The private resolver grouped clients by IPv4 /24 and silently dropped requests above 20 queries per second. Disable the public-server protection so internal DNS bursts complete.
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.
git-subtree-dir: third_party/pi
git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
- When adding a graphical application, register its workspace icon in `registry.window-icon`.
The workspace indicator uses this mapping to show an application icon instead of the generic default glyph.
Match the mapping on the window class.
Store the icon as the rendered string.
Run `hyprctl clients -j | jq -r '.[].class' | sort -u` to list classes in the running session.
- TODO: Verify this path after the NixOS configuration is migrated.
Set Hyprland session environment variables in `modules/desktop/session/hyprland/default.nix` with `env = KEY,VALUE`.
`home.sessionVariables` do **not** reach the Hyprland session because UWSM does not source `hm-session-vars.sh`.
Source cursor values from `config.stylix.cursor`.
Set `XCURSOR_*` and `HYPRCURSOR_*` to the same theme for Bibata.
## Firefox
- Manage Firefox search engines through `programs.firefox.search` with `force = true`.
Hide built-in engines with `<engine>.metaData.hidden = true` because omission does not remove them.
Use current engine ids, such as `default = "ddg"` instead of `"DuckDuckGo"`.
Decode the built `search.json.mozlz4` with `mozlz4a -d <search.json.mozlz4>` to check the result.
- Avoid Home Manager Firefox extension settings unless the whole profile can use the legacy extension-storage backend.
Any non-empty `profiles.<name>.extensions.settings.<id>.settings` sets `extensions.webextensions.ExtensionStorageIDB.enabled = false` for the whole profile.
## Neovim
- Nixvim's flake input follows the root nixpkgs source, but its Home Manager module does not reuse the host's `pkgs` instance.
That setting makes Nixvim use the shared package set without warning that its source default changed.
## AI tooling
- Use produced literals for Herdr key names that include shifted punctuation.
For example, use `prefix+<` instead of `prefix+shift+comma`.
- Put monorepo Pi extension sources in `.pi/extensions/`.
Pi discovers them from subdirectories through the local ancestor-resource patch.
- Treat Home Manager-managed Pi settings as generated output.
Do not edit them except for throwaway development or local experiments.
Promote finished settings into the NixOS configuration before treating them as deployed.
## Gotchas
-`configs/nixos/registry/stable-uid.nix` receives library functions through `lib`.
Qualify its library calls with `lib.`.
- Guest modules are host-agnostic wiring, while host files own deployment-specific service configuration such as served volumes and host paths.
For example, `guests/copyparty.nix` should expose options and translate them into guest mounts/service settings, while `hosts/pikachu/default.nix` chooses `/inbox`, `/media`, and their backing paths.
Guest addresses and routes are host-level configuration because a guest module can be used on multiple hosts.
-`sops.secrets.<name>.owner` must name a user known on the decrypting host.
Do not set the owner to a guest-only service user unless the host also declares that user.
Use a host-visible owner plus a shared group mode when the guest service can read the decrypted secret file through its group.
- A read-only guest bind mount cannot contain nested writable bind mounts unless their mount-point
directories already exist inside the read-only source.
For aggregate Copyparty volumes such as `/srv` with nested `/srv/inbox`, keep the guest bind mount
writable and enforce read-only behavior through Copyparty access plus service `ReadWritePaths`.
-`deploy-to` builds from the source checkout, records the imported closure as the target system profile,
and activates it. Do not rely on a target-local monorepo checkout for remote deployment.
- On Pikachu, `nix copy --to ssh://pikachu` accepted a small `nix store add-file` probe,
but rejected locally built system paths that lacked trusted signatures.
Use a sudo `nix-store --import` path for unsigned deploy closures.
- Public DNS entries are not managed through the NixOS configuration.
Do not describe NixOS route choices as public-DNS management.
- Do not hand-author `hardware-configuration.nix` for a host that has not been generated on that machine.
Generate it on the target system or live ISO, then stage it before evaluating the flake.
- Configure the Chaotic Nyx cache only on hosts that select `linuxPackages_cachyos` (currently Neogaia
and Zeus), not in the generic host module.
- Module-relative paths resolve from the module file. Update them when moving a module into a subdirectory.
- On Pikachu, `uptime` does not support `-s`. Use `who -b` to report the boot time.
varXp=Object.create;varir=Object.defineProperty;varef=Object.getOwnPropertyDescriptor;varHv=Object.getOwnPropertyNames;var$v=Object.getPrototypeOf,Vv=Object.prototype.hasOwnProperty;vartf=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Dr=n=>{throwTypeError(n)};varnf=(n,t,e)=>tinn?ir(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;varZp=(n,t)=>ir(n,"name",{value:t,configurable:!0});varrr=(n,t)=>()=>{try{returnt||n((t={exports:{}}).exports,t),t.exports}catch(e){throwt=0,e}},ud=(n,t)=>{for(vareint)ir(n,e,{get:t[e],enumerable:!0})},rf=(n,t,e,i)=>{if(t&&typeoft=="object"||typeoft=="function")for(letrofHv(t))!Vv.call(n,r)&&r!==e&&ir(n,r,{get:()=>t[r],enumerable:!(i=ef(t,r))||i.enumerable});returnn};varSn=(n,t,e)=>(e=n!=null?Xp($v(n)):{},rf(t||!n||!n.__esModule?ir(e,"default",{value:n,enumerable:!0}):e,n)),Gv=n=>rf(ir({},"__esModule",{value:!0}),n);varI=n=>[,,,Xp(n?.[tf("metadata")]??null)],sf=["class","method","getter","setter","accessor","field","value","get","set"],ka=n=>n!==void0&&typeofn!="function"?Dr("Function expected"):n,Qv=(n,t,e,i,r)=>({kind:sf[n],name:t,metadata:i,addInitializer:s=>e._?Dr("Already initialized"):r.push(ka(s||null))}),oe=(n,t)=>nf(t,tf("metadata"),n[3]),L=(n,t,e,i)=>{for(varr=0,s=n[t>>1],a=s&&s.length;r<a;r++)t&1?s[r].call(e):i=s[r].call(e,i);returni},O=(n,t,e,i,r,s)=>{vara,o,l,c,u,d=t&7,m=!!(t&8),p=!!(t&16),h=d>3?n.length+1:d?m?1:2:0,f=sf[d+5],g=d>3&&(n[h-1]=[]),b=n[h]||(n[h]=[]),k=d&&(!p&&!m&&(r=r.prototype),d<5&&(d>3||!p)&&ef(d<4?r:{get[e](){returnv(this,s)},set[e](E){returnH(this,s,E)}},e));d?p&&d<4&&Zp(s,(d>2?"set ":d>1?"get ":"")+e):Zp(r,e);for(varx=i.length-1;x>=0;x--)c=Qv(d,e,l={},n[3],b),d&&(c.static=m,c.private=p,u=c.access={has:p?E=>Jv(r,E):E=>einE},d^3&&(u.get=p?E=>(d^1?v:_)(E,r,d^4?s:k.get):E=>E[e]),d>2&&(u.set=p?(E,C)=>H(E,r,C,d^4?s:k.set):(E,C)=>E[e]=C)),o=(0,i[x])(d?d<4?p?s:k[f]:d>4?void0:{get:k.get,set:k.set}:r,c),l._=1,d^4||o===void0?ka(o)&&(d>4?g.unshift(o):d?p?s=o:k[f]=o:r=o):typeofo!="object"||o===null?Dr("Object expected"):(ka(a=o.get)&&(k.get=a),ka(a=o.set)&&(k.set=a),ka(a=o.init)&&g.unshift(a));returnd||oe(n,r),k&&ir(r,e,k),p?d^4?s:k:r},Ie=(n,t,e)=>nf(n,typeoft!="symbol"?t+"":t,e),md=(n,t,e)=>t.has(n)||Dr("Cannot "+e),Jv=(n,t)=>Object(t)!==t?Dr('Cannot use the "in" operator on this value'):n.has(t),v=(n,t,e)=>(md(n,t,"read from private field"),e?e.call(n):t.get(n)),ee=(n,t,e)=>t.has(n)?Dr("Cannot add the same private member more than once"):tinstanceofWeakSet?t.add(n):t.set(n,e),H=(n,t,e,i)=>(md(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),_=(n,t,e)=>(md(n,t,"access private method"),e);varNo=(n,t,e,i)=>({set_(r){H(n,t,r,e)},get_(){returnv(n,t,i)}});varBo=rr((lf,Fo)=>{(function(n,t){"use strict";typeofdefine=="function"&&define.amd?define(t):typeofFo=="object"&&Fo.exports?Fo.exports=t():n.log=t()})(lf,function(){"use strict";varn=function(){},t="undefined",e=typeofwindow!==t&&typeofwindow.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},s=null;functiona(h,f){varg=h[f];if(typeofg.bind=="function")returng.bind(h);try{returnFunction.prototype.bind.call(g,h)}catch{returnfunction(){returnFunction.prototype.apply.apply(g,[h,arguments])}}}functiono(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}functionl(h){returnh==="debug"&&(h="log"),typeofconsole===t?!1:h==="trace"&&e?o:console[h]!==void0?a(console,h):console.log!==void0?a(console,"log"):n}functionc(){for(varh=this.getLevel(),f=0;f<i.length;f++){varg=i[f];this[g]=f<h?n:this.methodFactory(g,h,this.name)}if(this.log=this.debug,typeofconsole===t&&h<this.levels.SILENT)return"No console available for logging"}functionu(h){returnfunction(){typeofconsole!==t&&(c.call(this),this[h].apply(this,arguments))}}functiond(h,f,g){returnl(h)||u.apply(this,arguments)}functionm(h,f){varg=this,b,k,x,E="loglevel";typeofh=="string"?E+=":"+h:typeofh=="symbol"&&(E=void0);functionC(q){var$=(i[q]||"silent").toUpperCase();if(!(typeofwindow===t||!E)){try{window.localStorage[E]=$;return}catch{}try{window.document.cookie=encodeURIComponent(E)+"="+$+";"}catch{}}}functionM(){varq;if(!(typeofwindow===t||!E)){try{q=window.localStorage[E]}catch{}if(typeofq===t)try{var$=window.document.cookie,j=encodeURIComponent(E),U=$.indexOf(j+"=");U!==-1&&(q=/^([^;]+)/.exec($.slice(U+j.length+1))[1])}catch{}returng.levels[q]===void0&&(q=void0),q}}functionN(){if(!(typeofwindow===t||!E)){try{window.localStorage.removeItem(E)}catch{}try{window.document.cookie=encodeURIComponent(E)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}functionF(q){var$=q;if(typeof$=="string"&&g.levels[$.toUpperCase()]!==void0&&($=g.levels[$.toUpperCase()]),typeof$=="number"&&$>=0&&$<=g.levels.SILENT)return$;thrownewTypeError("log.setLevel() called with invalid level: "+q)}g.name=h,Line truncated
`+t.stack),ye.default.error(e),va&&Ko(e.substring(e.indexOf("]")+2),ye.default.levels.TRACE)}function qt(n){ye.default.info(`${Do}${n}`),va&&Ko(n,ye.default.levels.INFO)}function $e(n){ye.default.debug(`${Do}${n}`),va&&Ko(n,ye.default.levels.DEBUG)}function Wt(n){ye.default.warn(`${Do}${n}`),va&&Ko(n,ye.default.levels.WARN)}function sr(n){ye.default.getLevel()>ye.default.levels.DEBUG||cf.set(n,performance.now())}function ai(n){if(ye.default.getLevel()>ye.default.levels.DEBUG)return;let t=cf.get(n);if(!t){Wt(A("logs.timing-key-not-found").replace("{TIMING_KEY}",n));return}let e=performance.now()-t;$e(`${n}:${e}`+A("logs.milliseconds-abbreviation"))}function Ko(n,t){ye.default.getLevel()<=t&&Yo.push(n)}function fd(){Yo=[]}function Yr(n){va=n}function Po(n){if(Xv(n))switch(n){case"INFO":{ye.default.setLevel("info");break}case"TRACE":{ye.default.setLevel("trace");break}case"DEBUG":{ye.default.setLevel("debug");break}case"SILENT":{ye.default.setLevel("silent");break}case"ERROR":{ye.default.setLevel("error");break}case"WARN":{ye.default.setLevel("warn");break}}}function uf(n){switch(n){case ye.default.levels.INFO:return"INFO";case ye.default.levels.TRACE:return"TRACE";case ye.default.levels.DEBUG:return"DEBUG";case ye.default.levels.SILENT:return"SILENT";case ye.default.levels.ERROR:return"ERROR";case ye.default.levels.WARN:return"WARN"}return""}function Xv(n){return Object.values(df).includes(n)}var mf={};var pf={};var ff={};var hf={commands:{"lint-file":{name:"Linten Sie die aktuelle Datei","error-message":"Lint-Datei-Fehler in der Datei"},"lint-file-unless-ignored":{name:"Linten Sie die aktuelle Datei, es sei denn, sie wird ignoriert"},"lint-all-files":{name:"Linten Sie alle Dateien im Vault","error-message":"Beim Linten aller Dateien Fehler in der Datei","success-message":"Alle Dateien gelinted","errors-message-singular":"Beim Linten aller Dateien gab es einen Fehler.","errors-message-plural":"Beim Linten aller Dateien gab es {NUM} Fehler.","start-message":"Dadurch werden alle Ihre Dateien ver\xE4ndert und es k\xF6nnen Fehler entstehen.","submit-button-text":"Linte alle","submit-button-notice-text":"Linte alle Dateien..."},"lint-all-files-in-folder":{name:"Linte alle Dateien im aktuellen Ordner","start-message":"Dadurch werden alle Ihre Dateien in {FOLDER_NAME} bearbeitet, einschlie\xDFlich der Dateien in den Unterordnern, was zu Fehlern f\xFChren kann.","submit-button-text":"Linte alle Dateien in {FOLDER_NAME}","submit-button-notice-text":"Linten aller Dateien in {FOLDER_NAME}...","error-message":"Beim Linten aller Dateien im Ordner gab es Fehler in der Datei","success-message":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted.","message-singular":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted und es trat ein Fehler auf.","message-plural":"Alle {FILE_COUNT}-Dateien in {FOLDER_NAME} wurden gelinted und es gab {ERROR_COUNT} Fehler."},"paste-as-plain-text":{name:"Einf\xFCgen als reiner Text und ohne \xC4nderungen"},"lint-file-pop-up-menu-text":{name:"Linte Datei"},"lint-folder-pop-up-menu-text":{name:"Linte Ordner"}},logs:{"plugin-load":"Plugin wird geladen","plugin-unload":"Plugin entladen","folder-lint":"Linting-Ordner ","linter-run":"Laufender Linter","paste-link-warning":"Abgebrochenes Einf\xFCgen des Lints, da der Inhalt der Zwischenablage ein Link ist, wodurch Konflikte mit anderen Plugins vermieden werden, die das Einf\xFCgen \xE4ndern.","see-console":"Weitere Informationen finden Sie in der Konsole.","unknown-error":"Beim Linten ist ein unbekannter Fehler aufgetreten.","moment-locale-not-found":"Beim Versuch, Moment.js locale auf {MOMENT_LOCALE} umzustellen, wurde {CURRENT_LOCALE} angezeigt","file-change-lint-message-start":"Linted","pre-rules":"Regeln vor regul\xE4ren Regeln","post-rules":"Regeln nach regul\xE4ren Regeln","rule-running":"Laufende Regeln","custom-regex":"Benutzerdefinierte Regex-Regeln","running-custom-regex":"Ausf\xFChren von benutzerdefinierten Regex","running-custom-lint-command":"Ausf\xFChren von benutzerdefinierten Lint-Befehlen","custom-lint-duplicate-warning":'Sie k\xF6nnen denselben Befehl ("{COMMAND_NAME}") nicht zweimal als benutzerdefinierte Lint-Regel ausf\xFChren.',"custom-lint-error-message":"Benutzerdefinierter Lint-Befehl","disabled-text":"ist deaktiviert","run-rule-text":"L\xE4uft","timing-key-not-found":"Der Timing-Schl\xFCssel '{TIMING_KEY}' ist in der Timing-Info-Liste nicht vorhanden, daher wurde er ignoriert","milliseconds-abbreviation":"ms","invalid-date-format-error":"Das Format des Erstellungsdatums '{DATE}' konnte nicht analysiert oder bestimmt werden, sodass das Erstellungsdatum in '{FILE_NAME}","invalid-delimiter-error-message":"Trennzeichen darf nur ein einzelnes Zeichen sein","missing-footnote-error-message":"Die Fu\xDFnote '{FOOTNOTE}' hat keinen entsprechenden Fu\xDFnotenverweis vor dem Fu\xDFnoteninhalt und kann nicht verarbeitet werden. Bitte achten Sie darauf, dass alle Fu\xDFnoten vor dem Inhalt der Fu\xDFnote einen entsprechenden Verw
Line truncated
`){if(o!==e)break;o=0,i=r}else s===">"&&o++;r--}return a?i:t}function Hr(n){let t=fi(n),e=new Map,i,r,s;for(let a of t){i=n.substring(a.startIndex,a.endIndex),r=i.split(`
`),r.splice(0,2);for(let o of r){if(s=o.split("|"),s.length!==4){Wt(A("options.custom-auto-correct.custom-row-parse-warning").replace("{ROW}",o));continue}e.set(s[1].trim().toLowerCase(),s[2].trim())}}return e}function eh(n){return n.replace(/[\\[\]<>_*~=`$]/g,"\\$&")}functionth(n){returnn.replace(/(\\+)([!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~])/g,(t,e,i)=>{letr=e.length,s=Math.floor(r/2);return"\\".repeat(s)+i})}functionGe(n,t,e,i){letr=n.length,s=0,a;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,e=e>0?e:0,i.length<1e4)a=Array.from(i),a.unshift(t,e),n.splice(...a);elsefor(e&&n.splice(t,e);s<i.length;)a=i.slice(s,s+1e4),a.unshift(t,0),n.splice(...a),s+=1e4,t+=1e4}functionlt(n,t){returnn.length>0?(Ge(n,n.length,0,t),n):t}varvA=hi(/\p{P}/u),De=hi(/[A-Za-z]/),Ye=hi(/[\dA-Za-z]/),nh=hi(/[#-'*+\--9=?A-Z^-~]/);functionmr(n){returnn!==null&&(n<32||n===127)}varRa=hi(/\d/),ih=hi(/[\dA-Fa-f]/),Md=hi(/[!-/:-@[-`{-~]/);functionK(n){returnn!==null&&n<-2}functionme(n){returnn!==null&&(n<0||n===32)}functionQ(n){returnn===-2||n===-1||n===32}functionpr(n){returnMd(n)||vA(n)}varTn=hi(/\s/);functionhi(n){returnt;functiont(e){returne!==null&&e>-1&&n.test(String.fromCharCode(e))}}functionOd(n){if(n===null||me(n)||Tn(n))return1;if(pr(n))return2}function$r(n,t,e){leti=[],r=-1;for(;++r<n.length;){lets=n[r].resolveAll;s&&!i.includes(s)&&(t=s(t,e),i.push(s))}returnt}varNa={name:"attention",tokenize:wA,resolveAll:AA};functionAA(n,t){lete=-1,i,r,s,a,o,l,c,u;for(;++e<n.length;)if(n[e][0]==="enter"&&n[e][1].type==="attentionSequence"&&n[e][1]._close){for(i=e;i--;)if(n[i][0]==="exit"&&n[i][1].type==="attentionSequence"&&n[i][1]._open&&t.sliceSerialize(n[i][1]).charCodeAt(0)===t.sliceSerialize(n[e][1]).charCodeAt(0)){if((n[i][1]._close||n[e][1]._open)&&(n[e][1].end.offset-n[e][1].start.offset)%3&&!((n[i][1].end.offset-n[i][1].start.offset+n[e][1].end.offset-n[e][1].start.offset)%3))continue;l=n[i][1].end.offset-n[i][1].start.offset>1&&n[e][1].end.offset-n[e][1].start.offset>1?2:1;letd=Object.assign({},n[i][1].end),m=Object.assign({},n[e][1].start);rh(d,-l),rh(m,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},n[i][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[e][1].start),end:m},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},n[i][1].end),end:Object.assign({},n[e][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},o.end)},n[i][1].end=Object.assign({},a.start),n[e][1].start=Object.assign({},o.end),c=[],n[i][1].end.offset-n[i][1].start.offset&&(c=lt(c,[["enter",n[i][1],t],["exit",n[i][1],t]])),c=lt(c,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=lt(c,$r(t.parser.constructs.insideSpan.null,n.slice(i+1,e),t)),c=lt(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",r,t]]),n[e][1].end.offset-n[e][1].start.offset?(u=2,c=lt(c,[["enter",n[e][1],t],["exit",n[e][1],t]])):u=0,Ge(n,i-1,e-i+3,c),e=i+c.length-u-2;break}}for(e=-1;++e<n.length;)n[e][1].type==="attentionSequence"&&(n[e][1].type="data");returnn}functionwA(n,t){lete=this.parser.constructs.attentionMarkers.null,i=this.previous,r=Od(i),s;returna;functiona(l){returns=l,n.enter("attentionSequence"),o(l)}functiono(l){if(l===s)returnn.consume(l),o;letc=n.exit("attentionSequence"),u=Od(l),d=!u||u===2&&r||e.includes(l),m=!r||r===2&&u||e.includes(i);returnc._open=!!(s===42?d:d&&(r||!m)),c._close=!!(s===42?m:m&&(u||!d)),t(l)}}functionrh(n,t){n.column+=t,n.offset+=t,n._bufferIndex+=t}varCd={name:"autolink",tokenize:xA};functionxA(n,t,e){leti=0;returnr;functionr(p){returnn.enter("autolink"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),s}functions(p){returnDe(p)?(n.consume(p),a):c(p)}functiona(p){returnp===43||p===45||p===46||Ye(p)?(i=1,o(p)):c(p)}functiono(p){returnp===58?(n.consume(p),i=0,l):(p===43||p===45||p===46||Ye(p))&&i++<32?(n.consume(p),o):(i=0,c(p))}functionl(p){returnp===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),t):p===null||p===32||p===60||mr(p)?e(p):(n.consume(p),l)}functionc(p){returnp===64?(n.consume(p),u):nh(p)?(n.consume(p),c):e(p)}functionu(p){returnYe(p)?d(p):e(p)}functiond(p){returnp===46?(n.consume(p),i=0,u):p===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(p),n.exit("autolinkMarker"),n.exit("autolink"),t):m(p)}functionm(p){if((p===45||Ye(p))&&i++<63){leth=p===45?m:d;returnn.consume(p),h}returne(p)}}functionG(n,t,e,i){letr=i?i-1:Number.POSITIVE_INFINITY,s=0;returna;functiona(l){returnQ(l)?(n.enter(e),o(l)):t(l)}functiono(l){returnQ(l)&&s++<r?(n.consume(l),o):(n.exit(e),t(l))}}varMn={tokenize:LA,partial:!0};functionLA(n,t,e){returni;functioni(s){returnQ(s)?G(n,r,"linePrefix")(s):r(s)}functionr(s){returns===null||K(s)?t(s):e(s)}}varJo={name:"blockQuote",tokenize:SA,continuation:{tokenize:EA},exit:TA};functionSA(n,t,e){letLine truncated
`?(e++,i=1):i++;return{line:e,column:i,offset:t}}function yi(n,t=!1){let e=Jh(n),i=[];return ar(e,"listItem",r=>{if(!r.children||r.children.length===0){t&&i.push({position:r.position,isEmpty:!0});return}for(let s of r.children)s.type==="paragraph"&&i.push({position:s.position,isEmpty:!1})}),i.sort((r,s)=>s.position.start.offset-r.position.start.offset),i}function Xh(n){let t=Jh(n),e=[];return ar(t,"heading",i=>{if(!(!i.children||i.children.length===0))for(let r of i.children)r.type==="text"&&e.push({position:r.position,text:r.value})}),e.sort((i,r)=>r.position.start.offset-i.position.start.offset),e}function eg(n,t,e){let i=ot("footnoteDefinition",n).filter(c=>!e.isProtected(c.start.offset,n.indexOf("]",c.start.offset)+2)),r=[],s=new Map,a=new Map,o=function(c,u,d){let m=u.match(/\[\^.*?\]/)[0];if(s.has(m)){let g=s.get(m);g.footnotesReferencingKey.push(u),s.set(m,g);return}let p,h=[];do{if(d<0)break;p=c.lastIndexOf(m,d),p!==-1&&(e.isProtected(p,p+m.length)||h.push(p),d=p-1)}while(p>0);let f={key:m,referencePositions:h,footnotesReferencingKey:[u]};s.set(m,f)};for(let c of i){let u=n.substring(c.start.offset,c.end.offset);r.push(u),o(n,u,c.start.offset-1)}for(let c of i)c.end.offset<n.length&&n[c.end.offset]===`
`&&(n=n.substring(0,c.end.offset)+n.substring(c.end.offset+1)),n=n.substring(0,c.start.offset)+n.substring(c.end.offset);for(let c of s){let u=c[1],d=u.referencePositions.length-u.footnotesReferencingKey.length;d=d>=0?d:0;let m=0;for(let p of u.footnotesReferencingKey){if(m+d>=u.referencePositions.length)throw new Error(A("logs.missing-footnote-error-message").replace("{FOOTNOTE}",p));a.set(p,u.referencePositions[d+m++])}}r=r.sort((c,u)=>a.get(c)-a.get(u)),r.length>0&&(n=n.trimEnd());let l=`
`;t?l=`
`:r.length>0&&(n+=`
`);for(let c of r)n+=l+c;return n}function tg(n,t){let e=ot("footnoteDefinition",n).filter(f=>!t.isProtected(f.start.offset,n.indexOf("]",f.start.offset)+2)),i=[],r=new Map,s=new Map,a=[],o=new Set,l=function(f,g,b){let k=g.match(/\[\^.*?\]/)[0];r.set(g,k);let x=o.has(k);if(x&&i.includes(g))return;if(x)throw new Error(A("logs.too-many-footnotes-error-message").replace("{FOOTNOTE_KEY}",k));let E;do E=f.lastIndexOf(k,b),E!==-1&&(!t.isProtected(E,E+k.length)&&(E+g.length>f.length||f.substring(E,E+g.length)!==g)&&a.push({key:k,position:E}),b=E-1);while(E>0);o.add(k)};for(let f of e){let g=n.substring(f.start.offset,f.end.offset);i.unshift(g),l(n,g,f.start.offset)}let c=1,u=new Set;for(let f of i){if(u.has(f))continue;u.add(f);let g=r.get(f),b=`[^${c++}]`;s.set(g,b)}a.sort((f,g)=>g.position-f.position);let d=[],m=[];for(let f of a){let g=s.get(f.key);d.push({startIndex:f.position,endIndex:f.position+f.key.length,value:g})}u.clear();for(let f of e.slice().reverse()){let g=n.substring(f.start.offset,f.end.offset);if(u.has(g)){let x=f.start.offset;n[x-1]===`
`&&n[f.end.offset]===`
`&&x--,m.push({startIndex:x,endIndex:f.end.offset,value:""});continue}u.add(g);let b=r.get(g),k=s.get(b);d.some(x=>x.startIndex===f.start.offset)||d.push({startIndex:f.start.offset,endIndex:f.start.offset+b.length,value:k})}let p=new Et(m),h=d.filter(f=>!p.isProtected(f.startIndex,f.endIndex));return h.push(...p.ranges.map(f=>({...f,value:""}))),ke(n,h.sort((f,g)=>f.startIndex-g.startIndex))}function dl(n,t,e,i){let r=e==="strong"?2:1,s=ot(e,n).filter(l=>!i.isProtected(l.start.offset,l.start.offset+r)&&!i.isProtected(l.end.offset-r,l.end.offset));if(s.length===0)return n;let a;if(t==="underscore")a="_";else if(t==="asterisk")a="*";else{let l=s[s.length-1];a=n.substring(l.start.offset,l.start.offset+1)}e==="strong"&&(a+=a);let o=[];for(let l of s)o.push({startIndex:l.start.offset,endIndex:l.start.offset+a.length,value:a}),o.push({startIndex:l.end.offset-a.length,endIndex:l.end.offset,value:a});return J(n,o)}function ng(n,t,e){let i=e.projection(),r=kr("paragraph",i);if(r.length===0)return n;n=i.text;for(let s of r){let a=n.substring(s.startIndex,s.endIndex).split(`
`),r=ot("paragraph",n);if(r.length===0)return e.source;let s=[],a=new Map,o=(l,c,u)=>{let d=`${l}:${c}`,m=a.get(d);if(m){if(m.value!=u)throw new Error(A("logs.paragraph-gap-conflict-error"));return}let p={startIndex:l,endIndex:c,value:u};a.set(d,p),s.push(p)};for(let l of r){let c=l.start.offset;for(c>0&&c--;c>=0&&n.charAt(c)!=`
`:""),o(l.end.offset,f,g)}return vr(e,J(n,s))}function rg(n,t){let e=ot("link",n),i=[];for(let r of e){if(r==null||t.isProtected(r.start.offset,r.end.offset))continue;let s=n.substring(r.start.offset,r.end.offset);if(!s.match(Ar))continue;let a=s.indexOf("]"),o=s.substring(0,1)+s.substring(1,a).trim()+s.substring(a);i.push({startIndex:r.start.offset,endIndex:r.end.offset,value:o})}return J(n,i)}function sg(n,t,e){let i=ot("emphasis",n),r=[];for(let s of i)e.isProtected(s.start.offset,s.start.offset+1)||e.isProtected(s.end.offset-1,s.end.offset)||r.push(...t(n.substring(s.start.offset+1,s.end.offset-1),s.start.offset+1,e));return r}function ag(n,t,e){let i=ot("strong",n),r=[];for(let s of i)e.isProtected(s.start.offset,s.start.offset+2)||e.isProtected(s.end.offset-2,s.end.offset)||r.push(...t(n.substring(s.start.offset+2,s.end.offset-2),s.start.offset+2,e));return r}function kr(n,t){let e=[];for(let i of ot(n,t.source)){let r=t.sourceToProjection(i.start.offset),s=t.sourceToProjection(i.end.offset);r!==void 0&&s!==void 0&&!t.isToken(r)&&e.push({startIndex:r,endIndex:s})}return e}function vr(n,t){let e=[];for(let i of Ue(n.text,t)){let r=n.editRangeToSource(i);r&&e.push({...r,value:i.value})}return J(n.source,e)}function og(n,t){let e=Ue(n.text,t),i=s=>{let a=0;for(let o of e){if(o.startIndex>s)break;if(o.endIndex>s)return;a+=o.value.length-(o.endIndex-o.startIndex)}return s+a},r=[];for(let s of kr("inlineMath",n)){let a=i(s.startIndex),o=i(s.endIndex);a!==void 0&&o!==void 0&&r.push({startIndex:a,endIndex:o})}return r}function lg(n,t){let e=t.projection(),i=e.text,r=kr("code",e);for(let s of r){let a=i.substring(s.startIndex,s.endIndex);!a.startsWith("```")&&!a.startsWith("~~~")||(i=mi(i,s.startIndex,s.endIndex))}return vr(e,i)}function cg(n,t,e){let i=e.projection(),r=i.text,s=kr("math",i);for(let a of s)r=mi(r,a.startIndex,a.endIndex);s=og(i,r);for(let a of s)r.substring(a.startIndex,a.endIndex).startsWith("$".repeat(t))&&(r=mi(r,a.startIndex,a.endIndex));return vr(i,r)}function dg(n,t){let e=t.projection(),i=e.text,r=kr("blockquote",e);for(letsofr){leta=s.endIndex;for(;a<i.length-1&&i.charAt(a)!==`
`;)a++;i=mi(i,s.startIndex,a,!0)}return vr(e,i)}function ug(n,t){let e=t.projection(),i=e.text,r=kr("thematicBreak",e);for(let s of r)i=mi(i,s.startIndex,s.endIndex);return vr(e,i)}function mg(n,t,e,i,r){let s=ot("list",n);if(!s)return n;let a=/^(( |\t|> )*)((\d+(\.|\)))|[-*+])([^\n]*)$/gm,o=new Set,l=0,c=0;for(let u of n.matchAll(a)){l+=Tt(n.substring(c,u.index),`
`),c=u.index;let d=u.index+u[1].length;r.isProtected(d,d+u[3].length)&&o.add(l)}for(let u of s){let d=u.start.offset;for(;d>0&&n.charAt(d-1)!==`
`),k=q,o.has(b))return x;let $=t==="preserve"||i?parseInt(N,10):1,j=p(E);if(!/^\d/.test(M)){let U=j>g?j:g;return f(j,U),x}return h.has(j)?t==="ascending"?($=h.get(j)+1,h.set(j,$)):i&&($=h.get(j)):h.set(j,$),g>j&&f(j,g),g=j,`${E}${$}${e}${P}`}),n=ui(n,d,u.end.offset,m)}return n}function pg(n,t,e){let i=ot("listItem",n).filter(o=>!e.isProtected(o.start.offset,o.start.offset+1));if(!i)return n;let r=/^((\d+[.)])|(- \[[ x]\]))/m,s=t;if(t=="consistent"){let o=i.length-1;for(;o>=0;){let l=n.substring(i[o].start.offset,i[o].end.offset);if(o--,!l.match(r)){s=l.charAt(0);break}}if(o==-1)return n}let a=[];for(let o of i)n.substring(o.start.offset,o.end.offset).match(r)||a.push({startIndex:o.start.offset,endIndex:o.start.offset+1,value:s});return J(n,a)}function fg(n,t){let e=ot("blockquote",n),i=new Map;for(let r of e){let s=r.end.offset;for(;s<n.length-1&&n.charAt(s)!==`
`;)s++;i.set(r,t(n.substring(r.start.offset,s),r.start.offset))}for(let r of e){let s=i.get(r),a=r.end.offset;for(;a<n.length-1&&n.charAt(a)!==`
`;)a++;let o=n.substring(r.start.offset,a);o=s(o),n=ui(n,r.start.offset,a,o)}return n}function hg(n,t,e){let i=e.projection(),r=i.text,s=kr("math",i),a=new RegExp("^(\\${"+t+",})(\\n*)"),o=new RegExp("(\\n*)(\\${"+t+",})([^\\$]*)$");for(let l of s){let c=r.substring(l.startIndex,l.endIndex),u=Qx(c,t,l.startIndex);for(let d of u)r=Gh(r,d.startIndex,d.endIndex,a,o)}s=og(i,r);for(let l of s)r.substring(l.startIndex,l.endIndex).startsWith("$".repeat(t))&&(r=Gh(r,l.startIndex,l.endIndex,a,o));return vr(i,r)}function Qx(n,t,e){let i="$".repeat(t),r=t;for(;n.charAt(r)==="$";)i+="$",r++;let s=[],a=Tt(n,i);if(a<=1)return[];if(a===2)return s.unshift({startIndex:e,endIndex:e+n.length}),s;a===3&&s.unshift({startIndex:e,endIndex:e+n.indexOf(i,i.length)+i.length}),a%2===1&&a--;let o=e,l=i.length;for(;a>2;){let c=n.indexOf(i,l)+i.length;s.unshift({startIndex:o,endIndex:e+c}),o=e+c+1,l=c+1,a-=2}return s.unshift({startIndex:e+n.indexOf(i,l),endIndex:e+n.length}),s}function Gh(n,t,e,i,r){let s=n.substring(pi(n,t),t)??"",[a]=ur(s,s.length),o=n.substring(pi(n,e),e)??"",l=n.substring(t,e),c=kg.test(s.trim()),u=!1;for(l=l.replace(i,(d,m,p="")=>{let h="";return!c&&s.trim()!=""?(h+=`
${t.indent}${o}`:o}function $g({key:n,value:t},e,i,r){let{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=e,m=ue(n)&&n.comment||null;if(d){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(pe(n)||!ue(n)&&typeof n=="object"){let N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let p=!d&&(!n||m&&t==null&&!e.inFlow||pe(n)||(ne(n)?n.type===W.BLOCK_FOLDED||n.type===W.BLOCK_LITERAL:typeof n=="object"));e=Object.assign({},e,{allNullValues:!1,implicitKey:!p&&(d||!s),indent:o+l});let h=!1,f=!1,g=Zn(n,e,()=>h=!0,()=>f=!0);if(!p&&!e.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(e.inFlow){if(s||t==null)return h&&i&&i(),g===""?"?":p?`?${g}`:g}else if(s&&!d||t==null&&p)return g=`?${g}`,m&&!h?g+=Rn(g,e.indent,c(m)):f&&r&&r(),g;h&&(m=null),p?(m&&(g+=Rn(g,e.indent,c(m))),g=`?${g}
`)),h<n.length-1?b+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=d.reduce((k,x)=>k+x.length+2,2)+(b.length+2)>t.options.lineWidth)),c&&(b+=",")),g&&(b+=Rn(b,i,o(g))),d.push(b),u=d.length}let{start:m,end:p}=e;if(d.length===0)return m+p;if(!c){let h=d.reduce((f,g)=>f+g.length+2,2);c=t.options.lineWidth>0&&h>t.options.lineWidth}if(c){let h=m;for(let f of d)h+=f?`
${s}${r}${f}`:`
`;return`${h}
${r}${p}`}else return`${m}${a}${d.join(" ")}${a}${p}`}function Nl({indent:n,options:{commentString:t}},e,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Ht(t(i),n);e.push(s.trimStart())}}function Ai(n,t){let e=ne(t)?t.value:t;for(let i of n)if(ce(i)&&(i.key===t||i.key===e||ne(i.key)&&i.key.value===e))return i}var Me=class extends ts{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(dn,t),this.items=[]}static from(t,e,i){let{keepUndefined:r,replacer:s}=i,a=new this(t),o=(l,c)=>{if(typeof s=="function")c=s.call(e,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||r)&&a.items.push(rs(l,c,i))};if(e instanceof Map)for(let[l,c]of e)o(l,c);else if(e&&typeof e=="object")for(let l of Object.keys(e))o(l,e[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,e){let i;ce(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Ce(t,t?.value):i=new Ce(t.key,t.value);let r=Ai(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key${i.key}alreadyset`);ne(r.value)&&Ll(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let a=this.items.findIndex(o=>s(i,o)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(t){let e=Ai(this.items,t);return e?this.items.splice(this.items.indexOf(e),1).length>0:!1}get(t,e){let r=Ai(this.items,t)?.value;return(!e&&ne(r)?r.value:r)??void 0}has(t){return!!Ai(this.items,t)}set(t,e){this.add(new Ce(t,e),!0)}toJSON(t,e,i){let r=i?new i:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(let s of this.items)Rl(e,r,s);return r}toString(t,e,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!ce(r))throw new Error(`Mapitemsmustallbepairs;found${JSON.stringify(r)}instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Fl(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:e})}};var hn={collection:"map",default:!0,nodeClass:Me,tag:"tag:yaml.org,2002:map",resolve(n,t){return ht(n)||t("Expected a mapping for this tag"),n},createNode:(n,t,e)=>Me.from(n,t,e)};var Xe=class extends ts{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Vn,t),this.items=[]}add(t){this.items.push(t)}delete(t){let e=Bl(t);return typeof e!="number"?!1:this.items.splice(e,1).length>0}get(t,e){let i=Bl(t);if(typeof i!="number")return;let r=this.items[i];return!e&&ne(r)?r.value:r}has(t){let e=Bl(t);return typeof e=="number"&&e<this.items.length}set(t,e){let i=Bl(t);if(typeof i!="number")throw new Error(`Expectedavalidindex,not${t}.`);let r=this.items[i];ne(r)&&Ll(e)?r.value=e:this.items[i]=e}toJSON(t,e){let i=[];e?.onCreate&&e.onCreate(i);let r=0;for(let s of this.items)i.push(_e(s,String(r++),e));return i}toString(t,e,i){return t?Fl(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:e}):JSON.stringify(this)}static from(t,e,i){let{replacer:r}=i,s=new this(t);if(e&&Symbol.iterator in Object(e)){let a=0;for(let o of e){if(typeof r=="function"){let l=e instanceof Set?o:String(a++);o=r.call(e,l,o)}s.items.push(Qn(o,void 0,i))}}return s}};function Bl(n){let t=ne(n)?n.value:n;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}var gn={collection:"seq",default:!0,nodeClass:Xe,tag:"tag:yaml.org,2002:seq",resolve(n,t){return pn(n)||t("Expected a sequence for this tag"),n},createNode:(n,t,e)=>Xe.from(n,t,e)};var wi={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,t,e,i){return t=Object.assign({actualString:!0},t),Jn(n,t,e,i)}};var xr={identify:n=>n==null,createNode:()=>new W(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new W(null),stringify:({source:n},t)=>typeof n=="string"&&xr.test.test(n)?n:t.options.nullStr};var Va={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new W(n[0]==="t"||n[0]==="T"),stringify({source:n,value:t},e){if(n&&Va.test.test(n)){let i=n[0]==="t"||n[0]==="T";if(t===i)return n}return t?e.options.trueStr:e.options.falseStr}};function et({format:n,minFractionDigits:t,tag:e,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!n&&t&&(!e||e==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}var Dl={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:et},Yl={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^
Line truncated
`:" ")}return Jn({comment:n,type:t,value:o},i,r,s)}};function Su(n,t){if(pn(n))for(let e=0;e<n.items.length;++e){let i=n.items[e];if(!ce(i)){if(ht(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new Ce(new W(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
`}};function Nn(n,{flow:t,indicator:e,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:o}){let l=!1,c=o,u=o,d="",m="",p=!1,h=!1,f=null,g=null,b=null,k=null,x=null,E=null,C=null;for(let F of n)switch(h&&(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma"&&s(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),f&&(c&&F.type!=="comment"&&F.type!=="newline"&&s(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),F.type){case"space":!t&&(e!=="doc-start"||i?.type!=="flow-collection")&&F.source.includes(" ")&&(f=F),u=!0;break;case"comment":{u||s(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=F.source.substring(1)||" ";d?d+=m+P:d=P,m="",c=!1;break}case"newline":c?d?d+=F.source:(!E||e!=="seq-item-ind")&&(l=!0):m+=F.source,c=!0,p=!0,(g||b)&&(k=F),u=!0;break;case"anchor":g&&s(F,"MULTIPLE_ANCHORS","A node can have at most one anchor"),F.source.endsWith(":")&&s(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=F,C??(C=F.offset),c=!1,u=!1,h=!0;break;case"tag":{b&&s(F,"MULTIPLE_TAGS","A node can have at most one tag"),b=F,C??(C=F.offset),c=!1,u=!1,h=!0;break}case e:(g||b)&&s(F,"BAD_PROP_ORDER",`Anchorsandtagsmustbeafterthe${F.source}indicator`),E&&s(F,"UNEXPECTED_TOKEN",`Unexpected${F.source}in${t??"collection"}`),E=F,c=e==="seq-item-ind"||e==="explicit-key-ind",u=!1;break;case"comma":if(t){x&&s(F,"UNEXPECTED_TOKEN",`Unexpected,in${t}`),x=F,c=!1,u=!1;break}default:s(F,"UNEXPECTED_TOKEN",`Unexpected${F.type}token`),c=!1,u=!1}let M=n[n.length-1],N=M?M.offset+M.source.length:r;return h&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(c&&f.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&s(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:E,spaceBefore:l,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:k,end:N,start:C??N}}function xi(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
`))return!0;if(n.end){for(let t of n.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of n.items){for(let e of t.start)if(e.type==="newline")return!0;if(t.sep){for(let e of t.sep)if(e.type==="newline")return!0}if(xi(t.key)||xi(t.value))return!0}return!1;default:return!0}}function io(n,t,e){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&xi(t)&&e(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Vl(n,t,e){let{uniqueKeys:i}=n.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,a)=>s===a||ne(s)&&ne(a)&&s.value===a.value;return t.some(s=>r(s.key,e))}var py="All mapping items must start at the same column";function fy({composeNode:n,composeEmptyNode:t},e,i,r,s){let a=s?.nodeClass??Me,o=new a(e.schema);e.atRoot&&(e.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:d,key:m,sep:p,value:h}=u,f=Nn(d,{indicator:"explicit-key-ind",next:m??p?.[0],offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0}),g=!f.found;if(g){if(m&&(m.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(l,"BAD_INDENT",py)),!f.anchor&&!f.tag&&!p){c=f.end,f.comment&&(o.comment?o.comment+=`
`+f.comment:o.comment=f.comment);continue}(f.newlineAfterProp||xi(m))&&r(m??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else f.found?.indent!==i.indent&&r(l,"BAD_INDENT",py);e.atKey=!0;let b=f.end,k=m?n(e,m,f,r):t(e,b,d,null,f,r);e.schema.compat&&io(i.indent,m,r),e.atKey=!1,Vl(e,o.items,k)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let x=Nn(p??[],{indicator:"map-value-ind",next:h,offset:k.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(l=x.end,x.found){g&&(h?.type==="block-map"&&!x.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),e.options.strict&&f.start<x.found.offset-1024&&r(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=h?n(e,h,x,r):t(e,l,p,null,x,r);e.schema.compat&&io(i.indent,h,r),l=E.range[2];let C=new Ce(k,E);e.options.keepSourceTokens&&(C.srcToken=u),o.items.push(C)}else{g&&r(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(k.comment?k.comment+=`
`+x.comment:k.comment=x.comment);let E=new Ce(k);e.options.keepSourceTokens&&(E.srcToken=u),o.items.push(E)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),o.range=[i.offset,l,c??l],o}function hy({composeNode:n,composeEmptyNode:t},e,i,r,s){let a=s?.nodeClass??Xe,o=new a(e.schema);e.atRoot&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:d}of i.items){let m=Nn(u,{indicator:"seq-item-ind",next:d,offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||d)d?.type==="block-seq"?r(m.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(o.comment=m.comment);continue}let p=d?n(e,d,m,r):t(e,m.end,u,null,m,r);e.schema.compat&&io(i.indent,d,r),l=p.range[2],o.items.push(p)}return o.range=[i.offset,l,c??l],o}function Fn(n,t,e,i){let r="";if(n){let s=!1,a="";for(let o of n){let{source:l,type:c}=o;switch(c){case"space":s=!0;break;case"comment":{e&&!s&&i(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=a+u:r=u,a="";break}case"newline":r&&(a+=l),s=!0;break;default:i(o,"UNEXPECTED_TOKEN",`Unexpected${c}atnodeend`)}t+=l.length}}return{comment:r,offset:t}}var Nu="Block collections are not allowed within flow collections",Fu=n=>n&&(n.type==="block-map"||n.type==="block-seq");function gy({composeNode:n,composeEmptyNode:t},e,i,r,s){let a=i.start.source==="{",o=a?"flow map":"flow sequence",l=s?.nodeClass??(a?Me:Xe),c=new l(e.schema);c.flow=!0;let u=e.atRoot;u&&(e.atRoot=!1),e.atKey&&(e.atKey=!1);let d=i.offset+i.start.source.length;for(let g=0;g<i.items.length;++g){let b=i.items[g],{start:k,key:x,sep:E,value:C}=b,M=Nn(k,{flow:o,indicator:"explicit-key-ind",next:x??E?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!E&&!C){g===0&&M.comma?r(M.comma,"UNEXPECTED_TOKEN",`Unexpected,in${o}`):g<i.items.length-1&&r(M.start,"UNEXPECTED_TOKEN",`Unexpectedemptyitemin${o}`),M.comment&&(c.comment?c.comment+=`
`+M.comment:c.comment=M.comment),d=M.end;continue}!a&&e.options.strict&&xi(x)&&r(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected,in${o}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing,between${o}items`),M.comment){let N="";e:for(let F of k)switch(F.type){case"comma":case"space":break;case"comment":N=F.source.substring(1);break e;default:break e}if(N){let F=c.items[c.items.length-1];ce(F)&&(F=F.value??F.key),F.comment?F.comment+=`
`+N:F.comment=N,M.comment=M.comment.substring(N.length+1)}}if(!a&&!E&&!M.found){let N=C?n(e,C,M,r):t(e,M.end,E,null,M,r);c.items.push(N),d=N.range[2],Fu(C)&&r(N.range,"BLOCK_IN_FLOW",Nu)}else{e.atKey=!0;let N=M.end,F=x?n(e,x,M,r):t(e,N,k,null,M,r);Fu(x)&&r(F.range,"BLOCK_IN_FLOW",Nu),e.atKey=!1;let P=Nn(E??[],{flow:o,indicator:"map-value-ind",next:C,offset:F.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(P.found){if(!a&&!M.found&&e.options.strict){if(E)for(let j of E){if(j===P.found)break;if(j.type==="newline"){r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missingspaceafter:in${o}`):r(P.start,"MISSING_CHAR",`Missing,or:between${o}items`));let q=C?n(e,C,P,r):P.found?t(e,P.end,E,null,P,r):null;q?Fu(C)&&r(q.range,"BLOCK_IN_FLOW",Nu):P.comment&&(F.comment?F.comment+=`
`+P.comment:F.comment=P.comment);let $=new Ce(F,q);if(e.options.keepSourceTokens&&($.srcToken=b),a){let j=c;Vl(e,j.items,F)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),j.items.push($)}else{let j=new Me(e.schema);j.flow=!0,j.items.push($);let U=(q??F).range;j.range=[F.range[0],U[1],U[2]],c.items.push(j)}d=q?q.range[2]:P.end}}let m=a?"}":"]",[p,...h]=i.end,f=d;if(p?.source===m)f=p.offset+p.source.length;else{let g=o[0].toUpperCase()+o.substring(1),b=u?`${g}mustendwitha${m}`:`${g}inblockcollectionmustbesufficientlyindentedandendwitha${m}`;r(d,u?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&h.unshift(p)}if(h.length>0){let g=Fn(h,f,e.options.strict,r);g.comment&&(c.comment?c.comment+=`
`.repeat(Math.max(1,a.length-1)):"",g=i+r.length;return t.source&&(g+=t.source.length),{value:f,type:s,comment:r.comment,range:[i,g,g]}}let l=t.indent+r.indent,c=t.offset+r.length,u=0;for(let f=0;f<o;++f){let[g,b]=a[f];if(b===""||b==="\r")r.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&e(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=g.length),u=f,l===0&&!n.atRoot&&e(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let f=a.length-1;f>=o;--f)a[f][0].length>l&&(o=f+1);let d="",m="",p=!1;for(let f=0;f<u;++f)d+=a[f][0].slice(l)+`
`;if(n.type==="block-scalar"){let s=n.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,n.source=r}else{let{offset:s}=n,a="indent"in n?n.indent:-1,o=[{type:"block-scalar-header",offset:s,indent:a,source:i}];Sy(o,"end"in n?n.end:void 0)||o.push({type:"newline",offset:-1,indent:a,source:`
`});for(let l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:a,props:o,source:r})}}function Sy(n,t){if(t)for(let e of t)switch(e.type){case"space":case"comment":n.push(e);break;case"newline":return n.push(e),!0}return!1}function _u(n,t,e){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=e,n.source=t;break;case"block-scalar":{let i=n.props.slice(1),r=t.length;n.props[0].type==="block-scalar-header"&&(r-=n.props[0].source.length);for(let s of i)s.offset+=r;delete n.props,Object.assign(n,{type:e,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:n.offset+t.length,indent:n.indent,source:`
`};delete n.items,Object.assign(n,{type:e,source:t,end:[r]});break}default:{let i="indent"in n?n.indent:-1,r="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:e,indent:i,source:t,end:r})}}}var Ey=n=>"type"in n?Xl(n):Zl(n);function Xl(n){switch(n.type){case"block-scalar":{let t="";for(let e of n.props)t+=Xl(e);return t+n.source}case"block-map":case"block-seq":{let t="";for(let e of n.items)t+=Zl(e);return t}case"flow-collection":{let t=n.start.source;for(let e of n.items)t+=Zl(e);for(let e of n.end)t+=e.source;return t}case"document":{let t=Zl(n);if(n.end)for(let e of n.end)t+=e.source;return t}default:{let t=n.source;if("end"in n&&n.end)for(let e of n.end)t+=e.source;return t}}}function Zl({start:n,key:t,sep:e,value:i}){let r="";for(let s of n)r+=s.source;if(t&&(r+=Xl(t)),e)for(let s of e)r+=s.source;return i&&(r+=Xl(i)),r}var Ku=Symbol("break visit"),IL=Symbol("skip children"),Ty=Symbol("remove item");function Li(n,t){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),My(Object.freeze([]),n,t)}Li.BREAK=Ku;Li.SKIP=IL;Li.REMOVE=Ty;Li.itemAtPath=(n,t)=>{let e=n;for(let[i,r]of t){let s=e?.[i];if(s&&"items"in s)e=s.items[r];else return}return e};Li.parentCollection=(n,t)=>{let e=Li.itemAtPath(n,t.slice(0,-1)),i=t[t.length-1][0],r=e?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function My(n,t,e){let i=e(t,n);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=t[r];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let o=My(Object.freeze(n.concat([[r,a]])),s.items[a],e);if(typeof o=="number")a=o-1;else{if(o===Ku)return Ku;o===Ty&&(s.items.splice(a,1),a-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,n))}}return typeof i=="function"?i(t,n):i}var ao="\uFEFF",oo="",lo="",cs="",RL=n=>!!n&&"items"in n,NL=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function FL(n){switch(n){case ao:return"<BOM>";case oo:return"<DOC>";case lo:return"<FLOW_END>";case cs:return"<SCALAR>";default:return JSON.stringify(n)}}function Pu(n){switch(n){case ao:return"byte-order-mark";case oo:return"doc-mode";case lo:return"flow-error-end";case cs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
\r`),zu=n=>!n||DL.has(n),co=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let i=this.next??"stream";for(;i&&(e||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;e===" "||e===" ";)e=this.buffer[++t];return!e||e==="#"||e===`
---`},wikiLink:{replaceAction:pl,placeholder:"{WIKI_LINK_PLACEHOLDER}"},obsidianMultiLineComments:{replaceAction:Mg,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:ml,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},url:{replaceAction:Jr,placeholder:"{URL_PLACEHOLDER}"},anchorTag:{replaceAction:Cg,placeholder:"{ANCHOR_PLACEHOLDER}"},templaterCommand:{replaceAction:Bg,placeholder:"{TEMPLATER_PLACEHOLDER}"},link:{replaceAction:"link",placeholder:"{REGULAR_LINK_PLACEHOLDER}",onlyIfMatches:Ar},tag:{placeholder:"#tag-placeholder",findRanges:JL},table:{placeholder:"{TABLE_PLACEHOLDER}",findRanges:fi},customIgnore:{placeholder:"{CUSTOM_IGNORE_PLACEHOLDER}",findRanges:gg}};function JL(n){let t=[];for(let e of n.matchAll(fl)){let i=e.index+e[1].length;t.push({startIndex:i,endIndex:i+e[2].length})}return t}var ZL=[y.customIgnore,y.obsidianMultiLineComments,y.templaterCommand,y.yaml,y.anchorTag,y.table,y.code,y.inlineCode,y.math,y.inlineMath,y.html,y.heading,y.blockquote,y.list,y.thematicBreak,y.bold,y.italics,y.image,y.link,y.wikiLink,y.tag,y.url,y.footnoteAtStartOfLine,y.footnoteAfterATask];Vf(ZL);var Jy=1e4,hs,Ao,Ci,ut=class ut{static getRule(){let t=new this;if(!v(ut,hs).has(t.alias)){let e=new bc(t.nameKey,t.descriptionKey,t.settingsKey,t.alias,t.type,t.safeApply.bind(t),t.optionBuilders.map(i=>i.option),t.hasSpecialExecutionOrder,t.ignoreTypes,t.disableConflictingOptions);v(ut,hs).set(t.alias,e),v(ut,Ao).set(t.alias,t)}return v(ut,hs).get(t.alias)}static applyIfEnabledBase(t,e,i,r,s){let a=t.getOptions(i);if(a[t.enabledOptionName()]){sr(t.alias);let o=Object.assign({},a,r);$e(`${A("logs.run-rule-text")}${t.getName()}`);try{let l=t.apply(e,o,s);return ai(t.alias),l.length>Jy?$e(l.slice(0,Jy-1)+"..."):$e(l),[l,!0]}catch(l){ai(t.alias),vc(l instanceof Error?l:new Error(String(l)),t.getName())}}return[e,!1]}static getBuilderByName(t){return v(ut,Ao).get(t)}static setNoSettingControl(t,e){v(ut,Ci).has(t)||v(ut,Ci).set(t,[]),v(ut,Ci).get(t).push(e)}static hasSettingControl(t,e){return!v(ut,Ci).has(t)||!v(ut,Ci).get(t).includes(e)}};hs=new WeakMap,Ao=new WeakMap,Ci=new WeakMap,ee(ut,hs,new Map),ee(ut,Ao,new Map),ee(ut,Ci,new Map);var Ii=ut,w=class extends Ii{constructor(t){super(),this.alias=t.nameKey.substring(6,t.nameKey.length-5),this.settingsKey=this.alias,this.nameKey=t.nameKey,this.descriptionKey=t.descriptionKey,this.type=t.type,this.hasSpecialExecutionOrder=t.hasSpecialExecutionOrder??!1,this.disableConflictingOptions=t.disableConflictingOptions??null,t.ruleIgnoreTypes?this.ignoreTypes=[y.customIgnore,...t.ruleIgnoreTypes]:this.ignoreTypes=[y.customIgnore]}static register(t,e){let i=t.getRule();$y(i)}safeApply(t,e,i){return this.apply(t,this.buildRuleOptions(e),i)}buildRuleOptions(t){t=t??{};let e=new this.OptionsClass,i=Object.assign(e,t);for(let r of this.optionBuilders)r.setRuleOption(i,t);return i}static applyIfEnabled(t,e,i,r,s){let a=this.getRule();return i.includes(a.alias)?($e(a.alias+" "+A("logs.disabled-text")),[t,!1]):Ii.applyIfEnabledBase(a,t,e,r,s)}static getRuleOptions(t){let e=Ii.getRule.bind(this)(),i=new this,r=e.getOptions(t);return i.buildRuleOptions(r)}static noSettingControl(){return function(t,e){let i=String(e.name);e.addInitializer(function(){Ii.setNoSettingControl(this.constructor.name,i)})}}getOptionBuilderByOptionsKey(t){return this.optionBuilders.find(e=>e.optionsKey===t)}};var gs,ei=class{constructor(t){ee(this,gs);this.OptionsClass=t.OptionsClass;let e=t.nameKey.split(".");e.length==1?this.configKey=e[0]:this.configKey=e[e.length-2],this.nameKey=t.nameKey,this.descriptionKey=t.descriptionKey,this.optionsKey=t.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return v(this,gs)||H(this,gs,this.buildOption()),v(this,gs)}setRuleOption(t,e){let i=e[this.configKey];i!==void 0&&(t[this.optionsKey]=i)}};gs=new WeakMap;var V=class extends ei{constructor(t){super(t),this.onChange=t.onChange??null}buildOption(){return new ps(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,null,this.onChange)}},wc=class extends ei{buildOption(){return new vo(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},de=class extends ei{constructor(t){super(t),this.records=t.records.map(e=>new fc("enums."+e.value,e.description))}buildOption(){return new hc(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,this.records)}},Ae=class extends ei{constructor(e){super(e);this.validator=void 0;this.validator=e.validator,this.emptyStateKey=e.emptyStateKey,this.fieldNamePlaceholderKey=e.fieldNamePlaceholderKey,this.allowReorder=e.allowReorder??!1,this.trimItemWhitespace=e.trimItemWhitespace??!1}buildOption(){return new mc(this.configKey,this.nameKey,this.descriptionKey,null,this.defaultValue??[],this.validator,this.emptyStateKey,this.fieldNamePlaceholderKey,this.allowReorder,th
Line truncated
`?t:t.replace(r,r+`
`)}get optionBuilders(){return[]}};Ju=I(tS),ti=O(Ju,0,"AddBlankLineAfterYAML",Zy,ti),L(Ju,1,ti);var Xu=[[0,31,"N"],[32,126,"Na"],[127,160,"N"],[161,161,"A"],[162,163,"Na"],[164,164,"A"],[165,166,"Na"],[167,168,"A"],[169,169,"N"],[170,170,"A"],[171,171,"N"],[172,172,"Na"],[173,174,"A"],[175,175,"Na"],[176,180,"A"],[181,181,"N"],[182,186,"A"],[187,187,"N"],[188,191,"A"],[192,197,"N"],[198,198,"A"],[199,207,"N"],[208,208,"A"],[209,214,"N"],[215,216,"A"],[217,221,"N"],[222,225,"A"],[226,229,"N"],[230,230,"A"],[231,231,"N"],[232,234,"A"],[235,235,"N"],[236,237,"A"],[238,239,"N"],[240,240,"A"],[241,241,"N"],[242,243,"A"],[244,246,"N"],[247,250,"A"],[251,251,"N"],[252,252,"A"],[253,253,"N"],[254,254,"A"],[255,256,"N"],[257,257,"A"],[258,272,"N"],[273,273,"A"],[274,274,"N"],[275,275,"A"],[276,282,"N"],[283,283,"A"],[284,293,"N"],[294,295,"A"],[296,298,"N"],[299,299,"A"],[300,304,"N"],[305,307,"A"],[308,311,"N"],[312,312,"A"],[313,318,"N"],[319,322,"A"],[323,323,"N"],[324,324,"A"],[325,327,"N"],[328,331,"A"],[332,332,"N"],[333,333,"A"],[334,337,"N"],[338,339,"A"],[340,357,"N"],[358,359,"A"],[360,362,"N"],[363,363,"A"],[364,461,"N"],[462,462,"A"],[463,463,"N"],[464,464,"A"],[465,465,"N"],[466,466,"A"],[467,467,"N"],[468,468,"A"],[469,469,"N"],[470,470,"A"],[471,471,"N"],[472,472,"A"],[473,473,"N"],[474,474,"A"],[475,475,"N"],[476,476,"A"],[477,592,"N"],[593,593,"A"],[594,608,"N"],[609,609,"A"],[610,707,"N"],[708,708,"A"],[709,710,"N"],[711,711,"A"],[712,712,"N"],[713,715,"A"],[716,716,"N"],[717,717,"A"],[718,719,"N"],[720,720,"A"],[721,727,"N"],[728,731,"A"],[732,732,"N"],[733,733,"A"],[734,734,"N"],[735,735,"A"],[736,767,"N"],[768,879,"A"],[880,912,"N"],[913,929,"A"],[930,930,"N"],[931,937,"A"],[938,944,"N"],[945,961,"A"],[962,962,"N"],[963,969,"A"],[970,1024,"N"],[1025,1025,"A"],[1026,1039,"N"],[1040,1103,"A"],[1104,1104,"N"],[1105,1105,"A"],[1106,4351,"N"],[4352,4447,"W"],[4448,8207,"N"],[8208,8208,"A"],[8209,8210,"N"],[8211,8214,"A"],[8215,8215,"N"],[8216,8217,"A"],[8218,8219,"N"],[8220,8221,"A"],[8222,8223,"N"],[8224,8226,"A"],[8227,8227,"N"],[8228,8231,"A"],[8232,8239,"N"],[8240,8240,"A"],[8241,8241,"N"],[8242,8243,"A"],[8244,8244,"N"],[8245,8245,"A"],[8246,8250,"N"],[8251,8251,"A"],[8252,8253,"N"],[8254,8254,"A"],[8255,8307,"N"],[8308,8308,"A"],[8309,8318,"N"],[8319,8319,"A"],[8320,8320,"N"],[8321,8324,"A"],[8325,8360,"N"],[8361,8361,"H"],[8362,8363,"N"],[8364,8364,"A"],[8365,8450,"N"],[8451,8451,"A"],[8452,8452,"N"],[8453,8453,"A"],[8454,8456,"N"],[8457,8457,"A"],[8458,8466,"N"],[8467,8467,"A"],[8468,8469,"N"],[8470,8470,"A"],[8471,8480,"N"],[8481,8482,"A"],[8483,8485,"N"],[8486,8486,"A"],[8487,8490,"N"],[8491,8491,"A"],[8492,8530,"N"],[8531,8532,"A"],[8533,8538,"N"],[8539,8542,"A"],[8543,8543,"N"],[8544,8555,"A"],[8556,8559,"N"],[8560,8569,"A"],[8570,8584,"N"],[8585,8585,"A"],[8586,8591,"N"],[8592,8601,"A"],[8602,8631,"N"],[8632,8633,"A"],[8634,8657,"N"],[8658,8658,"A"],[8659,8659,"N"],[8660,8660,"A"],[8661,8678,"N"],[8679,8679,"A"],[8680,8703,"N"],[8704,8704,"A"],[8705,8705,"N"],[8706,8707,"A"],[8708,8710,"N"],[8711,8712,"A"],[8713,8714,"N"],[8715,8715,"A"],[8716,8718,"N"],[8719,8719,"A"],[8720,8720,"N"],[8721,8721,"A"],[8722,8724,"N"],[8725,8725,"A"],[8726,8729,"N"],[8730,8730,"A"],[8731,8732,"N"],[8733,8736,"A"],[8737,8738,"N"],[8739,8739,"A"],[8740,8740,"N"],[8741,8741,"A"],[8742,8742,"N"],[8743,8748,"A"],[8749,8749,"N"],[8750,8750,"A"],[8751,8755,"N"],[8756,8759,"A"],[8760,8763,"N"],[8764,8765,"A"],[8766,8775,"N"],[8776,8776,"A"],[8777,8779,"N"],[8780,8780,"A"],[8781,8785,"N"],[8786,8786,"A"],[8787,8799,"N"],[8800,8801,"A"],[8802,8803,"N"],[8804,8807,"A"],[8808,8809,"N"],[8810,8811,"A"],[8812,8813,"N"],[8814,8815,"A"],[8816,8833,"N"],[8834,8835,"A"],[8836,8837,"N"],[8838,8839,"A"],[8840,8852,"N"],[8853,8853,"A"],[8854,8856,"N"],[8857,8857,"A"],[8858,8868,"N"],[8869,8869,"A"],[8870,8894,"N"],[8895,8895,"A"],[8896,8977,"N"],[8978,8978,"A"],[8979,8985,"N"],[8986,8987,"W"],[8988,9e3,"N"],[9001,9002,"W"],[9003,9192,"N"],[9193,9196,"W"],[9197,9199,"N"],[9200,9200,"W"],[9201,9202,"N"],[9203,9203,"W"],[9204,9311,"N"],[9312,9449,"A"],[9450,9450,"N"],[9451,9547,"A"],[9548,9551,"N"],[9552,9587,"A"],[9588,9599,"N"],[9600,9615,"A"],[9616,9617,"N"],[9618,9621,"A"],[9622,9631,"N"],[9632,9633,"A"],[9634,9634,"N"],[9635,9641,"A"],[9642,9649,"N"],[9650,9651,"A"],[9652,9653,"N"],[9654,9655,"A"],[9656,9659,"N"],[9660,9661,"A"],[9662,9663,"N"],[9664,9665,"A"],[9666,9669,"N"],[9670,9672,"A"],[9673,9674,"N"],[9675,9675,"A"],[9676,9677,"N"],[9678,9681,"A"],[9682,9697,"N"],[9698,9701,"A"],[9702,9710,"N"],[9711,9711,"A"],[9712,9724,"N"],[9725,9726,"W"],[9727,9732,"N"],[9733,9734,"A"],[9735,9736,"N"],[9737,9737,"A"],[9738,9741,"N"],[9742,9743,"A"],[9744,9747,"N"],[9748,9749,"W"],[9750,9755,"N"],[9756,9756,"A"],[9757,9757,"N"],[9758,9758,"A"],[9759,9775,"N"],[9776,9783,"W"],[9784,9791,"N"],[9792,9792,"A"],[9793,9793,"N"],[9794,9794,"A"],[9795,9799,"N"],[9800,9811,"W"],[9812,9823,"N"],[9824,9825,"A"],[9826,9826,"N"],[9827,9829,"A"
Line truncated
`,a),o===-1&&(o=d.length-1,m=!0),[l,u]=ur(d,o-1);let h=p++;if(i[h]){a=o+1;continue}c=e(l,r[h],s[h]),u++,d=ui(d,u,u+l.length,c),a=o+1+c.length-l.length}while(!m);return d}get optionBuilders(){return[new de({OptionsClass:Mc,nameKey:"rules.blockquote-style.style.name",descriptionKey:"rules.blockquote-style.style.description",optionsKey:"style",records:[{value:"space",description:"> indicator is followed by a space"},{value:"no space",description:">indicator is not followed by a space"}]})]}};im=I(lS),Fi=O(im,0,"BlockquoteStyle",ob,Fi),L(im,1,Fi);var lb,Oc;lb=[w.noSettingControl()];var xo=class{constructor(){this.lineContent=L(Oc,8,this),L(Oc,11,this)}};Oc=I(null),O(Oc,5,"lineContent",lb,xo),oe(Oc,xo);var cb,rm,dS;cb=[w.register];var Bi=class extends(dS=w){constructor(){super({nameKey:"rules.add-blockquote-indentation-on-paste.name",descriptionKey:"rules.add-blockquote-indentation-on-paste.description",type:"Paste"})}get OptionsClass(){return xo}apply(t,e){let i=/^(\s*)((> ?)+) .*/,r=e.lineContent.match(i);if(!r)return t;let s=r[1]??"",a=r[2]??"";return t.trim().replace(/\n/gm,`
${s}${a}`)}get optionBuilders(){return[]}};rm=I(dS),Bi=O(rm,0,"BlockquotifyOnPaste",cb,Bi),L(rm,1,Bi);var ni=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript","I"];this.lowercaseWords=["a","an","the","aboard","about","abt.","above","abreast","absent","across","after","against","along","aloft","alongside","amid","amidst","mid","midst","among","amongst","anti","apropos","around","round","as","aslant","astride","at","atop","ontop","bar","barring","before","B4","behind","below","beneath","neath","beside","besides","between","'tween","beyond","but","by","chez","circa","c.","ca.","come","concerning","contra","counting","cum","despite","spite","down","during","effective","ere","except","excepting","excluding","failing","following","for","from","in","including","inside","into","less","like","minus","modulo","mod","near","nearer","nearest","next","notwithstanding","of","o'","off","offshore","on","onto","opposite","out","outside","over","o'er","pace","past","pending","per","plus","post","pre","pro","qua","re","regarding","respecting","sans","save","saving","short","since","sub","than","through","thru","throughout","thruout","till","times","to","t'","touching","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","vs.","v.","via","vice","vis-\xE0-vis","wanting","with","w/","w.","c\u0304","within","w/i","without","'thout","w/o","abroad","adrift","aft","afterward","afterwards","ahead","apart","ashore","aside","away","back","backward","backwards","beforehand","downhill","downstage","downstairs","downstream","downward","downwards","downwind","east","eastward","eastwards","forth","forward","forwards","heavenward","heavenwards","hence","henceforth","here","hereby","herein","hereof","hereto","herewith","home","homeward","homewards","indoors","inward","inwards","leftward","leftwards","north","northeast","northward","northwards","northwest","now","onward","onwards","outdoors","outward","outwards","overboard","overhead","overland","overseas","rightward","rightwards","seaward","seawards","skywards","skyward","south","southeast","southwards","southward","southwest","then","thence","thenceforth","there","thereby","therein","thereof","thereto","therewith","together","underfoot","underground","uphill","upstage","upstairs","upstream","upward","upwards","upwind","west","westward","westwards","when","whence","where","whereby","wherein","whereto","wherewith","although","because","considering","given","granted","if","lest","once","provided","providing","seeing","so","supposing","though","unless","whenever","whereas","wherever","while","whilst","ago","inasmuch","even","whether","whose","whoever","why","how","whatever","what","both","and","or","either","neither","nor","just","rather","such","that","yet","is","it"];this.startingWordIgnoreCharacters=`'"(\u2018\u201C-`;this.endingWordIgnoreCharacters=`.?!,:;'")\u201D\u20190123456789-`;this.ignoreCasedWords=!0}},db,sm,mS;db=[w.register];var Di=class extends(mS=w){constructor(){super({nameKey:"rules.capitalize-headings.name",descriptionKey:"rules.capitalize-headings.description",type:"Heading",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[y.code,y.inlineCode,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return ni}apply(t,e,i){let r=i.projection(),s=[];for(let a of r.text.matchAll(cn)){if(!a[4]||a[4].trim()=="")continue;let o=(d,m,p)=>{let h=r.editRangeToSource({startIndex:a.index+d,endIndex:a.index+m});h&&t.substring(h.startIndex,h.endIndex)!==p&&s.push({...h,value:p})};if(e.style==="ALLCAPS"){let d=0;for(let m of a[0])o(d,d+m.length,m.toUpperCase()),d+=m.length;continue}let l=[...a[0].matchAll(fu)],c=this.capitalizeHeading(a[0],e).split(""),u=0;for(let d=0;d<l.length;d++){let m=l[d];o(u,m.index,d===0?"":""),o(m.index,m.index+m[0].length,c[d]),u=m.index+m[0].length}o(u,a[0].length,"")}return J(t,s)}capitalizeHeading(t,e){return t.replace(cn,i=>{if(e.style==="ALLCAPS")return i.toUpperCase();let r=e.style==="Firstletter",s=i.match(fu);if(!s)return i;let a=e.startingWordIgnoreCharacters?.length==0?"":`[${Mt(e.startingWordIgnoreCharacters)}]?`,o=e.endingWordIgnoreCharacters?.length==0?"":`[${Mt(e.endingWordIgnoreCharacters)}]*`,l=new RegExp(`^${a}[\\p{L}\u2019'-]{1,}${o}$`,"u"),c=e.ignoreWords,u=e.lowercaseWords,d=!0;for(let m=1;m<s.length;m++){if(!s[m].match(l)||s[m]==="-"||s[m]==="'")continue;let h=0;if(e.startingWordIgnoreCharacters?.includes(s[m][0])&&(h=1),e.ignoreCasedWords&&s[m]!==s[m].toLowerCase()||c.includes(s[m])||(s[m]=s[m].toLowerCase(),(!u.includes(s[m])&&!r||d===!0)&&(h===0?s[m]=s[m][h].toUpperCase()+s[m].slice(h+1):s[m]=s[m][0]+s[m][h].toUpperCase()+s[m].slice(h+1))),d=!1,e.ignoreCasedWords&&r)break}return s.join("")})}get optionBuilders(){return[new de({OptionsClass:ni,nameKey:"rules.capitalize-headings.style.name",descriptionKey:"rules.capitalize-headings.style.description",optionsKey:"style",records:[{value:"TitleCase",description:"CapitalizeUsingTitleLine truncated
`),i=i.replace(/\n+---/,`
---`),e.innerNewLines&&(i=_y(i)),i))}get optionBuilders(){return[new V({OptionsClass:Cc,nameKey:"rules.compact-yaml.inner-new-lines.name",descriptionKey:"rules.compact-yaml.inner-new-lines.description",optionsKey:"innerNewLines"})]}};am=I(fS),bs=O(am,0,"CompactYaml",ub,bs),L(am,1,bs);var lm=class{},mb,om,gS;mb=[w.register];var Yi=class extends(gS=w){constructor(){super({nameKey:"rules.consecutive-blank-lines.name",descriptionKey:"rules.consecutive-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag],hasSpecialExecutionOrder:!0})}get OptionsClass(){return lm}apply(t,e,i){let r=i.projection(),s=[];for(let a of r.text.matchAll(Zr)){let o=r.editRangeToSource({startIndex:a.index,endIndex:a.index+a[0].length});o&&s.push({...o,value:`
---`,""));if(!r)return i;for(let s of It)if(e.dedupeAliasKey&&Object.keys(r).includes(s)){i=he(i,s,Se(wn(this.getUniqueArray(Ne(Le(i,s)))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ct)if(e.dedupeTagKey&&Object.keys(r).includes(s)){i=he(i,s,Se(An(this.getUniqueArray(Ne(Le(i,s)))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.dedupeArrayKeys){let s=[...It,...Ct,...e.ignoreDedupeArrayKeys];for(let a of Object.keys(r)){if(s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null)continue;let o=Le(i,a),l="single-line";o.includes(`
`)&&(l="multi-line");let c=this.getUniqueArray(Ne(o));i=he(i,a,Se(c,l,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}getYamlValue(t){return typeof t!="string"||t.length<2?t:t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}getUniqueArray(t){if(t==null||typeof t=="string"||t.length<=1)return t;let e=new Set,i=[];for(let r of t){let s=this.getYamlValue(r);e.has(s)||(e.add(s),i.push(r))}return i}get optionBuilders(){return[new V({OptionsClass:Gt,nameKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.description",optionsKey:"dedupeAliasKey"}),new V({OptionsClass:Gt,nameKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.description",optionsKey:"dedupeTagKey"}),new V({OptionsClass:Gt,nameKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.description",optionsKey:"dedupeArrayKeys"}),new Ae({OptionsClass:Gt,nameKey:"rules.dedupe-yaml-array-values.ignore-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.ignore-keys.description",emptyStateKey:"rules.dedupe-yaml-array-values.ignore-keys.empty-state",fieldNamePlaceholderKey:"rules.dedupe-yaml-array-values.ignore-keys.placeholder-text",optionsKey:"ignoreDedupeArrayKeys",trimItemWhitespace:!0,validator:Nt})]}};mm=I(wS),As=O(mm,0,"DedupeYamlArrayValues",kb,As),L(mm,1,As);var Rc=class{constructor(){this.defaultLanguage=""}},vb,pm,LS;vb=[w.register];var ws=class extends(LS=w){constructor(){super({nameKey:"rules.default-language-for-code-fences.name",descriptionKey:"rules.default-language-for-code-fences.description",type:"Content",ruleIgnoreTypes:[y.yaml,y.math,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Rc}apply(t,e,i){return yg(t,e.defaultLanguage,i)}get optionBuilders(){return[new Te({OptionsClass:Rc,nameKey:"rules.default-language-for-code-fences.default-language.name",descriptionKey:"rules.default-language-for-code-fences.default-language.description",optionsKey:"defaultLanguage"})]}};pm=I(LS),ws=O(pm,0,"DefaultLanguageForCodeFences",vb,ws),L(pm,1,ws);var Nc=class{constructor(){this.style="consistent"}},Ab,fm,ES;Ab=[w.register];var xs=class extends(ES=w){constructor(){super({nameKey:"rules.emphasis-style.name",descriptionKey:"rules.emphasis-style.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag,y.inlineMath]})}get OptionsClass(){return Nc}apply(t,e,i){return dl(t,e.style,"emphasis",i)}get optionBuilders(){return[new de({OptionsClass:Nc,nameKey:"rules.emphasis-style.style.name",descriptionKey:"rules.emphasis-style.style.description",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of emphasis is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure * is the emphasis indicator"},{value:"underscore",description:"Makes sure _ is the emphasis indicator"}]})]}};fm=I(ES),xs=O(fm,0,"EmphasisStyle",Ab,xs),L(fm,1,xs);var gm=class{},wb,hm,MS;wb=[w.register];var Ls=class extends(MS=w){constructor(){super({nameKey:"rules.empty-line-around-blockquotes.name",descriptionKey:"rules.empty-line-around-blockquotes.description",type:"Spacing"})}get OptionsClass(){return gm}apply(t,e,i){return dg(t,i)}get optionBuilders(){return[]}};hm=I(MS),Ls=O(hm,0,"EmptyLineAroundBlockquotes",wb,Ls),L(hm,1,Ls);var bm=class{},xb,ym,CS;xb=[w.register];var Ss=class extends(CS=w){constructor(){super({nameKey:"rules.empty-line-around-code-fences.name",descriptionKey:"rules.empty-line-around-code-fences.description",type:"Spacing"})}get OptionsClass(){return bm}apply(t,e,i){return lg(t,i)}get optionBuilders(){return[]}};ym=I(CS),Ss=O(ym,0,"EmptyLineAroundCodeFences",xb,Ss),L(ym,1,Ss);var vm=class{},Lb,km,RS;Lb=[w.register];var Es=class extends(RS=w){constructor(){super({nameKey:"rules.empty-line-around-horizontal-rules.name",descriptionKey:"rules.empty-line-around-horizontal-rules.description",type:"Spacing"})}get OptionsClass(){return vm}apply(t,e,i){return ug(t,i)}get optionBuilders(){return[]}};km=I(RS),Es=O(km,0,"EmptyLineAroundHorizontalRules",Lb,Es),L(km,1,Es);var Sb,Fc;Sb=[w.noSettingControl()];var Lo=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=L(Fc,8,this,2),L(Fc,11,this)}};Fc=I(null),O(Fc,5,"minimumNumberOfDollarSignsToBeAMathBlock",Sb,Lo),oe(Fc,Lo);var Eb,Am,FS;Eb=[w.register];var Ts=class extends(FS=w){constructor(){super({nameKey:"rules.empty-line-around-math-blocks.name",descriptionKey:"rules.empty-line-around-math-blocks.description",type:"Spacing",ruleIgnoreTypes:[y.yaml,y.code]})}get OptionsClass(){return Lo}apply(t,e,i){return cg(t,e.minimumNumberOfDollarSignsToBeAMathBlock,i)}get optionBuilders(){return[]}};Am=I(FS),Ts=O(Am,0,"EmptyLineAroundMathBlock",Eb,Ts),L(Am,1,Ts);var xm=class{},Tb,wm,DS;Tb=[w.register];var Ms=class extends(DS=w){construc
Line truncated
---`,""));if(!r)return i;for(let s of It)if(e.formatAliasKey&&Object.keys(r).includes(s)){i=he(i,s,Se(wn(Ne(Le(i,s))),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ct)if(e.formatTagKey&&Object.keys(r).includes(s)){i=he(i,s,Se(An(Ne(Le(i,s))),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.formatArrayKeys){let s=[...It,...Ct,...e.forceMultiLineArrayStyle,...e.forceSingleLineArrayStyle];for(let a of Object.keys(r))s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null||(i=he(i,a,Se(Ne(Le(i,a)),e.defaultArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)))}for(let s of e.forceSingleLineArrayStyle)Object.keys(r).includes(s)&&(i=he(i,s,Se(Ne(Le(i,s)),"single-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));for(let s of e.forceMultiLineArrayStyle)Object.keys(r).includes(s)&&(i=he(i,s,Se(Ne(Le(i,s)),"multi-line",e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays)));return i})}get optionBuilders(){return[new V({OptionsClass:yt,nameKey:"rules.format-yaml-array.alias-key.name",descriptionKey:"rules.format-yaml-array.alias-key.description",optionsKey:"formatAliasKey"}),new V({OptionsClass:yt,nameKey:"rules.format-yaml-array.tag-key.name",descriptionKey:"rules.format-yaml-array.tag-key.description",optionsKey:"formatTagKey"}),new V({OptionsClass:yt,nameKey:"rules.format-yaml-array.default-array-keys.name",descriptionKey:"rules.format-yaml-array.default-array-keys.description",optionsKey:"formatArrayKeys"}),new Ae({OptionsClass:yt,nameKey:"rules.format-yaml-array.force-single-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-single-line-array-style.description",emptyStateKey:"rules.format-yaml-array.force-single-line-array-style.empty-state",fieldNamePlaceholderKey:"rules.format-yaml-array.force-single-line-array-style.placeholder-text",optionsKey:"forceSingleLineArrayStyle",validator:Nt}),new Ae({OptionsClass:yt,nameKey:"rules.format-yaml-array.force-multi-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-multi-line-array-style.description",emptyStateKey:"rules.format-yaml-array.force-multi-line-array-style.empty-state",fieldNamePlaceholderKey:"rules.format-yaml-array.force-multi-line-array-style.placeholder-text",optionsKey:"forceMultiLineArrayStyle",validator:Nt})]}};Im=I(QS),Ns=O(Im,0,"FormatYamlArray",qb,Ns),L(Im,1,Ns);var _c=class{constructor(){this.startAtH2=!1}},Wb,Rm,ZS;Wb=[w.register];var Fs=class extends(ZS=w){constructor(){super({nameKey:"rules.header-increment.name",descriptionKey:"rules.header-increment.description",type:"Heading",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return _c}apply(t,e,i){let r=i.projection(),s=[],a=0,o=e.startAtH2?2:1,l=[],c=[0,0,0,0,0,0],u=c.length;for(let d of r.text.matchAll(cn)){let m=d.index+d[1].length,p=r.editRangeToSource({startIndex:m,endIndex:m+d[2].length});if(!p)continue;let h=d[2].length;if(h=h<=u?h:u,c[h-1]>=0&&h<a){let f=c.length;for(;l.length!==0&&h<=l[l.length-1];)f=l.pop();l.length===0?f=0:f--;for(let g=c.length-1;g>=f;g--)c[g]=0}if(c[h-1]<=0){let f=a,g=l.length+o;g=g<=u?g:u;for(let b=f;b<h-1;b++)c[b]=g-1;l.push(h),c[h-1]=g}a=h,s.push({...p,value:"#".repeat(c[h-1])})}return J(t,s)}get optionBuilders(){return[new V({OptionsClass:_c,nameKey:"rules.header-increment.start-at-h2.name",descriptionKey:"rules.header-increment.start-at-h2.description",optionsKey:"startAtH2",onChange(t,e,i){let r=Rt["file-name-heading"].options[0];t&&r.getValue(i)&&new Yn(e,"rules.header-increment.start-at-h2.name","rules.file-name-heading.name",async()=>{await r.setValue(!1,i)},async()=>{await Rt["header-increment"].options[1].setValue(!1,i)}).open()}})]}};Rm=I(ZS),Fs=O(Rm,0,"HeaderIncrement",Wb,Fs),L(Rm,1,Fs);var Eo=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},jb,Nm,e1;jb=[w.register];var Bs=class extends(e1=w){constructor(){super({nameKey:"rules.heading-blank-lines.name",descriptionKey:"rules.heading-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink]})}get OptionsClass(){return Eo}apply(t,e,i){let r=i.projection(),s=r.text;e.bottom?(s=s.replace(/^(#+\s.*)/gm,`
`),t}get optionBuilders(){return[]}};Ym=I(a1),_s=O(Ym,0,"LineBreakAtDocumentEnd",$b,_s),L(Ym,1,_s);var Pc=class{constructor(){this.includeBlankLineBetweenFootnotes=!1}},Vb,Km,l1;Vb=[w.register];var Ks=class extends(l1=w){constructor(){super({nameKey:"rules.move-footnotes-to-the-bottom.name",descriptionKey:"rules.move-footnotes-to-the-bottom.description",type:"Footnote",ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.yaml]})}get OptionsClass(){return Pc}apply(t,e,i){return eg(t,e.includeBlankLineBetweenFootnotes,i)}get optionBuilders(){return[new V({OptionsClass:Pc,nameKey:"rules.move-footnotes-to-the-bottom.include-blank-line-between-footnotes.name",descriptionKey:"rules.move-footnotes-to-the-bottom.include-blank-line-between-footnotes.description",optionsKey:"includeBlankLineBetweenFootnotes"})]}};Km=I(l1),Ks=O(Km,0,"MoveFootnotesToTheBottom",Vb,Ks),L(Km,1,Ks);var Qb,Jb,Zb,Xb,ek,rt;ek=[w.noSettingControl()],Xb=[w.noSettingControl()],Zb=[w.noSettingControl()],Jb=[w.noSettingControl()],Qb=[w.noSettingControl()];var Bt=class{constructor(){this.howToHandleFullLineFields="Move and remove";this.howToHandleBracketedFields="Leave in place";this.howToHandleExistingKeys="Skip";this.inlineKeysToIgnore=[];this.defaultEscapeCharacter=L(rt,8,this,'"'),L(rt,11,this);this.tagArrayStyle=L(rt,12,this,"single-line"),L(rt,15,this);this.aliasArrayStyle=L(rt,16,this,"single-line"),L(rt,19,this);this.defaultArrayStyle=L(rt,20,this,"single-line"),L(rt,23,this);this.removeUnnecessaryEscapeCharsForMultiLineArrays=L(rt,24,this,!1),L(rt,27,this)}};rt=I(null),O(rt,5,"defaultEscapeCharacter",ek,Bt),O(rt,5,"tagArrayStyle",Xb,Bt),O(rt,5,"aliasArrayStyle",Zb,Bt),O(rt,5,"defaultArrayStyle",Jb,Bt),O(rt,5,"removeUnnecessaryEscapeCharsForMultiLineArrays",Qb,Bt),oe(rt,Bt);var zc={"[":"]","(":")"},c1=/^[^0-9\w\p{Letter}]*((?:\p{Extended_Pictographic}|\u{200D}|\u{FE0F}|[0-9\p{Letter}\w\s/-])*)[_*~`]*$/u,d1=/^[\p{Letter}_][\p{Letter}\p{Number}_/-]*$/u,tk,zm,k1;tk=[w.register];varzi=classextends(k1=w){constructor(){super({nameKey:"rules.move-inline-fields-to-yaml.name",descriptionKey:"rules.move-inline-fields-to-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[y.code,y.inlineCode,y.math,y.inlineMath,y.html,y.list,y.table,y.obsidianMultiLineComments]})}getOptionsClass(){returnBt}apply(t,e,i){letr=i.combinedWith([y.yaml]),s=this.getInlineFields(t,r,e);if(s.length===0)returnt;leta=newMap;for(lethofs)a.has(h.key)||a.set(h.key,[]),a.get(h.key).push(h);leto=Mi(t)??"",l=[],c=[];for(let[h,f]ofa){letg=u1(h),b=this.getNewValues(f.map(C=>C.value).filter(C=>C!==""),g,e);if(b==null)continue;letk=Le(o,h,!1),x=k==null?null:m1(k),E;if(k==null||e.howToHandleExistingKeys==="Overwrite")E=this.formatValues(b,x,g,e);elseif(e.howToHandleExistingKeys==="Merge into list"){letC=this.getMergeableValues(k);if(C==null)continue;g===Bn?C=C.flatMap(F=>An(F)):g===Ti&&(C=C.flatMap(F=>wn(F)));letM=newSet(C.map(Pm)),N=[];for(letFofb)M.has(Pm(F))||(M.add(Pm(F)),N.push(F));if(c.push(...f),N.length===0)continue;E=this.formatValues([...C,...N],x,g,e),l.push({key:this.formatKey(h,e.defaultEscapeCharacter),value:E});continue}elsecontinue;l.push({key:this.formatKey(h,e.defaultEscapeCharacter),value:E}),c.push(...f)}if(c.length===0)returnt;letu=$t(t);u=Ee(u,h=>{h=h.replace(`---
`,"").replace("---","");for(let f of l)h=he(h,f.key,f.value,!1);return`---
${h}---`});let d=u.length-t.length,m=c.filter(h=>(h.isBracketed?e.howToHandleBracketedFields:e.howToHandleFullLineFields)!=="Move and keep in text"),p=this.getBodyEdits(t,m,e).map(h=>{let f=h.startIndex+d;return h.startIndex===0&&h.endIndex===t.length&&!t.endsWith(`
`,s);a===-1&&(a=t.length);let o=t.substring(s,a);if(o.includes("::")){let l=g1(o);if(l.length>0){if(i.howToHandleBracketedFields!=="Leave in place")for(let c of l){let u=s+c.start,d=s+c.end;c.key===""||i.inlineKeysToIgnore.includes(c.key)||e.isProtected(u,d)||r.push({key:c.key,value:c.value,startIndex:u,endIndex:d,lineStartIndex:s,lineEndIndex:a,isBracketed:!0})}}else{let c=i.howToHandleFullLineFields==="Leave in place"?void 0:y1(o);c!=null&&c.key!==""&&!i.inlineKeysToIgnore.includes(c.key)&&!e.isProtected(s,a)&&r.push({key:c.key,value:c.value,startIndex:s,endIndex:a,lineStartIndex:s,lineEndIndex:a,isBracketed:!1})}}s=a+1}return r}getBodyEdits(t,e,i){let r=[],s=[],a=new Map;for(let c of e)a.has(c.lineStartIndex)||a.set(c.lineStartIndex,[]),a.get(c.lineStartIndex).push(c);for(let[c,u]of a){let d=u[0].lineEndIndex;if(!u[0].isBracketed){s.push({startIndex:c,endIndex:d});continue}let m=[],p=c;for(let f of u.sort((g,b)=>g.startIndex-b.startIndex)){if(i.howToHandleBracketedFields==="Move and keep value in text"&&f.value!==""){m.push({startIndex:f.startIndex,endIndex:f.endIndex,value:f.value}),p=f.endIndex;continue}let g=f.startIndex,b=f.endIndex,k=0;for(;g-k>p&&Gb(t.charAt(g-k-1));)k++;if(k>0||g===c)for(;b<d&&Gb(t.charAt(b));)b++;b===d&&(g-=k),m.push({startIndex:g,endIndex:b,value:""}),p=b}J(t.substring(c,d),m.map(f=>({startIndex:f.startIndex-c,endIndex:f.endIndex-c,value:f.value}))).trim()===""?s.push({startIndex:c,endIndex:d}):r.push(...m)}s.sort((c,u)=>c.startIndex-u.startIndex);let o=[];for(let c of s){let u=Math.min(c.endIndex+1,t.length),d=o[o.length-1];d&&d.endIndex===c.startIndex?d.endIndex=u:o.push({startIndex:c.startIndex,endIndex:u,value:""})}let l=o[o.length-1];return l&&l.endIndex===t.length&&l.startIndex>0&&!t.endsWith(`
`)&&l.startIndex--,[...r,...o]}escapeValue(t,e){let i=p1(t);if(i!=null){if(nk(t)===i)return t;t=i}try{let r=kn(t,{logLevel:"error"});if(typeof r=="string"&&r===t||typeof r=="number"||typeof r=="boolean")return t}catch{}return nt(t,e,!0)}formatKey(t,e){return d1.test(t)&&kn(t)===t?t:nt(t,e,!0)}getNewValues(t,e,i){if(e===Bn){let r=t.flatMap(s=>An(s)).map(s=>s.replace(/^#/,"")).filter(s=>s!=="");return r.some(s=>!Ec(s)[0])?null:r}else e===Ti&&(t=t.flatMap(r=>wn(r)));return t.map(r=>this.escapeValue(r,i.defaultEscapeCharacter))}formatValues(t,e,i,r){if(i===Bn)return Se(t,r.tagArrayStyle,r.defaultEscapeCharacter,r.removeUnnecessaryEscapeCharsForMultiLineArrays);if(i===Ti)return Se(t,r.aliasArrayStyle,r.defaultEscapeCharacter,r.removeUnnecessaryEscapeCharsForMultiLineArrays,!0);let s=r.defaultEscapeCharacter;if(e==null){if(t.length===0)return"";if(t.length===1)return" "+t[0];e=r.defaultArrayStyle}return Se(t,e,s,!1)}getMergeableValues(t){let e=t.trim();if(e==="")return[];if(/^[|>]/.test(e)||/(^|\s)#/.test(e))return null;let i;try{i=kn(t,{logLevel:"error"})}catch{return null}if(i!=null&&typeof i=="object"&&(!Array.isArray(i)||i.some(s=>s!=null&&typeof s=="object")))return null;let r=Ne(t);return r==null?[]:typeof r=="string"?[r]:r}get optionBuilders(){return[new de({OptionsClass:Bt,nameKey:"rules.move-inline-fields-to-yaml.how-to-handle-full-line-fields.name",descriptionKey:"rules.move-inline-fields-to-yaml.how-to-handle-full-line-fields.description",optionsKey:"howToHandleFullLineFields",records:[{value:"Leave in place",description:"Does not move full-line fields like `key::value`"},{value:"Move and keep in text",description:"Adds full-line fields to the YAML frontmatter and leaves their lines as they are"},{value:"Move and remove",description:"Moves full-line fields to the YAML frontmatter and removes their lines"}]}),new de({OptionsClass:Bt,nameKey:"rules.move-inline-fields-to-yaml.how-to-handle-bracketed-fields.name",descriptionKey:"rules.move-inline-fields-to-yaml.how-to-handle-bracketed-fields.description",optionsKey:"howToHandleBracketedFields",records:[{value:"Leave in place",description:"Does not move bracketed fields like `[key::value]` and `(key::value)`"},{value:"Move and keep in text",description:"Adds bracketed fields to the YAML frontmatter and leaves them in the text as they are"},{value:"Move and keep value in text",description:"Moves bracketed fields to the YAML frontmatter and replaces them with their value"},{value:"Move and remove",description:"Moves bracketed fields to the YAML frontmatter and removes them from the body, removing the line if only whitespace is left"}]}),new de({OptionsClass:Bt,nameKey:"rules.move-inline-fields-to-yaml.how-to-handle-existing-keys.name",descriptionKey:"rules.move-inline-fields-to-yaml.how-to-handle-existing-keys.description",optionsKey:"howToHandleExistingKeys",records:[{value:"Skip",description:"Leaves the fields in the body and the YAML frontmatter value as is"},{value:"Merge into list",description:"Adds the field values to the YAML frontmatter value, turning it into a list"},{value:"Overwrite",description:"Replaces the YAML frontmatter value with the field values"}]}),new Ae({OptionsClass:Bt,nameKey:"rules.move-inline-fields-to-yaml.inline-keys-to-ignore.name",descriptionKey:"rules.move-inline-fields-to-yaml.inline-keys-to-ignore.description",emptyStateKey:"rules.move-inline-fields-to-yaml.inline-keys-to-ignore.empty-state",fieldNamePlaceholderKey:"rules.move-inline-fields-to-yaml.inline-keys-to-ignore.placeholder-text",optionsKey:"inlineKeysToIgnore",validator:Nt})]}};zm=I(k1),zi=O(zm,0,"MoveInlineFieldsToYaml",tk,zi),L(zm,1,zi);function u1(n){return Ct.includes(n)?Bn:It.includes(n)?Ti:null}function m1(n){let t=n.trim();return t.startsWith("[")?"single-line":t.startsWith("-")&&n.startsWith(`
`,"").replace("---","");let m=[],p=Bn;for(let g of Ct){let b=Le(d,g);if(b!=null){m=An(Ne(b)),p=g;break}}let h=new Set;if(typeof m=="string")h.add(m),m=[m];else if(m!=null)for(let g of m)h.add(g);else m=[];for(let g of o){let b=g.trim().substring(1);!h.has(b)&&!e.tagsToIgnore.includes(b)&&(h.add(b),m.push(b))}return`---
${he(d,p,Se(m,e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}---`});let l=[],c=t.length-r.text.length;if(e.howToHandleExistingTags!=="Nothing")for(let d of a){if(e.tagsToIgnore.includes(d[2].substring(1)))continue;let m=s.editRangeToSource({startIndex:d.index,endIndex:d.index+d[0].length}),p=r.sourceToProjection(m.startIndex)+c,h=r.sourceToProjection(m.endIndex)+c;e.howToHandleExistingTags==="Remove hashtag"?(p+=d[1].length,l.push({startIndex:p,endIndex:p+1,value:""})):(d.index===0&&d[1]===""&&c>0&&p--,l.push({startIndex:p,endIndex:h,value:""}))}t=J(t,l),t=t.replace(/(\n---)( |\t)+/,"$1");let u=[];for(let d of Ue(r.text,t)){let m=r.editRangeToSource(d);m&&u.push({...m,value:d.value})}return J(r.source,u)}get optionBuilders(){return[new de({OptionsClass:ii,nameKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.name",descriptionKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.description",optionsKey:"howToHandleExistingTags",records:[{value:"Nothing",description:"Leaves tags in the body of the file alone"},{value:"Remove hashtag",description:"Removes `#` from tags in content body after moving them to the YAML frontmatter"},{value:"Remove whole tag",description:"Removes the whole tag in content body after moving them to the YAML frontmatter. _Note that this removes the first space prior to the tag as well_"}]}),new Ae({OptionsClass:ii,nameKey:"rules.move-tags-to-yaml.tags-to-ignore.name",descriptionKey:"rules.move-tags-to-yaml.tags-to-ignore.description",emptyStateKey:"rules.move-tags-to-yaml.tags-to-ignore.empty-state",fieldNamePlaceholderKey:"rules.move-tags-to-yaml.tags-to-ignore.placeholder-text",optionsKey:"tagsToIgnore",validator:Ec})]}};Wm=I(x1),Ps=O(Wm,0,"MoveTagsToYaml",lk,Ps),L(Wm,1,Ps);var jc=class{constructor(){this.noBareURIs=!1}},Wc="'\"\u2018\u2019\u201C\u201D`[]",L1=["http","ftp","https","smtp"],ck,jm,E1;ck=[w.register];var zs=class extends(E1=w){constructor(){super({nameKey:"rules.no-bare-urls.name",descriptionKey:"rules.no-bare-urls.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag,y.image,y.inlineCode,y.anchorTag,y.html]})}get OptionsClass(){return jc}apply(t,e,i){let r=[],s=bg(t).toReversed();if(s){let a=[];for(let o of s)a.push({match:t.substring(o.start.offset,o.end.offset),urlStart:o.start.offset,urlEnd:o.end.offset});r.push(...this.handleMatches(t,a,!1,i))}if(e.noBareURIs){let a=t.match(Og);if(a){let o=0,l=[];for(let u of a){let d=u,m=t.indexOf(d,o),p=m+d.length;o=p,l.push({match:d,urlStart:m,urlEnd:p})}let c=new Et(r);for(let u of this.handleMatches(t,l,!0,i))c.isProtected(u.startIndex,u.endIndex)||r.push(u)}}return J(t,r)}handleMatches(t,e,i,r){let s=[];for(let a of e){let o=a.match,l=a.urlStart,c=a.urlEnd;if(r.isProtected(l,c))continue;o.charAt(0)==="<"&&(o=o.substring(1),l++),o.charAt(o.length-1)===">"&&(o=o.substring(0,o.length-1),c--);let u=l===0?void 0:Hn(t,r,l-1,l).slice(-1),d=c>=t.length?void 0:Hn(t,r,c,c+1).charAt(0),m=Tt(o,"(");if(m!=0&&m!=Tt(o,")")&&d==")"?(o+=d,c++,d=c>=t.length?void 0:Hn(t,r,c,c+1).charAt(0)):m==0&&o.endsWith(")")&&(d=")",c--,o=o.substring(0,o.length-1)),!this.skipMatch(u,d,o,i)){if(u!=null&&u==="<"&&d!=null&&d===">"){let p=l-1;for(;p>0&&t.charAt(p-1)==="<";)p--;let h=c;for(;h<t.length-1&&t.charAt(h+1)===">";)h++;r.isProtected(p,h+1)||this.addReplacement(s,{startIndex:p,endIndex:h+1,value:"<"+o+">"});continue}r.isProtected(l,l+o.length)||this.addReplacement(s,{startIndex:l,endIndex:l+o.length,value:"<"+o+">"})}}return s}addReplacement(t,e){let i=t[t.length-1];i&&e.startIndex<i.endIndex||t.push(e)}skipMatch(t,e,i,r){let s=t!=null&&Wc.includes(t)||Wc.includes(i.charAt(0)),a=e!=null&&Wc.includes(e)||Wc.includes(i.charAt(i.length-1));return s&&a?!0:r?L1.includes(i.substring(0,i.indexOf(":"))):!1}get optionBuilders(){return[new V({OptionsClass:jc,nameKey:"rules.no-bare-urls.no-bare-uris.name",descriptionKey:"rules.no-bare-urls.no-bare-uris.description",optionsKey:"noBareURIs"})]}};jm=I(E1),zs=O(jm,0,"NoBareUrls",ck,zs),L(jm,1,zs);var Ws=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},dk,Um,M1;dk=[w.register];var qs=class extends(M1=w){constructor(){super({nameKey:"rules.ordered-list-style.name",descriptionKey:"rules.ordered-list-style.description",type:"Content",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.tag]})}get OptionsClass(){return Ws}apply(t,e,i){return mg(t,e.numberStyle,e.listEndStyle,e.preserveStart,i)}get optionBuilders(){return[new de({OptionsClass:Ws,nameKey:"rules.ordered-list-style.number-style.name",descriptionKey:"rules.ordered-list-style.number-style.description",optionsKey:"numberStyle",records:[{value:"ascending",description:"Makessureorderedlistitemsareascending(i.e.1,2,3,etc.)"},{value:"lazy",description:"Makessureorderedlistitemindicatorsallarethesame"},{value:"preserve",description:"Preservesorderedlistitemindicatorsastheyare"}]}),new de({OptionsClass:Ws,nameKey:"rules.ordered-list-style.listLine truncated
---`,""));if(!r)return i;for(let s of It)if(e.sortAliasKey&&Object.keys(r).includes(s)){i=he(i,s,Se(wn(this.sortArray(Ne(Le(i,s)),e.sortOrder)),e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let s of Ct)if(e.sortTagKey&&Object.keys(r).includes(s)){i=he(i,s,Se(An(this.sortArray(Ne(Le(i,s)),e.sortOrder)),e.tagArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(e.sortArrayKeys){let s=[...It,...Ct,...e.ignoreSortArrayKeys];for(let a of Object.keys(r)){if(s.includes(a)||!Array.isArray(r[a])||r[a].length!==0&&typeof r[a][0]=="object"&&r[a][0]!==null)continue;let o=Le(i,a),l="single-line";o.includes(`
`)&&(l="multi-line");let c=this.sortArray(Ne(o),e.sortOrder);i=he(i,a,Se(c,l,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return i})}sortArray(t,e){return t==null||typeof t=="string"||t.length<=1||(t.sort(function(i,r){let s=i.toLowerCase().localeCompare(r.toLowerCase());return s===0?i.localeCompare(r):s}),e==="Ascending Alphabetical")||t.reverse(),t}get optionBuilders(){return[new V({OptionsClass:Yt,nameKey:"rules.sort-yaml-array-values.sort-alias-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-alias-key.description",optionsKey:"sortAliasKey"}),new V({OptionsClass:Yt,nameKey:"rules.sort-yaml-array-values.sort-tag-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-tag-key.description",optionsKey:"sortTagKey"}),new V({OptionsClass:Yt,nameKey:"rules.sort-yaml-array-values.sort-array-keys.name",descriptionKey:"rules.sort-yaml-array-values.sort-array-keys.description",optionsKey:"sortArrayKeys"}),new Ae({OptionsClass:Yt,nameKey:"rules.sort-yaml-array-values.ignore-keys.name",descriptionKey:"rules.sort-yaml-array-values.ignore-keys.description",emptyStateKey:"rules.sort-yaml-array-values.ignore-keys.empty-state",fieldNamePlaceholderKey:"rules.sort-yaml-array-values.ignore-keys.placeholder-text",optionsKey:"ignoreSortArrayKeys",validator:Nt}),new de({OptionsClass:Yt,nameKey:"rules.sort-yaml-array-values.sort-order.name",descriptionKey:"rules.sort-yaml-array-values.sort-order.description",optionsKey:"sortOrder",records:[{value:"Ascending Alphabetical",description:"Sorts the array values from a to z"},{value:"Descending Alphabetical",description:"Sorts the array values from z to a"}]})]}};Tp=I(b0),aa=O(Tp,0,"SortYamlArrayValues",Pk,aa),L(Tp,1,aa);var Op=class{},zk,Mp,v0;zk=[w.register];var oa=class extends(v0=w){constructor(){super({nameKey:"rules.space-after-list-markers.name",descriptionKey:"rules.space-after-list-markers.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.math,y.yaml,y.link,y.wikiLink,y.tag]})}get OptionsClass(){return Op}apply(t,e,i){let r={editRange:(a,o)=>({startIndex:o+a[1].length,endIndex:o+a[0].length,value:" "}),guardRange:(a,o)=>({startIndex:o,endIndex:o+a[0].length})},s=le(t,/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,i,r);return s.push(...le(t,/^(\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,i,r)),J(t,s)}get optionBuilders(){return[]}};Mp=I(v0),oa=O(Mp,0,"SpaceAfterListMarkers",zk,oa),L(Mp,1,oa);var Oo=class{constructor(){this.englishNonLetterCharactersAfterCJKCharacters=`-+'"([\xA5$`;this.englishNonLetterCharactersBeforeCJKCharacters=`-+;:'"\xB0%$)]`}},qk,Cp,w0;qk=[w.register];var la=class extends(w0=w){constructor(){super({nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.description",type:"Spacing",ruleIgnoreTypes:[y.code,y.inlineCode,y.yaml,y.image,y.link,y.wikiLink,y.tag,y.math,y.inlineMath,y.html]})}get OptionsClass(){return Oo}apply(t,e,i){let r=this.buildHeadRegex(e.englishNonLetterCharactersAfterCJKCharacters),s=this.buildTailRegex(e.englishNonLetterCharactersBeforeCJKCharacters),a=on.for(t).protectedRangesFor([y.link,y.inlineMath,y.inlineCode,y.wikiLink]),o=(m,p,h)=>{let f=[];for(let g of[r,s])f.push(...le(m,g,h,{editRange:(b,k)=>({startIndex:k+b[1].length,endIndex:k+b[0].length-b[3].length,value:""}),guardRange:(b,k)=>({startIndex:k,endIndex:k+b[0].length})},p));return f},l=o(t,0,i.combinedWith([y.italics,y.bold])),c=/[\p{sc=Han}\p{sc=Katakana}\p{sc=Hiragana}\p{sc=Hangul}]( *)$/u,u=/^( *)[\p{sc=Han}\p{sc=Katakana}\p{sc=Hiragana}\p{sc=Hangul}]/u;for(let m of a.ranges){let p=m.startIndex;for(;p>0&&t.charAt(p-1)==="";)p--;let h=t.substring(Math.max(0,p-2),m.startIndex).match(c);h&&!i.isProtected(m.startIndex-h[0].length,m.startIndex)&&l.push({startIndex:p,endIndex:m.startIndex,value:""});let f=m.endIndex;for(;f<t.length&&t.charAt(f)==="";)f++;let g=t.substring(m.endIndex,f+2).match(u);g&&!i.isProtected(m.endIndex,m.endIndex+g[0].length)&&l.push({startIndex:m.endIndex,endIndex:f,value:""})}l.push(...sg(t,o,i)),l.push(...ag(t,o,i)),l.sort((m,p)=>m.startIndex-p.startIndex||m.endIndex-p.endIndex);let d=l.filter((m,p)=>{let h=l[p-1];return!h||m.startIndex!==h.startIndex||m.endIndex!==h.endIndex});return ke(t,d)}buildHeadRegex(t){t&&t!==""&&(t=t.replaceAll(/\s/g,""));let e="";return t&&t.length!=0&&(e=`|[${Mt(t)}]`),new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${e}|\\*[^*])`,"gmu")}buildTailRegex(t){t&&t!==""&&(t=t.replaceAll(/\s/g,""));let e="";return t&&t.length!=0&&(e=`|[${Mt(t)}]`),new RegExp(`(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${e}|[^*]\\*)( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu")}get optionBuilders(){return[new Te({OptionsClass:Oo,nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-engLine truncated
${i.dateModifiedKey}:${c}`,d=o.test(t);if(d){let m=this.getYAMLTimestampString(t,o,i.dateModifiedKey),p=(0,Qt.moment)(m,i.format,i.locale);(e||p==null||!p.isValid()||p.format(i.format)!=m||i.dateModifiedSourceOfTruth!="user or Linter edits"&&this.getTimeDifferenceInSeconds(p,l,i)>5)&&(t=t.replace(o,ft(u)+`
`))}else if(a.test(t))t=t.replace(a,ft(u)+`
`);else if(!d){let m=t.indexOf(`
---`);t=Ia(t,m,u)}return t}parseValueToCurrentFormatIfPossible(t,e,i,r){if(t==null)return null;let s=r?Qt.moment.utc(t,e,i,!0):(0,Qt.moment)(t,e,i,!0);if(s!=null&&s.isValid())return s;let a=(0,Pp.default)(t);if(a!=null){let o=r?Qt.moment.utc(t,a):(0,Qt.moment)(t,a);o.locale(i);let l=r?o.utc().format(e):o.format(e);return r?Qt.moment.utc(l,e,i,!0):(0,Qt.moment)(l,e,i,!0)}return null}getYAMLTimestampString(t,e,i){return t.match(e)[0].replace(i+":","").trim()}getTimeDifferenceInSeconds(t,e,i){let r=(0,Qt.moment)(e.format(i.format),i.format,i.locale,!0);return Math.abs(t.diff(r,"seconds"))}get optionBuilders(){return[new V({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created.name",descriptionKey:"rules.yaml-timestamp.date-created.description",optionsKey:"dateCreated"}),new Te({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created-key.name",descriptionKey:"rules.yaml-timestamp.date-created-key.description",optionsKey:"dateCreatedKey"}),new de({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-created-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-created-source-of-truth.description",optionsKey:"dateCreatedSourceOfTruth",records:[{value:"file system",description:"The file system date created value is used to set the value of date created in the frontmatter"},{value:"frontmatter",description:"When a value is present in the frontmatter for date created, this value is used as the value for the date created"}]}),new V({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified.name",descriptionKey:"rules.yaml-timestamp.date-modified.description",optionsKey:"dateModified"}),new Te({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified-key.name",descriptionKey:"rules.yaml-timestamp.date-modified-key.description",optionsKey:"dateModifiedKey"}),new de({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.date-modified-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-modified-source-of-truth.description",optionsKey:"dateModifiedSourceOfTruth",records:[{value:"file system",description:"The file system date modified value is used to set the value of date modified in the frontmatter"},{value:"user or Linter edits",description:"When a value is present in the frontmatter for date modified, date modified is kept as is unless the Linter makes a change to a note or the user edits a note with the setting `{NAME}` set to something other than `{NEVER}`.".replace("{NAME}",A("rules.yaml-timestamp.update-on-file-contents-updated.name")).replace("{NEVER}",A("enums.never"))}]}),new xc({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.format.name",descriptionKey:"rules.yaml-timestamp.format.description",optionsKey:"format"}),new V({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.convert-to-utc.name",descriptionKey:"rules.yaml-timestamp.convert-to-utc.description",optionsKey:"convertToUTC"}),new de({OptionsClass:Pe,nameKey:"rules.yaml-timestamp.update-on-file-contents-updated.name",descriptionKey:"rules.yaml-timestamp.update-on-file-contents-updated.description",optionsKey:"timestampUpdateOnFileContentUpdated",records:[{value:"never",description:"never"},{value:"after 5 seconds",description:"after 5 seconds"},{value:"after 10 seconds",description:"after 10 seconds"},{value:"after 15 seconds",description:"after 15 seconds"},{value:"after 30 seconds",description:"after 30 seconds"},{value:"after 1 minute",description:"after 1 minute"}]})]}};Kp=I(zE),zn=O(Kp,0,"YamlTimestamp",hv,zn),L(Kp,1,zn);var gv,yv,bv,kv,_t;kv=[w.noSettingControl()],bv=[w.noSettingControl()],yv=[w.noSettingControl()],gv=[w.noSettingControl()];var Kt=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.removeAliasKeyWhenEmpty=!0;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasHelperKey=ju;this.aliasArrayStyle=L(_t,8,this,"multi-line"),L(_t,11,this);this.fileName=L(_t,12,this),L(_t,15,this);this.defaultEscapeCharacter=L(_t,16,this,'"'),L(_t,19,this);this.removeUnnecessaryEscapeCharsForMultiLineArrays=L(_t,20,this,!1),L(_t,23,this)}};_t=I(null),O(_t,5,"aliasArrayStyle",kv,Kt),O(_t,5,"fileName",bv,Kt),O(_t,5,"defaultEscapeCharacter",yv,Kt),O(_t,5,"removeUnnecessaryEscapeCharsForMultiLineArrays",gv,Kt),oe(_t,Kt);var vv,zp,jE;vv=[w.register];var Zi=class extends(jE=w){constructor(){super({nameKey:"rules.yaml-title-alias.name",descriptionKey:"rules.yaml-title-alias.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Kt}apply(t,e,i){let[r,s]=this.getTitleInfo(t,e.fileName,e.aliasArrayStyle,e.defaultEscapeCharacter,i);t=$t(t);let a,o=t.match(Ze)[1],l=!e.keepAliasThatMatchesTheFilename&&r===e.fileName,c=o.replace(`---
`,"").replace(`
---`,""),u=dt(o),d=e.aliasHelperKey??ju;d.endsWith(":")&&(d=d.substring(0,d.length-1)),a=u[d]??null,a!=null&&(a=a+"",a=nt(a,e.defaultEscapeCharacter,this.forceEscape(a,e.aliasArrayStyle)));let m=null,p=Object.keys(u);for(let g of It)if(p.includes(g)){m=g;break}if(m!=null){let g=Le(c,m),b="multi-line",k=g==="",x=!1;!g.includes(`
`)&&!(g==="[]"&&e.aliasArrayStyle==="multi-line")&&(g.match(/^\[.*\]/)===null?(b="single string to single-line",x=!0):b="single-line");let E=wn(Ne(g)),C=this.getNewAliasValue(E,l,s,a);C===""?e.removeAliasKeyWhenEmpty&&(c=po(c,m)):e.preserveExistingAliasesSectionStyle?!k&&(x&&s==C||!x||E==C)?c=he(c,m,Se(C,b,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):c=he(c,m,Se(C,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):c=he(c,m,Se(C,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0))}else l||(c=he(c,Ti,Se(s,e.aliasArrayStyle,e.defaultEscapeCharacter,e.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)));!e.useYamlKeyToKeepTrackOfOldFilenameOrHeading||l?c=po(c,d):c=he(c,d,`${s}`);let h=`---
${e.titleKey}:${r}`)}return s})}getFirstH1Header(t,e){return yl(t,e.combinedWith([y.code,y.math,y.yaml,y.tag]))}get optionBuilders(){return[new Te({OptionsClass:Xi,nameKey:"rules.yaml-title.title-key.name",descriptionKey:"rules.yaml-title.title-key.description",optionsKey:"titleKey"}),new de({OptionsClass:Xi,nameKey:"rules.yaml-title.mode.name",descriptionKey:"rules.yaml-title.mode.description",optionsKey:"mode",records:[{value:"first-h1-or-filename-if-h1-missing",description:"Uses the first H1 in the file or the filename of the file if there is not H1"},{value:"filename",description:"Uses the filename as the title"},{value:"first-h1",description:"Uses the first H1 in the file as the title"}]})]}};qp=I(HE),er=O(qp,0,"YamlTitle",xv,er),L(qp,1,er);var $E=`<svgxmlns="http://www.w3.org/2000/svg"width="100"height="100"viewBox="0 0 24 24"fill="none"stroke="currentColor"stroke-width="2"stroke-linecap="round"stroke-linejoin="round"class="lucide lucide-file-cog">
"description":"Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
| AdGuard Home | `services.adguardhome`; checked YAML and mutable or immutable state | Native block lists, rules, and per-client policy | Native | Native | Upstream and client-facing encrypted DNS | Direct migration with the closest state and feature match. UI state conflicts with fully declarative operation unless configuration is immutable. |
| Blocky | `services.blocky`; checked declarative YAML | Native lists, allow lists, rewrites, and per-client groups | No UI; REST API and metrics only | No | Encrypted upstreams and client-facing DoH, DoT, and DoQ | Strong Git-managed configuration and low operational surface. It lacks an interactive administration interface and DHCP. |
| Pi-hole | `services.pihole-ftl` plus `services.pihole-web`; declarative TOML, lists, and dashboard | Native gravity lists, allow lists, regex rules, and groups | Native | Native | Use a companion for encrypted upstream DNS | Familiar filtering product with a dashboard. The migration changes product data and uses more coupled services. |
| Technitium DNS Server | `services.technitium-dns-server`; service and firewall options only | Native block lists and DNS applications | Native | Native | Upstream and client-facing encrypted DNS | Broadest DNS feature set, including authoritative DNS. NixOS does not expose its runtime configuration declaratively. |
| Unbound | `services.unbound`; structured server and free-form settings | Local zones or response-policy zones require custom policy management | No | No | DNS-over-TLS support | Mature validating recursive resolver. Filtering and user operations require separate design. |
| dnscrypt-proxy | `services.dnscrypt-proxy`; declarative TOML | Local block and allow rules, without a list-management UI | No | No | Encrypted upstream DNS, including DNSCrypt and DoH | Strong upstream privacy and resolver selection. It is not a full network filtering appliance. |
| Knot Resolver | `services.kresd`; structured listener settings and extra Lua | Custom policy modules | No | No | Client-facing DoH and TLS listeners | Flexible high-performance recursive resolver. Filtering requires resolver expertise and custom policy. |
| SmartDNS | `services.smartdns`; free-form settings | Domain and address rules | No NixOS-integrated UI | No | Encrypted upstream and client-facing DNS | Optimizes upstream selection and latency. It offers less complete filtering management than dedicated blockers. |
`Native` means that the product provides the feature without a companion service.
## Decision tree
- **D1 — DNS service product** [settled]
- Retain AdGuard Home on Pikachu.
- Constraint: Preserve AdGuard Home as the DNS service product.
- **D2A — AdGuard Home role** [settled]
- Provides DNS filtering and resolution only.
- Constraint: The existing DHCP provider continues to assign addresses and DHCP options.
- **D3A — Execution placement** [settled]
- Runs in a dedicated guest on Pikachu's existing VLAN 20.
- Constraint: Isolate AdGuard Home from the Pikachu host.
- **D4A — Guest network identity** [settled]
- Reuses MAC `bc:24:11:91:60:bf` and address `10.23.20.33` on VLAN 20.
- Constraint: Stop the Proxmox container before the guest starts.
- **D5A — Network exposure** [settled]
- Listens on all guest addresses at port 53.
- Accepts requests from every reachable internal device.
- **D6A — Resolver policy** [settled]
- Preserves the existing upstream resolvers and parallel resolver mode.
- Preserves disabled DNSSEC and the three local rewrites.
- **D7A — Configuration authority** [settled]
- Uses fully declarative Nix configuration.
- Constraint: Set `services.adguardhome.mutableSettings = false`.
- Constraint: Declare `dns.bootstrap_dns` as a list.
- Constraint: Web UI changes do not persist.
- Constraint: Match existing service behavior except for the administrator password.
- **D8A — Migration data** [settled]
- Migrate functional DNS configuration only.
- Constraint: Do not migrate query history or statistics.
- **D9A — Operations** [settled]
- Declares a newly generated bcrypt verifier in Nix.
- Constraint: Keep the plaintext password outside the repository and Nix store.
- Constraint: The verifier is readable from the Nix store.
- **D10A — Cutover and rollback** [settled]
- Uses a planned atomic cutover with rollback.
- Stop the Proxmox container before starting the guest.
- Validate the guest before restoring the Proxmox container during rollback.
- **D11A — Runtime-state backup** [settled]
- Do not back up rebuildable AdGuard Home runtime state.
- **D12A — Monitoring** [settled]
- Do not add DNS availability monitoring.
- **D13A — Upgrade ownership** [settled]
- The normal flake update and explicit NixOS rebuild workflow owns upgrades.
- Replace AdGuard Home. [not selected]
- **D2B — Replacement product** [not applicable]
- Choose Blocky, Pi-hole, Technitium, or a composed resolver.
The Hyprland compositor config uses Home Manager's hyprlang output.
Hyprland deprecates hyprlang for the main compositor config.
The repository needs to generate a Lua config without changing desktop behavior.
## Solution
Keep the config owned by Nix and Home Manager.
Switch the Hyprland Home Manager config output to Lua.
Convert only the settings whose shape changes under Lua.
This is not a desktop redesign.
The change preserves the current monitors, binds, window rules, environment variables, and UWSM startup.
## User Stories
1. As the operator, I want Hyprland to load `hyprland.lua`, so that startup no longer warns about hyprlang deprecation.
2. As the operator, I want existing keyboard binds to keep working, so that the desktop behavior stays unchanged.
3. As the operator, I want host monitor layout to stay unchanged, so that the physical display setup does not move.
4. As the operator, I want session environment variables to stay in the compositor config, so that Wayland and cursor behavior stays unchanged.
5. As the operator, I want auxiliary module binds to keep working, so that launcher, lock, screenshot, clipboard, notifications, and recording flows stay usable.
## Implementation Decisions
1. Use Home Manager's Lua config generator.
Set the Hyprland config type to Lua and keep package ownership unchanged.
2. Keep ordinary compositor options declarative in Nix.
Move input, general, decoration, xwayland, animation, and layout settings into the Lua config structure.
3. Remove hyprlang-only variables from generated config.
Keep modifier and terminal values as Nix locals or helper inputs.
4. Add minimal local helpers for Lua calls.
Use helpers only for repeated bind, dispatcher, command, environment, and rule shapes.
5. Convert all bind strings to Lua bind call data.
Preserve key combinations, dispatchers, commands, repeat behavior, and locked-session behavior.
6. Convert contributed binds in their owning modules.
Keep each bind near the module that owns the tool it launches.
7. Convert monitor strings to Lua monitor records.
Preserve output names, modes, positions, scale values, and rotation.
8. Convert the screenshot window rule to the Lua rule shape.
Preserve the Satty class matcher and floating behavior.
9. Convert environment strings to Lua environment calls.
Preserve the Wayland flag and cursor variables.
10. Delete or update comments that describe hyprlang syntax.
Keep comments that explain behavior or non-obvious invariants.
## Testing Decisions
1. Run the repository Nix formatting and style checks for modified Nix files.
2. Evaluate or build the affected host configuration.
This proves Home Manager accepts the Lua settings structure.
3. Confirm the generated config file uses Lua.
The expected output is `hyprland.lua`, not `hyprland.conf`.
4. Verify Hyprland accepts the generated Lua config.
Use Hyprland config verification when the installed build supports it.
Otherwise reload the compositor and inspect errors.
5. Smoke test the changed desktop surface.
Test one bind from each source area after reload.
6. Check the explicit monitor layout on the host that declares it.
Confirm resolution, position, scale, and rotation stayed unchanged.
## Out of Scope
- Do not split the config into Lua modules.
- Do not hand-write a full Lua config.
- Do not add new Hyprland behavior.
- Do not change UWSM startup.
- Do not redesign binds, monitor layout, or visual settings.
- Do not change hyprlock, hypridle, waybar, mako, or rofi settings beyond their Hyprland binds.
## Further Notes
Home Manager documents `configType = "lua"` for Hyprland.
It maps settings to `hl.*` calls.
It supports `_args` for multi-argument calls.
It supports raw Lua expressions with `lib.generators.mkLuaInline`.
The riskiest parts are binds, monitor declarations, and window rules.
Those parts changed shape more than scalar config sections.
Assumption: the pinned Home Manager input contains the documented Lua Hyprland generator.
- **Work phases:** Deploy the guest, update the package, then import selected ROMs.
- **Guest data directory:** Use RomM's default `/var/lib/romm`.
- **Host application data:** Mount `/pikachu/data/romm` at `/var/lib/romm`.
- **ROM library:** Mount it separately at `/var/lib/romm/library`.
- **Storage classification:** Preserve the distinction between application data and browsable media.
- **User assets:** Mount `/pikachu/media/games/emulation/users` at `/var/lib/romm/assets/users` to expose saves, states, user-uploaded screenshots, and profile avatars through Copyparty.
- **ROM paths:** Mount `/pikachu/media/games/emulation/roms` and `/pikachu/media/games/emulation/bios` at the corresponding children of `/var/lib/romm/library`.
- **Guest networking:** Follow the standard guest-provisioning protocol.
- **Public route:** Retain the old installation's public domain.
- **Metadata providers:** Configure IGDB, ScreenScraper, and SteamGridDB in both package phases.
- **Metadata priority:** Use RomM's default metadata and artwork priority.
- **RomM configuration:** Manage the required 5.4.0 `config.yml` declaratively with Nix.
- **Scan region and language priority:** Use RomM's defaults.
- **Initial authentication:** Use RomM's built-in accounts.
- **OIDC follow-up:** Track it in [[0013-oidc-provider]].
- **ROM migration:** The operator manually selects and copies ROMs after deployment.
- **Guest limits:** Cap the guest at `4G` memory, `200%` CPU, and `512` tasks.
- **Library watcher:** Enable the filesystem watcher.
- **PostgreSQL:** Mount `/pikachu/data/romm/postgresql` at `/var/lib/postgresql`.
- **Redis:** Mount `/pikachu/data/romm/redis` at `/var/lib/redis-romm`.
- **Browser save synchronization:** Disable it in 5.4.0 until browser emulation is needed.
## Frontier
No in-scope decisions remain.
## Next question
None. Present the settled design for confirmation before implementation.
Write a TODO CLI that enforces the task workflow in this vault deterministically. This allows agents to participate in task management with minimal cost instead of relying on markdown generation and parsing arbitrary metadata while maintaining human readability.
One of the biggest patterns I noticed when working on Rust projects in the monorepo was that they were mostly CLI tools. I found myself doing the same boilerplate over and over again.
I think much like Google, having a function that handles sensible defaults would be a good idea.
But also, maybe a Rust project set up to avoid the common pitfalls?
The current plugin I use for Markdown rendering in Vim has some issues, but most importantly it doesn't have full feature parity with Obsidian. I think from the top of my head, wikilinks can't be followed for example.
Most of the time, games detect the HDMI monitor as the main monitor and show the wrong resolution options and/or have display issues.
The HDMI monitor is a vertical monitor with 1080x1920 resolution so that leads to a lot of problems I can't fix from within the game because it gets cut off.
@@ -38,7 +38,7 @@ Use `REPLACE` for terms that have a preferred substitute.
| host | USE | | A machine with a NixOS configuration built by this repository's flake. |
| module | USE | | A self-contained NixOS configuration under `configs/nixos/modules/`. |
| registry | USE | | A typed configuration namespace whose entries can be collected across hosts and reused by other configuration. |
| Conventional Commits | USE | | A commit-message format defined in `docs/conventional-commits.md`. |
| Conventional Commits | USE | | A format for commit messages. |
| forge | USE | | A web service that hosts Git repositories, pull requests, issues, and code review comments. Use when the exact provider does not matter. |
| flake | USE | | A Nix project with pinned inputs and declared outputs. Use for the repository-level build unit defined by `flake.nix`. |
| NixOS module | USE | | A Nix file evaluated by `nixosSystem` for a NixOS configuration. |
The skill-specific branch of [`agent-writing-guide`](SKILL.md): what changes when the document is a skill (frontmatter, the invocation choice, and router skills). Everything else about writing it is the universal reference in `SKILL.md`.
## Invocation
Two choices, trading the two loads:
- A **model-invoked** skill keeps a `description`, so the agent can fire it autonomously, and other skills can reach it. You can still type its name: model-invocation always _includes_ user reach; a description only ever adds agent discovery, never removes the human's. The description is the skill's top-level context pointer, forced to stay loaded at all times: permanent context load in exchange for discoverability. A model-invoked skill whose content is all reference is also one home for shared reference: another skill can invoke it, so reference needed by several skills lives in one place. Mechanics: omit `disable-model-invocation`, and write a model-facing description carrying the trigger branches (the pointer-writing rules in `SKILL.md` apply in full).
- A **user-invoked** skill strips the description from the agent's reach: only the human typing its name can invoke it, and no other skill can. Zero context load, but it spends cognitive load: you are the index that must remember it exists. Mechanics: set `disable-model-invocation: true`; the `description` becomes human-facing: a one-line summary, trigger lists stripped.
Pick model-invocation only when the agent must reach the skill on its own, or another skill must. If it only ever fires by hand, make it user-invoked and pay no context load.
Shared reference that two user-invoked skills both need can live in neither: neither skill exposes model invocation. Push it to a plain file outside the skill system: external reference any skill can point at.
## Splitting by invocation
The invocation cut of splitting (the sequence cut lives in `SKILL.md`): split off a model-invoked skill when you have a distinct leading word that should trigger it on its own (a trigger word you actually use in your prompts), or another skill must reach it. You pay context load for the new always-loaded description, so that independent reach has to be worth it.
## Router skills
When user-invoked skills multiply past what you can remember, that piled-up cognitive load is cured by a **router skill**: one user-invoked skill that names the others and when to reach for each, so the human has one skill to remember instead of many. It can only hint, never fire them: `disable-model-invocation: true` prevents model invocation, so nothing but the human can reach them.
description:Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
---
Reference for writing any document an agent consumes: a skill, an `AGENTS.md` / `CLAUDE.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable, since the agent takes the same _process_ every run rather than producing the same output.
When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
## Context pointers
A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material, and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
A pointer does two jobs: state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
- **Front-load the leading word**: the pointer is where it does its triggering work.
- **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches.
- **Cut identity the body already carries.**
## The two loads
Every document and pointer you add spends one of two budgets:
- **Context load** is the cost of always-loaded material on the agent's window: an `AGENTS.md` line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires.
- **Cognitive load** is the cost on the human: which documents exist and when to reach for each. The human is the index. Not a cost to minimise: it is the price of human agency; spend it where human judgement matters, remove it where it does not.
Material reached only through a pointer escapes context load at the price of the pointer's own line; material with no pointer at all rides entirely on cognitive load.
## Information hierarchy
A document is built from two content types: **steps** (the ordered actions the agent performs) and **reference** (definitions, rules, facts consulted on demand). The two mix freely: all steps (a recipe), all reference (a review's rules, this skill), or both. The core decision is where each piece sits on the **information hierarchy**, a ladder ranked by how immediately the agent needs the material:
1.**In-file step** is the primary tier: what the agent does, in order.
2.**In-file reference** is consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung), which is a fine arrangement, not a smell.
3.**Disclosed reference** is pushed out into a separate file, reached by a context pointer, loaded only when the pointer fires. Spans a sibling file in the same folder through fully external reference that lives anywhere and any document can point at.
Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
**Progressive disclosure** is the move down the ladder (out of the main file and behind a pointer) so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip: a variance lever, not just a legibility one.
**Co-location** is the within-file companion: where the ladder decides _how far down_ a piece sits, co-location decides _what sits beside it_ once there. Keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it. The test: the document should read like documentation written for the agent. Grouped material reads that way; scattered material does not. (Distinct from duplication: that repeats one meaning in two places; scattering fragments one meaning across many.)
**Sprawl** is the failure mode here: a document simply too long, even when every line is live and unique. Attention thins across the excess, and every extra line is one more to keep relevant. The cure is the ladder: disclose reference behind pointers, and split by branch or sequence so each path carries only what it needs.
## Steps and completion criteria
Every step ends on a **completion criterion**, the condition that tells the agent the work is done. Two properties make it a lever:
- **Clarity**: can the agent tell done from not-done? A vague bound ("understanding reached") invites **premature completion**: ending the step before it is genuinely done, attention slipping to _being done_. The visible steps still ahead (the **post-completion steps**) supply the pull; the criterion's clarity is the resistance. Defend in order: **sharpen the bound first** (local and cheap); only if it is irreducibly fuzzy _and_ you observe the rush, hide the later steps by splitting the sequence. Hiding only works across a real context boundary (a hand-off or a subagent dispatch; an inline call leaves the later steps in context and clears nothing).
- **Demand**: how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** (the digging the agent does within the work, latent in the wording rather than written as its own step), and it is not step-bound: "every rule applied" binds a body of flat reference just as "every step done" binds a sequence, which is how an all-reference document still carries an exhaustiveness bar.
The strongest criteria are both checkable and exhaustive.
## When to split
Splitting one document into two spends one of the two loads, so split only when the cut earns it:
- **By sequence**: split a run of steps where the post-completion steps tempt the agent to rush the one in front of it. Keeping them out of view drives more legwork on the current task. Beware the reverse: merging sequences exposes each step's later steps to what follows, inviting premature completion.
- **By invocation**, skill-specific: see [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md).
## Leading words
A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the document (_lesson_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors: you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
It anchors twice. In the body, _execution_: the agent reaches for the same behaviour every time the word appears, and inside flat reference it focuses attention on a class of thing to look for. In a pointer, _invocation_: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the material and reaches it more reliably.
Hunt for opportunities to refactor with leading words. A triad spelled out at three sites, a pointer spending a sentence to gesture at one idea. Each is a passage begging to collapse into a single token:
- "fast, deterministic, low-overhead" → _tight_ (a _tight_ loop).
- "a loop you believe in" → _red_, turning a fuzzy gate into a binary observable state (the loop goes _red_ on the bug, or it doesn't).
You win twice: fewer tokens, and a sharper hook for the agent to hang its thinking on. Assume every document is carrying restatements that leading words retire. Go find them.
**Negation** is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the **positive**: state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
## Pruning
- Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit. **Duplication** (the same meaning in more than one place) costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank. (The accidental inverse of a leading word, which repeats a token on purpose, never the meaning.)
- The **environment** is a source of truth too (`package.json` scripts, config files, the directory layout, `--help` output), and a document that restates it is a **cache**: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.
- Check every line for **relevance**: does it still bear on what the document does? A line loses relevance by never bearing on the task (mere exposition, or a branch that should be disclosed) or by going stale as the behaviour or world it describes changes. Shorter documents are easier to keep relevant. Without a pruning discipline the default fate is **sediment**: stale layers that settle because adding feels safe and removing feels risky, until you must core down through them to find what is still live.
- Hunt **no-ops** sentence by sentence: an instruction the model already obeys by default pays load to say nothing. The test (does it change behaviour versus the default?) is model-relative, not reader-relative: two people disagreeing about a no-op disagree about the default, and settle it by running the document, not by debate. When a sentence fails, delete the whole sentence rather than trim words from it. The test also grades leading words: a word too weak to beat the default (_be thorough_ when the agent is already thorough-ish) is a no-op, and the fix is a stronger word (_relentless_), not a different technique.
description:Stress-test a plan, decision, or design through a one-question-at-a-time interview. Use when the user asks to grill, stress-test, pressure-test, challenge, interrogate, or poke holes in a plan.
description:Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
---
# grill
Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: each decision branches into the decisions it unblocks.
Interview the user until the session has no open or blocked questions.
Open questions define the ending condition for the grill session.
Blocked questions track known decisions with unsettled prerequisites.
Maintain the design tree in a new Markdown file. Use the file as the source of truth.
Do not begin implementation during or after grill without an explicit user instruction.
A completed grill summary is not an instruction to build.
Build the complete **frontier** before the first question.
After each answer, recompute and display every frontier decision.
## Run the interview
Ask one frontier decision per turn.
A clarification leaves that decision open.
1. Prepare the grill.
Read the conversation, files, and docs that can settle facts or reveal constraints.
Resolve factual questions yourself when tools can answer them.
Do not ask the user for facts you can find.
Build the required-question set from the known plan or idea.
Put ready questions under `Open questions:`.
Put known questions with unsettled prerequisites under `Blocked questions:`.
Format a question like so:
Finish when both sections contain every known required question.
```
❓ **D1 — <decision title>**: <question body, might be multiple paragraphs, including multiple choices>
2. Start the interview.
Show `Open questions:` and `Blocked questions:` in short form.
Include titles only, not full question bodies.
Use Markdown list items in both sections.
Mark each initial item with `- [ ]`.
Ask exactly one numbered question in the same turn.
The question title must match an item under `Open questions:`.
**Options**
Finish when the interview has started with exactly one numbered question.
1. <option>
...
<n>. **<recommended option>** — recommended
3. Process the answer.
Account for the user's answer before asking another question.
Resolve, update, remove, unblock, or add questions as the answer requires.
Use `- [ ]` for unchanged unresolved questions.
Use `- [+]` for questions added by the latest answer.
Use `- [u]` for questions updated by the latest answer.
Use `- [x]` for questions resolved by the latest answer.
Use `- [-]` for questions removed by the latest answer.
Include a cause note for each `- [+]`, `- [u]`, and `- [-]` change.
Indent cause notes by two spaces under the changed question.
Show `- [+]`, `- [u]`, `- [x]`, and `- [-]` for one turn only.
After that turn, keep an updated question visible as `- [ ]`.
After that turn, remove resolved and removed questions from the visible list.
Move unblocked questions from `Blocked questions:` to `Open questions:` with `- [u]`.
Do not use `- [+]` for unblocked questions because they are not new.
Add questions only when the latest answer directly causes them.
When the user extends scope instead of answering, account for the new question before pursuing it.
Do not add optional follow-up questions to either section.
Put optional follow-up questions in the final summary instead.
Resolve newly answerable facts yourself.
---
Finish when every list change has an explicit marker and required cause note.
❓ **D2 — <decision title>**: <question body, might be multiple paragraphs, including multiple choices>
4. Ask the next question.
Show `Open questions:` and `Blocked questions:` on every active grill turn.
Keep `- [ ]` items visible every turn.
Preserve agent judgment when the user reframes or invalidates a question.
Show the resulting list change instead of following a rigid reframe algorithm.
If the user catches incorrect accounting, briefly explain the error.
Then show the corrected question sections.
Ask exactly one numbered question when `Open questions:` contains an unresolved item.
The question title must match an item currently shown under `Open questions:`.
Give concrete options with trade-offs.
Label options with `A.`, `B.`, `C.`, and later letters.
Use the same labels in the recommendation.
Give a recommendation and rationale.
Probe vague words, overloaded terms, and hidden assumptions.
Use concrete scenarios to test concept boundaries and edge cases.
When code contradicts the user's claim, quote both the claim and the code behavior.
If the turn includes a correction, file edit, apology, or explanation, still end with the next numbered question.
**Options**
Finish when the turn ends with the next numbered question.
1. <option>
...
<n>. **<recommended option>** — recommended
```
5. Close or pause.
Close when `Open questions:` and `Blocked questions:` are empty.
Output a concise summary of every decision reached.
Include optional follow-up questions that were not added to either section.
Do not act on the summary unless the user gives a new implementation instruction.
If the user changes tasks, state that grill is paused.
End the turn with the final decision summary or the pause statement.
List every viable answer in an ordered list and mark your recommended answer.
Word each question so "yes" accepts your recommended answer.
Finish when the summary is delivered or grill is explicitly paused.
Before asking the next question, account for every decision that the response settles.
Record preferences as constraints.
Settle an implementation decision only after facts establish that it is viable.
A decision with unresolved prerequisites belongs outside the frontier.
Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), find it with available tools; don't ask the user for anything you could look up yourself. The _decisions_ are the user's: put each to them and wait.
The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Present every settled decision from the design tree. Do not act on it until the user confirms you have reached a shared understanding.
2. Read the primary sources for the session the user specifies. This may mean searching through session logs on this machine. If the user doesn't specify a session, default to the current one.
3. Look for candidates for improvement in these categories.
- **Navigation**: how easy was it for the agent to find the right files? Are there hidden dependencies between files? Would a **navigation pointer** make it easier? _Use when_ the session took a long time to find a piece of information.
- **Automated checks**: are there automated checks that could catch errors the agent made? Linting, typing, tests, filesystem linters? Read the repo's own check command first (its `package.json`/build-tool `lint`/`check` scripts, its CI workflow), so a check that already exists but sits unwired or silently broken is the finding, not a reinvention. A repo with no **guardrail** (no pre-commit hook and no CI job running its lint/typecheck/test command) is itself a finding: an un-linted repo is a standing missed opportunity, not a neutral default. _Use when_ the agent made a mistake an automated check could have caught, or the repo has no guardrail at all.
- **Coding standards**: should the **reviewer agent** be given a new rule to enforce? Should an existing rule be removed or clarified? Classify the violation first: a **mechanical** one (a fixed syntactic pattern, a banned API, an import shape, a file-location rule) gets a deterministic check, full stop: a custom rule in the repo's own linter, a new pre-commit hook, or a new CI job, whichever the repo's language and existing guardrail make cheapest. Default to building the check over writing the rule. Reserve **review standards** for genuine **judgement calls** (cross-file consistency, "matches the surrounding style," anything no guardrail could ever substitute for). Before proposing a rule, identify the repository source that its review workflow loads. Keep the rule in that established source. _Use when_ the reviewer agent failed to catch a mistake.
- **Global AGENTS.md**: are there any steering instructions that should be moved to review standards (or automated checks) instead? _Use when_ the AGENTS.md file is particularly large - in the repo OR the user's global scope.
- **Tool economy**: did the agent make expensive tool calls that could be streamlined? Is there any custom tooling (CLI's, MCP's) that is particularly token-inefficient? _Use when_ the agent made an expensive tool call.
- **No-ops**: look for instructions in steering files that don't modify the agent's behavior. _Use when_ the steering files are large and unwieldy.
- **Information access**: look for opportunities to increase the agent's access to information. Teeing dev server logs, readonly access to third-party services. _Use when_ a crucial piece of information was not available to the agent.
4. Present these candidates to the user, in order of severity.
## Reference
### Implementation vs Review
Remember that all work goes through two stages: implementation and review. The implementation agent has the most **context pressure**. They are responsible for exploration, writing code, and debugging failures.
The review agent has the least context pressure - it receives a diff, so no exploration needed. It often does not need to write code or debug.
This means that the review agent should be responsible for imposing coding standards, not the implementation agent.
### Files
You have access to several files in the repo:
-`AGENTS.md`: these files are pushed to the context window of any agent working in this repo. They should be used incredibly sparingly, usually only for **navigation pointers** to other files.
- **Review standards**: these are the documented rules that the repository's review workflow loads. They can live in a standards file, a contribution guide, or scoped rule files. Find the existing source before proposing an addition.
- Docs: use docs as references files, pointed to by other files. Look for existing docs before writing new ones.
- Skills: use skills for user-invoked commands or model-discoverable guidance. Follow the advice in the `agent-writing-guide` skill.
description:Draft a requested summary, specification, plan, decision record, or similar document from conversation and repository context.
---
Do not start with an interview when the conversation gives a usable subject.
Ask before drafting only when the conversation lacks a usable subject.
Do not put draft contents in the chat response.
Always persist the draft to a file.
Do not implement the draft contents unless the operator gives a separate instruction.
Treat a completed draft as documentation, not an instruction to build.
## Process
1. Identify the subject.
Use the conversation as the primary source.
If the conversation lacks a usable subject, ask what the document is about.
Do not ask clarifying questions before drafting when a usable subject exists.
Finish when you have a subject or a question that requests the missing subject.
2. Gather repository facts that the draft needs.
Inspect files when repository details matter.
Do not invent modules, paths, commands, flows, contracts, or conventions.
Distinguish confirmed facts from assumptions.
Finish when each repository-specific claim has support or an explicit assumption marker.
3. Choose the document shape.
Infer the document type and title from context.
Load [DOCUMENT-FORMAT.md](DOCUMENT-FORMAT.md) when the operator requests no specific format.
Adapt the structure only when the requested document type needs different sections.
Preserve useful sections for decisions, testing, scope, and notes.
Finish when the draft has a title and section plan that fit the requested document.
4. Write the draft.
Capture known context accurately.
Mark assumptions and gaps explicitly.
Include decisions that the conversation settled.
Include open questions only as gaps, not as an interview.
Keep the document focused on the operator's problem and intended use.
Finish when the draft contains the relevant facts, decisions, assumptions, gaps, and scope.
5. Persist the draft.
Use `docs/00 INBOX/ai` as the default destination.
Use the operator's requested path when one exists.
Derive a kebab-case slug from the inferred title.
Create the destination directory when it does not exist.
If the target file exists, summarize the expected change.
Confirm before overwriting an existing file.
Do not print the draft in chat instead of writing it.
Finish when the draft is written or overwrite confirmation is pending.
6. Finish with the result.
Report the written path.
Do not include the draft contents in the response.
Do not continue into implementation without an explicit instruction.
Finish when the operator can find the written draft.
Loaded 100 of 1853 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.