window.relearn=window.relearn||{},window.relearn.runInitialSearch=function(){if(window.relearn.isSearchInit&&window.relearn.isLunrInit){var t,e=document.querySelector("#R-search-by-detail");if(!e)return;t=e.value,searchDetail(t)}};function initLunrIndex(e){if(!window.lunr)return;pagesIndex=e,lunrIndex=lunr(function(){this.use(lunr.multiLanguage.apply(null,window.relearn.contentLangs)),this.ref("index"),this.field("title",{boost:15}),this.field("tags",{boost:10}),this.field("content",{boost:5}),this.pipeline.remove(lunr.stemmer),this.searchPipeline.remove(lunr.stemmer),pagesIndex.forEach(function(e,t){e.index=t,this.add(e)},this)}),window.relearn.isLunrInit=!0,window.relearn.runInitialSearch()}function triggerSearch(){var e,t,n,o,s=document.querySelector("#R-search-by-detail");if(!s)return;n=s.value,searchDetail(n),t=new URL(window.location),o=t.searchParams.get("search-by"),n!=o&&(e=window.history.state||{},e=Object.assign({},typeof e=="object"?e:{}),t.searchParams.set("search-by",n),e.search=t.toString(),e.contentScrollTop=+elc.scrollTop,window.history.pushState(e,"",t))}window.addEventListener("popstate",function(e){if(e.state){var n,s,o,t=window.history.state||{},t=Object.assign({},typeof t=="object"?t:{});t.search&&(n=new URL(t.search),n.searchParams.has("search-by")&&(s=n.searchParams.get("search-by"),o=document.querySelectorAll("input.search-by"),o.forEach(function(e){e.value=s;var t=document.createEvent("Event");t.initEvent("input",!1,!1),e.dispatchEvent(t)}),searchDetail(s)))}});var lunrIndex,pagesIndex,input=document.querySelector("#R-search-by-detail");input&&input.addEventListener("keydown",function(e){e.key=="Escape"&&setTimeout(function(){input.focus()},0)});function initLunrJs(){if(window.relearn.index_js_url){var e=document.createElement("script");e.src=window.relearn.index_js_url,e.setAttribute("async",""),e.onload=function(){initLunrIndex(relearn_searchindex)},e.onerror=function(){console.error("Error getting Hugo index file")},document.head.appendChild(e)}}function search(e){if(!window.lunr)return[];e=e.replace(/[*:^~+-]/g," ");var t=lunr.tokenizer(e).reduce(function(e,t){return e.concat(searchPatterns(t.str))},[]).join(" ");return!t||!lunrIndex?[]:lunrIndex.search(t).map(function(e){return{index:e.ref,matches:Object.keys(e.matchData.metadata)}})}function searchPatterns(e){var t=[{len:-1,typos:1},{len:60,typos:2},{len:40,typos:3},{len:20,typos:4},{len:16,typos:3},{len:12,typos:2},{len:8,typos:1},{len:4,typos:0}];return[e+"^100",e+"*^10","*"+e+"^10",e+"~"+t.reduce(function(t,n){return e.length