`),s}function T(n,t){if(!(n==null?void 0:n.headings))return"";let{headings:e}=n,s=e.filter(i=>!!i&&i.level>=t.min_depth&&i.level<=t.max_depth);return s.length?G(s.map(i=>new O(i)),t):""}var _=class extends y.MarkdownRenderChild{constructor(t,e,s,i){super(i);this.app=t;this.config=e;this.filePath=s;this.container=i;this.onSettingsChangeHandler=t=>{this.render(x(this.config,t))};this.onFileChangeHandler=t=>{t.deleted||t.path!==this.filePath||this.render()}}onload(){return a(this,null,function*(){yield this.render(),this.registerEvent(this.app.metadataCache.on("dynamic-toc:settings",this.onSettingsChangeHandler)),this.registerEvent(this.app.metadataCache.on("changed",this.onFileChangeHandler))})}render(t){return a(this,null,function*(){this.container.empty(),this.container.classList.add(g);let e=T(this.app.metadataCache.getCache(this.filePath),t||this.config);yield y.MarkdownRenderer.renderMarkdown(e,this.container,this.filePath,this)})}};var o=p(require("obsidian"));var w=class extends o.PluginSettingTab{constructor(t,e){super(t,e);this.plugin=e}display(){let{containerEl:t}=this;t.empty(),t.createEl("h2",{text:"Dynamic Table of Contents Settings"}),new o.Setting(t).setName("List Style").setDesc("The table indication").addDropdown(s=>s.addOptions({bullet:"Bullet",number:"Number"}).setValue(this.plugin.settings.style).onChange(i=>a(this,null,function*(){this.plugin.settings.style=i,yield this.plugin.saveSettings()}))),new o.Setting(t).setName("Minimum Header Depth").setDesc("The default minimum header depth to render").addSlider(s=>s.setLimits(1,6,1).setValue(this.plugin.settings.min_depth).setDynamicTooltip().onChange(i=>a(this,null,function*(){i>this.plugin.settings.max_depth?new o.Notice("Min Depth is higher than Max Depth"):(this.plugin.settings.min_depth=i,yield this.plugin.saveSettings())}))),new o.Setting(t).setName("Maximum Header Depth").setDesc("The default maximum header depth to render").addSlider(s=>s.setLimits(1,6,1).setValue(this.plugin.settings.max_depth).setDynamicTooltip().onChange(i=>a(this,null,function*(){i<this.plugin.settings.min_depth?new o.Notice("Max Depth is higher than Min Depth"):(this.plugin.settings.max_depth=i,yield this.plugin.saveSettings())}))),new o.Setting(t).setName("Title").setDesc("The title of the table of contents, supports simple markdown such as ## Contents or **Contents**").addText(s=>s.setPlaceholder("## Table of Contents").setValue(this.plugin.settings.title).onChange(i=>a(this,null,function*(){this.plugin.settings.title=i,this.plugin.saveSettings()})));let e=new o.Setting(t).setName("External rendering support").setDesc("Different markdown viewers provided Table of Contents support such as [TOC] or [[_TOC_]]. You may need to restart Obsidian for this to take effect.").addDropdown(s=>s.addOptions(Object.keys(d).reduce((i,r)=>{let c=d[r];return u(m({},i),{[r]:c})},{})).setDisabled(this.plugin.settings.supportAllMatchers).setValue(this.plugin.settings.externalStyle).onChange(i=>a(this,null,function*(){this.plugin.settings.externalStyle=i,yield this.plugin.saveSettings()})));new o.Setting(t).setName("Support all external renderers").setDesc("Cannot be used in conjunction with individual renderers").addToggle(s=>s.setValue(this.plugin.settings.supportAllMatchers).onChange(i=>a(this,null,function*(){this.plugin.settings.supportAllMatchers=i,e.setDisabled(i),yield this.plugin.saveSettings()})))}};var C=p(require("obsidian"));var f=class extends C.MarkdownRenderChild{constructor(t,e,s,i,r){super(i);this.app=t;this.settings=e;this.filePath=s;this.match=r;this.onSettingsChangeHandler=()=>{this.render()};this.onFileChangeHandler=t=>{t.deleted||t.path!==this.filePath||this.render()}}static findMatch(t,e){return Array.from(t.querySelectorAll("p, span, a")).find(i=>i.textContent.toLowerCase().includes(e.toLowerCase()))||null}onload(){return a(this,null,function*(){this.render(),this.registerEvent(this.app.metadataCache.on("dynamic-toc:settings",this.onSettingsChangeHandler)),this.registerEvent(this.app.metadataCache.on("changed",this.onFileChangeHandler))})}render(){return a(this,null,funct