(function(p,n){typeof exports=="object"&&typeof module<"u"?module.exports=n():typeof define=="function"&&define.amd?define(n):(p=typeof globalThis<"u"?globalThis:p||self,p.RevealSearch=n())})(this,function(){"use strict";/*! * Handles finding a text string anywhere in the slides and showing the next occurrence to the user * by navigatating to that slide and highlighting it. * * @author Jon Snyder , February 2013 */return()=>{let n,t,i,o,a,g,f;function v(){t=document.createElement("div"),t.classList.add("searchbox"),t.style.position="absolute",t.style.top="10px",t.style.right="10px",t.style.zIndex=10,t.innerHTML=` `,i=t.querySelector(".searchinput"),i.style.width="240px",i.style.fontSize="14px",i.style.padding="4px 6px",i.style.color="#000",i.style.background="#fff",i.style.borderRadius="2px",i.style.border="0",i.style.outline="0",i.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",i.style["-webkit-appearance"]="none",n.getRevealElement().appendChild(t),i.addEventListener("keyup",function(r){switch(r.keyCode){case 13:r.preventDefault(),k(),g=!1;break;default:g=!0}},!1),x()}function C(){t||v(),t.style.display="inline",i.focus(),i.select()}function x(){t||v(),t.style.display="none",f&&f.remove()}function E(){t||v(),t.style.display!=="inline"?C():x()}function k(){if(g){var r=i.value;r===""?(f&&f.remove(),o=null):(f=new L("slidecontent"),o=f.apply(r),a=0)}o&&(o.length&&o.length<=a&&(a=0),o.length>a&&(n.slide(o[a].h,o[a].v),a++))}function L(r,c){var I=document.getElementById(r)||document.body,m=c||"EM",M=new RegExp("^(?:"+m+"|SCRIPT|FORM)$"),N=["#ff6","#a0ffff","#9f9","#f99","#f6f"],S=[],B=0,y="",d=[];this.setRegex=function(e){e=e.trim(),y=new RegExp("("+e+")","i")},this.getRegex=function(){return y.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(e){if(!(e==null||!e)&&y&&!M.test(e.nodeName)){if(e.hasChildNodes())for(var l=0;l{n=r,n.registerKeyboardShortcut("CTRL + Shift + F","Search"),document.addEventListener("keydown",function(c){c.key=="F"&&(c.ctrlKey||c.metaKey)&&(c.preventDefault(),E())},!1)},open:C,close:x,toggle:E}}});