mirror of
https://github.com/bramses/bramses-highly-opinionated-vault-2023.git
synced 2025-02-26 07:53:55 +00:00
2320 lines
349 KiB
JavaScript
2320 lines
349 KiB
JavaScript
/*
|
||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
if you want to view the source, please visit the github repository of this plugin
|
||
*/
|
||
|
||
var dp=Object.create;var Jn=Object.defineProperty;var Ea=Object.getOwnPropertyDescriptor;var fp=Object.getOwnPropertyNames;var hp=Object.getPrototypeOf,gp=Object.prototype.hasOwnProperty;var La=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_a=(e,t)=>{for(var n in t)Jn(e,n,{get:t[n],enumerable:!0})},Ba=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of fp(t))!gp.call(e,r)&&r!==n&&Jn(e,r,{get:()=>t[r],enumerable:!(i=Ea(t,r))||i.enumerable});return e};var Go=(e,t,n)=>(n=e!=null?dp(hp(e)):{},Ba(t||!e||!e.__esModule?Jn(n,"default",{value:e,enumerable:!0}):n,e)),yp=e=>Ba(Jn({},"__esModule",{value:!0}),e),O=(e,t,n,i)=>{for(var r=i>1?void 0:i?Ea(t,n):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(r=(i?s(t,n,r):s(r))||r);return i&&r&&Jn(t,n,r),r};var Ia=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Ue=(e,t,n)=>(Ia(e,t,"read from private field"),n?n.call(e):t.get(e)),On=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ma=(e,t,n,i)=>(Ia(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);var Ml=La((h0,Mn)=>{var _=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},X=-1,te=1,W=0;_.Diff=function(e,t){return[e,t]};_.prototype.diff_main=function(e,t,n,i){typeof i>"u"&&(this.Diff_Timeout<=0?i=Number.MAX_VALUE:i=new Date().getTime()+this.Diff_Timeout*1e3);var r=i;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new _.Diff(W,e)]:[];typeof n>"u"&&(n=!0);var o=n,s=this.diff_commonPrefix(e,t),a=e.substring(0,s);e=e.substring(s),t=t.substring(s),s=this.diff_commonSuffix(e,t);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),t=t.substring(0,t.length-s);var p=this.diff_compute_(e,t,o,r);return a&&p.unshift(new _.Diff(W,a)),l&&p.push(new _.Diff(W,l)),this.diff_cleanupMerge(p),p};_.prototype.diff_compute_=function(e,t,n,i){var r;if(!e)return[new _.Diff(te,t)];if(!t)return[new _.Diff(X,e)];var o=e.length>t.length?e:t,s=e.length>t.length?t:e,a=o.indexOf(s);if(a!=-1)return r=[new _.Diff(te,o.substring(0,a)),new _.Diff(W,s),new _.Diff(te,o.substring(a+s.length))],e.length>t.length&&(r[0][0]=r[2][0]=X),r;if(s.length==1)return[new _.Diff(X,e),new _.Diff(te,t)];var l=this.diff_halfMatch_(e,t);if(l){var p=l[0],u=l[1],m=l[2],c=l[3],f=l[4],h=this.diff_main(p,m,n,i),g=this.diff_main(u,c,n,i);return h.concat([new _.Diff(W,f)],g)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,i):this.diff_bisect_(e,t,i)};_.prototype.diff_lineMode_=function(e,t,n){var i=this.diff_linesToChars_(e,t);e=i.chars1,t=i.chars2;var r=i.lineArray,o=this.diff_main(e,t,!1,n);this.diff_charsToLines_(o,r),this.diff_cleanupSemantic(o),o.push(new _.Diff(W,""));for(var s=0,a=0,l=0,p="",u="";s<o.length;){switch(o[s][0]){case te:l++,u+=o[s][1];break;case X:a++,p+=o[s][1];break;case W:if(a>=1&&l>=1){o.splice(s-a-l,a+l),s=s-a-l;for(var m=this.diff_main(p,u,!1,n),c=m.length-1;c>=0;c--)o.splice(s,0,m[c]);s=s+m.length}l=0,a=0,p="",u="";break}s++}return o.pop(),o};_.prototype.diff_bisect_=function(e,t,n){for(var i=e.length,r=t.length,o=Math.ceil((i+r)/2),s=o,a=2*o,l=new Array(a),p=new Array(a),u=0;u<a;u++)l[u]=-1,p[u]=-1;l[s+1]=0,p[s+1]=0;for(var m=i-r,c=m%2!=0,f=0,h=0,g=0,w=0,y=0;y<o&&!(new Date().getTime()>n);y++){for(var E=-y+f;E<=y-h;E+=2){var A=s+E,L;E==-y||E!=y&&l[A-1]<l[A+1]?L=l[A+1]:L=l[A-1]+1;for(var M=L-E;L<i&&M<r&&e.charAt(L)==t.charAt(M);)L++,M++;if(l[A]=L,L>i)h+=2;else if(M>r)f+=2;else if(c){var T=s+m-E;if(T>=0&&T<a&&p[T]!=-1){var B=i-p[T];if(L>=B)return this.diff_bisectSplit_(e,t,L,M,n)}}}for(var I=-y+g;I<=y-w;I+=2){var T=s+I,B;I==-y||I!=y&&p[T-1]<p[T+1]?B=p[T+1]:B=p[T-1]+1;for(var P=B-I;B<i&&P<r&&e.charAt(i-B-1)==t.charAt(r-P-1);)B++,P++;if(p[T]=B,B>i)w+=2;else if(P>r)g+=2;else if(!c){var A=s+m-I;if(A>=0&&A<a&&l[A]!=-1){var L=l[A],M=s+L-A;if(B=i-B,L>=B)return this.diff_bisectSplit_(e,t,L,M,n)}}}}return[new _.Diff(X,e),new _.Diff(te,t)]};_.prototype.diff_bisectSplit_=function(e,t,n,i,r){var o=e.substring(0,n),s=t.substring(0,i),a=e.substring(n),l=t.substring(i),p=this.diff_main(o,s,!1,r),u=this.diff_main(a,l,!1,r);return p.concat(u)};_.prototype.diff_linesToChars_=function(e,t){var n=[],i={};n[0]="";function r(l){for(var p="",u=0,m=-1,c=n.length;m<l.length-1;){m=l.indexOf(`
|
||
`,u),m==-1&&(m=l.length-1);var f=l.substring(u,m+1);(i.hasOwnProperty?i.hasOwnProperty(f):i[f]!==void 0)?p+=String.fromCharCode(i[f]):(c==o&&(f=l.substring(u),m=l.length),p+=String.fromCharCode(c),i[f]=c,n[c++]=f),u=m+1}return p}var o=4e4,s=r(e);o=65535;var a=r(t);return{chars1:s,chars2:a,lineArray:n}};_.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var i=e[n][1],r=[],o=0;o<i.length;o++)r[o]=t[i.charCodeAt(o)];e[n][1]=r.join("")}};_.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,i=Math.min(e.length,t.length),r=i,o=0;n<r;)e.substring(o,r)==t.substring(o,r)?(n=r,o=n):i=r,r=Math.floor((i-n)/2+n);return r};_.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,i=Math.min(e.length,t.length),r=i,o=0;n<r;)e.substring(e.length-r,e.length-o)==t.substring(t.length-r,t.length-o)?(n=r,o=n):i=r,r=Math.floor((i-n)/2+n);return r};_.prototype.diff_commonOverlap_=function(e,t){var n=e.length,i=t.length;if(n==0||i==0)return 0;n>i?e=e.substring(n-i):n<i&&(t=t.substring(0,n));var r=Math.min(n,i);if(e==t)return r;for(var o=0,s=1;;){var a=e.substring(r-s),l=t.indexOf(a);if(l==-1)return o;s+=l,(l==0||e.substring(r-s)==t.substring(0,s))&&(o=s,s++)}};_.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,i=e.length>t.length?t:e;if(n.length<4||i.length*2<n.length)return null;var r=this;function o(h,g,w){for(var y=h.substring(w,w+Math.floor(h.length/4)),E=-1,A="",L,M,T,B;(E=g.indexOf(y,E+1))!=-1;){var I=r.diff_commonPrefix(h.substring(w),g.substring(E)),P=r.diff_commonSuffix(h.substring(0,w),g.substring(0,E));A.length<P+I&&(A=g.substring(E-P,E)+g.substring(E,E+I),L=h.substring(0,w-P),M=h.substring(w+I),T=g.substring(0,E-P),B=g.substring(E+I))}return A.length*2>=h.length?[L,M,T,B,A]:null}var s=o(n,i,Math.ceil(n.length/4)),a=o(n,i,Math.ceil(n.length/2)),l;if(!s&&!a)return null;a?s?l=s[4].length>a[4].length?s:a:l=a:l=s;var p,u,m,c;e.length>t.length?(p=l[0],u=l[1],m=l[2],c=l[3]):(m=l[0],c=l[1],p=l[2],u=l[3]);var f=l[4];return[p,u,m,c,f]};_.prototype.diff_cleanupSemantic=function(e){for(var t=!1,n=[],i=0,r=null,o=0,s=0,a=0,l=0,p=0;o<e.length;)e[o][0]==W?(n[i++]=o,s=l,a=p,l=0,p=0,r=e[o][1]):(e[o][0]==te?l+=e[o][1].length:p+=e[o][1].length,r&&r.length<=Math.max(s,a)&&r.length<=Math.max(l,p)&&(e.splice(n[i-1],0,new _.Diff(X,r)),e[n[i-1]+1][0]=te,i--,i--,o=i>0?n[i-1]:-1,s=0,a=0,l=0,p=0,r=null,t=!0)),o++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o<e.length;){if(e[o-1][0]==X&&e[o][0]==te){var u=e[o-1][1],m=e[o][1],c=this.diff_commonOverlap_(u,m),f=this.diff_commonOverlap_(m,u);c>=f?(c>=u.length/2||c>=m.length/2)&&(e.splice(o,0,new _.Diff(W,m.substring(0,c))),e[o-1][1]=u.substring(0,u.length-c),e[o+1][1]=m.substring(c),o++):(f>=u.length/2||f>=m.length/2)&&(e.splice(o,0,new _.Diff(W,u.substring(0,f))),e[o-1][0]=te,e[o-1][1]=m.substring(0,m.length-f),e[o+1][0]=X,e[o+1][1]=u.substring(f),o++),o++}o++}};_.prototype.diff_cleanupSemanticLossless=function(e){function t(f,h){if(!f||!h)return 6;var g=f.charAt(f.length-1),w=h.charAt(0),y=g.match(_.nonAlphaNumericRegex_),E=w.match(_.nonAlphaNumericRegex_),A=y&&g.match(_.whitespaceRegex_),L=E&&w.match(_.whitespaceRegex_),M=A&&g.match(_.linebreakRegex_),T=L&&w.match(_.linebreakRegex_),B=M&&f.match(_.blanklineEndRegex_),I=T&&h.match(_.blanklineStartRegex_);return B||I?5:M||T?4:y&&!A&&L?3:A||L?2:y||E?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==W&&e[n+1][0]==W){var i=e[n-1][1],r=e[n][1],o=e[n+1][1],s=this.diff_commonSuffix(i,r);if(s){var a=r.substring(r.length-s);i=i.substring(0,i.length-s),r=a+r.substring(0,r.length-s),o=a+o}for(var l=i,p=r,u=o,m=t(i,r)+t(r,o);r.charAt(0)===o.charAt(0);){i+=r.charAt(0),r=r.substring(1)+o.charAt(0),o=o.substring(1);var c=t(i,r)+t(r,o);c>=m&&(m=c,l=i,p=r,u=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=p,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}};_.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;_.whitespaceRegex_=/\s/;_.linebreakRegex_=/[\r\n]/;_.blanklineEndRegex_=/\n\r?\n$/;_.blanklineStartRegex_=/^\r?\n\r?\n/;_.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,n=[],i=0,r=null,o=0,s=!1,a=!1,l=!1,p=!1;o<e.length;)e[o][0]==W?(e[o][1].length<this.Diff_EditCost&&(l||p)?(n[i++]=o,s=l,a=p,r=e[o][1]):(i=0,r=null),l=p=!1):(e[o][0]==X?p=!0:l=!0,r&&(s&&a&&l&&p||r.length<this.Diff_EditCost/2&&s+a+l+p==3)&&(e.splice(n[i-1],0,new _.Diff(X,r)),e[n[i-1]+1][0]=te,i--,r=null,s&&a?(l=p=!0,i=0):(i--,o=i>0?n[i-1]:-1,l=p=!1),t=!0)),o++;t&&this.diff_cleanupMerge(e)};_.prototype.diff_cleanupMerge=function(e){e.push(new _.Diff(W,""));for(var t=0,n=0,i=0,r="",o="",s;t<e.length;)switch(e[t][0]){case te:i++,o+=e[t][1],t++;break;case X:n++,r+=e[t][1],t++;break;case W:n+i>1?(n!==0&&i!==0&&(s=this.diff_commonPrefix(o,r),s!==0&&(t-n-i>0&&e[t-n-i-1][0]==W?e[t-n-i-1][1]+=o.substring(0,s):(e.splice(0,0,new _.Diff(W,o.substring(0,s))),t++),o=o.substring(s),r=r.substring(s)),s=this.diff_commonSuffix(o,r),s!==0&&(e[t][1]=o.substring(o.length-s)+e[t][1],o=o.substring(0,o.length-s),r=r.substring(0,r.length-s))),t-=n+i,e.splice(t,n+i),r.length&&(e.splice(t,0,new _.Diff(X,r)),t++),o.length&&(e.splice(t,0,new _.Diff(te,o)),t++),t++):t!==0&&e[t-1][0]==W?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,i=0,n=0,r="",o="";break}e[e.length-1][1]===""&&e.pop();var a=!1;for(t=1;t<e.length-1;)e[t-1][0]==W&&e[t+1][0]==W&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),a=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),a=!0)),t++;a&&this.diff_cleanupMerge(e)};_.prototype.diff_xIndex=function(e,t){var n=0,i=0,r=0,o=0,s;for(s=0;s<e.length&&(e[s][0]!==te&&(n+=e[s][1].length),e[s][0]!==X&&(i+=e[s][1].length),!(n>t));s++)r=n,o=i;return e.length!=s&&e[s][0]===X?o:o+(t-r)};_.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,i=/</g,r=/>/g,o=/\n/g,s=0;s<e.length;s++){var a=e[s][0],l=e[s][1],p=l.replace(n,"&").replace(i,"<").replace(r,">").replace(o,"¶<br>");switch(a){case te:t[s]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case X:t[s]='<del style="background:#ffe6e6;">'+p+"</del>";break;case W:t[s]="<span>"+p+"</span>";break}}return t.join("")};_.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==te&&(t[n]=e[n][1]);return t.join("")};_.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==X&&(t[n]=e[n][1]);return t.join("")};_.prototype.diff_levenshtein=function(e){for(var t=0,n=0,i=0,r=0;r<e.length;r++){var o=e[r][0],s=e[r][1];switch(o){case te:n+=s.length;break;case X:i+=s.length;break;case W:t+=Math.max(n,i),n=0,i=0;break}}return t+=Math.max(n,i),t};_.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case te:t[n]="+"+encodeURI(e[n][1]);break;case X:t[n]="-"+e[n][1].length;break;case W:t[n]="="+e[n][1].length;break}return t.join(" ").replace(/%20/g," ")};_.prototype.diff_fromDelta=function(e,t){for(var n=[],i=0,r=0,o=t.split(/\t/g),s=0;s<o.length;s++){var a=o[s].substring(1);switch(o[s].charAt(0)){case"+":try{n[i++]=new _.Diff(te,decodeURI(a))}catch{throw new Error("Illegal escape in diff_fromDelta: "+a)}break;case"-":case"=":var l=parseInt(a,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+a);var p=e.substring(r,r+=l);o[s].charAt(0)=="="?n[i++]=new _.Diff(W,p):n[i++]=new _.Diff(X,p);break;default:if(o[s])throw new Error("Invalid diff operation in diff_fromDelta: "+o[s])}}if(r!=e.length)throw new Error("Delta length ("+r+") does not equal source text length ("+e.length+").");return n};_.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1};_.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(t),r=this;function o(L,M){var T=L/t.length,B=Math.abs(n-M);return r.Match_Distance?T+B/r.Match_Distance:B?1:T}var s=this.Match_Threshold,a=e.indexOf(t,n);a!=-1&&(s=Math.min(o(0,a),s),a=e.lastIndexOf(t,n+t.length),a!=-1&&(s=Math.min(o(0,a),s)));var l=1<<t.length-1;a=-1;for(var p,u,m=t.length+e.length,c,f=0;f<t.length;f++){for(p=0,u=m;p<u;)o(f,n+u)<=s?p=u:m=u,u=Math.floor((m-p)/2+p);m=u;var h=Math.max(1,n-u+1),g=Math.min(n+u,e.length)+t.length,w=Array(g+2);w[g+1]=(1<<f)-1;for(var y=g;y>=h;y--){var E=i[e.charAt(y-1)];if(f===0?w[y]=(w[y+1]<<1|1)&E:w[y]=(w[y+1]<<1|1)&E|((c[y+1]|c[y])<<1|1)|c[y+1],w[y]&l){var A=o(f,y-1);if(A<=s)if(s=A,a=y-1,a>n)h=Math.max(1,2*n-a);else break}}if(o(f+1,n)>s)break;c=w}return a};_.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t};_.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error("patch not initialized");for(var n=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(n)!=t.lastIndexOf(n)&&n.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,n=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var r=t.substring(e.start2-i,e.start2);r&&e.diffs.unshift(new _.Diff(W,r));var o=t.substring(e.start2+e.length1,e.start2+e.length1+i);o&&e.diffs.push(new _.Diff(W,o)),e.start1-=r.length,e.start2-=r.length,e.length1+=r.length+o.length,e.length2+=r.length+o.length}};_.prototype.patch_make=function(e,t,n){var i,r;if(typeof e=="string"&&typeof t=="string"&&typeof n>"u")i=e,r=this.diff_main(i,t,!0),r.length>2&&(this.diff_cleanupSemantic(r),this.diff_cleanupEfficiency(r));else if(e&&typeof e=="object"&&typeof t>"u"&&typeof n>"u")r=e,i=this.diff_text1(r);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof n>"u")i=e,r=t;else if(typeof e=="string"&&typeof t=="string"&&n&&typeof n=="object")i=e,r=n;else throw new Error("Unknown call format to patch_make.");if(r.length===0)return[];for(var o=[],s=new _.patch_obj,a=0,l=0,p=0,u=i,m=i,c=0;c<r.length;c++){var f=r[c][0],h=r[c][1];switch(!a&&f!==W&&(s.start1=l,s.start2=p),f){case te:s.diffs[a++]=r[c],s.length2+=h.length,m=m.substring(0,p)+h+m.substring(p);break;case X:s.length1+=h.length,s.diffs[a++]=r[c],m=m.substring(0,p)+m.substring(p+h.length);break;case W:h.length<=2*this.Patch_Margin&&a&&r.length!=c+1?(s.diffs[a++]=r[c],s.length1+=h.length,s.length2+=h.length):h.length>=2*this.Patch_Margin&&a&&(this.patch_addContext_(s,u),o.push(s),s=new _.patch_obj,a=0,u=m,l=p);break}f!==te&&(l+=h.length),f!==X&&(p+=h.length)}return a&&(this.patch_addContext_(s,u),o.push(s)),o};_.prototype.patch_deepCopy=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=new _.patch_obj;r.diffs=[];for(var o=0;o<i.diffs.length;o++)r.diffs[o]=new _.Diff(i.diffs[o][0],i.diffs[o][1]);r.start1=i.start1,r.start2=i.start2,r.length1=i.length1,r.length2=i.length2,t[n]=r}return t};_.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var i=0,r=[],o=0;o<e.length;o++){var s=e[o].start2+i,a=this.diff_text1(e[o].diffs),l,p=-1;if(a.length>this.Match_MaxBits?(l=this.match_main(t,a.substring(0,this.Match_MaxBits),s),l!=-1&&(p=this.match_main(t,a.substring(a.length-this.Match_MaxBits),s+a.length-this.Match_MaxBits),(p==-1||l>=p)&&(l=-1))):l=this.match_main(t,a,s),l==-1)r[o]=!1,i-=e[o].length2-e[o].length1;else{r[o]=!0,i=l-s;var u;if(p==-1?u=t.substring(l,l+a.length):u=t.substring(l,p+this.Match_MaxBits),a==u)t=t.substring(0,l)+this.diff_text2(e[o].diffs)+t.substring(l+a.length);else{var m=this.diff_main(a,u,!1);if(a.length>this.Match_MaxBits&&this.diff_levenshtein(m)/a.length>this.Patch_DeleteThreshold)r[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var c=0,f,h=0;h<e[o].diffs.length;h++){var g=e[o].diffs[h];g[0]!==W&&(f=this.diff_xIndex(m,c)),g[0]===te?t=t.substring(0,l+f)+g[1]+t.substring(l+f):g[0]===X&&(t=t.substring(0,l+f)+t.substring(l+this.diff_xIndex(m,c+g[1].length))),g[0]!==X&&(c+=g[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,r]};_.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,n="",i=1;i<=t;i++)n+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var r=e[0],o=r.diffs;if(o.length==0||o[0][0]!=W)o.unshift(new _.Diff(W,n)),r.start1-=t,r.start2-=t,r.length1+=t,r.length2+=t;else if(t>o[0][1].length){var s=t-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],r.start1-=s,r.start2-=s,r.length1+=s,r.length2+=s}if(r=e[e.length-1],o=r.diffs,o.length==0||o[o.length-1][0]!=W)o.push(new _.Diff(W,n)),r.length1+=t,r.length2+=t;else if(t>o[o.length-1][1].length){var s=t-o[o.length-1][1].length;o[o.length-1][1]+=n.substring(0,s),r.length1+=s,r.length2+=s}return n};_.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n<e.length;n++)if(!(e[n].length1<=t)){var i=e[n];e.splice(n--,1);for(var r=i.start1,o=i.start2,s="";i.diffs.length!==0;){var a=new _.patch_obj,l=!0;for(a.start1=r-s.length,a.start2=o-s.length,s!==""&&(a.length1=a.length2=s.length,a.diffs.push(new _.Diff(W,s)));i.diffs.length!==0&&a.length1<t-this.Patch_Margin;){var p=i.diffs[0][0],u=i.diffs[0][1];p===te?(a.length2+=u.length,o+=u.length,a.diffs.push(i.diffs.shift()),l=!1):p===X&&a.diffs.length==1&&a.diffs[0][0]==W&&u.length>2*t?(a.length1+=u.length,r+=u.length,l=!1,a.diffs.push(new _.Diff(p,u)),i.diffs.shift()):(u=u.substring(0,t-a.length1-this.Patch_Margin),a.length1+=u.length,r+=u.length,p===W?(a.length2+=u.length,o+=u.length):l=!1,a.diffs.push(new _.Diff(p,u)),u==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(u.length))}s=this.diff_text2(a.diffs),s=s.substring(s.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(a.length1+=m.length,a.length2+=m.length,a.diffs.length!==0&&a.diffs[a.diffs.length-1][0]===W?a.diffs[a.diffs.length-1][1]+=m:a.diffs.push(new _.Diff(W,m))),l||e.splice(++n,0,a)}}};_.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")};_.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var n=e.split(`
|
||
`),i=0,r=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<n.length;){var o=n[i].match(r);if(!o)throw new Error("Invalid patch string: "+n[i]);var s=new _.patch_obj;for(t.push(s),s.start1=parseInt(o[1],10),o[2]===""?(s.start1--,s.length1=1):o[2]=="0"?s.length1=0:(s.start1--,s.length1=parseInt(o[2],10)),s.start2=parseInt(o[3],10),o[4]===""?(s.start2--,s.length2=1):o[4]=="0"?s.length2=0:(s.start2--,s.length2=parseInt(o[4],10)),i++;i<n.length;){var a=n[i].charAt(0);try{var l=decodeURI(n[i].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(a=="-")s.diffs.push(new _.Diff(X,l));else if(a=="+")s.diffs.push(new _.Diff(te,l));else if(a==" ")s.diffs.push(new _.Diff(W,l));else{if(a=="@")break;if(a!=="")throw new Error('Invalid patch mode "'+a+'" in: '+l)}i++}}return t};_.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0};_.patch_obj.prototype.toString=function(){var e,t;this.length1===0?e=this.start1+",0":this.length1==1?e=this.start1+1:e=this.start1+1+","+this.length1,this.length2===0?t=this.start2+",0":this.length2==1?t=this.start2+1:t=this.start2+1+","+this.length2;for(var n=["@@ -"+e+" +"+t+` @@
|
||
`],i,r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case te:i="+";break;case X:i="-";break;case W:i=" ";break}n[r+1]=i+encodeURI(this.diffs[r][1])+`
|
||
`}return n.join("").replace(/%20/g," ")};Mn.exports=_;Mn.exports.diff_match_patch=_;Mn.exports.DIFF_DELETE=X;Mn.exports.DIFF_INSERT=te;Mn.exports.DIFF_EQUAL=W});var gs=La((Fl,Zr)=>{(function(e,t){"use strict";typeof define=="function"&&define.amd?define(t):typeof Zr=="object"&&Zr.exports?Zr.exports=t():e.log=t()})(Fl,function(){"use strict";var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function r(h,g){var w=h[g];if(typeof w.bind=="function")return w.bind(h);try{return Function.prototype.bind.call(w,h)}catch{return function(){return Function.prototype.apply.apply(w,[h,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(h){return h==="debug"&&(h="log"),typeof console===t?!1:h==="trace"&&n?o:console[h]!==void 0?r(console,h):console.log!==void 0?r(console,"log"):e}function a(h,g){for(var w=0;w<i.length;w++){var y=i[w];this[y]=w<h?e:this.methodFactory(y,h,g)}this.log=this.debug}function l(h,g,w){return function(){typeof console!==t&&(a.call(this,g,w),this[h].apply(this,arguments))}}function p(h,g,w){return s(h)||l.apply(this,arguments)}function u(h,g,w){var y=this,E;g=g??"WARN";var A="loglevel";typeof h=="string"?A+=":"+h:typeof h=="symbol"&&(A=void 0);function L(I){var P=(i[I]||"silent").toUpperCase();if(!(typeof window===t||!A)){try{window.localStorage[A]=P;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+P+";"}catch{}}}function M(){var I;if(!(typeof window===t||!A)){try{I=window.localStorage[A]}catch{}if(typeof I===t)try{var P=window.document.cookie,K=P.indexOf(encodeURIComponent(A)+"=");K!==-1&&(I=/^([^;]+)/.exec(P.slice(K))[1])}catch{}return y.levels[I]===void 0&&(I=void 0),I}}function T(){if(!(typeof window===t||!A)){try{window.localStorage.removeItem(A);return}catch{}try{window.document.cookie=encodeURIComponent(A)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}y.name=h,y.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},y.methodFactory=w||p,y.getLevel=function(){return E},y.setLevel=function(I,P){if(typeof I=="string"&&y.levels[I.toUpperCase()]!==void 0&&(I=y.levels[I.toUpperCase()]),typeof I=="number"&&I>=0&&I<=y.levels.SILENT){if(E=I,P!==!1&&L(I),a.call(y,I,h),typeof console===t&&I<y.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+I},y.setDefaultLevel=function(I){g=I,M()||y.setLevel(I,!1)},y.resetLevel=function(){y.setLevel(g,!1),T()},y.enableAll=function(I){y.setLevel(y.levels.TRACE,I)},y.disableAll=function(I){y.setLevel(y.levels.SILENT,I)};var B=M();B==null&&(B=g),y.setLevel(B,!1)}var m=new u,c={};m.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var w=c[g];return w||(w=c[g]=new u(g,m.getLevel(),m.methodFactory)),w};var f=typeof window!==t?window.log:void 0;return m.noConflict=function(){return typeof window!==t&&window.log===m&&(window.log=f),m},m.getLoggers=function(){return c},m.default=m,m})});var Yg={};_a(Yg,{default:()=>Vo});module.exports=yp(Yg);var oe=require("obsidian");function Ga(e){return typeof e>"u"||e===null}function bp(e){return typeof e=="object"&&e!==null}function wp(e){return Array.isArray(e)?e:Ga(e)?[]:[e]}function xp(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function vp(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function kp(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sp=Ga,Tp=bp,Op=wp,Ap=vp,Cp=kp,Ep=xp,ge={isNothing:Sp,isObject:Tp,toArray:Op,repeat:Ap,isNegativeZero:Cp,extend:Ep};function Za(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
||
|
||
`+e.mark.snippet),i+" "+n):i}function ti(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Za(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ti.prototype=Object.create(Error.prototype);ti.prototype.constructor=ti;ti.prototype.toString=function(t){return this.name+": "+Za(this,t)};var Ne=ti;function Zo(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Qo(e,t){return ge.repeat(" ",t-e.length)+e}function Lp(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,p,u=Math.min(e.line+t.linesAfter,r.length).toString().length,m=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)p=Zo(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),m),a=ge.repeat(" ",t.indent)+Qo((e.line-l+1).toString(),u)+" | "+p.str+`
|
||
`+a;for(p=Zo(e.buffer,i[s],r[s],e.position,m),a+=ge.repeat(" ",t.indent)+Qo((e.line+1).toString(),u)+" | "+p.str+`
|
||
`,a+=ge.repeat("-",t.indent+u+3+p.pos)+`^
|
||
`,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)p=Zo(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),m),a+=ge.repeat(" ",t.indent)+Qo((e.line+l+1).toString(),u)+" | "+p.str+`
|
||
`;return a.replace(/\n$/,"")}var _p=Lp,Bp=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ip=["scalar","sequence","mapping"];function Mp(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Fp(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Bp.indexOf(n)===-1)throw new Ne('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Mp(t.styleAliases||null),Ip.indexOf(this.kind)===-1)throw new Ne('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Fe=Fp;function Fa(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Rp(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function Jo(e){return this.extend(e)}Jo.prototype.extend=function(t){var n=[],i=[];if(t instanceof Fe)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new Ne("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof Fe))throw new Ne("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Ne("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Ne("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof Fe))throw new Ne("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Jo.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Fa(r,"implicit"),r.compiledExplicit=Fa(r,"explicit"),r.compiledTypeMap=Rp(r.compiledImplicit,r.compiledExplicit),r};var Dp=Jo,$p=new Fe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Pp=new Fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Np=new Fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Hp=new Dp({explicit:[$p,Pp,Np]});function zp(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Yp(){return null}function qp(e){return e===null}var Kp=new Fe("tag:yaml.org,2002:null",{kind:"scalar",resolve:zp,construct:Yp,predicate:qp,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vp(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function jp(e){return e==="true"||e==="True"||e==="TRUE"}function Wp(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Up=new Fe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vp,construct:jp,predicate:Wp,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Gp(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Zp(e){return 48<=e&&e<=55}function Qp(e){return 48<=e&&e<=57}function Xp(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Gp(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Zp(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!Qp(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function Jp(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function ec(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var tc=new Fe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xp,construct:Jp,predicate:ec,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),nc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ic(e){return!(e===null||!nc.test(e)||e[e.length-1]==="_")}function rc(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var oc=/^[-+]?[0-9]+e/;function sc(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),oc.test(n)?n.replace("e",".e"):n}function ac(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var lc=new Fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:ic,construct:rc,predicate:ac,represent:sc,defaultStyle:"lowercase"}),uc=Hp.extend({implicit:[Kp,Up,tc,lc]}),pc=uc,Qa=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Xa=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function cc(e){return e===null?!1:Qa.exec(e)!==null||Xa.exec(e)!==null}function mc(e){var t,n,i,r,o,s,a,l=0,p=null,u,m,c;if(t=Qa.exec(e),t===null&&(t=Xa.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],m=+(t[11]||0),p=(u*60+m)*6e4,t[9]==="-"&&(p=-p)),c=new Date(Date.UTC(n,i,r,o,s,a,l)),p&&c.setTime(c.getTime()-p),c}function dc(e){return e.toISOString()}var fc=new Fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:cc,construct:mc,instanceOf:Date,represent:dc});function hc(e){return e==="<<"||e===null}var gc=new Fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hc}),rs=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
||
\r`;function yc(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=rs;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function bc(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=rs,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function wc(e){var t="",n=0,i,r,o=e.length,s=rs;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function xc(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var vc=new Fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yc,construct:bc,predicate:xc,represent:wc}),kc=Object.prototype.hasOwnProperty,Sc=Object.prototype.toString;function Tc(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,Sc.call(r)!=="[object Object]")return!1;for(o in r)if(kc.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function Oc(e){return e!==null?e:[]}var Ac=new Fe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Tc,construct:Oc}),Cc=Object.prototype.toString;function Ec(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],Cc.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function Lc(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var _c=new Fe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ec,construct:Lc}),Bc=Object.prototype.hasOwnProperty;function Ic(e){if(e===null)return!0;var t,n=e;for(t in n)if(Bc.call(n,t)&&n[t]!==null)return!1;return!0}function Mc(e){return e!==null?e:{}}var Fc=new Fe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ic,construct:Mc}),Ja=pc.extend({implicit:[fc,gc],explicit:[vc,Ac,_c,Fc]}),Mt=Object.prototype.hasOwnProperty,Lr=1,el=2,tl=3,_r=4,Xo=1,Rc=2,Ra=3,Dc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,$c=/[\x85\u2028\u2029]/,Pc=/[,\[\]\{\}]/,nl=/^(?:!|!!|![a-z\-]+!)$/i,il=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Da(e){return Object.prototype.toString.call(e)}function ft(e){return e===10||e===13}function jt(e){return e===9||e===32}function je(e){return e===9||e===32||e===10||e===13}function Cn(e){return e===44||e===91||e===93||e===123||e===125}function Nc(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Hc(e){return e===120?2:e===117?4:e===85?8:0}function zc(e){return 48<=e&&e<=57?e-48:-1}function $a(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 Yc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var rl=new Array(256),ol=new Array(256);for(Vt=0;Vt<256;Vt++)rl[Vt]=$a(Vt)?1:0,ol[Vt]=$a(Vt);var Vt;function qc(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ja,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.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 sl(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=_p(n),new Ne(t,n)}function H(e,t){throw sl(e,t)}function Br(e,t){e.onWarning&&e.onWarning.call(null,sl(e,t))}var Pa={YAML:function(t,n,i){var r,o,s;t.version!==null&&H(t,"duplication of %YAML directive"),i.length!==1&&H(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&H(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&H(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Br(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&H(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],nl.test(r)||H(t,"ill-formed tag handle (first argument) of the TAG directive"),Mt.call(t.tagMap,r)&&H(t,'there is a previously declared suffix for "'+r+'" tag handle'),il.test(o)||H(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{H(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function It(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||H(e,"expected valid JSON character");else Dc.test(a)&&H(e,"the stream contains non-printable characters");e.result+=a}}function Na(e,t,n,i){var r,o,s,a;for(ge.isObject(n)||H(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],Mt.call(t,o)||(t[o]=n[o],i[o]=!0)}function En(e,t,n,i,r,o,s,a,l){var p,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),p=0,u=r.length;p<u;p+=1)Array.isArray(r[p])&&H(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Da(r[p])==="[object Object]"&&(r[p]="[object Object]");if(typeof r=="object"&&Da(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(p=0,u=o.length;p<u;p+=1)Na(e,t,o[p],n);else Na(e,t,o,n);else!e.json&&!Mt.call(n,r)&&Mt.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,H(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[r]=o,delete n[r];return t}function os(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):H(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function fe(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;jt(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(ft(r))for(os(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&Br(e,"deficient indentation"),i}function Fr(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||je(n)))}function ss(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
|
||
`,t-1))}function Kc(e,t,n){var i,r,o,s,a,l,p,u,m=e.kind,c=e.result,f;if(f=e.input.charCodeAt(e.position),je(f)||Cn(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(r=e.input.charCodeAt(e.position+1),je(r)||n&&Cn(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;f!==0;){if(f===58){if(r=e.input.charCodeAt(e.position+1),je(r)||n&&Cn(r))break}else if(f===35){if(i=e.input.charCodeAt(e.position-1),je(i))break}else{if(e.position===e.lineStart&&Fr(e)||n&&Cn(f))break;if(ft(f))if(l=e.line,p=e.lineStart,u=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){a=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=p,e.lineIndent=u;break}}a&&(It(e,o,s,!1),ss(e,e.line-l),o=s=e.position,a=!1),jt(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return It(e,o,s,!1),e.result?!0:(e.kind=m,e.result=c,!1)}function Vc(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(It(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else ft(n)?(It(e,i,r,!0),ss(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Fr(e)?H(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);H(e,"unexpected end of the stream within a single quoted scalar")}function jc(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return It(e,n,e.position,!0),e.position++,!0;if(a===92){if(It(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ft(a))fe(e,!1,t);else if(a<256&&rl[a])e.result+=ol[a],e.position++;else if((s=Hc(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=Nc(a))>=0?o=(o<<4)+s:H(e,"expected hexadecimal character");e.result+=Yc(o),e.position++}else H(e,"unknown escape sequence");n=i=e.position}else ft(a)?(It(e,n,i,!0),ss(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Fr(e)?H(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}H(e,"unexpected end of the stream within a double quoted scalar")}function Wc(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,p,u,m,c,f,h=Object.create(null),g,w,y,E;if(E=e.input.charCodeAt(e.position),E===91)u=93,f=!1,a=[];else if(E===123)u=125,f=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(fe(e,!0,t),E=e.input.charCodeAt(e.position),E===u)return e.position++,e.tag=s,e.anchor=l,e.kind=f?"mapping":"sequence",e.result=a,!0;n?E===44&&H(e,"expected the node content, but found ','"):H(e,"missed comma between flow collection entries"),w=g=y=null,m=c=!1,E===63&&(p=e.input.charCodeAt(e.position+1),je(p)&&(m=c=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,Ln(e,t,Lr,!1,!0),w=e.tag,g=e.result,fe(e,!0,t),E=e.input.charCodeAt(e.position),(c||e.line===i)&&E===58&&(m=!0,E=e.input.charCodeAt(++e.position),fe(e,!0,t),Ln(e,t,Lr,!1,!0),y=e.result),f?En(e,a,h,w,g,y,i,r,o):m?a.push(En(e,null,h,w,g,y,i,r,o)):a.push(g),fe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}H(e,"unexpected end of the stream within a flow collection")}function Uc(e,t){var n,i,r=Xo,o=!1,s=!1,a=t,l=0,p=!1,u,m;if(m=e.input.charCodeAt(e.position),m===124)i=!1;else if(m===62)i=!0;else return!1;for(e.kind="scalar",e.result="";m!==0;)if(m=e.input.charCodeAt(++e.position),m===43||m===45)Xo===r?r=m===43?Ra:Rc:H(e,"repeat of a chomping mode identifier");else if((u=zc(m))>=0)u===0?H(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?H(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(jt(m)){do m=e.input.charCodeAt(++e.position);while(jt(m));if(m===35)do m=e.input.charCodeAt(++e.position);while(!ft(m)&&m!==0)}for(;m!==0;){for(os(e),e.lineIndent=0,m=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&m===32;)e.lineIndent++,m=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),ft(m)){l++;continue}if(e.lineIndent<a){r===Ra?e.result+=ge.repeat(`
|
||
`,o?1+l:l):r===Xo&&o&&(e.result+=`
|
||
`);break}for(i?jt(m)?(p=!0,e.result+=ge.repeat(`
|
||
`,o?1+l:l)):p?(p=!1,e.result+=ge.repeat(`
|
||
`,l+1)):l===0?o&&(e.result+=" "):e.result+=ge.repeat(`
|
||
`,l):e.result+=ge.repeat(`
|
||
`,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!ft(m)&&m!==0;)m=e.input.charCodeAt(++e.position);It(e,n,e.position,!1)}return!0}function Ha(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!je(s))));){if(a=!0,e.position++,fe(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Ln(e,t,tl,!1,!0),o.push(e.result),fe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)H(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function Gc(e,t,n){var i,r,o,s,a,l,p=e.tag,u=e.anchor,m={},c=Object.create(null),f=null,h=null,g=null,w=!1,y=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=m),E=e.input.charCodeAt(e.position);E!==0;){if(!w&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(E===63||E===58)&&je(i))E===63?(w&&(En(e,m,c,f,h,null,s,a,l),f=h=g=null),y=!0,w=!0,r=!0):w?(w=!1,r=!0):H(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=i;else{if(s=e.line,a=e.lineStart,l=e.position,!Ln(e,n,el,!1,!0))break;if(e.line===o){for(E=e.input.charCodeAt(e.position);jt(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),je(E)||H(e,"a whitespace character is expected after the key-value separator within a block mapping"),w&&(En(e,m,c,f,h,null,s,a,l),f=h=g=null),y=!0,w=!1,r=!1,f=e.tag,h=e.result;else if(y)H(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=p,e.anchor=u,!0}else if(y)H(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=p,e.anchor=u,!0}if((e.line===o||e.lineIndent>t)&&(w&&(s=e.line,a=e.lineStart,l=e.position),Ln(e,t,_r,!0,r)&&(w?h=e.result:g=e.result),w||(En(e,m,c,f,h,g,s,a,l),f=h=g=null),fe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&E!==0)H(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return w&&En(e,m,c,f,h,null,s,a,l),y&&(e.tag=p,e.anchor=u,e.kind="mapping",e.result=m),y}function Zc(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&H(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):H(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!je(s);)s===33&&(i?H(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),nl.test(r)||H(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),Pc.test(o)&&H(e,"tag suffix cannot contain flow indicator characters")}o&&!il.test(o)&&H(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{H(e,"tag name is malformed: "+o)}return n?e.tag=o:Mt.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:H(e,'undeclared tag handle "'+r+'"'),!0}function Qc(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&H(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!je(n)&&!Cn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&H(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Xc(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!je(i)&&!Cn(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&H(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Mt.call(e.anchorMap,n)||H(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],fe(e,!0,-1),!0}function Ln(e,t,n,i,r){var o,s,a,l=1,p=!1,u=!1,m,c,f,h,g,w;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=_r===n||tl===n,i&&fe(e,!0,-1)&&(p=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Zc(e)||Qc(e);)fe(e,!0,-1)?(p=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=p||r),(l===1||_r===n)&&(Lr===n||el===n?g=t:g=t+1,w=e.position-e.lineStart,l===1?a&&(Ha(e,w)||Gc(e,w,g))||Wc(e,g)?u=!0:(s&&Uc(e,g)||Vc(e,g)||jc(e,g)?u=!0:Xc(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&H(e,"alias node should not have any properties")):Kc(e,g,Lr===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&Ha(e,w))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&H(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),m=0,c=e.implicitTypes.length;m<c;m+=1)if(h=e.implicitTypes[m],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Mt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,f=e.typeMap.multi[e.kind||"fallback"],m=0,c=f.length;m<c;m+=1)if(e.tag.slice(0,f[m].tag.length)===f[m].tag){h=f[m];break}h||H(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&H(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):H(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Jc(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(fe(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!je(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&H(e,"directive name must not be less than one character in length");s!==0;){for(;jt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!ft(s));break}if(ft(s))break;for(n=e.position;s!==0&&!je(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&os(e),Mt.call(Pa,i)?Pa[i](e,i,r):Br(e,'unknown document directive "'+i+'"')}if(fe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,fe(e,!0,-1)):o&&H(e,"directives end mark is expected"),Ln(e,e.lineIndent-1,_r,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&$c.test(e.input.slice(t,e.position))&&Br(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Fr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(e,!0,-1));return}if(e.position<e.length-1)H(e,"end of the stream or a document separator is expected");else return}function al(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
||
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new qc(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,H(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Jc(n);return n.documents}function em(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var i=al(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function tm(e,t){var n=al(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ne("expected a single document in the stream, but found more")}}var nm=em,im=tm,ll={loadAll:nm,load:im},ul=Object.prototype.toString,pl=Object.prototype.hasOwnProperty,as=65279,rm=9,ni=10,om=13,sm=32,am=33,lm=34,es=35,um=37,pm=38,cm=39,mm=42,cl=44,dm=45,Ir=58,fm=61,hm=62,gm=63,ym=64,ml=91,dl=93,bm=96,fl=123,wm=124,hl=125,Re={};Re[0]="\\0";Re[7]="\\a";Re[8]="\\b";Re[9]="\\t";Re[10]="\\n";Re[11]="\\v";Re[12]="\\f";Re[13]="\\r";Re[27]="\\e";Re[34]='\\"';Re[92]="\\\\";Re[133]="\\N";Re[160]="\\_";Re[8232]="\\L";Re[8233]="\\P";var xm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],vm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function km(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&pl.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function Sm(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new Ne("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",i-t.length)+t}var Tm=1,ii=2;function Om(e){this.schema=e.schema||Ja,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=km(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==='"'?ii:Tm,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 za(e,t){for(var n=ge.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
|
||
`,i),r===-1?(s=e.slice(i),i=a):(s=e.slice(i,r+1),i=r+1),s.length&&s!==`
|
||
`&&(o+=n),o+=s;return o}function ts(e,t){return`
|
||
`+ge.repeat(" ",e.indent*t)}function Am(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Mr(e){return e===sm||e===rm}function ri(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==as||65536<=e&&e<=1114111}function Ya(e){return ri(e)&&e!==as&&e!==om&&e!==ni}function qa(e,t,n){var i=Ya(e),r=i&&!Mr(e);return(n?i:i&&e!==cl&&e!==ml&&e!==dl&&e!==fl&&e!==hl)&&e!==es&&!(t===Ir&&!r)||Ya(t)&&!Mr(t)&&e===es||t===Ir&&r}function Cm(e){return ri(e)&&e!==as&&!Mr(e)&&e!==dm&&e!==gm&&e!==Ir&&e!==cl&&e!==ml&&e!==dl&&e!==fl&&e!==hl&&e!==es&&e!==pm&&e!==mm&&e!==am&&e!==wm&&e!==fm&&e!==hm&&e!==cm&&e!==lm&&e!==um&&e!==ym&&e!==bm}function Em(e){return!Mr(e)&&e!==Ir}function ei(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function gl(e){var t=/^\n* /;return t.test(e)}var yl=1,ns=2,bl=3,wl=4,An=5;function Lm(e,t,n,i,r,o,s,a){var l,p=0,u=null,m=!1,c=!1,f=i!==-1,h=-1,g=Cm(ei(e,0))&&Em(ei(e,e.length-1));if(t||s)for(l=0;l<e.length;p>=65536?l+=2:l++){if(p=ei(e,l),!ri(p))return An;g=g&&qa(p,u,a),u=p}else{for(l=0;l<e.length;p>=65536?l+=2:l++){if(p=ei(e,l),p===ni)m=!0,f&&(c=c||l-h-1>i&&e[h+1]!==" ",h=l);else if(!ri(p))return An;g=g&&qa(p,u,a),u=p}c=c||f&&l-h-1>i&&e[h+1]!==" "}return!m&&!c?g&&!s&&!r(e)?yl:o===ii?An:ns:n>9&&gl(e)?An:s?o===ii?An:ns:c?wl:bl}function _m(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===ii?'""':"''";if(!e.noCompatMode&&(xm.indexOf(t)!==-1||vm.test(t)))return e.quotingType===ii?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(p){return Am(e,p)}switch(Lm(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case yl:return t;case ns:return"'"+t.replace(/'/g,"''")+"'";case bl:return"|"+Ka(t,e.indent)+Va(za(t,o));case wl:return">"+Ka(t,e.indent)+Va(za(Bm(t,s),o));case An:return'"'+Im(t)+'"';default:throw new Ne("impossible error: invalid scalar style")}}()}function Ka(e,t){var n=gl(e)?String(t):"",i=e[e.length-1]===`
|
||
`,r=i&&(e[e.length-2]===`
|
||
`||e===`
|
||
`),o=r?"+":i?"":"-";return n+o+`
|
||
`}function Va(e){return e[e.length-1]===`
|
||
`?e.slice(0,-1):e}function Bm(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var p=e.indexOf(`
|
||
`);return p=p!==-1?p:e.length,n.lastIndex=p,ja(e.slice(0,p),t)}(),r=e[0]===`
|
||
`||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?`
|
||
`:"")+ja(l,t),r=o}return i}function ja(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
|
||
`+e.slice(r,o),r=o+1),s=a;return l+=`
|
||
`,e.length-r>t&&s>r?l+=e.slice(r,s)+`
|
||
`+e.slice(s+1):l+=e.slice(r),l.slice(1)}function Im(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=ei(e,r),i=Re[n],!i&&ri(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||Sm(n);return t}function Mm(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(kt(e,t,a,!1,!1)||typeof a>"u"&&kt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function Wa(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(kt(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&kt(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=ts(e,t)),e.dump&&ni===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Fm(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,p,u;for(s=0,a=o.length;s<a;s+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=o[s],p=n[l],e.replacer&&(p=e.replacer.call(n,l,p)),kt(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),kt(e,t,p,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function Rm(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,p,u,m,c;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Ne("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)c="",(!i||r!=="")&&(c+=ts(e,t)),p=s[a],u=n[p],e.replacer&&(u=e.replacer.call(n,p,u)),kt(e,t+1,p,!0,!0,!0)&&(m=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,m&&(e.dump&&ni===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,m&&(c+=ts(e,t)),kt(e,t+1,u,!0,m)&&(e.dump&&ni===e.dump.charCodeAt(0)?c+=":":c+=": ",c+=e.dump,r+=c));e.tag=o,e.dump=r||"{}"}function Ua(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,ul.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(pl.call(a.represent,l))i=a.represent[l](t,l);else throw new Ne("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function kt(e,t,n,i,r,o,s){e.tag=null,e.dump=n,Ua(e,n,!1)||Ua(e,n,!0);var a=ul.call(e.dump),l=i,p;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",m,c;if(u&&(m=e.duplicates.indexOf(n),c=m!==-1),(e.tag!==null&&e.tag!=="?"||c||e.indent!==2&&t>0)&&(r=!1),c&&e.usedDuplicates[m])e.dump="*ref_"+m;else{if(u&&c&&!e.usedDuplicates[m]&&(e.usedDuplicates[m]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Rm(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(Fm(e,t,e.dump),c&&(e.dump="&ref_"+m+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Wa(e,t-1,e.dump,r):Wa(e,t,e.dump,r),c&&(e.dump="&ref_"+m+e.dump)):(Mm(e,t,e.dump),c&&(e.dump="&ref_"+m+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&_m(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ne("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(p=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?p="!"+p:p.slice(0,18)==="tag:yaml.org,2002:"?p="!!"+p.slice(18):p="!<"+p+">",e.dump=p+" "+e.dump)}return!0}function Dm(e,t){var n=[],i=[],r,o;for(is(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function is(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)is(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)is(e[i[r]],t,n)}function $m(e,t){t=t||{};var n=new Om(t);n.noRefs||Dm(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),kt(n,0,i,!0,!0)?n.dump+`
|
||
`:""}var Pm=$m,Nm={dump:Pm};function ls(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var xl=ll.load,Kg=ll.loadAll,Vg=Nm.dump,vl=Ne;var jg=ls("safeLoad","load"),Wg=ls("safeLoadAll","loadAll"),Ug=ls("safeDump","dump");function Wt(e,t,n){return e.substring(0,t)+n+e.substring(t)}function ve(e,t,n,i){return e.substring(0,t)+i+e.substring(n)}function kl(e){return e.replace(/\r/g,"")}function Ft(e,t,n=!1){return n?e==t:t.match(new RegExp("^"+Rr(e)+"( |\\t)*$","m"))!=null}function Ut(e,t,n,i=!1){let r=e.substring(t,n),o="",s=e.substring(0,t);if(s.length>0){let l=s.split(`
|
||
`);o=l[l.length-1]??"",o=o.trimEnd();let p=0;for(;l.length-(2+p)>=0;){let u=l[l.length-(2+p)];if(!Ft(o,u)&&(!i||!Ft("",u,!0)))break;p++}l.splice(l.length-(1+p),p),l.length>1&&(i&&l[l.length-2].match(/^> ?.*$/m)||!i&&!Ft(o,l[l.length-2])?l.splice(l.length-1,0,o):Ft("",l[l.length-2],!0)||l.splice(l.length-1,0,"")),s=l.join(`
|
||
`)}let a=e.substring(n);if(a.length>0){let l=a.split(`
|
||
`),p=0;for(;p+1<l.length;){let u=l[1+p];if(!Ft(o,u)&&(!i||!Ft("",u,!0)))break;p++}l.splice(1,p),l.length>1&&(i&&l[1].match(/^> ?.*$/m)||!i&&!Ft(o,l[1])?l.splice(1,0,o):i&&!Ft("",l[1])&&l.splice(1,0,"")),a=l.join(`
|
||
`)}return s+r+a}function Sl(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r<e.length;r++)o=e.charCodeAt(r),n=Math.imul(n^o,2654435761),i=Math.imul(i^o,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&i)+(n>>>0)}function Tl(e){return e=e.replace("\\b","\b"),e=e.replace("\\f","\f"),e=e.replace("\\n",`
|
||
`),e=e.replace("\\r","\r"),e=e.replace("\\t"," "),e=e.replace("\\v","\v"),e}var Rt=/^([ \t]*)(#+)([ \t]+)([^#\n\r]*)([ \t]+#+)?$/gm,Ol=`^XXX\\.*?
|
||
(?:((?:.|
|
||
)*?)
|
||
)?XXX(?=\\s|$)$`,ke=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,Hm=Ol.replaceAll("X","`"),zm=Ol.replaceAll("X","~"),Ym=`^(( |( {4})).*
|
||
)+`,Jg=new RegExp(`${Hm}|${zm}|${Ym}`,"gm"),Dr=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?\]{2}/g,oi=/(!?)\[([^[]*)\](\(.*\))/g,si=/(?:\s|^)#[^\s#;.,><?!=+]+/g,Al=/^%%\n[^%]*\n%%/gm,us=/[,\s]+/,$r=/(\. ?){2}\./g,_n="\\s*(>\\s*)*",ps=/((((>[ ]?)*)|([ ]{0,3}))\[.*?\][ \t]*\n)?((((>[ ]?)*)|([ ]{0,3}))\S+.*?\|.*?\n([^\n]*?\|[^\n]*?\n)*?)?(((>[ ]?)*)|([ ]{0,3}))[|\-+:.][ \-+|:.]*?\|[ \-+|:.]*(?:\n?[^\n]*?\|([^\n]*?)*)+/g,Pr=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'"‘’“”>]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s`\]'"‘’“”>]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s`\]'"‘’“”>]{2,}|www\.[a-zA-Z0-9]+\.[^\s`\]'"‘’“”>]{2,})/gi;function We(e){return e.replace(/\$/g,"$$$$")}function Rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cl(e){let t=e.match(Dr);if(t){for(let n of t)if(n.includes("|")){let i=n.indexOf("|"),r=n.substring(0,i+1)+n.substring(i+1,n.length-2).trim()+"]]";e=e.replace(n,r)}}return e}function El(e){let t=e.match(ps);if(t==null)return e;for(let n of t){let i=e.indexOf(n),r=i+n.length;if(n.trim().startsWith(">"))for(;e.charAt(i).trim()===""||e.charAt(i)===">";)i++;e=Ut(e,i,r)}return e}function Nr(e){let t=e.match(/^#\s+(.*)/m);if(t&&t[1]){let n=t[1];return n=n.replaceAll(Dr,(i,r,o,s)=>s??o),n.replaceAll(oi,"$2")}return""}var ms="tag",ai="tags",li=[ms,ai],qm="alias",ds="aliases",ui=[qm,ds],pi="linter-yaml-title-alias";function ht(e){return e.match(ke)===null&&(e=`---
|
||
---
|
||
`+e),e}function Se(e,t){if(!e.match(ke))return e;let n=e.match(ke)[0],i=t(n);return e=e.replace(n,We(i)),e}function fs(e){return new RegExp(`^([\\t ]*)${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m")}function Te(e,t,n){let i=`${t}:${n}
|
||
`,r=!1,o=e.replace(fs(t),(s,a)=>(r=!0,a+i));return r||(o=`${e}${i}`),o}function Oe(e,t){let n=e.match(fs(t));return n==null?null:n[2]}function Gt(e,t){return e.replace(fs(t),"")}function Je(e){if(e==null)return null;let t=xl(e.replace(/\n(\t)+/g,`
|
||
`));return t??{}}function Ge(e,t){switch(typeof e=="string"&&(e=[e]),t){case"single-line":return e==null||e.length===0?" []":" "+cs(e);case"multi-line":return e==null||e.length===0?`
|
||
- `:`
|
||
- `+e.join(`
|
||
- `);case"single string to single-line":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+cs(e);case"single string to multi-line":return e==null||e.length===0?" ":e.length===1?" "+e[0]:`
|
||
- `+e.join(`
|
||
- `);case"single string space delimited":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+e.join(" ");case"single string comma delimited":return e==null||e.length===0?" ":e.length===1?" "+e[0]:" "+e.join(", ");case"single-line space delimited":return e==null||e.length===0?" []":e.length===1?" "+e[0]:" "+cs(e).replaceAll(", "," ")}}function cs(e){return e==null||e.length===0?"[]":"["+e.join(", ")+"]"}function gt(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:Hr(e,",").filter(n=>n!="");if(e.includes(`
|
||
`)){let t=e.split(/[ \t]*\n[ \t]*-[ \t]*/);return t.splice(0,1),t=t.filter(n=>n!=""),t==null||t.length===0?null:t}return e}function zr(e){if(e==null)return[];let t=[],n=[];Array.isArray(e)?n=e:e.includes(",")?n=Hr(e,","):n=Hr(e," ");for(let i of n)t.push(i.trim());return t}function Yr(e){return typeof e=="string"?Hr(e,","):e}function Hr(e,t=","){if(e==""||e==null)return null;if(t.length>1)throw new Error("delimiter is only allowed to be a single character");let n=[],i="",r=0;for(;r<e.length;){let o=e.charAt(r);if(o===t)n.push(i.trim()),i="";else if(o==='"'||o==="'"){let s=e.indexOf(o,r+1);s!=-1?(i+=e.substring(r,s+1),r=s):i+=o}else i+=o;r++}return i.trim()!=""&&n.push(i.trim()),n}function hs(e){return e.length>1&&(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))}function St(e,t,n=!1){if(hs(e))return e;let i=e.includes("'"),r=e.includes('"'),o=e.includes(": ");return!i&&!r&&!o&&!n||i&&r?e:i?`"${e}"`:r?`'${e}'`:`${t}${e}${t}`}var In=require("obsidian");var Ll=require("obsidian");function He(e,t){Ll.MarkdownRenderer.renderMarkdown(e,t,"",null);let n=t.innerHTML.trim();n.startsWith("<p>")&&(n=n.substring(3)),n.endsWith("</p>")&&(n=n.substring(0,n.length-4)),t.innerHTML=n}var Zt=class{constructor(t,n,i,r){this.name=t,this.description=n,this.defaultValue=i,this.searchInfo={name:t,description:n},r&&(this.ruleName=r)}setOption(t,n){n.ruleConfigs[this.ruleName][this.name]=t}},Bn=class extends Zt{display(n,i,r){let o=new In.Setting(n).addToggle(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});He(this.name,o.nameEl),He(this.description,o.descEl),o.settingEl.style.border="none"}},ci=class extends Zt{display(n,i,r){let o=new In.Setting(n).addText(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});He(this.name,o.nameEl),He(this.description,o.descEl),o.settingEl.style.border="none"}},qr=class extends Zt{display(n,i,r){let o=new In.Setting(n).addTextArea(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});He(this.name,o.nameEl),He(this.description,o.descEl),o.settingEl.style.border="none"}},Kr=class extends Zt{display(n,i,r){let o=new In.Setting(n).addMomentFormat(s=>{s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.setPlaceholder("dddd, MMMM Do YYYY, h:mm:ss a"),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});He(this.name,o.nameEl),He(this.description,o.descEl),o.settingEl.style.border="none"}},Vr=class{constructor(t,n){this.value=t,this.description=n}},jr=class extends Zt{constructor(n,i,r,o,s){super(n,i,r,s);this.options=o,this.searchInfo.options=o}display(n,i,r){let o=new In.Setting(n).addDropdown(s=>{for(let a of this.options)s.addOption(a.value,a.value);s.setValue(i.ruleConfigs[this.ruleName][this.name]),s.onChange(a=>{this.setOption(a,i),r.settings=i,r.saveData(r.settings)})});He(this.name,o.nameEl),He(this.description,o.descEl),o.settingEl.style.border="none"}};var Dt=class extends Error{constructor(t,n){super(t),this.cause=n??null,this.stack=n.stack??null,Object.setPrototypeOf(this,Dt.prototype)}};var N=(s=>(s.YAML="YAML",s.HEADING="Heading",s.FOOTNOTE="Footnote",s.CONTENT="Content",s.SPACING="Spacing",s.PASTE="Paste",s))(N||{}),Wr=class{constructor(t,n,i,r,o,s=[],a=!1){this.name=t,this.description=n,this.type=i,this.apply=r,this.examples=o,s.unshift(new Bn(this.description,"",!1));for(let l of s)l.ruleName=t;this.options=s,this.hasSpecialExecutionOrder=a}alias(){return this.name.replace(/ /g,"-").toLowerCase()}getDefaultOptions(){let t={};for(let n of this.options)t[n.name]=n.defaultValue;return t}getOptions(t){return t.ruleConfigs[this.name]}getURL(){return"https://github.com/platers/obsidian-linter/blob/master/docs/rules.md"+"#"+this.alias()}enabledOptionName(){return this.options[0].name}},Ur=class{constructor(t,n,i,r={}){this.description=t,this.options=r,this.before=n,this.after=i}},_l=Object.values(N);function Bl(e){let t=e.match(ke);if(!t)return[];let n=t[1],i=Oe(n,"disabled rules");if(i==null)return[];let r=i.includes(`
|
||
`)?`disabled rules:
|
||
`:"disabled rules: ";r+=i;let s=Je(r)["disabled rules"];return s?(typeof s=="string"&&(s=[s]),s.includes("all")?yt.map(a=>a.alias()):s):[]}var yt=[],Km=yt.reduce((e,t)=>(e[t.alias()]=t,e),{});function Il(e){yt.push(e),yt.sort((t,n)=>_l.indexOf(t.type)-_l.indexOf(n.type)||t.name.localeCompare(n.name)),Km[e.alias()]=e}function Gr(e,t){let n;throw e instanceof vl?(n=e.toString(),n=`error in the yaml: ${n.substring(n.indexOf(":")+1)}`):n=`unknown error: ${e.message}`,new Dt(`"${t}" encountered an ${n}`,e)}var Wn=Go(Ml());function Vm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var r=i.reduce(function(a,l){var p=l.match(/\n([\t ]+|(?!\s).)/g);return p?a.concat(p.map(function(u){var m,c;return(c=(m=u.match(/[\t ]/g))===null||m===void 0?void 0:m.length)!==null&&c!==void 0?c:0})):a},[]);if(r.length){var o=new RegExp(`
|
||
[ ]{`+Math.min.apply(Math,r)+"}","g");i=i.map(function(a){return a.replace(o,`
|
||
`)})}i[0]=i[0].replace(/^\r?\n/,"");var s=i[0];return t.forEach(function(a,l){var p=s.match(/(?:^|\n)( *)$/),u=p?p[1]:"",m=a;typeof a=="string"&&a.includes(`
|
||
`)&&(m=String(a).split(`
|
||
`).map(function(c,f){return f===0?c:""+u+c}).join(`
|
||
`)),s+=m+i[l+1]}),s}var d=Vm;var mp=Go(gs());var _e=Go(gs()),Qr="[Obsidian Linter]";function Rl(e,t){let n=`${Qr} ${e}:
|
||
`;n+=`${t.name} ${t.message}`,t.stack&&(n+=`
|
||
`+t.stack),_e.default.error(n)}function mi(e){_e.default.info(`${Qr} ${e}`)}function Tt(e){_e.default.debug(`${Qr} ${e}`)}function Xr(e){_e.default.warn(`${Qr} ${e}`)}function Dl(e){switch(e){case _e.default.levels.INFO:{_e.default.setLevel("info");break}case _e.default.levels.TRACE:{_e.default.setLevel("trace");break}case _e.default.levels.DEBUG:{_e.default.setLevel("debug");break}case _e.default.levels.SILENT:{_e.default.setLevel("silent");break}case _e.default.levels.ERROR:{_e.default.setLevel("error");break}case _e.default.levels.WARN:{_e.default.setLevel("warn");break}}}var Ko=require("obsidian");var Fn,di,$t,et=class{static getRule(){if(!Ue(et,Fn).has(this.name)){let t=new this,n=new Wr(t.name,t.description,t.type,t.safeApply.bind(t),t.exampleBuilders.map(i=>i.example),t.optionBuilders.map(i=>i.option),t.hasSpecialExecutionOrder);Ue(et,Fn).set(this.name,n),Ue(et,di).set(t.name,t)}return Ue(et,Fn).get(this.name)}static applyIfEnabledBase(t,n,i,r){let o=t.getOptions(i);if(o[t.enabledOptionName()]){let s=Object.assign({},o,r);Tt(`Running ${t.name}`);try{return[t.apply(n,s),!0]}catch(a){Gr(a,t.name)}}else return[n,!1]}static getBuilderByName(t){return Ue(et,di).get(t)}static setNoSettingControl(t,n){Ue(et,$t).has(t)||Ue(et,$t).set(t,[]),Ue(et,$t).get(t).push(n)}static hasSettingControl(t,n){return!Ue(et,$t).has(t)||!Ue(et,$t).get(t).includes(n)}},st=et;Fn=new WeakMap,di=new WeakMap,$t=new WeakMap,On(st,Fn,new Map),On(st,di,new Map),On(st,$t,new Map);var S=class extends st{static register(t){let n=t.getRule();Il(n)}safeApply(t,n){return this.apply(t,this.buildRuleOptions(n))}buildRuleOptions(t){t=t??{};let n=new this.OptionsClass,i=Object.assign(n,t);for(let r of this.optionBuilders)r.setRuleOption(i,t);return i}get hasSpecialExecutionOrder(){return!1}static applyIfEnabled(t,n,i,r){let o=this.getRule();return i.includes(o.alias())?(Tt(o.alias()+" is disabled"),[t,!1]):st.applyIfEnabledBase(o,t,n,r)}static getRuleOptions(t){let n=st.getRule.bind(this)(),i=new this,r=n.getOptions(t);return i.buildRuleOptions(r)}static noSettingControl(){return(t,n)=>{let i=t.constructor.name;st.setNoSettingControl(i,n)}}},ys,x=class{constructor(t){On(this,ys,void 0);this.example=new Ur(t.description,t.before,t.after,t.options)}};ys=new WeakMap;var Rn,Pt=class{constructor(t){On(this,Rn,void 0);this.OptionsClass=t.OptionsClass,this.name=t.name,this.description=t.description,this.optionsKey=t.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return Ue(this,Rn)||Ma(this,Rn,this.buildOption()),Ue(this,Rn)}setRuleOption(t,n){let i=n[this.name];i!==void 0&&(t[this.optionsKey]=i)}};Rn=new WeakMap;var U=class extends Pt{buildOption(){return new Bn(this.name,this.description,this.defaultValue)}},Jr=class extends Pt{buildOption(){return new ci(this.name,this.description,this.defaultValue)}},ye=class extends Pt{constructor(n){super(n);this.records=n.records.map(i=>new Vr(i.value,i.description))}buildOption(){return new jr(this.name,this.description,this.defaultValue,this.records)}},Ae=class extends Pt{constructor(n){super(n);this.separator=n.separator??`
|
||
`,this.splitter=n.splitter??/\n/}buildOption(){return new qr(this.name,this.description,this.defaultValue.join(this.separator))}setRuleOption(n,i){if(i[this.name]!==void 0){let r=i[this.name].split(this.splitter).filter(function(o){return o!=""});n[this.optionsKey]=r}}},at=class extends Pt{buildOption(){return new ci(this.name,this.description,this.defaultValue)}},eo=class extends Pt{buildOption(){return new Kr(this.name,this.description,this.defaultValue)}};var to=class{};O([S.noSettingControl()],to.prototype,"lineContent",2);var Qt=class extends S{get OptionsClass(){return to}get name(){return"Add Blockquote Indentation on Paste"}get description(){return"Adds blockquotes to all but the first line, when the cursor is in a blockquote/callout line during pasting"}get type(){return"Paste"}apply(t,n){let i=/^(\s*)((> ?)+) .*/,r=n.lineContent.match(i);if(!r)return t;let o=r[1]??"",s=r[2]??"";return t.trim().replace(/\n/gm,`
|
||
${o}${s} `)}get exampleBuilders(){return[new x({description:"Line being pasted into regular text does not get blockquotified with current line being `Part 1 of the sentence`",before:d`
|
||
was much less likely to succeed, but they tried it anyway.
|
||
Part 2 was much more interesting.
|
||
`,after:d`
|
||
was much less likely to succeed, but they tried it anyway.
|
||
Part 2 was much more interesting.
|
||
`,options:{lineContent:"Part 1 of the sentence"}}),new x({description:"Line being pasted into a blockquote gets blockquotified with current line being `> > `",before:d`
|
||
${""}
|
||
This content is being added to a blockquote
|
||
Note that the second line is indented and the surrounding blank lines were trimmed
|
||
${""}
|
||
`,after:d`
|
||
This content is being added to a blockquote
|
||
> > Note that the second line is indented and the surrounding blank lines were trimmed
|
||
`,options:{lineContent:"> > "}})]}get optionBuilders(){return[]}};Qt=O([S.register],Qt);var bs=function(e){if(e==null)return Qm;if(typeof e=="string")return Zm(e);if(typeof e=="object")return Array.isArray(e)?Um(e):Gm(e);if(typeof e=="function")return no(e);throw new Error("Expected function, string, or object as test")};function Um(e){let t=[],n=-1;for(;++n<e.length;)t[n]=bs(e[n]);return no(i);function i(...r){let o=-1;for(;++o<t.length;)if(t[o].call(this,...r))return!0;return!1}}function Gm(e){return no(t);function t(n){let i;for(i in e)if(n[i]!==e[i])return!1;return!0}}function Zm(e){return no(t);function t(n){return n&&n.type===e}}function no(e){return t;function t(...n){return Boolean(e.call(this,...n))}}function Qm(){return!0}var Xm=!0,Jm="skip",$l=!1,Pl=function(e,t,n,i){typeof t=="function"&&typeof n!="function"&&(i=n,n=t,t=null);let r=bs(t),o=i?-1:1;s(e,null,[])();function s(a,l,p){let u=typeof a=="object"&&a!==null?a:{},m;return typeof u.type=="string"&&(m=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0,Object.defineProperty(c,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})),c;function c(){let f=[],h,g,w;if((!t||r(a,l,p[p.length-1]||null))&&(f=ed(n(a,p)),f[0]===$l))return f;if(a.children&&f[0]!==Jm)for(g=(i?a.children.length:-1)+o,w=p.concat(a);g>-1&&g<a.children.length;){if(h=s(a.children[g],g,w)(),h[0]===$l)return h;g=typeof h[1]=="number"?h[1]:g+o}return f}}};function ed(e){return Array.isArray(e)?e:typeof e=="number"?[Xm,e]:[e]}var Nl=function(e,t,n,i){typeof t=="function"&&typeof n!="function"&&(i=n,n=t,t=null),Pl(e,t,r,i);function r(o,s){let a=s[s.length-1];return n(o,a?a.children.indexOf(o):null,a)}};function Be(e,t,n,i){let r=e.length,o=0,s;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(t,n),[].splice.apply(e,s);else for(n&&[].splice.apply(e,[t,n]);o<i.length;)s=i.slice(o,o+1e4),s.unshift(t,0),[].splice.apply(e,s),o+=1e4,t+=1e4}function ze(e,t){return e.length>0?(Be(e,e.length,0,t),e):t}var Hl=/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;var Ze=Nt(/[A-Za-z]/),fi=Nt(/\d/),zl=Nt(/[\dA-Fa-f]/),Ye=Nt(/[\dA-Za-z]/),Yl=Nt(/[!-/:-@[-`{-~]/),ws=Nt(/[#-'*+\--9=?A-Z^-~]/);function hi(e){return e!==null&&(e<32||e===127)}function re(e){return e!==null&&(e<0||e===32)}function D(e){return e!==null&&e<-2}function G(e){return e===-2||e===-1||e===32}var ql=Nt(/\s/),Kl=Nt(Hl);function Nt(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function xs(e){if(e===null||re(e)||ql(e))return 1;if(Kl(e))return 2}function Dn(e,t,n){let i=[],r=-1;for(;++r<e.length;){let o=e[r].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}var gi={name:"attention",tokenize:nd,resolveAll:td};function td(e,t){let n=-1,i,r,o,s,a,l,p,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let m=Object.assign({},e[i][1].end),c=Object.assign({},e[n][1].start);Vl(m,-l),Vl(c,l),s={type:l>1?"strongSequence":"emphasisSequence",start:m,end:Object.assign({},e[i][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:c},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[i][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),p=[],e[i][1].end.offset-e[i][1].start.offset&&(p=ze(p,[["enter",e[i][1],t],["exit",e[i][1],t]])),p=ze(p,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",o,t]]),p=ze(p,Dn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),p=ze(p,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,p=ze(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Be(e,i-1,n-i+3,p),n=i+p.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function nd(e,t){let n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=xs(i),o;return s;function s(l){return e.enter("attentionSequence"),o=l,a(l)}function a(l){if(l===o)return e.consume(l),a;let p=e.exit("attentionSequence"),u=xs(l),m=!u||u===2&&r||n.includes(l),c=!r||r===2&&u||n.includes(i);return p._open=Boolean(o===42?m:m&&(r||!c)),p._close=Boolean(o===42?c:c&&(u||!m)),t(l)}}function Vl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var vs={name:"autolink",tokenize:id};function id(e,t,n){let i=1;return r;function r(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return Ze(h)?(e.consume(h),s):ws(h)?p(h):n(h)}function s(h){return h===43||h===45||h===46||Ye(h)?a(h):p(h)}function a(h){return h===58?(e.consume(h),l):(h===43||h===45||h===46||Ye(h))&&i++<32?(e.consume(h),a):p(h)}function l(h){return h===62?(e.exit("autolinkProtocol"),f(h)):h===null||h===32||h===60||hi(h)?n(h):(e.consume(h),l)}function p(h){return h===64?(e.consume(h),i=0,u):ws(h)?(e.consume(h),p):n(h)}function u(h){return Ye(h)?m(h):n(h)}function m(h){return h===46?(e.consume(h),i=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",f(h)):c(h)}function c(h){return(h===45||Ye(h))&&i++<63?(e.consume(h),h===45?c:m):n(h)}function f(h){return e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t}}function Y(e,t,n,i){let r=i?i-1:Number.POSITIVE_INFINITY,o=0;return s;function s(l){return G(l)?(e.enter(n),a(l)):t(l)}function a(l){return G(l)&&o++<r?(e.consume(l),a):(e.exit(n),t(l))}}var bt={tokenize:rd,partial:!0};function rd(e,t,n){return Y(e,i,"linePrefix");function i(r){return r===null||D(r)?t(r):n(r)}}var io={name:"blockQuote",tokenize:od,continuation:{tokenize:sd},exit:ad};function od(e,t,n){let i=this;return r;function r(s){if(s===62){let a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return G(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function sd(e,t,n){return Y(e,e.attempt(io,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ad(e){e.exit("blockQuote")}var ro={name:"characterEscape",tokenize:ld};function ld(e,t,n){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),r}function r(o){return Yl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var jl=document.createElement("i");function $n(e){let t="&"+e+";";jl.innerHTML=t;let n=jl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}var oo={name:"characterReference",tokenize:ud};function ud(e,t,n){let i=this,r=0,o,s;return a;function a(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),l}function l(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,s=Ye,u(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=zl,u):(e.enter("characterReferenceValue"),o=7,s=fi,u(m))}function u(m){let c;return m===59&&r?(c=e.exit("characterReferenceValue"),s===Ye&&!$n(i.sliceSerialize(c))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)):s(m)&&r++<o?(e.consume(m),u):n(m)}}var so={name:"codeFenced",tokenize:pd,concrete:!0};function pd(e,t,n){let i=this,r={tokenize:M,partial:!0},o={tokenize:L,partial:!0},s=this.events[this.events.length-1],a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0,p;return u;function u(T){return e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p=T,m(T)}function m(T){return T===p?(e.consume(T),l++,m):(e.exit("codeFencedFenceSequence"),l<3?n(T):Y(e,c,"whitespace")(T))}function c(T){return T===null||D(T)?w(T):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(T))}function f(T){return T===null||re(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Y(e,h,"whitespace")(T)):T===96&&T===p?n(T):(e.consume(T),f)}function h(T){return T===null||D(T)?w(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(T))}function g(T){return T===null||D(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),w(T)):T===96&&T===p?n(T):(e.consume(T),g)}function w(T){return e.exit("codeFencedFence"),i.interrupt?t(T):y(T)}function y(T){return T===null?A(T):D(T)?e.attempt(o,e.attempt(r,A,a?Y(e,y,"linePrefix",a+1):y),A)(T):(e.enter("codeFlowValue"),E(T))}function E(T){return T===null||D(T)?(e.exit("codeFlowValue"),y(T)):(e.consume(T),E)}function A(T){return e.exit("codeFenced"),t(T)}function L(T,B,I){let P=this;return K;function K(V){return T.enter("lineEnding"),T.consume(V),T.exit("lineEnding"),z}function z(V){return P.parser.lazy[P.now().line]?I(V):B(V)}}function M(T,B,I){let P=0;return Y(T,K,"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function K(F){return T.enter("codeFencedFence"),T.enter("codeFencedFenceSequence"),z(F)}function z(F){return F===p?(T.consume(F),P++,z):P<l?I(F):(T.exit("codeFencedFenceSequence"),Y(T,V,"whitespace")(F))}function V(F){return F===null||D(F)?(T.exit("codeFencedFence"),B(F)):I(F)}}}var yi={name:"codeIndented",tokenize:md},cd={tokenize:dd,partial:!0};function md(e,t,n){let i=this;return r;function r(p){return e.enter("codeIndented"),Y(e,o,"linePrefix",4+1)(p)}function o(p){let u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(p):n(p)}function s(p){return p===null?l(p):D(p)?e.attempt(cd,s,l)(p):(e.enter("codeFlowValue"),a(p))}function a(p){return p===null||D(p)?(e.exit("codeFlowValue"),s(p)):(e.consume(p),a)}function l(p){return e.exit("codeIndented"),t(p)}}function dd(e,t,n){let i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):D(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):Y(e,o,"linePrefix",4+1)(s)}function o(s){let a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):D(s)?r(s):n(s)}}var ks={name:"codeText",tokenize:gd,resolve:fd,previous:hd};function fd(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function hd(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gd(e,t,n){let i=this,r=0,o,s;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),l(c)}function l(c){return c===96?(e.consume(c),r++,l):(e.exit("codeTextSequence"),p(c))}function p(c){return c===null?n(c):c===96?(s=e.enter("codeTextSequence"),o=0,m(c)):c===32?(e.enter("space"),e.consume(c),e.exit("space"),p):D(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),p):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||D(c)?(e.exit("codeTextData"),p(c)):(e.consume(c),u)}function m(c){return c===96?(e.consume(c),o++,m):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}function ao(e){let t={},n=-1,i,r,o,s,a,l,p;for(;++n<e.length;){for(;n in t;)n=t[n];if(i=e[n],n&&i[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,yd(e,n)),n=t[n],p=!0);else if(i[1]._container){for(o=n,r=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(r&&(e[r][1].type="lineEndingBlank"),s[1].type="lineEnding",r=o);r&&(i[1].end=Object.assign({},e[r][1].start),a=e.slice(r,n),a.unshift(i),Be(e,r,n-r+1,a))}}return!p}function yd(e,t){let n=e[t][1],i=e[t][2],r=t-1,o=[],s=n._tokenizer||i.parser[n.contentType](n.start),a=s.events,l=[],p={},u,m,c=-1,f=n,h=0,g=0,w=[g];for(;f;){for(;e[++r][1]!==f;);o.push(r),f._tokenizer||(u=i.sliceStream(f),f.next||u.push(null),m&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),m=f,f=f.next}for(f=n;++c<a.length;)a[c][0]==="exit"&&a[c-1][0]==="enter"&&a[c][1].type===a[c-1][1].type&&a[c][1].start.line!==a[c][1].end.line&&(g=c+1,w.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):w.pop(),c=w.length;c--;){let y=a.slice(w[c],w[c+1]),E=o.pop();l.unshift([E,E+y.length-1]),Be(e,E,2,y)}for(c=-1;++c<l.length;)p[h+l[c][0]]=h+l[c][1],h+=l[c][1]-l[c][0]-1;return p}var Ss={tokenize:xd,resolve:wd},bd={tokenize:vd,partial:!0};function wd(e){return ao(e),e}function xd(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?o(a):D(a)?e.check(bd,s,o)(a):(e.consume(a),r)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function vd(e,t,n){let i=this;return r;function r(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Y(e,o,"linePrefix")}function o(s){if(s===null||D(s))return n(s);let a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(i.parser.constructs.flow,n,t)(s)}}function lo(e,t,n,i,r,o,s,a,l){let p=l||Number.POSITIVE_INFINITY,u=0;return m;function m(y){return y===60?(e.enter(i),e.enter(r),e.enter(o),e.consume(y),e.exit(o),c):y===null||y===41||hi(y)?n(y):(e.enter(i),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(y))}function c(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),c(y)):y===null||y===60||D(y)?n(y):(e.consume(y),y===92?h:f)}function h(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function g(y){return y===40?++u>p?n(y):(e.consume(y),g):y===41?u--?(e.consume(y),g):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(y)):y===null||re(y)?u?n(y):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(y)):hi(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function uo(e,t,n,i,r,o){let s=this,a=0,l;return p;function p(f){return e.enter(i),e.enter(r),e.consume(f),e.exit(r),e.enter(o),u}function u(f){return f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs||a>999?n(f):f===93?(e.exit(o),e.enter(r),e.consume(f),e.exit(r),e.exit(i),t):D(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),m(f))}function m(f){return f===null||f===91||f===93||D(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l=l||!G(f),f===92?c:m)}function c(f){return f===91||f===92||f===93?(e.consume(f),a++,m):m(f)}}function po(e,t,n,i,r,o){let s;return a;function a(c){return e.enter(i),e.enter(r),e.consume(c),e.exit(r),s=c===40?41:c,l}function l(c){return c===s?(e.enter(r),e.consume(c),e.exit(r),e.exit(i),t):(e.enter(o),p(c))}function p(c){return c===s?(e.exit(o),l(s)):c===null?n(c):D(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Y(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(c))}function u(c){return c===s||c===null||D(c)?(e.exit("chunkString"),p(c)):(e.consume(c),c===92?m:u)}function m(c){return c===s||c===92?(e.consume(c),u):u(c)}}function Xt(e,t){let n;return i;function i(r){return D(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):G(r)?Y(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}function De(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Ts={name:"definition",tokenize:Sd},kd={tokenize:Td,partial:!0};function Sd(e,t,n){let i=this,r;return o;function o(l){return e.enter("definition"),uo.call(i,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(l)}function s(l){return r=De(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),l===58?(e.enter("definitionMarker"),e.consume(l),e.exit("definitionMarker"),Xt(e,lo(e,e.attempt(kd,Y(e,a,"whitespace"),Y(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(l)}function a(l){return l===null||D(l)?(e.exit("definition"),i.parser.defined.includes(r)||i.parser.defined.push(r),t(l)):n(l)}}function Td(e,t,n){return i;function i(s){return re(s)?Xt(e,r)(s):n(s)}function r(s){return s===34||s===39||s===40?po(e,Y(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s):n(s)}function o(s){return s===null||D(s)?t(s):n(s)}}var Os={name:"hardBreakEscape",tokenize:Od};function Od(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(o),r}function r(o){return D(o)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(o)):n(o)}}var As={name:"headingAtx",tokenize:Cd,resolve:Ad};function Ad(e,t){let n=e.length-2,i=3,r,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Be(e,i,n-i+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),e}function Cd(e,t,n){let i=this,r=0;return o;function o(u){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||re(u)?(e.exit("atxHeadingSequence"),i.interrupt?t(u):a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||D(u)?(e.exit("atxHeading"),t(u)):G(u)?Y(e,a,"whitespace")(u):(e.enter("atxHeadingText"),p(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function p(u){return u===null||u===35||re(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),p)}}var Wl=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Cs=["pre","script","style","textarea"];var Es={name:"htmlFlow",tokenize:_d,resolveTo:Ld,concrete:!0},Ed={tokenize:Bd,partial:!0};function Ld(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function _d(e,t,n){let i=this,r,o,s,a,l;return p;function p(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),m):b===47?(e.consume(b),h):b===63?(e.consume(b),r=3,i.interrupt?t:le):Ze(b)?(e.consume(b),s=String.fromCharCode(b),o=!0,g):n(b)}function m(b){return b===45?(e.consume(b),r=2,c):b===91?(e.consume(b),r=5,s="CDATA[",a=0,f):Ze(b)?(e.consume(b),r=4,i.interrupt?t:le):n(b)}function c(b){return b===45?(e.consume(b),i.interrupt?t:le):n(b)}function f(b){return b===s.charCodeAt(a++)?(e.consume(b),a===s.length?i.interrupt?t:z:f):n(b)}function h(b){return Ze(b)?(e.consume(b),s=String.fromCharCode(b),g):n(b)}function g(b){return b===null||b===47||b===62||re(b)?b!==47&&o&&Cs.includes(s.toLowerCase())?(r=1,i.interrupt?t(b):z(b)):Wl.includes(s.toLowerCase())?(r=6,b===47?(e.consume(b),w):i.interrupt?t(b):z(b)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(b):o?E(b):y(b)):b===45||Ye(b)?(e.consume(b),s+=String.fromCharCode(b),g):n(b)}function w(b){return b===62?(e.consume(b),i.interrupt?t:z):n(b)}function y(b){return G(b)?(e.consume(b),y):P(b)}function E(b){return b===47?(e.consume(b),P):b===58||b===95||Ze(b)?(e.consume(b),A):G(b)?(e.consume(b),E):P(b)}function A(b){return b===45||b===46||b===58||b===95||Ye(b)?(e.consume(b),A):L(b)}function L(b){return b===61?(e.consume(b),M):G(b)?(e.consume(b),L):E(b)}function M(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),l=b,T):G(b)?(e.consume(b),M):(l=null,B(b))}function T(b){return b===null||D(b)?n(b):b===l?(e.consume(b),I):(e.consume(b),T)}function B(b){return b===null||b===34||b===39||b===60||b===61||b===62||b===96||re(b)?L(b):(e.consume(b),B)}function I(b){return b===47||b===62||G(b)?E(b):n(b)}function P(b){return b===62?(e.consume(b),K):n(b)}function K(b){return G(b)?(e.consume(b),K):b===null||D(b)?z(b):n(b)}function z(b){return b===45&&r===2?(e.consume(b),J):b===60&&r===1?(e.consume(b),Z):b===62&&r===4?(e.consume(b),ne):b===63&&r===3?(e.consume(b),le):b===93&&r===5?(e.consume(b),ae):D(b)&&(r===6||r===7)?e.check(Ed,ne,V)(b):b===null||D(b)?V(b):(e.consume(b),z)}function V(b){return e.exit("htmlFlowData"),F(b)}function F(b){return b===null?v(b):D(b)?e.attempt({tokenize:j,partial:!0},F,v)(b):(e.enter("htmlFlowData"),z(b))}function j(b,mt,Ke){return Pe;function Pe(Ve){return b.enter("lineEnding"),b.consume(Ve),b.exit("lineEnding"),rt}function rt(Ve){return i.parser.lazy[i.now().line]?Ke(Ve):mt(Ve)}}function J(b){return b===45?(e.consume(b),le):z(b)}function Z(b){return b===47?(e.consume(b),s="",se):z(b)}function se(b){return b===62&&Cs.includes(s.toLowerCase())?(e.consume(b),ne):Ze(b)&&s.length<8?(e.consume(b),s+=String.fromCharCode(b),se):z(b)}function ae(b){return b===93?(e.consume(b),le):z(b)}function le(b){return b===62?(e.consume(b),ne):b===45&&r===2?(e.consume(b),le):z(b)}function ne(b){return b===null||D(b)?(e.exit("htmlFlowData"),v(b)):(e.consume(b),ne)}function v(b){return e.exit("htmlFlow"),t(b)}}function Bd(e,t,n){return i;function i(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(bt,t,n)}}var Ls={name:"htmlText",tokenize:Id};function Id(e,t,n){let i=this,r,o,s,a;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),p}function p(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),B):v===63?(e.consume(v),M):Ze(v)?(e.consume(v),K):n(v)}function u(v){return v===45?(e.consume(v),m):v===91?(e.consume(v),o="CDATA[",s=0,w):Ze(v)?(e.consume(v),L):n(v)}function m(v){return v===45?(e.consume(v),c):n(v)}function c(v){return v===null||v===62?n(v):v===45?(e.consume(v),f):h(v)}function f(v){return v===null||v===62?n(v):h(v)}function h(v){return v===null?n(v):v===45?(e.consume(v),g):D(v)?(a=h,ae(v)):(e.consume(v),h)}function g(v){return v===45?(e.consume(v),ne):h(v)}function w(v){return v===o.charCodeAt(s++)?(e.consume(v),s===o.length?y:w):n(v)}function y(v){return v===null?n(v):v===93?(e.consume(v),E):D(v)?(a=y,ae(v)):(e.consume(v),y)}function E(v){return v===93?(e.consume(v),A):y(v)}function A(v){return v===62?ne(v):v===93?(e.consume(v),A):y(v)}function L(v){return v===null||v===62?ne(v):D(v)?(a=L,ae(v)):(e.consume(v),L)}function M(v){return v===null?n(v):v===63?(e.consume(v),T):D(v)?(a=M,ae(v)):(e.consume(v),M)}function T(v){return v===62?ne(v):M(v)}function B(v){return Ze(v)?(e.consume(v),I):n(v)}function I(v){return v===45||Ye(v)?(e.consume(v),I):P(v)}function P(v){return D(v)?(a=P,ae(v)):G(v)?(e.consume(v),P):ne(v)}function K(v){return v===45||Ye(v)?(e.consume(v),K):v===47||v===62||re(v)?z(v):n(v)}function z(v){return v===47?(e.consume(v),ne):v===58||v===95||Ze(v)?(e.consume(v),V):D(v)?(a=z,ae(v)):G(v)?(e.consume(v),z):ne(v)}function V(v){return v===45||v===46||v===58||v===95||Ye(v)?(e.consume(v),V):F(v)}function F(v){return v===61?(e.consume(v),j):D(v)?(a=F,ae(v)):G(v)?(e.consume(v),F):z(v)}function j(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),r=v,J):D(v)?(a=j,ae(v)):G(v)?(e.consume(v),j):(e.consume(v),r=void 0,se)}function J(v){return v===r?(e.consume(v),Z):v===null?n(v):D(v)?(a=J,ae(v)):(e.consume(v),J)}function Z(v){return v===62||v===47||re(v)?z(v):n(v)}function se(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===62||re(v)?z(v):(e.consume(v),se)}function ae(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Y(e,le,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function le(v){return e.enter("htmlTextData"),a(v)}function ne(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}}var Jt={name:"labelEnd",tokenize:Pd,resolveTo:$d,resolveAll:Dd},Md={tokenize:Nd},Fd={tokenize:Hd},Rd={tokenize:zd};function Dd(e){let t=-1,n;for(;++t<e.length;)n=e[t][1],(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++);return e}function $d(e,t){let n=e.length,i=0,r,o,s,a;for(;n--;)if(r=e[n][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=n);let l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[o+i+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",p,t]],a=ze(a,e.slice(o+1,o+i+3)),a=ze(a,[["enter",u,t]]),a=ze(a,Dn(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t)),a=ze(a,[["exit",u,t],e[s-2],e[s-1],["exit",p,t]]),a=ze(a,e.slice(s+1)),a=ze(a,[["exit",l,t]]),Be(e,o,e.length,a),e}function Pd(e,t,n){let i=this,r=i.events.length,o,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}return a;function a(u){return o?o._inactive?p(u):(s=i.parser.defined.includes(De(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelEnd"),l):n(u)}function l(u){return u===40?e.attempt(Md,t,s?t:p)(u):u===91?e.attempt(Fd,t,s?e.attempt(Rd,t,p):p)(u):s?t(u):p(u)}function p(u){return o._balanced=!0,n(u)}}function Nd(e,t,n){return i;function i(l){return e.enter("resource"),e.enter("resourceMarker"),e.consume(l),e.exit("resourceMarker"),Xt(e,r)}function r(l){return l===41?a(l):lo(e,o,n,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(l)}function o(l){return re(l)?Xt(e,s)(l):a(l)}function s(l){return l===34||l===39||l===40?po(e,Xt(e,a),n,"resourceTitle","resourceTitleMarker","resourceTitleString")(l):a(l)}function a(l){return l===41?(e.enter("resourceMarker"),e.consume(l),e.exit("resourceMarker"),e.exit("resource"),t):n(l)}}function Hd(e,t,n){let i=this;return r;function r(s){return uo.call(i,e,o,n,"reference","referenceMarker","referenceString")(s)}function o(s){return i.parser.defined.includes(De(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(s):n(s)}}function zd(e,t,n){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),r}function r(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var _s={name:"labelStartImage",tokenize:Yd,resolveAll:Jt.resolveAll};function Yd(e,t,n){let i=this;return r;function r(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}var Bs={name:"labelStartLink",tokenize:qd,resolveAll:Jt.resolveAll};function qd(e,t,n){let i=this;return r;function r(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(s):t(s)}}var bi={name:"lineEnding",tokenize:Kd};function Kd(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Y(e,t,"linePrefix")}}var en={name:"thematicBreak",tokenize:Vd};function Vd(e,t,n){let i=0,r;return o;function o(l){return e.enter("thematicBreak"),r=l,s(l)}function s(l){return l===r?(e.enter("thematicBreakSequence"),a(l)):G(l)?Y(e,s,"whitespace")(l):i<3||l!==null&&!D(l)?n(l):(e.exit("thematicBreak"),t(l))}function a(l){return l===r?(e.consume(l),i++,a):(e.exit("thematicBreakSequence"),s(l))}}var $e={name:"list",tokenize:Ud,continuation:{tokenize:Gd},exit:Qd},jd={tokenize:Xd,partial:!0},Wd={tokenize:Zd,partial:!0};function Ud(e,t,n){let i=this,r=i.events[i.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(f){let h=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:fi(f)){if(i.containerState.type||(i.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(en,n,p)(f):p(f);if(!i.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return fi(f)&&++s<10?(e.consume(f),l):(!i.interrupt||s<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),p(f)):n(f)}function p(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,e.check(bt,i.interrupt?n:u,e.attempt(jd,c,m))}function u(f){return i.containerState.initialBlankLine=!0,o++,c(f)}function m(f){return G(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),c):n(f)}function c(f){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Gd(e,t,n){let i=this;return i.containerState._closeFlow=void 0,e.check(bt,r,o);function r(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Y(e,t,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!G(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Wd,t,s)(a))}function s(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,Y(e,e.attempt($e,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Zd(e,t,n){let i=this;return Y(e,r,"listItemIndent",i.containerState.size+1);function r(o){let s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?t(o):n(o)}}function Qd(e){e.exit(this.containerState.type)}function Xd(e,t,n){let i=this;return Y(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function r(o){let s=i.events[i.events.length-1];return!G(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var co={name:"setextUnderline",tokenize:ef,resolveTo:Jd};function Jd(e,t){let n=e.length,i,r,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",s,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end=Object.assign({},e[o][1].end)):e[i][1]=s,e.push(["exit",s,t]),e}function ef(e,t,n){let i=this,r=i.events.length,o,s;for(;r--;)if(i.events[r][1].type!=="lineEnding"&&i.events[r][1].type!=="linePrefix"&&i.events[r][1].type!=="content"){s=i.events[r][1].type==="paragraph";break}return a;function a(u){return!i.parser.lazy[i.now().line]&&(i.interrupt||s)?(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),o=u,l(u)):n(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Y(e,p,"lineSuffix")(u))}function p(u){return u===null||D(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var tf={tokenize:uf,partial:!0};function Is(){return{document:{[91]:{tokenize:sf,continuation:{tokenize:af},exit:lf}},text:{[91]:{tokenize:of},[93]:{add:"after",tokenize:nf,resolveTo:rf}}}}function nf(e,t,n){let i=this,r=i.events.length,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s;for(;r--;){let l=i.events[r][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);let p=De(i.sliceSerialize({start:s.end,end:i.now()}));return p.charCodeAt(0)!==94||!o.includes(p.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function rf(e,t){let n=e.length,i;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){i=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function of(e,t,n){let i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(c){let f;return c===null||c===91||o++>999?n(c):c===93?s?(e.exit("chunkString"),f=e.exit("gfmFootnoteCallString"),r.includes(De(i.sliceSerialize(f)))?m(c):n(c)):n(c):(e.consume(c),re(c)||(s=!0),c===92?u:p)}function u(c){return c===91||c===92||c===93?(e.consume(c),o++,p):p(c)}function m(c){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}}function sf(e,t,n){let i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),u):n(g)}function u(g){let w;return g===null||g===91||s>999?n(g):g===93?a?(w=e.exit("gfmFootnoteDefinitionLabelString"),o=De(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f):n(g):D(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),s++,u):(e.enter("chunkString").contentType="string",m(g))}function m(g){return g===null||D(g)||g===91||g===93||s>999?(e.exit("chunkString"),u(g)):(re(g)||(a=!0),s++,e.consume(g),g===92?c:m)}function c(g){return g===91||g===92||g===93?(e.consume(g),s++,m):m(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),Y(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return r.includes(o)||r.push(o),t(g)}}function af(e,t,n){return e.check(bt,t,e.attempt(tf,t,n))}function lf(e){e.exit("gfmFootnoteDefinition")}function uf(e,t,n){let i=this;return Y(e,r,"gfmFootnoteDefinitionIndent",4+1);function r(o){let s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}var pf={tokenize:cf},Ms={text:{[91]:pf}};function cf(e,t,n){let i=this;return r;function r(a){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return re(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),s):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),s):n(a)}function s(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:mf},t,n)):n(a)}}function mf(e,t,n){let i=this;return Y(e,r,"whitespace");function r(o){let s=i.events[i.events.length-1];return(s&&s[1].type==="whitespace"||D(o))&&o!==null?t(o):n(o)}}var Ul={}.hasOwnProperty;function mo(e){let t={},n=-1;for(;++n<e.length;)df(t,e[n]);return t}function df(e,t){let n;for(n in t){let r=(Ul.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;for(s in o){Ul.call(r,s)||(r[s]=[]);let a=o[s];ff(r[s],Array.isArray(a)?a:a?[a]:[])}}}function ff(e,t){let n=-1,i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Be(e,0,0,i)}var Gl={tokenize:gf,concrete:!0},hf={tokenize:yf,partial:!0};function gf(e,t,n){let i=this,r=i.events[i.events.length-1],o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(w){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),l(w)}function l(w){return w===36?(e.consume(w),s++,l):(e.exit("mathFlowFenceSequence"),s<2?n(w):Y(e,p,"whitespace")(w))}function p(w){return w===null||D(w)?m(w):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||D(w)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(w)):w===36?n(w):(e.consume(w),u)}function m(w){return e.exit("mathFlowFence"),i.interrupt?t(w):c(w)}function c(w){return w===null?h(w):D(w)?e.attempt(hf,e.attempt({tokenize:g,partial:!0},h,o?Y(e,c,"linePrefix",o+1):c),h)(w):(e.enter("mathFlowValue"),f(w))}function f(w){return w===null||D(w)?(e.exit("mathFlowValue"),c(w)):(e.consume(w),f)}function h(w){return e.exit("mathFlow"),t(w)}function g(w,y,E){let A=0;return Y(w,L,"linePrefix",4);function L(B){return w.enter("mathFlowFence"),w.enter("mathFlowFenceSequence"),M(B)}function M(B){return B===36?(w.consume(B),A++,M):A<s?E(B):(w.exit("mathFlowFenceSequence"),Y(w,T,"whitespace")(B))}function T(B){return B===null||D(B)?(w.exit("mathFlowFence"),y(B)):E(B)}}}function yf(e,t,n){let i=this;return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o}function o(s){return i.parser.lazy[i.now().line]?n(s):t(s)}}function Zl(e={}){let t=e.singleDollarTextMath;return t==null&&(t=!0),{tokenize:n,resolve:bf,previous:wf};function n(i,r,o){let s=this,a=0,l,p;return u;function u(g){return i.enter("mathText"),i.enter("mathTextSequence"),m(g)}function m(g){return g===36?(i.consume(g),a++,m):a<2&&!t?o(g):(i.exit("mathTextSequence"),c(g))}function c(g){return g===null?o(g):g===36?(p=i.enter("mathTextSequence"),l=0,h(g)):g===32?(i.enter("space"),i.consume(g),i.exit("space"),c):D(g)?(i.enter("lineEnding"),i.consume(g),i.exit("lineEnding"),c):(i.enter("mathTextData"),f(g))}function f(g){return g===null||g===32||g===36||D(g)?(i.exit("mathTextData"),c(g)):(i.consume(g),f)}function h(g){return g===36?(i.consume(g),l++,h):l===a?(i.exit("mathTextSequence"),i.exit("mathText"),r(g)):(p.type="mathTextData",f(g))}}}function bf(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)r===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(r=i):(i===t||e[i][1].type==="lineEnding")&&(e[r][1].type="mathTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),t-=i-r-2,i=r+2),r=void 0);return e}function wf(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Fs(e){return{flow:{[36]:Gl},text:{[36]:Zl(e)}}}function Ql(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:r,mathFlowFence:i,mathFlowFenceMeta:n,mathFlowValue:a,mathText:s,mathTextData:a}};function e(l){this.enter({type:"math",meta:null,value:"",data:{hName:"div",hProperties:{className:["math","math-display"]},hChildren:[{type:"text",value:""}]}},l)}function t(){this.buffer()}function n(){let l=this.resume(),p=this.stack[this.stack.length-1];p.meta=l}function i(){this.getData("mathFlowInside")||(this.buffer(),this.setData("mathFlowInside",!0))}function r(l){let p=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),u=this.exit(l);u.value=p,u.data.hChildren[0].value=p,this.setData("mathFlowInside")}function o(l){this.enter({type:"inlineMath",value:"",data:{hName:"span",hProperties:{className:["math","math-inline"]},hChildren:[{type:"text",value:""}]}},l),this.buffer()}function s(l){let p=this.resume(),u=this.exit(l);u.value=p,u.data.hChildren[0].value=p}function a(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Jl(e,t){var{includeImageAlt:n=!0}=t||{};return eu(e,n)}function eu(e,t){return e&&typeof e=="object"&&(e.value||(t?e.alt:"")||"children"in e&&Xl(e.children,t)||Array.isArray(e)&&Xl(e,t))||""}function Xl(e,t){for(var n=[],i=-1;++i<e.length;)n[i]=eu(e[i],t);return n.join("")}var tu={tokenize:xf};function xf(e){let t=e.attempt(this.parser.constructs.contentInitial,i,r),n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Y(e,t,"linePrefix")}function r(a){return e.enter("paragraph"),o(a)}function o(a){let l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return D(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var iu={tokenize:vf},nu={tokenize:kf};function vf(e){let t=this,n=[],i=0,r,o,s;return a;function a(A){if(i<n.length){let L=n[i];return t.containerState=L[1],e.attempt(L[0].continuation,l,p)(A)}return p(A)}function l(A){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&E();let L=t.events.length,M=L,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){T=t.events[M][1].end;break}y(i);let B=L;for(;B<t.events.length;)t.events[B][1].end=Object.assign({},T),B++;return Be(t.events,M+1,0,t.events.slice(L)),t.events.length=B,p(A)}return a(A)}function p(A){if(i===n.length){if(!r)return c(A);if(r.currentConstruct&&r.currentConstruct.concrete)return h(A);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nu,u,m)(A)}function u(A){return r&&E(),y(i),c(A)}function m(A){return t.parser.lazy[t.now().line]=i!==n.length,s=t.now().offset,h(A)}function c(A){return t.containerState={},e.attempt(nu,f,h)(A)}function f(A){return i++,n.push([t.currentConstruct,t.containerState]),c(A)}function h(A){if(A===null){r&&E(),y(0),e.consume(A);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:r}),g(A)}function g(A){if(A===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(A);return}return D(A)?(e.consume(A),w(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(A),g)}function w(A,L){let M=t.sliceStream(A);if(L&&M.push(null),A.previous=o,o&&(o.next=A),o=A,r.defineSkip(A.start),r.write(M),t.parser.lazy[A.start.line]){let T=r.events.length;for(;T--;)if(r.events[T][1].start.offset<s&&(!r.events[T][1].end||r.events[T][1].end.offset>s))return;let B=t.events.length,I=B,P,K;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(P){K=t.events[I][1].end;break}P=!0}for(y(i),T=B;T<t.events.length;)t.events[T][1].end=Object.assign({},K),T++;Be(t.events,I+1,0,t.events.slice(B)),t.events.length=T}}function y(A){let L=n.length;for(;L-- >A;){let M=n[L];t.containerState=M[1],M[0].exit.call(t,e)}n.length=A}function E(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function kf(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var ru={tokenize:Sf};function Sf(e){let t=this,n=e.attempt(bt,i,e.attempt(this.parser.constructs.flowInitial,r,Y(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ss,r)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var ou={resolveAll:uu()},su=lu("string"),au=lu("text");function lu(e){return{tokenize:t,resolveAll:uu(e==="text"?Tf:void 0)};function t(n){let i=this,r=this.parser.constructs[e],o=n.attempt(r,s,a);return s;function s(u){return p(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return p(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function p(u){if(u===null)return!0;let m=r[u],c=-1;if(m)for(;++c<m.length;){let f=m[c];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function uu(e){return t;function t(n,i){let r=-1,o;for(;++r<=n.length;)o===void 0?n[r]&&n[r][1].type==="data"&&(o=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==o+2&&(n[o][1].end=n[r-1][1].end,n.splice(o+2,r-o-2),r=o+2),o=void 0);return e?e(n,i):n}}function Tf(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let i=e[n-1][1],r=t.sliceStream(i),o=r.length,s=-1,a=0,l;for(;o--;){let p=r[o];if(typeof p=="string"){for(s=p.length;p.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(p===-2)l=!0,a++;else if(p!==-1){o++;break}}if(a){let p={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:i.end.line,column:i.end.column-a,offset:i.end.offset-a,_index:i.start._index+o,_bufferIndex:o?s:i.start._bufferIndex+s},end:Object.assign({},i.end)};i.end=Object.assign({},p.start),i.start.offset===i.end.offset?Object.assign(i,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}function pu(e,t,n){let i=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),r={},o=[],s=[],a=[],l=!0,p={consume:L,enter:M,exit:T,attempt:P(B),check:P(I),interrupt:P(I,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:h,now:w,defineSkip:y,write:f},m=t.tokenize.call(u,p),c;return t.resolveAll&&o.push(t),u;function f(F){return s=ze(s,F),E(),s[s.length-1]!==null?[]:(K(t,0),u.events=Dn(o,u.events,u),u.events)}function h(F,j){return Af(g(F),j)}function g(F){return Of(s,F)}function w(){return Object.assign({},i)}function y(F){r[F.line]=F.column,V()}function E(){let F;for(;i._index<s.length;){let j=s[i._index];if(typeof j=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<j.length;)A(j.charCodeAt(i._bufferIndex));else A(j)}}function A(F){l=void 0,c=F,m=m(F)}function L(F){D(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,V()):F!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),u.previous=F,l=!0}function M(F,j){let J=j||{};return J.type=F,J.start=w(),u.events.push(["enter",J,u]),a.push(J),J}function T(F){let j=a.pop();return j.end=w(),u.events.push(["exit",j,u]),j}function B(F,j){K(F,j.from)}function I(F,j){j.restore()}function P(F,j){return J;function J(Z,se,ae){let le,ne,v,b;return Array.isArray(Z)?Ke(Z):"tokenize"in Z?Ke([Z]):mt(Z);function mt(ee){return wt;function wt(ot){let dt=ot!==null&&ee[ot],Bt=ot!==null&&ee.null,qt=[...Array.isArray(dt)?dt:dt?[dt]:[],...Array.isArray(Bt)?Bt:Bt?[Bt]:[]];return Ke(qt)(ot)}}function Ke(ee){return le=ee,ne=0,ee.length===0?ae:Pe(ee[ne])}function Pe(ee){return wt;function wt(ot){return b=z(),v=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?Ve(ot):ee.tokenize.call(j?Object.assign(Object.create(u),j):u,p,rt,Ve)(ot)}}function rt(ee){return l=!0,F(v,b),se}function Ve(ee){return l=!0,b.restore(),++ne<le.length?Pe(le[ne]):ae}}}function K(F,j){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&Be(u.events,j,u.events.length-j,F.resolve(u.events.slice(j),u)),F.resolveTo&&(u.events=F.resolveTo(u.events,u))}function z(){let F=w(),j=u.previous,J=u.currentConstruct,Z=u.events.length,se=Array.from(a);return{restore:ae,from:Z};function ae(){i=F,u.previous=j,u.currentConstruct=J,u.events.length=Z,a=se,V()}}function V(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Of(e,t){let n=t.start._index,i=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex,s;return n===r?s=[e[n].slice(i,o)]:(s=e.slice(n,r),i>-1&&(s[0]=s[0].slice(i)),o>0&&s.push(e[r].slice(0,o))),s}function Af(e,t){let n=-1,i=[],r;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
||
`;break}case-3:{s=`\r
|
||
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&r)continue;s=" ";break}default:s=String.fromCharCode(o)}r=o===-2,i.push(s)}return i.join("")}var Rs={};_a(Rs,{attentionMarkers:()=>Ff,contentInitial:()=>Ef,disable:()=>Rf,document:()=>Cf,flow:()=>_f,flowInitial:()=>Lf,insideSpan:()=>Mf,string:()=>Bf,text:()=>If});var Cf={[42]:$e,[43]:$e,[45]:$e,[48]:$e,[49]:$e,[50]:$e,[51]:$e,[52]:$e,[53]:$e,[54]:$e,[55]:$e,[56]:$e,[57]:$e,[62]:io},Ef={[91]:Ts},Lf={[-2]:yi,[-1]:yi,[32]:yi},_f={[35]:As,[42]:en,[45]:[co,en],[60]:Es,[61]:co,[95]:en,[96]:so,[126]:so},Bf={[38]:oo,[92]:ro},If={[-5]:bi,[-4]:bi,[-3]:bi,[33]:_s,[38]:oo,[42]:gi,[60]:[vs,Ls],[91]:Bs,[92]:[Os,ro],[93]:Jt,[95]:gi,[96]:ks},Mf={null:[gi,ou]},Ff={null:[42,95]},Rf={null:[]};function cu(e={}){let t=mo([Rs].concat(e.extensions||[])),n={defined:[],lazy:{},constructs:t,content:i(tu),document:i(iu),flow:i(ru),string:i(su),text:i(au)};return n;function i(r){return o;function o(s){return pu(n,r,s)}}}var mu=/[\0\t\n\r]/g;function du(){let e=1,t="",n=!0,i;return r;function r(o,s,a){let l=[],p,u,m,c,f;for(o=t+o.toString(s),m=0,t="",n&&(o.charCodeAt(0)===65279&&m++,n=void 0);m<o.length;){if(mu.lastIndex=m,p=mu.exec(o),c=p&&p.index!==void 0?p.index:o.length,f=o.charCodeAt(c),!p){t=o.slice(m);break}if(f===10&&m===c&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),m<c&&(l.push(o.slice(m,c)),e+=c-m),f){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:i=!0,e=1}m=c+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}function fu(e){for(;!ao(e););return e}function fo(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCharCode(n)}var Df=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hu(e){return e.replace(Df,$f)}function $f(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let r=n.charCodeAt(1),o=r===120||r===88;return fo(n.slice(o?2:1),o?16:10)}return $n(n)||e}function wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gu(e.position):"start"in e||"end"in e?gu(e):"line"in e||"column"in e?Ds(e):""}function Ds(e){return yu(e&&e.line)+":"+yu(e&&e.column)}function gu(e){return Ds(e&&e.start)+"-"+Ds(e&&e.end)}function yu(e){return e&&typeof e=="number"?e:1}var $s={}.hasOwnProperty,Ps=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Pf(n)(fu(cu(n).document().write(du()(e,t,!0))))};function Pf(e={}){let t=wu({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Kt),autolinkProtocol:V,autolinkEmail:V,atxHeading:l(Un),blockQuote:l(Bt),characterEscape:V,characterReference:V,codeFenced:l(qt),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:l(qt,p),codeText:l(jo,p),codeTextData:V,data:V,codeFlowValue:V,definition:l(Wo),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:l(kr),hardBreakEscape:l(Sr),hardBreakTrailing:l(Sr),htmlFlow:l(Tr,p),htmlFlowData:V,htmlText:l(Tr,p),htmlTextData:V,image:l(xt),label:p,link:l(Kt),listItem:l(Or),listItemValue:g,listOrdered:l(Gn,h),listUnordered:l(Gn),paragraph:l(Zn),reference:rt,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:l(Un),strong:l(Ar),thematicBreak:l(Er)},exit:{atxHeading:m(),atxHeadingSequence:I,autolink:m(),autolinkEmail:dt,autolinkProtocol:ot,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:wt,codeFenced:m(A),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:y,codeFlowValue:F,codeIndented:m(L),codeText:m(ae),codeTextData:F,data:F,definition:m(),definitionDestinationString:B,definitionLabelString:M,definitionTitleString:T,emphasis:m(),hardBreakEscape:m(J),hardBreakTrailing:m(J),htmlFlow:m(Z),htmlFlowData:F,htmlText:m(se),htmlTextData:F,image:m(ne),label:b,labelText:v,lineEnding:j,link:m(le),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Ve,resourceDestinationString:mt,resourceTitleString:Ke,resource:Pe,setextHeading:m(z),setextHeadingLineSequence:K,setextHeadingText:P,strong:m(),thematicBreak:m()}},e.mdastExtensions||[]),n={};return i;function i(C){let R={type:"root",children:[]},q=[R],Q=[],Xe=[],Qn={stack:q,tokenStack:Q,config:t,enter:u,exit:c,buffer:p,resume:f,setData:o,getData:s},ie=-1;for(;++ie<C.length;)if(C[ie][1].type==="listOrdered"||C[ie][1].type==="listUnordered")if(C[ie][0]==="enter")Xe.push(ie);else{let Le=Xe.pop();ie=r(C,Le,ie)}for(ie=-1;++ie<C.length;){let Le=t[C[ie][0]];$s.call(Le,C[ie][1].type)&&Le[C[ie][1].type].call(Object.assign({sliceSerialize:C[ie][2].sliceSerialize},Qn),C[ie][1])}if(Q.length>0){let Le=Q[Q.length-1];(Le[1]||bu).call(Qn,void 0,Le[0])}for(R.position={start:a(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:a(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},ie=-1;++ie<t.transforms.length;)R=t.transforms[ie](R)||R;return R}function r(C,R,q){let Q=R-1,Xe=-1,Qn=!1,ie,Le,Tn,Xn;for(;++Q<=q;){let ce=C[Q];if(ce[1].type==="listUnordered"||ce[1].type==="listOrdered"||ce[1].type==="blockQuote"?(ce[0]==="enter"?Xe++:Xe--,Xn=void 0):ce[1].type==="lineEndingBlank"?ce[0]==="enter"&&(ie&&!Xn&&!Xe&&!Tn&&(Tn=Q),Xn=void 0):ce[1].type==="linePrefix"||ce[1].type==="listItemValue"||ce[1].type==="listItemMarker"||ce[1].type==="listItemPrefix"||ce[1].type==="listItemPrefixWhitespace"||(Xn=void 0),!Xe&&ce[0]==="enter"&&ce[1].type==="listItemPrefix"||Xe===-1&&ce[0]==="exit"&&(ce[1].type==="listUnordered"||ce[1].type==="listOrdered")){if(ie){let Uo=Q;for(Le=void 0;Uo--;){let vt=C[Uo];if(vt[1].type==="lineEnding"||vt[1].type==="lineEndingBlank"){if(vt[0]==="exit")continue;Le&&(C[Le][1].type="lineEndingBlank",Qn=!0),vt[1].type="lineEnding",Le=Uo}else if(!(vt[1].type==="linePrefix"||vt[1].type==="blockQuotePrefix"||vt[1].type==="blockQuotePrefixWhitespace"||vt[1].type==="blockQuoteMarker"||vt[1].type==="listItemIndent"))break}Tn&&(!Le||Tn<Le)&&(ie._spread=!0),ie.end=Object.assign({},Le?C[Le][1].start:ce[1].end),C.splice(Le||Q,0,["exit",ie,ce[2]]),Q++,q++}ce[1].type==="listItemPrefix"&&(ie={type:"listItem",_spread:!1,start:Object.assign({},ce[1].start)},C.splice(Q,0,["enter",ie,ce[2]]),Q++,q++,Tn=void 0,Xn=!0)}}return C[R][1]._spread=Qn,q}function o(C,R){n[C]=R}function s(C){return n[C]}function a(C){return{line:C.line,column:C.column,offset:C.offset}}function l(C,R){return q;function q(Q){u.call(this,C(Q),Q),R&&R.call(this,Q)}}function p(){this.stack.push({type:"fragment",children:[]})}function u(C,R,q){return this.stack[this.stack.length-1].children.push(C),this.stack.push(C),this.tokenStack.push([R,q]),C.position={start:a(R.start)},C}function m(C){return R;function R(q){C&&C.call(this,q),c.call(this,q)}}function c(C,R){let q=this.stack.pop(),Q=this.tokenStack.pop();if(Q)Q[0].type!==C.type&&(R?R.call(this,C,Q[0]):(Q[1]||bu).call(this,C,Q[0]));else throw new Error("Cannot close `"+C.type+"` ("+wi({start:C.start,end:C.end})+"): it\u2019s not open");return q.position.end=a(C.end),q}function f(){return Jl(this.stack.pop())}function h(){o("expectingFirstListItemValue",!0)}function g(C){if(s("expectingFirstListItemValue")){let R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(C),10),o("expectingFirstListItemValue")}}function w(){let C=this.resume(),R=this.stack[this.stack.length-1];R.lang=C}function y(){let C=this.resume(),R=this.stack[this.stack.length-1];R.meta=C}function E(){s("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))}function A(){let C=this.resume(),R=this.stack[this.stack.length-1];R.value=C.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")}function L(){let C=this.resume(),R=this.stack[this.stack.length-1];R.value=C.replace(/(\r?\n|\r)$/g,"")}function M(C){let R=this.resume(),q=this.stack[this.stack.length-1];q.label=R,q.identifier=De(this.sliceSerialize(C)).toLowerCase()}function T(){let C=this.resume(),R=this.stack[this.stack.length-1];R.title=C}function B(){let C=this.resume(),R=this.stack[this.stack.length-1];R.url=C}function I(C){let R=this.stack[this.stack.length-1];if(!R.depth){let q=this.sliceSerialize(C).length;R.depth=q}}function P(){o("setextHeadingSlurpLineEnding",!0)}function K(C){let R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(C).charCodeAt(0)===61?1:2}function z(){o("setextHeadingSlurpLineEnding")}function V(C){let R=this.stack[this.stack.length-1],q=R.children[R.children.length-1];(!q||q.type!=="text")&&(q=Cr(),q.position={start:a(C.start)},R.children.push(q)),this.stack.push(q)}function F(C){let R=this.stack.pop();R.value+=this.sliceSerialize(C),R.position.end=a(C.end)}function j(C){let R=this.stack[this.stack.length-1];if(s("atHardBreak")){let q=R.children[R.children.length-1];q.position.end=a(C.end),o("atHardBreak");return}!s("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(R.type)&&(V.call(this,C),F.call(this,C))}function J(){o("atHardBreak",!0)}function Z(){let C=this.resume(),R=this.stack[this.stack.length-1];R.value=C}function se(){let C=this.resume(),R=this.stack[this.stack.length-1];R.value=C}function ae(){let C=this.resume(),R=this.stack[this.stack.length-1];R.value=C}function le(){let C=this.stack[this.stack.length-1];s("inReference")?(C.type+="Reference",C.referenceType=s("referenceType")||"shortcut",delete C.url,delete C.title):(delete C.identifier,delete C.label),o("referenceType")}function ne(){let C=this.stack[this.stack.length-1];s("inReference")?(C.type+="Reference",C.referenceType=s("referenceType")||"shortcut",delete C.url,delete C.title):(delete C.identifier,delete C.label),o("referenceType")}function v(C){let R=this.stack[this.stack.length-2],q=this.sliceSerialize(C);R.label=hu(q),R.identifier=De(q).toLowerCase()}function b(){let C=this.stack[this.stack.length-1],R=this.resume(),q=this.stack[this.stack.length-1];o("inReference",!0),q.type==="link"?q.children=C.children:q.alt=R}function mt(){let C=this.resume(),R=this.stack[this.stack.length-1];R.url=C}function Ke(){let C=this.resume(),R=this.stack[this.stack.length-1];R.title=C}function Pe(){o("inReference")}function rt(){o("referenceType","collapsed")}function Ve(C){let R=this.resume(),q=this.stack[this.stack.length-1];q.label=R,q.identifier=De(this.sliceSerialize(C)).toLowerCase(),o("referenceType","full")}function ee(C){o("characterReferenceType",C.type)}function wt(C){let R=this.sliceSerialize(C),q=s("characterReferenceType"),Q;q?(Q=fo(R,q==="characterReferenceMarkerNumeric"?10:16),o("characterReferenceType")):Q=$n(R);let Xe=this.stack.pop();Xe.value+=Q,Xe.position.end=a(C.end)}function ot(C){F.call(this,C);let R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(C)}function dt(C){F.call(this,C);let R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(C)}function Bt(){return{type:"blockquote",children:[]}}function qt(){return{type:"code",lang:null,meta:null,value:""}}function jo(){return{type:"inlineCode",value:""}}function Wo(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kr(){return{type:"emphasis",children:[]}}function Un(){return{type:"heading",depth:void 0,children:[]}}function Sr(){return{type:"break"}}function Tr(){return{type:"html",value:""}}function xt(){return{type:"image",title:null,url:"",alt:null}}function Kt(){return{type:"link",title:null,url:"",children:[]}}function Gn(C){return{type:"list",ordered:C.type==="listOrdered",start:null,spread:C._spread,children:[]}}function Or(C){return{type:"listItem",spread:C._spread,checked:null,children:[]}}function Zn(){return{type:"paragraph",children:[]}}function Ar(){return{type:"strong",children:[]}}function Cr(){return{type:"text",value:""}}function Er(){return{type:"thematicBreak"}}}function wu(e,t){let n=-1;for(;++n<t.length;){let i=t[n];Array.isArray(i)?wu(e,i):Nf(e,i)}return e}function Nf(e,t){let n;for(n in t)if($s.call(t,n)){let i=n==="canContainEols"||n==="transforms",o=($s.call(e,n)?e[n]:void 0)||(e[n]=i?[]:{}),s=t[n];s&&(i?e[n]=[...o,...s]:Object.assign(o,s))}}function bu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wi({start:t.start,end:t.end})+") is still open")}function xu(){return{enter:{gfmFootnoteDefinition:e,gfmFootnoteDefinitionLabelString:t,gfmFootnoteCall:r,gfmFootnoteCallString:o},exit:{gfmFootnoteDefinition:i,gfmFootnoteDefinitionLabelString:n,gfmFootnoteCall:a,gfmFootnoteCallString:s}};function e(l){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},l)}function t(){this.buffer()}function n(l){let p=this.resume(),u=this.stack[this.stack.length-1];u.label=p,u.identifier=De(this.sliceSerialize(l)).toLowerCase()}function i(l){this.exit(l)}function r(l){this.enter({type:"footnoteReference",identifier:"",label:""},l)}function o(){this.buffer()}function s(l){let p=this.resume(),u=this.stack[this.stack.length-1];u.label=p,u.identifier=De(this.sliceSerialize(l)).toLowerCase()}function a(l){this.exit(l)}}var ku={exit:{taskListCheckValueChecked:vu,taskListCheckValueUnchecked:vu,paragraph:Hf}};function vu(e){let t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function Hf(e){let t=this.stack[this.stack.length-2],n=this.stack[this.stack.length-1],i=t.children,r=n.children[0],o=-1,s;if(t&&t.type==="listItem"&&typeof t.checked=="boolean"&&r&&r.type==="text"){for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}this.exit(e)}var xi=class extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(let[n,i]of t)this.onEviction(n,i.value)}_deleteIfExpired(t,n){return typeof n.expiry=="number"&&n.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,n.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,n){if(this._deleteIfExpired(t,n)===!1)return n.value}_getItemValue(t,n){return n.expiry?this._getOrDeleteIfExpired(t,n):n.value}_peek(t,n){let i=n.get(t);return this._getItemValue(t,i)}_set(t,n){this.cache.set(t,n),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,n){this.oldCache.delete(t),this._set(t,n)}*_entriesAscending(){for(let t of this.oldCache){let[n,i]=t;this.cache.has(n)||this._deleteIfExpired(n,i)===!1&&(yield t)}for(let t of this.cache){let[n,i]=t;this._deleteIfExpired(n,i)===!1&&(yield t)}}get(t){if(this.cache.has(t)){let n=this.cache.get(t);return this._getItemValue(t,n)}if(this.oldCache.has(t)){let n=this.oldCache.get(t);if(this._deleteIfExpired(t,n)===!1)return this._moveToRecent(t,n),n.value}}set(t,n,{maxAge:i=this.maxAge}={}){let r=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;this.cache.has(t)?this.cache.set(t,{value:n,expiry:r}):this._set(t,{value:n,expiry:r})}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){let n=this.cache.delete(t);return n&&this._size--,this.oldCache.delete(t)||n}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");let n=[...this._entriesAscending()],i=n.length-t;i<0?(this.cache=new Map(n),this.oldCache=new Map,this._size=n.length):(i>0&&this._emitEvictions(n.slice(0,i)),this.oldCache=new Map(n.slice(i)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(let[t]of this)yield t}*values(){for(let[,t]of this)yield t}*[Symbol.iterator](){for(let t of this.cache){let[n,i]=t;this._deleteIfExpired(n,i)===!1&&(yield[n,i.value])}for(let t of this.oldCache){let[n,i]=t;this.cache.has(n)||this._deleteIfExpired(n,i)===!1&&(yield[n,i.value])}}*entriesDescending(){let t=[...this.cache];for(let n=t.length-1;n>=0;--n){let i=t[n],[r,o]=i;this._deleteIfExpired(r,o)===!1&&(yield[r,o.value])}t=[...this.oldCache];for(let n=t.length-1;n>=0;--n){let i=t[n],[r,o]=i;this.cache.has(r)||this._deleteIfExpired(r,o)===!1&&(yield[r,o.value])}}*entriesAscending(){for(let[t,n]of this._entriesAscending())yield[t,n.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(let n of this.oldCache.keys())this.cache.has(n)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,n=this){for(let[i,r]of this.entriesAscending())t.call(n,r,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};var Ns=new xi({maxSize:200});function zf(e){let t=Sl(e);if(Ns.has(t))return Ns.get(t);let n=Ps(e,{extensions:[mo([Is(),Ms]),Fs()],mdastExtensions:[[xu(),ku],Ql()]});return Ns.set(t,n),n}function be(e,t){let n=zf(t),i=[];return Nl(n,e,r=>{i.push(r.position)}),i.sort((r,o)=>o.start.offset-r.start.offset),i}function Su(e){let t=be("footnoteDefinition",e),n=[],i=new Set,r=new Map,o=function(s,a){let l=s.match(/\[\^.*?\]/)[0],p;do p=e.lastIndexOf(l,a),a=p;while(i.has(p)&&p!==-1);if(p===-1)throw new Error(`Footnote '${s}' has no corresponding footnote reference before the footnote contents and cannot be processed. Please make sure that all footnotes have a corresponding reference before the content of the footnote.`);return i.add(p),p};for(let s of t){let a=e.substring(s.start.offset,s.end.offset);n.push(a),s.end.offset<e.length&&e[s.end.offset]===`
|
||
`&&(e=e.substring(0,s.end.offset)+e.substring(s.end.offset+1)),s.end.offset<e.length&&e[s.end.offset]===`
|
||
`&&(e=e.substring(0,s.end.offset)+e.substring(s.end.offset+1)),e=e.substring(0,s.start.offset)+e.substring(s.end.offset),r.set(a,o(a,s.start.offset))}n=n.sort((s,a)=>r.get(s)-r.get(a)),n.length>0&&(e=e.trimEnd()+`
|
||
`);for(let s of n)e+=`
|
||
`+s;return e}function ho(e,t,n){let i=be(n,e);if(i.length===0)return e;let r="";if(t==="underscore")r="_";else if(t==="asterisk")r="*";else{let o=i[i.length-1];r=e.substring(o.start.offset,o.start.offset+1)}n==="strong"&&(r+=r);for(let o of i){let s=r+e.substring(o.start.offset+r.length,o.end.offset-r.length)+r;e=ve(e,o.start.offset,o.end.offset,s)}return e}function Tu(e){let t=be("paragraph",e);if(t.length===0)return e;for(let n of t){let i=e.substring(n.start.offset,n.end.offset).split(`
|
||
`),r=i.length-1;if(!(r<1)){for(let o=0;o<r;o++){let s=i[o].trimEnd();s.endsWith("<br>")||s.endsWith("<br/>")||(i[o]=s+" ")}e=ve(e,n.start.offset,n.end.offset,i.join(`
|
||
`))}}return e}function Ou(e){let t=e.endsWith(`
|
||
`),n=be("paragraph",e);if(n.length===0)return e;for(let i of n){let r=i.start.offset;for(r>0&&r--;r>=0&&e.charAt(r)!=`
|
||
`;)r--;r++;let o=e.substring(r,i.end.offset).split(`
|
||
`),s=o[0].trimStart();if(s.startsWith("> ")||s.startsWith("> ")||s.startsWith("- ")||s.startsWith("- ")||s.match(/^[0-9]+\.( |\t)+/))continue;let a=o.length,l=[],p=!1;for(let h=0;h<a;h++){let g=o[h];if(p){let w=l.length-1;l[w]+=`
|
||
`+g}else l.push(g);p=g.endsWith("<br>")||g.endsWith("<br/>")||g.endsWith(" ")}for(;r>0&&e.charAt(r-1)==`
|
||
`;)r--;let u=e.length,m=i.end.offset;for(m<u&&m++;m<u&&e.charAt(m)==`
|
||
`;)m++;let c=`
|
||
|
||
`;r==0&&(c="");let f=`
|
||
|
||
`;m==u&&(f=""),e=ve(e,r,m,c+l.join(`
|
||
|
||
`)+f)}return t&&!e.endsWith(`
|
||
`)&&(e+=`
|
||
`),e}function Au(e){let t=be("link",e);for(let n of t){if(n==null)continue;let i=e.substring(n.start.offset,n.end.offset);if(!i.match(oi))continue;let r=i.indexOf("]"),o=i.substring(0,1)+i.substring(1,r).trim()+i.substring(r);e=ve(e,n.start.offset,n.end.offset,o)}return e}function Cu(e,t){let n=be("emphasis",e);for(let i of n){let r=e.substring(i.start.offset+1,i.end.offset-1);r=t(r),e=ve(e,i.start.offset+1,i.end.offset-1,r)}return e}function Eu(e,t){let n=be("strong",e);for(let i of n){let r=e.substring(i.start.offset+2,i.end.offset-2);r=t(r),e=ve(e,i.start.offset+2,i.end.offset-2,r)}return e}function Lu(e,t){let n=be("listItem",e);for(let i of n){let r=e.substring(i.start.offset+2,i.end.offset),o=/\n(( |\t)*>?)*(\*|-|\+|- \[( | x)\]|\d+\.) /g,s=r.match(o);if(s){let a=r.split(new RegExp(o.source.replaceAll("(","(?:"))),l="",p=0;for(let u of a)p>0&&(l+=s[p-1]),l+=t(u),p++;r=l}else r=t(r);e=ve(e,i.start.offset+2,i.end.offset,r)}return e}function _u(e){let t=be("code",e);for(let n of t)!e.substring(n.start.offset,n.end.offset).startsWith("```")||(e=Ut(e,n.start.offset,n.end.offset));return e}function Bu(e,t){let n=be("math",e);for(let i of n)e=Ut(e,i.start.offset,i.end.offset);n=be("inlineMath",e);for(let i of n)!e.substring(i.start.offset,i.end.offset).startsWith("$".repeat(t))||(e=Ut(e,i.start.offset,i.end.offset));return e}function Iu(e){let t=be("blockquote",e);for(let n of t)e=Ut(e,n.start.offset,n.end.offset,!0);return e}function Mu(e,t,n){let i=be("list",e);if(!i)return e;for(let r of i){let o=r.start.offset;for(;o>0&&e.charAt(o-1)!==`
|
||
`;)o--;let s=e.substring(o,r.end.offset),a=function(u){let m=u.lastIndexOf("> ");return m!==-1&&(u=u.substring(m+2)),u=u.replaceAll(" "," "),Math.floor((u.split(" ").length-1)/2)+1},l=new Map,p=-1;s=s.replace(/^(( |\t|> )*)(\d+(\.|\)))([^\n]*)$/gm,(u,m="",c,f,h,g)=>{let w=1,y=a(m);if(l.has(y)?t==="ascending"&&(w=l.get(y)+1,l.set(y,w)):l.set(y,1),p>y){let E=p;for(;E>y;)l.delete(E--)}return p=y,`${m}${w}${n}${g}`}),e=ve(e,o,r.end.offset,s)}return e}function Fu(e,t){let n=be("listItem",e);if(!n)return e;let i=/^((\d+[.)])|(- \[[ x]\]))/m,r=t;if(t=="consistent"){let o=n.length-1;for(;o>=0;){let s=e.substring(n[o].start.offset,n[o].end.offset);if(o--,!s.match(i)){r=s.charAt(0);break}}if(o==-1)return e}for(let o of n){let s=e.substring(o.start.offset,o.end.offset);s.match(i)||(s=r+s.substring(1),e=ve(e,o.start.offset,o.end.offset,s))}return e}function Ru(e,t){let n=be("math",e),i=new RegExp("^(\\${"+t+",})(\\n*)"),r=new RegExp("(\\n*)(\\${"+t+",})([^\\$]*)$");for(let o of n){let s=e.substring(o.start.offset,o.end.offset);s=s.replace(i,`$1
|
||
`),s=s.replace(r,`
|
||
$2$3`),e=ve(e,o.start.offset,o.end.offset,s)}n=be("inlineMath",e);for(let o of n){if(!e.substring(o.start.offset,o.end.offset).startsWith("$".repeat(t)))continue;let s=e.substring(o.start.offset,o.end.offset);s=s.replace(i,`$1
|
||
`),s=s.replace(r,`
|
||
$2$3`),e=ve(e,o.start.offset,o.end.offset,s)}return e}var k={code:{replaceAction:"code",placeholder:"{CODE_BLOCK_PLACEHOLDER}"},inlineCode:{replaceAction:"inlineCode",placeholder:"{INLINE_CODE_BLOCK_PLACEHOLDER}"},image:{replaceAction:"image",placeholder:"{IMAGE_PLACEHOLDER}"},thematicBreak:{replaceAction:"thematicBreak",placeholder:"{HORIZONTAL_RULE_PLACEHOLDER}"},italics:{replaceAction:"emphasis",placeholder:"{ITALICS_PLACEHOLDER}"},bold:{replaceAction:"strong",placeholder:"{STRONG_PLACEHOLDER}"},list:{replaceAction:"list",placeholder:"{LIST_PLACEHOLDER}"},blockquote:{replaceAction:"blockquote",placeholder:"{BLOCKQUOTE_PLACEHOLDER}"},math:{replaceAction:"math",placeholder:"{MATH_PLACEHOLDER}"},inlineMath:{replaceAction:"inlineMath",placeholder:"{INLINE_MATH_PLACEHOLDER}"},html:{replaceAction:"html",placeholder:"{HTML_PLACEHOLDER}"},yaml:{replaceAction:ke,placeholder:We(`---
|
||
---`)},wikiLink:{replaceAction:Dr,placeholder:"{WIKI_LINK_PLACEHOLDER}"},tag:{replaceAction:si,placeholder:"#tag-placeholder"},obsidianMultiLineComments:{replaceAction:Al,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},table:{replaceAction:ps,placeholder:"{TABLE_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:/^(\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},link:{replaceAction:Kf,placeholder:"{REGULAR_LINK_PLACEHOLDER}"}};function $(e,t,n){let i=[];for(let r of e){let o;if(typeof r.replaceAction=="string")o=Yf(t,r.placeholder,r.replaceAction);else if(r.replaceAction instanceof RegExp)o=qf(t,r.placeholder,r.replaceAction);else if(typeof r.replaceAction=="function"){let s=r.replaceAction;o=s(t,r.placeholder)}t=o.newText,i.push({replacedValues:o.replacedValues,placeholder:r.placeholder})}return t=n(t),i=i.reverse(),i!=null&&i.length>0&&i.forEach(r=>{r.replacedValues.forEach(o=>{t=t.replace(new RegExp(r.placeholder,"i"),We(o))})}),t}function Yf(e,t,n){let i=be(n,e),r=[];for(let o of i){let s=e.substring(o.start.offset,o.end.offset);r.push(s),e=ve(e,o.start.offset,o.end.offset,t)}return r.reverse(),{newText:e,replacedValues:r}}function qf(e,t,n){let i=e.match(n),r=[];if(n.flags.includes("g")){if(e=e.replaceAll(n,t),i)for(let o of i)r.push(o)}else e=e.replace(n,t),i&&r.push(i[0]);return{newText:e,replacedValues:r}}function Kf(e,t){let n=be("link",e),i=[];for(let r of n){if(r==null)continue;let o=e.substring(r.start.offset,r.end.offset);!o.match(oi)||(i.push(o),e=ve(e,r.start.offset,r.end.offset,t))}return i.reverse(),{newText:e,replacedValues:i}}var tn=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript","I"];this.lowercaseWords=["via","a","an","the","and","or","but","for","nor","so","yet","at","by","in","of","on","to","up","as","is","if","it","for","to","with","without","into","onto","per"];this.ignoreCasedWords=!0}},vi=class extends S{get OptionsClass(){return tn}get name(){return"Capitalize Headings"}get description(){return"Headings should be formatted with capitalization"}get type(){return"Heading"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(Rt,r=>{if(n.style==="ALL CAPS")return r.toUpperCase();let o=n.style==="First letter",s=r.match(/\S+/g),a=n.ignoreWords,l=n.lowercaseWords,p=!0;for(let u=1;u<s.length;u++){if(!s[u].match(/^[\p{L}'-]{1,}[.?!,:;]?$/u))continue;if(n.ignoreCasedWords&&s[u]!==s[u].toLowerCase()||a.includes(s[u])||(s[u]=s[u].toLowerCase(),(!l.includes(s[u])&&!o||p===!0)&&(s[u]=s[u][0].toUpperCase()+s[u].slice(1))),p=!1,n.ignoreCasedWords&&o)break}return s.join(" ")}))}get exampleBuilders(){return[new x({description:"With `Title Case=true`, `Ignore Cased Words=false`",before:d`
|
||
# this is a heading 1
|
||
## THIS IS A HEADING 2
|
||
### a heading 3
|
||
`,after:d`
|
||
# This is a Heading 1
|
||
## This is a Heading 2
|
||
### A Heading 3
|
||
`,options:{style:"Title Case",ignoreCasedWords:!1}}),new x({description:"With `Title Case=true`, `Ignore Cased Words=true`",before:d`
|
||
# this is a heading 1
|
||
## THIS IS A HEADING 2
|
||
### a hEaDiNg 3
|
||
`,after:d`
|
||
# This is a Heading 1
|
||
## THIS IS A HEADING 2
|
||
### A hEaDiNg 3
|
||
`,options:{style:"Title Case",ignoreCasedWords:!0}}),new x({description:"With `First letter=true`",before:d`
|
||
# this is a heading 1
|
||
## this is a heading 2
|
||
`,after:d`
|
||
# This is a heading 1
|
||
## This is a heading 2
|
||
`,options:{style:"First letter"}}),new x({description:"With `ALL CAPS=true`",before:d`
|
||
# this is a heading 1
|
||
## this is a heading 2
|
||
`,after:d`
|
||
# THIS IS A HEADING 1
|
||
## THIS IS A HEADING 2
|
||
`,options:{style:"ALL CAPS"}})]}get optionBuilders(){return[new ye({OptionsClass:tn,name:"Style",description:"The style of capitalization to use",optionsKey:"style",records:[{value:"Title Case",description:"Capitalize Using Title Case Rules"},{value:"ALL CAPS",description:"CAPITALIZE THE WHOLE TITLE"},{value:"First letter",description:"Only capitalize the first letter"}]}),new U({OptionsClass:tn,name:"Ignore Cased Words",description:"Only apply title case style to words that are all lowercase",optionsKey:"ignoreCasedWords"}),new Ae({OptionsClass:tn,name:"Ignore Words",description:"A comma separated list of words to ignore when capitalizing",optionsKey:"ignoreWords",splitter:us,separator:", "}),new Ae({OptionsClass:tn,name:"Lowercase Words",description:"A comma separated list of words to keep lowercase",optionsKey:"lowercaseWords",splitter:us,separator:", "})]}};vi=O([S.register],vi);var go=class{constructor(){this.innerNewLines=!1}},ki=class extends S{get OptionsClass(){return go}get name(){return"Compact YAML"}get description(){return"Removes leading and trailing blank lines in the YAML front matter."}get type(){return"Spacing"}apply(t,n){return Se(t,i=>(i=i.replace(/^---\n+/,`---
|
||
`),i=i.replace(/\n+---/,`
|
||
---`),n.innerNewLines&&(i=i.replaceAll(/\n{2,}/g,`
|
||
`)),i))}get exampleBuilders(){return[new x({description:"Remove blank lines at the start and end of the YAML",before:d`
|
||
---
|
||
${""}
|
||
date: today
|
||
${""}
|
||
title: unchanged without inner new lines turned on
|
||
${""}
|
||
---
|
||
`,after:d`
|
||
---
|
||
date: today
|
||
${""}
|
||
title: unchanged without inner new lines turned on
|
||
---
|
||
`}),new x({description:"Remove blank lines anywhere in YAML with inner new lines set to true",before:d`
|
||
---
|
||
${""}
|
||
date: today
|
||
${""}
|
||
${""}
|
||
title: remove inner new lines
|
||
${""}
|
||
---
|
||
${""}
|
||
# Header 1
|
||
${""}
|
||
${""}
|
||
Body content here.
|
||
`,after:d`
|
||
---
|
||
date: today
|
||
title: remove inner new lines
|
||
---
|
||
${""}
|
||
# Header 1
|
||
${""}
|
||
${""}
|
||
Body content here.
|
||
`,options:{innerNewLines:!0}})]}get optionBuilders(){return[new U({OptionsClass:go,name:"Inner New Lines",description:"Remove new lines that are not at the start or the end of the YAML",optionsKey:"innerNewLines"})]}};ki=O([S.register],ki);var Hs=class{},Si=class extends S{get OptionsClass(){return Hs}get name(){return"Consecutive blank lines"}get description(){return"There should be at most one consecutive blank line."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(/(\n([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?){2,}\n/g,`
|
||
|
||
`))}get exampleBuilders(){return[new x({description:"",before:d`
|
||
Some text
|
||
${""}
|
||
${""}
|
||
Some more text
|
||
`,after:d`
|
||
Some text
|
||
${""}
|
||
Some more text
|
||
`})]}get optionBuilders(){return[]}};Si=O([S.register],Si);var zs=class{},Ti=class extends S{get OptionsClass(){return zs}get name(){return"Convert Bullet List Markers"}get description(){return"Converts common bullet list marker symbols to markdown list markers."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3"))}get exampleBuilders(){return[new x({description:"Converts \u2022",before:d`
|
||
• item 1
|
||
• item 2
|
||
`,after:d`
|
||
- item 1
|
||
- item 2
|
||
`}),new x({description:"Converts \xA7",before:d`
|
||
• item 1
|
||
§ item 2
|
||
§ item 3
|
||
`,after:d`
|
||
- item 1
|
||
- item 2
|
||
- item 3
|
||
`})]}get optionBuilders(){return[]}};Ti=O([S.register],Ti);var yo=class{constructor(){this.tabsize=4}},Oi=class extends S{get OptionsClass(){return yo}get name(){return"Convert Spaces to Tabs"}get description(){return"Converts leading spaces to tabs."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>{let r=String(n.tabsize),o=new RegExp("^( *) {"+String(r)+"}","gm");for(;i.match(o)!=null;)i=i.replace(o,"$1 ");return i})}get exampleBuilders(){return[new x({description:"Converting spaces to tabs with `tabsize = 3`",before:d`
|
||
- text with no indention
|
||
- text indented with 3 spaces
|
||
- text with no indention
|
||
- text indented with 6 spaces
|
||
`,after:d`
|
||
- text with no indention
|
||
\t- text indented with 3 spaces
|
||
- text with no indention
|
||
\t\t- text indented with 6 spaces
|
||
`,options:{tabsize:3}})]}get optionBuilders(){return[new Jr({OptionsClass:yo,name:"Tabsize",description:"Number of spaces that will be converted to a tab",optionsKey:"tabsize"})]}};Oi=O([S.register],Oi);var bo=class{constructor(){this.style="consistent"}},Ai=class extends S{get OptionsClass(){return bo}get name(){return"Emphasis Style"}get description(){return"Makes sure the emphasis style is consistent."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.math,k.inlineMath],t,i=>ho(i,n.style,"emphasis"))}get exampleBuilders(){return[new x({description:"Emphasis indicators should use underscores when style is set to 'underscore'",before:d`
|
||
# Emphasis Cases
|
||
${""}
|
||
*Test emphasis*
|
||
* Test not emphasized *
|
||
This is *emphasized* mid sentence
|
||
This is *emphasized* mid sentence with a second *emphasis* on the same line
|
||
This is ***bold and emphasized***
|
||
This is ***nested bold** and ending emphasized*
|
||
This is ***nested emphasis* and ending bold**
|
||
${""}
|
||
**Test bold**
|
||
${""}
|
||
* List Item1 with *emphasized text*
|
||
* List Item2
|
||
`,after:d`
|
||
# Emphasis Cases
|
||
${""}
|
||
_Test emphasis_
|
||
* Test not emphasized *
|
||
This is _emphasized_ mid sentence
|
||
This is _emphasized_ mid sentence with a second _emphasis_ on the same line
|
||
This is _**bold and emphasized**_
|
||
This is _**nested bold** and ending emphasized_
|
||
This is **_nested emphasis_ and ending bold**
|
||
${""}
|
||
**Test bold**
|
||
${""}
|
||
* List Item1 with _emphasized text_
|
||
* List Item2
|
||
`,options:{style:"underscore"}}),new x({description:"Emphasis indicators should use asterisks when style is set to 'asterisk'",before:d`
|
||
# Emphasis Cases
|
||
${""}
|
||
_Test emphasis_
|
||
_ Test not emphasized _
|
||
This is _emphasized_ mid sentence
|
||
This is _emphasized_ mid sentence with a second _emphasis_ on the same line
|
||
This is ___bold and emphasized___
|
||
This is ___nested bold__ and ending emphasized_
|
||
This is ___nested emphasis_ and ending bold__
|
||
${""}
|
||
__Test bold__
|
||
`,after:d`
|
||
# Emphasis Cases
|
||
${""}
|
||
*Test emphasis*
|
||
_ Test not emphasized _
|
||
This is *emphasized* mid sentence
|
||
This is *emphasized* mid sentence with a second *emphasis* on the same line
|
||
This is *__bold and emphasized__*
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is __*nested emphasis* and ending bold__
|
||
${""}
|
||
__Test bold__
|
||
`,options:{style:"asterisk"}}),new x({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:d`
|
||
# Emphasis First Emphasis Is an Asterisk
|
||
${""}
|
||
*First emphasis*
|
||
This is _emphasized_ mid sentence
|
||
This is *emphasized* mid sentence with a second _emphasis_ on the same line
|
||
This is *__bold and emphasized__*
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is **_nested emphasis_ and ending bold**
|
||
${""}
|
||
__Test bold__
|
||
`,after:d`
|
||
# Emphasis First Emphasis Is an Asterisk
|
||
${""}
|
||
*First emphasis*
|
||
This is *emphasized* mid sentence
|
||
This is *emphasized* mid sentence with a second *emphasis* on the same line
|
||
This is *__bold and emphasized__*
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is ***nested emphasis* and ending bold**
|
||
${""}
|
||
__Test bold__
|
||
`,options:{style:"consistent"}}),new x({description:"Emphasis indicators should use consistent style based on first emphasis indicator in a file when style is set to 'consistent'",before:d`
|
||
# Emphasis First Emphasis Is an Underscore
|
||
${""}
|
||
**_First emphasis_**
|
||
This is _emphasized_ mid sentence
|
||
This is *emphasized* mid sentence with a second _emphasis_ on the same line
|
||
This is *__bold and emphasized__*
|
||
This is _**nested bold** and ending emphasized_
|
||
This is __*nested emphasis* and ending bold__
|
||
${""}
|
||
__Test bold__
|
||
`,after:d`
|
||
# Emphasis First Emphasis Is an Underscore
|
||
${""}
|
||
**_First emphasis_**
|
||
This is _emphasized_ mid sentence
|
||
This is _emphasized_ mid sentence with a second _emphasis_ on the same line
|
||
This is ___bold and emphasized___
|
||
This is _**nested bold** and ending emphasized_
|
||
This is ___nested emphasis_ and ending bold__
|
||
${""}
|
||
__Test bold__
|
||
`,options:{style:"consistent"}})]}get optionBuilders(){return[new ye({OptionsClass:bo,name:"Style",description:"The style used to denote emphasized content",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"}]})]}};Ai=O([S.register],Ai);var Ys=class{},Ci=class extends S{get OptionsClass(){return Ys}get name(){return"Empty Line Around Blockquotes"}get description(){return"Ensures that there is an empty line around blockquotes unless they start or end a document. **Note that an empty line is either one less level of nesting for blockquotes or a newline character.**"}get type(){return"Spacing"}apply(t,n){return Iu(t)}get exampleBuilders(){return[new x({description:"Blockquotes that start a document do not get an empty line before them.",before:d`
|
||
> Quote content here
|
||
> quote content continued
|
||
# Title here
|
||
`,after:d`
|
||
> Quote content here
|
||
> quote content continued
|
||
${""}
|
||
# Title here
|
||
`}),new x({description:"Blockquotes that end a document do not get an empty line after them.",before:d`
|
||
# Heading 1
|
||
> Quote content here
|
||
> quote content continued
|
||
`,after:d`
|
||
# Heading 1
|
||
${""}
|
||
> Quote content here
|
||
> quote content continued
|
||
`}),new x({description:"Blockquotes that are nested have the proper empty line added",before:d`
|
||
# Make sure that nested blockquotes are accounted for correctly
|
||
> Quote content here
|
||
> quote content continued
|
||
> > Nested Blockquote
|
||
> > content continued
|
||
${""}
|
||
**Note that the empty line is either one less blockquote indicator if followed/proceeded by more blockquote content or it is an empty line**
|
||
${""}
|
||
# Doubly nested code block
|
||
${""}
|
||
> > Quote content here
|
||
> > quote content continued
|
||
`,after:d`
|
||
# Make sure that nested blockquotes are accounted for correctly
|
||
${""}
|
||
> Quote content here
|
||
> quote content continued
|
||
>
|
||
> > Nested Blockquote
|
||
> > content continued
|
||
${""}
|
||
**Note that the empty line is either one less blockquote indicator if followed/proceeded by more blockquote content or it is an empty line**
|
||
${""}
|
||
# Doubly nested code block
|
||
${""}
|
||
> > Quote content here
|
||
> > quote content continued
|
||
`})]}get optionBuilders(){return[]}};Ci=O([S.register],Ci);var qs=class{},Ei=class extends S{get OptionsClass(){return qs}get name(){return"Empty Line Around Code Fences"}get description(){return"Ensures that there is an empty line around code fences unless they start or end a document."}get type(){return"Spacing"}apply(t,n){return _u(t)}get exampleBuilders(){return[new x({description:"Fenced code blocks that start a document do not get an empty line before them.",before:d`
|
||
\`\`\` js
|
||
var temp = 'text';
|
||
// this is a code block
|
||
\`\`\`
|
||
Text after code block.
|
||
`,after:d`
|
||
\`\`\` js
|
||
var temp = 'text';
|
||
// this is a code block
|
||
\`\`\`
|
||
${""}
|
||
Text after code block.
|
||
`}),new x({description:"Fenced code blocks that end a document do not get an empty line after them.",before:d`
|
||
# Heading 1
|
||
\`\`\`
|
||
Here is a code block
|
||
\`\`\`
|
||
`,after:d`
|
||
# Heading 1
|
||
${""}
|
||
\`\`\`
|
||
Here is a code block
|
||
\`\`\`
|
||
`}),new x({description:"Fenced code blocks that are in a blockquote have the proper empty line added",before:d`
|
||
# Make sure that code blocks in blockquotes are accounted for correctly
|
||
> \`\`\`js
|
||
> var text = 'this is some text';
|
||
> \`\`\`
|
||
>
|
||
> \`\`\`js
|
||
> var other text = 'this is more text';
|
||
> \`\`\`
|
||
${""}
|
||
**Note that the blanks blockquote lines added do not have whitespace after them**
|
||
${""}
|
||
# Doubly nested code block
|
||
${""}
|
||
> > \`\`\`js
|
||
> > var other text = 'this is more text';
|
||
> > \`\`\`
|
||
`,after:d`
|
||
# Make sure that code blocks in blockquotes are accounted for correctly
|
||
>
|
||
> \`\`\`js
|
||
> var text = 'this is some text';
|
||
> \`\`\`
|
||
>
|
||
> \`\`\`js
|
||
> var other text = 'this is more text';
|
||
> \`\`\`
|
||
>
|
||
${""}
|
||
**Note that the blanks blockquote lines added do not have whitespace after them**
|
||
${""}
|
||
# Doubly nested code block
|
||
${""}
|
||
> >
|
||
> > \`\`\`js
|
||
> > var other text = 'this is more text';
|
||
> > \`\`\`
|
||
`}),new x({description:"Nested fenced code blocks get empty lines added around them",before:d`
|
||
\`\`\`markdown
|
||
# Header
|
||
${""}
|
||
\`\`\`\`JavaScript
|
||
var text = 'some string';
|
||
\`\`\`\`
|
||
\`\`\`
|
||
`,after:d`
|
||
\`\`\`markdown
|
||
# Header
|
||
${""}
|
||
\`\`\`\`JavaScript
|
||
var text = 'some string';
|
||
\`\`\`\`
|
||
${""}
|
||
\`\`\`
|
||
`})]}get optionBuilders(){return[]}};Ei=O([S.register],Ei);var wo=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};O([S.noSettingControl()],wo.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Li=class extends S{get OptionsClass(){return wo}get name(){return"Empty Line Around Math Blocks"}get description(){return"Ensures that there is an empty line around math blocks using `Number of Dollar Signs to Indicate a Math Block` to determine how many dollar signs indicates a math block for single-line math."}get type(){return"Spacing"}apply(t,n){return $([k.yaml,k.code],t,i=>Bu(i,n.minimumNumberOfDollarSignsToBeAMathBlock))}get exampleBuilders(){return[new x({description:"Math blocks that start a document do not get an empty line before them.",before:d`
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
some more text
|
||
`,after:d`
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
${""}
|
||
some more text
|
||
`}),new x({description:"Math blocks that are singe-line are updated based on the value of `Number of Dollar Signs to Indicate a Math Block` (in this case its value is 2)",before:d`
|
||
$$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$
|
||
some more text
|
||
`,after:d`
|
||
$$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$
|
||
${""}
|
||
some more text
|
||
`}),new x({description:"Math blocks that end a document do not get an empty line after them.",before:d`
|
||
Some text
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
`,after:d`
|
||
Some text
|
||
${""}
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
`}),new x({description:"Math blocks that are not at the start or the end of the document will have an empty line added before and after them",before:d`
|
||
Some text
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
some more text
|
||
`,after:d`
|
||
Some text
|
||
${""}
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
${""}
|
||
some more text
|
||
`}),new x({description:"Math blocks in callouts or blockquotes have the appropriately formatted blank lines added",before:d`
|
||
> Math block in blockquote
|
||
> $$
|
||
> \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
> $$
|
||
${""}
|
||
More content here
|
||
${""}
|
||
> Math block doubly nested in blockquote
|
||
> > $$
|
||
> > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
> > $$
|
||
`,after:d`
|
||
> Math block in blockquote
|
||
>
|
||
> $$
|
||
> \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
> $$
|
||
>
|
||
${""}
|
||
More content here
|
||
${""}
|
||
> Math block doubly nested in blockquote
|
||
> >
|
||
> > $$
|
||
> > \\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
> > $$
|
||
`})]}get optionBuilders(){return[]}};Li=O([S.register],Li);var Ks=class{},_i=class extends S{get OptionsClass(){return Ks}get name(){return"Empty Line Around Tables"}get description(){return"Ensures that there is an empty line around github flavored tables unless they start or end a document."}get type(){return"Spacing"}apply(t,n){return $([k.yaml,k.code,k.math,k.inlineMath],t,i=>El(i))}get exampleBuilders(){return[new x({description:"Tables that start a document do not get an empty line before them.",before:d`
|
||
| Column 1 | Column 2 |
|
||
|----------|----------|
|
||
| foo | bar |
|
||
| baz | qux |
|
||
| quux | quuz |
|
||
More text.
|
||
# Heading
|
||
${""}
|
||
**Note that text directly following a table is considered part of a table according to github markdown**
|
||
`,after:d`
|
||
| Column 1 | Column 2 |
|
||
|----------|----------|
|
||
| foo | bar |
|
||
| baz | qux |
|
||
| quux | quuz |
|
||
${""}
|
||
More text.
|
||
# Heading
|
||
${""}
|
||
**Note that text directly following a table is considered part of a table according to github markdown**
|
||
`}),new x({description:"Tables that end a document do not get an empty line after them.",before:d`
|
||
# Heading 1
|
||
| Column 1 | Column 2 |
|
||
|----------|----------|
|
||
| foo | bar |
|
||
| baz | qux |
|
||
| quux | quuz |
|
||
`,after:d`
|
||
# Heading 1
|
||
${""}
|
||
| Column 1 | Column 2 |
|
||
|----------|----------|
|
||
| foo | bar |
|
||
| baz | qux |
|
||
| quux | quuz |
|
||
`}),new x({description:"Tables that are not at the start or the end of the document will have an empty line added before and after them",before:d`
|
||
# Table 1
|
||
| Column 1 | Column 2 | Column 3 |
|
||
|----------|----------|----------|
|
||
| foo | bar | blob |
|
||
| baz | qux | trust |
|
||
| quux | quuz | glob |
|
||
# Table 2 without Pipe at Start and End
|
||
| Column 1 | Column 2 |
|
||
:-: | -----------:
|
||
bar | baz
|
||
foo | bar
|
||
# Header for more content
|
||
New paragraph.
|
||
`,after:d`
|
||
# Table 1
|
||
${""}
|
||
| Column 1 | Column 2 | Column 3 |
|
||
|----------|----------|----------|
|
||
| foo | bar | blob |
|
||
| baz | qux | trust |
|
||
| quux | quuz | glob |
|
||
${""}
|
||
# Table 2 without Pipe at Start and End
|
||
${""}
|
||
| Column 1 | Column 2 |
|
||
:-: | -----------:
|
||
bar | baz
|
||
foo | bar
|
||
${""}
|
||
# Header for more content
|
||
New paragraph.
|
||
`}),new x({description:"Tables in callouts or blockquotes have the appropriately formatted blank lines added",before:d`
|
||
> Table in blockquote
|
||
> | Column 1 | Column 2 | Column 3 |
|
||
> |----------|----------|----------|
|
||
> | foo | bar | blob |
|
||
> | baz | qux | trust |
|
||
> | quux | quuz | glob |
|
||
${""}
|
||
More content here
|
||
${""}
|
||
> Table doubly nested in blockquote
|
||
> > | Column 1 | Column 2 | Column 3 |
|
||
> > |----------|----------|----------|
|
||
> > | foo | bar | blob |
|
||
> > | baz | qux | trust |
|
||
> > | quux | quuz | glob |
|
||
`,after:d`
|
||
> Table in blockquote
|
||
>
|
||
> | Column 1 | Column 2 | Column 3 |
|
||
> |----------|----------|----------|
|
||
> | foo | bar | blob |
|
||
> | baz | qux | trust |
|
||
> | quux | quuz | glob |
|
||
>
|
||
${""}
|
||
More content here
|
||
${""}
|
||
> Table doubly nested in blockquote
|
||
> >
|
||
> > | Column 1 | Column 2 | Column 3 |
|
||
> > |----------|----------|----------|
|
||
> > | foo | bar | blob |
|
||
> > | baz | qux | trust |
|
||
> > | quux | quuz | glob |
|
||
`})]}get optionBuilders(){return[]}};_i=O([S.register],_i);var Bi=class{constructor(){this.defaultEscapeCharacter='"';this.tryToEscapeSingleLineArrays=!1}};O([S.noSettingControl()],Bi.prototype,"defaultEscapeCharacter",2);var nn=class extends S{get OptionsClass(){return Bi}get name(){return"Escape YAML Special Characters"}get description(){return`Escapes colons with a space after them (: ), single quotes ('), and double quotes (") in YAML.`}get type(){return"YAML"}apply(t,n){return Se(t,i=>{let r=i.split(`
|
||
`),o=r.length;if(o<1)return i;for(let s=0;s<o;s++){let a=r[s].trim(),l=a.indexOf(":"),p=l<0||l+1>=a.length,u=a.startsWith("-"),m=u&&a.length<2;if(p&&m)continue;let c=1;if(!u)c+=l;else if(l!==-1&&s+1<o){let h=r[s],g=h.indexOf("-")+1;for(;g<h.length&&h.charAt(g)===" ";)g++;let w=0,y=r[s+1];for(;w<y.length&&y.charAt(w)===" ";)w++;g<=w&&(c+=l)}let f=a.substring(c).trim();if(f.startsWith("[")){if(n.tryToEscapeSingleLineArrays){if(f.length<3)continue;let h=f.substring(1,f.length-1).split(","),g=h.length;for(let w=0;w<g;w++){let y=h[w].trim();y.startsWith("[")&&(y=y.substring(1).trimStart()),y.endsWith("]")&&(y=y.substring(0,y.length-1).trimEnd()),h[w]=h[w].replace(y,St(y,n.defaultEscapeCharacter))}r[s]=r[s].replace(f,"["+h.join(",")+"]")}continue}r[s]=r[s].replace(f,St(f,n.defaultEscapeCharacter))}return r.join(`
|
||
`)})}get exampleBuilders(){return[new x({description:"YAML without anything to escape",before:d`
|
||
---
|
||
key: value
|
||
otherKey: []
|
||
---
|
||
`,after:d`
|
||
---
|
||
key: value
|
||
otherKey: []
|
||
---
|
||
`}),new x({description:"YAML with unescaped values",before:d`
|
||
---
|
||
key: value: with colon in the middle
|
||
secondKey: value with ' a single quote present
|
||
thirdKey: "already escaped: value"
|
||
fourthKey: value with " a double quote present
|
||
fifthKey: value with both ' " a double and single quote present is not escaped, but is invalid YAML
|
||
sixthKey: colon:between characters is fine
|
||
otherKey: []
|
||
---
|
||
`,after:d`
|
||
---
|
||
key: "value: with colon in the middle"
|
||
secondKey: "value with ' a single quote present"
|
||
thirdKey: "already escaped: value"
|
||
fourthKey: 'value with " a double quote present'
|
||
fifthKey: value with both ' " a double and single quote present is not escaped, but is invalid YAML
|
||
sixthKey: colon:between characters is fine
|
||
otherKey: []
|
||
---
|
||
`}),new x({description:"YAML with unescaped values in an expanded list with `Default Escape Character = '`",before:d`
|
||
---
|
||
key:
|
||
- value: with colon in the middle
|
||
- value with ' a single quote present
|
||
- 'already escaped: value'
|
||
- value with " a double quote present
|
||
- value with both ' " a double and single quote present is not escaped, but is invalid YAML
|
||
- colon:between characters is fine
|
||
---
|
||
`,after:d`
|
||
---
|
||
key:
|
||
- 'value: with colon in the middle'
|
||
- "value with ' a single quote present"
|
||
- 'already escaped: value'
|
||
- 'value with " a double quote present'
|
||
- value with both ' " a double and single quote present is not escaped, but is invalid YAML
|
||
- colon:between characters is fine
|
||
---
|
||
`,options:{defaultEscapeCharacter:"'"}}),new x({description:"YAML with unescaped values with arrays",before:d`
|
||
---
|
||
array: [value: with colon in the middle, value with ' a single quote present, "already escaped: value", value with " a double quote present, value with both ' " a double and single quote present is not escaped but is invalid YAML, colon:between characters is fine]
|
||
nestedArray: [[value: with colon in the middle, value with ' a single quote present], ["already escaped: value", value with " a double quote present], value with both ' " a double and single quote present is not escaped but is invalid YAML, colon:between characters is fine]
|
||
nestedArray2: [[value: with colon in the middle], value with ' a single quote present]
|
||
---
|
||
${""}
|
||
_Note that escaped commas in a YAML array will be treated as a separator._
|
||
`,after:d`
|
||
---
|
||
array: ["value: with colon in the middle", "value with ' a single quote present", "already escaped: value", 'value with " a double quote present', value with both ' " a double and single quote present is not escaped but is invalid YAML, colon:between characters is fine]
|
||
nestedArray: [["value: with colon in the middle", "value with ' a single quote present"], ["already escaped: value", 'value with " a double quote present'], value with both ' " a double and single quote present is not escaped but is invalid YAML, colon:between characters is fine]
|
||
nestedArray2: [["value: with colon in the middle"], "value with ' a single quote present"]
|
||
---
|
||
${""}
|
||
_Note that escaped commas in a YAML array will be treated as a separator._
|
||
`,options:{tryToEscapeSingleLineArrays:!0}})]}get optionBuilders(){return[new U({OptionsClass:Bi,name:"Try to Escape Single Line Arrays",description:'Tries to escape array values assuming that an array starts with "[", ends with "]", and has items that are delimited by ",".',optionsKey:"tryToEscapeSingleLineArrays"})]}get hasSpecialExecutionOrder(){return!0}};nn=O([S.register],nn);var xo=class{};O([S.noSettingControl()],xo.prototype,"fileName",2);var Ii=class extends S{get OptionsClass(){return xo}get name(){return"File Name Heading"}get description(){return"Inserts the file name as a H1 heading if no H1 heading exists."}get type(){return"Heading"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>{if(i.match(/^#\s.*/m))return i;let o=n.fileName,s=i.indexOf(`
|
||
---`);s=s==-1||!i.startsWith(`---
|
||
`)?0:s+5;let a=`# ${o}
|
||
`;return i.length<s&&(a=`
|
||
`+a),Wt(i,s,a)})}get exampleBuilders(){return[new x({description:"Inserts an H1 heading",before:d`
|
||
This is a line of text
|
||
`,after:d`
|
||
# File Name
|
||
This is a line of text
|
||
`,options:{fileName:"File Name"}}),new x({description:"Inserts heading after YAML front matter",before:d`
|
||
---
|
||
title: My Title
|
||
---
|
||
This is a line of text
|
||
`,after:d`
|
||
---
|
||
title: My Title
|
||
---
|
||
# File Name
|
||
This is a line of text
|
||
`,options:{fileName:"File Name"}})]}get optionBuilders(){return[]}};Ii=O([S.register],Ii);var Vs=class{},Mi=class extends S{get OptionsClass(){return Vs}get name(){return"Footnote after Punctuation"}get description(){return"Ensures that footnote references are placed after punctuation, not before."}get type(){return"Footnote"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.footnoteAtStartOfLine,k.footnoteAfterATask],t,i=>i.replace(/(\[\^\w+\]) ?([,.;!:?])/gm,"$2$1"))}get exampleBuilders(){return[new x({description:"Placing footnotes after punctuation.",before:d`
|
||
Lorem[^1]. Ipsum[^2], doletes.
|
||
`,after:d`
|
||
Lorem.[^1] Ipsum,[^2] doletes.
|
||
`}),new x({description:"A footnote at the start of a task is not moved to after the punctuation",before:d`
|
||
- [ ] [^1]: This is a footnote and a task.
|
||
- [ ] This is a footnote and a task that gets swapped with the punctuation[^2]!
|
||
[^2]: This footnote got modified
|
||
`,after:d`
|
||
- [ ] [^1]: This is a footnote and a task.
|
||
- [ ] This is a footnote and a task that gets swapped with the punctuation![^2]
|
||
[^2]: This footnote got modified
|
||
`})]}get optionBuilders(){return[]}};Mi=O([S.register],Mi);var Fi=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};O([S.noSettingControl()],Fi.prototype,"defaultEscapeCharacter",2);var rn=class extends S{get OptionsClass(){return Fi}get name(){return"Force YAML Escape"}get description(){return"Escapes the values for the specified YAML keys."}get type(){return"YAML"}apply(t,n){return Se(t,i=>{for(let r of n.forceYamlEscape){let o=Oe(i,r);if(o!=null){if(o.includes(`
|
||
`)||o.startsWith(" [")||hs(o))continue;o=St(o,n.defaultEscapeCharacter,!0),i=Te(i,r," "+o)}}return i})}get exampleBuilders(){return[new x({description:"YAML without anything to escape",before:d`
|
||
---
|
||
key: value
|
||
otherKey: []
|
||
---
|
||
`,after:d`
|
||
---
|
||
key: value
|
||
otherKey: []
|
||
---
|
||
`}),new x({description:"Force YAML keys to be escaped with double quotes where not already escaped with `Force Yaml Escape on Keys = 'key'\\n'title'\\n'bool'`",before:d`
|
||
---
|
||
key: 'Already escaped value'
|
||
title: This is a title
|
||
bool: false
|
||
unaffected: value
|
||
---
|
||
${""}
|
||
_Note that the force Yaml key option should not be used with arrays._
|
||
`,after:d`
|
||
---
|
||
key: 'Already escaped value'
|
||
title: "This is a title"
|
||
bool: "false"
|
||
unaffected: value
|
||
---
|
||
${""}
|
||
_Note that the force Yaml key option should not be used with arrays._
|
||
`,options:{forceYamlEscape:["key","title","bool"],defaultEscapeCharacter:'"'}})]}get optionBuilders(){return[new Ae({OptionsClass:Fi,name:"Force YAML Escape on Keys",description:"Uses the YAML escape character on the specified YAML keys separated by a new line character if it is not already escaped. Do not use on YAML arrays.",optionsKey:"forceYamlEscape"})]}get hasSpecialExecutionOrder(){return!0}};rn=O([S.register],rn);var js=class{},on=class extends S{get OptionsClass(){return js}get name(){return"Format Tags in YAML"}get description(){return"Remove Hashtags from tags in the YAML frontmatter, as they make the tags there invalid."}get type(){return"YAML"}apply(t,n){return Se(t,i=>i.replace(new RegExp(`\\n(${ai}|${ms}):(.*?)(?=\\n(?:[A-Za-z-]+?:|---))`,"s"),function(r){return r.replaceAll("#","")}))}get exampleBuilders(){return[new x({description:"Format Tags in YAML frontmatter",before:d`
|
||
---
|
||
tags: #one #two #three #nested/four/five
|
||
---
|
||
`,after:d`
|
||
---
|
||
tags: one two three nested/four/five
|
||
---
|
||
`}),new x({description:"Format tags in array",before:d`
|
||
---
|
||
tags: [#one #two #three]
|
||
---
|
||
`,after:d`
|
||
---
|
||
tags: [one two three]
|
||
---
|
||
`}),new x({description:"Format tags in array with `tag` as the tags key",before:d`
|
||
---
|
||
tag: [#one #two #three]
|
||
---
|
||
`,after:d`
|
||
---
|
||
tag: [one two three]
|
||
---
|
||
`}),new x({description:"Format tags in list",before:d`
|
||
---
|
||
tags:
|
||
- #tag1
|
||
- #tag2
|
||
---
|
||
`,after:d`
|
||
---
|
||
tags:
|
||
- tag1
|
||
- tag2
|
||
---
|
||
`})]}get optionBuilders(){return[]}get hasSpecialExecutionOrder(){return!0}};on=O([S.register],on);var lt=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=[]}};O([S.noSettingControl()],lt.prototype,"aliasArrayStyle",2),O([S.noSettingControl()],lt.prototype,"tagArrayStyle",2);var Ri=class extends S{get OptionsClass(){return lt}get name(){return"Format Yaml Array"}get description(){return"Allows for the formatting of regular yaml arrays as either multi-line or single-line and `tags` and `aliases` are allowed to have some Obsidian specific yaml formats. Note that single string to single-line goes from a single string entry to a single-line array if more than 1 entry is present. The same is true for single string to multi-line except it becomes a multi-line array."}get type(){return"YAML"}apply(t,n){return Se(t,i=>{let r=Je(i.replace(`---
|
||
`,"").replace(`
|
||
---`,""));if(!r)return i;for(let o of ui)if(n.formatAliasKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge(Yr(gt(Oe(i,o))),n.aliasArrayStyle));break}for(let o of li)if(n.formatTagKey&&Object.keys(r).includes(o)){i=Te(i,o,Ge(zr(gt(Oe(i,o))),n.tagArrayStyle));break}if(n.formatArrayKeys){let o=[...ui,...li,...n.forceMultiLineArrayStyle,...n.forceSingleLineArrayStyle];for(let s of Object.keys(r))o.includes(s)||!Array.isArray(r[s])||r[s].length!==0&&typeof r[s][0]=="object"&&r[s][0]!==null||(i=Te(i,s,Ge(gt(Oe(i,s)),n.defaultArrayStyle)))}for(let o of n.forceSingleLineArrayStyle)!Object.keys(r).includes(o)||(i=Te(i,o,Ge(gt(Oe(i,o)),"single-line")));for(let o of n.forceMultiLineArrayStyle)!Object.keys(r).includes(o)||(i=Te(i,o,Ge(gt(Oe(i,o)),"multi-line")));return i})}get exampleBuilders(){return[new x({description:"Format tags as a single-line array delimited by spaces and aliases as a multi-line array and format the key `test` to be a single-line array",before:d`
|
||
---
|
||
tags:
|
||
- computer
|
||
- research
|
||
aliases: Title 1, Title2
|
||
test: this is a value
|
||
---
|
||
${""}
|
||
# Notes:
|
||
${""}
|
||
Nesting yaml arrays may result in unexpected results.
|
||
${""}
|
||
Multi-line arrays will have empty values removed only leaving one if it is completely empty. The same is not true for single-line arrays as that is invalid yaml unless it comes as the last entry in the array.
|
||
`,after:d`
|
||
---
|
||
tags: [computer, research]
|
||
aliases:
|
||
- Title 1
|
||
- Title2
|
||
test: [this is a value]
|
||
---
|
||
${""}
|
||
# Notes:
|
||
${""}
|
||
Nesting yaml arrays may result in unexpected results.
|
||
${""}
|
||
Multi-line arrays will have empty values removed only leaving one if it is completely empty. The same is not true for single-line arrays as that is invalid yaml unless it comes as the last entry in the array.
|
||
`,options:{aliasArrayStyle:"multi-line",forceSingleLineArrayStyle:["test"]}}),new x({description:"Format tags as a single string with space delimiters, ignore aliases, and format regular yaml arrays as single-line arrays",before:d`
|
||
---
|
||
aliases: Typescript
|
||
types:
|
||
- thought provoking
|
||
- peer reviewed
|
||
tags: [computer, science, trajectory]
|
||
---
|
||
`,after:d`
|
||
---
|
||
aliases: Typescript
|
||
types: [thought provoking, peer reviewed]
|
||
tags: computer science trajectory
|
||
---
|
||
`,options:{formatAliasKey:!1,tagArrayStyle:"single string space delimited"}}),new x({description:"Arrays with dictionaries in them are ignored",before:d`
|
||
---
|
||
gists:
|
||
- id: test123
|
||
url: 'some_url'
|
||
filename: file.md
|
||
isPublic: true
|
||
---
|
||
`,after:d`
|
||
---
|
||
gists:
|
||
- id: test123
|
||
url: 'some_url'
|
||
filename: file.md
|
||
isPublic: true
|
||
---
|
||
`,options:{formatArrayKeys:!0,defaultArrayStyle:"single-line"}})]}get optionBuilders(){return[new U({OptionsClass:lt,name:"Format yaml aliases section",description:"Turns on formatting for the yaml aliases section. You should not enable this option alongside the rule `YAML Title Alias` as they may not work well together or they may have different format styles selected causing unexpected results.",optionsKey:"formatAliasKey"}),new U({OptionsClass:lt,name:"Format yaml tags section",description:"Turns on formatting for the yaml tags section.",optionsKey:"formatTagKey"}),new ye({OptionsClass:lt,name:"Default yaml array section style",description:"The style of other yaml arrays that are not `tags`, `aliases` or in `Force key values to be single-line arrays` and `Force key values to be multi-line arrays`",optionsKey:"defaultArrayStyle",records:[{value:"multi-line",description:"```key:\\n - value```"},{value:"single-line",description:"```key: [value]```"}]}),new U({OptionsClass:lt,name:"Format yaml array sections",description:"Turns on formatting for regular yaml arrays",optionsKey:"formatArrayKeys"}),new Ae({OptionsClass:lt,name:"Force key values to be single-line arrays",description:"Forces the yaml array for the new line separated keys to be in single-line format (leave empty to disable this option)",optionsKey:"forceSingleLineArrayStyle"}),new Ae({OptionsClass:lt,name:"Force key values to be multi-line arrays",description:"Forces the yaml array for the new line separated keys to be in multi-line format (leave empty to disable this option)",optionsKey:"forceMultiLineArrayStyle"})]}};Ri=O([S.register],Ri);var ko=class{constructor(){this.startAtH2=!1}},Di=class extends S{get OptionsClass(){return ko}get name(){return"Header Increment"}get description(){return"Heading levels should only increment by one level at a time"}get type(){return"Heading"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>{let r=n.startAtH2?1:0,o=0,s=n.startAtH2?2:1,a=n.startAtH2?1:0;return i.replace(Rt,(l,p="",u="",m="",c="",f="")=>{let h=u.length+a-o;return h>r+1?(o+=h-(r+1),h=r+1):h<r&&(o-=r+o-u.length,o<=0&&(h=u.length,o=0)),h=h<s?s:h,r=h,p+"#".repeat(h)+m+c+f})})}get exampleBuilders(){return[new x({description:"",before:d`
|
||
# H1
|
||
### H3
|
||
### H3
|
||
#### H4
|
||
###### H6
|
||
${""}
|
||
We skipped a 2nd level heading
|
||
`,after:d`
|
||
# H1
|
||
## H3
|
||
## H3
|
||
### H4
|
||
#### H6
|
||
${""}
|
||
We skipped a 2nd level heading
|
||
`}),new x({description:"Skipped headings in sections that would be decremented will result in those headings not having the same meaning",before:d`
|
||
# H1
|
||
### H3
|
||
${""}
|
||
We skip from 1 to 3
|
||
${""}
|
||
####### H7
|
||
${""}
|
||
We skip from 3 to 7 leaving out 4, 5, and 6. Thus headings level 4, 5, and 6 will be treated like H3 above until another H2 or H1 is encountered
|
||
${""}
|
||
###### H6
|
||
${""}
|
||
We skipped 6 previously so it will be treated the same as the H3 above since it was the next lowest header that was to be decremented
|
||
${""}
|
||
## H2
|
||
${""}
|
||
This resets the decrement section so the H6 below is decremented to an H3
|
||
${""}
|
||
###### H6
|
||
`,after:d`
|
||
# H1
|
||
## H3
|
||
${""}
|
||
We skip from 1 to 3
|
||
${""}
|
||
### H7
|
||
${""}
|
||
We skip from 3 to 7 leaving out 4, 5, and 6. Thus headings level 4, 5, and 6 will be treated like H3 above until another H2 or H1 is encountered
|
||
${""}
|
||
## H6
|
||
${""}
|
||
We skipped 6 previously so it will be treated the same as the H3 above since it was the next lowest header that was to be decremented
|
||
${""}
|
||
## H2
|
||
${""}
|
||
This resets the decrement section so the H6 below is decremented to an H3
|
||
${""}
|
||
### H6
|
||
`}),new x({description:"When `Start Header Increment at Heading Level 2 = true`, H1s become H2s and the other headers are incremented accordingly",before:d`
|
||
# H1 becomes H2
|
||
#### H4 becomes H3
|
||
####### H7
|
||
###### H6
|
||
## H2
|
||
###### H6
|
||
# H1
|
||
## H2
|
||
`,after:d`
|
||
## H1 becomes H2
|
||
### H4 becomes H3
|
||
#### H7
|
||
### H6
|
||
## H2
|
||
### H6
|
||
## H1
|
||
### H2
|
||
`,options:{startAtH2:!0}})]}get optionBuilders(){return[new U({OptionsClass:ko,name:"Start Header Increment at Heading Level 2",description:"Makes heading level 2 the minimum heading level in a file for header increment and shifts all headings accordingly so they increment starting with a level 2 heading.",optionsKey:"startAtH2"})]}};Di=O([S.register],Di);var Pi=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},$i=class extends S{get OptionsClass(){return Pi}get name(){return"Heading blank lines"}get description(){return"All headings have a blank line both before and after (except where the heading is at the beginning or end of the document)."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink],t,i=>(n.bottom?(i=i.replace(/^(#+\s.*)/gm,`
|
||
|
||
$1
|
||
|
||
`),i=i.replace(/\n+(#+\s.*)/g,`
|
||
|
||
$1`),i=i.replace(/(^#+\s.*)\n+/gm,`$1
|
||
|
||
`)):(i=i.replace(/(^#+\s.*)\n+/gm,`$1
|
||
`),i=i.replace(/\n+(#+\s.*)/g,`
|
||
|
||
$1`)),i=i.replace(/^\n+(#+\s.*)/,"$1"),i=i.replace(/(#+\s.*)\n+$/,"$1"),n.emptyLineAfterYaml||(i=i.replace(new RegExp("("+ke.source+")\\n+(#+\\s.*)"),`$1
|
||
$5`)),i))}get exampleBuilders(){return[new x({description:"Headings should be surrounded by blank lines",before:d`
|
||
# H1
|
||
## H2
|
||
${""}
|
||
${""}
|
||
# H1
|
||
line
|
||
## H2
|
||
${""}
|
||
`,after:d`
|
||
# H1
|
||
${""}
|
||
## H2
|
||
${""}
|
||
# H1
|
||
${""}
|
||
line
|
||
${""}
|
||
## H2
|
||
`}),new x({description:"With `Bottom=false`",before:d`
|
||
# H1
|
||
line
|
||
## H2
|
||
# H1
|
||
line
|
||
`,after:d`
|
||
# H1
|
||
line
|
||
${""}
|
||
## H2
|
||
${""}
|
||
# H1
|
||
line
|
||
`,options:{bottom:!1,emptyLineAfterYaml:!0}}),new x({description:"Empty line before header and after Yaml is removed with `Empty Line Between Yaml and Header=true`",before:d`
|
||
---
|
||
key: value
|
||
---
|
||
# Header
|
||
Paragraph here...
|
||
`,after:d`
|
||
---
|
||
key: value
|
||
---
|
||
# Header
|
||
|
||
Paragraph here...
|
||
`,options:{bottom:!0,emptyLineAfterYaml:!1}})]}get optionBuilders(){return[new U({OptionsClass:Pi,name:"Bottom",description:"Insert a blank line after headings",optionsKey:"bottom"}),new U({OptionsClass:Pi,name:"Empty Line Between Yaml and Header",description:"Keep the empty line between the Yaml frontmatter and header",optionsKey:"emptyLineAfterYaml"})]}};$i=O([S.register],$i);var Ws=class{},Ni=class extends S{get OptionsClass(){return Ws}get name(){return"Headings Start Line"}get description(){return"Headings that do not start a line will have their preceding whitespace removed to make sure they get recognized as headers."}get type(){return"Heading"}apply(t,n){return $([k.code,k.yaml],t,i=>i.replaceAll(Rt,r=>r.trimStart()))}get exampleBuilders(){return[new x({description:"Removes spaces prior to a heading",before:d`
|
||
${""} ## Other heading preceded by 2 spaces ##
|
||
_Note that if the spacing is enough for the header to be considered to be part of a codeblock it will not be affected by this rule._
|
||
`,after:d`
|
||
## Other heading preceded by 2 spaces ##
|
||
_Note that if the spacing is enough for the header to be considered to be part of a codeblock it will not be affected by this rule._
|
||
`}),new x({description:"Tags are not affected by this",before:d`
|
||
${""} #test
|
||
${""} # Heading &
|
||
`,after:d`
|
||
${""} #test
|
||
# Heading &
|
||
`})]}get optionBuilders(){return[]}};Ni=O([S.register],Ni);var So=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},Hi=class extends S{get OptionsClass(){return So}get name(){return"Insert YAML attributes"}get description(){return"Inserts the given YAML attributes into the YAML frontmatter. Put each attribute on a single line."}get type(){return"YAML"}apply(t,n){return t=ht(t),Se(t,i=>{let r=n.textToInsert.reverse(),o=Je(i.match(ke)[1]);for(let s of r){let a=s.split(":")[0];Object.prototype.hasOwnProperty.call(o,a)||(i=i.replace(/^---\n/,We(`---
|
||
${s}
|
||
`)))}return i})}get exampleBuilders(){return[new x({description:"Insert static lines into YAML frontmatter. Text to insert: `aliases:\ntags: doc\nanimal: dog`",before:d`
|
||
---
|
||
animal: cat
|
||
---
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
tags: doc
|
||
animal: cat
|
||
---
|
||
`,options:{textToInsert:["aliases:","tags: doc","animal: dog"]}})]}get optionBuilders(){return[new Ae({OptionsClass:So,name:"Text to insert",description:"Text to insert into the YAML frontmatter",optionsKey:"textToInsert"})]}};Hi=O([S.register],Hi);var Us=class{},zi=class extends S{get OptionsClass(){return Us}get name(){return"Line Break at Document End"}get description(){return"Ensures that there is exactly one line break at the end of a document."}get type(){return"Spacing"}apply(t,n){return t=t.replace(/\n+$/g,""),t+=`
|
||
`,t}get exampleBuilders(){return[new x({description:"Appending a line break to the end of the document.",before:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||
`,after:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||
${""}
|
||
`}),new x({description:"Removing trailing line breaks to the end of the document, except one.",before:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||
${""}
|
||
${""}
|
||
${""}
|
||
`,after:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||
${""}
|
||
`})]}get optionBuilders(){return[]}};zi=O([S.register],zi);var Gs=class{},Yi=class extends S{get OptionsClass(){return Gs}get name(){return"Move Footnotes to the bottom"}get description(){return"Move all footnotes to the bottom of the document."}get type(){return"Footnote"}apply(t,n){return $([k.code,k.yaml],t,i=>Su(i))}get exampleBuilders(){return[new x({description:"Moving footnotes to the bottom",before:d`
|
||
Lorem ipsum, consectetur adipiscing elit. [^1] Donec dictum turpis quis ipsum pellentesque.
|
||
${""}
|
||
[^1]: first footnote
|
||
${""}
|
||
Quisque lorem est, fringilla sed enim at, sollicitudin lacinia nisi.[^2]
|
||
[^2]: second footnote
|
||
${""}
|
||
Maecenas malesuada dignissim purus ac volutpat.
|
||
`,after:d`
|
||
Lorem ipsum, consectetur adipiscing elit. [^1] Donec dictum turpis quis ipsum pellentesque.
|
||
${""}
|
||
Quisque lorem est, fringilla sed enim at, sollicitudin lacinia nisi.[^2]
|
||
Maecenas malesuada dignissim purus ac volutpat.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^2]: second footnote
|
||
`})]}get optionBuilders(){return[]}};Yi=O([S.register],Yi);var To=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};O([S.noSettingControl()],To.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var qi=class extends S{get OptionsClass(){return To}get name(){return"Move Math Block Indicators to Their Own Line"}get description(){return"Move all starting and ending math block indicators to their own lines using `Number of Dollar Signs to Indicate a Math Block` to determine how many dollar signs indicates a math block for single-line math."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.inlineCode],t,i=>Ru(i,n.minimumNumberOfDollarSignsToBeAMathBlock))}get exampleBuilders(){return[new x({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 2",before:d`
|
||
This is left alone:
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
The following is updated:
|
||
$$L = \\frac{1}{2} \\rho v^2 S C_L$$
|
||
`,after:d`
|
||
This is left alone:
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
The following is updated:
|
||
$$
|
||
L = \\frac{1}{2} \\rho v^2 S C_L
|
||
$$
|
||
`}),new x({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 3 and opening indicator is on the same line as the start of the content",before:d`
|
||
$$$\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$$
|
||
`,after:d`
|
||
$$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$$
|
||
`}),new x({description:"Moving math block indicator to its own line when `Number of Dollar Signs to Indicate a Math Block` = 2 and ending indicator is on the same line as the ending line of the content",before:d`
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}$$
|
||
`,after:d`
|
||
$$
|
||
\\boldsymbol{a}=\\begin{bmatrix}a_x \\\\ a_y\\end{bmatrix}
|
||
$$
|
||
`})]}get optionBuilders(){return[]}};qi=O([S.register],qi);var Pn=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[]}};O([S.noSettingControl()],Pn.prototype,"tagArrayStyle",2);var Ki=class extends S{get OptionsClass(){return Pn}get name(){return"Move Tags to Yaml"}get description(){return"Move all tags to Yaml frontmatter of the document."}get type(){return"YAML"}apply(t,n){return $([k.code,k.inlineCode,k.math,k.html],t,i=>{let r=i.match(si);return r&&(i=ht(i),i=Se(i,o=>{o=o.replace(`---
|
||
`,"").replace("---","");let s=[],a=ai;for(let u of li){let m=Oe(o,u);if(m!=null){s=zr(gt(m)),a=u;break}}let l=new Set;if(typeof s=="string")l.add(s),s=[s];else if(s!=null)for(let u of s)l.add(u);else s=[];for(let u of r){let m=u.trim().substring(1);!l.has(m)&&!n.tagsToIgnore.includes(m)&&(l.add(m),s.push(m))}return`---
|
||
${Te(o,a,Ge(s,n.tagArrayStyle))}---`}),n.howToHandleExistingTags!=="Nothing"&&(i=i.replace(si,o=>{let s=o.indexOf("#"),a=o.substring(s+1);return n.tagsToIgnore.includes(a)?o:n.howToHandleExistingTags==="Remove hashtag"?o.substring(0,s)+a:""}))),i})}get exampleBuilders(){return[new x({description:"Move tags from body to Yaml with `Tags to ignore = 'ignored-tag'`",before:d`
|
||
Text has to do with #test and #markdown
|
||
${""}
|
||
#test content here
|
||
\`\`\`
|
||
#ignored
|
||
Code block content is ignored
|
||
\`\`\`
|
||
${""}
|
||
This inline code \`#ignored content\`
|
||
${""}
|
||
#ignored-tag is ignored since it is in the ignored list
|
||
`,after:d`
|
||
---
|
||
tags: [test, markdown]
|
||
---
|
||
Text has to do with #test and #markdown
|
||
${""}
|
||
#test content here
|
||
\`\`\`
|
||
#ignored
|
||
Code block content is ignored
|
||
\`\`\`
|
||
${""}
|
||
This inline code \`#ignored content\`
|
||
${""}
|
||
#ignored-tag is ignored since it is in the ignored list
|
||
`,options:{tagsToIgnore:["ignored-tag"]}}),new x({description:"Move tags from body to YAML with existing tags retains the already existing ones and only adds new ones",before:d`
|
||
---
|
||
tags: [test, tag2]
|
||
---
|
||
Text has to do with #test and #markdown
|
||
`,after:d`
|
||
---
|
||
tags: [test, tag2, markdown]
|
||
---
|
||
Text has to do with #test and #markdown
|
||
`}),new x({description:"Move tags to YAML frontmatter and then remove hashtags in body content tags when `Body tag operation = 'Remove hashtag'` and `Tags to ignore = 'yet-another-ignored-tag'`.",before:d`
|
||
---
|
||
tags: [test, tag2]
|
||
---
|
||
Text has to do with #test and #markdown
|
||
${""}
|
||
The tag at the end of this line stays as a tag since it is ignored #yet-another-ignored-tag
|
||
`,after:d`
|
||
---
|
||
tags: [test, tag2, markdown]
|
||
---
|
||
Text has to do with test and markdown
|
||
${""}
|
||
The tag at the end of this line stays as a tag since it is ignored #yet-another-ignored-tag
|
||
`,options:{howToHandleExistingTags:"Remove hashtag",tagsToIgnore:["yet-another-ignored-tag"]}}),new x({description:"Move tags to YAML frontmatter and then remove body content tags when `Body tag operation = 'Remove whole tag'`.",before:d`
|
||
---
|
||
tags: [test, tag2]
|
||
---
|
||
This document will have #tags removed and spacing around tags is left alone except for the space prior to the hashtag #warning
|
||
`,after:d`
|
||
---
|
||
tags: [test, tag2, tags, warning]
|
||
---
|
||
This document will have removed and spacing around tags is left alone except for the space prior to the hashtag
|
||
`,options:{howToHandleExistingTags:"Remove whole tag"}})]}get optionBuilders(){return[new ye({OptionsClass:Pn,name:"Body tag operation",description:"What to do with non-ignored tags in the body of the file once they have been moved to the frontmatter",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 Ae({OptionsClass:Pn,name:"Tags to ignore",description:"The tags that will not be moved to the tags array or removed from the body content if `Remove the hashtag from tags in content body` is enabled. Each tag should be on a new line and without the `#`. **Make sure not to include the hashtag in the tag name.**",optionsKey:"tagsToIgnore"})]}};Ki=O([S.register],Ki);var Zs=class{},Pu="'\"\u2018\u2019\u201C\u201D`[]",Vi=class extends S{get OptionsClass(){return Zs}get name(){return"No Bare URLs"}get description(){return"Encloses bare URLs with angle brackets except when enclosed in back ticks, square braces, or single or double quotes."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.image,k.inlineCode],t,i=>{let r=i.match(Pr);if(!r)return i;let o=0,s=r.length;for(let a=0;a<s;a++){let l=r[a],p=i.indexOf(l,o),u=p+l.length,m=p===0?void 0:i.charAt(p-1),c=u>=i.length?void 0:i.charAt(u);if(m!=null&&Pu.includes(m)&&c!=null&&Pu.includes(c)){o=p+l.length;continue}if(m!=null&&m==="<"&&c!=null&&c===">"){let f=p-1;for(;f>0&&i.charAt(f-1)==="<";)f--;let h=u;for(;h<i.length-1&&i.charAt(h+1)===">";)h++;i=ve(i,f,h+1,"<"+l+">"),o=p+l.length;continue}i=ve(i,p,p+l.length,"<"+l+">"),o=p+l.length+2}return i})}get exampleBuilders(){return[new x({description:"Make sure that links are inside of angle brackets when not in single quotes('), double quotes(\"), or backticks(`)",before:d`
|
||
https://github.com
|
||
braces around url should stay the same: [https://github.com]
|
||
backticks around url should stay the same: \`https://github.com\`
|
||
Links mid-sentence should be updated like https://google.com will be.
|
||
'https://github.com'
|
||
"https://github.com"
|
||
<https://github.com>
|
||
links should stay the same: [](https://github.com)
|
||
https://gitlab.com
|
||
`,after:d`
|
||
<https://github.com>
|
||
braces around url should stay the same: [https://github.com]
|
||
backticks around url should stay the same: \`https://github.com\`
|
||
Links mid-sentence should be updated like <https://google.com> will be.
|
||
'https://github.com'
|
||
"https://github.com"
|
||
<https://github.com>
|
||
links should stay the same: [](https://github.com)
|
||
<https://gitlab.com>
|
||
`}),new x({description:`Angle brackets are added if the url is not the only text in the single quotes(') or double quotes(")`,before:d`
|
||
[https://github.com some text here]
|
||
backticks around a url should stay the same: \`https://github.com some text here\`
|
||
single quotes around a url should stay the same, but only if the contents of the single quotes is the url: 'https://github.com some text here'
|
||
double quotes around a url should stay the same, but only if the contents of the double quotes is the url: "https://github.com some text here"
|
||
`,after:d`
|
||
[<https://github.com> some text here]
|
||
backticks around a url should stay the same: \`https://github.com some text here\`
|
||
single quotes around a url should stay the same, but only if the contents of the single quotes is the url: '<https://github.com> some text here'
|
||
double quotes around a url should stay the same, but only if the contents of the double quotes is the url: "<https://github.com> some text here"
|
||
`}),new x({description:"Multiple angle brackets at the start and or end of a url will be reduced down to 1",before:d`
|
||
<<https://github.com>
|
||
<https://google.com>>
|
||
<<https://gitlab.com>>
|
||
`,after:d`
|
||
<https://github.com>
|
||
<https://google.com>
|
||
<https://gitlab.com>
|
||
`})]}get optionBuilders(){return[]}};Vi=O([S.register],Vi);var Wi=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},ji=class extends S{get OptionsClass(){return Wi}get name(){return"Ordered List Style"}get description(){return"Makes sure that ordered lists follow the style specified. Note that 2 spaces or 1 tab is considered to be an indentation level."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.tag],t,i=>Mu(i,n.numberStyle,n.listEndStyle))}get exampleBuilders(){return[new x({description:"Ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
4. Item 3
|
||
${""}
|
||
Some text here
|
||
${""}
|
||
1. Item 1
|
||
1. Item 2
|
||
1. Item 3
|
||
`,after:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
3. Item 3
|
||
${""}
|
||
Some text here
|
||
${""}
|
||
1. Item 1
|
||
2. Item 2
|
||
3. Item 3
|
||
`}),new x({description:"Nested ordered lists have list items set to ascending numerical order when Number Style is `ascending`.",before:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
1. Subitem 1
|
||
5. Subitem 2
|
||
2. Subitem 3
|
||
4. Item 3
|
||
`,after:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
1. Subitem 1
|
||
2. Subitem 2
|
||
3. Subitem 3
|
||
3. Item 3
|
||
`}),new x({description:"Ordered list in blockquote has list items set to '1.' when Number Style is `lazy`.",before:d`
|
||
> 1. Item 1
|
||
> 4. Item 2
|
||
> > 1. Subitem 1
|
||
> > 5. Subitem 2
|
||
> > 2. Subitem 3
|
||
`,after:d`
|
||
> 1. Item 1
|
||
> 1. Item 2
|
||
> > 1. Subitem 1
|
||
> > 1. Subitem 2
|
||
> > 1. Subitem 3
|
||
`,options:{numberStyle:"lazy"}}),new x({description:"Ordered list in blockquote has list items set to ascending numerical order when Number Style is `ascending`.",before:d`
|
||
> 1. Item 1
|
||
> 4. Item 2
|
||
> > 1. Subitem 1
|
||
> > 5. Subitem 2
|
||
> > 2. Subitem 3
|
||
`,after:d`
|
||
> 1. Item 1
|
||
> 2. Item 2
|
||
> > 1. Subitem 1
|
||
> > 2. Subitem 2
|
||
> > 3. Subitem 3
|
||
`}),new x({description:"Nested ordered list has list items set to '1)' when Number Style is `lazy` and Ordered List Indicator End Style is `)`.",before:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
1. Subitem 1
|
||
5. Subitem 2
|
||
2. Subitem 3
|
||
4. Item 3
|
||
`,after:d`
|
||
1) Item 1
|
||
1) Item 2
|
||
1) Subitem 1
|
||
1) Subitem 2
|
||
1) Subitem 3
|
||
1) Item 3
|
||
`,options:{listEndStyle:")",numberStyle:"lazy"}})]}get optionBuilders(){return[new ye({OptionsClass:Wi,name:"Number Style",description:"The number style used in ordered list indicators",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 number 1"}]}),new ye({OptionsClass:Wi,name:"Ordered List Indicator End Style",description:"The ending character of an ordered list indicator",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)`)"}]})]}};ji=O([S.register],ji);var Qs=class{},Ui=class extends S{get OptionsClass(){return Qs}get name(){return"Paragraph blank lines"}get description(){return"All paragraphs should have exactly one blank line both before and after."}get type(){return"Spacing"}apply(t,n){return $([k.obsidianMultiLineComments,k.yaml,k.table],t,Ou)}get exampleBuilders(){return[new x({description:"Paragraphs should be surrounded by blank lines",before:d`
|
||
# H1
|
||
Newlines are inserted.
|
||
A paragraph is a line that starts with a letter.
|
||
`,after:d`
|
||
# H1
|
||
${""}
|
||
Newlines are inserted.
|
||
${""}
|
||
A paragraph is a line that starts with a letter.
|
||
`})]}get optionBuilders(){return[]}};Ui=O([S.register],Ui);var Oo=class{};O([S.noSettingControl()],Oo.prototype,"lineContent",2);var sn=class extends S{get OptionsClass(){return Oo}get name(){return"Prevent Double Checklist Indicator on Paste"}get description(){return"Removes starting checklist indicator from the text to paste if the line the cursor is on in the file has a checklist indicator"}get type(){return"Paste"}apply(t,n){let i=new RegExp(`^${_n}- \\[[ x]] `),r=/^\s*- \[[ x]] /,o=i.test(n.lineContent),s=r.test(t);return!o||!s?t:t.replace(r,"")}get exampleBuilders(){return[new x({description:"Line being pasted is left alone when current line has no checklist indicator in it: `Regular text here`",before:d`
|
||
- [ ] Checklist item being pasted
|
||
`,after:d`
|
||
- [ ] Checklist item being pasted
|
||
`,options:{lineContent:"Regular text here"}}),new x({description:"Line being pasted into a blockquote without a checklist indicator is left alone when it lacks a checklist indicator: `> > `",before:d`
|
||
- [ ] Checklist item contents here
|
||
More content here
|
||
`,after:d`
|
||
- [ ] Checklist item contents here
|
||
More content here
|
||
`,options:{lineContent:"> > "}}),new x({description:"Line being pasted into a blockquote with a checklist indicator is has its checklist indicator removed when current line is: `> - [x] `",before:d`
|
||
- [ ] Checklist item contents here
|
||
More content here
|
||
`,after:d`
|
||
Checklist item contents here
|
||
More content here
|
||
`,options:{lineContent:"> - [x] "}}),new x({description:"Line being pasted with a checklist indicator is has its checklist indicator removed when current line is: `- [ ] `",before:d`
|
||
- [x] Checklist item 1
|
||
- [ ] Checklist item 2
|
||
`,after:d`
|
||
Checklist item 1
|
||
- [ ] Checklist item 2
|
||
`,options:{lineContent:"- [ ] "}})]}get optionBuilders(){return[]}};sn=O([S.register],sn);var Ao=class{};O([S.noSettingControl()],Ao.prototype,"lineContent",2);var an=class extends S{get OptionsClass(){return Ao}get name(){return"Prevent Double List Item Indicator on Paste"}get description(){return"Removes starting list indicator from the text to paste if the line the cursor is on in the file has a list indicator"}get type(){return"Paste"}apply(t,n){let i=new RegExp(`^${_n}[*+-] `),r=/^\s*[*+-] /,o=i.test(n.lineContent),s=r.test(t);return!o||!s?t:t.replace(r,"")}get exampleBuilders(){return[new x({description:"Line being pasted is left alone when current line has no list indicator in it: `Regular text here`",before:d`
|
||
- List item being pasted
|
||
`,after:d`
|
||
- List item being pasted
|
||
`,options:{lineContent:"Regular text here"}}),new x({description:"Line being pasted into a blockquote without a list indicator is left alone when it lacks a list indicator: `> > `",before:d`
|
||
* List item contents here
|
||
More content here
|
||
`,after:d`
|
||
* List item contents here
|
||
More content here
|
||
`,options:{lineContent:"> > "}}),new x({description:"Line being pasted into a blockquote with a list indicator is has its list indicator removed when current line is: `> * `",before:d`
|
||
+ List item contents here
|
||
More content here
|
||
`,after:d`
|
||
List item contents here
|
||
More content here
|
||
`,options:{lineContent:"> * "}}),new x({description:"Line being pasted with a list indicator is has its list indicator removed when current line is: `+ `",before:d`
|
||
- List item 1
|
||
- List item 2
|
||
`,after:d`
|
||
List item 1
|
||
- List item 2
|
||
`,options:{lineContent:"+ "}})]}get optionBuilders(){return[]}};an=O([S.register],an);var Xs=class{},ln=class extends S{get OptionsClass(){return Xs}get name(){return"Proper Ellipsis on Paste"}get description(){return"Replaces three consecutive dots with an ellipsis even if they have a space between them in the text to paste"}get type(){return"Paste"}apply(t,n){return t.replaceAll($r,"\u2026")}get exampleBuilders(){return[new x({description:"Replacing three consecutive dots with an ellipsis even if spaces are present",before:d`
|
||
Lorem (...) Impsum.
|
||
Lorem (. ..) Impsum.
|
||
Lorem (. . .) Impsum.
|
||
`,after:d`
|
||
Lorem (…) Impsum.
|
||
Lorem (…) Impsum.
|
||
Lorem (…) Impsum.
|
||
`})]}get optionBuilders(){return[]}};ln=O([S.register],ln);var Js=class{},Gi=class extends S{get OptionsClass(){return Js}get name(){return"Proper Ellipsis"}get description(){return"Replaces three consecutive dots with an ellipsis."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replaceAll($r,"\u2026"))}get exampleBuilders(){return[new x({description:"Replacing three consecutive dots with an ellipsis.",before:d`
|
||
Lorem (...) Impsum.
|
||
`,after:d`
|
||
Lorem (…) Impsum.
|
||
`})]}get optionBuilders(){return[]}};Gi=O([S.register],Gi);var ea=class{},Zi=class extends S{get OptionsClass(){return ea}get name(){return"Re-Index Footnotes"}get description(){return"Re-indexes footnote keys and footnote, based on the order of occurrence (NOTE: This rule deliberately does *not* preserve the relation between key and footnote, to be able to re-index duplicate keys.)"}get type(){return"Footnote"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>{let r=0;return i=i.replace(/^\[\^\w+\]: /gm,function(){return r++,"[^"+String(r)+"]: "}),r=0,i=i.replace(/(?!^)\[\^\w+\]/gm,function(){return r++,"[^"+String(r)+"]"}),i})}get exampleBuilders(){return[new x({description:"Re-indexing footnotes after having deleted previous footnotes",before:d`
|
||
Lorem ipsum at aliquet felis.[^3] Donec dictum turpis quis pellentesque,[^5] et iaculis tortor condimentum.
|
||
${""}
|
||
[^3]: first footnote
|
||
[^5]: second footnote
|
||
`,after:d`
|
||
Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^2] et iaculis tortor condimentum.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^2]: second footnote
|
||
`}),new x({description:"Re-indexing footnotes after inserting a footnote between",before:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.[^1] Aenean at aliquet felis. Donec dictum turpis quis ipsum pellentesque, et iaculis tortor condimentum.[^1a] Vestibulum nec blandit felis, vulputate finibus purus.[^2] Praesent quis iaculis diam.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^1a]: third footnote, inserted later
|
||
[^2]: second footnotes
|
||
`,after:d`
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.[^1] Aenean at aliquet felis. Donec dictum turpis quis ipsum pellentesque, et iaculis tortor condimentum.[^2] Vestibulum nec blandit felis, vulputate finibus purus.[^3] Praesent quis iaculis diam.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^2]: third footnote, inserted later
|
||
[^3]: second footnotes
|
||
`}),new x({description:"Re-indexing duplicate footnote keys",before:d`
|
||
Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^1] et iaculis tortor condimentum.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^1]: second footnote
|
||
`,after:d`
|
||
Lorem ipsum at aliquet felis.[^1] Donec dictum turpis quis pellentesque,[^2] et iaculis tortor condimentum.
|
||
${""}
|
||
[^1]: first footnote
|
||
[^2]: second footnote
|
||
`})]}get optionBuilders(){return[]}};Zi=O([S.register],Zi);var ta=class{},Qi=class extends S{get OptionsClass(){return ta}get name(){return"Remove Consecutive List Markers"}get description(){return"Removes consecutive list markers. Useful when copy-pasting list items."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(/^([ |\t]*)- - \b/gm,"$1- "))}get exampleBuilders(){return[new x({description:"Removing consecutive list markers.",before:d`
|
||
- item 1
|
||
- - copypasted item A
|
||
- item 2
|
||
- indented item
|
||
- - copypasted item B
|
||
`,after:d`
|
||
- item 1
|
||
- copypasted item A
|
||
- item 2
|
||
- indented item
|
||
- copypasted item B
|
||
`})]}get optionBuilders(){return[]}};Qi=O([S.register],Qi);var un=class extends S{get OptionsClass(){return un}get name(){return"Remove Empty Lines Between List Markers and Checklists"}get description(){return"There should not be any empty lines between list markers and checklists."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.thematicBreak],t,i=>{let r=function(u,m,c){let f=new RegExp(`^${m}
|
||
{2,}${m}$`,"gm"),h,g=u;do h=g.match(f),g=g.replaceAll(f,c);while(h);return g};return i=r(i,"(( |\\t)*- \\[( |x)\\]( |\\t)+.+)",`$1
|
||
$5`),i=r(i,"(( |\\t)*\\d+\\.( |\\t)+.+)",`$1
|
||
$4`),i=r(i,"(( |\\t)*\\+( |\\t)+.+)",`$1
|
||
$4`),i=r(i,"(( |\\t)*-(?! \\[( |x)\\])( |\\t)+.+)",`$1
|
||
$5`),r(i,"(( |\\t)*\\*( |\\t)+.+)",`$1
|
||
$4`)})}get exampleBuilders(){return[new x({description:"",before:d`
|
||
1. Item 1
|
||
${""}
|
||
2. Item 2
|
||
${""}
|
||
- Item 1
|
||
${""}
|
||
\t- Subitem 1
|
||
${""}
|
||
- Item 2
|
||
${""}
|
||
- [x] Item 1
|
||
${""}
|
||
\t- [ ] Subitem 1
|
||
${""}
|
||
- [ ] Item 2
|
||
${""}
|
||
+ Item 1
|
||
${""}
|
||
\t+ Subitem 1
|
||
${""}
|
||
+ Item 2
|
||
${""}
|
||
* Item 1
|
||
${""}
|
||
\t* Subitem 1
|
||
${""}
|
||
* Item 2
|
||
`,after:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
${""}
|
||
- Item 1
|
||
\t- Subitem 1
|
||
- Item 2
|
||
${""}
|
||
- [x] Item 1
|
||
\t- [ ] Subitem 1
|
||
- [ ] Item 2
|
||
${""}
|
||
+ Item 1
|
||
\t+ Subitem 1
|
||
+ Item 2
|
||
${""}
|
||
* Item 1
|
||
\t* Subitem 1
|
||
* Item 2
|
||
`})]}get optionBuilders(){return[]}};un=O([S.register],un);var na=class{},Xi=class extends S{get OptionsClass(){return na}get name(){return"Remove Empty List Markers"}get description(){return"Removes empty list markers, i.e. list items without content."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>{let r=new RegExp(`^${_n}(-|\\*|\\+|\\d+[.)]|- (\\[( |x)\\]))\\s*?$`,"gm");return i=i.replace(new RegExp(r.source+"\\n","gm"),""),i=i.replace(new RegExp("\\n"+r.source,"gm"),""),i.replace(r,"")})}get exampleBuilders(){return[new x({description:"Removes empty list markers.",before:d`
|
||
- item 1
|
||
-
|
||
- item 2
|
||
${""}
|
||
* list 2 item 1
|
||
*
|
||
* list 2 item 2
|
||
${""}
|
||
+ list 3 item 1
|
||
+
|
||
+ list 3 item 2
|
||
`,after:d`
|
||
- item 1
|
||
- item 2
|
||
${""}
|
||
* list 2 item 1
|
||
* list 2 item 2
|
||
${""}
|
||
+ list 3 item 1
|
||
+ list 3 item 2
|
||
`}),new x({description:"Removes empty ordered list markers.",before:d`
|
||
1. item 1
|
||
2.
|
||
3. item 2
|
||
${""}
|
||
1. list 2 item 1
|
||
2. list 2 item 2
|
||
3. ${""}
|
||
${""}
|
||
_Note that this rule does not make sure that the ordered list is sequential after removal_
|
||
`,after:d`
|
||
1. item 1
|
||
3. item 2
|
||
${""}
|
||
1. list 2 item 1
|
||
2. list 2 item 2
|
||
${""}
|
||
_Note that this rule does not make sure that the ordered list is sequential after removal_
|
||
`}),new x({description:"Removes empty checklist markers.",before:d`
|
||
- [ ] item 1
|
||
- [x]
|
||
- [ ] item 2
|
||
- [ ] ${""}
|
||
${""}
|
||
_Note that this will affect checked and uncheck checked list items_
|
||
`,after:d`
|
||
- [ ] item 1
|
||
- [ ] item 2
|
||
${""}
|
||
_Note that this will affect checked and uncheck checked list items_
|
||
`}),new x({description:"Removes empty list, checklist, and ordered list markers in callouts/blockquotes",before:d`
|
||
> Checklist in blockquote
|
||
> - [ ] item 1
|
||
> - [x]
|
||
> - [ ] item 2
|
||
> - [ ] ${""}
|
||
${""}
|
||
> Ordered List in blockquote
|
||
> > 1. item 1
|
||
> > 2.
|
||
> > 3. item 2
|
||
> > 4. ${""}
|
||
${""}
|
||
> Regular lists in blockquote
|
||
>
|
||
> - item 1
|
||
> -
|
||
> - item 2
|
||
>
|
||
> List 2
|
||
>
|
||
> * item 1
|
||
> *
|
||
> * list 2 item 2
|
||
>
|
||
> List 3
|
||
>
|
||
> + item 1
|
||
> +
|
||
> + item 2
|
||
`,after:d`
|
||
> Checklist in blockquote
|
||
> - [ ] item 1
|
||
> - [ ] item 2
|
||
${""}
|
||
> Ordered List in blockquote
|
||
> > 1. item 1
|
||
> > 3. item 2
|
||
${""}
|
||
> Regular lists in blockquote
|
||
>
|
||
> - item 1
|
||
> - item 2
|
||
>
|
||
> List 2
|
||
>
|
||
> * item 1
|
||
> * list 2 item 2
|
||
>
|
||
> List 3
|
||
>
|
||
> + item 1
|
||
> + item 2
|
||
`})]}get optionBuilders(){return[]}};Xi=O([S.register],Xi);var ia=class{},Ji=class extends S{get OptionsClass(){return ia}get name(){return"Remove Hyphenated Line Breaks"}get description(){return"Removes hyphenated line breaks. Useful when pasting text from textbooks."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(/\b[-‐] \b/g,""))}get exampleBuilders(){return[new x({description:"Removing hyphenated line breaks.",before:d`
|
||
This text has a linebr‐ eak.
|
||
`,after:d`
|
||
This text has a linebreak.
|
||
`})]}get optionBuilders(){return[]}};Ji=O([S.register],Ji);var ra=class{},pn=class extends S{get OptionsClass(){return ra}get name(){return"Remove Hyphens on Paste"}get description(){return"Removes hyphens from the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/(\S)[-‐]\s+\n?(?=\w)/g,"$1")}get exampleBuilders(){return[new x({description:"Remove hyphen in content to paste",before:d`
|
||
Text that was cool but hyper-
|
||
tension made it uncool.
|
||
`,after:d`
|
||
Text that was cool but hypertension made it uncool.
|
||
`})]}get optionBuilders(){return[]}};pn=O([S.register],pn);var oa=class{},cn=class extends S{get OptionsClass(){return oa}get name(){return"Remove Leading or Trailing Whitespace on Paste"}get description(){return"Removes any leading non-tab whitespace and all trailing whitespace for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/^[\n ]+|\s+$/g,"")}get exampleBuilders(){return[new x({description:"Removes leading spaces and newline characters",before:d`
|
||
${""}
|
||
${""}
|
||
This text was really indented
|
||
${""}
|
||
`,after:d`
|
||
This text was really indented
|
||
`}),new x({description:"Leaves leading tabs alone",before:d`
|
||
${""}
|
||
${""}
|
||
\t\tThis text is really indented
|
||
${""}
|
||
`,after:" This text is really indented"})]}get optionBuilders(){return[]}};cn=O([S.register],cn);var sa=class{},mn=class extends S{get OptionsClass(){return sa}get name(){return"Remove Leftover Footnotes from Quote on Paste"}get description(){return"Removes any leftover footnote references for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/(\D)[.,]\d+/g,"$1")}get exampleBuilders(){return[new x({description:"Footnote reference removed",before:d`
|
||
He was sure that he would get off without doing any time, but the cops had other plans.50
|
||
${""}
|
||
_Note that the format for footnote references to move is a dot or comma followed by any number of digits_
|
||
`,after:d`
|
||
He was sure that he would get off without doing any time, but the cops had other plans
|
||
${""}
|
||
_Note that the format for footnote references to move is a dot or comma followed by any number of digits_
|
||
`})]}get optionBuilders(){return[]}};mn=O([S.register],mn);var aa=class{},er=class extends S{get OptionsClass(){return aa}get name(){return"Remove link spacing"}get description(){return"Removes spacing around link text."}get type(){return"Spacing"}apply(t,n){return t=Au(t),Cl(t)}get exampleBuilders(){return[new x({description:"Space in regular markdown link text",before:d`
|
||
[ here is link text1 ](link_here)
|
||
[ here is link text2](link_here)
|
||
[here is link text3 ](link_here)
|
||
[here is link text4](link_here)
|
||
[\there is link text5\t](link_here)
|
||
[](link_here)
|
||
**Note that image markdown syntax does not get affected even if it is transclusion:**
|
||

|
||
`,after:d`
|
||
[here is link text1](link_here)
|
||
[here is link text2](link_here)
|
||
[here is link text3](link_here)
|
||
[here is link text4](link_here)
|
||
[here is link text5](link_here)
|
||
[](link_here)
|
||
**Note that image markdown syntax does not get affected even if it is transclusion:**
|
||

|
||
`}),new x({description:"Space in wiki link text",before:d`
|
||
[[link_here| here is link text1 ]]
|
||
[[link_here|here is link text2 ]]
|
||
[[link_here| here is link text3]]
|
||
[[link_here|here is link text4]]
|
||
[[link_here|\there is link text5\t]]
|
||
![[link_here|\there is link text6\t]]
|
||
[[link_here]]
|
||
`,after:d`
|
||
[[link_here|here is link text1]]
|
||
[[link_here|here is link text2]]
|
||
[[link_here|here is link text3]]
|
||
[[link_here|here is link text4]]
|
||
[[link_here|here is link text5]]
|
||
![[link_here|here is link text6]]
|
||
[[link_here]]
|
||
`})]}get optionBuilders(){return[]}};er=O([S.register],er);var la=class{},dn=class extends S{get OptionsClass(){return la}get name(){return"Remove Multiple Blank Lines on Paste"}get description(){return"Condenses multiple blank lines down into one blank line for the text to paste"}get type(){return"Paste"}apply(t,n){return t.replace(/\n{3,}/g,`
|
||
|
||
`)}get exampleBuilders(){return[new x({description:"Multiple blanks lines condensed down to one",before:d`
|
||
Here is the first line.
|
||
${""}
|
||
${""}
|
||
${""}
|
||
${""}
|
||
Here is some more text.
|
||
`,after:d`
|
||
Here is the first line.
|
||
${""}
|
||
Here is some more text.
|
||
`}),new x({description:"Text with only one blank line in a row is left alone",before:d`
|
||
First line.
|
||
${""}
|
||
Last line.
|
||
`,after:d`
|
||
First line.
|
||
${""}
|
||
Last line.
|
||
`})]}get optionBuilders(){return[]}};dn=O([S.register],dn);var ua=class{},tr=class extends S{get OptionsClass(){return ua}get name(){return"Remove Multiple Spaces"}get description(){return"Removes two or more consecutive spaces. Ignores spaces at the beginning and ending of the line. "}get type(){return"Content"}apply(t,n){return $([k.table,k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>i.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3"))}get exampleBuilders(){return[new x({description:"Removing double and triple space.",before:d`
|
||
Lorem ipsum dolor sit amet.
|
||
`,after:d`
|
||
Lorem ipsum dolor sit amet.
|
||
`})]}get optionBuilders(){return[]}};tr=O([S.register],tr);var fn=class{constructor(){this.includeFullwidthForms=!0;this.includeCJKSymbolsAndPunctuation=!0;this.includeDashes=!0;this.otherSymbols=""}},nr=class extends S{get OptionsClass(){return fn}get name(){return"Remove Space around Characters"}get description(){return"Ensures that certain characters are not surrounded by whitespace (either single spaces or a tab). Note that this may causes issues with markdown format in some cases."}get type(){return"Spacing"}apply(t,n){let i="";if(n.includeFullwidthForms&&(i+="\uFF01-\uFF5E"),n.includeCJKSymbolsAndPunctuation&&(i+="\u3000-\u30FF"),n.includeDashes&&(i+="\u2013\u2014"),i+=Rr(n.otherSymbols),!i)return t;let r=new RegExp(`([ ])+([${i}])`,"g"),o=new RegExp(`([${i}])([ ])+`,"g"),s=function(l){return l.replace(r,"$2").replace(o,"$1")},a=$([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.list],t,s);return a=Lu(a,s),a}get exampleBuilders(){return[new x({description:"Remove Spaces and Tabs around Fullwidth Characters",before:d`
|
||
Full list of affected characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"'`^~ ̄_&@#%+-*=<>()[]{}⦅⦆|¦/\¬$£¢₩¥。、「」『』〔〕【】—…–《》〈〉
|
||
This is a fullwidth period\t 。 with text after it.
|
||
This is a fullwidth comma\t, with text after it.
|
||
This is a fullwidth left parenthesis ( \twith text after it.
|
||
This is a fullwidth right parenthesis ) with text after it.
|
||
This is a fullwidth colon : with text after it.
|
||
This is a fullwidth semicolon ; with text after it.
|
||
Removes space at start of line
|
||
`,after:d`
|
||
Full list of affected characters:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"'`^~ ̄_&@#%+-*=<>()[]{}⦅⦆|¦/\¬$£¢₩¥。、「」『』〔〕【】—…–《》〈〉
|
||
This is a fullwidth period。with text after it.
|
||
This is a fullwidth comma,with text after it.
|
||
This is a fullwidth left parenthesis(with text after it.
|
||
This is a fullwidth right parenthesis)with text after it.
|
||
This is a fullwidth colon:with text after it.
|
||
This is a fullwidth semicolon;with text after it.
|
||
Removes space at start of line
|
||
`}),new x({description:"Fullwidth Characters in List Do not Affect List Markdown Syntax",before:d`
|
||
# List indicators should not have the space after them removed if they are followed by a fullwidth character
|
||
${""}
|
||
- [ contents here]
|
||
- \t[ more contents here] more text here
|
||
+ \t[ another item here]
|
||
* [ one last item here]
|
||
${""}
|
||
# Nested in a block quote
|
||
${""}
|
||
> - [ contents here]
|
||
> - \t[ more contents here] more text here
|
||
> + \t[ another item here]
|
||
> * [ one last item here]
|
||
${""}
|
||
# Doubly nested in a block quote
|
||
${""}
|
||
> The following is doubly nested
|
||
> > - [ contents here]
|
||
> > - \t[ more contents here] more text here
|
||
> > + \t[ another item here]
|
||
> > * [ one last item here]
|
||
`,after:d`
|
||
# List indicators should not have the space after them removed if they are followed by a fullwidth character
|
||
${""}
|
||
- [contents here]
|
||
- [more contents here]more text here
|
||
+ [another item here]
|
||
* [one last item here]
|
||
${""}
|
||
# Nested in a block quote
|
||
${""}
|
||
> - [contents here]
|
||
> - [more contents here]more text here
|
||
> + [another item here]
|
||
> * [one last item here]
|
||
${""}
|
||
# Doubly nested in a block quote
|
||
${""}
|
||
> The following is doubly nested
|
||
> > - [contents here]
|
||
> > - [more contents here]more text here
|
||
> > + [another item here]
|
||
> > * [one last item here]
|
||
`})]}get optionBuilders(){return[new U({name:"Include Fullwidth Forms",description:'Include <a href="https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)">Fullwidth Forms Unicode block</a>',OptionsClass:fn,optionsKey:"includeFullwidthForms"}),new U({name:"Include CJK Symbols and Punctuation",description:'Include <a href="https://en.wikipedia.org/wiki/CJK_Symbols_and_Punctuation">CJK Symbols and Punctuation Unicode block</a>',OptionsClass:fn,optionsKey:"includeCJKSymbolsAndPunctuation"}),new U({name:"Include Dashes",description:"Include en dash (\u2013) and em dash (\u2014)",OptionsClass:fn,optionsKey:"includeDashes"}),new at({name:"Other symbols",description:"Other symbols to include",OptionsClass:fn,optionsKey:"otherSymbols"})]}};nr=O([S.register],nr);var Co=class{constructor(){this.punctuationToRemove=".,;:!\u3002\uFF0C\uFF1B\uFF1A\uFF01"}},ir=class extends S{get OptionsClass(){return Co}get name(){return"Remove Trailing Punctuation in Heading"}get description(){return"Removes the specified punctuation from the end of headings making sure to ignore the semicolon at the end of [HTML entity references](https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references)."}get type(){return"Heading"}apply(t,n){return $([k.code,k.yaml],t,i=>i.replaceAll(Rt,(r,o="",s="",a="",l="",p="")=>{if(l==""||l.match(/&[^\s]+;$/mi))return r;let u=l.charAt(l.length-1);return n.punctuationToRemove.includes(u)?o+s+a+l.substring(0,l.length-1)+p:r}))}get exampleBuilders(){return[new x({description:"Removes punctuation from the end of a heading",before:d`
|
||
# Heading ends in a period.
|
||
## Other heading ends in an exclamation mark! ##
|
||
`,after:d`
|
||
# Heading ends in a period
|
||
## Other heading ends in an exclamation mark ##
|
||
`}),new x({description:"HTML Entities at the end of a heading is ignored",before:d`
|
||
# Heading 1
|
||
## Heading &
|
||
`,after:d`
|
||
# Heading 1
|
||
## Heading &
|
||
`})]}get optionBuilders(){return[new at({OptionsClass:Co,name:"Trailing Punctuation",description:"The trailing punctuation to remove from the headings in the file.",optionsKey:"punctuationToRemove"})]}};ir=O([S.register],ir);var Eo=class{constructor(){this.yamlKeysToRemove=[]}},rr=class extends S{get OptionsClass(){return Eo}get name(){return"Remove YAML Keys"}get description(){return"Removes the YAML keys specified"}get type(){return"YAML"}apply(t,n){let i=n.yamlKeysToRemove,r=t.match(ke);if(!r||i.length===0)return t;let o=r[1];for(let s of i){let a=s.trim();a.endsWith(":")&&(a=a.substring(0,a.length-1)),o=Gt(o,a)}return t.replace(r[1],o)}get exampleBuilders(){return[new x({description:'Removes the values specified in `YAML Keys to Remove` = "status:\nkeywords\ndate"',before:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
keywords:
|
||
- keyword1
|
||
- keyword2
|
||
status: WIP
|
||
date: 02/15/2022
|
||
---
|
||
${""}
|
||
# Header Context
|
||
${""}
|
||
Text
|
||
`,after:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
---
|
||
${""}
|
||
# Header Context
|
||
${""}
|
||
Text
|
||
`,options:{yamlKeysToRemove:["status:","keywords","date"]}})]}get optionBuilders(){return[new Ae({OptionsClass:Eo,name:"YAML Keys to Remove",description:"The yaml keys to remove from the yaml frontmatter with or without colons",optionsKey:"yamlKeysToRemove"})]}};rr=O([S.register],rr);var pa=class{},or=class extends S{get OptionsClass(){return pa}get name(){return"Space after list markers"}get description(){return"There should be a single space after list markers and checkboxes."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>(i=i.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),i.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")))}get exampleBuilders(){return[new x({description:"",before:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
${""}
|
||
- [ ] Item 1
|
||
- [x] Item 2
|
||
\t- [ ] Item 3
|
||
`,after:d`
|
||
1. Item 1
|
||
2. Item 2
|
||
${""}
|
||
- [ ] Item 1
|
||
- [x] Item 2
|
||
\t- [ ] Item 3
|
||
`})]}get optionBuilders(){return[]}};or=O([S.register],or);var ca=class{},sr=class extends S{get OptionsClass(){return ca}get name(){return"Space between Chinese Japanese or Korean and English or numbers"}get description(){return"Ensures that Chinese, Japanese, or Korean and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)"}get type(){return"Spacing"}apply(t,n){let i=/(\p{sc=Han}|\p{sc=Katakana}|\p{sc=Hiragana}|\p{sc=Hangul})( *)(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+'"([{¥$]|\*[^*])/gmu,r=/(\[[^[]*\]\(.*\)|`[^`]*`|\w+|[-+;:'"°%$)\]}]|[^*]\*)( *)(\p{sc=Han}|\p{sc=Katakana}|\p{sc=Hiragana}|\p{sc=Hangul})/gmu,o=function(a){return a.replace(i,"$1 $3").replace(r,"$1 $3")},s=$([k.code,k.inlineCode,k.yaml,k.image,k.link,k.wikiLink,k.tag,k.italics,k.bold,k.math,k.inlineMath],t,o);return s=Cu(s,o),s=Eu(s,o),s}get exampleBuilders(){return[new x({description:"Space between Chinese and English",before:d`
|
||
中文字符串english中文字符串。
|
||
`,after:d`
|
||
中文字符串 english 中文字符串。
|
||
`}),new x({description:"Space between Chinese and link",before:d`
|
||
中文字符串[english](http://example.com)中文字符串。
|
||
`,after:d`
|
||
中文字符串 [english](http://example.com) 中文字符串。
|
||
`}),new x({description:"Space between Chinese and inline code block",before:d`
|
||
中文字符串\`code\`中文字符串。
|
||
`,after:d`
|
||
中文字符串 \`code\` 中文字符串。
|
||
`}),new x({description:"No space between Chinese and English in tag",before:d`
|
||
#标签A #标签2标签
|
||
`,after:d`
|
||
#标签A #标签2标签
|
||
`}),new x({description:"Make sure that spaces are not added between italics and chinese characters to preserve markdown syntax",before:d`
|
||
_这是一个数学公式_
|
||
*这是一个数学公式english*
|
||
${""}
|
||
# Handling bold and italics nested in each other is not supported at this time
|
||
${""}
|
||
**_这是一_个数学公式**
|
||
*这是一hello__个数学world公式__*
|
||
`,after:d`
|
||
_这是一个数学公式_
|
||
*这是一个数学公式 english*
|
||
${""}
|
||
# Handling bold and italics nested in each other is not supported at this time
|
||
${""}
|
||
**_ 这是一 _ 个数学公式**
|
||
*这是一 hello__ 个数学 world 公式 __*
|
||
`}),new x({description:"Images and links are ignored",before:d`
|
||
[[这是一个数学公式english]]
|
||
![[这是一个数学公式english.jpg]]
|
||
[这是一个数学公式english](这是一个数学公式english.md)
|
||

|
||
`,after:d`
|
||
[[这是一个数学公式english]]
|
||
![[这是一个数学公式english.jpg]]
|
||
[这是一个数学公式english](这是一个数学公式english.md)
|
||

|
||
`}),new x({description:"Space between CJK and English",before:d`
|
||
日本語englishひらがな
|
||
カタカナenglishカタカナ
|
||
ハンカクカタカナenglish123全角数字
|
||
한글english한글
|
||
`,after:d`
|
||
日本語 english ひらがな
|
||
カタカナ english カタカナ
|
||
ハンカクカタカナ english123全角数字
|
||
한글 english 한글
|
||
`})]}get optionBuilders(){return[]}};sr=O([S.register],sr);var Lo=class{constructor(){this.style="consistent"}},ar=class extends S{get OptionsClass(){return Lo}get name(){return"Strong Style"}get description(){return"Makes sure the strong style is consistent."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag,k.math,k.inlineMath],t,i=>ho(i,n.style,"strong"))}get exampleBuilders(){return[new x({description:"Strong indicators should use underscores when style is set to 'underscore'",before:d`
|
||
# Strong/Bold Cases
|
||
${""}
|
||
**Test bold**
|
||
** Test not bold **
|
||
This is **bold** mid sentence
|
||
This is **bold** mid sentence with a second **bold** on the same line
|
||
This is ***bold and emphasized***
|
||
This is ***nested bold** and ending emphasized*
|
||
This is ***nested emphasis* and ending bold**
|
||
${""}
|
||
*Test emphasis*
|
||
${""}
|
||
* List Item1 with **bold text**
|
||
* List Item2
|
||
`,after:d`
|
||
# Strong/Bold Cases
|
||
${""}
|
||
__Test bold__
|
||
** Test not bold **
|
||
This is __bold__ mid sentence
|
||
This is __bold__ mid sentence with a second __bold__ on the same line
|
||
This is *__bold and emphasized__*
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is __*nested emphasis* and ending bold__
|
||
${""}
|
||
*Test emphasis*
|
||
${""}
|
||
* List Item1 with __bold text__
|
||
* List Item2
|
||
`,options:{style:"underscore"}}),new x({description:"Strong indicators should use asterisks when style is set to 'asterisk'",before:d`
|
||
# Strong/Bold Cases
|
||
${""}
|
||
__Test bold__
|
||
__ Test not bold __
|
||
This is __bold__ mid sentence
|
||
This is __bold__ mid sentence with a second __bold__ on the same line
|
||
This is ___bold and emphasized___
|
||
This is ___nested bold__ and ending emphasized_
|
||
This is ___nested emphasis_ and ending bold__
|
||
${""}
|
||
_Test emphasis_
|
||
`,after:d`
|
||
# Strong/Bold Cases
|
||
${""}
|
||
**Test bold**
|
||
__ Test not bold __
|
||
This is **bold** mid sentence
|
||
This is **bold** mid sentence with a second **bold** on the same line
|
||
This is _**bold and emphasized**_
|
||
This is _**nested bold** and ending emphasized_
|
||
This is **_nested emphasis_ and ending bold**
|
||
${""}
|
||
_Test emphasis_
|
||
`,options:{style:"asterisk"}}),new x({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:d`
|
||
# Strong First Strong Is an Asterisk
|
||
${""}
|
||
**First bold**
|
||
This is __bold__ mid sentence
|
||
This is __bold__ mid sentence with a second **bold** on the same line
|
||
This is ___bold and emphasized___
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is **_nested emphasis_ and ending bold**
|
||
${""}
|
||
__Test bold__
|
||
`,after:d`
|
||
# Strong First Strong Is an Asterisk
|
||
${""}
|
||
**First bold**
|
||
This is **bold** mid sentence
|
||
This is **bold** mid sentence with a second **bold** on the same line
|
||
This is _**bold and emphasized**_
|
||
This is ***nested bold** and ending emphasized*
|
||
This is **_nested emphasis_ and ending bold**
|
||
${""}
|
||
**Test bold**
|
||
`,options:{style:"consistent"}}),new x({description:"Strong indicators should use consistent style based on first strong indicator in a file when style is set to 'consistent'",before:d`
|
||
# Strong First Strong Is an Underscore
|
||
${""}
|
||
__First bold__
|
||
This is **bold** mid sentence
|
||
This is **bold** mid sentence with a second __bold__ on the same line
|
||
This is **_bold and emphasized_**
|
||
This is ***nested bold** and ending emphasized*
|
||
This is ___nested emphasis_ and ending bold__
|
||
${""}
|
||
**Test bold**
|
||
`,after:d`
|
||
# Strong First Strong Is an Underscore
|
||
${""}
|
||
__First bold__
|
||
This is __bold__ mid sentence
|
||
This is __bold__ mid sentence with a second __bold__ on the same line
|
||
This is ___bold and emphasized___
|
||
This is *__nested bold__ and ending emphasized*
|
||
This is ___nested emphasis_ and ending bold__
|
||
${""}
|
||
__Test bold__
|
||
`,options:{style:"consistent"}})]}get optionBuilders(){return[new ye({OptionsClass:Lo,name:"Style",description:"The style used to denote strong/bolded content",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of strong is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure ** is the strong indicator"},{value:"underscore",description:"Makes sure __ is the strong indicator"}]})]}};ar=O([S.register],ar);var _o=class{constructor(){this.twoSpaceLineBreak=!1}},lr=class extends S{get OptionsClass(){return _o}get name(){return"Trailing spaces"}get description(){return"Removes extra spaces after every line."}get type(){return"Spacing"}apply(t,n){return $([k.code,k.yaml,k.link,k.wikiLink,k.tag],t,i=>n.twoSpaceLineBreak?(i=i.replace(/(\S)[ \t]$/gm,"$1"),i=i.replace(/(\S)[ \t]{3,}$/gm,"$1"),i=i.replace(/(\S)( ?\t\t? ?)$/gm,"$1"),i):i.replace(/[ \t]+$/gm,""))}get exampleBuilders(){return[new x({description:"Removes trailing spaces and tabs.",before:d`
|
||
# H1
|
||
Line with trailing spaces and tabs. ${""}
|
||
`,after:d`
|
||
# H1
|
||
Line with trailing spaces and tabs.
|
||
`}),new x({description:"With `Two Space Linebreak = true`",before:d`
|
||
# H1
|
||
Line with trailing spaces and tabs. ${""}
|
||
`,after:d`
|
||
# H1
|
||
Line with trailing spaces and tabs. ${""}
|
||
`,options:{twoSpaceLineBreak:!0}})]}get optionBuilders(){return[new U({OptionsClass:_o,name:"Two Space Linebreak",description:'Ignore two spaces followed by a line break ("Two Space Rule").',optionsKey:"twoSpaceLineBreak"})]}};lr=O([S.register],lr);var ma=class{},ur=class extends S{get OptionsClass(){return ma}get name(){return"Two Spaces Between Lines with Content"}get description(){return"Makes sure that two spaces are added to the ends of lines with content continued on the next line for paragraphs, blockquotes, and list items"}get type(){return"Content"}apply(t,n){return $([k.obsidianMultiLineComments,k.yaml,k.table],t,Tu)}get exampleBuilders(){return[new x({description:"Make sure two spaces are added to the ends of lines that have content on it and the next line for lists, blockquotes, and paragraphs",before:d`
|
||
# Heading 1
|
||
First paragraph stays as the first paragraph
|
||
${""}
|
||
- list item 1
|
||
- list item 2
|
||
Continuation of list item 2
|
||
- list item 3
|
||
${""}
|
||
1. Item 1
|
||
2. Item 2
|
||
Continuation of item 3
|
||
3. Item 3
|
||
${""}
|
||
Paragraph for with link [[other file name]].
|
||
Continuation *of* the paragraph has \`inline code block\` __in it__.
|
||
Even more continuation
|
||
${""}
|
||
Paragraph lines that end in <br/>
|
||
Or lines that end in <br>
|
||
Are left alone
|
||
Since they mean the same thing
|
||
${""}
|
||
\`\`\` text
|
||
Code blocks are ignored
|
||
Even with multiple lines
|
||
\`\`\`
|
||
Another paragraph here
|
||
${""}
|
||
> Blockquotes are affected
|
||
> More content here
|
||
Content here
|
||
${""}
|
||
<div>
|
||
html content
|
||
should be ignored
|
||
</div>
|
||
Even more content here
|
||
${""}
|
||
`,after:d`
|
||
# Heading 1
|
||
First paragraph stays as the first paragraph
|
||
${""}
|
||
- list item 1
|
||
- list item 2 ${""}
|
||
Continuation of list item 2
|
||
- list item 3
|
||
${""}
|
||
1. Item 1
|
||
2. Item 2 ${""}
|
||
Continuation of item 3
|
||
3. Item 3
|
||
${""}
|
||
Paragraph for with link [[other file name]]. ${""}
|
||
Continuation *of* the paragraph has \`inline code block\` __in it__. ${""}
|
||
Even more continuation
|
||
${""}
|
||
Paragraph lines that end in <br/>
|
||
Or lines that end in <br>
|
||
Are left alone ${""}
|
||
Since they mean the same thing
|
||
${""}
|
||
\`\`\` text
|
||
Code blocks are ignored
|
||
Even with multiple lines
|
||
\`\`\`
|
||
Another paragraph here
|
||
${""}
|
||
> Blockquotes are affected ${""}
|
||
> More content here ${""}
|
||
Content here
|
||
${""}
|
||
<div>
|
||
html content
|
||
should be ignored
|
||
</div>
|
||
Even more content here
|
||
${""}
|
||
`})]}get optionBuilders(){return[]}};ur=O([S.register],ur);var Bo=class{constructor(){this.listStyle="consistent"}},pr=class extends S{get OptionsClass(){return Bo}get name(){return"Unordered List Style"}get description(){return"Makes sure that unordered lists follow the style specified."}get type(){return"Content"}apply(t,n){return $([k.code,k.yaml,k.tag],t,i=>Fu(i,n.listStyle))}get exampleBuilders(){return[new x({description:"Unordered lists have their indicator updated to `*` when `List item style = 'consistent'` and `*` is the first unordered list indicator",before:d`
|
||
1. ordered item 1
|
||
2. ordered item 2
|
||
${""}
|
||
Checklists should be ignored
|
||
- [ ] Checklist item 1
|
||
- [x] completed item
|
||
${""}
|
||
* Item 1
|
||
- Sublist 1 item 1
|
||
- Sublist 1 item 2
|
||
- Item 2
|
||
+ Sublist 2 item 1
|
||
+ Sublist 2 item 2
|
||
+ Item 3
|
||
* Sublist 3 item 1
|
||
* Sublist 3 item 2
|
||
${""}
|
||
`,after:d`
|
||
1. ordered item 1
|
||
2. ordered item 2
|
||
${""}
|
||
Checklists should be ignored
|
||
- [ ] Checklist item 1
|
||
- [x] completed item
|
||
${""}
|
||
* Item 1
|
||
* Sublist 1 item 1
|
||
* Sublist 1 item 2
|
||
* Item 2
|
||
* Sublist 2 item 1
|
||
* Sublist 2 item 2
|
||
* Item 3
|
||
* Sublist 3 item 1
|
||
* Sublist 3 item 2
|
||
${""}
|
||
`}),new x({description:"Unordered lists have their indicator updated to `-` when `List item style = '-'`",before:d`
|
||
- Item 1
|
||
* Sublist 1 item 1
|
||
* Sublist 1 item 2
|
||
* Item 2
|
||
+ Sublist 2 item 1
|
||
+ Sublist 2 item 2
|
||
+ Item 3
|
||
- Sublist 3 item 1
|
||
- Sublist 3 item 2
|
||
${""}
|
||
See that the ordered list is ignored, but its sublist is not
|
||
${""}
|
||
1. Item 1
|
||
- Sub item 1
|
||
1. Item 2
|
||
* Sub item 2
|
||
1. Item 3
|
||
+ Sub item 3
|
||
`,after:d`
|
||
- Item 1
|
||
- Sublist 1 item 1
|
||
- Sublist 1 item 2
|
||
- Item 2
|
||
- Sublist 2 item 1
|
||
- Sublist 2 item 2
|
||
- Item 3
|
||
- Sublist 3 item 1
|
||
- Sublist 3 item 2
|
||
${""}
|
||
See that the ordered list is ignored, but its sublist is not
|
||
${""}
|
||
1. Item 1
|
||
- Sub item 1
|
||
1. Item 2
|
||
- Sub item 2
|
||
1. Item 3
|
||
- Sub item 3
|
||
`,options:{listStyle:"-"}}),new x({description:"Unordered lists have their indicator updated to `*` when `List item style = '*'`",before:d`
|
||
- Item 1
|
||
* Sublist 1 item 1
|
||
* Sublist 1 item 2
|
||
* Item 2
|
||
+ Sublist 2 item 1
|
||
+ Sublist 2 item 2
|
||
+ Item 3
|
||
- Sublist 3 item 1
|
||
- Sublist 3 item 2
|
||
${""}
|
||
`,after:d`
|
||
* Item 1
|
||
* Sublist 1 item 1
|
||
* Sublist 1 item 2
|
||
* Item 2
|
||
* Sublist 2 item 1
|
||
* Sublist 2 item 2
|
||
* Item 3
|
||
* Sublist 3 item 1
|
||
* Sublist 3 item 2
|
||
${""}
|
||
`,options:{listStyle:"*"}}),new x({description:"Unordered list in blockquote has list item indicators set to `+` when `List item style = '-'`",before:d`
|
||
> - Item 1
|
||
> + Item 2
|
||
> > * Subitem 1
|
||
> > + Subitem 2
|
||
> > - Sub sub item 1
|
||
> > - Subitem 3
|
||
`,after:d`
|
||
> + Item 1
|
||
> + Item 2
|
||
> > + Subitem 1
|
||
> > + Subitem 2
|
||
> > + Sub sub item 1
|
||
> > + Subitem 3
|
||
`,options:{listStyle:"+"}})]}get optionBuilders(){return[new ye({OptionsClass:Bo,name:"List item style",description:"The list item style to use in unordered lists",optionsKey:"listStyle",records:[{value:"consistent",description:"Makes sure unordered list items use a consistent list item indicator in the file which will be based on the first list item found"},{value:"-",description:"Makes sure unordered list items use `-` as their indicator"},{value:"*",description:"Makes sure unordered list items use `*` as their indicator"},{value:"+",description:"Makes sure unordered list items use `+` as their indicator"}]})]}};pr=O([S.register],pr);var Ot=class{constructor(){this.priorityKeysAtStartOfYaml=!0;this.yamlKeyPrioritySortOrder=[];this.yamlSortOrderForOtherKeys="None"}};O([S.noSettingControl()],Ot.prototype,"dateModifiedKey",2),O([S.noSettingControl()],Ot.prototype,"currentTimeFormatted",2),O([S.noSettingControl()],Ot.prototype,"yamlTimestampDateModifiedEnabled",2);var hn=class extends S{get OptionsClass(){return Ot}get name(){return"YAML Key Sort"}get description(){return"Sorts the YAML keys based on the order and priority specified. Note: may remove blank lines as well."}get type(){return"YAML"}apply(t,n){let i=t.match(ke);if(!i)return t;let r=i[1],o=n.priorityKeysAtStartOfYaml,s=function(A,L){return A==L?L:Te(L,n.dateModifiedKey," "+n.currentTimeFormatted)},a=function(A,L,M){let T=`${L}${A}`;return M&&(T=`${A}${L}`),n.yamlTimestampDateModifiedEnabled&&(T=s(i[1],T)),t.replace(i[1],T)},l=function(A,L){let M="";for(let T of L){let B=Oe(A,T);B!==null&&(B.includes(`
|
||
`)?M+=`${T}:${B}
|
||
`:M+=`${T}: ${B}
|
||
`,A=Gt(A,T))}return{remainingYaml:A,sortedYamlKeyValues:M}},p=n.yamlKeyPrioritySortOrder,u=l(r,p),m=u.sortedYamlKeyValues;r=u.remainingYaml;let c=n.yamlSortOrderForOtherKeys,f=Je(r);if(f==null)return a(m,r,o);let h=function(A,L){return A=A.toLowerCase(),L=L.toLowerCase(),A>L?-1:L>A?1:0},g=function(A,L){return A=A.toLowerCase(),L=L.toLowerCase(),A<L?-1:L<A?1:0},w=Object.keys(f),y;if(c==="Ascending Alphabetical")y=g;else if(c==="Descending Alphabetical")y=h;else return a(m,r,o);w=w.sort(y);let E=l(r,w);return a(m,E.sortedYamlKeyValues,o)}get exampleBuilders(){return[new x({description:"Sorts YAML keys in order specified by `YAML Key Priority Sort Order` has a sort order of `date type language`",before:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
keywords: []
|
||
status: WIP
|
||
date: 02/15/2022
|
||
---
|
||
`,after:d`
|
||
---
|
||
date: 02/15/2022
|
||
type: programming
|
||
language: Typescript
|
||
tags: computer
|
||
keywords: []
|
||
status: WIP
|
||
---
|
||
`,options:{yamlKeyPrioritySortOrder:["date","type","language"],yamlSortOrderForOtherKeys:"None",priorityKeysAtStartOfYaml:!0}}),new x({description:"Sorts YAML keys in order specified by `YAML Key Priority Sort Order` has a sort order of `date type language` with `'YAML Sort Order for Other Keys' = Ascending Alphabetical`",before:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
keywords: []
|
||
status: WIP
|
||
date: 02/15/2022
|
||
---
|
||
`,after:d`
|
||
---
|
||
date: 02/15/2022
|
||
type: programming
|
||
language: Typescript
|
||
keywords: []
|
||
status: WIP
|
||
tags: computer
|
||
---
|
||
`,options:{yamlKeyPrioritySortOrder:["date","type","language"],yamlSortOrderForOtherKeys:"Ascending Alphabetical"}}),new x({description:"Sorts YAML keys in order specified by `YAML Key Priority Sort Order` has a sort order of `date type language` with `'YAML Sort Order for Other Keys' = Descending Alphabetical`",before:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
keywords: []
|
||
status: WIP
|
||
date: 02/15/2022
|
||
---
|
||
`,after:d`
|
||
---
|
||
date: 02/15/2022
|
||
type: programming
|
||
language: Typescript
|
||
tags: computer
|
||
status: WIP
|
||
keywords: []
|
||
---
|
||
`,options:{yamlKeyPrioritySortOrder:["date","type","language"],yamlSortOrderForOtherKeys:"Descending Alphabetical",priorityKeysAtStartOfYaml:!0}}),new x({description:"Sorts YAML keys in order specified by `YAML Key Priority Sort Order` has a sort order of `date type language` with `'YAML Sort Order for Other Keys' = Descending Alphabetical` and `'Priority Keys at Start of YAML' = false`",before:d`
|
||
---
|
||
language: Typescript
|
||
type: programming
|
||
tags: computer
|
||
keywords: []
|
||
${""}
|
||
status: WIP
|
||
date: 02/15/2022
|
||
---
|
||
`,after:d`
|
||
---
|
||
tags: computer
|
||
status: WIP
|
||
keywords: []
|
||
date: 02/15/2022
|
||
type: programming
|
||
language: Typescript
|
||
---
|
||
`,options:{yamlKeyPrioritySortOrder:["date","type","language"],yamlSortOrderForOtherKeys:"Descending Alphabetical",priorityKeysAtStartOfYaml:!1}})]}get optionBuilders(){return[new Ae({OptionsClass:Ot,name:"YAML Key Priority Sort Order",description:"The order in which to sort keys with one on each line where it sorts in the order found in the list",optionsKey:"yamlKeyPrioritySortOrder"}),new U({OptionsClass:Ot,name:"Priority Keys at Start of YAML",description:"YAML Key Priority Sort Order is placed at the start of the YAML frontmatter",optionsKey:"priorityKeysAtStartOfYaml"}),new ye({OptionsClass:Ot,name:"YAML Sort Order for Other Keys",description:"The way in which to sort the keys that are not found in the YAML Key Priority Sort Order text area",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"}]})]}get hasSpecialExecutionOrder(){return!0}};hn=O([S.register],hn);var At=require("obsidian");var Qe=class{constructor(){this.dateCreatedKey="date created";this.dateCreated=!0;this.format="dddd, MMMM Do YYYY, h:mm:ss a";this.dateModified=!0;this.dateModifiedKey="date modified";this.locale="en"}};O([S.noSettingControl()],Qe.prototype,"alreadyModified",2),O([S.noSettingControl()],Qe.prototype,"fileCreatedTime",2),O([S.noSettingControl()],Qe.prototype,"fileModifiedTime",2),O([S.noSettingControl()],Qe.prototype,"locale",2),O([S.noSettingControl()],Qe.prototype,"currentTime",2);var Ht=class extends S{get OptionsClass(){return Qe}get name(){return"YAML Timestamp"}get description(){return"Keep track of the date the file was last edited in the YAML front matter. Gets dates from file metadata."}get type(){return"YAML"}apply(t,n){let i=n.alreadyModified,r=ht(t);return i=i||r!==t,Se(r,o=>{let s=`
|
||
${n.dateCreatedKey}: [^
|
||
]+
|
||
`,a=`
|
||
${n.dateCreatedKey}:[ ]*
|
||
`,l=new RegExp(a),p=new RegExp(s);if(n.dateCreated){let u=(0,At.moment)(n.fileCreatedTime);u.locale(n.locale);let m=u.format(n.format),c=`
|
||
${n.dateCreatedKey}: ${m}`,f=p.test(o);if(!f&&l.test(o))o=o.replace(l,We(c)+`
|
||
`),i=!0;else if(f){if(f){let h=(0,At.moment)(o.match(p)[0].replace(n.dateCreatedKey+":","").trim(),n.format,n.locale,!0);(h==null||!h.isValid())&&(o=o.replace(p,We(c)+`
|
||
`),i=!0)}}else{let h=o.indexOf(`
|
||
---`);o=Wt(o,h,`
|
||
${n.dateCreatedKey}: ${m}`),i=!0}}if(n.dateModified){let u=`
|
||
${n.dateModifiedKey}: [^
|
||
]+
|
||
`,m=`
|
||
${n.dateModifiedKey}:[ ]*
|
||
`,c=new RegExp(m),f=new RegExp(u),h=(0,At.moment)(n.fileModifiedTime);h.locale(n.locale);let g=n.currentTime.format(n.format),w=`
|
||
${n.dateModifiedKey}: ${g}`,y=f.test(o);if(y){let E=(0,At.moment)(o.match(f)[0].replace(n.dateModifiedKey+":","").trim(),n.format,n.locale,!0);(i||E==null||!E.isValid()||Math.abs(E.diff(h,"seconds"))>5)&&(o=o.replace(f,We(w)+`
|
||
`))}else if(c.test(o))o=o.replace(c,We(w)+`
|
||
`);else if(!y){let E=o.indexOf(`
|
||
---`);o=Wt(o,E,w)}}return o})}get exampleBuilders(){return[new x({description:"Adds a header with the date.",before:d`
|
||
# H1
|
||
`,after:d`
|
||
---
|
||
date created: Wednesday, January 1st 2020, 12:00:00 am
|
||
date modified: Thursday, January 2nd 2020, 12:00:05 am
|
||
---
|
||
# H1
|
||
`,options:{fileCreatedTime:"2020-01-01T00:00:00-00:00",fileModifiedTime:"2020-01-02T00:00:00-00:00",currentTime:(0,At.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new x({description:"dateCreated option is false",before:d`
|
||
# H1
|
||
`,after:d`
|
||
---
|
||
date modified: Thursday, January 2nd 2020, 12:00:05 am
|
||
---
|
||
# H1
|
||
`,options:{dateCreated:!1,fileCreatedTime:"2020-01-01T00:00:00-00:00",fileModifiedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,At.moment)("Thursday, January 2nd 2020, 12:00:05 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new x({description:"Date Created Key is set",before:d`
|
||
# H1
|
||
`,after:d`
|
||
---
|
||
created: Wednesday, January 1st 2020, 12:00:00 am
|
||
---
|
||
# H1
|
||
`,options:{dateCreated:!0,dateModified:!1,dateCreatedKey:"created",fileCreatedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,At.moment)("Thursday, January 2nd 2020, 12:00:03 am","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}}),new x({description:"Date Modified Key is set",before:d`
|
||
# H1
|
||
`,after:d`
|
||
---
|
||
modified: Wednesday, January 1st 2020, 4:00:00 pm
|
||
---
|
||
# H1
|
||
`,options:{dateCreated:!1,dateModified:!0,dateModifiedKey:"modified",fileModifiedTime:"2020-01-01T00:00:00-00:00",currentTime:(0,At.moment)("Wednesday, January 1st 2020, 4:00:00 pm","dddd, MMMM Do YYYY, h:mm:ss a"),alreadyModified:!1}})]}get optionBuilders(){return[new U({OptionsClass:Qe,name:"Date Created",description:"Insert the file creation date",optionsKey:"dateCreated"}),new at({OptionsClass:Qe,name:"Date Created Key",description:"Which YAML key to use for creation date",optionsKey:"dateCreatedKey"}),new U({OptionsClass:Qe,name:"Date Modified",description:"Insert the date the file was last modified",optionsKey:"dateModified"}),new at({OptionsClass:Qe,name:"Date Modified Key",description:"Which YAML key to use for modification date",optionsKey:"dateModifiedKey"}),new eo({OptionsClass:Qe,name:"Format",description:"Moment date format to use (see [Moment format options](https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/))",optionsKey:"format"})]}get hasSpecialExecutionOrder(){return!0}};Ht=O([S.register],Ht);var Ct=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"'}};O([S.noSettingControl()],Ct.prototype,"aliasArrayStyle",2),O([S.noSettingControl()],Ct.prototype,"fileName",2),O([S.noSettingControl()],Ct.prototype,"defaultEscapeCharacter",2);var cr=class extends S{get OptionsClass(){return Ct}get name(){return"YAML Title Alias"}get description(){return"Inserts the title of the file into the YAML frontmatter's aliases section. Gets the title from the first H1 or filename."}get type(){return"YAML"}apply(t,n){t=ht(t);let i=$([k.code,k.yaml,k.tag],t,Nr);i=i||n.fileName;let r=null,o=t.match(ke)[1],s=!n.keepAliasThatMatchesTheFilename&&i===n.fileName;n.useYamlKeyToKeepTrackOfOldFilenameOrHeading&&(r=Je(Oe(o,pi)));let a=o.replace(`---
|
||
`,"").replace(`
|
||
---`,""),l=Je(o);r=Je(Oe(o,pi)),i=St(i,n.defaultEscapeCharacter);let p=function(c,f){if(c==null)return f?"":i;if(typeof c=="string")f?c===i&&(c=""):r===c?c=i:c=[i,c];else if(r!==null){let h=c.indexOf(r);h!==-1&&(f?c.splice(h,1):c[h]=i)}else{let h=c.indexOf(i);h!==-1?f&&c.splice(h,1):f||(c=[i,...c])}return c===""||c.length===0?"":c},u=null,m=Object.keys(l);for(let c of ui)if(m.includes(c)){u=c;break}if(u!=null){let c=Oe(a,u),f="multi-line",h=c==="",g=!1;c.includes(`
|
||
`)||(c.match(/^\[.*\]/)===null?(f="single string to single-line",g=!0):f="single-line");let w=Yr(gt(c)),y=p(w,s);y===""?a=Gt(a,u):n.preserveExistingAliasesSectionStyle?!h&&(g&&i==y||!g||w==y)?a=Te(a,u,Ge(y,f)):a=Te(a,u,Ge(y,n.aliasArrayStyle)):a=Te(a,u,Ge(y,n.aliasArrayStyle))}else s||(a=Te(a,ds,Ge(i,n.aliasArrayStyle)));return!n.useYamlKeyToKeepTrackOfOldFilenameOrHeading||s?a=Gt(a,pi):a=Te(a,pi,` ${i}`),t=t.replace(`---
|
||
${o}---
|
||
`,`---
|
||
${a}---
|
||
`),t}get exampleBuilders(){return[new x({description:"Adds a header with the title from heading.",before:d`
|
||
# Obsidian
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- Obsidian
|
||
linter-yaml-title-alias: Obsidian
|
||
---
|
||
# Obsidian
|
||
`}),new x({description:"Adds a header with the title from heading without YAML key when the use of the YAML key is set to false.",before:d`
|
||
# Obsidian
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- Obsidian
|
||
---
|
||
# Obsidian
|
||
`,options:{useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new x({description:"Adds a header with the title.",before:d`
|
||
${""}
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- Filename
|
||
linter-yaml-title-alias: Filename
|
||
---
|
||
${""}
|
||
`,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}}),new x({description:"Adds a header with the title without YAML key when the use of the YAML key is set to false.",before:d`
|
||
${""}
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- Filename
|
||
---
|
||
${""}
|
||
`,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0,useYamlKeyToKeepTrackOfOldFilenameOrHeading:!1}}),new x({description:"Replaces old filename with new filename when no header is present and filename is different than the old one listed in `linter-yaml-title-alias`.",before:d`
|
||
---
|
||
aliases:
|
||
- Old Filename
|
||
- Alias 2
|
||
linter-yaml-title-alias: Old Filename
|
||
---
|
||
${""}
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- Filename
|
||
- Alias 2
|
||
linter-yaml-title-alias: Filename
|
||
---
|
||
${""}
|
||
`,options:{fileName:"Filename",keepAliasThatMatchesTheFilename:!0}}),new x({description:"Make sure that markdown and wiki links in first H1 get their values converted to text",before:d`
|
||
# This is a [Heading](markdown.md)
|
||
`,after:d`
|
||
---
|
||
aliases:
|
||
- This is a Heading
|
||
linter-yaml-title-alias: This is a Heading
|
||
---
|
||
# This is a [Heading](markdown.md)
|
||
`,options:{aliasArrayStyle:"multi-line"}})]}get optionBuilders(){return[new U({OptionsClass:Ct,name:"Preserve existing aliases section style",description:"If set, the `YAML aliases section style` setting applies only to the newly created sections",optionsKey:"preserveExistingAliasesSectionStyle"}),new U({OptionsClass:Ct,name:"Keep alias that matches the filename",description:"Such aliases are usually redundant",optionsKey:"keepAliasThatMatchesTheFilename"}),new U({OptionsClass:Ct,name:"Use the YAML key `linter-yaml-title-alias` to help with filename and heading changes",description:"If set, when the first H1 heading changes or filename if first H1 is not present changes, then the old alias stored in this key will be replaced with the new value instead of just inserting a new entry in the aliases array",optionsKey:"useYamlKeyToKeepTrackOfOldFilenameOrHeading"})]}};cr=O([S.register],cr);var Nn=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title"}};O([S.noSettingControl()],Nn.prototype,"fileName",2),O([S.noSettingControl()],Nn.prototype,"defaultEscapeCharacter",2);var mr=class extends S{get OptionsClass(){return Nn}get name(){return"YAML Title"}get description(){return"Inserts the title of the file into the YAML frontmatter. Gets the title from the first H1 or filename if there is no H1."}get type(){return"YAML"}apply(t,n){t=ht(t);let i=$([k.code,k.yaml,k.tag],t,Nr);return i=i||n.fileName,i=St(i,n.defaultEscapeCharacter),Se(t,r=>{let o=`
|
||
${n.titleKey}.*
|
||
`,s=new RegExp(o);if(s.test(r))r=r.replace(s,We(`
|
||
${n.titleKey}: ${i}
|
||
`));else{let a=r.indexOf(`
|
||
---`);r=Wt(r,a,`
|
||
${n.titleKey}: ${i}`)}return r})}get exampleBuilders(){return[new x({description:"Adds a header with the title from heading.",before:d`
|
||
# Obsidian
|
||
`,after:d`
|
||
---
|
||
title: Obsidian
|
||
---
|
||
# Obsidian
|
||
`,options:{fileName:"Filename"}}),new x({description:"Adds a header with the title.",before:d`
|
||
${""}
|
||
`,after:d`
|
||
---
|
||
title: Filename
|
||
---
|
||
${""}
|
||
`,options:{fileName:"Filename"}}),new x({description:"Make sure that markdown links in headings are properly copied to the yaml as just the text",before:d`
|
||
# This is a [Heading](test heading.md)
|
||
`,after:d`
|
||
---
|
||
title: This is a Heading
|
||
---
|
||
# This is a [Heading](test heading.md)
|
||
`})]}get optionBuilders(){return[new at({OptionsClass:Nn,name:"Title Key",description:"Which YAML key to use for title",optionsKey:"titleKey"})]}};mr=O([S.register],mr);var jh=`<svg fill="currentColor" viewBox="0 0 100 100" width="100" height="100" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M5 2v97.649h91.607V28.734l-.715-.663L65.356 2.597 64.56 2Zm5.09 4.246h50.892v25.473h30.536v63.684H10.089Zm55.982 3.051L87.86 27.474H66.072Z" style="stroke-width:2.32417"/>
|
||
<g style="opacity:1;fill:none;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" stroke-linecap="round">
|
||
<path d="M89.161 11.093a1 1 0 0 0-1.656-.392l-7.189 7.189a5.765 5.765 0 0 1-4.104 1.7 5.768 5.768 0 0 1-4.104-1.699 5.811 5.811 0 0 1 0-8.207l7.189-7.189a1 1 0 0 0-.392-1.656C73.042-1.106 66.689.39 62.335 4.745a16.177 16.177 0 0 0-3.792 16.948l-36.85 36.851a16.18 16.18 0 0 0-16.948 3.792C.39 66.691-1.107 73.04.838 78.906a.998.998 0 0 0 1.656.392l7.189-7.189a5.81 5.81 0 0 1 8.207 0 5.764 5.764 0 0 1 1.699 4.104 5.763 5.763 0 0 1-1.7 4.104L10.7 87.506a.999.999 0 0 0 .392 1.656c1.7.563 3.44.839 5.16.839 4.218 0 8.317-1.652 11.41-4.745a16.177 16.177 0 0 0 3.793-16.948l36.851-36.851a16.177 16.177 0 0 0 16.948-3.793c4.357-4.355 5.853-10.705 3.907-16.571z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.59252 0 0 .54674 22.478 41.225)"/>
|
||
<path d="M72.088 57.275a1.003 1.003 0 0 0-.662-.292c-3.462-.155-7.078-1.876-9.923-4.721-1.742-1.743-3.065-3.782-3.863-5.897L46.517 57.488c2.115.799 4.154 2.121 5.897 3.863 2.845 2.846 4.565 6.462 4.721 9.923.012.249.115.485.292.662l14.876 14.876a10.334 10.334 0 0 0 7.33 3.031c2.655 0 5.311-1.01 7.331-3.031 4.041-4.042 4.041-10.619 0-14.661zM5.351 14.171c.123.219.324.384.563.462l5.82 1.89 23.869 23.869 4.638-4.638-23.869-23.869-1.891-5.82a1.003 1.003 0 0 0-.462-.563L4.714.279a1 1 0 0 0-1.196.165L.293 3.668a1 1 0 0 0-.165 1.196Z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.59252 0 0 .54674 22.478 41.225)"/>
|
||
</g>
|
||
</svg>`,Wh=`<svg width="100" height="100" viewBox="0 0 100 100" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||
<g style="opacity:1;fill:none;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" stroke-linecap="round">
|
||
<path d="M89.161 11.093a1 1 0 0 0-1.656-.392l-7.189 7.189a5.765 5.765 0 0 1-4.104 1.7 5.768 5.768 0 0 1-4.104-1.699 5.811 5.811 0 0 1 0-8.207l7.189-7.189a1 1 0 0 0-.392-1.656C73.042-1.106 66.689.39 62.335 4.745a16.177 16.177 0 0 0-3.792 16.948l-36.85 36.851a16.18 16.18 0 0 0-16.948 3.792C.39 66.691-1.107 73.04.838 78.906a.998.998 0 0 0 1.656.392l7.189-7.189a5.81 5.81 0 0 1 8.207 0 5.764 5.764 0 0 1 1.699 4.104 5.763 5.763 0 0 1-1.7 4.104L10.7 87.506a.999.999 0 0 0 .392 1.656c1.7.563 3.44.839 5.16.839 4.218 0 8.317-1.652 11.41-4.745a16.177 16.177 0 0 0 3.793-16.948l36.851-36.851a16.177 16.177 0 0 0 16.948-3.793c4.357-4.355 5.853-10.705 3.907-16.571z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.57187 0 0 .39802 28.922 50.846)"/>
|
||
<path d="M72.088 57.275a1.003 1.003 0 0 0-.662-.292c-3.462-.155-7.078-1.876-9.923-4.721-1.742-1.743-3.065-3.782-3.863-5.897L46.517 57.488c2.115.799 4.154 2.121 5.897 3.863 2.845 2.846 4.565 6.462 4.721 9.923.012.249.115.485.292.662l14.876 14.876a10.334 10.334 0 0 0 7.33 3.031c2.655 0 5.311-1.01 7.331-3.031 4.041-4.042 4.041-10.619 0-14.661zM5.351 14.171c.123.219.324.384.563.462l5.82 1.89 23.869 23.869 4.638-4.638-23.869-23.869-1.891-5.82a1.003 1.003 0 0 0-.462-.563L4.714.279a1 1 0 0 0-1.196.165L.293 3.668a1 1 0 0 0-.165 1.196Z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.57187 0 0 .39802 28.922 50.846)"/>
|
||
</g>
|
||
<g style="opacity:1;fill:none;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none">
|
||
<path d="M89.234 35.526a3.794 3.794 0 0 0-3.065-1.536H74.085v-8.511a5.187 5.187 0 0 0-5.181-5.181H44.128a2.196 2.196 0 0 1-1.542-.639l-7.588-7.588a5.144 5.144 0 0 0-3.664-1.518H5.181A5.188 5.188 0 0 0 0 15.735v59.569a4.147 4.147 0 0 0 4.142 4.143h70.075c2.389 0 4.245-1.737 5.093-4.753l10.531-35.792c.344-1.17.124-2.4-.607-3.376zM4.142 76.446c-.63 0-1.142-.513-1.142-1.143V15.735c0-1.203.978-2.181 2.181-2.181h26.154c.574 0 1.136.233 1.542.639l7.588 7.588a5.144 5.144 0 0 0 3.664 1.518h24.776c1.202 0 2.181.978 2.181 2.181v8.511h-50.05a5.292 5.292 0 0 0-5.065 3.817L5.342 74.893c-.442 1.553-.954 1.553-1.2 1.553Zm82.821-38.392-10.537 35.81c-.331 1.179-.983 2.582-2.222 2.582H7.985c.086-.227.167-.469.241-.729l10.629-37.083a2.278 2.278 0 0 1 2.181-1.644h65.133c.36 0 .57.208.663.333a.813.813 0 0 1 .131.731z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(1.06512 0 0 1.385 3.167 -10.742)"/>
|
||
</g>
|
||
</svg>`,Uh=`<svg width="100" height="100" viewBox="0 0 100 100" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||
<g style="opacity:1;fill:none;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(1.07096 0 0 1.20147 1.964 -4.212)">
|
||
<path d="M90 84.505H0V5.495h90zm-86-4h82V9.495H4Z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
<path d="M90 32.695H0v-27.2h90zm-86-4h82v-19.2H4Z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
<rect x="9.58" y="17.09" rx="0" ry="0" width="3.07" height="4" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
<rect x="16.45" y="17.09" rx="0" ry="0" width="3.07" height="4" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
<rect x="23.31" y="17.09" rx="0" ry="0" width="3.07" height="4" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
<rect x="36.55" y="17.09" rx="0" ry="0" width="43.88" height="4" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none"/>
|
||
</g>
|
||
<g style="opacity:1;fill:none;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" stroke-linecap="round">
|
||
<path d="M89.161 11.093a1 1 0 0 0-1.656-.392l-7.189 7.189a5.765 5.765 0 0 1-4.104 1.7 5.768 5.768 0 0 1-4.104-1.699 5.811 5.811 0 0 1 0-8.207l7.189-7.189a1 1 0 0 0-.392-1.656C73.042-1.106 66.689.39 62.335 4.745a16.177 16.177 0 0 0-3.792 16.948l-36.85 36.851a16.18 16.18 0 0 0-16.948 3.792C.39 66.691-1.107 73.04.838 78.906a.998.998 0 0 0 1.656.392l7.189-7.189a5.81 5.81 0 0 1 8.207 0 5.764 5.764 0 0 1 1.699 4.104 5.763 5.763 0 0 1-1.7 4.104L10.7 87.506a.999.999 0 0 0 .392 1.656c1.7.563 3.44.839 5.16.839 4.218 0 8.317-1.652 11.41-4.745a16.177 16.177 0 0 0 3.793-16.948l36.851-36.851a16.177 16.177 0 0 0 16.948-3.793c4.357-4.355 5.853-10.705 3.907-16.571z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.66714 0 0 .51336 18.867 41.049)"/>
|
||
<path d="M72.088 57.275a1.003 1.003 0 0 0-.662-.292c-3.462-.155-7.078-1.876-9.923-4.721-1.742-1.743-3.065-3.782-3.863-5.897L46.517 57.488c2.115.799 4.154 2.121 5.897 3.863 2.845 2.846 4.565 6.462 4.721 9.923.012.249.115.485.292.662l14.876 14.876a10.334 10.334 0 0 0 7.33 3.031c2.655 0 5.311-1.01 7.331-3.031 4.041-4.042 4.041-10.619 0-14.661zM5.351 14.171c.123.219.324.384.563.462l5.82 1.89 23.869 23.869 4.638-4.638-23.869-23.869-1.891-5.82a1.003 1.003 0 0 0-.462-.563L4.714.279a1 1 0 0 0-1.196.165L.293 3.668a1 1 0 0 0-.165 1.196Z" style="opacity:1;fill:currentColor;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none" transform="matrix(.66714 0 0 .51336 18.867 41.049)"/>
|
||
</g>
|
||
</svg>`,Gh=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
||
<path fill="currentColor" d="M75 12.5V6.25H40.625a21.875 21.875 0 0 0 0 43.75H50v31.25h-6.25v6.25H75v-6.25h-6.25V12.5H75zM50 43.75h-9.375a15.625 15.625 0 1 1 0-31.25H50v31.25zm12.5 37.5h-6.25V12.5h6.25v68.75z"/>
|
||
</svg>`,Zh=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M55.719 22.131c1.812-.25 2.956-.213 3.831-.037a9.375 9.375 0 0 1 3.038 1.3 4.688 4.688 0 1 0 4.825-8.037 18.606 18.606 0 0 0-6.025-2.45c-2.244-.45-4.525-.406-7.05-.044l-.112.013c-5 .838-8.919 3.419-11.594 7.262-2.581 3.725-3.831 8.375-4.188 13.281a4.688 4.688 0 0 0-.006.331v.05l-.006.15-.019.519-.081 1.688c-.063 1.387-.169 3.25-.287 5.45l-.031.581H30a4.688 4.688 0 0 0 0 9.375h7.469l-.356 6.05a2608.581 2608.581 0 0 1-1.794 28.263c-.669 8.025-1.375 13.362-6.419 16.313-2.519 1.431-6.369 1.344-10.563-.75a4.688 4.688 0 0 0-4.188 8.375c5.794 2.906 13.188 4.069 19.419.506l.037-.019c9.581-5.594 10.425-15.937 11-22.912l.063-.75v-.031c.369-4.8 1.406-21.625 2.188-35.044h11.269a4.688 4.688 0 0 0 0-9.375H47.4c.231-4.175.388-7.225.406-8.225.287-3.788 1.219-6.594 2.525-8.475 1.231-1.769 2.919-2.938 5.388-3.356Zm49.156 42.125a4.688 4.688 0 1 0-6.625-6.631L82.131 73.738a226.175 226.175 0 0 1-4.75-8.463l-.456-.725c-.956-1.531-2.381-3.819-4.112-5.419a10.056 10.056 0 0 0-4.6-2.519 9.662 9.662 0 0 0-5.981.631 4.688 4.688 0 0 0-.875.494l-.206.137a11.125 11.125 0 0 0-1.769 1.456c-.281.294-.563.625-.825.931l-.137.163-1.025 1.188a4.688 4.688 0 0 0 7.087 6.144l1.081-1.263.131-.156c.263-.313.363-.425.419-.481l.075-.056c.063.037.144.106.256.213.356.325.781.844 1.325 1.644a48.75 48.75 0 0 1 1.05 1.619l.55.875c.756 1.469 3.063 5.606 5.912 10.438L57.625 98.25a4.688 4.688 0 1 0 6.625 6.625l16.637-16.631a240.988 240.988 0 0 1 5.1 9.069l.313.544c.813 1.381 2.188 3.731 4 5.45 1.125 1.069 2.637 2.125 4.581 2.637a10.038 10.038 0 0 0 6.6-.6c2.225-1.113 3.6-2.55 5.025-4.869a4.688 4.688 0 0 0-8-4.894 5.95 5.95 0 0 1-.787 1.1.938.938 0 0 1-.2.156 1.163 1.163 0 0 1-.206.037h-.044s-.044-.013-.125-.063a2.419 2.419 0 0 1-.394-.313 9.156 9.156 0 0 1-1.269-1.606 37.587 37.587 0 0 1-.988-1.613l-.375-.644a289.688 289.688 0 0 0-6.381-11.244l17.137-17.144ZM66.25 65.768Zm-.013 0h.013Z"/>
|
||
</svg>`,Qh=`<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" preserveAspectRatio="xMidYMid meet" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M34.375 43.75a3.125 3.125 0 0 0 0 6.25h25a3.125 3.125 0 0 0 0 -6.25h-25Zm0 15.625a3.125 3.125 0 0 0 0 6.25h43.75a3.125 3.125 0 0 0 0 -6.25h-43.75Zm-3.125 18.75a3.125 3.125 0 0 1 3.125 -3.125h31.25a3.125 3.125 0 0 1 0 6.25h-31.25a3.125 3.125 0 0 1 -3.125 -3.125ZM28.125 25A15.625 15.625 0 0 0 12.5 40.625v43.75A15.625 15.625 0 0 0 28.125 100h68.75a15.625 15.625 0 0 0 15.625 -15.625v-43.75A15.625 15.625 0 0 0 96.875 25h-68.75ZM18.75 40.625A9.375 9.375 0 0 1 28.125 31.25h68.75A9.375 9.375 0 0 1 106.25 40.625v43.75a9.375 9.375 0 0 1 -9.375 9.375h-68.75A9.375 9.375 0 0 1 18.75 84.375v-43.75Z"/>
|
||
</svg>`,Xh=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M40.625 50a3.125 3.125 0 0 0 0 6.25h43.75a3.125 3.125 0 0 0 0-6.25h-43.75ZM37.5 71.875a3.125 3.125 0 0 1 3.125-3.125h18.75a3.125 3.125 0 0 1 0 6.25h-18.75a3.125 3.125 0 0 1-3.125-3.125ZM40.625 87.5a3.125 3.125 0 0 0 0 6.25h31.25a3.125 3.125 0 0 0 0-6.25h-31.25Zm12.5-75a9.375 9.375 0 0 0-8.844 6.25h-9.906A9.375 9.375 0 0 0 25 28.125v75a9.375 9.375 0 0 0 9.375 9.375h56.25a9.375 9.375 0 0 0 9.375-9.375v-75a9.375 9.375 0 0 0-9.375-9.375h-9.906a9.375 9.375 0 0 0-8.844-6.25h-18.75Zm18.75 6.25a3.125 3.125 0 0 1 0 6.25h-18.75a3.125 3.125 0 0 1 0-6.25h18.75ZM34.375 25h9.906a9.375 9.375 0 0 0 8.844 6.25h18.75A9.375 9.375 0 0 0 80.719 25h9.906a3.125 3.125 0 0 1 3.125 3.125v75a3.125 3.125 0 0 1-3.125 3.125h-56.25a3.125 3.125 0 0 1-3.125-3.125v-75A3.125 3.125 0 0 1 34.375 25Z"/>
|
||
</svg>`,Jh=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M87.5 18.75h-50A6.25 6.25 0 0 0 31.25 25v68.75h25.138a34.375 34.375 0 0 0 1.156 6.25H31.25a6.25 6.25 0 0 0 6.25 6.25H60a34.63 34.63 0 0 0 4.106 6.25H37.5A12.5 12.5 0 0 1 25 100V25a12.5 12.5 0 0 1 12.5-12.5h50A12.5 12.5 0 0 1 100 25v32.544a34.25 34.25 0 0 0-6.25-1.156V25a6.25 6.25 0 0 0-6.25-6.25Zm-50 12.5v6.25a6.25 6.25 0 0 0 6.25 6.25h37.5a6.25 6.25 0 0 0 6.25-6.25v-6.25A6.25 6.25 0 0 0 81.25 25h-37.5a6.25 6.25 0 0 0-6.25 6.25Zm6.25 0h37.5v6.25h-37.5v-6.25Zm75 59.375a28.125 28.125 0 1 1-56.25 0 28.125 28.125 0 0 1 56.25 0Zm-25-12.5a3.125 3.125 0 0 0-6.25 0V87.5h-9.375a3.125 3.125 0 0 0 0 6.25H87.5v9.375a3.125 3.125 0 0 0 6.25 0V93.75h9.375a3.125 3.125 0 0 0 0-6.25H93.75v-9.375Z"/>
|
||
</svg>`,eg=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M103.581 23.894a4.688 4.688 0 0 0-6.613 3.313c-1.594 7.112-8.175 16.3-16.756 22.019a4.688 4.688 0 1 0 5.2 7.8 54.806 54.806 0 0 0 11.463-10.338v50.187a4.688 4.688 0 0 0 9.375 0v-68.65a4.688 4.688 0 0 0-2.669-4.331Zm-81.706 4.231a4.688 4.688 0 1 0-9.375 0v68.75a4.688 4.688 0 0 0 9.375 0v-31.25h31.25v31.25a4.688 4.688 0 0 0 9.375 0v-68.75a4.688 4.688 0 1 0-9.375 0V56.25h-31.25V28.125Z"/>
|
||
</svg>`,tg=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 125 125">
|
||
<path fill="currentColor" d="M108.187 18.75a4.688 4.688 0 0 1 4.313 4.675v34.388a4.688 4.688 0 0 1-9.375 0V38.206a27.531 27.531 0 0 1-1.944 1.431 4.688 4.688 0 0 1-5.2-7.806c3.85-2.563 6.644-6.638 7.25-9.406a4.669 4.669 0 0 1 4.956-3.675ZM63.75 94.188a4.913 4.913 0 0 1-1.25-3.413V41.294a5.188 5.188 0 0 1 1.325-3.606l.025-.025a4.75 4.75 0 0 1 3.519-1.463 4.625 4.625 0 0 1 3.5 1.475c.938.994 1.375 2.244 1.375 3.625v14.669a15.53 15.53 0 0 1 3.006-2.288l.013-.006c2.481-1.438 5.25-2.15 8.275-2.15 5.438 0 9.925 2.063 13.3 6.162 3.356 4.075 4.956 9.412 4.956 15.862 0 6.469-1.6 11.819-4.956 15.9-3.381 4.081-7.906 6.125-13.419 6.125-3.081 0-5.894-.706-8.388-2.156h-.006a15.619 15.619 0 0 1-3.094-2.375 4.656 4.656 0 0 1-4.787 4.525 4.519 4.519 0 0 1-3.375-1.356l-.019-.025Zm11.313-11c1.862 2.325 4.181 3.438 7.062 3.438 3.05 0 5.344-1.106 7.062-3.313 1.75-2.275 2.712-5.475 2.712-9.763 0-4.263-.963-7.456-2.719-9.738-1.719-2.231-4.013-3.344-7.056-3.344-2.875 0-5.194 1.125-7.062 3.475-1.856 2.344-2.856 5.5-2.856 9.606 0 4.125 1 7.294 2.85 9.638Zm-64.125 7.543c0 1.319.531 2.469 1.519 3.344l.043.05a5.5 5.5 0 0 0 3.562 1.194 5 5 0 0 0 3.081-.975 5.731 5.731 0 0 0 1.875-2.694l4.662-12.662h20.462l4.694 12.662a5.719 5.719 0 0 0 1.875 2.688 5 5 0 0 0 3.087.981 5.375 5.375 0 0 0 3.55-1.213 4.313 4.313 0 0 0 1.581-3.375c0-.775-.219-1.625-.537-2.469L41.954 40.224a6.888 6.888 0 0 0-2.288-3.163 6.037 6.037 0 0 0-3.65-1.125c-1.4 0-2.688.344-3.781 1.125a6.8 6.8 0 0 0-2.362 3.206l-18.4 47.994a7.125 7.125 0 0 0-.537 2.469ZM42.987 70h-14.1l7.051-19.35 7.05 19.356Z"/>
|
||
</svg>`,ng=`<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" preserveAspectRatio="xMidYMid meet" viewBox="0 0 3200 3200">
|
||
<path fill="currentColor" d="m1473.706 130.869l-573.844 860.463v545.469H548.138v-545.469L0 130.869h395.313l348.55 554.038l351.406 -554.038h378.438zm590.631 1093.281H1427.706l-129.481 312.65H1016.313l596.125 -1405.931h288.356l571.938 1405.931h-301.225l-107.175 -312.65zm-105.75 -279.588l-195.162 -515.938l-217.731 515.938h412.887zM548.131 1691.187v1377.938h295.644V2118.638l309.406 638.875h232.713l319.975 -661.331v972.663h283.619V1691.187h-387.25l-343.606 623.163l-327.25 -623.163h-383.25zM3200 2770H2472.737V1691.187h-301.225v1372.013H3200v-293.188z"/>
|
||
</svg>`,ig=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
||
<path fill="currentColor" d="M9.55 36.915a42.455 42.455 0 0 1 8.9-15.4 2.5 2.5 0 0 1 2.7-.675l9.59 3.43a5 5 0 0 0 6.6-3.81l1.83-10.03a2.5 2.5 0 0 1 1.94-2 42.66 42.66 0 0 1 17.775 0 2.5 2.5 0 0 1 1.935 2l1.835 10.03a5 5 0 0 0 6.6 3.81l9.59-3.43a2.5 2.5 0 0 1 2.7.68 42.455 42.455 0 0 1 8.9 15.395 2.5 2.5 0 0 1-.76 2.675l-7.775 6.6a5 5 0 0 0 0 7.62l7.775 6.6a2.5 2.5 0 0 1 .76 2.675 42.455 42.455 0 0 1-8.9 15.4 2.5 2.5 0 0 1-2.7.675l-9.59-3.43a5 5 0 0 0-6.6 3.81L60.82 89.575a2.5 2.5 0 0 1-1.935 1.995 42.65 42.65 0 0 1-17.775 0 2.5 2.5 0 0 1-1.94-2l-1.825-10.03a5 5 0 0 0-6.6-3.81l-9.595 3.43a2.5 2.5 0 0 1-2.7-.68 42.45 42.45 0 0 1-8.9-15.395 2.5 2.5 0 0 1 .765-2.675l7.77-6.6a5 5 0 0 0 0-7.62l-7.77-6.6a2.5 2.5 0 0 1-.765-2.675Zm5.305-.03 6.47 5.49a10 10 0 0 1 0 15.25l-6.475 5.49a37.45 37.45 0 0 0 6.225 10.76l7.98-2.85a10 10 0 0 1 13.2 7.625l1.525 8.34a37.78 37.78 0 0 0 12.425 0l1.525-8.35a9.99 9.99 0 0 1 13.2-7.62l7.985 2.855a37.46 37.46 0 0 0 6.225-10.76l-6.47-5.49a9.99 9.99 0 0 1 0-15.25l6.47-5.49a37.455 37.455 0 0 0-6.225-10.76l-7.98 2.85a10 10 0 0 1-13.2-7.62l-1.53-8.345a37.775 37.775 0 0 0-12.425 0l-1.52 8.345a10 10 0 0 1-13.205 7.625l-7.98-2.855a37.455 37.455 0 0 0-6.225 10.76ZM37.5 50a12.5 12.5 0 1 1 25 0 12.5 12.5 0 0 1-25 0Zm5 0a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0Z"/>
|
||
</svg>`,Ie={folder:{id:"lint-folder",source:Wh},file:{id:"lint-file",source:jh},vault:{id:"lint-vault",source:Uh},whitespace:{id:"lint-whitespace",source:Gh},math:{id:"lint-math",source:Zh},content:{id:"lint-content",source:Qh},paste:{id:"lint-paste",source:Xh},custom:{id:"lint-custom",source:Jh},heading:{id:"lint-heading",source:eg},footer:{id:"lint-footer",source:tg},yaml:{id:"lint-yaml",source:ng},general:{id:"lint-general",source:ig}};var Hn=require("obsidian");var Io=class{constructor(){this.disabledRules=[]}lintText(t){let n=t.oldText;this.disabledRules=Bl(n);let i=this.runBeforeRegularRules(t);for(let r of yt){if(this.disabledRules.includes(r.alias())){Tt(r.alias()+" is disabled");continue}else if(r.hasSpecialExecutionOrder||r.type==="Paste")continue;[i]=st.applyIfEnabledBase(r,i,t.settings,{fileCreatedTime:t.fileInfo.createdAtFormatted,fileModifiedTime:t.fileInfo.modifiedAtFormatted,fileName:t.fileInfo.name,locale:t.momentLocale,minimumNumberOfDollarSignsToBeAMathBlock:t.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock,aliasArrayStyle:t.settings.commonStyles.aliasArrayStyle,tagArrayStyle:t.settings.commonStyles.tagArrayStyle,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter})}return i=this.runCustomRegexReplacement(t.settings.customRegexes,i),t.oldText=i,this.runAfterRegularRules(n,t)}runBeforeRegularRules(t){let n=t.oldText;return[n]=on.applyIfEnabled(n,t.settings,this.disabledRules),[n]=nn.applyIfEnabled(n,t.settings,this.disabledRules,{defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),n}runAfterRegularRules(t,n){let i=n.oldText;[i]=rn.applyIfEnabled(i,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter});let r=n.getCurrentTime(),o;[i,o]=Ht.applyIfEnabled(i,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:r,alreadyModified:t!=i,locale:n.momentLocale});let s=Ht.getRuleOptions(n.settings);return r=n.getCurrentTime(),[i]=hn.applyIfEnabled(i,n.settings,this.disabledRules,{currentTimeFormatted:r.format(s.format),yamlTimestampDateModifiedEnabled:o&&s.dateModified,dateModifiedKey:s.dateModifiedKey}),i}runCustomCommands(t,n){Tt("Running Custom Lint Commands");let i=new Set;for(let r of t){if(r.id){if(i.has(r.id)){Xr(`You cannot run the same command ("${r.name}") as a custom lint rule twice.`);continue}}else continue;try{i.add(r.id),n.executeCommandById(r.id)}catch(o){Gr(o,`Custom Lint Command ${r.id}`)}}}runCustomRegexReplacement(t,n){Tt("Running Custom Regex");let i=n;for(let r of t){if(r.find==null||r.replace===void 0||r.replace===null)continue;let o=new RegExp(`${r.find}`,r.flags);i=i.replace(o,Tl(r.replace))}return i}runPasteLint(t,n){let i=n.oldText;return[i]=pn.applyIfEnabled(i,n.settings,[]),[i]=dn.applyIfEnabled(i,n.settings,[]),[i]=mn.applyIfEnabled(i,n.settings,[]),[i]=ln.applyIfEnabled(i,n.settings,[]),[i]=cn.applyIfEnabled(i,n.settings,[]),[i]=sn.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=an.applyIfEnabled(i,n.settings,[],{lineContent:t}),[i]=Qt.applyIfEnabled(i,n.settings,[],{lineContent:t}),i}};function dr(e,t=null,n,i){let r=t?(0,Hn.moment)(t.stat.ctime):(0,Hn.moment)();r.locale(n);let o=t?(0,Hn.moment)(t.stat.mtime):(0,Hn.moment)();o.locale(n);let s=o.format(),a=r.format();return{oldText:e,fileInfo:{name:t?t.basename:"",createdAtFormatted:a,modifiedAtFormatted:s},settings:i,momentLocale:n,getCurrentTime:()=>{let l=(0,Hn.moment)();return l.locale(n),l}}}var Mo=require("obsidian"),fr=class extends Mo.Modal{constructor(t,n,i,r,o){super(t),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:"Warning"}).style.textAlign="center",this.contentEl.createEl("p",{text:n+" Make sure you have backed up your files."}).id="confirm-dialog",this.contentEl.createDiv("modal-button-container",s=>{s.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close());let a=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:i});a.addEventListener("click",async l=>{new Mo.Notice(r),this.close(),await o()}),setTimeout(()=>{a.focus()},50)})}};var de=require("obsidian");var cp=require("obsidian");var up=require("obsidian");var Hu=require("obsidian");var zn=class{constructor(t,n,i,r,o,s,a,l,p){this.containerEl=t;this.name=n;this.description=i;this.warning=r;this.addInputBtnText=o;this.isMobile=s;this.app=a;this.saveSettings=l;this.onAddInput=p}display(){this.containerEl.createEl(this.isMobile?"h4":"h3",{text:this.name}),He(this.description,this.containerEl),this.warning!=null&&this.containerEl.createEl("p",{text:this.warning,cls:"mod-warning"}),new Hu.Setting(this.containerEl).addButton(t=>{t.setButtonText(this.addInputBtnText).setCta().onClick(()=>this.onAddInput())}),this.inputElDiv=this.containerEl.createDiv(),this.showInputEls()}resetInputEls(){this.inputElDiv.empty(),this.showInputEls()}};var lp=require("obsidian");var pe="top",we="bottom",he="right",me="left",Fo="auto",zt=[pe,we,he,me],Et="start",gn="end",zu="clippingParents",Ro="viewport",Yn="popper",Yu="reference",da=zt.reduce(function(e,t){return e.concat([t+"-"+Et,t+"-"+gn])},[]),Do=[].concat(zt,[Fo]).reduce(function(e,t){return e.concat([t,t+"-"+Et,t+"-"+gn])},[]),rg="beforeRead",og="read",sg="afterRead",ag="beforeMain",lg="main",ug="afterMain",pg="beforeWrite",cg="write",mg="afterWrite",qu=[rg,og,sg,ag,lg,ug,pg,cg,mg];function Ce(e){return e?(e.nodeName||"").toLowerCase():null}function ue(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function tt(e){var t=ue(e).Element;return e instanceof t||e instanceof Element}function xe(e){var t=ue(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qn(e){if(typeof ShadowRoot>"u")return!1;var t=ue(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function dg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!xe(o)||!Ce(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function fg(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],o=t.attributes[i]||{},s=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=s.reduce(function(l,p){return l[p]="",l},{});!xe(r)||!Ce(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var Ku={name:"applyStyles",enabled:!0,phase:"write",fn:dg,effect:fg,requires:["computeStyles"]};function Ee(e){return e.split("-")[0]}var ut=Math.max,yn=Math.min,Lt=Math.round;function Kn(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hr(){return!/^((?!chrome|android).)*safari/i.test(Kn())}function nt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),r=1,o=1;t&&xe(e)&&(r=e.offsetWidth>0&&Lt(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Lt(i.height)/e.offsetHeight||1);var s=tt(e)?ue(e):window,a=s.visualViewport,l=!hr()&&n,p=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/o,m=i.width/r,c=i.height/o;return{width:m,height:c,top:u,right:p+m,bottom:u+c,left:p,x:p,y:u}}function bn(e){var t=nt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function gr(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qn(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function qe(e){return ue(e).getComputedStyle(e)}function fa(e){return["table","td","th"].indexOf(Ce(e))>=0}function Me(e){return((tt(e)?e.ownerDocument:e.document)||window.document).documentElement}function _t(e){return Ce(e)==="html"?e:e.assignedSlot||e.parentNode||(qn(e)?e.host:null)||Me(e)}function Vu(e){return!xe(e)||qe(e).position==="fixed"?null:e.offsetParent}function hg(e){var t=/firefox/i.test(Kn()),n=/Trident/i.test(Kn());if(n&&xe(e)){var i=qe(e);if(i.position==="fixed")return null}var r=_t(e);for(qn(r)&&(r=r.host);xe(r)&&["html","body"].indexOf(Ce(r))<0;){var o=qe(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function pt(e){for(var t=ue(e),n=Vu(e);n&&fa(n)&&qe(n).position==="static";)n=Vu(n);return n&&(Ce(n)==="html"||Ce(n)==="body"&&qe(n).position==="static")?t:n||hg(e)||t}function wn(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function xn(e,t,n){return ut(e,yn(t,n))}function ju(e,t,n){var i=xn(e,t,n);return i>n?n:i}function yr(){return{top:0,right:0,bottom:0,left:0}}function br(e){return Object.assign({},yr(),e)}function wr(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var gg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,br(typeof t!="number"?t:wr(t,zt))};function yg(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ee(n.placement),l=wn(a),p=[me,he].indexOf(a)>=0,u=p?"height":"width";if(!(!o||!s)){var m=gg(r.padding,n),c=bn(o),f=l==="y"?pe:me,h=l==="y"?we:he,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],w=s[l]-n.rects.reference[l],y=pt(o),E=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,A=g/2-w/2,L=m[f],M=E-c[u]-m[h],T=E/2-c[u]/2+A,B=xn(L,T,M),I=l;n.modifiersData[i]=(t={},t[I]=B,t.centerOffset=B-T,t)}}function bg(e){var t=e.state,n=e.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||!gr(t.elements.popper,r)||(t.elements.arrow=r))}var Wu={name:"arrow",enabled:!0,phase:"main",fn:yg,effect:bg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var wg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xg(e){var t=e.x,n=e.y,i=window,r=i.devicePixelRatio||1;return{x:Lt(t*r)/r||0,y:Lt(n*r)/r||0}}function Uu(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,p=e.adaptive,u=e.roundOffsets,m=e.isFixed,c=s.x,f=c===void 0?0:c,h=s.y,g=h===void 0?0:h,w=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=w.x,g=w.y;var y=s.hasOwnProperty("x"),E=s.hasOwnProperty("y"),A=me,L=pe,M=window;if(p){var T=pt(n),B="clientHeight",I="clientWidth";if(T===ue(n)&&(T=Me(n),qe(T).position!=="static"&&a==="absolute"&&(B="scrollHeight",I="scrollWidth")),T=T,r===pe||(r===me||r===he)&&o===gn){L=we;var P=m&&T===M&&M.visualViewport?M.visualViewport.height:T[B];g-=P-i.height,g*=l?1:-1}if(r===me||(r===pe||r===we)&&o===gn){A=he;var K=m&&T===M&&M.visualViewport?M.visualViewport.width:T[I];f-=K-i.width,f*=l?1:-1}}var z=Object.assign({position:a},p&&wg),V=u===!0?xg({x:f,y:g}):{x:f,y:g};if(f=V.x,g=V.y,l){var F;return Object.assign({},z,(F={},F[L]=E?"0":"",F[A]=y?"0":"",F.transform=(M.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",F))}return Object.assign({},z,(t={},t[L]=E?g+"px":"",t[A]=y?f+"px":"",t.transform="",t))}function vg(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=i===void 0?!0:i,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a;if(!1)var p;var u={placement:Ee(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Uu(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Uu(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Gu={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vg,data:{}};var $o={passive:!0};function kg(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=ue(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&p.forEach(function(u){u.addEventListener("scroll",n.update,$o)}),a&&l.addEventListener("resize",n.update,$o),function(){o&&p.forEach(function(u){u.removeEventListener("scroll",n.update,$o)}),a&&l.removeEventListener("resize",n.update,$o)}}var Zu={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kg,data:{}};var Sg={left:"right",right:"left",bottom:"top",top:"bottom"};function Vn(e){return e.replace(/left|right|bottom|top/g,function(t){return Sg[t]})}var Tg={start:"end",end:"start"};function Po(e){return e.replace(/start|end/g,function(t){return Tg[t]})}function vn(e){var t=ue(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function kn(e){return nt(Me(e)).left+vn(e).scrollLeft}function ha(e,t){var n=ue(e),i=Me(e),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var p=hr();(p||!p&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+kn(e),y:l}}function ga(e){var t,n=Me(e),i=vn(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=ut(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=ut(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+kn(e),l=-i.scrollTop;return qe(r||n).direction==="rtl"&&(a+=ut(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Sn(e){var t=qe(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function No(e){return["html","body","#document"].indexOf(Ce(e))>=0?e.ownerDocument.body:xe(e)&&Sn(e)?e:No(_t(e))}function Yt(e,t){var n;t===void 0&&(t=[]);var i=No(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),o=ue(i),s=r?[o].concat(o.visualViewport||[],Sn(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(Yt(_t(s)))}function jn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Og(e,t){var n=nt(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Qu(e,t,n){return t===Ro?jn(ha(e,n)):tt(t)?Og(t,n):jn(ga(Me(e)))}function Ag(e){var t=Yt(_t(e)),n=["absolute","fixed"].indexOf(qe(e).position)>=0,i=n&&xe(e)?pt(e):e;return tt(i)?t.filter(function(r){return tt(r)&&gr(r,i)&&Ce(r)!=="body"}):[]}function ya(e,t,n,i){var r=t==="clippingParents"?Ag(e):[].concat(t),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,p){var u=Qu(e,p,i);return l.top=ut(u.top,l.top),l.right=yn(u.right,l.right),l.bottom=yn(u.bottom,l.bottom),l.left=ut(u.left,l.left),l},Qu(e,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xr(e){var t=e.reference,n=e.element,i=e.placement,r=i?Ee(i):null,o=i?it(i):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(r){case pe:l={x:s,y:t.y-n.height};break;case we:l={x:s,y:t.y+t.height};break;case he:l={x:t.x+t.width,y:a};break;case me:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var p=r?wn(r):null;if(p!=null){var u=p==="y"?"height":"width";switch(o){case Et:l[p]=l[p]-(t[u]/2-n[u]/2);break;case gn:l[p]=l[p]+(t[u]/2-n[u]/2);break;default:}}return l}function ct(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=i===void 0?e.placement:i,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?zu:a,p=n.rootBoundary,u=p===void 0?Ro:p,m=n.elementContext,c=m===void 0?Yn:m,f=n.altBoundary,h=f===void 0?!1:f,g=n.padding,w=g===void 0?0:g,y=br(typeof w!="number"?w:wr(w,zt)),E=c===Yn?Yu:Yn,A=e.rects.popper,L=e.elements[h?E:c],M=ya(tt(L)?L:L.contextElement||Me(e.elements.popper),l,u,s),T=nt(e.elements.reference),B=xr({reference:T,element:A,strategy:"absolute",placement:r}),I=jn(Object.assign({},A,B)),P=c===Yn?I:T,K={top:M.top-P.top+y.top,bottom:P.bottom-M.bottom+y.bottom,left:M.left-P.left+y.left,right:P.right-M.right+y.right},z=e.modifiersData.offset;if(c===Yn&&z){var V=z[r];Object.keys(K).forEach(function(F){var j=[he,we].indexOf(F)>=0?1:-1,J=[pe,we].indexOf(F)>=0?"y":"x";K[F]+=V[J]*j})}return K}function ba(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,p=l===void 0?Do:l,u=it(i),m=u?a?da:da.filter(function(h){return it(h)===u}):zt,c=m.filter(function(h){return p.indexOf(h)>=0});c.length===0&&(c=m);var f=c.reduce(function(h,g){return h[g]=ct(e,{placement:g,boundary:r,rootBoundary:o,padding:s})[Ee(g)],h},{});return Object.keys(f).sort(function(h,g){return f[h]-f[g]})}function Cg(e){if(Ee(e)===Fo)return[];var t=Vn(e);return[Po(e),t,Po(t)]}function Eg(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,p=n.padding,u=n.boundary,m=n.rootBoundary,c=n.altBoundary,f=n.flipVariations,h=f===void 0?!0:f,g=n.allowedAutoPlacements,w=t.options.placement,y=Ee(w),E=y===w,A=l||(E||!h?[Vn(w)]:Cg(w)),L=[w].concat(A).reduce(function(Ke,Pe){return Ke.concat(Ee(Pe)===Fo?ba(t,{placement:Pe,boundary:u,rootBoundary:m,padding:p,flipVariations:h,allowedAutoPlacements:g}):Pe)},[]),M=t.rects.reference,T=t.rects.popper,B=new Map,I=!0,P=L[0],K=0;K<L.length;K++){var z=L[K],V=Ee(z),F=it(z)===Et,j=[pe,we].indexOf(V)>=0,J=j?"width":"height",Z=ct(t,{placement:z,boundary:u,rootBoundary:m,altBoundary:c,padding:p}),se=j?F?he:me:F?we:pe;M[J]>T[J]&&(se=Vn(se));var ae=Vn(se),le=[];if(o&&le.push(Z[V]<=0),a&&le.push(Z[se]<=0,Z[ae]<=0),le.every(function(Ke){return Ke})){P=z,I=!1;break}B.set(z,le)}if(I)for(var ne=h?3:1,v=function(Pe){var rt=L.find(function(Ve){var ee=B.get(Ve);if(ee)return ee.slice(0,Pe).every(function(wt){return wt})});if(rt)return P=rt,"break"},b=ne;b>0;b--){var mt=v(b);if(mt==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}var Xu={name:"flip",enabled:!0,phase:"main",fn:Eg,requiresIfExists:["offset"],data:{_skip:!1}};function Ju(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ep(e){return[pe,he,we,me].some(function(t){return e[t]>=0})}function Lg(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=ct(t,{elementContext:"reference"}),a=ct(t,{altBoundary:!0}),l=Ju(s,i),p=Ju(a,r,o),u=ep(l),m=ep(p);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:p,isReferenceHidden:u,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m})}var tp={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Lg};function _g(e,t,n){var i=Ee(e),r=[me,pe].indexOf(i)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[me,he].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Bg(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=r===void 0?[0,0]:r,s=Do.reduce(function(u,m){return u[m]=_g(m,t.rects,o),u},{}),a=s[t.placement],l=a.x,p=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=p),t.modifiersData[i]=s}var np={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bg};function Ig(e){var t=e.state,n=e.name;t.modifiersData[n]=xr({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var ip={name:"popperOffsets",enabled:!0,phase:"read",fn:Ig,data:{}};function wa(e){return e==="x"?"y":"x"}function Mg(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,p=n.rootBoundary,u=n.altBoundary,m=n.padding,c=n.tether,f=c===void 0?!0:c,h=n.tetherOffset,g=h===void 0?0:h,w=ct(t,{boundary:l,rootBoundary:p,padding:m,altBoundary:u}),y=Ee(t.placement),E=it(t.placement),A=!E,L=wn(y),M=wa(L),T=t.modifiersData.popperOffsets,B=t.rects.reference,I=t.rects.popper,P=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,K=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(!!T){if(o){var F,j=L==="y"?pe:me,J=L==="y"?we:he,Z=L==="y"?"height":"width",se=T[L],ae=se+w[j],le=se-w[J],ne=f?-I[Z]/2:0,v=E===Et?B[Z]:I[Z],b=E===Et?-I[Z]:-B[Z],mt=t.elements.arrow,Ke=f&&mt?bn(mt):{width:0,height:0},Pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:yr(),rt=Pe[j],Ve=Pe[J],ee=xn(0,B[Z],Ke[Z]),wt=A?B[Z]/2-ne-ee-rt-K.mainAxis:v-ee-rt-K.mainAxis,ot=A?-B[Z]/2+ne+ee+Ve+K.mainAxis:b+ee+Ve+K.mainAxis,dt=t.elements.arrow&&pt(t.elements.arrow),Bt=dt?L==="y"?dt.clientTop||0:dt.clientLeft||0:0,qt=(F=z?.[L])!=null?F:0,jo=se+wt-qt-Bt,Wo=se+ot-qt,kr=xn(f?yn(ae,jo):ae,se,f?ut(le,Wo):le);T[L]=kr,V[L]=kr-se}if(a){var Un,Sr=L==="x"?pe:me,Tr=L==="x"?we:he,xt=T[M],Kt=M==="y"?"height":"width",Gn=xt+w[Sr],Or=xt-w[Tr],Zn=[pe,me].indexOf(y)!==-1,Ar=(Un=z?.[M])!=null?Un:0,Cr=Zn?Gn:xt-B[Kt]-I[Kt]-Ar+K.altAxis,Er=Zn?xt+B[Kt]+I[Kt]-Ar-K.altAxis:Or,C=f&&Zn?ju(Cr,xt,Er):xn(f?Cr:Gn,xt,f?Er:Or);T[M]=C,V[M]=C-xt}t.modifiersData[i]=V}}var rp={name:"preventOverflow",enabled:!0,phase:"main",fn:Mg,requiresIfExists:["offset"]};function xa(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function va(e){return e===ue(e)||!xe(e)?vn(e):xa(e)}function Fg(e){var t=e.getBoundingClientRect(),n=Lt(t.width)/e.offsetWidth||1,i=Lt(t.height)/e.offsetHeight||1;return n!==1||i!==1}function ka(e,t,n){n===void 0&&(n=!1);var i=xe(t),r=xe(t)&&Fg(t),o=Me(t),s=nt(e,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((Ce(t)!=="body"||Sn(o))&&(a=va(t)),xe(t)?(l=nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=kn(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Rg(e){var t=new Map,n=new Set,i=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&r(l)}}),i.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),i}function Sa(e){var t=Rg(e);return qu.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function Ta(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Oa(e){var t=e.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var op={placement:"bottom",modifiers:[],strategy:"absolute"};function sp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function ap(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,i=n===void 0?[]:n,r=t.defaultOptions,o=r===void 0?op:r;return function(a,l,p){p===void 0&&(p=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},op,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},m=[],c=!1,f={state:u,setOptions:function(y){var E=typeof y=="function"?y(u.options):y;g(),u.options=Object.assign({},o,u.options,E),u.scrollParents={reference:tt(a)?Yt(a):a.contextElement?Yt(a.contextElement):[],popper:Yt(l)};var A=Sa(Oa([].concat(i,u.options.modifiers)));if(u.orderedModifiers=A.filter(function(z){return z.enabled}),!1){var L;if(getBasePlacement(u.options.placement)===auto)var M;var T,B,I,P,K}return h(),f.update()},forceUpdate:function(){if(!c){var y=u.elements,E=y.reference,A=y.popper;if(!!sp(E,A)){u.rects={reference:ka(E,pt(A),u.options.strategy==="fixed"),popper:bn(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(z){return u.modifiersData[z.name]=Object.assign({},z.data)});for(var L=0,M=0;M<u.orderedModifiers.length;M++){if(u.reset===!0){u.reset=!1,M=-1;continue}var T=u.orderedModifiers[M],B=T.fn,I=T.options,P=I===void 0?{}:I,K=T.name;typeof B=="function"&&(u=B({state:u,options:P,name:K,instance:f})||u)}}}},update:Ta(function(){return new Promise(function(w){f.forceUpdate(),w(u)})}),destroy:function(){g(),c=!0}};if(!sp(a,l))return f;f.setOptions(p).then(function(w){!c&&p.onFirstUpdate&&p.onFirstUpdate(w)});function h(){u.orderedModifiers.forEach(function(w){var y=w.name,E=w.options,A=E===void 0?{}:E,L=w.effect;if(typeof L=="function"){var M=L({state:u,name:y,instance:f,options:A}),T=function(){};m.push(M||T)}})}function g(){m.forEach(function(w){return w()}),m=[]}return f}}var Dg=[Zu,ip,Gu,Ku,np,Xu,rp,Wu,tp],Aa=ap({defaultModifiers:Dg});var $g=(e,t)=>(e%t+t)%t,Ca=class{constructor(t,n,i){this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),i.register([],"ArrowUp",r=>{if(!r.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),i.register([],"ArrowDown",r=>{if(!r.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),i.register([],"Enter",r=>{if(!r.isComposing)return this.useSelectedItem(r),!1})}onSuggestionClick(t,n){t.preventDefault();let i=this.suggestions.indexOf(n);this.setSelectedItem(i,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){let i=this.suggestions.indexOf(n);this.setSelectedItem(i,!1)}setSuggestions(t){this.containerEl.empty();let n=[];t.forEach(i=>{let r=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(i,r),n.push(r)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){let n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){let i=$g(t,this.suggestions.length),r=this.suggestions[this.selectedItem],o=this.suggestions[i];r?.removeClass("is-selected"),o?.addClass("is-selected"),this.selectedItem=i,n&&o.scrollIntoView(!1)}},Ho=class{constructor(t,n){this.app=t,this.inputEl=n,this.scope=new lp.Scope,this.suggestEl=createDiv("suggestion-container");let i=this.suggestEl.createDiv("suggestion");this.suggest=new Ca(this,i,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",r=>{r.preventDefault()})}onInputChanged(){let t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(this.app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){this.app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=Aa(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:i,instance:r})=>{let o=`${i.rects.reference.width}px`;i.styles.popper.width!==o&&(i.styles.popper.width=o,r.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){this.app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};var vr=class extends Ho{constructor(n,i,r=[]){super(n,i);this.app=n;this.inputEl=i;this.valuesToExclude=r}getSuggestions(n){let i=this.app.commands.listCommands();if(!i)return[];let r=i.filter(a=>{for(let l of this.valuesToExclude)if(l.id==a.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==a.id))return!1;return!0}),o=[],s=n.toLowerCase();return r.forEach(a=>{(a.id.contains(s)||a.name.toLowerCase().contains(s))&&o.push(a)}),o}renderSuggestion(n,i){i.setText(n.name)}selectSuggestion(n){this.inputEl.value=n.name,this.inputEl.setAttribute("commandId",n.id),this.inputEl.trigger("input"),this.close()}};var zo=class extends zn{constructor(n,i,r,o,s){super(n,"Custom Commands","Custom commands are Obsidian commands that get run after the linter is finished running its regular rules. This means that they do not run before the YAML timestamp logic runs, so they can cause YAML timestamp to be triggered on the next run of the linter. You may only select an Obsidian command once. **_Note that this currently only works on linting the current file._**","When selecting an option, make sure to select the option either by using the mouse or by hitting the enter key. Other selection methods may not work and only selections of an actual Obsidian command or an empty string will be saved.","Add new command",r,o,s,()=>{let a={id:"",name:""};this.lintCommands.push(a),this.saveSettings(),this.addCommand(a,this.lintCommands.length-1,!0)});this.lintCommands=i;this.display()}showInputEls(){this.lintCommands.forEach((n,i)=>{this.addCommand(n,i)})}addCommand(n,i,r=!1){new up.Setting(this.inputElDiv).addSearch(o=>{new vr(this.app,o.inputEl,this.lintCommands),o.setPlaceholder("Obsidian command").setValue(n.name).onChange(s=>{let a={id:o.inputEl.getAttribute("commandId"),name:s};a.name&&a.id?(this.lintCommands[i]=a,this.saveSettings()):!a.name&&!a.id&&(this.lintCommands[i]=a,this.saveSettings())}),o.inputEl.setAttr("tabIndex",i),o.inputEl.addClass("linter-custom-command"),r&&o.inputEl.focus()}).addExtraButton(o=>{o.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{this.arrayMove(i,i-1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(o=>{o.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{this.arrayMove(i,i+1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.lintCommands.splice(i,1),this.saveSettings(),this.resetInputEls()})})}arrayMove(n,i){if(i<0||i===this.lintCommands.length)return;let r=this.lintCommands[n];this.lintCommands[n]=this.lintCommands[i],this.lintCommands[i]=r}};var pp=require("obsidian");var Pg="gm",Yo=class extends zn{constructor(n,i,r,o,s){super(n,"Custom Regex Replacement","Custom regex replacement can be used to replace anything that matches the find regex with the replacement value. The replace and find values will need to be valid regex values.","Use this with caution if you do not know regex. Also, please make sure that you do not use lookbehinds in your regex on iOS mobile as that will cause linting to fail since that is not supported on that platform.","Add new regex replacement",r,o,s,()=>{let a={find:"",replace:"",flags:Pg};this.regexes.push(a),this.saveSettings(),this.addRegex(a,this.regexes.length-1,!0)});this.regexes=i;this.display()}showInputEls(){this.regexes.forEach((n,i)=>{this.addRegex(n,i)})}addRegex(n,i,r=!1){new pp.Setting(this.inputElDiv).addText(o=>{o.setPlaceholder("regex to find").setValue(n.find).onChange(s=>{this.regexes[i].find=s,this.saveSettings()}),o.inputEl.setAttr("inputIndex",i),o.inputEl.addClass("linter-custom-regex-replacement"),r&&o.inputEl.focus()}).addText(o=>{o.setPlaceholder("flags").setValue(n.flags).onChange(s=>{this.regexes[i].flags=s,this.saveSettings()})}).addText(o=>{o.setPlaceholder("regex to replace").setValue(n.replace).onChange(s=>{this.regexes[i].replace=s,this.saveSettings()})}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.regexes.splice(i,1),this.saveSettings(),this.resetInputEls()})})}};var Ng={General:Ie.general.id,Custom:Ie.custom.id,YAML:Ie.yaml.id,Heading:Ie.heading.id,Footnote:Ie.footer.id,Content:Ie.content.id,Spacing:Ie.whitespace.id,Paste:Ie.paste.id},qo=class extends de.PluginSettingTab{constructor(n,i){super(n,i);this.tabContent=new Map;this.selectedTab="General";this.searchSettingInfo=new Map;this.plugin=i}display(){let{containerEl:n}=this;n.empty(),this.generateSettingsTitle(n,de.Platform.isMobile);let r=n.createEl("nav",{cls:"linter-setting-header"}).createDiv("linter-setting-tab-group"),o=n.createDiv("linter-setting-content");this.createTabAndContent("General",r,o,(l,p)=>this.generateGeneralSettings(p,l));let s="",a="";for(let l of yt)l.type!==s&&(a=l.type,this.createTabAndContent(a,r,o),s=l.type),this.addRuleToTab(a,l);this.createTabAndContent("Custom",r,o,(l,p)=>this.generateCustomSettings(p,l)),this.createSearchZeroState(o)}createTabAndContent(n,i,r,o){let s=this.selectedTab===n,a=i.createDiv("linter-navigation-item"),l="linter-desktop";de.Platform.isMobile&&(l="linter-mobile"),a.addClass(l),(0,de.setIcon)(a.createSpan({cls:"linter-navigation-item-icon"}),Ng[n],20),a.createSpan().setText(n),a.onclick=()=>{if(this.selectedTab==n)return;a.addClass("linter-navigation-item-selected");let m=this.tabContent.get(n);if(this.unhideEl(m.content),this.selectedTab!=""){let c=this.tabContent.get(this.selectedTab);c.navButton.removeClass("linter-navigation-item-selected"),this.hideEl(c.content)}else{this.hideEl(this.searchZeroState);for(let c of this.searchSettingInfo)for(let f of c[1])this.unhideEl(f.containerEl);for(let c of this.tabContent){let f=c[1];this.hideEl(f.heading),n!==c[0]&&this.hideEl(f.content)}}this.selectedTab=n};let p=r.createDiv("linter-tab-settings"),u=p.createEl("h2",{text:n+" Settings"});this.hideEl(u),p.id=n.toLowerCase().replace(" ","-"),s?a.addClass("linter-navigation-item-selected"):this.hideEl(p),o&&o(p,n),this.tabContent.set(n,{content:p,heading:u,navButton:a})}addRuleToTab(n,i){let r=this.tabContent.get(n).content;if(r==null)return;let o=r.createDiv();o.id=i.alias(),o.createEl(de.Platform.isMobile?"h4":"h3",{},a=>{a.innerHTML=`<a href="${i.getURL()}">${i.name}</a>`});let s=[];for(let a of i.options)a.display(o,this.plugin.settings,this.plugin),s.push(a.searchInfo);this.addSettingToMasterSettingsList(n,o,i.name.toLowerCase(),i.description.toLowerCase(),s,o.id)}generateCustomSettings(n,i){let r=i.createDiv(),o=new zo(r,this.plugin.settings.lintCommands,de.Platform.isMobile,this.app,()=>{this.plugin.saveSettings()});this.addSettingToMasterSettingsList(n,r,o.name,o.description.replaceAll(`
|
||
`," ")+o.warning.replaceAll(`
|
||
`," "));let s=i.createDiv(),a=new Yo(s,this.plugin.settings.customRegexes,de.Platform.isMobile,this.app,()=>{this.plugin.saveSettings()});this.addSettingToMasterSettingsList(n,s,a.name,a.description.replaceAll(`
|
||
`," ")+a.warning.replaceAll(`
|
||
`," "))}generateGeneralSettings(n,i){let r=i.createDiv(),o="Lint on save",s="Lint the file on manual save (when `Ctrl + S` is pressed or when `:w` is executed while using vim keybindings)",a=new de.Setting(r).setName(o).addToggle(c=>{c.setValue(this.plugin.settings.lintOnSave).onChange(async f=>{this.plugin.settings.lintOnSave=f,await this.plugin.saveSettings()})});He(s,a.descEl),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Display message on lint",s="Display the number of characters changed after linting",new de.Setting(r).setName(o).setDesc(s).addToggle(c=>{c.setValue(this.plugin.settings.displayChanged).onChange(async f=>{this.plugin.settings.displayChanged=f,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Folders to ignore",s="Folders to ignore when linting all files or linting on save. Enter folder paths separated by newlines",new de.Setting(r).setName(o).setDesc(s).addTextArea(c=>{c.setValue(this.plugin.settings.foldersToIgnore.join(`
|
||
`)).onChange(async f=>{this.plugin.settings.foldersToIgnore=f.split(`
|
||
`),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let l=navigator.language?.toLowerCase();r=i.createDiv(),o="Override locale",s="Set this if you want to use a locale different from the default",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{c.addOption("system-default",`Same as system (${l})`),cp.moment.locales().forEach(f=>{c.addOption(f,f)}),c.setValue(this.plugin.settings.linterLocale),c.onChange(async f=>{this.plugin.settings.linterLocale=f,await this.plugin.setOrUpdateMomentInstance(),await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let p=["multi-line","single-line","single string comma delimited","single string to single-line","single string to multi-line"];r=i.createDiv(),o="YAML aliases section style",s="The style of the YAML aliases section",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{p.forEach(f=>{c.addOption(f,f)}),c.setValue(this.plugin.settings.commonStyles.aliasArrayStyle),c.onChange(async f=>{this.plugin.settings.commonStyles.aliasArrayStyle=f,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let u=["multi-line","single-line","single string to single-line","single string to multi-line","single-line space delimited","single string space delimited","single string comma delimited"];r=i.createDiv(),o="YAML tags section style",s="The style of the YAML tags section",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{u.forEach(f=>{c.addOption(f,f)}),c.setValue(this.plugin.settings.commonStyles.tagArrayStyle),c.onChange(async f=>{this.plugin.settings.commonStyles.tagArrayStyle=f,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s);let m=['"',"'"];r=i.createDiv(),o="Default Escape Character",s="The default character to use to escape YAML values when a single quote and double quote are not present.",new de.Setting(r).setName(o).setDesc(s).addDropdown(c=>{m.forEach(f=>{c.addOption(f,f)}),c.setValue(this.plugin.settings.commonStyles.escapeCharacter),c.onChange(async f=>{this.plugin.settings.commonStyles.escapeCharacter=f,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s),r=i.createDiv(),o="Number of Dollar Signs to Indicate Math Block",s="The amount of dollar signs to consider the math content to be a math block instead of inline math",new de.Setting(r).setName(o).setDesc(s).addText(c=>{c.setValue(this.plugin.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock.toString()).onChange(async f=>{let h=parseInt(f);isNaN(h)&&(h=2),this.plugin.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock=h,await this.plugin.saveSettings()})}),this.addSettingToMasterSettingsList(n,r,o,s)}generateSearchBar(n){let i=new de.Setting(n);i.settingEl.style.border="none",i.addSearch(r=>{this.search=r}),this.search.setPlaceholder("Search all settings"),this.search.inputEl.onfocus=()=>{for(let r of this.tabContent){let o=r[1];o.navButton.removeClass("linter-navigation-item-selected"),this.unhideEl(o.content),this.unhideEl(o.heading);let s=this.search.getValue();this.selectedTab==""&&s.trim()!=""&&this.searchSettings(s.toLowerCase()),this.selectedTab=""}},this.search.onChange(r=>{this.searchSettings(r.toLowerCase())})}generateSettingsTitle(n,i){let r=n.createDiv("linter-setting-title");i?r.addClass("linter-mobile"):r.createEl("h1").setText("Linter"),this.generateSearchBar(r)}searchSettings(n){let i=new Set,r=this,o=function(s,a){r.unhideEl(s),i.has(a)||i.add(a)};for(let s of this.searchSettingInfo){let a=s[0],l=s[1];for(let p of l)if(n.trim()===""||p.alias?.includes(n)||p.description.includes(n)||p.name.includes(n))o(p.containerEl,a);else if(p.options)for(let u of p.options){if(u.description.toLowerCase().includes(n)||u.name.toLowerCase().includes(n)){o(p.containerEl,a);break}else if(u.options){for(let m of u.options)if(m.description.toLowerCase().includes(n)||m.value.toLowerCase().includes(n)){o(p.containerEl,a);break}}this.hideEl(p.containerEl)}else this.hideEl(p.containerEl)}for(let s of this.tabContent)i.has(s[0])?this.unhideEl(s[1].heading):this.hideEl(s[1].heading);i.size===0?this.unhideEl(this.searchZeroState):this.hideEl(this.searchZeroState)}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.hideEl(this.searchZeroState),this.searchZeroState.createEl(de.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}addSettingToMasterSettingsList(n,i,r="",o="",s=null,a=null){let l={containerEl:i,name:r.toLowerCase(),description:o.toLowerCase(),options:s,alias:a};this.searchSettingInfo.has(n)?this.searchSettingInfo.get(n).push(l):this.searchSettingInfo.set(n,[l])}hideEl(n){n.addClass("linter-visually-hidden")}unhideEl(n){n.removeClass("linter-visually-hidden")}};var Hg={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"},zg={ruleConfigs:{},lintOnSave:!1,displayChanged:!0,foldersToIgnore:[],linterLocale:"system-default",logLevel:mp.default.levels.ERROR,lintCommands:[],customRegexes:[],commonStyles:{aliasArrayStyle:"single-line",tagArrayStyle:"single-line",minimumNumberOfDollarSignsToBeAMathBlock:2,escapeCharacter:'"'}},Vo=class extends oe.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new Io}async onload(){mi("Loading plugin"),this.isEnabled=!0;for(let n in Ie){let i=Ie[n];(0,oe.addIcon)(i.id,i.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.addSettingTab(new qo(this.app,this))}async onunload(){mi("Unloading plugin"),this.isEnabled=!1;for(let n of this.eventRefs)this.app.workspace.offref(n)}async loadSettings(){let n=await this.loadData();this.settings=Object.assign({},zg,n),Dl(this.settings.logLevel),this.setOrUpdateMomentInstance();let i=this.settings.ruleConfigs["Move Tags to Yaml"];if(i){let s=i["Force Yaml Escape on Keys"];s&&(this.settings.ruleConfigs["Force YAML Escape"]||(this.settings.ruleConfigs["Force YAML Escape"]={}),this.settings.ruleConfigs["Force YAML Escape"]["Force YAML Escape on Keys"]=s??this.settings.ruleConfigs["Force YAML Escape"]["Force YAML Escape on Keys"]),delete this.settings.ruleConfigs["Escape YAML Special Characters"]["Force Yaml Escape on Keys"]}let r=this.settings.ruleConfigs["Move Tags to Yaml"];if(r){let s=r["Remove the hashtag from tags in content body"];s!=null&&(this.settings.ruleConfigs["Move Tags to Yaml"]["Body tag operation"]=s?"Remove hashtag":"Nothing",delete this.settings.ruleConfigs["Move Tags to Yaml"]["Remove the hashtag from tags in content body"])}let o=this.settings.ruleConfigs["Space between Chinese and English or numbers"];if(o){let s=o["Ensures that Chinese and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)"];this.settings.ruleConfigs["Space between Chinese Japanese or Korean and English or numbers"]={"Ensures that Chinese, Japanese, or Korean and English or numbers are separated by a single space. Follows these [guidelines](https://github.com/sparanoid/chinese-copywriting-guidelines)":s},delete this.settings.ruleConfigs["Space between Chinese and English or numbers"]}this.moveSettingsToCommonSettings();for(let s of yt)this.settings.ruleConfigs[s.name]||(this.settings.ruleConfigs[s.name]=s.getDefaultOptions())}async saveSettings(){await this.saveData(this.settings)}addCommands(){this.addCommand({id:"lint-file",name:"Lint the current file",editorCallback:n=>this.runLinterEditor(n),icon:Ie.file.id,hotkeys:[{modifiers:["Mod","Alt"],key:"L"}]}),this.addCommand({id:"lint-all-files",name:"Lint all files in the vault",icon:Ie.vault.id,callback:()=>{let n="This will edit all of your files and may introduce errors.",i="Lint All",r="Linting all files...";new fr(this.app,n,i,r,()=>this.runLinterAllFiles(this.app)).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:"Lint all files in the current folder",icon:Ie.folder.id,editorCheckCallback:(n,i)=>{if(n)return!this.app.workspace.getActiveFile().parent.isRoot();this.createFolderLintModal(this.app.workspace.getActiveFile().parent)}}),this.addCommand({id:"paste-as-plain-text",name:"Paste as Plain Text & without Modifications",editorCallback:n=>this.pasteAsPlainText(n)})}registerEventsAndSaveCallback(){let n=this.app.workspace.on("editor-paste",s=>{s.defaultPrevented||this.modifyPasteEvent(s)});this.registerEvent(n),this.eventRefs.push(n),n=this.app.workspace.on("file-menu",(s,a,l)=>this.onMenuOpenCallback(s,a,l)),this.registerEvent(n),this.eventRefs.push(n);let i=this.app.commands?.commands?.["editor:save-file"];typeof i?.callback=="function"&&(i.callback=()=>{if(this.settings.lintOnSave&&this.isEnabled){let s=this.getEditor();if(!s)return;let a=this.app.workspace.getActiveFile();this.shouldIgnoreFile(a)||this.runLinterEditor(s)}});let o=this;window.CodeMirrorAdapter.commands.save=()=>{o.app.commands.executeCommandById("editor:save-file")}}onMenuOpenCallback(n,i,r){i instanceof oe.TFile&&i.extension==="md"?n.addItem(o=>{o.setIcon(Ie.file.id).setTitle("Lint file").onClick(async()=>{this.runLinterFile(i)})}):i instanceof oe.TFolder&&n.addItem(o=>{o.setTitle("Lint folder").setIcon(Ie.folder.id).onClick(()=>this.createFolderLintModal(i))})}shouldIgnoreFile(n){for(let i of this.settings.foldersToIgnore)if(i.length>0&&n.path.startsWith(i))return!0;return!1}async runLinterFile(n){let i=kl(await this.app.vault.read(n)),r=this.rulesRunner.lintText(dr(i,n,this.momentLocale,this.settings));await this.app.vault.modify(n,r)}async runLinterAllFiles(n){let i=0;await Promise.all(n.vault.getMarkdownFiles().map(async o=>{if(!this.shouldIgnoreFile(o))try{await this.runLinterFile(o)}catch(s){this.handleLintError(o,s,"Lint All Files Error in File '${file.path}'"),i+=1}}));let r=0;if(i===0)new oe.Notice("Linted all files",r);else{let o=i===1?"was 1 error":"were "+i+" errors";new oe.Notice("Linted all files and there "+o+".",r)}}async runLinterAllFilesInFolder(n){mi("Linting folder "+n.name);let i=0,r=0,o=(0,oe.normalizePath)(n.path)+"/";await Promise.all(this.app.vault.getMarkdownFiles().map(async a=>{if((0,oe.normalizePath)(a.path).startsWith(o)&&!this.shouldIgnoreFile(a)){try{await this.runLinterFile(a)}catch(l){this.handleLintError(a,l,"Lint All Files in Folder Error in File '${file.path}'"),i+=1}r++}}));let s=0;if(i===0)new oe.Notice("Linted all "+r+" files in "+n.name+".",s);else{let a=i===1?"was 1 error":"were "+i+" errors";new oe.Notice("Linted all "+r+" files in "+n.name+" and there "+a+".",s)}}createFolderLintModal(n){let i="This will edit all of your files in "+n.name+" including files in its subfolders which may introduce errors.",r="Lint All Files in "+n.name,o="Linting all files in "+n.name+"...";new fr(this.app,i,r,o,()=>this.runLinterAllFilesInFolder(n)).open()}runLinterEditor(n){mi("Running linter");let i=this.app.workspace.getActiveFile(),r=n.getValue(),o;try{o=this.rulesRunner.lintText(dr(r,i,this.momentLocale,this.settings))}catch(m){this.handleLintError(i,m,"Lint File Error in File '${file.path}'",!1);return}let a=new Wn.default.diff_match_patch().diff_main(r,o),l="";a.forEach(m=>{function c(g){let w=g.split(`
|
||
`);return{line:w.length-1,ch:w[w.length-1].length}}let[f,h]=m;if(f==Wn.default.DIFF_INSERT)n.replaceRange(h,c(l)),l+=h;else if(f==Wn.default.DIFF_DELETE){let g=c(l),w=l;w+=h;let y=c(w);n.replaceRange("",g,y)}else l+=h});let p=a.map(m=>m[0]==Wn.default.DIFF_INSERT?m[1].length:0).reduce((m,c)=>m+c,0),u=a.map(m=>m[0]==Wn.default.DIFF_DELETE?m[1].length:0).reduce((m,c)=>m+c,0);this.displayChangedMessage(p,u);try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(m){this.handleLintError(i,m,"Lint File Error in File '${file.path}'",!1)}}async setOrUpdateMomentInstance(){let n=localStorage.getItem("language")||"en",i=navigator.language?.toLowerCase(),r=Hg[n];this.settings.linterLocale!=="system-default"?r=this.settings.linterLocale:i.startsWith(n)&&(r=i),this.momentLocale=r;let o=Ko.moment.locale(),s=Ko.moment.locale(r);Tt(`Trying to switch Moment.js locale to ${r}, got ${s}`),Ko.moment.locale(o)}displayChangedMessage(n,i){if(this.settings.displayChanged){let r=d`
|
||
${n} characters added
|
||
${i} characters removed
|
||
`;new oe.Notice(r)}}handleLintError(n,i,r,o=!0){let s=r.replace("${file.path}",n.path);i instanceof Dt?o?new oe.Notice(`${s} ${i.message}.
|
||
See console for more details.`):new oe.Notice(`${i.message}.
|
||
See console for more details.`):new oe.Notice("An unknown error occurred during linting. See console for details"),Rl(s,i)}async modifyPasteEvent(n){let i=this.getEditor();if(!i)return;let r=n.clipboardData.getData("text/plain");if(!r)return;if(Pr.test(r.trim())){Xr("aborted paste lint as the clipboard content is a link and doing so will avoid conflicts with other plugins that modify pasting.");return}if(n.stopPropagation(),n.preventDefault(),!n.defaultPrevented)return;let o=this.app.vault.getConfig("autoConvertHtml"),s=n.clipboardData.getData("text/html"),a=s&&o?(0,oe.htmlToMarkdown)(s):r,l=i.listSelections();if(l.length===1){let p=l[0];a=this.rulesRunner.runPasteLint(this.getLineContent(i,p),dr(a,null,this.momentLocale,this.settings)),i.replaceSelection(a)}else this.handleMultiCursorPaste(i,l,a)}handleMultiCursorPaste(n,i,r){let o=this.convertContentIntoProperPasteContent(i,r),s=[];i.forEach((a,l)=>{r=this.rulesRunner.runPasteLint(this.getLineContent(n,a),dr(o[l],null,this.momentLocale,this.settings)),s.push({text:r,from:a.anchor,to:a.head})}),n.transaction({changes:s})}convertContentIntoProperPasteContent(n,i){let r=i.split(`
|
||
`),o=[];if(r.length%n.length!==0)for(let s=0;s<n.length;s++)o.push(i);else{let s=r.length/n.length,a="";for(let l=0;l<r.length;l++)a+=r[l],(l+1===n.length||(l+1)%s===0)&&(o.push(a),a="")}return o}async pasteAsPlainText(n){let i=await navigator.clipboard.readText();if(!i){new oe.Notice("There is no clipboard content.");return}n.replaceSelection(i)}getEditor(){let n=this.app.workspace.getActiveViewOfType(oe.MarkdownView);return n?n.editor:null}getLineContent(n,i){return n.getLine(i.anchor.line)}moveSettingsToCommonSettings(){let n,i=this.settings.ruleConfigs["YAML Title Alias"];if(i&&i["YAML aliases section style"]){if(i["Inserts the title of the file into the YAML frontmatter's aliases section. Gets the title from the first H1 or filename."])switch(i["YAML aliases section style"]){case"Multi-line array":n="multi-line";break;case"Single-line array":n="single-line";break;case"Single string that expands to multi-line array if needed":n="single string to multi-line";break;case"Single string that expands to single-line array if needed":n="single string to single-line";break}delete this.settings.ruleConfigs["YAML Title Alias"]["YAML aliases section style"]}let r=this.settings.ruleConfigs["Format Yaml Array"];if(r&&r["Yaml aliases section style"]){if(r["Allows for the formatting of regular yaml arrays as either multi-line or single-line and `tags` and `aliases` are allowed to have some Obsidian specific yaml formats. Note that single string to single-line goes from a single string entry to a single-line array if more than 1 entry is present. The same is true for single string to multi-line except it becomes a multi-line array."]&&r["Format yaml aliases section"]){let l=r["Yaml aliases section style"];if(!n)n=l;else switch(l){case"single-line":n="single-line";break;case"multi-line":n!="single-line"&&(n="single-line");break;case"single string comma delimited":n!="single-line"&&n!="multi-line"&&(n="single string comma delimited");break;case"single string to multi-line":n!="single-line"&&n!="multi-line"&&(n="single string to multi-line");break;case"single string to single-line":n!="single-line"&&n!="multi-line"&&(n="single string to single-line");break}}delete this.settings.ruleConfigs["Format Yaml Array"]["Yaml aliases section style"]}n&&(this.settings.commonStyles.aliasArrayStyle=n);let o;r&&r["Yaml tags section style"]&&(r["Allows for the formatting of regular yaml arrays as either multi-line or single-line and `tags` and `aliases` are allowed to have some Obsidian specific yaml formats. Note that single string to single-line goes from a single string entry to a single-line array if more than 1 entry is present. The same is true for single string to multi-line except it becomes a multi-line array."]&&r["Format yaml tags section"]&&(o=r["Yaml tags section style"]),delete this.settings.ruleConfigs["Format Yaml Array"]["Yaml tags section style"]);let s=this.settings.ruleConfigs["Move Tags to Yaml"];if(s&&s["Yaml tags section style"]){if(s["Move all tags to Yaml frontmatter of the document."]){let l=s["Yaml tags section style"];if(!o)o=l;else switch(l){case"single-line":o="single-line";break;case"multi-line":o!="single-line"&&(o="single-line");break;case"single string comma delimited":o!="single-line"&&o!="multi-line"&&(o="single string comma delimited");break;case"single string to multi-line":o!="single-line"&&o!="multi-line"&&(o="single string to multi-line");break;case"single string to single-line":o!="single-line"&&o!="multi-line"&&(o="single string to single-line");break;case"single-line space delimited":o!="single-line"&&o!="multi-line"&&o!="single string comma delimited"&&o!="single string to single-line"&&o!="single string to multi-line"&&(o="single-line space delimited");break;case"single string space delimited":o!="single-line"&&o!="multi-line"&&o!="single string comma delimited"&&o!="single string to single-line"&&o!="single string to multi-line"&&(o="single string space delimited");break}}delete this.settings.ruleConfigs["Move Tags to Yaml"]["Yaml tags section style"]}o&&(this.settings.commonStyles.tagArrayStyle=o);let a=this.settings.ruleConfigs["Escape YAML Special Characters"];a&&(this.settings.commonStyles.escapeCharacter=a["Default Escape Character"]??this.settings.commonStyles.escapeCharacter,delete this.settings.ruleConfigs["Escape YAML Special Characters"]["Default Escape Character"]),this.saveSettings()}};
|
||
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|