Files
my-vault/.obsidian/plugins/omnisearch/main.js
T

175 lines
702 KiB
JavaScript
Raw Normal View History

2026-01-05 13:03:55 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var bT=Object.create;var Ul=Object.defineProperty;var _T=Object.getOwnPropertyDescriptor;var ET=Object.getOwnPropertyNames;var vT=Object.getPrototypeOf,xT=Object.prototype.hasOwnProperty;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var ka=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(var r in t)Ul(e,r,{get:t[r],enumerable:!0})},Yg=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ET(t))!xT.call(e,i)&&i!==r&&Ul(e,i,{get:()=>t[i],enumerable:!(n=_T(t,i))||n.enumerable});return e};var Qn=(e,t,r)=>(r=e!=null?bT(vT(e)):{},Yg(t||!e||!e.__esModule?Ul(r,"default",{value:e,enumerable:!0}):r,e)),eh=e=>Yg(Ul({},"__esModule",{value:!0}),e);var Kg=C(()=>{});var Ai=C(()=>{Kg();typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5")});var Ui,Tt,En,$l,Fo,th,ft=C(()=>{Ui={},Tt=Symbol("uninitialized"),En=Symbol("filename"),$l="http://www.w3.org/1999/xhtml",Fo="http://www.w3.org/2000/svg",th="http://www.w3.org/1998/Math/MathML"});var Yl,Qg=C(()=>{Yl=!0});var Wg,G,Gg=C(()=>{Wg=globalThis.process?.env?.NODE_ENV,G=Wg&&!Wg.toLowerCase().startsWith("prod")});var Vg=C(()=>{});var Xe=C(()=>{Qg();Gg();Vg()});function Gu(e){return typeof e=="function"}function Jg(e){return e()}function Ts(e){for(var t=0;t<e.length;t++)e[t]()}function Ql(){var e,t,r=new Promise((n,i)=>{e=n,t=i});return{promise:r,resolve:e,reject:t}}var gi,qg,Wu,ys,rh,br,Rr,Kl,nh,zg,Ra,ih,Mt,st=C(()=>{gi=Array.isArray,qg=Array.prototype.indexOf,Wu=Array.prototype.includes,ys=Array.from,rh=Object.keys,br=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Kl=Object.getOwnPropertyDescriptors,nh=Object.prototype,zg=Array.prototype,Ra=Object.getPrototypeOf,ih=Object.isExtensible;Mt=()=>{}});var tr,ws,jg,Wl,Gl,Po,Mo,Ho,Vu,uh,lu,ah,Oa,Dn,Ve=C(()=>{tr=Symbol("$state"),ws=Symbol("legacy props"),jg=Symbol(""),Wl=Symbol("proxy path"),Gl=Symbol("attributes"),Po=Symbol("class"),Mo=Symbol("style"),Ho=Symbol("text"),Vu=Symbol("form reset"),uh=Symbol("hmr anchor"),lu=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ah=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Oa=3,Dn=8});function Zg(e){if(G){let t=new Error(`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/invariant_violation`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function Is(e){if(G){let t=new Error(`lifecycle_outside_component
2026-01-05 13:03:55 +08:00
\`${e}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var Uo=C(()=>{Xe()});function e1(){if(G){let e=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function sh(){if(G){let e=new Error("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");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function t1(){if(G){let e=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function oh(e,t,r){if(G){let n=new Error(`each_key_duplicate
${r?`Keyed each block has duplicate key \`${r}\` at indexes ${e} and ${t}`:`Keyed each block has duplicate key at indexes ${e} and ${t}`}
https://svelte.dev/e/each_key_duplicate`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function r1(e,t,r){if(G){let n=new Error(`each_key_volatile
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
https://svelte.dev/e/each_key_volatile`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function n1(e){if(G){let t=new Error(`effect_in_teardown
\`${e}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function i1(){if(G){let e=new Error("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");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function u1(e){if(G){let t=new Error(`effect_orphan
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function a1(){if(G){let e=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function s1(){if(G){let e=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function o1(e){if(G){let t=new Error(`props_invalid_value
Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function c1(e){if(G){let t=new Error(`rune_outside_svelte
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function l1(){if(G){let e=new Error("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");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function f1(){if(G){let e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function d1(){if(G){let e=new Error("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");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function h1(){if(G){let e=new Error("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");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var _r=C(()=>{Xe();Uo()});function p1(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\`
https://svelte.dev/e/await_reactivity_loss`,$i,Yi):console.warn("https://svelte.dev/e/await_reactivity_loss")}function m1(e,t){G?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${e}\` (${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
https://svelte.dev/e/await_waterfall`,$i,Yi):console.warn("https://svelte.dev/e/await_waterfall")}function A1(){G?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,$i,Yi):console.warn("https://svelte.dev/e/derived_inert")}function g1(e,t,r){G?console.warn(`%c[svelte] hydration_attribute_changed
%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
https://svelte.dev/e/hydration_attribute_changed`,$i,Yi):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function b1(e){G?console.warn(`%c[svelte] hydration_html_changed
%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"}
https://svelte.dev/e/hydration_html_changed`,$i,Yi):console.warn("https://svelte.dev/e/hydration_html_changed")}function qu(e){G?console.warn(`%c[svelte] hydration_mismatch
%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"}
https://svelte.dev/e/hydration_mismatch`,$i,Yi):console.warn("https://svelte.dev/e/hydration_mismatch")}function _1(){G?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,$i,Yi):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Vl(e){G?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,$i,Yi):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function E1(){G?console.warn(`%c[svelte] state_proxy_unmount
%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")}function v1(){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,fr=C(()=>{Xe();$i="font-weight: bold",Yi="font-weight: normal"});function Gt(e){de=e}function ct(e){if(e===null)throw qu(),Ui;return ke=e}function rr(){return ct(vr(ke))}function Ee(e){if(de){if(vr(ke)!==null)throw qu(),Ui;ke=e}}function Br(e=1){if(de){for(var t=e,r=ke;t--;)r=vr(r);ke=r}}function bi(e=!0){for(var t=0,r=ke;;){if(r.nodeType===Dn){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var i=vr(r);e&&r.remove(),r=i}}function Ds(e){if(!e||e.nodeType!==Dn)throw qu(),Ui;return e.data}var de,ke,gt=C(()=>{Ve();ft();fr();nr();de=!1});function ql(e){return e===this.v}function $o(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function zl(e){return!$o(e,this.v)}var Yo=C(()=>{});function x1(){Ki=!0}var ir,Ki,_i,cn=C(()=>{ir=!1,Ki=!1,_i=!1});var ch=C(()=>{Xe()});var ks=C(()=>{Xe();ch();st()});function Gr(e,t){return e.label=t,jl(e.v,t),e}function jl(e,t){return e?.[Wl]?.(t),e}var Ko,zu=C(()=>{ft();ks();Ve();Be();Ke();Ko=null});function Ei(e){let t=new Error,r=TT();return r.length===0?null:(r.unshift(`
`),br(t,"stack",{value:r.join(`
`)}),br(t,"name",{value:e}),t)}function TT(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(`
`),n=[];for(let i=0;i<r.length;i++){let u=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)}}return n}function T1(e,t){if(!G)throw new Error("invariant(...) was not guarded by if (DEV)");e||Zg(t)}var Ba=C(()=>{Xe();st();Uo()});function du(e){Ue=e}function Rs(e){Qi=e}function Zl(e){kn=e}function dr(e,t=!1,r){Ue={p:Ue,i:!1,c:null,e:null,s:e,x:null,r:fe,l:Ki&&!t?{s:null,u:null,$:[]}:null},G&&(Ue.function=r,kn=r)}function hr(e){var t=Ue,r=t.e;if(r!==null){t.e=null;for(var n of r)lh(n)}return e!==void 0&&(t.x=e),t.i=!0,Ue=t.p,G&&(kn=Ue?.function??null),e??{}}function Wi(){return!Ki||Ue!==null&&Ue.l===null}var Ue,Qi,kn,Bt=C(()=>{Xe();_r();Ke();Be();cn();ft();Ve();Ue=null;Qi=null;kn=null});function w1(){var e=La;La=[],Ts(e)}function Ht(e){if(La.length===0&&!Fa){var t=La;queueMicrotask(()=>{t===La&&w1()})}La.push(e)}function I1(){for(;La.length>0;)w1()}var La,Gn=C(()=>{st();Lr();La=[]});function Xl(e){var t=fe;if(t===null)return Se.f|=8388608,e;if(G&&e instanceof Error&&!fh.has(e)&&fh.set(e,wT(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw G&&!t.parent&&e instanceof Error&&C1(e),e;xi(e,t)}function xi(e,t){if(!(t!==null&&(t.f&16384)!==0)){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw G&&e instanceof Error&&C1(e),e}}function wT(e,t){let r=Rr(e,"message");if(!(r&&!r.configurable)){for(var n=Go?" ":" ",i=`
${n}in ${t.fn?.name||"<unknown>"}`,u=t.ctx;u!==null;)i+=`
${n}in ${u.function?.[En].split("/").pop()}`,u=u.p;return{message:e.message+`
${i}
`,stack:e.stack?.split(`
`).filter(o=>!o.includes("svelte/src/internal")).join(`
`)}}}function C1(e){let t=fh.get(e);t&&(br(e,"message",{value:t.message}),br(e,"stack",{value:t.stack}))}var fh,Wo=C(()=>{Xe();ft();nr();Ve();st();Ke();fh=new WeakMap});function mt(e,t){e.f=e.f&IT|t}function Os(e){(e.f&512)!==0||e.deps===null?mt(e,1024):mt(e,4096)}var IT,Ju=C(()=>{Ve();IT=-7169});function S1(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,S1(t.deps))}function ef(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),S1(e.deps),mt(e,1024)}var dh=C(()=>{Ve();Ju()});function tf(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Mt;let n=Te(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var hh=C(()=>{Ke();st()});function Ls(e,t=Mt){let r=null,n=new Set;function i(c){if($o(e,c)&&(e=c,r)){let d=!Bs.length;for(let p of n)p[1](),Bs.push(p,e);if(d){for(let p=0;p<Bs.length;p+=2)Bs[p][0](Bs[p+1]);Bs.length=0}}}function u(c){i(c(e))}function o(c,d=Mt){let p=[c,d];return n.add(p),n.size===1&&(r=t(i,u)||Mt),c(e),()=>{n.delete(p),n.size===0&&r&&(r(),r=null)}}return{set:i,update:u,subscribe:o}}function rf(e){let t;return tf(e,r=>t=r)(),t}var Bs,nf=C(()=>{st();Yo();hh();Bs=[]});function Vo(e,t,r){let n=r[t]??={store:null,source:et(void 0),unsubscribe:Mt};if(G&&(n.source.label=t),n.store!==e&&!(ph in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=Mt;else{var i=!0;n.unsubscribe=tf(e,u=>{i?n.source.v=u:ie(n.source,u)}),i=!1}return e&&ph in r?rf(e):B(n.source)}function qo(){let e={};function t(){pr(()=>{for(var r in e)e[r].unsubscribe();br(e,ph,{enumerable:!1,value:!0})})}return[e,t]}function mh(e){var t=uf;try{return uf=!1,[e(),uf]}finally{uf=t}}var N1,uf,ph,zo=C(()=>{hh();nf();st();Ke();Be();qr();Xe();N1=!1,uf=!1,ph=Symbol("unmounted")});var D1=C(()=>{Ve();ks();Ke()});function af(){k1||(k1=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Vu]?.()})},{capture:!0}))}var k1,sf=C(()=>{gt();nr();Gn();Ve();k1=!1});function xn(e){var t=Se,r=fe;ar(null),$t(null);try{return e()}finally{ar(t),$t(r)}}function Ah(e,t,r,n=r){e.addEventListener(t,()=>xn(r));let i=e[Vu];i?e[Vu]=()=>{i(),n(!0)}:e[Vu]=()=>n(!0),af()}var Rn=C(()=>{Be();Ke();Ve();sf()});function gh(e){let t=0,r=zr(0),n;return G&&Gr(r,"createSubscriber version"),()=>{fu()&&(B(r),qt(()=>(t===0&&(n=Te(()=>e(()=>Pa(r)))),t+=1,()=>{Ht(()=>{t-=1,t===0&&(n?.(),n=void 0,Pa(r))})})))}}var bh=C(()=>{Ke();Be();qr();zu();Xe();Gn()});function Eh(e,t,r,n){new _h(e,t,r,n)}var CT,_h,of=C(()=>{Ve();ft();Bt();Wo();Be();Ke();gt();Gn();_r();fr();Xe();Lr();qr();zu();bh();nr();dh();CT=589824;_h=class{parent;is_pending=!1;transform_error;#e;#t=de?ke:null;#r;#o;#u;#a=null;#n=null;#s=null;#i=null;#m=0;#l=0;#f=!1;#d=new Set;#A=new Set;#c=null;#_=gh(()=>(this.#c=zr(this.#m),G&&Gr(this.#c,"$effect.pending()"),()=>{this.#c=null}));constructor(t,r,n,i){this.#e=t,this.#r=r,this.#o=u=>{var o=fe;o.b=this,o.f|=128,n(u)},this.parent=fe.b,this.transform_error=i??this.parent?.transform_error??(u=>u),this.#u=yn(()=>{if(de){let u=this.#t;rr();let o=u.data==="[!";if(u.data.startsWith("[?")){let d=JSON.parse(u.data.slice("[?".length));this.#E(d)}else o?this.#x():this.#g()}else this.#h()},CT),de&&(this.#e=ke)}#g(){try{this.#a=Ar(()=>this.#o(this.#e))}catch(t){this.error(t)}}#E(t){let r=this.#r.failed,{reset:n,invoke_onerror:i}=this.#v(t);Ht(i),r&&(this.#s=Ar(()=>{r(this.#e,()=>t,()=>n)}))}#v(t){var r=!1,n=!1;let i=()=>{if(r){v1();return}r=!0,n&&h1(),this.#s!==null&&Gi(this.#s,()=>{this.#s=null}),this.#p(()=>{this.#h()})};return{reset:i,invoke_onerror:()=>{try{n=!0,this.#r.onerror?.(t,i),n=!1}catch(o){xi(o,this.#u&&this.#u.parent)}}}}#x(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#n=Ar(()=>t(this.#e)),Ht(()=>{var r=this.#i=document.createDocumentFragment(),n=zt();r.append(n),this.#a=this.#p(()=>Ar(()=>this.#o(n))),this.#l===0&&(this.#e.before(r),this.#i=null,Gi(this.#n,()=>{this.#n=null}),this.#b(Ce))}))}#h(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#m=0,this.#a=Ar(()=>{this.#o(this.#e)}),this.#l>0){var t=this.#i=document.createDocumentFragm
`).some(c=>c.startsWith("https://svelte.dev/e/")))throw o;return o!==Ui&&console.warn("Failed to hydrate: ",o),t.recover===!1&&s1(),Af(),Jo(r),Gt(!1),Va(e,t)}finally{Gt(n),ct(i)}}function hb(e,{target:t,anchor:r,props:n={},events:i,context:u,intro:o=!0,transformError:c}){Af();var d=void 0,p=Z1(()=>{var A=r??t.appendChild(zt());Eh(A,{pending:()=>{}},v=>{dr({});var w=Ue;if(u&&(w.c=u),i&&(n.$$events=i),de&&Zr(v,null),Cf=o,d=e(v,n)||{},Cf=!0,de&&(fe.nodes.end=ke,ke===null||ke.nodeType!==Dn||ke.data!=="]"))throw qu(),Ui;hr()},c);var g=new Set,_=v=>{for(var w=0;w<v.length;w++){var D=v[w];if(!g.has(D)){g.add(D);var L=db(D);for(let se of[t,document]){var Q=If.get(se);Q===void 0&&(Q=new Map,If.set(se,Q));var H=Q.get(D);H===void 0?(se.addEventListener(D,yf,{passive:L}),Q.set(D,1)):Q.set(D,H+1)}}}};return _(ys($h)),vf.add(_),()=>{for(var v of g)for(let L of[t,document]){var w=If.get(L),D=w.get(v);--D==0?(L.removeEventListener(v,yf),w.delete(v),w.size===0&&If.delete(L)):w.set(v,D)}vf.delete(_),A!==r&&A.parentNode?.removeChild(A)}});return Kh.set(d,p),d}function Qs(e,t){let r=Kh.get(e);return r?(Kh.delete(e),r(t)):(G&&(tr in e?E1():_1()),Promise.resolve())}var Cf,If,Kh,qa=C(()=>{Xe();nr();ft();Ke();Bt();Be();gt();st();sc();fr();_r();ea();ta();Ve();of();Cf=!0;If=new Map;Kh=new WeakMap});var Wh=C(()=>{ta();ch();Uo();Uo()});var qi,za=C(()=>{Lr();Be();Ve();gt();nr();Xe();qi=class{anchor;#e=new Map;#t=new Map;#r=new Map;#o=new Set;#u=!0;constructor(t,r=!0){this.anchor=t,this.#u=r}#a=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)Ks(n),this.#o.delete(r);else{var i=this.#r.get(r);i&&(Ks(i.effect),this.#t.set(r,i.effect),this.#r.delete(r),G&&(i.fragment.lastChild[uh]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[u,o]of this.#e){if(this.#e.delete(u),u===t)break;let c=this.#r.get(o);c&&(Yt(c.effect),this.#r.delete(o))}for(let[u,o]of this.#t){if(u===r||this.#o.has(u))continue;let c=()=>{if(Array.from(this.#e.values()).includes(u)){var p=document.createDocumentFragment();Ps(o,p),p.append(zt()),this.#r.set(u,{effect:o,fragment:p})}else Yt(o);this.#o.delete(u),this.#t.delete(u)};this.#u||!n?(this.#o.add(u),Gi(o,c,!1)):c()}}};#n=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,i]of this.#r)r.includes(n)||(Yt(i.effect),this.#r.delete(n))};ensure(t,r){var n=Ce,i=gf();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var u=document.createDocumentFragment(),o=zt();u.append(o),this.#r.set(t,{effect:Ar(()=>r(o)),fragment:u})}else this.#t.set(t,Ar(()=>r(this.anchor)));if(this.#e.set(n,t),i){for(let[c,d]of this.#t)c===t?n.unskip_effect(d):n.skip_effect(d);for(let[c,d]of this.#r)c===t?n.unskip_effect(d.effect):n.skip_effect(d.effect);n.oncommit(this.#a),n.ondiscard(this.#n)}else de&&(this.anchor=ke),this.#a(n)}}});var Gh=C(()=>{Ve();Be();Bt();gt();Tf();ea();fr();_r();Xe();nr();Wh();za()});function Ja(e){Ue===null&&Is("onMount"),Ki&&Ue.l!==null?JT(Ue).m.push(e):Eu(()=>{let t=Te(e);if(typeof t=="function")return t})}function Sf(e){Ue===null&&Is("onDestroy"),Ja(()=>()=>Te(e))}function zT(e,t,{bubbles:r=!1,cancelable:n=!1}={}){return new CustomEvent(e,{detail:t,bubbles:r,cancelable:n})}function mb(){let e=Ue;return e===null&&Is("createEventDispatcher"),(t,r,n)=>{let i=e.s.$$events?.[t];if(i){let u=gi(i)?i.slice():[i],o=zT(t,r,n);for(let c of u)c.call(e.x,o);return!o.defaultPrevented}return!0}}function JT(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}var ja=C(()=>{Ke();st();Pn();_r();cn();Bt();Xe();Lr();Bt();sb();qa();Ke();Gh();if(G){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;c1(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}});var Ab=C(()=>{Pn();ft();ja();Be()});var gb=C(()=>{Ve();ta();Ke();fr()});var Vh=C(()=>{});var bb=C(()=>{Ve();ft();gt();Bt()});var _b=C(()=>{ft();Ve();gt();Be();qr();qa();Ke()});var Eb=C(()=>{st();Ve();ft();Bt();fr();ta()});var vb=C(()=>{_r();Bt();ft()});var xb=C(()=>{ft();ks();Be();Ke();Ba()});var yb=C(()=>{Zu();Ke();gt();e
\r\f\xA0\v\uFEFF`]});function yu(e,t,r,n,i,u){var o=e[Po];if(de||o!==r||o===void 0){var c=zb(r,n,u);(!de||c!==e.getAttribute("class"))&&(c==null?e.removeAttribute("class"):t?e.className=c:e.setAttribute("class",c)),e[Po]=r}else if(u&&i!==u)for(var d in u){var p=!!u[d];(i==null||p!==!!i[d])&&e.classList.toggle(d,p)}return u}var tp=C(()=>{hc();Ve();gt()});function rp(e,t={},r,n){for(var i in r){var u=r[i];t[i]!==u&&(r[i]==null?e.style.removeProperty(i):e.style.setProperty(i,u,n))}}function pc(e,t,r,n){var i=e[Mo];if(de||i!==t){var u=Jb(t,n);(!de||u!==e.getAttribute("style"))&&(u==null?e.removeAttribute("style"):e.style.cssText=u),e[Mo]=t}else n&&(Array.isArray(n)?(rp(e,r?.[0],n[0]),rp(e,r?.[1],n[1],"important")):rp(e,r,n));return n}var np=C(()=>{hc();Ve();gt()});var ip=C(()=>{Be();Rn();Qa();st();fr();Lr();cn()});function ap(e){if(de){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;Tu(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var i=e.checked;Tu(e,"checked",null),e.checked=i}}};e[Vu]=r,Ht(r),af()}}function Tu(e,t,r,n){var i=yw(e);if(de&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===xw)){n||ww(e,t,r??"");return}i[t]!==(i[t]=r)&&(t==="loading"&&(e[jg]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Tw(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function yw(e){return e[Gl]??={[Ew]:e.nodeName.includes("-"),[vw]:e.namespaceURI===$l}}function Tw(e){var t=e.getAttribute("is")||e.nodeName,r=jb.get(t);if(r)return r;jb.set(t,r=[]);for(var n,i=e,u=Element.prototype;u!==i;){n=Kl(i);for(var o in n)n[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&r.push(o);i=Ra(i)}return r}function ww(e,t,r){G&&(t==="srcset"&&Iw(e,r)||up(e.getAttribute(t)??"",r)||g1(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(r)))}function up(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function Zb(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function Iw(e,t){var r=Zb(e.srcset),n=Zb(t);return n.length===r.length&&n.every(([i,u],o)=>u===r[o][1]&&(up(r[o][0],i)||up(i,r[o][0])))}var Ew,vw,xw,jb,e_=C(()=>{Xe();gt();st();sc();sf();fr();Ve();Gn();ta();Ke();Df();hc();tp();np();ft();Be();ip();Zu();Ew=Symbol("is custom element"),vw=Symbol("is html"),xw=ah?"link":"LINK";jb=new Map});var t_=C(()=>{gt();nr();Tf();Df()});var r_=C(()=>{Rn()});function cp(e,t,r=t){var n=new WeakSet;Ah(e,"input",async i=>{G&&e.type==="checkbox"&&sh();var u=i?e.defaultValue:e.value;if(u=sp(e)?op(u):u,r(u),Ce!==null&&n.add(Ce),await Si(),u!==(u=t())){var o=e.selectionStart,c=e.selectionEnd,d=e.value.length;if(e.value=u??"",c!==null){var p=e.value.length;o===c&&c===d&&p>d?(e.selectionStart=p,e.selectionEnd=p):(e.selectionStart=o,e.selectionEnd=Math.min(c,p))}}}),(de&&e.defaultValue!==e.value||Te(t)==null&&e.value)&&(r(sp(e)?op(e.value):e.value),Ce!==null&&n.add(Ce)),qt(()=>{G&&e.type==="checkbox"&&sh();var i=t();if(e===document.activeElement){var u=ir?gu:Ce;if(n.has(u))return}sp(e)&&i===op(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function sp(e){var t=e.type;return t==="number"||t==="range"}function op(e){return e===""?null:+e}var n_=C(()=>{Xe();Be();Rn();_r();Qa();Gn();gt();Ke();Lr();cn()});var i_=C(()=>{Be();Rn()});var u_=C(()=>{Rn()});function lp(e,t,r){var n=Rr(e,t);n&&n.set&&(e[t]=r,pr(()=>{e[t]=null}))}var a_=C(()=>{Be();st()});var s_=C(()=>{Be();Ke()});function fp(e,t){return e===t||e?.[tr]===t}function es(e={},t,r,n){var i=Ue.r,u=fe;return Nt(()=>{var o,c;return qt(()=>{o=c,c=n?.()||[],Te(()=>{fp(r(...c),e)||(t(e,...c),o&&fp(r(...o),e)&&t(null,...o))})}),()=>{let d=u;for(;d!==i&&d.parent!==null&&d.parent.f&33554432;)d=d.parent;let p=()=>{c&&fp(r(...c),e)&&t(null,...c)},A=d.teardown;d.teardown=()=>{p(),A?.()}}}),e}var o_=C(()=>{Ve();Bt();Be();Ke()});var c_=C(()=>{Be();Rn()});var l_=C(()=>{Be();Rn()});var dp=C(()=>{st();Be();sc()});function mn(e=!1){let t=Ue,r=t.l.u;if(!r)return;let n=()=>Pe(t.s);if(e){let i=0,u={},o=mu(()=>{let c=!1,d=t.s;for(let p in d)d[p]!==u[p]&&(u[p]=d[p],c=!0);return c&&i++,i});n=()=>B(
Enable this option to completely hide them.`).addToggle(i=>i.setValue(t.hideExcluded).onChange(async u=>{t.hideExcluded=u,await He(e)})),new Mn.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 He(e)})}),new Mn.Setting(r).setName("Split CamelCaseWords").setDesc(Kt(`Enable this if you want to be able to search for CamelCaseWords as separate words.<br/>
2026-01-05 13:03:55 +08:00
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
${Ws}`)).addToggle(i=>i.setValue(t.splitCamelCase).onChange(async u=>{await n.clearCache(),t.splitCamelCase=u,await He(e)})),new Mn.Setting(r).setName("Simpler search").setDesc(`Enable this if Obsidian often freezes while making searches.
Words shorter than 3 characters won'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 He(e)})),Mn.Platform.isIosApp||new Mn.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 He(e)})),new Mn.Setting(r).setName("Set Vim like navigation keys").setDesc(`Navigate down the results with ${Jn()} + J/N, or navigate up with ${Jn()} + K/P.`).addToggle(i=>i.setValue(t.vimLikeNavigationShortcut).onChange(async u=>{t.vimLikeNavigationShortcut=u,await He(e)})),new Mn.Setting(r).setName("Fuzziness").setDesc("Define the level of fuzziness for the search. The higher the fuzziness, the more results you'll get.").addDropdown(i=>i.addOptions({0:"Exact match",1:"Not too fuzzy",2:"Fuzzy enough"}).setValue(t.fuzziness).onChange(async u=>{["0","1","2"].includes(u)||(u="2"),t.fuzziness=u,await He(e)}))}var Mn,H_=C(()=>{Mn=require("obsidian");Hr();Ri()});function U_(e,t,r){let n=e.database;new ru.Setting(r).setName("Danger Zone").setHeading(),new ru.Setting(r).setName("Ignore diacritics").setDesc(Kt(`Normalize diacritics in search terms. Words like "br\xFBl\xE9e" or "\u017Elu\u0165ou\u010Dk\xFD" will be indexed as "brulee" and "zlutoucky".<br/>
2026-01-05 13:03:55 +08:00
\u26A0\uFE0F <span style="color: var(--text-accent)">You probably should <strong>NOT</strong> disable this.</span><br>
\u26A0\uFE0F <span style="color: var(--text-accent)">Changing this setting will clear the cache.</span><br>
${Ws}`)).addToggle(u=>u.setValue(t.ignoreDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreDiacritics=o,await He(e)})),new ru.Setting(r).setName("Ignore Arabic diacritics (beta)").addToggle(u=>u.setValue(t.ignoreArabicDiacritics).onChange(async o=>{await n.clearCache(),t.ignoreArabicDiacritics=o,await He(e)}));let i=Kt(`Disable Omnisearch on this device only.<br>
${Ws}`);new ru.Setting(r).setName("Disable on this device").setDesc(i).addToggle(u=>u.setValue(Uf(e.app)).onChange(async o=>{o?(e.app.saveLocalStorage(ts,"1"),new ru.Notice("Omnisearch - Disabled. Please restart Obsidian.")):(e.app.saveLocalStorage(ts),new ru.Notice("Omnisearch - Enabled. Please restart Obsidian."))})),new ru.Setting(r).setName("Force save the cache").setDesc(Kt(`Omnisearch has a security feature that automatically disables cache writing if it cannot fully perform the operation.<br>
2026-01-05 13:03:55 +08:00
Use this option to force the cache to be saved, even if it causes a crash.<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 He(e)})),wu()&&new ru.Setting(r).setName("Clear cache data").setDesc(Kt(`Erase all Omnisearch cache data.
2026-01-05 13:03:55 +08:00
Use this if Omnisearch results are inconsistent, missing, or appear outdated.<br>
${Ws}`)).addButton(u=>{u.setButtonText("Clear cache"),u.onClick(async()=>{await n.clearCache()})})}var ru,$_=C(()=>{ru=require("obsidian");wn();Ri()});function Y_(e,t,r){ns.Platform.isMobile||(new ns.Setting(r).setName("API Access Through HTTP").setHeading().setDesc(Kt('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 He(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 He(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 He(e)})))}var ns,K_=C(()=>{ns=require("obsidian");Ri()});function Q_(e,t,r){let n=e.getTextExtractor(),i=e.getAIImageAnalyzer(),u=e.database,o=(0,Zn.debounce)(async()=>{await u.clearCache()},1e3);new Zn.Setting(r).setName("Indexing").setHeading().setDesc(Kt(`<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 Zn.Setting(r).setName(`PDFs content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Kt("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 He(e)})).setDisabled(!n),new Zn.Setting(r).setName(`Images OCR indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(Kt("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 He(e)})).setDisabled(!n);let c=Kt('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 Zn.Setting(r).setName(`Documents content indexing ${n?"":"\u26A0\uFE0F Disabled"}`).setDesc(c).addToggle(p=>p.setValue(t.officeIndexing).onChange(async A=>{await u.clearCache(),t.officeIndexing=A,await He(e)})).setDisabled(!n);let d=Kt(`Omnisearch will use AI Image Analyzer to index the content of your images with AI.<br/>
\u26A0\uFE0F <span style="color: var(--text-accent)">If both AI Image Analyzer and Text Extractor are enabled, Text Extractor will only be used as a fallback.</span>`);new Zn.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 He(e)})).setDisabled(!i),new Zn.Setting(r).setName("Index paths of unsupported files").setDesc(Kt(`
Omnisearch can index file<strong>names</strong> of "unsupported" files, such as e.g. <pre style="display:inline">.mp4</pre>
or non-extracted PDFs & images.<br/>
"Obsidian setting" will respect the value of "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 He(e)})}),new Zn.Setting(r).setName("Set frontmatter property key as title").setDesc(Kt(`If you have a custom property in your notes that you want to use as the title in search results. If you set this to '#heading', then use the first heading from a file as the title.<br>
Leave empty to disable.`)).addText(p=>{p.setValue(t.displayTitle).onChange(async A=>{await o(),t.displayTitle=A,await He(e)})}),new Zn.Setting(r).setName("Additional TEXT files to index").setDesc(Kt(`In addition to standard <code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">PLAINTEXT</strong> files.<br/>
Add extensions separated by a space, without the dot. Example: "<code>txt org csv</code>".<br />
\u26A0\uFE0F <span style="color: var(--text-accent)">Using extensions of non-plaintext files (like .pptx) WILL cause crashes,
because Omnisearch will try to index their content.</span>`)).addText(p=>{p.setValue(t.indexedFileTypes.join(" ")).setPlaceholder("Example: txt org csv").onChange(async A=>{await u.clearCache(),t.indexedFileTypes=A.split(" "),await He(e)})}),new Zn.Setting(r).setName("Index files without extension").setDesc(Kt(`Enable this to also index files that have <strong style="color: var(--text-accent)">no file extension</strong>.<br/>
These files will be indexed as plaintext files.`)).addToggle(p=>{p.setValue(t.indexFilesWithoutExtension).onChange(async A=>{await u.clearCache(),t.indexFilesWithoutExtension=A,await He(e)})})}var Zn,W_=C(()=>{Zn=require("obsidian");Ri()});function G_(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 He(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(Kt(`Some results are <a href="https://help.obsidian.md/Linking+notes+and+files/Embed+files">embedded</a> in other notes.<br>
This setting controls the maximum number of embeds to show in the search results. Set to 0 to disable.<br>
Also works with Text Extractor for embedded images and documents.`)).addSlider(n=>{n.setLimits(0,10,1).setValue(t.maxEmbeds).setDynamicTooltip().onChange(async i=>{t.maxEmbeds=i,await He(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 He(e)})),new ua.Setting(r).setName('Show "Create note" button').setDesc(Kt(`Shows a button next to the search input, to create a note.
Acts the same as the <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 He(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 He(e)}))}var ua,V_=C(()=>{ua=require("obsidian");Gs();Ri()});function z_(e,t,r,n){function i(o,c){o.setLimits(1,10,.5).setValue(t[c]).setDynamicTooltip().onChange(async d=>{t[c]=d,await He(e)})}let u=wc(e.app);new Xn.Setting(r).setName("Results weighting").setHeading(),new Xn.Setting(r).setName(`File name & declared aliases (default: ${u.weightBasename})`).addSlider(o=>i(o,"weightBasename")),new Xn.Setting(r).setName(`File directory (default: ${u.weightDirectory})`).addSlider(o=>i(o,"weightDirectory")),new Xn.Setting(r).setName(`Headings level 1 (default: ${u.weightH1})`).addSlider(o=>i(o,"weightH1")),new Xn.Setting(r).setName(`Headings level 2 (default: ${u.weightH2})`).addSlider(o=>i(o,"weightH2")),new Xn.Setting(r).setName(`Headings level 3 (default: ${u.weightH3})`).addSlider(o=>i(o,"weightH3")),new Xn.Setting(r).setName(`Tags (default: ${u.weightUnmarkedTags})`).addSlider(o=>i(o,"weightUnmarkedTags")),new Xn.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 Xn.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 He(e)})}).addSlider(p=>{p.setLimits(.1,5,.1).setValue(c.weight).setDynamicTooltip().onChange(async A=>{c.weight=A,await He(e)})}).addButton(p=>{p.setButtonText("Remove"),p.onClick(async()=>{t.weightCustomProperties.splice(o,1),await He(e),n()})})}new Xn.Setting(r).addButton(o=>{o.setButtonText("Add a new property"),o.onClick(c=>{t.weightCustomProperties.push({name:"",weight:1}),n()})}),new Xn.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 He(e)}))}var Xn,J_=C(()=>{Xn=require("obsidian");wn();Gs();Ri()});function wc(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,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({},wc(e.app),await e.loadData()),aa.set(Xr.showExcerpt),xp(Xr.verboseLogging),Xr}var Ic,aa,$f,Xr,Gs=C(()=>{Ic=require("obsidian");Ap();wn();Hr();H_();$_();K_();W_();V_();J_();Ri();aa=Ls(!1),$f=class extends Ic.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t,aa.subscribe(async r=>{Xr.showExcerpt=r,await He(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:"Omnisearch"});let
2026-01-05 13:03:55 +08:00
`);let d=t.lastIndexOf(`
`,i-u);d>0&&(t=t.slice(d))}return t=Kf(t),n.renderLineReturnInExcerpts&&(t=t.trim().replaceAll(`
`,"<br>")),t}catch(i){return new lE.Notice("Omnisearch - Error while creating excerpt, see developer console"),console.error("Omnisearch - Error while creating excerpt"),console.error(i),""}}}});async function fE(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,qs.normalizePath)(c);o[d]=u[c]}return o}catch(i){return ki("Failed to read data.json:",i),{}}}async function dE(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=jw(A);t[g]=A}}catch(c){ki("Failed to list icon packs:",c)}}return{prefixToIconPack:t,iconsPath:r}}function jw(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 Sp(e,t){let r=(0,qs.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 Zw(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 Np(e,t,r,n){let i=Zw(e),{prefix:u,name:o}=i;if(!u)return`<span class="omnisearch-result__icon--emoji">${Kf(o)}</span>`;let c=n[u];if(!c)return ki(`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,qs.getIcon)(d);return p?p.outerHTML:(ki(`Lucide icon not found: ${d}`),null)}else{if(!r)return ki("Icons path is not set. Cannot load icon SVG."),null;let d=`${t.app.vault.configDir}/${r}/${c}/${o}.svg`;try{return await t.app.vault.adapter.read(d)}catch(p){return ki(`Failed to load icon SVG for ${e} at ${d}:`,p),null}}}function Dp(e){let t="file";e==="folder"?t="folder":jn(e)?t="image":Di(e)?t="file-text":(tu(e)||gc(e)||rs(e))&&(t="layout-dashboard");let r=(0,qs.getIcon)(t);return r?r.outerHTML:""}var qs,hE=C(()=>{qs=require("obsidian");Hr();Cp()});function kp(e,t){dr(t,!1);let r=()=>Vo(aa,"$showExcerpt",n),[n,i]=qo(),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(""),w=et(""),D={},L=et(null),Q=et(null),H={},se,ce=et(!1),me=et([]);Ja(async()=>{D=await fE(g());let at=await dE(g());H=at.prefixToIconPack,se=at.iconsPath,ie(ce,!0)});async function ve(){let at=Sp(B(w),D);at?ie(L,await Np(at,g(),se,H)):ie(L,Dp("folder"));let ot=Sp(A().path,D);ot?ie(Q,await Np(ot,g(),se,H)):ie(Q,Dp(A().path))}function le(at,ot){let _t=new DOMParser,kt=_t.parseFromString(ot,"image/svg+xml").documentElement;return at.appendChild(kt),{update(Ft){let O=_t.parseFromString(Ft,"image/svg+xml").documentElement;at.replaceChild(O,kt),kt=O},destroy(){at.firstElementChild&&at.removeChild(at.firstElementChild)}}}let Qe=null,je=null,$e=et(null);sr(()=>(Pe(A()),B(ce),Ac),()=>{A()&&A().path&&B(ce)&&(async()=>(ie(v,A().displayTitle||A().basename),ie(w,Ac(A().path)),await ve()))()}),sr(()=>(jn,Pe(A()),Pe(g()),Oi.TFile),()=>{if(ie(_,null),jn(A().path)){let at=g().app.vault.getAbstractFileByPath(A().path);at instanceof Oi.TFile&&ie(_,g().app.vault.getResourcePath(at))}}),sr(()=>(Pe(A()),Ac,Oi.setIcon,jn,Di,tu,gc,rs,B($e)),()=>{ie(v,A().displayTitle||A().basename),ie(w,Ac(A().path)),Qe&&(0,Oi.setIcon)(Qe,"folder-open"),je&&(jn(A().path)?(0,Oi.setIcon)(je,"image"):Di(A().path)?(0,Oi.setIcon)(je,"file-text"):tu(A().path)||gc(A().path)||rs(A().path)?(0,Oi.setIcon)(je,"layout-dashboard"):(0,Oi.setIcon)(je,"file")),B($e)&&(0,Oi.setIcon)(B($e),"corner-down-right")}),sr(()=>(Pe(g()),B(v),Pe(A())),()=>{ie(u,g().textProcessor.getMatches(B(v),A().foundWords))}),sr(()=>(Pe(g()),B(w),Pe(A())),()=>{ie(o,g().textProcessor.getMatches(B(w),A().foundWords))}),sr(()=>(Pe(A()),Pe(g())),()=>{A().matches.length>0
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Le=!0,We=!1,ht;return{s:function(){q=q.call(O)},n:function(){var Qt=q.next();return Le=Qt.done,Qt},e:function(Qt){We=!0,ht=Qt},f:function(){try{!Le&&q.return!=null&&q.return()}finally{if(We)throw ht}}}}function p(O,Y){if(O){if(typeof O=="string")return A(O,Y);var q=Object.prototype.toString.call(O).slice(8,-1);if(q==="Object"&&O.constructor&&(q=O.constructor.name),q==="Map"||q==="Set")return Array.from(O);if(q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q))return A(O,Y)}}function A(O,Y){(Y==null||Y>O.length)&&(Y=O.length);for(var q=0,re=new Array(Y);q<Y;q++)re[q]=O[q];return re}function g(O,Y){if(!(O instanceof Y))throw new TypeError("Cannot call a class as a function")}function _(O,Y){for(var q=0;q<Y.length;q++){var re=Y[q];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(O,re.key,re)}}function v(O,Y,q){return Y&&_(O.prototype,Y),q&&_(O,q),Object.defineProperty(O,"prototype",{writable:!1}),O}function w(O,Y,q){return Y in O?Object.defineProperty(O,Y,{value:q,enumerable:!0,configurable:!0,writable:!0}):O[Y]=q,O}function D(O,Y,q){L(O,Y),Y.set(O,q)}function L(O,Y){if(Y.has(O))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(O,Y){var q=ce(O,Y,"get");return H(O,q)}function H(O,Y){return Y.get?Y.get.call(O):Y.value}function se(O,Y,q){var re=ce(O,Y,"set");return me(O,re,q),q}function ce(O,Y,q){if(!Y.has(O))throw new TypeError("attempted to "+q+" private field on non-instance");return Y.get(O)}function me(O,Y,q){if(Y.set)Y.set.call(O,q);else{if(!Y.writable)throw new TypeError("attempted to set read only private field");Y.value=q}}var ve=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",le=new WeakMap,Qe=new WeakMap,je=(function(){function O(Y){var q=Y.executor,re=q===void 0?function(){}:q,Ye=Y.internals,Le=Ye===void 0?Ie():Ye,We=Y.promise,ht=We===void 0?new Promise(function(Rt,Qt){return re(Rt,Qt,function(Zt){Le.onCancelList.push(Zt)})}):We;g(this,O),D(this,le,{writable:!0,value:void 0}),D(this,Qe,{writable:!0,value:void 0}),w(this,ve,"CancelablePromise"),this.cancel=this.cancel.bind(this),se(this,le,Le),se(this,Qe,ht||new Promise(function(Rt,Qt){return re(Rt,Qt,function(Zt){Le.onCancelList.push(Zt)})}))}return v(O,[{key:"then",value:function(q,re){return kt(Q(this,Qe).then(Et(q,Q(this,le)),Et(re,Q(this,le))),Q(this,le))}},{key:"catch",value:function(q){return kt(Q(this,Qe).catch(Et(q,Q(this,le))),Q(this,le))}},{key:"finally",value:function(q,re){var Ye=this;return re&&Q(this,le).onCancelList.push(q),kt(Q(this,Qe).finally(Et(function(){if(q)return re&&(Q(Ye,le).onCancelList=Q(Ye,le).onCancelList.filter(function(Le){return Le!==q})),q()},Q(this,le))),Q(this,le))}},{key:"cancel",value:function(){Q(this,le).isCanceled=!0;var q=Q(this,le).onCancelList;Q(this,le).onCancelList=[];var re=d(q),Ye;try{for(re.s();!(Ye=re.n()).done;){var Le=Ye.value;if(typeof Le=="function")try{Le()}catch(We){console.error(We)}}}catch(We){re.e(We)}finally{re.f()}}},{key:"isCanceled",value:function(){return Q(this,le).isCanceled===!0}}]),O})(),$e=(function(O){t(q,O);var Y=n(q);function q(re){return g(this,q),Y.call(this,{executor:re})}return v(q)})(je);e.CancelablePromise=$e,w($e,"all",function(Y){return Ft(Y,Promise.all(Y))}),w($e,"allSettled",function(Y){return Ft(Y,Promise.allSettled(Y))}),w($e,"any",function(Y){return Ft(Y,Promise.any(Y))}),w($e,"race",function(Y){return Ft(Y,Promise.race(Y))}),w($e,"resolve",function(Y){return ot(Promise.resolve(Y))}),w($e,"reject",function(Y){return ot(Promise.reject(Y))}),w($e,"isCancelable",_t);var at=$e;e.default=at;function ot(O){return kt(O,Ie())}function _t(O){return O instanceof $e||O instanceof je}function Et(O,Y){if(O)return function(q){if(!Y.isCanceled){var re=O(q);return _t(re)&&Y.onCancelList.push(re.cancel),re}return q}}function kt(O,Y){return new je({internals:Y,promise:O})}function Ft(O,Y){var q=Ie();return q.onCancelList.push(function(){var re=d(O),Ye;try{for(re.s();!(Ye=re.n()).done;){var L
characters.</span>`,1),b6=Me("We found 0 results for your search here. <!>",1),_6=Me('<!> <div style="text-align: center;"><!></div>',1),E6=Me('<div class="prompt-instruction"><span class="prompt-instruction-command">hold</span> <span>to open in a new pane</span></div>'),v6=Me('<!> <!> <!> <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"])});function Fp(e,t){dr(t,!1);let r=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);sr(()=>(Pe(n()),Pe(u()),Pe(i())),()=>{ie(r,n().textProcessor.makeExcerpt(u()?.content??"",i()))}),Ci(),mn();{let d=Bn(()=>(Pe(o()),Te(()=>o().toString())));Cc(e,{get id(){return B(d)},get selected(){return c()},$$events:{auxclick(p){Mr.call(this,t,p)},click(p){Mr.call(this,t,p)},longpress(p){Mr.call(this,t,p)},mousemove(p){Mr.call(this,t,p)}},children:(p,A)=>{var g=x6();Za(g,()=>(Pe(n()),B(r),Pe(u()),Te(()=>n().textProcessor.highlightText(B(r),u().matches))),!0),Ee(g),we(p,g)},$$slots:{default:!0}})}hr()}var x6,SE=C(()=>{Ai();Zi();Pn();Ip();x6=Me('<div class="omnisearch-result__body"></div>')});function Pp(e,t){dr(t,!1);let r=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(()=>{Ge.enable("infile"),Ge.on("infile","enter",H),Ge.on("infile","open-in-new-pane",L),Ge.on("infile","arrow-up",()=>w(-1)),Ge.on("infile","arrow-down",()=>w(1)),Ge.on("infile","tab",se)}),Sf(()=>{Ge.disable("infile")});function _(Ie){let O=[],Y=-1,q=0;for(;++q<100;){let re=v(Ie,Y,mc);if(!re.length)break;Y=re.last().offset,O.push(re)}return O}function v(Ie,O,Y){let q=Ie.find(re=>re.offset>O);return q?Ie.filter(re=>re.offset>O&&re.offset<=q.offset+Y):[]}function w(Ie){ie(p,Ff(B(p)+Ie,B(d).length)),D()}async function D(){await Si(),document.querySelector(`[data-result-id="${B(p)}"]`)?.scrollIntoView({behavior:"auto",block:"nearest"})}async function L(){return H(!0)}async function Q(Ie){return H(Mf(Ie))}async function H(Ie=!1){if(B(A)){n().close(),i()&&i().close();let O=B(d)[B(p)]??0;await Hf(r(),B(A),O,Ie)}}function se(){new Cu(r(),B(c)??o()).open(),n().close()}sr(()=>Pe(o()),()=>{ie(c,o()??"")}),sr(()=>(B(c),B(g),Iu,Pe(r()),Pe(u())),()=>{(async()=>(B(c)&&(ie(g,new Iu(B(c),{ignoreDiacritics:r().settings.ignoreDiacritics,ignoreArabicDiacritics:r().settings.ignoreArabicDiacritics})),ie(A,(await r().searchEngine.getSuggestions(B(g),{singleFilePath:u()}))[0]??null)),ie(p,0),await D()))()}),sr(()=>(B(A),B(g)),()=>{if(B(A)){let Ie=_(B(A).matches),O=B(g).getExactTerms();O.length&&(Ie=Ie.filter(Y=>O.every(q=>Y.some(re=>re.match.includes(q))))),ie(d,Ie.ma
`)}function Yr(a,s,f,h){this.failures=s,this.failedKeys=h,this.successCount=f,this.message=gn(a,s)}w(Yr).from(Pt);function Dr(a,s){this.name="BulkError",this.failures=Object.keys(s).map(function(f){return s[f]}),this.failuresByPos=s,this.message=gn(a,this.failures)}w(Dr).from(Pt);var cr=it.reduce(function(a,s){return a[s]=s+"Error",a},{}),an=Pt,he=it.reduce(function(a,s){var f=s+"Error";function h(m,b){this.name=f,m?typeof m=="string"?(this.message="".concat(m).concat(b?`
`+b:""),this.inner=b||null):typeof m=="object"&&(this.message="".concat(m.name," ").concat(m.message),this.inner=m):(this.message=pt[s]||f,this.inner=null)}return w(h).from(an),a[s]=h,a},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var Eo=Zt.reduce(function(a,s){return a[s+"Error"]=he[s],a},{});function _d(a,s){if(!a||a instanceof Pt||a instanceof TypeError||a instanceof SyntaxError||!a.name||!Eo[a.name])return a;var f=new Eo[a.name](s||a.message,a);return"stack"in a&&v(f,"stack",{get:function(){return this.inner.stack}}),f}var Fu=it.reduce(function(a,s){return["Syntax","Type","Range"].indexOf(s)===-1&&(a[s+"Error"]=he[s]),a},{});Fu.ModifyError=Yr,Fu.DexieError=Pt,Fu.BulkError=Dr;function lt(){}function Ea(a){return a}function vo(a,s){return a==null||a===Ea?s:function(f){return s(a(f))}}function su(a,s){return function(){a.apply(this,arguments),s.apply(this,arguments)}}function xo(a,s){return a===lt?s:function(){var f=a.apply(this,arguments);f!==void 0&&(arguments[0]=f);var h=this.onsuccess,m=this.onerror;this.onsuccess=null,this.onerror=null;var b=s.apply(this,arguments);return h&&(this.onsuccess=this.onsuccess?su(h,this.onsuccess):h),m&&(this.onerror=this.onerror?su(m,this.onerror):m),b!==void 0?b:f}}function pl(a,s){return a===lt?s:function(){a.apply(this,arguments);var f=this.onsuccess,h=this.onerror;this.onsuccess=this.onerror=null,s.apply(this,arguments),f&&(this.onsuccess=this.onsuccess?su(f,this.onsuccess):f),h&&(this.onerror=this.onerror?su(h,this.onerror):h)}}function Ed(a,s){return a===lt?s:function(f){var h=a.apply(this,arguments);c(f,h);var m=this.onsuccess,b=this.onerror;this.onsuccess=null,this.onerror=null;var E=s.apply(this,arguments);return m&&(this.onsuccess=this.onsuccess?su(m,this.onsuccess):m),b&&(this.onerror=this.onerror?su(b,this.onerror):b),h===void 0?E===void 0?void 0:E:c(h,E)}}function yo(a,s){return a===lt?s:function(){return s.apply(this,arguments)===!1?!1:a.apply(this,arguments)}}function gs(a,s){return a===lt?s:function(){var f=a.apply(this,arguments);if(f&&typeof f.then=="function"){for(var h=this,m=arguments.length,b=new Array(m);m--;)b[m]=arguments[m];return f.then(function(){return s.apply(h,b)})}return s.apply(this,arguments)}}var $n=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function To(a,s){$n=a}var Pu={},ml=100,De=typeof Promise>"u"?[]:(function(){var a=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[a,d(a),a];var s=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[s,d(s),a]})(),Ot=De[0],Xt=De[1],Kr=De[2],li=Xt&&Xt.then,sn=Ot&&Ot.constructor,va=!!Kr;function fi(){queueMicrotask(i3)}var er=function(a,s){wo.push([a,s]),Hi&&(fi(),Hi=!1)},Mi=!0,Hi=!0,di=[],xa=[],hi=Ea,bn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:lt,pgp:!1,env:{},finalize:lt},be=bn,wo=[],ya=0,Al=[];function ae(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var s=this._PSD=be;if(typeof a!="function"){if(a!==Pu)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&xd(this,this._value);return}this._state=null,this._value=null,++s.ref,og(this,a)}var vd={get:function(){var a=be,s=El;function f(h,m){var b=this,E=!a.global&&(a!==be||s!==El),y=E&&!Hu(),T=new ae(function(N,R){yd(b,new sg(fg(h,a,E,y),fg(m,a,E,y),N,R,a))});return this._consoleTask&&(T._consoleTask=this._consoleTask),T}return f.prototype=Pu,f},set:function(a){v(this,"then",a&&a.prototype===Pu?vd:{get:function(){return a},set:vd.set})}};g(ae.prototype,{then:vd,_then:function(a,s){yd(this,new sg(null,null,a,s,be))},catch:function(a){if(arguments.length===1)return this.then(null,a);var s=arguments[0],f=arguments[1];return typeof s=="function"?this.then(null,function(h){return h instanceof s?f(h):gl(h)}):this.then(null,function(h){return h&&h.name===s?f(h):gl(h)})},finally:function(a){return this.then(function(s){return ae.resolve(a()).then(function(){return s})},function(s){return ae.resolve(a()).then(function(){return gl(s)})})},timeout:function(
`),r=t.length-1;for(;r>=0&&en.blankLine.test(t[r]);)r--;return t.length-r<=2?e:t.slice(0,r+1).join(`
`)}function DI(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function kI(e,t=0){let r=t,n="";for(let i of e)if(i===" "){let u=4-r%4;n+=" ".repeat(u),r+=u}else n+=i,r++;return n}function w2(e,t,r,n,i){let u=t.href,o=t.title||null,c=e[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:o,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,d}function RI(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let i=n[1];return t.split(`
`).map(u=>{let o=u.match(r.other.beginningSpace);if(o===null)return u;let[c]=o;return c.length>=i.length?u.slice(i.length):u}).join(`
`)}function At(e,t){return as.parse(e,t)}var oa,us,W6,en,G6,V6,q6,Lc,z6,um,C2,S2,J6,am,j6,sm,Z6,X6,u0,om,eI,N2,tI,rI,nI,cm,_2,iI,uI,aI,sI,D2,oI,Xs,a0,lm,cI,k2,lI,fI,dI,R2,hI,pI,O2,mI,AI,gI,bI,_I,EI,vI,xI,yI,TI,n0,wI,B2,L2,II,E2,fm,CI,rm,SI,r0,Rc,NI,v2,Oc,ei,Bc,s0,ti,Zs,F2,as,OI,BI,LI,FI,PI,MI,HI,UI,M2=C(()=>{oa=i0();us={exec:()=>null};W6=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),en={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:js(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:js(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:js(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:js(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:js(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:js(e=>new RegExp(`^ {0,${e}}>`))},G6=/^(?:[ \t]*(?:\n|$))+/,V6=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,q6=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Lc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,z6=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,um=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,C2=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,S2=ut(C2).replace(/bull/g,um).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),J6=ut(C2).replace(/bull/g,um).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),am=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,j6=/^[^\n]+/,sm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Z6=ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),X6=ut(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,um).getRegex(),u0="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|
]`).replace("lheading",S2).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},aI=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sI=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,D2=/^( {2,}|\\)\n(?!\s*$)/,oI=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xs=/[\p{P}\p{S}]/u,a0=/[\s\p{P}\p{S}]/u,lm=/[^\s\p{P}\p{S}]/u,cI=ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,a0).getRegex(),k2=/(?!~)[\p{P}\p{S}]/u,lI=/(?!~)[\s\p{P}\p{S}]/u,fI=/(?:[^\s\p{P}\p{S}]|~)/u,dI=ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",W6?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),R2=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hI=ut(R2,"u").replace(/punct/g,Xs).getRegex(),pI=ut(R2,"u").replace(/punct/g,k2).getRegex(),O2="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mI=ut(O2,"gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,a0).replace(/punct/g,Xs).getRegex(),AI=ut(O2,"gu").replace(/notPunctSpace/g,fI).replace(/punctSpace/g,lI).replace(/punct/g,k2).getRegex(),gI=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,a0).replace(/punct/g,Xs).getRegex(),bI=ut(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xs).getRegex(),_I="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",EI=ut(_I,"gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,a0).replace(/punct/g,Xs).getRegex(),vI=ut(/\\(punct)/,"gu").replace(/punct/g,Xs).getRegex(),xI=ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yI=ut(om).replace("(?:-->|$)","-->").getRegex(),TI=ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",yI).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),n0=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,wI=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",n0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),B2=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",n0).replace("ref",sm).getRegex(),L2=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",sm).getRegex(),II=ut("reflink|nolink(?!\\()","g").replace("reflink",B2).replace("nolink",L2).getRegex(),E2=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fm={_backpedal:us,anyPunctuation:vI,autolink:xI,blockSkip:dI,br:D2,code:sI,del:us,delLDelim:us,delRDelim:us,emStrongLDelim:hI,emStrongRDelimAst:mI,emStrongRDelimUnd:gI,escape:aI,link:wI,nolink:L2,punctuation:cI,reflink:B2,reflinkSearch:II,tag:TI,text:oI,url:us},CI={...fm,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",n0).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n0).getRegex()},rm={...fm,emStrongRDelimAst:AI,emStrongLDelim:pI,delLDelim:bI,delRDelim:EI,url:ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",E2).replace("email",/[A-Za-z0
`),depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:sa(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=sa(t[0],`
`).split(`
`),n="",i="",u=[];for(;r.length>0;){let o=!1,c=[],d;for(d=0;d<r.length;d++)if(this.rules.other.blockquoteStart.test(r[d]))c.push(r[d]),o=!0;else if(!o)c.push(r[d]);else break;r=r.slice(d);let p=c.join(`
`),A=p.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
${p}`:p,i=i?`${i}
${A}`:A;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(A,u,!0),this.lexer.state.top=g,r.length===0)break;let _=u.at(-1);if(_?.type==="code")break;if(_?.type==="blockquote"){let v=_,w=v.raw+`
`+r.join(`
`),D=this.blockquote(w);u[u.length-1]=D,n=n.substring(0,n.length-v.raw.length)+D.raw,i=i.substring(0,i.length-v.text.length)+D.text;break}else if(_?.type==="list"){let v=_,w=v.raw+`
`+r.join(`
`),D=this.list(w);u[u.length-1]=D,n=n.substring(0,n.length-_.raw.length)+D.raw,i=i.substring(0,i.length-v.raw.length)+D.raw,r=w.substring(u.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:n,tokens:u,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let u=this.rules.other.listItemRegex(r),o=!1;for(;e;){let d=!1,p="",A="";if(!(t=u.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let g=kI(t[2].split(`
`,1)[0],t[1].length),_=e.split(`
`,1)[0],v=!g.trim(),w=0;if(this.options.pedantic?(w=2,A=g.trimStart()):v?w=t[1].length+1:(w=g.search(this.rules.other.nonSpaceChar),w=w>4?1:w,A=g.slice(w),w+=t[1].length),v&&this.rules.other.blankLine.test(_)&&(p+=_+`
`,e=e.substring(_.length+1),d=!0),!d){let D=this.rules.other.nextBulletRegex(w),L=this.rules.other.hrRegex(w),Q=this.rules.other.fencesBeginRegex(w),H=this.rules.other.headingBeginRegex(w),se=this.rules.other.htmlBeginRegex(w),ce=this.rules.other.blockquoteBeginRegex(w);for(;e;){let me=e.split(`
`,1)[0],ve;if(_=me,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),ve=_):ve=_.replace(this.rules.other.tabCharGlobal," "),Q.test(_)||H.test(_)||se.test(_)||ce.test(_)||D.test(_)||L.test(_))break;if(ve.search(this.rules.other.nonSpaceChar)>=w||!_.trim())A+=`
`+ve.slice(w);else{if(v||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(g)||H.test(g)||L.test(g))break;A+=`
`+_}v=!_.trim(),p+=me+`
`,e=e.substring(me.length+1),g=ve.slice(w)}}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=T2(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],`
`),href:n,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=y2(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],u={type:"table",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(y2(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],`
`),depth:t[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let u=sa(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{let u=DI(t[2],"()");if(u===-2)return;if(u>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+u;t[2]=t[2].substring(0,u),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){let u=this.rules.other.pedanticHrefTitle.exec(n);u&&(n=u[1],i=u[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),w2(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[n.toLowerCase()];if(!i){let u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return w2(r,i,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,u,o,c=i,d=0,p=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+i);(n=p.exec(t))!==null;){if(u=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!u)continue;if(o=[...u].length,n[3]||n[4]){c+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);let A=[...n[0]][0].length,g=e.slice(0,i+n.index+A+o);if(Math.min(i,o)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let _=g.slice(2,-2);return{type:"strong",raw:g,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,u,o,c=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(n=d.exec(t))!==null;){if(u=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!u||(o=[...u].length,o!==i))continue;if(n[3]||n[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let p=[...n[0]][0].length,A=e.slice(0,i+n.index+p+o),g=A.slice(i,-i);return{type:"del",raw:A,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{le
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(en.tabCharGlobal," ").replace(en.spaceLine,""));let i=1/0;for(;t;){if(t.length<i)i=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let u;if(this.options.extensions?.block?.some(c=>(u=c.call({lexer:this},t,r))?(t=t.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.space(t)){t=t.substring(u.raw.length);let c=r.at(-1);u.raw.length===1&&c!==void 0?c.raw+=`
`:r.push(u);continue}if(u=this.tokenizer.code(t)){t=t.substring(u.raw.length);let c=r.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+u.raw,c.text+=`
`+u.text,this.inlineQueue.at(-1).src=c.text):r.push(u);continue}if(u=this.tokenizer.fences(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.heading(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.hr(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.blockquote(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.list(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.html(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.def(t)){t=t.substring(u.raw.length);let c=r.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+u.raw,c.text+=`
`+u.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},r.push(u));continue}if(u=this.tokenizer.table(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.lheading(t)){t=t.substring(u.raw.length),r.push(u);continue}let o=t;if(this.options.extensions?.startBlock){let c=1/0,d=t.slice(1),p;this.options.extensions.startBlock.forEach(A=>{p=A.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(this.state.top&&(u=this.tokenizer.paragraph(o))){let c=r.at(-1);n&&c?.type==="paragraph"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+u.raw,c.text+=`
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(u),n=o.length!==t.length,t=t.substring(u.raw.length);continue}if(u=this.tokenizer.text(t)){t=t.substring(u.raw.length);let c=r.at(-1);c?.type==="text"?(c.raw+=(c.raw.endsWith(`
`)?"":`
`)+u.raw,c.text+=`
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(u);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){this.tokenizer.lexer=this;let n=t;if(this.tokens.links){let c=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)=>{let A=p?p.length:0;return c.slice(0,A)+"["+"a".repeat(c.length-A-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!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;let c;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);let p=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}let d=t;if(this.options.extensions?.startInline){let p=1/0,A=t.slice(1),g;this.options.extensions.startInline.forEach(_=>{g=_.call({lexer:this},A),typeof g=="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;let p=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}}return r}infiniteLoopError(t){let r="Infinite loop on byte: "+t;if(this.options.silent)console.error(r);else throw new Error(r)}},Bc=class{options;parser;constructor(e){this.options=e||oa}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(en.notSpaceStart)?.[0],i=e.replace(en.endingNewline,"")+`
`;return n?'<pre><code class="language-'+nu(n)+'">'+(r?i:nu(i,!0))+`</code></pre>
`:"<pre><code>"+(r?i:nu(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,r=e.start,n="";for(let o=0;o<e.items.length;o++){let c=e.items[o];n+=this.listitem(c)}let i=t?"ol":"ul",u=t&&r!==1?' start="'+r+'"':"";return"<"+i+u+`>
`+n+"</"+i+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",r="";for(let i=0;i<e.header.length;i++)r+=this.tablecell(e.header[i]);t+=this.tablerow({text:r});let n="";for(let i=0;i<e.rows.length;i++){let u=e.rows[i];r="";for(let o=0;o<u.length;o++)r+=this.tablecell(u[o]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
2026-01-05 13:03:55 +08:00
<thead>
`+t+`</thead>
`+n+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
`}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>${nu(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),i=x2(e);if(i===null)return n;e=i;let u='<a href="'+e+'"';return t&&(u+=' title="'+nu(t)+'"'),u+=">"+n+"</a>",u}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=x2(e);if(i===null)return nu(r);e=i;let u=`<img src="${e}" alt="${nu(r)}"`;return t&&(u+=` title="${nu(t)}"`),u+=">",u}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:nu(e.text)}},s0=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ti=class im{options;renderer;textRenderer;constructor(t){this.options=t||oa,this.options.renderer=this.options.renderer||new Bc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new s0}static parse(t,r){return new im(r).parse(t)}static parseInline(t,r){return new im(r).parseInline(t)}parse(t){this.renderer.parser=this;let r="";for(let n=0;n<t.length;n++){let i=t[n];if(this.options.extensions?.renderers?.[i.type]){let o=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}}let u=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:{let o='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(t,r=this.renderer){this.renderer.parser=this;let n="";for(let i=0;i<t.length;i++){let u=t[i];if(this.options.extensions?.renderers?.[u.type]){let c=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}}let o=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:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Zs=class{options;block;constructor(e){this.options=e||oa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ei.lex:ei.lexInline}provideParser(e=this.block){return e?ti.parse:ti.parseInline}},F2=class{defaults=i0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ti;Renderer=Bc;TextRenderer=s0;Lexer=ei;Tokenizer=Oc;Hooks=Zs;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+nu(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},as=new F2;At.options=At.setOptions=function(e){return as.setOptions(e),At.defaults=as.defaults,I2(At.defaults),At};At.getDefaults=i0;At.defaults=oa;At.use=function(...e){return as.use(...e),At.defaults=as.defaults,I2(At.defaults),At};At.walkTokens=function(e,t){return as.walkTokens(e,t)};At.parseInline=as.parseInline;At.Parser=ti;At.parser=ti.parse;At.Renderer=Bc;At.TextRenderer=s0;At.Lexer=ei;At.lexer=ei.lex;At.Tokenizer=Oc;At.Hooks=Zs;At.parse=At;OI=At.options,BI=At.setOptions,LI=At.use,FI=At.walkTokens,PI=At.parseInline,MI=At,HI=ti.parse,UI=ei.lex});var ri={};_n(ri,{CDATA:()=>Em,Comment:()=>Am,Directive:()=>mm,Doctype:()=>vm,ElementType:()=>rt,Root:()=>hm,Script:()=>gm,Style:()=>bm,Tag:()=>_m,Text:()=>pm,isTag:()=>dm});function dm(e){return e.type===rt.Tag||e.type===rt.Script||e.type===rt.Style}var rt,hm,pm,mm,Am,gm,bm,_m,Em,vm,eo=C(()=>{(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(rt||(rt={}));hm=rt.Root,pm=rt.Text,mm=rt.Directive,Am=rt.Comment,gm=rt.Script,bm=rt.Style,_m=rt.Tag,Em=rt.CDATA,vm=rt.Doctype});function pe(e){return dm(e)}function to(e){return e.type===rt.CDATA}function In(e){return e.type===rt.Text}function ls(e){return e.type===rt.Comment}function c0(e){return e.type===rt.Directive}function ni(e){return e.type===rt.Root}function xt(e){return Object.prototype.hasOwnProperty.call(e,"children")}function ro(e,t=!1){let r;if(In(e))r=new iu(e.data);else if(ls(e))r=new ss(e.data);else if(pe(e)){let n=t?xm(e.children):[],i=new cs(e.name,{...e.attribs},n);n.forEach(u=>u.parent=i),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...e["x-attribsPrefix"]}),r=i}else if(to(e)){let n=t?xm(e.children):[],i=new Mc(n);n.forEach(u=>u.parent=i),r=i}else if(ni(e)){let n=t?xm(e.children):[],i=new Un(n);n.forEach(u=>u.parent=i),e["x-mode"]&&(i["x-mode"]=e["x-mode"]),r=i}else if(c0(e)){let n=new os(e.name,e.data);e["x-name"]!=null&&(n["x-name"]=e["x-name"],n["x-publicId"]=e["x-publicId"],n["x-systemId"]=e["x-systemId"]),r=n}else throw new Error(`Not implemented yet: ${e.type}`);return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}function xm(e){let t=e.map(r=>ro(r,!0));for(let r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}var o0,Fc,iu,ss,os,Pc,Mc,Un,cs,ym=C(()=>{eo();o0=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return ro(this,t)}},Fc=class extends o0{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}},iu=class extends Fc{constructor(){super(...arguments),this.type=rt.Text}get nodeType(){return 3}},ss=class extends Fc{constructor(){super(...arguments),this.type=rt.Comment}get nodeType(){return 8}},os=class extends Fc{constructor(t,r){super(r),this.name=t,this.type=rt.Directive}get nodeType(){return 1}},Pc=class extends o0{constructor(t){super(),this.children=t}get firstChild(){var t;return(t=this.children[0])!==null&&t!==void 0?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}},Mc=class extends Pc{constructor(){super(...arguments),this.type=rt.CDATA}get nodeType(){return 4}},Un=class extends Pc{constructor(){super(...arguments),this.type=rt.Root}get nodeType(){return 9}},cs=class extends Pc{constructor(t,r,n=[],i=t==="script"?rt.Script:t==="style"?rt.St
`:A0(e.children):to(e)?A0(e.children):In(e)?e.data:""}function Nu(e){return Array.isArray(e)?e.map(Nu).join(""):xt(e)&&!ls(e)?Nu(e.children):In(e)?e.data:""}function Uc(e){return Array.isArray(e)?e.map(Uc).join(""):xt(e)&&(e.type===rt.Tag||to(e))?Uc(e.children):In(e)?e.data:""}var Pm=C(()=>{$r();Fm();eo()});function io(e){return xt(e)?e.children:[]}function uv(e){return e.parent||null}function Mm(e){let t=uv(e);if(t!=null)return io(t);let r=[e],{prev:n,next:i}=e;for(;n!=null;)r.unshift(n),{prev:n}=n;for(;i!=null;)r.push(i),{next:i}=i;return r}function sC(e,t){var r;return(r=e.attribs)===null||r===void 0?void 0:r[t]}function oC(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function cC(e){return e.name}function g0(e){let{next:t}=e;for(;t!==null&&!pe(t);)({next:t}=t);return t}function b0(e){let{prev:t}=e;for(;t!==null&&!pe(t);)({prev:t}=t);return t}var av=C(()=>{$r()});function Du(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){let t=e.parent.children,r=t.lastIndexOf(e);r>=0&&t.splice(r,1)}e.next=null,e.prev=null,e.parent=null}function lC(e,t){let r=t.prev=e.prev;r&&(r.next=t);let n=t.next=e.next;n&&(n.prev=t);let i=t.parent=e.parent;if(i){let u=i.children;u[u.lastIndexOf(e)]=t,e.parent=null}}function fC(e,t){if(Du(t),t.next=null,t.parent=e,e.children.push(t)>1){let r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null}function dC(e,t){Du(t);let{parent:r}=e,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){let i=r.children;i.splice(i.lastIndexOf(n),0,t)}}else r&&r.children.push(t)}function hC(e,t){if(Du(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){let r=e.children[1];r.prev=t,t.next=r}else t.next=null}function pC(e,t){Du(t);let{parent:r}=e;if(r){let n=r.children;n.splice(n.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}var sv=C(()=>{});function uo(e,t,r=!0,n=1/0){return _0(e,Array.isArray(t)?t:[t],r,n)}function _0(e,t,r,n){let i=[],u=[Array.isArray(t)?t:[t]],o=[0];for(;;){if(o[0]>=u[0].length){if(o.length===1)return i;u.shift(),o.shift();continue}let c=u[0][o[0]++];if(e(c)&&(i.push(c),--n<=0))return i;r&&xt(c)&&c.children.length>0&&(o.unshift(0),u.unshift(c.children))}}function mC(e,t){return t.find(e)}function E0(e,t,r=!0){let n=Array.isArray(t)?t:[t];for(let i=0;i<n.length;i++){let u=n[i];if(pe(u)&&e(u))return u;if(r&&xt(u)&&u.children.length>0){let o=E0(e,u.children,!0);if(o)return o}}return null}function ov(e,t){return(Array.isArray(t)?t:[t]).some(r=>pe(r)&&e(r)||xt(r)&&ov(e,r.children))}function AC(e,t){let r=[],n=[Array.isArray(t)?t:[t]],i=[0];for(;;){if(i[0]>=n[0].length){if(n.length===1)return r;n.shift(),i.shift();continue}let u=n[0][i[0]++];pe(u)&&e(u)&&r.push(u),xt(u)&&u.children.length>0&&(i.unshift(0),n.unshift(u.children))}}var Hm=C(()=>{$r()});function Um(e,t){return typeof t=="function"?r=>pe(r)&&t(r.attribs[e]):r=>pe(r)&&r.attribs[e]===t}function gC(e,t){return r=>e(r)||t(r)}function cv(e){let t=Object.keys(e).map(r=>{let n=e[r];return Object.prototype.hasOwnProperty.call(v0,r)?v0[r](n):Um(r,n)});return t.length===0?null:t.reduce(gC)}function bC(e,t){let r=cv(e);return r?r(t):!0}function _C(e,t,r,n=1/0){let i=cv(e);return i?uo(i,t,r,n):[]}function EC(e,t,r=!0){return Array.isArray(t)||(t=[t]),E0(Um("id",e),t,r)}function fs(e,t,r=!0,n=1/0){return uo(v0.tag_name(e),t,r,n)}function vC(e,t,r=!0,n=1/0){return uo(Um("class",e),t,r,n)}function xC(e,t,r=!0,n=1/0){return uo(v0.tag_type(e),t,r,n)}var v0,$m=C(()=>{$r();Hm();v0={tag_name(e){return typeof e=="function"?t=>pe(t)&&e(t.name):e==="*"?pe:t=>pe(t)&&t.name===e},tag_type(e){return typeof e=="function"?t=>e(t.type):t=>t.type===e},tag_contains(e){return typeof e=="function"?t=>In(t)&&e(t.data):t=>In(t)&&t.data===e}}});function yC(e){let t=e.length;for(;--t>=0;){let r=e[t];if(t>0&&e.lastIndexOf(r,t-1)>=0){e.splice(t,1);continue}for(let n=r.parent;n;n=n.parent)if(e.includes(n)){e.splice(t,1);break}}return e}function lv(e,t){let r=[],n=[];if(e===t)return 0;let i=xt(e)?e:e.parent;for(;i;)r.unshift(i),i=i.parent;f
2026-01-05 13:03:55 +08:00
:is(button, input, select, textarea, optgroup, option)[disabled],
optgroup[disabled] > option,
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
)`,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])"}});function gA(e,t){return e===si.default.falseFunc?si.default.falseFunc:r=>t.isTag(r)&&e(r)}function bA(e,t){let r=t.getSiblings(e);if(r.length<=1)return[];let n=r.indexOf(e);return n<0||n===r.length-1?[]:r.slice(n+1).filter(t.isTag)}function mA(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}}var si,AA,pA,R0,O0=C(()=>{si=Qn(ha(),1);lA();AA={};pA=(e,t,r,n,i)=>{let u=i(t,mA(r),n);return u===si.default.trueFunc?e:u===si.default.falseFunc?si.default.falseFunc:o=>u(o)&&e(o)},R0={is:pA,matches:pA,where:pA,not(e,t,r,n,i){let u=i(t,mA(r),n);return u===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;let c=t.some(A=>A.some(Jc))?[AA]:void 0,d=i(t,o,c);if(d===si.default.falseFunc)return si.default.falseFunc;let p=gA(d,u);if(c&&d!==si.default.trueFunc){let{shouldTestNextSiblings:A=!1}=d;return g=>{if(!e(g))return!1;c[0]=g;let _=u.getChildren(g),v=A?[..._,...bA(g,u)]:_;return u.existsOne(p,v)}}return A=>e(A)&&u.existsOne(p,u.getChildren(A))}}});function Xv(e,t,r,n,i){var u;let{name:o,data:c}=t;if(Array.isArray(c)){if(!(o in R0))throw new Error(`Unknown pseudo-class :${o}(${c})`);return R0[o](e,c,r,n,i)}let d=(u=r.pseudos)===null||u===void 0?void 0:u[o],p=typeof d=="string"?d:k0[o];if(typeof p=="string"){if(c!=null)throw new Error(`Pseudo ${o} doesn't have any arguments`);let A=Ru(p);return R0.is(e,A,r,n,i)}if(typeof d=="function")return hA(d,o,c,1),A=>d(A,c)&&e(A);if(o in po)return po[o](e,c,r,n);if(o in Zc){let A=Zc[o];return hA(A,o,c,2),g=>A(g,r,c)&&e(g)}throw new Error(`Unknown pseudo-class :${o}`)}var _A=C(()=>{fo();Jv();jv();Zv();O0()});function EA(e,t){let r=t.getParent(e);return r&&t.isTag(r)?r:null}function ex(e,t,r,n,i){let{adapter:u,equals:o}=r;switch(t.type){case _e.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case _e.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case _e.Attribute:{if(t.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!r.xmlMode||r.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),Yv[t.action](e,t,r)}case _e.Pseudo:return Xv(e,t,r,n,i);case _e.Tag:{if(t.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:c}=t;return(!r.xmlMode||r.lowerCaseTags)&&(c=c.toLowerCase()),function(p){return u.getName(p)===c&&e(p)}}case _e.Descendant:{if(r.cacheResults===!1||typeof WeakSet>"u")return function(p){let A=p;for(;A=EA(A,u);)if(e(A))return!0;return!1};let c=new WeakSet;return function(p){let A=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":return function(d){let p=d;do if(e(p))return!0;while(p=EA(p,u));return!1};case _e.Parent:return function(d){return u.getChildren(d).some(p=>u.isTag(p)&&e(p))};case _e.Child:return function(d){let p=u.getParent(d);return p!=null&&u.isTag(p)&&e(p)};case _e.Sibling:return function(d){let p=u.getSiblings(d);for(let A=0;A<p.length;A++){let g=p[A];if(o(d,g))break;if(u.isTag(g)&&e(g))return!0}return!1};case _e.Adjacent:return u.prevElementSibling?function(d){let p=u.prevElementSibling(d);return p!=null&&e(p)}:funct
`)})):{name:i,value:u.replace(wx,`\r
`)}}).toArray()}var Tx,TS,wx,Ix=C(()=>{$r();Tx="input,select,textarea,keygen",TS=/%20/g,wx=/\r?\n/g});var HA={};_n(HA,{extract:()=>SS});function CS(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 SS(e){let t={};for(let r in e){let n=e[r],i=Array.isArray(n),{selector:u,value:o}=CS(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 Cx=C(()=>{});var Aa,Sx=C(()=>{Ov();Ax();Ex();yx();Ix();Cx();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 Nx(e,t){return function r(n,i,u=!0){if(n==null)throw new Error("cheerio.load() expects a string");let o=$c(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,w){return e(g,_,v,w)}_render(g){return t(g,this.options)}}function p(A,g,_=c,v){if(A&&ui(A))return A;let w=$c(v,o),D=typeof _=="string"?[e(_,w,!1,null)]:"length"in _?_:[_],L=ui(D)?D:new d(D,null,w);if(L._root=L,!A)return new d(void 0,L,w);let Q=typeof A=="string"&&Kc(A)?e(A,w,!1,null).children:NS(A)?[A]:Array.isArray(A)?A:void 0,H=new d(Q,L,w);if(Q)return H;if(typeof A!="string")throw new TypeError("Unexpected type of selector");let se=A,ce=g?typeof g=="string"?Kc(g)?new d([e(g,w,!1,null)],L,w):(se=`${g} ${se}`,L):ui(g)?g:new d(Array.isArray(g)?g:[g],L,w):L;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 NS(e){return!!e.name||e.type===ri.Root||e.type===ri.Text||e.type===ri.Comment}var Dx=C(()=>{Km();ao();Sx();so();Gc()});function $0(e){return e>=55296&&e<=57343}function kx(e){return e>=56320&&e<=57343}function Rx(e,t){return(e-55296)*1024+9216+t}function Y0(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function K0(e){return e>=64976&&e<=65007||DS.has(e)}var DS,St,x,An,Q0=C(()=>{DS=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]),St="\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={}));An={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"}});var $,tl=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.
`)}else if(bc(t))try{let A=JSON.parse(await r.vault.cachedRead(n)),g=[],_=v=>{for(let w in v)typeof v[w]=="object"?_(v[w]):w==="content"&&g.push(v[w])};_(A),i=g.join(`\r
`)}catch(A){console.error("Omnisearch: Error while parsing Dataloom file",t),console.error(A)}else jn(t)?this.plugin.settings.aiImageIndexing&&o?.canBeAnalyzed(n)?i=await o.analyzeImage(n):this.plugin.settings.imagesIndexing&&u?.canFileBeExtracted(t)&&(i=await u.extractText(n)):Di(t)&&this.plugin.settings.PDFIndexing&&u?.canFileBeExtracted(t)?i=await u.extractText(n):N_(t)&&this.plugin.settings.officeIndexing&&u?.canFileBeExtracted(t)?i=await u.extractText(n):this.plugin.notesIndexer.isFilenameIndexable(t)&&(i=n.path);i==null&&(ki(`Omnisearch: ${i} content for file`,n.path),i="");let c=r.metadataCache.getFileCache(n);if(c&&c.frontmatter?.["excalidraw-plugin"]){let A=c.sections?.filter(g=>g.type==="comment")??[];for(let{start:g,end:_}of A.map(v=>v.position))i=i.substring(0,g.offset-1)+i.substring(_.offset)}let d;this.plugin.settings.displayTitle==="#heading"?d=c?.headings?.find(A=>A.level===1)?.heading??"":d=c?.frontmatter?.[this.plugin.settings.displayTitle]??"";let p=S_(c);return{basename:n.basename,displayTitle:d,content:i,path:n.path,mtime:n.stat.mtime,tags:p,unmarkedTags:p.map(A=>A.replace("#","")),aliases:C_(c).join(""),headings1:c?Lf(c,1).join(" "):"",headings2:c?Lf(c,2).join(" "):"",headings3:c?Lf(c,3).join(" "):""}}}});var pd,zy=C(()=>{Tc();Hr();pd=class{constructor(t){this.plugin=t;this.notesToReindex=new Set}flagNoteForReindex(t){this.notesToReindex.add(t)}async refreshIndex(){let t=[...this.notesToReindex],r=t.filter(u=>this.plugin.app.vault.getAbstractFileByPath(u.path));for(let u of r)Je("Updating file",u.path),await this.plugin.documentsRepository.addDocument(u.path);let n=r.map(u=>u.path);n.length&&(this.plugin.searchEngine.removeFromPaths(n),await this.plugin.searchEngine.addFromPaths(n));let i=t.filter(u=>!r.includes(u)).map(u=>u.path);i.length&&this.plugin.searchEngine.removeFromPaths(i),this.notesToReindex.clear()}isFileIndexable(t){return this.plugin.settings.hideExcluded&&this.plugin.app.metadataCache.isUserIgnored&&this.plugin.app.metadataCache.isUserIgnored(t)?!1:this.isFilenameIndexable(t)||this.isContentIndexable(t)}isContentIndexable(t){let r=this.plugin.settings,n=!!this.plugin.getTextExtractor(),i=!!this.plugin.getAIImageAnalyzer(),u=n&&r.PDFIndexing,o=n&&r.imagesIndexing,c=i&&r.aiImageIndexing;return this.isFilePlaintext(t)||tu(t)||bc(t)||u&&Di(t)||o&&jn(t)||c&&jn(t)}isFilenameIndexable(t){return this.canIndexUnsupportedFiles()||this.isFilePlaintext(t)||tu(t)||rs(t)||bc(t)}canIndexUnsupportedFiles(){return this.plugin.settings.unsupportedFilesIndexing==="yes"||this.plugin.settings.unsupportedFilesIndexing==="default"&&!!this.plugin.app.vault.getConfig("showUnsupportedFiles")}generateIndexableNonexistingDocument(t,r){return t=L_(t),{path:t+(t.endsWith(".md")?"":".md"),basename:t,displayTitle:"",mtime:0,content:"",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(".")}}});var Ad,md,Jy=C(()=>{Ad=require("obsidian");Hr();md=class{constructor(t){this.plugin=t;this.embeds=new Map}addEmbed(t,r){this.embeds.has(t)||this.embeds.set(t,new Set),this.embeds.get(t).add(r)}removeFile(t){this.embeds.delete(t),this.embeds.forEach(r=>r.delete(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){return this.embeds.has(t)?[...this.embeds.get(t)]:[]}async writeToCache(){Je("Writing embeds to cache");let t=this.plugin.database,r=[];for(let[n,i]of this.embeds)r.push({embedded:n,referencedBy:[...i]});await t.embeds.clear(),await t.embeds.bulkAdd(r)}async loadFromCache(){try{let t=this.plugin.database;if(!t.embeds){Je("No embeds in cache");return}Je("Loading embeds from cache");let r=await t.embeds.toArray();for(let{embedded:n,referencedBy:i}of r)for(let u of i)this.addEmbed(n,u)}cat
2026-01-05 13:03:55 +08:00
/*! Bundled license information:
search-query-parser/lib/search-query-parser.js:
(*!
* search-query-parser.js
* Copyright(c) 2014-2019
* MIT Licensed
*)
*/
/* nosourcemap */