!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.morsels=e():t.morsels=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>Ht});function n(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function r(t,e,n){for(const o of t){const t=o.isSubtracted||o.isInverted?!n:n;o.termsSearched?t&&e.push([...o.termsSearched]):o.children&&r(o.children,e,t)}}function o(t,e){const o=[],i=[];r(t,i,!0);const s=[];for(const t of i){const r=t.map((t=>(s.push(t),n(t)))).sort(((t,e)=>e.length-t.length)).join("|");if("latin"===e.langConfig.lang){const t=new RegExp(`(^|\\W|_)(${r})(\\w*?)(?=\\W|$)`,"gi");o.push(t)}else{const t=new RegExp(`(^|\\W|_)(${r})((?=\\W|$))`,"gi");o.push(t)}}return[o,JSON.stringify(s)]}class i{constructor(t,e,n,r,o,i){this.query=t,this.resultsTotal=e,this.queryParts=n,this.getNextN=r,this.free=o,this.t=i}}function s(t,e,n){const{numDocsPerStore:r,numStoresPerDir:o,indexingConfig:i}=n,{numDocsPerBlock:s}=i,c=Math.floor(e/r),a=Math.floor(e/s);return`${t}field_store/${Math.floor(c/o)}/${c}--${a}.json`}const c=function(t,e,...n){const r=document.createElement(t);return Object.entries(e).forEach((([t,e])=>{r.setAttribute(t,e)})),n.forEach((t=>{if("string"==typeof t){const e=document.createElement("span");e.textContent=t,r.appendChild(e)}else r.appendChild(t)})),r};function a(){return c("span",{class:"morsels-ellipses"}," ... ")}function l(t){return c("mark",{class:"morsels-highlight"},t)}var u;!function(t){t.HEADING_BODY="heading-body",t.BODY_ONLY="body",t.HEADING_ONLY="heading"}(u||(u={}));class f{constructor(t,e,n,r,o){this.type=t,this.text=e,this.headingLink=r,this.heading=o,this.window=[],this.numTerms=0;const i=n.map((t=>Array.from(e.matchAll(t))));if(!i.some((t=>t.length)))return;let s=n.map((()=>-1)),c=1e7,a=n.map((()=>0));const l=i.map((()=>0)),u=i.map((t=>!t.length)),f=i.map((()=>-1));for(;;){let t=1e7,e=1e7,n=-1,r=0;for(let o=0;oi[e][t]&&i[e][t][2].length+i[e][t][3].length))),l[n]+=1,l[n]>=i[n].length&&(u[n]=!0,l[n]-=1,u.every((t=>t))))break}const d=s.map(((t,e)=>({pos:t,len:a[e]}))).filter((t=>t.pos>=0)).sort(((t,e)=>t.pos-e.pos));this.window=d,this.numTerms=d.length}highlight(t=!0){const{text:e,window:n}=this;if(!n.some((({pos:t})=>t>=0))){if(t){const t=e.trimStart().substring(0,80);return[80===t.length?t.replace(/\w+$/,""):t,a()]}return[e]}const r=[];let o=0;for(const{pos:i,len:s}of n){const n=i+s;if(i>o+80){t&&r.push(a());const o=e.substring(i-40,i);r.push(40===o.length?o.replace(/^\w+/,""):o),r.push(l(e.substring(i,n)))}else if(i>=o)r.pop(),r.push(e.substring(o,i)),r.push(l(e.substring(i,n)));else{if(!(n>o))continue;r.pop();r[r.length-1].textContent+=e.substring(o,n)}const c=e.substring(n,n+40);r.push(40===c.length?c.replace(/\w+$/,""):c),o=n}return t&&r.push(a()),r}highlightHTML(t=!0){const e=this.highlight(t);return c("div",{},...e).innerHTML}}var d=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))};class h{constructor(t,e,n){this.i=t,this.l=e,this.u=n,this.fields=[]}h(t,e,n){return d(this,void 0,void 0,(function*(){const r=s(t,this.i,n);try{const t=yield e.getJson(r);let o=this.i%n.numDocsPerStore;const{numDocsPerBlock:i}=n.indexingConfig;i[this.l[t].name,e]))}catch(t){console.log(t)}}))}getHeadingBodyExcerpts(){return function(t,e){let n,r=-2,o="",i=[];for(let s=0;sp(this,void 0,void 0,(function*(){m+=1,yield t(),m-=1}));m>=2?y.push(e):(yield e(),_())}))}class g{constructor(t){this.cache=t,this.p=Object.create(null)}m(t){return p(this,void 0,void 0,(function*(){if(this.cache){let e=yield this.cache.match(t);e?this.p[t]=e.json():w((()=>p(this,void 0,void 0,(function*(){yield this.cache.add(t),e=yield this.cache.match(t),this.p[t]=e.json()}))))}else w((()=>p(this,void 0,void 0,(function*(){const e=yield fetch(t);this.p[t]=e.json()}))))}))}_(t){return p(this,void 0,void 0,(function*(){if(this.cache){(yield this.cache.match(t))||w((()=>this.cache.add(t)))}}))}getJson(t){return this.p[t]||(this.p[t]=fetch(t).then((t=>t.json()))),this.p[t]}}var b=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))};let v;if(document.currentScript)v=document.currentScript.src;else{const t=document.getElementsByTagName("script");v=t.length&&t[t.length-1].src}v=v.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");const x={s:""};const P=class{constructor(t){if(this.g=t,this.isSetupDone=!1,this.v=Object.create(null),this.id=0,"object"!=typeof WebAssembly||"function"!=typeof WebAssembly.instantiateStreaming)return void(this.setupPromise=Promise.reject("WA unsupported"));!function(t){if(!("url"in t))throw new Error("Mandatory url parameter not specified");t.url.endsWith("/")||(t.url+="/"),t.url.startsWith("/")&&(t.url=window.location.origin+t.url),"maxAutoSuffixSearchTerms"in t||(t.maxAutoSuffixSearchTerms=3),"maxSuffixSearchTerms"in t||(t.maxSuffixSearchTerms=5),"useQueryTermProximity"in t||(t.useQueryTermProximity=!0),"plLazyCacheThreshold"in t||(t.plLazyCacheThreshold=0),"resultLimit"in t||(t.resultLimit=null)}(this.g);const e=this.P().then((()=>this.S(`morsels:${t.url}`)));this.setupPromise=Promise.all([e,new Promise(((t,n)=>{const r=URL.createObjectURL(new Blob([`const __morsWrkrUrl="${v}";${x.s}`],{type:"text/javascript"}));this.k=new Worker(r),this.k.onmessage=n=>{if(n.data.query){const{query:t,queryId:e,nextResults:r,resultsTotal:o,queryParts:i}=n.data,s=this.v[e];s&&s.resolve({query:t,nextResults:r,resultsTotal:o,queryParts:i})}else""===n.data?(e.then((()=>this.k.postMessage(this.cfg))),URL.revokeObjectURL(r)):n.data.isSetupDone&&(this.isSetupDone=!0,t(),this.A(),this.$())},this.k.onmessageerror=t=>{console.error(t),this.isSetupDone||n()}}))])}S(t){return b(this,void 0,void 0,(function*(){try{const{indexVer:e}=this.cfg;let n=yield caches.open(t);const r=yield n.match("/index_ver");if(r){e!==(yield r.text())&&(yield caches.delete(t),n=yield caches.open(t))}yield n.put("/index_ver",new Response(e)),this.j=new g(n)}catch(t){this.j=new g(void 0)}}))}A(){if(!this.g.cacheAllFieldStores)return;const{numDocsPerStore:t,indexingConfig:e,lastDocId:n}=this.cfg,r=Math.min(t,e.numDocsPerBlock);for(let t=0;t{const e=Math.floor(t/this.cfg.indexingConfig.numPlsPerDir),n=`${this.g.url}pl_${e}/pl_${t}.mls`;this.j._(n)}))}P(){return b(this,void 0,void 0,(function*(){const t=this.g;if(this.cfg=yield(yield fetch(`${t.url}morsels_config.json`)).json(),"0.7.3"!==this.cfg.ver)throw new Error("Morsels search !== indexer version!");"cacheAllFieldStores"in t||(t.cacheAllFieldStores=!!this.cfg.cacheAllFieldStores),t.useQueryTermProximity=t.useQueryTermProximity&&this.cfg.indexingConfig.withPositions,this.cfg.searcherOptions=t}))}runQuery(t){return b(this,void 0,void 0,(function*(){yield this.setupPromise;const e=this.id;this.id+=1;const n=this.v;n[e]={promise:void 0,resolve:void 0},n[e].promise=new Promise((r=>{n[e].resolve=r,this.k.postMessage({query:t,queryId:e})}));const r=yield n[e].promise,[s,c]=o(r.queryParts,this.cfg);return new i(t,r.resultsTotal,r.queryParts,(r=>b(this,void 0,void 0,(function*(){if(!n[e])return[];if(yield n[e].promise,n[e].promise=new Promise((o=>{n[e].resolve=o,this.k.postMessage({query:t,queryId:e,isGetNextN:!0,n:r})})),!n[e])return[];const o=(yield n[e].promise).nextResults.map((t=>new h(t,this.cfg.fieldInfos,s)));return yield Promise.all(o.map((t=>t.h(this.g.url,this.j,this.cfg)))),o}))),(()=>{delete n[e],this.k.postMessage({query:t,isFree:!0})}),c)}))}free(){this.k.terminate()}};var S;x.s='(()=>{var t,n,e,r,o={899:(t,n,e)=>{e.p=__morsWrkrUrl},519:(t,n,e)=>{"use strict";e.a(t,(async(t,r)=>{try{e.d(n,{get_new_searcher:()=>o.qS,get_query:()=>o.R1});var o=e(417),i=t([o]);o=(i.then?(await i)():i)[0],r()}catch(t){r(t)}}))},417:(t,n,e)=>{"use strict";e.a(t,(async(r,o)=>{try{e.d(n,{G6:()=>I,JP:()=>V,Or:()=>H,QF:()=>C,R1:()=>U,UA:()=>N,VD:()=>W,XG:()=>Q,XP:()=>B,bj:()=>J,fP:()=>z,ff:()=>G,g7:()=>F,jp:()=>X,lB:()=>D,ll:()=>K,oH:()=>R,qS:()=>P,ug:()=>T});var i=e(672),c=e(739);t=e.hmd(t);var u=r([c]);c=(u.then?(await u)():u)[0];const s=new Array(32).fill(void 0);function a(t){return s[t]}s.push(void 0,null,!0,!1);let f=s.length;function _(t){t<36||(s[t]=f,f=t)}function l(t){const n=a(t);return _(t),n}function d(t){f===s.length&&s.push(s.length+1);const n=f;return f=s[n],s[n]=t,n}let y=new("undefined"==typeof TextDecoder?(0,t.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});y.decode();let w=new Uint8Array;function b(){return 0===w.byteLength&&(w=new Uint8Array(c.memory.buffer)),w}function h(t,n){return y.decode(b().subarray(t,t+n))}function v(t,n,e,r){const o={a:t,b:n,cnt:1,dtor:e},i=(...t)=>{o.cnt++;const n=o.a;o.a=0;try{return r(n,o.b,...t)}finally{0==--o.cnt?c.__wbindgen_export_0.get(o.dtor)(n,o.b):o.a=n}};return i.original=o,i}function g(t,n,e){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf06d5548831c85d9(t,n,d(e))}let p=new Int32Array;function m(){return 0===p.byteLength&&(p=new Int32Array(c.memory.buffer)),p}let x=new Uint32Array;let A=0;let j=new("undefined"==typeof TextEncoder?(0,t.require)("util").TextEncoder:TextEncoder)("utf-8");const q="function"==typeof j.encodeInto?function(t,n){return j.encodeInto(t,n)}:function(t,n){const e=j.encode(t);return n.set(e),{read:t.length,written:e.length}};function O(t,n,e){if(void 0===e){const e=j.encode(t),r=n(e.length);return b().subarray(r,r+e.length).set(e),A=e.length,r}let r=t.length,o=n(r);const i=b();let c=0;for(;c127)break;i[o+c]=n}if(c!==r){0!==c&&(t=t.slice(c)),o=e(o,r,r=c+3*t.length);const n=b().subarray(o+c,o+r);c+=q(t,n).written}return A=c,o}function S(t){return null==t}function P(t,n,e,r,o,i,u,s,a,f,_,l,y,w,b,h){const v=O(r,c.__wbindgen_malloc,c.__wbindgen_realloc),g=A;var p=S(u)?0:O(u,c.__wbindgen_malloc,c.__wbindgen_realloc),m=A;const x=O(_,c.__wbindgen_malloc,c.__wbindgen_realloc),j=A,q=c.get_new_searcher(d(t),n,e,v,g,d(o),S(i)?16777215:i?1:0,p,m,!S(s),S(s)?0:s,d(a),f,x,j,l,y,w,b,!S(h),S(h)?0:h);return $.__wrap(q)}function U(t,n){const e=O(n,c.__wbindgen_malloc,c.__wbindgen_realloc),r=A;return l(c.get_query(t,e,r))}function k(t,n){try{return t.apply(this,n)}catch(t){c.__wbindgen_exn_store(d(t))}}function E(t,n,e,r){c.wasm_bindgen__convert__closures__invoke2_mut__h668a0ca803c0613b(t,n,d(e),d(r))}class M{static __wrap(t){const n=Object.create(M.prototype);return n.ptr=t,n}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();c.__wbg_query_free(t)}get results_total(){return c.__wbg_get_query_results_total(this.ptr)>>>0}set results_total(t){c.__wbg_set_query_results_total(this.ptr,t)}get_next_n(t){try{const u=c.__wbindgen_add_to_stack_pointer(-16);c.query_get_next_n(u,this.ptr,t);var n=m()[u/4+0],e=m()[u/4+1],r=(o=n,i=e,(0===x.byteLength&&(x=new Uint32Array(c.memory.buffer)),x).subarray(o/4,o/4+i)).slice();return c.__wbindgen_free(n,4*e),r}finally{c.__wbindgen_add_to_stack_pointer(16)}var o,i}get_query_parts(){try{const e=c.__wbindgen_add_to_stack_pointer(-16);c.query_get_query_parts(e,this.ptr);var t=m()[e/4+0],n=m()[e/4+1];return h(t,n)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(t,n)}}}class ${static __wrap(t){const n=Object.create($.prototype);return n.ptr=t,n}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();c.__wbg_searcher_free(t)}get_ptr(){return c.searcher_get_ptr(this.ptr)}}function T(t){l(t)}function I(t){const n=l(t).original;if(1==n.cnt--)return n.a=0,!0;return!1}function F(t,n,e,r,o){return d((0,i.T)(t>>>0,n>>>0,h(e,r),o>>>0))}function N(t,n,e){return d(a(t).then(a(n),a(e)))}function D(t){return d(new Uint8Array(a(t)))}function G(t){return d(M.__wrap(t))}function W(){return k((function(t,n,e){return d(a(t).call(a(n),a(e)))}),arguments)}function B(t){return void 0===a(t)}function C(t,n){try{var e={a:t,b:n};const r=new Promise(((t,n)=>{const r=e.a;e.a=0;try{return E(r,e.b,t,n)}finally{e.a=r}}));return d(r)}finally{e.a=e.b=0}}function J(t){return a(t).length}function R(){return d(c.memory)}function X(t){return d(a(t).buffer)}function z(t,n,e){a(t).set(a(n),e>>>0)}function H(t,n){throw new Error(h(t,n))}function Q(t,n){return d(a(t).then(a(n)))}function V(t){return d(Promise.resolve(a(t)))}function K(t,n,e){return d(v(t,n,15,g))}o()}catch(L){o(L)}}))},672:(t,n,e)=>{"use strict";async function r(t,n,e,r){const o=`${e}pl_${Math.floor(t/n)}/pl_${t}.mls`,i=`morsels:${e}`;function c(t){return fetch(t).then((t=>t.arrayBuffer()))}try{const t=await caches.open(i),n=await t.match(o);if(n)return await n.arrayBuffer();{const n=await c(o);return n.byteLength>=r&&t.add(o),n}}catch{return c(o)}}e.d(n,{T:()=>r})},739:(t,n,e)=>{"use strict";e.a(t,(async(r,o)=>{try{var i,c=r([i=e(417)]),[i]=c.then?(await c)():c;await e.v(n,t.id,"a13b20d80fc38d319d31",{"./index_bg.js":{__wbindgen_object_drop_ref:i.ug,__wbindgen_cb_drop:i.G6,__wbg_fetchPl_6118290d992488f4:i.g7,__wbg_then_cedad20fbbd9418a:i.UA,__wbg_new_8c3f0052272a457a:i.lB,__wbg_query_new:i.ff,__wbg_call_168da88779e35f61:i.VD,__wbindgen_is_undefined:i.XP,__wbg_new_9962f939219f1820:i.QF,__wbg_length_9e1ae1900cb0fbd5:i.bj,__wbindgen_memory:i.oH,__wbg_buffer_3f3d764d4747d564:i.jp,__wbg_set_83db9690f9353e79:i.fP,__wbindgen_throw:i.Or,__wbg_then_11f7a54d67b4bfad:i.XG,__wbg_resolve_99fe17964f31ffc0:i.JP,__wbindgen_closure_wrapper60:i.ll}}),o()}catch(t){o(t)}}),1)}},i={};function c(t){var n=i[t];if(void 0!==n)return n.exports;var e=i[t]={id:t,loaded:!1,exports:{}};return o[t](e,e.exports,c),e.loaded=!0,e.exports}t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",n="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",r=t=>{t&&!t.d&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},c.a=(o,i,c)=>{var u;c&&((u=[]).d=1);var s,a,f,_=new Set,l=o.exports,d=new Promise(((t,n)=>{f=n,a=t}));d[n]=l,d[t]=t=>(u&&t(u),_.forEach(t),d.catch((t=>{}))),o.exports=d,i((o=>{var i;s=(o=>o.map((o=>{if(null!==o&&"object"==typeof o){if(o[t])return o;if(o.then){var i=[];i.d=0,o.then((t=>{c[n]=t,r(i)}),(t=>{c[e]=t,r(i)}));var c={};return c[t]=t=>t(i),c}}var u={};return u[t]=t=>{},u[n]=o,u})))(o);var c=()=>s.map((t=>{if(t[e])throw t[e];return t[n]})),a=new Promise((n=>{(i=()=>n(c)).r=0;var e=t=>t!==u&&!_.has(t)&&(_.add(t),t&&!t.d&&(i.r++,t.push(i)));s.map((n=>n[t](e)))}));return i.r?a:c()}),(t=>(t?f(d[e]=t):a(l),r(u)))),u&&(u.d=0)},c.d=(t,n)=>{for(var e in n)c.o(n,e)&&!c.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},c.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),c.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),c.v=(t,n,e,r)=>{var o=fetch(c.p+""+e+".module.wasm");return"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(o,r).then((n=>Object.assign(t,n.instance.exports))):o.then((t=>t.arrayBuffer())).then((t=>WebAssembly.instantiate(t,r))).then((n=>Object.assign(t,n.instance.exports)))},c.p="/",(()=>{"use strict";c(899);class t{constructor(t,n,e){this.t=t,this.i=n,this.u=e}_(t){return Array.from(this.u.get_next_n(t))}l(){this.u.free()}}var n=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function c(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(c,u)}s((r=r.apply(t,n||[])).next())}))};const e=Object.create(null);let r,o;function i(i,c){return n(this,void 0,void 0,(function*(){const n=yield r.get_query(o.get_ptr(),i),u=n.get_query_parts();let s=[];try{s=JSON.parse(u)}catch(t){console.error(`Error deserializing query parts:\\n${u}\\n${t}`)}return e[c]=new t(s,n.results_total,n),e[c]}))}function u(t,e){return n(this,void 0,void 0,(function*(){const{indexingConfig:i,langConfig:{lang:c,options:u},fieldInfos:s,numScoredFields:a,searcherOptions:f}=t,_=function(t){return n(this,void 0,void 0,(function*(){let n;try{n=yield caches.open(`morsels:${t}`)}catch(t){}const e=`${t}metadata.json`;return(n?n.match(e).then((t=>!t&&n.add(e))).then((()=>n.match(e))).catch((()=>fetch(e))):fetch(e)).then((t=>t.arrayBuffer()))}))}(f.url),l=new TextEncoder;let d;const y=u.stop_words;if(y){const t=y.map((t=>l.encode(t))).filter((t=>t.length<255)),n=t.length+t.reduce(((t,n)=>t+n.length),0);d=new Uint8Array(n);let e=0;t.forEach((t=>{d[e++]=t.length,d.set(t,e),e+=t.length}))}const w=s.map((t=>l.encode(t.name))),b=w.reduce(((t,n)=>t+n.length),0),h=new Uint8Array(13*w.length+b),v=new Float32Array(3);let g=0;s.forEach(((t,n)=>{const e=w[n].length;h[g++]=e,h.set(w[n],g),g+=e,v[0]=t.weight,v[1]=t.k,v[2]=t.b,h.set(new Uint8Array(v.buffer),g),g+=12})),r=yield e,o=r.get_new_searcher(yield _,i.numPlsPerDir,i.withPositions,c,d,u.ignore_stop_words,u.stemmer,u.max_term_len,h,a,f.url,f.maxAutoSuffixSearchTerms,f.maxSuffixSearchTerms,f.useQueryTermProximity,f.plLazyCacheThreshold,f.resultLimit)}))}var s=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function c(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(c,u)}s((r=r.apply(t,n||[])).next())}))};!function(t){onmessage=function(n){return s(this,void 0,void 0,(function*(){const r=n.data;if(r.searcherOptions)yield u(r,t),postMessage({isSetupDone:!0});else if(r.query){const{query:t,queryId:n,n:o,isFree:c,isGetNextN:u}=r;if(c)!function(t){e[t]&&(e[t].l(),delete e[t])}(n);else if(u){const r=function(t,n){var r;return(null===(r=e[t])||void 0===r?void 0:r._(n))||[]}(n,o);postMessage({query:t,queryId:n,nextResults:r})}else{const e=yield i(t,n);postMessage({query:t,queryId:n,resultsTotal:e.i,queryParts:e.t})}}}))},postMessage("")}(Promise.resolve().then(c.bind(c,519)))})()})();',function(t){t.Auto="auto",t.Dropdown="dropdown",t.Fullscreen="fullscreen",t.Target="target"}(S||(S={}));const k="data-morsels-loading-indicator";function A(){return c("div",{[k]:"true"})}var $=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))};function j(t,e,n,r,o,i){return $(this,void 0,void 0,(function*(){const{resultsPerPage:s,listItemRender:a}=t.uiOptions,l=yield Promise.all(e.map((e=>a(c,t,e,n))));return l.push(function(t,e,n,r,o,i){const{loadingIndicatorRender:s,resultsPerPage:a}=t.uiOptions,l=c("div",{class:"morsels-footer",tabindex:"-1"});if(!i.resultsTotal)return l;const u=c("div",{class:"morsels-footer-so-far"},`${e} of ${i.resultsTotal}`).outerHTML,f=c("button",{class:"morsels-load-more",tabindex:"-1"},"Load more results"),d=c("div",{class:"morsels-load-more-opt",role:"option"},f);return d.addEventListener("focusout",(t=>{t.stopPropagation()})),d.onclick=()=>{const e=document.activeElement===f;d.remove(),l.append(s(c,t,!1,!0)),e&&l.focus({preventScroll:!0}),r(a).then((t=>{if(l.innerHTML=u,l.classList.add("morsels-footer-loaded"),t&&t.length&&!e){const e=t[0];o("option"===e.getAttribute("role")?e:e.querySelector('[role="option"]'))}}))},n?l.innerHTML=u:l.append(d),l}(t,r+e.length,e.lengthR(t,e,n,r,o+s.length,i)),(t=>M(t,l.querySelector("#morsels-list-selected"),a,l,!1)));return e.q?void 0:(o?l.append(...u):(l.innerHTML="",e.M=A(),l.append(e.M,i.uiOptions.headerRender(c,i,!1,!1,n),...u)),u)}))}var D=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))};class U{constructor(t,e){var n,r;this.O=t,this.T=e,this.L=!0,this.R=!1,this.M=A(),r=e,(n=t).addEventListener("keydown",(t=>{const{key:e}=t;if(!["ArrowDown","ArrowUp","Home","End","Enter"].includes(e))return;const o=r.querySelector("#morsels-list-selected"),i=r.querySelectorAll('[role="option"]'),s=i[i.length-1];let c=-1;if(i.forEach(((t,e)=>{t===o&&(c=e)})),"ArrowDown"===e)M(i[(c+1)%i.length],o,n,r,!0);else if("ArrowUp"===e)M(c>0?i[c-1]:s,o,n,r,!0);else if("Enter"===e)o&&o.dispatchEvent(new MouseEvent("click",{ctrlKey:t.ctrlKey}));else{const t="Home"===e?0:n.value.length;n.focus(),n.setSelectionRange(t,t),M(void 0,o,n,r,!0)}t.preventDefault()}))}}function C(t,e,n,r,o,i){var s;return D(this,void 0,void 0,(function*(){const{loadingIndicatorRender:a,headerRender:l,resultsPerPage:u}=i.uiOptions;e.R=!0;const f=a(c,i,!1,e.L);e.M.replaceWith(f),e.M=f;try{null===(s=e.D)||void 0===s||s.free(),e.D=yield n.runQuery(t);(yield R(n,e,e.D,u,0,i))&&(e.L=!1),r.scrollTo({top:0}),o.scrollTo({top:0})}catch(t){throw o.innerHTML="",o.appendChild(l(c,i,!0,!1)),t}finally{if(e.q){const t=e.q;e.q=void 0,yield t()}else e.R=!1}}))}function I(t,e,n){const{addSearchedTerms:r}=t.uiOptions;if(r){const t=(o=e).startsWith("/")?new URL(new URL(window.location.href).origin+o):new URL(o);return t.searchParams.append(r,n),t.toString()}var o;return e}const B=(t,e,n,r)=>{const{sourceFilesUrl:o,useBreadcrumb:i,maxSubMatches:s}=e.uiOptions,c={link:null,_relative_fp:null,title:null,h1:null};n.getKVFields(c);const a=function(t,e,n){if(!t||e){const t=n.split("/").map((t=>t.split(/[\s_-]+/g).map((t=>t.replace(/([a-z])([A-Z])/g,"$1 $2"))).map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join(" "))).join(" ยป ").split(".");let e=t.pop().toUpperCase();return e="HTML"===e?"":"PDF"===e?" (PDF)":"."+e,t.join(".")+e}return t}(c.h1||c.title,i,c._relative_fp),l=c.link||"string"==typeof o&&c._relative_fp&&`${o}${c._relative_fp}`||"",u=n.getHeadingBodyExcerpts();!function(t,e){t.sort(((t,e)=>{const n=t.numTerms,r=e.numTerms;return n===r?0===n?e.text.length-t.text.length:e.type.localeCompare(t.type):r-n}));const n=Math.min(t.length,e);let r=0;for(;r"body"===t)).map((t=>t.highlight())),d=u.filter((({type:t})=>t.startsWith("heading"))).map((t=>({body:t.highlight(),heading:t.heading.highlight(!1),href:t.headingLink?`${l}#${t.headingLink}`:l}))),h=t("a",{class:"morsels-title-link",role:"option",tabindex:"-1"},t("div",{class:"morsels-title"},a),...f.map((e=>t("div",{class:"morsels-body"},...e))));l&&h.setAttribute("href",I(e,l,r.t));const p=d.map((({body:n,heading:o,href:i})=>{const s=t("a",{class:"morsels-heading-link",role:"option",tabindex:"-1"},t("div",{class:"morsels-heading"},...o),t("div",{class:"morsels-body"},...n));return i&&s.setAttribute("href",I(e,i,r.t)),s}));return Promise.resolve(t("div",{class:"morsels-list-item",role:"group","aria-label":a},h,...p))};function F(t){return t.split("-")[0]}function W(t){return t.split("-")[1]}function H(t){return["top","bottom"].includes(F(t))?"x":"y"}function z(t){return"y"===t?"height":"width"}function G(t,e,n){let{reference:r,floating:o}=t;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,c=H(e),a=z(c),l=r[a]/2-o[a]/2,u="x"===c;let f;switch(F(e)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:s};break;case"left":f={x:r.x-o.width,y:s};break;default:f={x:r.x,y:r.y}}switch(W(e)){case"start":f[c]-=l*(n&&u?-1:1);break;case"end":f[c]+=l*(n&&u?-1:1)}return f}function N(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function J(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function Q(t,e){var n;void 0===e&&(e={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=e,p=N(h),m=c[d?"floating"===f?"reference":"floating":f],y=J(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),_=J(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...s.floating,x:r,y:o}:s.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),strategy:a}):s[f]);return{top:y.top-_.top+p.top,bottom:_.bottom-y.bottom+p.bottom,left:y.left-_.left+p.left,right:_.right-y.right+p.right}}const V=Math.min,X=Math.max;function K(t,e,n){return X(t,V(e,n))}const Y=t=>({name:"arrow",options:t,async fn(e){const{element:n,padding:r=0}=null!=t?t:{},{x:o,y:i,placement:s,rects:c,platform:a}=e;if(null==n)return{};const l=N(r),u={x:o,y:i},f=H(s),d=W(s),h=z(f),p=await a.getDimensions(n),m="y"===f?"top":"left",y="y"===f?"bottom":"right",_=c.reference[h]+c.reference[f]-u[f]-c.floating[h],w=u[f]-c.reference[f],g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(n));let b=g?"y"===f?g.clientHeight||0:g.clientWidth||0:0;0===b&&(b=c.floating[h]);const v=_/2-w/2,x=l[m],P=b-p[h]-l[y],S=b/2-p[h]/2+v,k=K(x,S,P),A=("start"===d?l[m]:l[y])>0&&S!==k&&c.reference[h]<=c.floating[h];return{[f]:u[f]-(A?SZ[t]))}function et(t,e,n){void 0===n&&(n=!1);const r=W(t),o=H(t),i=z(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=tt(s)),{main:s,cross:tt(s)}}const nt={start:"end",end:"start"};function rt(t){return t.replace(/start|end/g,(t=>nt[t]))}const ot=["top","right","bottom","left"],it=(ot.reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:h=!0,...p}=t,m=F(r),y=f||(m!==s&&h?function(t){const e=tt(t);return[rt(t),e,rt(e)]}(s):[tt(s)]),_=[s,...y],w=await Q(e,p),g=[];let b=(null==(n=o.flip)?void 0:n.overflows)||[];if(l&&g.push(w[m]),u){const{main:t,cross:e}=et(r,i,await(null==c.isRTL?void 0:c.isRTL(a.floating)));g.push(w[t],w[e])}if(b=[...b,{placement:r,overflows:g}],!g.every((t=>t<=0))){var v,x;const t=(null!=(v=null==(x=o.flip)?void 0:x.index)?v:0)+1,e=_[t];if(e)return{data:{index:t,overflows:b},reset:{placement:e}};let n="bottom";switch(d){case"bestFit":{var P;const t=null==(P=b.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:P[0].placement;t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}});const st=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=(()=>{}),...c}=t,a=await Q(e,c),l=F(n),u=W(n);let f,d;"top"===l||"bottom"===l?(f=l,d=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(d=l,f="end"===u?"top":"bottom");const h=X(a.left,0),p=X(a.right,0),m=X(a.top,0),y=X(a.bottom,0),_={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==m||0!==y?m+y:X(a.top,a.bottom)):a[f]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==h||0!==p?h+p:X(a.left,a.right)):a[d])};await s({...e,..._});const w=await o.getDimensions(i.floating);return r.floating.width!==w.width||r.floating.height!==w.height?{reset:{rects:!0}}:{}}}};function ct(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function at(t){if(null==t)return window;if(!ct(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function lt(t){return at(t).getComputedStyle(t)}function ut(t){return ct(t)?"":t?(t.nodeName||"").toLowerCase():""}function ft(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function dt(t){return t instanceof at(t).HTMLElement}function ht(t){return t instanceof at(t).Element}function pt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof at(t).ShadowRoot||t instanceof ShadowRoot)}function mt(t){const{overflow:e,overflowX:n,overflowY:r}=lt(t);return/auto|scroll|overlay|hidden/.test(e+r+n)}function yt(t){return["table","td","th"].includes(ut(t))}function _t(t){const e=/firefox/i.test(ft()),n=lt(t);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function wt(){return!/^((?!chrome|android).)*safari/i.test(ft())}const gt=Math.min,bt=Math.max,vt=Math.round;function xt(t,e,n){var r,o,i,s;void 0===e&&(e=!1),void 0===n&&(n=!1);const c=t.getBoundingClientRect();let a=1,l=1;e&&dt(t)&&(a=t.offsetWidth>0&&vt(c.width)/t.offsetWidth||1,l=t.offsetHeight>0&&vt(c.height)/t.offsetHeight||1);const u=ht(t)?at(t):window,f=!wt()&&n,d=(c.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/a,h=(c.top+(f&&null!=(i=null==(s=u.visualViewport)?void 0:s.offsetTop)?i:0))/l,p=c.width/a,m=c.height/l;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function Pt(t){return(e=t,(e instanceof at(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function St(t){return ht(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function kt(t){return xt(Pt(t)).left+St(t).scrollLeft}function At(t,e,n){const r=dt(e),o=Pt(e),i=xt(t,r&&function(t){const e=xt(t);return vt(e.width)!==t.offsetWidth||vt(e.height)!==t.offsetHeight}(e),"fixed"===n);let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==ut(e)||mt(o))&&(s=St(e)),dt(e)){const t=xt(e,!0);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else o&&(c.x=kt(o));return{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}function $t(t){return"html"===ut(t)?t:t.assignedSlot||t.parentNode||(pt(t)?t.host:null)||Pt(t)}function jt(t){return dt(t)&&"fixed"!==lt(t).position?t.offsetParent:null}function qt(t){const e=at(t);let n=jt(t);for(;n&&yt(n)&&"static"===lt(n).position;)n=jt(n);return n&&("html"===ut(n)||"body"===ut(n)&&"static"===lt(n).position&&!_t(n))?e:n||function(t){let e=$t(t);for(pt(e)&&(e=e.host);dt(e)&&!["html","body"].includes(ut(e));){if(_t(e))return e;{const t=e.parentNode;e=pt(t)?t.host:t}}return null}(t)||e}function Ot(t){if(dt(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=xt(t);return{width:e.width,height:e.height}}function Et(t){const e=$t(t);return["html","body","#document"].includes(ut(e))?t.ownerDocument.body:dt(e)&&mt(e)?e:Et(e)}function Tt(t,e){var n;void 0===e&&(e=[]);const r=Et(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=at(r),s=o?[i].concat(i.visualViewport||[],mt(r)?r:[]):r,c=e.concat(s);return o?c:c.concat(Tt(s))}function Mt(t,e,n){return"viewport"===e?J(function(t,e){const n=at(t),r=Pt(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,a=0;if(o){i=o.width,s=o.height;const t=wt();(t||!t&&"fixed"===e)&&(c=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:c,y:a}}(t,n)):ht(e)?function(t,e){const n=xt(t,!1,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:r,left:o,x:o,y:r,right:o+t.clientWidth,bottom:r+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(e,n):J(function(t){var e;const n=Pt(t),r=St(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=bt(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=bt(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let c=-r.scrollLeft+kt(t);const a=-r.scrollTop;return"rtl"===lt(o||n).direction&&(c+=bt(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:c,y:a}}(Pt(t)))}function Lt(t){const e=Tt(t),n=["absolute","fixed"].includes(lt(t).position)&&dt(t)?qt(t):t;return ht(n)?e.filter((t=>ht(t)&&function(t,e){const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&pt(n)){let n=e;do{if(n&&t===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(t,n)&&"body"!==ut(t))):[]}const Rt={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[..."clippingAncestors"===n?Lt(e):[].concat(n),r],s=i[0],c=i.reduce(((t,n)=>{const r=Mt(e,n,o);return t.top=bt(r.top,t.top),t.right=gt(r.right,t.right),t.bottom=gt(r.bottom,t.bottom),t.left=bt(r.left,t.left),t}),Mt(e,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:r}=t;const o=dt(n),i=Pt(n);if(n===i)return e;let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==ut(n)||mt(i))&&(s=St(n)),dt(n))){const t=xt(n,!0);c.x=t.x+n.clientLeft,c.y=t.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+c.x,y:e.y-s.scrollTop+c.y}},isElement:ht,getDimensions:Ot,getOffsetParent:qt,getDocumentElement:Pt,getElementRects:t=>{let{reference:e,floating:n,strategy:r}=t;return{reference:At(e,qt(n),r),floating:{...Ot(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===lt(t).direction};const Dt=(t,e,n)=>(async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=await(null==s.isRTL?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:l,y:u}=G(a,r,c),f=r,d={},h=0;for(let n=0;nc("td",{},c("div",{},t)))))}const o=c("tbody",{},r("Require a term",n("+sunny weather")),r("Exclude a term",n("-cloudy sunny")),r("Flip search results",n("~rainy")),r("Group terms together",n("~(sunny warm cloudy)")),r("Search for prefixes",n("run*")),r("Search only specific sections",c("ul",{},c("li",{},n("title:forecast")),c("li",{},n("heading:sunny")),c("li",{},n("body:(rainy gloomy)"))))),i=c("table",{class:"morsels-tip-table"},c("thead",{class:"morsels-tip-table-header"},c("tr",{},c("th",{scope:"col"},"Tip"),c("th",{},"Example"))),o),s=c("div",{class:"morsels-tip-popup-root"},c("div",{class:"morsels-tip-popup"},c("div",{class:"morsels-tip-popup-title"},"๐Ÿ”Ž Advanced search tips"),i),c("div",{class:"morsels-tip-popup-separator"}));function a(){Object.assign(s.style,{left:"calc(var(--morsels-tip-icon-size) - 150px)",top:"-160px"}),s.classList.remove("shown")}a();const l=c("div",{class:"morsels-tip-root",tabindex:"0"},c("span",{class:"morsels-tip-icon"},"?"),s);function u(){Dt(l,s,{placement:"top-end",middleware:[it({crossAxis:!1,flipAlignment:!1,padding:10})]}).then((({x:t,y:e})=>{Object.assign(s.style,{left:`${t}px`,top:`${e}px`}),s.classList.add("shown")}))}return l.onmouseover=u,l.onfocus=u,l.onmouseleave=a,l.onblur=a,e.setupPromise.then((()=>{e.cfg.indexingConfig.withPositions&&o.prepend(r("Search for phrases",n('"for tomorrow"')))})),l}let Ct=0;function It(t,e,n){t.setAttribute("autocomplete","off"),t.setAttribute("readonly",""),t.setAttribute("role","button"),t.setAttribute("aria-label",n),e&&t.setAttribute("placeholder",e),t.classList.add("morsels-button-input")}let Bt=0;class Ft{constructor(t){this.U=t,this.C=!1,this.I=!1}B(){const{mode:t,isMobileDevice:e}=this.U.uiOptions;return t===S.Auto&&!e()||t===S.Dropdown}F(t,e,n,r,o){const{uiOptions:i}=o,s=new U(t,n);let a=!0;r.setupPromise.then((()=>{s.q&&(s.q(),s.q=void 0)})).catch((()=>{n.innerHTML="",n.appendChild(i.headerRender(c,o,!0,!1)),a=!1}));let l=-1;t.addEventListener("input",(u=>{if(!a)return;const f=i.preprocessQuery(u.target.value);if(clearTimeout(l),f.length)l=setTimeout((()=>{var a;if(s.L&&!(null===(a=n.firstElementChild)||void 0===a?void 0:a.getAttribute(k))){n.innerHTML="";const t=i.loadingIndicatorRender(c,o,!r.isSetupDone,!0);s.M=t,n.appendChild(t)}this.W&&this.W();const l=()=>C(f,s,r,e,n,o);s.R||!r.isSetupDone?s.q=l:l(),q(t),t.setAttribute("aria-expanded","true")}),i.inputDebounce);else{const e=()=>{n.innerHTML="",this.B()?this.H():i.mode!==S.Target&&n.appendChild(i.headerRender(c,o,!1,!0)),s.R=!1,s.L=!0,q(t),O(t)};s.R?s.q=e:e()}}))}}const Wt=function(t){!function(t){t.searcherOptions=t.searcherOptions||{},t.uiOptions=t.uiOptions||{};const{uiOptions:e}=t;if(e.sourceFilesUrl&&!e.sourceFilesUrl.endsWith("/")&&(e.sourceFilesUrl+="/"),e.mode=e.mode||S.Auto,e.isMobileDevice=e.isMobileDevice||(()=>window.matchMedia("only screen and (max-width: 768px)").matches),e.mode===S.Target&&("string"==typeof e.target&&(e.target=document.getElementById(e.target)),!e.target))throw new Error("'target' mode specified but no valid target option specified");if("input"in e&&"string"!=typeof e.input||(e.input=document.getElementById(e.input||"morsels-search")),[S.Dropdown,S.Target].includes(e.mode)&&!e.input)throw new Error("'dropdown' or 'target' mode specified but no input element found");"inputDebounce"in e||(e.inputDebounce=100),e.preprocessQuery=e.preprocessQuery||(t=>t),e.dropdownAlignment=e.dropdownAlignment||"bottom-end","string"==typeof e.fsContainer&&(e.fsContainer=document.getElementById(e.fsContainer)),e.fsContainer=e.fsContainer||document.getElementsByTagName("body")[0],e.resultsPerPage=e.resultsPerPage||10,e.maxSubMatches=e.maxSubMatches||2,e.label=e.label||"Search this site",e.resultsLabel=e.resultsLabel||"Site results",e.fsInputLabel=e.fsInputLabel||"Search",e.fsPlaceholder=e.fsPlaceholder||"Search this site",e.fsCloseText=e.fsCloseText||"Close","fsScrollLock"in e||(e.fsScrollLock=!0),e.loadingIndicatorRender||(e.loadingIndicatorRender=(t,e,n,r)=>{const o=t("span",{class:"morsels-loading-indicator"});if(n){const e=t("div",{class:"morsels-initialising-text"},"... Initialising ...");return t("div",{class:"morsels-initialising"},e,o)}return r||o.classList.add("morsels-loading-indicator-subsequent"),o});const n=e.loadingIndicatorRender;e.loadingIndicatorRender=(...t)=>{const e=n(...t);return e.setAttribute(k,"true"),e},e.headerRender=e.headerRender||((t,e,n,r,o)=>{if(n)return t("div",{class:"morsels-header morsels-error"},"Oops! Something went wrong... ๐Ÿ™");if(r)return t("div",{class:"morsels-header morsels-fs-blank"},"Start Searching Above!");function i(t){return''}const s=t("div",{class:"morsels-instructions"});return s.innerHTML="Navigation:"+i(!1)+i(!0)+'',t("div",{class:"morsels-header"},`${o.resultsTotal} results found`,s)}),e.listItemRender=e.listItemRender||B,t.otherOptions=t.otherOptions||{}}(t);const{uiOptions:e}=t,{input:n,mode:r,dropdownAlignment:o,label:i,fsInputButtonText:s,fsInputLabel:a,fsScrollLock:l,target:u}=e,f=new P(t.searcherOptions),d=new Ft(t),[h,p,m,y,_]=function(t,e,n){const{uiOptions:r}=t,o=`morsels-fs-label-${Bt}`,i=c("input",{class:"morsels-fs-input",type:"search",placeholder:r.fsPlaceholder,"aria-labelledby":o,enterkeyhint:"search"});i.onkeydown=t=>{"Escape"===t.key&&i.value&&t.stopPropagation()};const s=c("span",{class:"morsels-fs-input-clear"});s.onclick=()=>{i.value&&(i.value="",i.dispatchEvent(new KeyboardEvent("input")),i.focus())};const a=c("button",{class:"morsels-input-close-fs"},r.fsCloseText),l=c("div",{id:"morsels-fs-list-"+Bt++,class:"morsels-list","aria-labelledby":o}),u=c("div",{class:"morsels-root morsels-fs-root"},c("form",{class:"morsels-fs-controls"},c("label",{id:o,for:"morsels-fs-input",style:"display: none"},r.label),c("div",{class:"morsels-fs-input-wrapper"},i,s),a),Ut(r,e),l);u.onclick=t=>t.stopPropagation(),u.onmousedown=t=>t.stopPropagation(),E(i,l,r.label);const f=c("div",{class:"morsels-fs-backdrop"},u);function d(t){n(t),f.remove()}return f.onmousedown=()=>d(!1),f.onkeydown=t=>{"Escape"===t.code&&(t.stopPropagation(),d(!0))},a.onclick=t=>{t.preventDefault(),d(""===t.pointerType)},[f,l,i,function(){r.fsContainer.appendChild(f);const t=f.querySelector("input.morsels-fs-input");t&&t.focus();const e=l.querySelector(".focus");e&&l.scrollTo({top:e.offsetTop-l.offsetTop-30})},d]}(t,f,(t=>{t&&n&&n.focus(),d.I=!1,l&&(document.body.style.overflow="")}));function w(){d.I||(y(),d.I=!0,l&&(document.body.style.overflow="hidden"))}function g(){_(!1),l&&(document.body.style.overflow="")}function b(){function t(){d.B()||w()}n.addEventListener("click",t),n.addEventListener("keydown",(e=>{"Enter"===e.key&&t()}))}let v;if(d.F(m,h,p,f,t),p.appendChild(e.headerRender(c,t,!1,!0)),!n||r!==S.Auto&&r!==S.Dropdown){if(n&&r===S.Fullscreen)It(n,s,a),b();else if(n&&r===S.Target){u.classList.add("morsels-root"),d.F(n,u,u,f,t);let x=u.getAttribute("id");x||(u.setAttribute("id","morsels-target-list"),x="morsels-target-list"),E(n,u,e.label)}}else{const A=n.getAttribute("placeholder")||"",$=n.parentElement,j=$.childNodes;let O=0;for(;O{"Escape"===t.code&&(t.stopPropagation(),n.focus(),r())},[s,o]}(e,f,n,(()=>{d.H()}));function L(){d.B()?(g(),(d.C||document.activeElement===n)&&d.W(),function(t,e,n,r){!function(t,e){t.removeAttribute("readonly"),t.removeAttribute("role"),t.removeAttribute("aria-label"),t.setAttribute("placeholder",e),t.classList.remove("morsels-button-input")}(t,r),E(t,e,n)}(n,v,i,A)):(d.H(),function(t,e,n,r){e.removeAttribute("role"),e.removeAttribute("aria-label"),t.removeAttribute("role"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-autocomplete"),t.removeAttribute("aria-controls"),q(t),It(t,r,n)}(n,v,a,s))}let R;v=M,O{v.childElementCount&&(!function(t,e,n){const r=t.children[1],o=r.firstElementChild;r.style.display="block",Dt(t,r,{placement:n,middleware:[it({padding:10,mainAxis:!1}),st({apply({availableWidth:t,availableHeight:n}){Object.assign(e.style,{maxWidth:`min(${t}px, var(--morsels-dropdown-max-width))`,maxHeight:`min(${n}px, var(--morsels-dropdown-max-height))`})},padding:10}),Y({element:o})]}).then((({x:t,y:e,middlewareData:n})=>{Object.assign(r.style,{left:`${t}px`,top:`${e}px`});const{x:i}=n.arrow;Object.assign(o.style,{left:null!=i?`${i}px`:""})}))}(T,v,o),d.C=!0)},d.H=()=>{T.children[1].style.display="none",d.C=!1},d.F(n,T,v,f,t),L(),window.addEventListener("resize",(()=>{clearTimeout(R),R=setTimeout(L,10)})),T.addEventListener("focusout",(()=>{d.B()&&setTimeout((()=>{let t=document.activeElement;for(;t;)if(t=t.parentElement,t===T)return;d.H()}),100)})),n.addEventListener("focus",(()=>{!d.C&&d.B()&&d.W()})),b()}return{showFullscreen:w,hideFullscreen:g}},Ht={initMorsels:Wt,Searcher:P};return e=e.default})()));