varpT=Object.create;varUl=Object.defineProperty;varmT=Object.getOwnPropertyDescriptor;varAT=Object.getOwnPropertyNames;vargT=Object.getPrototypeOf,bT=Object.prototype.hasOwnProperty;varC=(e,t)=>()=>(e&&(t=e(e=0)),t);varka=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(varrint)Ul(e,r,{get:t[r],enumerable:!0})},Yg=(e,t,r,n)=>{if(t&&typeoft=="object"||typeoft=="function")for(letiofAT(t))!bT.call(e,i)&&i!==r&&Ul(e,i,{get:()=>t[i],enumerable:!(n=mT(t,i))||n.enumerable});returne};varQn=(e,t,r)=>(r=e!=null?pT(gT(e)):{},Yg(t||!e||!e.__esModule?Ul(r,"default",{value:e,enumerable:!0}):r,e)),Zd=e=>Yg(Ul({},"__esModule",{value:!0}),e);varKg=C(()=>{});varAi=C(()=>{Kg();typeofwindow<"u"&&((window.__svelte??={}).v??=newSet).add("5")});varUi,It,An,$l,Bo,Xd,ft=C(()=>{Ui={},It=Symbol("uninitialized"),An=Symbol("filename"),$l="http://www.w3.org/1999/xhtml",Bo="http://www.w3.org/2000/svg",Xd="http://www.w3.org/1998/Math/MathML"});varYl,Qg=C(()=>{Yl=!0});varWg,G,Gg=C(()=>{Wg=globalThis.process?.env?.NODE_ENV,G=Wg&&!Wg.toLowerCase().startsWith("prod")});varVg=C(()=>{});varXe=C(()=>{Qg();Gg();Vg()});functionWu(e){returntypeofe=="function"}functionJg(e){returne()}functionTs(e){for(vart=0;t<e.length;t++)e[t]()}functionQl(){vare,t,r=newPromise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}vargi,qg,Qu,ys,eh,_r,Br,Kl,th,zg,Ra,rh,Pt,ot=C(()=>{gi=Array.isArray,qg=Array.prototype.indexOf,Qu=Array.prototype.includes,ys=Array.from,eh=Object.keys,_r=Object.defineProperty,Br=Object.getOwnPropertyDescriptor,Kl=Object.getOwnPropertyDescriptors,th=Object.prototype,zg=Array.prototype,Ra=Object.getPrototypeOf,rh=Object.isExtensible;Pt=()=>{}});varXt,ws,jg,Wl,Gl,Lo,Fo,Po,Gu,nh,lu,ih,Oa,Dn,We=C(()=>{Xt=Symbol("$state"),ws=Symbol("legacy props"),jg=Symbol(""),Wl=Symbol("proxy path"),Gl=Symbol("attributes"),Lo=Symbol("class"),Fo=Symbol("style"),Po=Symbol("text"),Gu=Symbol("form reset"),nh=Symbol("hmr anchor"),lu=newclassextendsError{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ih=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Oa=3,Dn=8});functionZg(e){if(G){lett=newError(`invariant_violation
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${e}"
https://svelte.dev/e/lifecycle_outside_component`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/lifecycle_outside_component")}varMo=C(()=>{Xe()});functione1(){if(G){lete=newError("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/async_derived_orphan")}functionuh(){if(G){lete=newError("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/bind_invalid_checkbox_value")}functiont1(){if(G){lete=newError(`derived_references_self
A derived value cannot reference itself recursively
Keyed each block has key that is not idempotent \u2014 the key for item at index ${e} was \`${t}\` but is now \`${r}\`. Keys must be the same each time for a given item
\`${e}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/effect_in_teardown")}functioni1(){if(G){lete=newError("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/effect_in_unowned_derived")}functionu1(e){if(G){lett=newError(`effect_orphan
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throwt.name="Svelte error",t}elsethrownewError("https://svelte.dev/e/rune_outside_svelte")}functionl1(){if(G){lete=newError("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_descriptors_fixed")}functionf1(){if(G){lete=newError("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_prototype_fixed")}functiond1(){if(G){lete=newError("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/state_unsafe_mutation")}functionh1(){if(G){lete=newError("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throwe.name="Svelte error",e}elsethrownewError("https://svelte.dev/e/svelte_boundary_reset_onerror")}varEr=C(()=>{Xe();Mo()});functionp1(e){G?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${e}\`. This happens when state is read in an async function after an earlier \`await\`
%cAn async derived, \`${e}\` (${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
%c${e?`The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
%cTried to unmount a state proxy, rather than a component
https://svelte.dev/e/state_proxy_unmount`,$i,Yi):console.warn("https://svelte.dev/e/state_proxy_unmount")}functionv1(){G?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",$i,Yi):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var$i,Yi,cr=C(()=>{Xe();$i="font-weight: bold",Yi="font-weight: normal"});functionWt(e){de=e}functionlt(e){if(e===null)throwVu(),Ui;returnke=e}functioner(){returnlt(xr(ke))}function_e(e){if(de){if(xr(ke)!==null)throwVu(),Ui;ke=e}}functionFr(e=1){if(de){for(vart=e,r=ke;t--;)r=xr(r);ke=r}}functionbi(e=!0){for(vart=0,r=ke;;){if(r.nodeType===Dn){varn=r.data;if(n==="]"){if(t===0)returnr;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}vari=xr(r);e&&r.remove(),r=i}}functionDs(e){if(!e||e.nodeType!==Dn)throwVu(),Ui;returne.data}varde,ke,gt=C(()=>{We();ft();cr();tr();de=!1});functionql(e){returne===this.v}functionHo(e,t){returne!=e?t==t:e!==t||e!==null&&typeofe=="object"||typeofe=="function"}functionzl(e){return!Ho(e,this.v)}varUo=C(()=>{});functionx1(){Ki=!0}varrr,Ki,_i,on=C(()=>{rr=!1,Ki=!1,_i=!1});varsh=C(()=>{Xe()});varks=C(()=>{Xe();sh();ot()});functionVr(e,t){returne.label=t,jl(e.v,t),e}functionjl(e,t){returne?.[Wl]?.(t),e}var$o,qu=C(()=>{ft();ks();We();Be();Ue();$o=null});functionEi(e){lett=newError,r=ET();returnr.length===0?null:(r.unshift(`
`),n=[];for(leti=0;i<r.length;i++){letu=r[i],o=u.replaceAll("\\","/");if(u.trim()!=="Error"){if(u.includes("validate_each_keys"))return[];o.includes("svelte/src/internal")||o.includes("node_modules/.vite")||n.push(u)}}returnn}functionT1(e,t){if(!G)thrownewError("invariant(...) was not guarded by if (DEV)");e||Zg(t)}varBa=C(()=>{Xe();ot();Mo()});functiondu(e){Me=e}functionRs(e){Qi=e}functionZl(e){kn=e}functionPr(e,t=!1,r){Me={p:Me,i:!1,c:null,e:null,s:e,x:null,r:fe,l:Ki&&!t?{s:null,u:null,$:[]}:null},G&&(Me.function=r,kn=r)}functionMr(e){vart=Me,r=t.e;if(r!==null){t.e=null;for(varnofr)oh(n)}returne!==void0&&(t.x=e),t.i=!0,Me=t.p,G&&(kn=Me?.function??null),e??{}}functionWi(){return!Ki||Me!==null&&Me.l===null}varMe,Qi,kn,Bt=C(()=>{Xe();Er();Ue();Be();on();ft();We();Me=null;Qi=null;kn=null});functionw1(){vare=La;La=[],Ts(e)}functionMt(e){if(La.length===0&&!Fa){vart=La;queueMicrotask(()=>{t===La&&w1()})}La.push(e)}functionI1(){for(;La.length>0;)w1()}varLa,Gn=C(()=>{ot();Hr();La=[]});functionXl(e){vart=fe;if(t===null)returnCe.f|=8388608,e;if(G&&einstanceofError&&!ch.has(e)&&ch.set(e,vT(e,t)),(t.f&32768)===0&&(t.f&4)===0)throwG&&!t.parent&&einstanceofError&&C1(e),e;xi(e,t)}functionxi(e,t){if(!(t!==null&&(t.f&16384)!==0)){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throwe;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throwG&&einstanceofError&&C1(e),e}}functionvT(e,t){letr=Br(e,"message");if(!(r&&!r.configurable)){for(varn=Qo?" ":" ",i=`
Enablethisoptiontocompletelyhidethem.`).addToggle(i=>i.setValue(t.hideExcluded).onChange(async u=>{t.hideExcluded=u,await Fe(e)})),new wn.Setting(r).setName("Folders to downrank in search results").setDesc("Folders to downrank in search results. Files in these folders will be downranked in results. They will still be indexed for tags, unlike excluded files. Folders should be comma delimited.").addText(i=>{i.setValue(t.downrankedFoldersFilters.join(",")).setPlaceholder("Example: src,p2/dir").onChange(async u=>{let o=u.split(",");o=o.map(c=>c.trim()),t.downrankedFoldersFilters=o,await Fe(e)})}),new wn.Setting(r).setName("Split CamelCaseWords").setDesc(Yt(`EnablethisifyouwanttobeabletosearchforCamelCaseWordsasseparatewords.<br/>
Wordsshorterthan3characterswon't be used as prefixes; this can reduce search delay but will return fewer results.`).addToggle(i=>i.setValue(t.simpleSearch).onChange(async u=>{t.simpleSearch=u,await Fe(e)})),wn.Platform.isIosApp||new wn.Setting(r).setName("Tokenize URLs").setDesc(`Enable this if you want to be able to search for URLs as separate words.
This setting has a strong impact on indexing performance, and can crash Obsidian under certain conditions.`).addToggle(i=>i.setValue(t.tokenizeUrls).onChange(async u=>{t.tokenizeUrls=u,await Fe(e)})),new wn.Setting(r).setName("Open in new pane").setDesc("Open and create files in a new pane instead of the current pane.").addToggle(i=>i.setValue(t.openInNewPane).onChange(async u=>{t.openInNewPane=u,await Fe(e)})),new wn.Setting(r).setName("Set Vim like navigation keys").setDesc(`Navigate down the results with ${Tn()} + J/N, or navigate up with ${Tn()} + K/P.`).addToggle(i=>i.setValue(t.vimLikeNavigationShortcut).onChange(async u=>{t.vimLikeNavigationShortcut=u,await Fe(e)})),new wn.Setting(r).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'llget.").addDropdown(i=>i.addOptions({0:"Exactmatch",1:"Nottoofuzzy",2:"Fuzzyenough"}).setValue(t.fuzziness).onChange(async u=>{["0","1","2"].includes(u)||(u="2"),t.fuzziness=u,await Fe(e)}))}var wn,M_=C(()=>{wn=require("obsidian");$r();Oi()});function H_(e,t,r){let n=e.database;new eu.Setting(r).setName("DangerZone").setHeading(),new eu.Setting(r).setName("Ignorediacritics").setDesc(Yt(`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
${Ws}`)).addToggle(u=>u.setValue(t.ignoreDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreDiacritics=o,await Fe(e)})),new eu.Setting(r).setName("IgnoreArabicdiacritics(beta)").addToggle(u=>u.setValue(t.ignoreArabicDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreArabicDiacritics=o,await Fe(e)}));let i=Yt(`Disable Omnisearch on this device only.<br>
${Ws}`);new eu.Setting(r).setName("Disableonthisdevice").setDesc(i).addToggle(u=>u.setValue(Hf(e.app)).onChange(async o=>{o?(e.app.saveLocalStorage(ts,"1"),new eu.Notice("Omnisearch-Disabled.PleaserestartObsidian.")):(e.app.saveLocalStorage(ts),new eu.Notice("Omnisearch-Enabled.PleaserestartObsidian."))})),new eu.Setting(r).setName("Forcesavethecache").setDesc(Yt(`Omnisearch has a security feature that automatically disables cache writing if it cannot fully perform the operation.<br>
\u26A0\uFE0F <span style="color:var(--text-accent)">Enabling this setting could lead to crash loops</span>`)).addToggle(u=>u.setValue(t.DANGER_forceSaveCache).onChange(async o=>{t.DANGER_forceSaveCache=o,await Fe(e)})),wu()&&new eu.Setting(r).setName("Clearcachedata").setDesc(Yt(`Erase all Omnisearch cache data.
${Ws}`)).addButton(u=>{u.setButtonText("Clearcache"),u.onClick(async()=>{await n.clearCache()})})}var eu,U_=C(()=>{eu=require("obsidian");yn();Oi()});function $_(e,t,r){ns.Platform.isMobile||(new ns.Setting(r).setName("APIAccessThroughHTTP").setHeading().setDesc(Yt('Omnisearch can be used through a simple HTTP server (<a href="https://publish.obsidian.md/omnisearch/Public+API+%26+URL+Scheme#HTTP+Server">more information</a>).')),new ns.Setting(r).setName("Enable the HTTP server").addToggle(n=>n.setValue(t.httpApiEnabled).onChange(async i=>{t.httpApiEnabled=i,i?e.apiHttpServer.listen(t.httpApiPort):e.apiHttpServer.close(),await Fe(e)})),new ns.Setting(r).setName("HTTP Port").addText(n=>{n.setValue(t.httpApiPort).setPlaceholder("51361").onChange(async i=>{parseInt(i)>65535&&(i=t.httpApiPort,n.setValue(t.httpApiPort)),t.httpApiPort=i,t.httpApiEnabled&&(e.apiHttpServer.close(),e.apiHttpServer.listen(t.httpApiPort)),await Fe(e)})}),new ns.Setting(r).setName("Show a notification when the server starts").setDesc("Will display a notification if the server is enabled, at Obsidian startup.").addToggle(n=>n.setValue(t.httpApiNotice).onChange(async i=>{t.httpApiNotice=i,await Fe(e)})))}var ns,Y_=C(()=>{ns=require("obsidian");Oi()});function K_(e,t,r){let n=e.getTextExtractor(),i=e.getAIImageAnalyzer(),u=e.database,o=(0,jn.debounce)(async()=>{await u.clearCache()},1e3);new jn.Setting(r).setName("Indexing").setHeading().setDesc(Yt(`<div style="margin-top: 1em; color: var(--text-accent)">\u26A0\uFE0F Changing indexing settings will clear the cache, and requires a restart of Obsidian.</div><br/>
${n?`\u{1F44D} You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch can use it to index PDFs and images contents.
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`:'\u26A0\uFE0F Omnisearch requires <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.'}
${i?'<br/>\u{1F44D} You have installed <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a>, Omnisearch can use it to index images contents with AI.':'<br/>\u26A0\uFE0F Omnisearch requires <a href="https://github.com/Swaggeroo/obsidian-ai-image-analyzer">AI Image Analyzer</a> to index images with AI.'}`)),new jn.Setting(r).setName(`PDFscontentindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Yt("Omnisearch will use Text Extractor to index the content of your PDFs.")).addToggle(p=>p.setValue(t.PDFIndexing).onChange(async A=>{await u.clearCache(),t.PDFIndexing=A,await Fe(e)})).setDisabled(!n),new jn.Setting(r).setName(`ImagesOCRindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Yt("Omnisearch will use Text Extractor to OCR your images and index their content.")).addToggle(p=>p.setValue(t.imagesIndexing).onChange(async A=>{await u.clearCache(),t.imagesIndexing=A,await Fe(e)})).setDisabled(!n);let c=Yt('Omnisearch will use Text Extractor to index the content of your office documents (currently <pre style="display:inline">.docx</pre> and <pre style="display:inline">.xlsx</pre>).');new jn.Setting(r).setName(`Documentscontentindexing${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(c).addToggle(p=>p.setValue(t.officeIndexing).onChange(async A=>{await u.clearCache(),t.officeIndexing=A,await Fe(e)})).setDisabled(!n);let d=Yt(`OmnisearchwilluseAIImageAnalyzertoindexthecontentofyourimageswithAI.<br/>
\u26A0\uFE0F<spanstyle="color: var(--text-accent)">IfbothAIImageAnalyzerandTextExtractorareenabled,TextExtractorwillonlybeusedasafallback.</span>`);new jn.Setting(r).setName(`Images AI indexing ${i?"":"\u26A0\uFE0F Disabled"}`).setDesc(d).addToggle(p=>p.setValue(t.aiImageIndexing).onChange(async A=>{await u.clearCache(),t.aiImageIndexing=A,await Fe(e)})).setDisabled(!i),new jn.Setting(r).setName("Index paths of unsupported files").setDesc(Yt(`
Omnisearchcanindexfile<strong>names</strong> of "unsupported" files, such as e.g. <pre style="display:inline">.mp4</pre>
ornon-extractedPDFs&images.<br/>
"Obsidian setting"willrespectthevalueof"Files & Links > Detect all file extensions".`)).addDropdown(p=>{p.addOptions({yes:"Yes",no:"No",default:"Obsidian setting"}).setValue(t.unsupportedFilesIndexing).onChange(async A=>{await o(),t.unsupportedFilesIndexing=A,await Fe(e)})}),new jn.Setting(r).setName("Set frontmatter property key as title").setDesc(Yt(`Ifyouhaveacustompropertyinyournotesthatyouwanttouseasthetitleinsearchresults.Ifyousetthisto'#heading',thenusethefirstheadingfromafileasthetitle.<br>
Leaveemptytodisable.`)).addText(p=>{p.setValue(t.displayTitle).onChange(async A=>{await o(),t.displayTitle=A,await Fe(e)})}),new jn.Setting(r).setName("Additional TEXT files to index").setDesc(Yt(`Inadditiontostandard<code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
becauseOmnisearchwilltrytoindextheircontent.</span>`)).addText(p=>{p.setValue(t.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async A=>{await u.clearCache(),t.indexedFileTypes=A.split(" "),await Fe(e)})}),new jn.Setting(r).setName("Index files without extension").setDesc(Yt(`Enable this to also index files that have <strong style="color: var(--text-accent)">no file extension</strong>.<br/>
Thesefileswillbeindexedasplaintextfiles.`)).addToggle(p=>{p.setValue(t.indexFilesWithoutExtension).onChange(async A=>{await u.clearCache(),t.indexFilesWithoutExtension=A,await Fe(e)})})}var jn,Q_=C(()=>{jn=require("obsidian");Oi()});function W_(e,t,r){new ua.Setting(r).setName("User Interface").setHeading(),new ua.Setting(r).setName("Show ribbon button").setDesc("Add a button on the sidebar to open the Vault search modal.").addToggle(n=>n.setValue(t.ribbonIcon).onChange(async i=>{t.ribbonIcon=i,await Fe(e),i?e.addRibbonButton():e.removeRibbonButton()})),new ua.Setting(r).setName("Show excerpts").setDesc("Shows the contextual part of the note that matches the search. Disable this to only show filenames in results.").addToggle(n=>n.setValue(t.showExcerpt).onChange(async i=>{aa.set(i)})),new ua.Setting(r).setName("Show embed references").setDesc(Yt(`Someresultsare<ahref="https://help.obsidian.md/Linking+notes+and+files/Embed+files">embedded</a> in other notes.<br>
AlsoworkswithTextExtractorforembeddedimagesanddocuments.`)).addSlider(n=>{n.setLimits(0,10,1).setValue(t.maxEmbeds).setDynamicTooltip().onChange(async i=>{t.maxEmbeds=i,await Fe(e)})}),new ua.Setting(r).setName("Render line return in excerpts").setDesc("Activate this option to render line returns in result excerpts.").addToggle(n=>n.setValue(t.renderLineReturnInExcerpts).onChange(async i=>{t.renderLineReturnInExcerpts=i,await Fe(e)})),new ua.Setting(r).setName('Show "Create note" button').setDesc(Yt(`Showsabuttonnexttothesearchinput,tocreateanote.
Actsthesameasthe<code>shift\u21B5</code> shortcut, can be useful for mobile device users.`)).addToggle(n=>n.setValue(t.showCreateButton).onChange(async i=>{t.showCreateButton=i,await Fe(e)})),new ua.Setting(r).setName("Highlight matching words in results").setDesc("Will highlight matching results when enabled. See README for more customization options.").addToggle(n=>n.setValue(t.highlight).onChange(async i=>{t.highlight=i,await Fe(e)}))}var ua,G_=C(()=>{ua=require("obsidian");Gs();Oi()});function q_(e,t,r,n){function i(o,c){o.setLimits(1,10,.5).setValue(t[c]).setDynamicTooltip().onChange(async d=>{t[c]=d,await Fe(e)})}let u=yc(e.app);new Zn.Setting(r).setName("Results weighting").setHeading(),new Zn.Setting(r).setName(`File name & declared aliases (default: ${u.weightBasename})`).addSlider(o=>i(o,"weightBasename")),new Zn.Setting(r).setName(`File directory (default: ${u.weightDirectory})`).addSlider(o=>i(o,"weightDirectory")),new Zn.Setting(r).setName(`Headings level 1 (default: ${u.weightH1})`).addSlider(o=>i(o,"weightH1")),new Zn.Setting(r).setName(`Headings level 2 (default: ${u.weightH2})`).addSlider(o=>i(o,"weightH2")),new Zn.Setting(r).setName(`Headings level 3 (default: ${u.weightH3})`).addSlider(o=>i(o,"weightH3")),new Zn.Setting(r).setName(`Tags (default: ${u.weightUnmarkedTags})`).addSlider(o=>i(o,"weightUnmarkedTags")),new Zn.Setting(r).setName("Header properties fields").setDesc('You can set custom weights for values of header properties (e.g. "keywords"). Weights under 1.0 will downrank the results.');for(let o=0;o<t.weightCustomProperties.length;o++){let c=t.weightCustomProperties[o],d=new Zn.Setting(r).setName((o+1).toString()+".");d.settingEl.style.paddingLeft="2em",d.addText(p=>{p.setPlaceholder("Property name").setValue(c.name).onChange(async A=>{c.name=A,await Fe(e)})}).addSlider(p=>{p.setLimits(.1,5,.1).setValue(c.weight).setDynamicTooltip().onChange(async A=>{c.weight=A,await Fe(e)})}).addButton(p=>{p.setButtonText("Remove"),p.onClick(async()=>{t.weightCustomProperties.splice(o,1),await Fe(e),n()})})}new Zn.Setting(r).addButton(o=>{o.setButtonText("Add a new property"),o.onClick(c=>{t.weightCustomProperties.push({name:"",weight:1}),n()})}),new Zn.Setting(r).setName("Recency boost (experimental)").setDesc("Files that have been modified more recently than [selected cutoff] are given a higher rank.").addDropdown(o=>o.addOptions({"0":"Disabled","1":"24 hours","2":"7 days","3":"30 days"}).setValue(t.recencyBoost).onChange(async c=>{t.recencyBoost=c,await Fe(e)}))}var Zn,z_=C(()=>{Zn=require("obsidian");yn();Gs();Oi()});function yc(e){return{useCache:!0,hideExcluded:!1,recencyBoost:"0",downrankedFoldersFilters:[],ignoreDiacritics:!0,ignoreArabicDiacritics:!1,indexedFileTypes:[],indexFilesWithoutExtension:!1,displayTitle:"",PDFIndexing:!1,officeIndexing:!1,imagesIndexing:!1,aiImageIndexing:!1,unsupportedFilesIndexing:"default",splitCamelCase:!1,openInNewPane:!1,vimLikeNavigationShortcut:e.vault.getConfig("vimMode"),ribbonIcon:!0,showExcerpt:!0,maxEmbeds:5,renderLineReturnInExcerpts:!0,showCreateButton:!1,highlight:!0,showPreviousQueryResults:!0,simpleSearch:!1,tokenizeUrls:!1,fuzziness:"1",weightBasename:10,weightDirectory:7,weightH1:6,weightH2:5,weightH3:4,weightUnmarkedTags:2,weightCustomProperties:[],httpApiEnabled:!1,httpApiPort:"51361",httpApiNotice:!0,welcomeMessage:"",verboseLogging:!1,DANGER_httpHost:null,DANGER_forceSaveCache:!1}}async function J_(e){return Xr=Object.assign({},yc(e.app),await e.loadData()),aa.set(Xr.showExcerpt),Ep(Xr.verboseLogging),Xr}var Tc,aa,Uf,Xr,Gs=C(()=>{Tc=require("obsidian");pp();yn();$r();M_();U_();Y_();Q_();G_();z_();Oi();aa=Ls(!1),Uf=class extends Tc.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t,aa.subscribe(async r=>{Xr.showExcerpt=r,await Fe(this.plugin)})}display(){let{containerEl:t}=this;if(t.empty(),this.app.loadLocalStorage(ts)=="1"){let o=t.createEl("span"),c=document.createElement("strong");c.style.color="var(--text-accent)",c.textContent="\u26A0\uFE0F OMNISEARCH IS DISABLED \u26A0\uFE0F",o.appendChild(c)}t.createEl("h1",{text:"
`,"<br>")),t}catch(i){return new aE.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(i),""}}}});async function sE(e){let t=e.app;if(!t.plugins.getPlugin("obsidian-icon-folder"))return{};let n=`${t.vault.configDir}/plugins/obsidian-icon-folder/data.json`;try{let i=await t.vault.adapter.read(n),u=JSON.parse(i),o={};for(let c in u){let d=(0,Vs.normalizePath)(c);o[d]=u[c]}return o}catch(i){return Ri("Failed to read data.json:",i),{}}}async function oE(e){let t={Li:"lucide-icons"},r="icons",n=e.app,i=n.plugins.getPlugin("obsidian-icon-folder");if(i){r=i.settings?.iconPacksPath||"icons";let o=`${n.vault.configDir}/${r}`;try{let c=await n.vault.adapter.list(o);if(c.folders&&c.folders.length>0)for(let d of c.folders){let p=d.split("/"),A=p[p.length-1],g=Gw(A);t[g]=A}}catch(c){Ri("Failed to list icon packs:",c)}}return{prefixToIconPack:t,iconsPath:r}}function Gw(e){if(e.includes("-")){let t=e.split("-"),r=t[0].charAt(0).toUpperCase();for(let n=1;n<t.length;n++)r+=t[n].charAt(0).toLowerCase();return r}return e.charAt(0).toUpperCase()+e.charAt(1).toLowerCase()}function Cp(e,t){let r=(0,Vs.normalizePath)(e),n=t[r];if(n){if(typeof n=="string")return n;if(typeof n=="object"&&n.iconName)return n.iconName}return null}function Vw(e){let t=e.match(/^[A-Z][a-z]*/);if(t){let r=t[0],n=e.substring(r.length);return{prefix:r,name:n}}else return{prefix:"",name:e}}async function Sp(e,t,r,n){let i=Vw(e),{prefix:u,name:o}=i;if(!u)return`<spanclass="omnisearch-result__icon--emoji">${Yf(o)}</span>`;let c=n[u];if(!c)return Ri(`No icon pack found for prefix: ${u}`),null;if(c==="lucide-icons"){let d=o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=(0,Vs.getIcon)(d);returnp?p.outerHTML:(Ri(`Lucide icon not found: ${d}`),null)}else{if(!r)returnRi("Icons path is not set. Cannot load icon SVG."),null;letd=`${t.app.vault.configDir}/${r}/${c}/${o}.svg`;try{returnawaitt.app.vault.adapter.read(d)}catch(p){returnRi(`Failed to load icon SVG for ${e} at ${d}:`,p),null}}}functionNp(e){lett="file";e==="folder"?t="folder":Jn(e)?t="image":ki(e)?t="file-text":(Xi(e)||mc(e)||rs(e))&&(t="layout-dashboard");letr=(0,Vs.getIcon)(t);returnr?r.outerHTML:""}varVs,cE=C(()=>{Vs=require("obsidian");$r();Ip()});functionDp(e,t){Pr(t,!1);letr=()=>Wo(aa,"$showExcerpt",n),[n,i]=Go(),u=et(),o=et(),c=et(),d=et(),p=ze(t,"selected",8,!1),A=ze(t,"note",8),g=ze(t,"plugin",8),_=et(null),v=et(""),I=et(""),D={},B=et(null),Q=et(null),H={},se,ce=et(!1),me=et([]);Ja(async()=>{D=awaitsE(g());letst=awaitoE(g());H=st.prefixToIconPack,se=st.iconsPath,re(ce,!0)});asyncfunctionve(){letst=Cp(R(I),D);st?re(B,awaitSp(st,g(),se,H)):re(B,Np("folder"));letAt=Cp(A().path,D);At?re(Q,awaitSp(At,g(),se,H)):re(Q,Np(A().path))}functionle(st,At){letEt=newDOMParser,Ie=Et.parseFromString(At,"image/svg+xml").documentElement;returnst.appendChild(Ie),{update(Ge){letF=Et.parseFromString(Ge,"image/svg+xml").documentElement;st.replaceChild(F,Ie),Ie=F},destroy(){st.firstElementChild&&st.removeChild(st.firstElementChild)}}}letYe=null,tt=null,He=et(null);ar(()=>(Pe(A()),R(ce),pc),()=>{A()&&A().path&&R(ce)&&(async()=>(re(v,A().displayTitle||A().basename),re(I,pc(A().path)),awaitve()))()}),ar(()=>(Jn,Pe(A()),Pe(g()),Bi.TFile),()=>{if(re(_,null),Jn(A().path)){letst=g().app.vault.getAbstractFileByPath(A().path);stinstanceofBi.TFile&&re(_,g().app.vault.getResourcePath(st))}}),ar(()=>(Pe(A()),pc,Bi.setIcon,Jn,ki,Xi,mc,rs,R(He)),()=>{re(v,A().displayTitle||A().basename),re(I,pc(A().path)),Ye&&(0,Bi.setIcon)(Ye,"folder-open"),tt&&(Jn(A().path)?(0,Bi.setIcon)(tt,"image"):ki(A().path)?(0,Bi.setIcon)(tt,"file-text"):Xi(A().path)||mc(A().path)||rs(A().path)?(0,Bi.setIcon)(tt,"layout-dashboard"):(0,Bi.setIcon)(tt,"file")),R(He)&&(0,Bi.setIcon)(R(He),"corner-down-right")}),ar(()=>(Pe(g()),R(v),Pe(A())),()=>{re(u,g().textProcessor.getMatches(R(v),A().foundWords))}),ar(()=>(Pe(g()),R(I),Pe(A())),()=>{re(o,g().textProcessor.getMatches(R(I),A().foundWords))}),ar(()=>(Pe(A()),Pe(g())),()=>{A().matches.length>0
Inordertobeiterable,non-arrayobjectsmusthavea[Symbol.iterator]()method.`)}var Ve=!0,qe=!1,dt;return{s:function(){j=j.call(F)},n:function(){var Kt=j.next();return Ve=Kt.done,Kt},e:function(Kt){qe=!0,dt=Kt},f:function(){try{!Ve&&j.return!=null&&j.return()}finally{if(qe)throw dt}}}}function p(F,Y){if(F){if(typeof F=="string")return A(F,Y);var j=Object.prototype.toString.call(F).slice(8,-1);if(j==="Object"&&F.constructor&&(j=F.constructor.name),j==="Map"||j==="Set")return Array.from(F);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return A(F,Y)}}function A(F,Y){(Y==null||Y>F.length)&&(Y=F.length);for(var j=0,ie=new Array(Y);j<Y;j++)ie[j]=F[j];return ie}function g(F,Y){if(!(F instanceof Y))throw new TypeError("Cannot call a class as a function")}function _(F,Y){for(var j=0;j<Y.length;j++){var ie=Y[j];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(F,ie.key,ie)}}function v(F,Y,j){return Y&&_(F.prototype,Y),j&&_(F,j),Object.defineProperty(F,"prototype",{writable:!1}),F}function I(F,Y,j){return Y in F?Object.defineProperty(F,Y,{value:j,enumerable:!0,configurable:!0,writable:!0}):F[Y]=j,F}function D(F,Y,j){B(F,Y),Y.set(F,j)}function B(F,Y){if(Y.has(F))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(F,Y){var j=ce(F,Y,"get");return H(F,j)}function H(F,Y){return Y.get?Y.get.call(F):Y.value}function se(F,Y,j){var ie=ce(F,Y,"set");return me(F,ie,j),j}function ce(F,Y,j){if(!Y.has(F))throw new TypeError("attempted to "+j+" private field on non-instance");return Y.get(F)}function me(F,Y,j){if(Y.set)Y.set.call(F,j);else{if(!Y.writable)throw new TypeError("attempted to set read only private field");Y.value=j}}var ve=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",le=new WeakMap,Ye=new WeakMap,tt=(function(){function F(Y){var j=Y.executor,ie=j===void 0?function(){}:j,Ke=Y.internals,Ve=Ke===void 0?rt():Ke,qe=Y.promise,dt=qe===void 0?new Promise(function(kt,Kt){return ie(kt,Kt,function(mr){Ve.onCancelList.push(mr)})}):qe;g(this,F),D(this,le,{writable:!0,value:void 0}),D(this,Ye,{writable:!0,value:void 0}),I(this,ve,"CancelablePromise"),this.cancel=this.cancel.bind(this),se(this,le,Ve),se(this,Ye,dt||new Promise(function(kt,Kt){return ie(kt,Kt,function(mr){Ve.onCancelList.push(mr)})}))}return v(F,[{key:"then",value:function(j,ie){return Ie(Q(this,Ye).then(vt(j,Q(this,le)),vt(ie,Q(this,le))),Q(this,le))}},{key:"catch",value:function(j){return Ie(Q(this,Ye).catch(vt(j,Q(this,le))),Q(this,le))}},{key:"finally",value:function(j,ie){var Ke=this;return ie&&Q(this,le).onCancelList.push(j),Ie(Q(this,Ye).finally(vt(function(){if(j)return ie&&(Q(Ke,le).onCancelList=Q(Ke,le).onCancelList.filter(function(Ve){return Ve!==j})),j()},Q(this,le))),Q(this,le))}},{key:"cancel",value:function(){Q(this,le).isCanceled=!0;var j=Q(this,le).onCancelList;Q(this,le).onCancelList=[];var ie=d(j),Ke;try{for(ie.s();!(Ke=ie.n()).done;){var Ve=Ke.value;if(typeof Ve=="function")try{Ve()}catch(qe){console.error(qe)}}}catch(qe){ie.e(qe)}finally{ie.f()}}},{key:"isCanceled",value:function(){return Q(this,le).isCanceled===!0}}]),F})(),He=(function(F){t(j,F);var Y=n(j);function j(ie){return g(this,j),Y.call(this,{executor:ie})}return v(j)})(tt);e.CancelablePromise=He,I(He,"all",function(Y){return Ge(Y,Promise.all(Y))}),I(He,"allSettled",function(Y){return Ge(Y,Promise.allSettled(Y))}),I(He,"any",function(Y){return Ge(Y,Promise.any(Y))}),I(He,"race",function(Y){return Ge(Y,Promise.race(Y))}),I(He,"resolve",function(Y){return At(Promise.resolve(Y))}),I(He,"reject",function(Y){return At(Promise.reject(Y))}),I(He,"isCancelable",Et);var st=He;e.default=st;function At(F){return Ie(F,rt())}function Et(F){return F instanceof He||F instanceof tt}function vt(F,Y){if(F)return function(j){if(!Y.isCanceled){var ie=F(j);return Et(ie)&&Y.onCancelList.push(ie.cancel),ie}return j}}function Ie(F,Y){return new tt({internals:Y,promise:F})}function Ge(F,Y){var j=rt();return j.onCancelList.push(function(){var ie=d(F),Ke;try{for(ie.s();!(Ke=ie.n()).done;){var V
characters.</span>`,1),h6=$e("We found 0 results for your search here. <!>",1),p6=$e('<!> <div style="text-align: center;"><!></div>',1),m6=$e('<!> <!> <!> <div class="prompt-instructions"><div class="prompt-instruction"><span class="prompt-instruction-command">\u2191\u2193</span><span>to navigate</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to cycle history</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Tab</span> <span>to switch to In-File Search</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in a new pane</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in a new split</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to open in the background</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to create</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to create in a new pane</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to insert a link</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command"> </span> <span>to toggle excerpts</span></div> <div class="prompt-instruction"><span class="prompt-instruction-command">Esc</span><span>to close</span></div></div>',1);xf(["click"])});functionLp(e,t){Pr(t,!1);letr=et(),n=ze(t,"plugin",8),i=ze(t,"offset",8),u=ze(t,"note",8),o=ze(t,"index",8,0),c=ze(t,"selected",8,!1);ar(()=>(Pe(n()),Pe(u()),Pe(i())),()=>{re(r,n().textProcessor.makeExcerpt(u()?.content??"",i()))}),Ci(),Mn();{letd=Bn(()=>(Pe(o()),Te(()=>o().toString())));wc(e,{getid(){returnR(d)},getselected(){returnc()},$$events:{auxclick(p){xn.call(this,t,p)},click(p){xn.call(this,t,p)},mousemove(p){xn.call(this,t,p)}},children:(p,A)=>{varg=A6();Za(g,()=>(Pe(n()),R(r),Pe(u()),Te(()=>n().textProcessor.highlightText(R(r),u().matches))),!0),_e(g),Se(p,g)},$$slots:{default:!0}})}Mr()}varA6,TE=C(()=>{Ai();Zi();Pn();wp();A6=$e('<div class="omnisearch-result__body"></div>')});functionPp(e,t){Pr(t,!1);letr=ze(t,"plugin",8),n=ze(t,"modal",8),i=ze(t,"parent",8,null),u=ze(t,"singleFilePath",8,""),o=ze(t,"previousQuery",8),c=et(),d=et([]),p=et(0),A=et(),g=et();Ja(()=>{Qe.enable("infile"),Qe.on("infile","enter",H),Qe.on("infile","open-in-new-pane",B),Qe.on("infile","arrow-up",()=>I(-1)),Qe.on("infile","arrow-down",()=>I(1)),Qe.on("infile","tab",se)}),Sf(()=>{Qe.disable("infile")});function_(Ie){letGe=[],rt=-1,F=0;for(;++F<100;){letY=v(Ie,rt,hc);if(!Y.length)break;rt=Y.last().offset,Ge.push(Y)}returnGe}functionv(Ie,Ge,rt){letF=Ie.find(Y=>Y.offset>Ge);returnF?Ie.filter(Y=>Y.offset>Ge&&Y.offset<=F.offset+rt):[]}functionI(Ie){re(p,Ff(R(p)+Ie,R(d).length)),D()}asyncfunctionD(){awaitSi(),document.querySelector(`[data-result-id="${R(p)}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}asyncfunctionB(){returnH(!0)}asyncfunctionQ(Ie){letGe=r().settings.openInNewPane?!Ie.ctrlKey:!!Ie.ctrlKey;returnH(Ge)}asyncfunctionH(Ie=!1){if(R(A)){n().close(),i()&&i().close();letGe=R(d)[R(p)]??0;awaitMf(r(),R(A),Ge,Ie)}}functionse(){newCu(r(),R(c)??o()).open(),n().close()}ar(()=>Pe(o()),()=>{re(c,o()??"")}),ar(()=>(R(c),R(g),Iu,Pe(r()),Pe(u())),()=>{(async()=>(R(c)&&(re(g,newIu(R(c),{ignoreDiacritics:r().settings.ignoreDiacritics,ignoreArabicDiacritics:r().settings.ignoreArabicDiacritics})),re(A,(awaitr().searchEngine.getSuggestions(R(g),{singleFilePath:u()}))[0]??null)),re(p,0),awaitD()))()}),ar(()=>(R(A),R(g)),()=>{if(R(A)){letIe=_(R(A).matches),Ge=R(g).getExactTerms();Ge.length&&(Ie=Ie.filter(rt=>Ge.every(F=>rt.some(Y=>Y.match.includes(F))))),re(d,Ie.map(rt=>Math.round(rt.first().offset)))}}),Ci(),Mn();varce=x6(),me=jr(ce);_c(me,{getplugin(){returnr()},pl
`,e=e.substring(me.length+1),g=ve.slice(I)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(A),loose:!1,text:A,tokens:[]}),i.raw+=p}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&(p?.type==="text"||p?.type==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let A=this.rules.other.listTaskCheckbox.exec(d.raw);if(A){let g={type:"checkbox",raw:A[0]+" ",checked:A[0]!=="[ ]"};d.checked=g.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=g.raw+d.tokens[0].raw,d.tokens[0].text=g.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(g)):d.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):d.tokens.unshift(g)}}else d.task&&(d.task=!1);if(!i.loose){let A=d.tokens.filter(_=>_.type==="space"),g=A.length>0&&A.some(_=>this.rules.other.anyLine.test(_.raw));i.loose=g}}if(i.loose)for(let d of i.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let r=E2(t[0]);return{type:"html",block:!0,raw:r,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:r}}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:sa(t[0],`
`),header:[],align:[],rows:[]};if(r.length===n.length){for(let o of n)this.rules.other.tableAlignRight.test(o)?u.align.push("right"):this.rules.other.tableAlignCenter.test(o)?u.align.push("center"):this.rules.other.tableAlignLeft.test(o)?u.align.push("left"):u.align.push(null);for(let o=0;o<r.length;o++)u.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:u.align[o]});for(let o of i)u.rows.push(_2(o,u.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:u.align[d]})));return u}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let r=t[1].trim();return{type:"heading",raw:sa(t[0],`
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(u);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}returnthis.state.top=!0,r}inline(t,r=[]){returnthis.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;letn=t;if(this.tokens.links){letc=Object.keys(this.tokens.links);c.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,d=>c.includes(d.slice(d.lastIndexOf("[")+1,-1))?"["+"a".repeat(d.length-2)+"]":d))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),n=n.replace(this.tokenizer.rules.inline.blockSkip,(c,d,p)=>{letA=p?p.length:0;returnc.slice(0,A)+"["+"a".repeat(c.length-A-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;leti=!1,u="",o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}i||(u=""),i=!1;letc;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},t,r))?(t=t.substring(c.raw.length),r.push(c),!0):!1))continue;if(c=this.tokenizer.escape(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.tag(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.link(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(c.raw.length);letp=r.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):r.push(c);continue}if(c=this.tokenizer.emStrong(t,n,u)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.codespan(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.br(t)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.del(t,n,u)){t=t.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.autolink(t)){t=t.substring(c.raw.length),r.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(t))){t=t.substring(c.raw.length),r.push(c);continue}letd=t;if(this.options.extensions?.startInline){letp=1/0,A=t.slice(1),g;this.options.extensions.startInline.forEach(_=>{g=_.call({lexer:this},A),typeofg=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(c=this.tokenizer.inlineText(d)){t=t.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(u=c.raw.slice(-1)),i=!0;letp=r.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):r.push(c);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}returnr}infiniteLoopError(t){letr="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);elsethrownewError(r)}},Rc=class{options;parser;constructor(e){this.options=e||oa}space(e){return""}code({text:e,lang:t,escaped:r}){letn=(t||"").match(en.notSpaceStart)?.[0],i=e.replace(en.endingNewline,"")+`
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${tu(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){letn=this.parser.parseInline(r),i=b2(e);if(i===null)returnn;e=i;letu='<a href="'+e+'"';returnt&&(u+=' title="'+tu(t)+'"'),u+=">"+n+"</a>",u}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));leti=b2(e);if(i===null)returntu(r);e=i;letu=`<img src="${e}" alt="${tu(r)}"`;returnt&&(u+=` title="${tu(t)}"`),u+=">",u}text(e){return"tokens"ine&&e.tokens?this.parser.parseInline(e.tokens):"escaped"ine&&e.escaped?e.text:tu(e.text)}},a0=class{strong({text:e}){returne}em({text:e}){returne}codespan({text:e}){returne}del({text:e}){returne}html({text:e}){returne}text({text:e}){returne}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){returne}},ti=classim{options;renderer;textRenderer;constructor(t){this.options=t||oa,this.options.renderer=this.options.renderer||newRc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=newa0}staticparse(t,r){returnnewim(r).parse(t)}staticparseInline(t,r){returnnewim(r).parseInline(t)}parse(t){this.renderer.parser=this;letr="";for(letn=0;n<t.length;n++){leti=t[n];if(this.options.extensions?.renderers?.[i.type]){leto=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){r+=c||"";continue}}letu=i;switch(u.type){case"space":{r+=this.renderer.space(u);break}case"hr":{r+=this.renderer.hr(u);break}case"heading":{r+=this.renderer.heading(u);break}case"code":{r+=this.renderer.code(u);break}case"table":{r+=this.renderer.table(u);break}case"blockquote":{r+=this.renderer.blockquote(u);break}case"list":{r+=this.renderer.list(u);break}case"checkbox":{r+=this.renderer.checkbox(u);break}case"html":{r+=this.renderer.html(u);break}case"def":{r+=this.renderer.def(u);break}case"paragraph":{r+=this.renderer.paragraph(u);break}case"text":{r+=this.renderer.text(u);break}default:{leto='Token with "'+u.type+'" type was not found.';if(this.options.silent)returnconsole.error(o),"";thrownewError(o)}}}returnr}parseInline(t,r=this.renderer){this.renderer.parser=this;letn="";for(leti=0;i<t.length;i++){letu=t[i];if(this.options.extensions?.renderers?.[u.type]){letc=this.options.extensions.renderers[u.type].call({parser:this},u);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){n+=c||"";continue}}leto=u;switch(o.type){case"escape":{n+=r.text(o);break}case"html":{n+=r.html(o);break}case"link":{n+=r.link(o);break}case"image":{n+=r.image(o);break}case"checkbox":{n+=r.checkbox(o);break}case"strong":{n+=r.strong(o);break}case"em":{n+=r.em(o);break}case"codespan":{n+=r.codespan(o);break}case"br":{n+=r.br(o);break}case"del":{n+=r.del(o);break}case"text":{n+=r.text(o);break}default:{letc='Token with "'+o.type+'" type was not found.';if(this.options.silent)returnconsole.error(c),"";thrownewError(c)}}}returnn}},js=class{options;block;constructor(e){this.options=e||oa}staticpassThroughHooks=newSet(["preprocess","postprocess","processAllTokens","emStrongMask"]);staticpassThroughHooksRespectAsync=newSet(["preprocess","postprocess","processAllTokens"]);preprocess(e){returne}postprocess(e){returne}processAllTokens(e){returne}emStrongMask(e){returne}provideLexer(e=this.block){returne?ei.lex:ei.lexInline}provideParser(e=this.block){returne?ti.parse:ti.parseInline}},R2=class{defaults=n0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ti;Renderer=Rc;TextRenderer=a0;Lexer=ei;Tokenizer=kc;Hooks=js;constructor(...e){this.use(...e)}walkTokens(e,t){letr=[];for(letnofe)switch(r=r.concat(t.call(this,n)),n.type){case"table":
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});functiongA(e,t){returne===si.default.falseFunc?si.default.falseFunc:r=>t.isTag(r)&&e(r)}functionbA(e,t){letr=t.getSiblings(e);if(r.length<=1)return[];letn=r.indexOf(e);returnn<0||n===r.length-1?[]:r.slice(n+1).filter(t.isTag)}functionmA(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}varsi,AA,pA,k0,R0=C(()=>{si=Qn(ha(),1);lA();AA={};pA=(e,t,r,n,i)=>{letu=i(t,mA(r),n);returnu===si.default.trueFunc?e:u===si.default.falseFunc?si.default.falseFunc:o=>u(o)&&e(o)},k0={is:pA,matches:pA,where:pA,not(e,t,r,n,i){letu=i(t,mA(r),n);returnu===si.default.falseFunc?e:u===si.default.trueFunc?si.default.falseFunc:o=>!u(o)&&e(o)},has(e,t,r,n,i){let{adapter:u}=r,o=mA(r);o.relativeSelector=!0;letc=t.some(A=>A.some(qc))?[AA]:void0,d=i(t,o,c);if(d===si.default.falseFunc)returnsi.default.falseFunc;letp=gA(d,u);if(c&&d!==si.default.trueFunc){let{shouldTestNextSiblings:A=!1}=d;returng=>{if(!e(g))return!1;c[0]=g;let_=u.getChildren(g),v=A?[..._,...bA(g,u)]:_;returnu.existsOne(p,v)}}returnA=>e(A)&&u.existsOne(p,u.getChildren(A))}}});functionzv(e,t,r,n,i){varu;let{name:o,data:c}=t;if(Array.isArray(c)){if(!(oink0))thrownewError(`Unknown pseudo-class :${o}(${c})`);returnk0[o](e,c,r,n,i)}letd=(u=r.pseudos)===null||u===void0?void0:u[o],p=typeofd=="string"?d:D0[o];if(typeofp=="string"){if(c!=null)thrownewError(`Pseudo ${o} doesn't have any arguments`);letA=Ru(p);returnk0.is(e,A,r,n,i)}if(typeofd=="function")returnhA(d,o,c,1),A=>d(A,c)&&e(A);if(oinho)returnho[o](e,c,r,n);if(oinJc){letA=Jc[o];returnhA(A,o,c,2),g=>A(g,r,c)&&e(g)}thrownewError(`Unknown pseudo-class :${o}`)}var_A=C(()=>{lo();Gv();Vv();qv();R0()});functionEA(e,t){letr=t.getParent(e);returnr&&t.isTag(r)?r:null}functionJv(e,t,r,n,i){let{adapter:u,equals:o}=r;switch(t.type){caseEe.PseudoElement:thrownewError("Pseudo-elements are not supported by css-select");caseEe.ColumnCombinator:thrownewError("Column combinators are not yet supported by css-select");caseEe.Attribute:{if(t.namespace!=null)thrownewError("Namespaced attributes are not yet supported by css-select");return(!r.xmlMode||r.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),Mv[t.action](e,t,r)}caseEe.Pseudo:returnzv(e,t,r,n,i);caseEe.Tag:{if(t.namespace!=null)thrownewError("Namespaced tag names are not yet supported by css-select");let{name:c}=t;return(!r.xmlMode||r.lowerCaseTags)&&(c=c.toLowerCase()),function(p){returnu.getName(p)===c&&e(p)}}caseEe.Descendant:{if(r.cacheResults===!1||typeofWeakSet>"u")returnfunction(p){letA=p;for(;A=EA(A,u);)if(e(A))return!0;return!1};letc=newWeakSet;returnfunction(p){letA=p;for(;A=EA(A,u);)if(!c.has(A)){if(u.isTag(A)&&e(A))return!0;c.add(A)}return!1}}case"_flexibleDescendant":returnfunction(d){letp=d;doif(e(p))return!0;while(p=EA(p,u));return!1};caseEe.Parent:returnfunction(d){returnu.getChildren(d).some(p=>u.isTag(p)&&e(p))};caseEe.Child:returnfunction(d){letp=u.getParent(d);returnp!=null&&u.isTag(p)&&e(p)};caseEe.Sibling:returnfunction(d){letp=u.getSiblings(d);for(letA=0;A<p.length;A++){letg=p[A];if(o(d,g))break;if(u.isTag(g)&&e(g))return!0}return!1};caseEe.Adjacent:returnu.prevElementSibling?function(d){letp=u.prevElementSibling(d);returnp!=null&&e(p)}:funct
`)})):{name:i,value:u.replace(vx,`\r
`)}}).toArray()}var Ex,gS,vx,xx=C(()=>{Kr();Ex="input,select,textarea,keygen",gS=/%20/g,vx=/\r?\n/g});var HA={};mn(HA,{extract:()=>vS});function ES(e){var t;return typeof e=="string"?{selector:e,value:"textContent"}:{selector:e.selector,value:(t=e.value)!==null&&t!==void 0?t:"textContent"}}function vS(e){let t={};for(let r in e){let n=e[r],i=Array.isArray(n),{selector:u,value:o}=ES(i?n[0]:n),c=typeof o=="function"?o:typeof o=="string"?d=>this._make(d).prop(o):d=>this._make(d).extract(o);if(i)t[r]=this._findBySelector(u,Number.POSITIVE_INFINITY).map((d,p)=>c(p,r,t)).get();else{let d=this._findBySelector(u,1);t[r]=d.length>0?c(d[0],r,t):void 0}}return t}var yx=C(()=>{});var Aa,Tx=C(()=>{Nv();dx();Ax();_x();xx();yx();Aa=class{constructor(t,r,n){if(this.length=0,this.options=n,this._root=r,t){for(let i=0;i<t.length;i++)this[i]=t[i];this.length=t.length}}};Aa.prototype.cheerio="[cheerio object]";Aa.prototype.splice=Array.prototype.splice;Aa.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator];Object.assign(Aa.prototype,aA,BA,FA,PA,MA,HA)});function wx(e,t){return function r(n,i,u=!0){if(n==null)throw new Error("cheerio.load() expects a string");let o=Hc(i),c=e(n,o,u,null);class d extends Aa{_make(g,_){let v=p(g,_);return v.prevObject=this,v}_parse(g,_,v,I){return e(g,_,v,I)}_render(g){return t(g,this.options)}}function p(A,g,_=c,v){if(A&&ui(A))return A;let I=Hc(v,o),D=typeof _=="string"?[e(_,I,!1,null)]:"length"in _?_:[_],B=ui(D)?D:new d(D,null,I);if(B._root=B,!A)return new d(void 0,B,I);let Q=typeof A=="string"&&$c(A)?e(A,I,!1,null).children:xS(A)?[A]:Array.isArray(A)?A:void 0,H=new d(Q,B,I);if(Q)return H;if(typeof A!="string")throw new TypeError("Unexpected type of selector");let se=A,ce=g?typeof g=="string"?$c(g)?new d([e(g,I,!1,null)],B,I):(se=`${g}${se}`,B):ui(g)?g:new d(Array.isArray(g)?g:[g],B,I):B;return ce?ce.find(se):H}return Object.assign(p,Wm,{load:r,_root:c,_options:o,fn:d.prototype,prototype:d.prototype}),p}}function xS(e){return!!e.name||e.type===ri.Root||e.type===ri.Text||e.type===ri.Comment}var Ix=C(()=>{Km();uo();Tx();ao();Qc()});function U0(e){return e>=55296&&e<=57343}function Cx(e){return e>=56320&&e<=57343}function Sx(e,t){return(e-55296)*1024+9216+t}function $0(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Y0(e){return e>=64976&&e<=65007||yS.has(e)}var yS,Dt,x,hn,K0=C(()=>{yS=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Dt="\uFFFD";(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(x||(x={}));hn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"}});var $,Xc=C(()=>{(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.
`)}catch(A){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(A)}elseJn(t)?this.plugin.settings.aiImageIndexing&&o?.canBeAnalyzed(n)?i=awaito.analyzeImage(n):this.plugin.settings.imagesIndexing&&u?.canFileBeExtracted(t)&&(i=awaitu.extractText(n)):ki(t)&&this.plugin.settings.PDFIndexing&&u?.canFileBeExtracted(t)?i=awaitu.extractText(n):S_(t)&&this.plugin.settings.officeIndexing&&u?.canFileBeExtracted(t)?i=awaitu.extractText(n):this.plugin.notesIndexer.isFilenameIndexable(t)&&(i=n.path);i==null&&(Ri(`Omnisearch: ${i} content for file`,n.path),i="");letc=r.metadataCache.getFileCache(n);if(c){letA=B_(this.plugin.app,n,c);for(letgofA.filter(_=>!this.documents.has(_))){let_=this.plugin.notesIndexer.generateIndexableNonexistingDocument(g,n.path)}if(c.frontmatter?.["excalidraw-plugin"]){letg=c.sections?.filter(_=>_.type==="comment")??[];for(let{start:_,end:v}ofg.map(I=>I.position))i=i.substring(0,_.offset-1)+i.substring(v.offset)}}letd;this.plugin.settings.displayTitle==="#heading"?d=c?.headings?.find(A=>A.level===1)?.heading??"":d=c?.frontmatter?.[this.plugin.settings.displayTitle]??"";letp=C_(c);return{basename:n.basename,displayTitle:d,content:i,cleanedContent:w_(Di(i)),path:n.path,mtime:n.stat.mtime,tags:p,unmarkedTags:p.map(A=>A.replace("#","")),aliases:I_(c).join(""),headings1:c?Lf(c,1).join(" "):"",headings2:c?Lf(c,2).join(" "):"",headings3:c?Lf(c,3).join(" "):""}}}});varhd,Wy=C(()=>{xc();$r();hd=class{constructor(t){this.plugin=t;this.notesToReindex=newSet}flagNoteForReindex(t){this.notesToReindex.add(t)}asyncrefreshIndex(){for(letrofthis.notesToReindex)Je("Updating file",r.path),awaitthis.plugin.documentsRepository.addDocument(r.path);lett=[...this.notesToReindex].map(r=>r.path);t.length&&(this.plugin.searchEngine.removeFromPaths(t),awaitthis.plugin.searchEngine.addFromPaths(t),this.notesToReindex.clear())}isFileIndexable(t){returnthis.plugin.settings.hideExcluded&&this.plugin.app.metadataCache.isUserIgnored&&this.plugin.app.metadataCache.isUserIgnored(t)?!1:this.isFilenameIndexable(t)||this.isContentIndexable(t)}isContentIndexable(t){letr=this.plugin.settings,n=!!this.plugin.getTextExtractor(),i=!!this.plugin.getAIImageAnalyzer(),u=n&&r.PDFIndexing,o=n&&r.imagesIndexing,c=i&&r.aiImageIndexing;returnthis.isFilePlaintext(t)||Xi(t)||Ac(t)||u&&ki(t)||o&&Jn(t)||c&&Jn(t)}isFilenameIndexable(t){returnthis.canIndexUnsupportedFiles()||this.isFilePlaintext(t)||Xi(t)||rs(t)||Ac(t)}canIndexUnsupportedFiles(){returnthis.plugin.settings.unsupportedFilesIndexing==="yes"||this.plugin.settings.unsupportedFilesIndexing==="default"&&!!this.plugin.app.vault.getConfig("showUnsupportedFiles")}generateIndexableNonexistingDocument(t,r){returnt=yp(t),{path:t+(t.endsWith(".md")?"":".md"),basename:t,displayTitle:"",mtime:0,content:"",cleanedContent:"",tags:[],unmarkedTags:[],aliases:"",headings1:"",headings2:"",headings3:"",doesNotExist:!0,parent:r}}isFilePlaintext(t){return[...this.plugin.settings.indexedFileTypes,"md"].some(r=>t.endsWith(`.${r}`))||this.plugin.settings.indexFilesWithoutExtension&&!t.includes(".")}}});varmd,pd,Gy=C(()=>{md=require("obsidian");$r();pd=class{constructor(t){this.plugin=t;this.embeds=newMap}addEmbed(t,r){this.embeds.has(t)||this.embeds.set(t,newSet),this.embeds.get(t).add(r)}removeFile(t){this.embeds.delete(t),this.refreshEmbedsForNote(t)}renameFile(t,r){this.embeds.has(t)&&(this.embeds.set(r,this.embeds.get(t)),this.embeds.delete(t)),this.embeds.forEach((n,i)=>{n.has(t)&&(n.delete(t),n.add(r))})}refreshEmbedsForNote(t){this.embeds.forEach((r,n)=>{r.has(t)&&r.delete(t)}),this.addEmbedsForNote(t)}getEmbeds(t){returnthis.embeds.has(t)?[...this.embeds.get(t)]:[]}asyncwriteToCache(){Je("Writing embeds to cache");lett=this.plugin.database,r=[];for(let[n,i]ofthis.embeds)r.push({embedded:n,referencedBy:[...i]});awaitt.embeds.clear(),awaitt.embeds.bulkAdd(r)}asyncloadFromCache(){try{lett=this.plugin.database;if(!t.embeds){Je("No embeds in cache");return}Je("Loading embeds from cache");letr=awaitt.embeds.toArray();for(let{embedded:n,referencedBy:i}ofr