From a91b3874e7454f88712396054920423a68987377 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 9 Apr 2021 19:13:04 +0200 Subject: Initial --- plugin/search/plugin.js | 243 ++++++++++++++++++++++++++++++++++++++++++++ plugin/search/search.esm.js | 1 + plugin/search/search.js | 1 + 3 files changed, 245 insertions(+) create mode 100644 plugin/search/plugin.js create mode 100644 plugin/search/search.esm.js create mode 100644 plugin/search/search.js (limited to 'plugin/search') diff --git a/plugin/search/plugin.js b/plugin/search/plugin.js new file mode 100644 index 0000000..5d09ce6 --- /dev/null +++ b/plugin/search/plugin.js @@ -0,0 +1,243 @@ +/*! + * 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 + */ + +const Plugin = () => { + + // The reveal.js instance this plugin is attached to + let deck; + + let searchElement; + let searchButton; + let searchInput; + + let matchedSlides; + let currentMatchedIndex; + let searchboxDirty; + let hilitor; + + function render() { + + searchElement = document.createElement( 'div' ); + searchElement.classList.add( 'searchbox' ); + searchElement.style.position = 'absolute'; + searchElement.style.top = '10px'; + searchElement.style.right = '10px'; + searchElement.style.zIndex = 10; + + //embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/: + searchElement.innerHTML = ` + `; + + searchInput = searchElement.querySelector( '.searchinput' ); + searchInput.style.width = '240px'; + searchInput.style.fontSize = '14px'; + searchInput.style.padding = '4px 6px'; + searchInput.style.color = '#000'; + searchInput.style.background = '#fff'; + searchInput.style.borderRadius = '2px'; + searchInput.style.border = '0'; + searchInput.style.outline = '0'; + searchInput.style.boxShadow = '0 2px 18px rgba(0, 0, 0, 0.2)'; + searchInput.style['-webkit-appearance'] = 'none'; + + deck.getRevealElement().appendChild( searchElement ); + + // searchButton.addEventListener( 'click', function(event) { + // doSearch(); + // }, false ); + + searchInput.addEventListener( 'keyup', function( event ) { + switch (event.keyCode) { + case 13: + event.preventDefault(); + doSearch(); + searchboxDirty = false; + break; + default: + searchboxDirty = true; + } + }, false ); + + closeSearch(); + + } + + function openSearch() { + if( !searchElement ) render(); + + searchElement.style.display = 'inline'; + searchInput.focus(); + searchInput.select(); + } + + function closeSearch() { + if( !searchElement ) render(); + + searchElement.style.display = 'none'; + if(hilitor) hilitor.remove(); + } + + function toggleSearch() { + if( !searchElement ) render(); + + if (searchElement.style.display !== 'inline') { + openSearch(); + } + else { + closeSearch(); + } + } + + function doSearch() { + //if there's been a change in the search term, perform a new search: + if (searchboxDirty) { + var searchstring = searchInput.value; + + if (searchstring === '') { + if(hilitor) hilitor.remove(); + matchedSlides = null; + } + else { + //find the keyword amongst the slides + hilitor = new Hilitor("slidecontent"); + matchedSlides = hilitor.apply(searchstring); + currentMatchedIndex = 0; + } + } + + if (matchedSlides) { + //navigate to the next slide that has the keyword, wrapping to the first if necessary + if (matchedSlides.length && (matchedSlides.length <= currentMatchedIndex)) { + currentMatchedIndex = 0; + } + if (matchedSlides.length > currentMatchedIndex) { + deck.slide(matchedSlides[currentMatchedIndex].h, matchedSlides[currentMatchedIndex].v); + currentMatchedIndex++; + } + } + } + + // Original JavaScript code by Chirp Internet: www.chirp.com.au + // Please acknowledge use of this code by including this header. + // 2/2013 jon: modified regex to display any match, not restricted to word boundaries. + function Hilitor(id, tag) { + + var targetNode = document.getElementById(id) || document.body; + var hiliteTag = tag || "EM"; + var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM)$"); + var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"]; + var wordColor = []; + var colorIdx = 0; + var matchRegex = ""; + var matchingSlides = []; + + this.setRegex = function(input) + { + input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|"); + matchRegex = new RegExp("(" + input + ")","i"); + } + + this.getRegex = function() + { + return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " "); + } + + // recursively apply word highlighting + this.hiliteWords = function(node) + { + if(node == undefined || !node) return; + if(!matchRegex) return; + if(skipTags.test(node.nodeName)) return; + + if(node.hasChildNodes()) { + for(var i=0; i < node.childNodes.length; i++) + this.hiliteWords(node.childNodes[i]); + } + if(node.nodeType == 3) { // NODE_TEXT + var nv, regs; + if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) { + //find the slide's section element and save it in our list of matching slides + var secnode = node; + while (secnode != null && secnode.nodeName != 'SECTION') { + secnode = secnode.parentNode; + } + + var slideIndex = deck.getIndices(secnode); + var slidelen = matchingSlides.length; + var alreadyAdded = false; + for (var i=0; i < slidelen; i++) { + if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) { + alreadyAdded = true; + } + } + if (! alreadyAdded) { + matchingSlides.push(slideIndex); + } + + if(!wordColor[regs[0].toLowerCase()]) { + wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length]; + } + + var match = document.createElement(hiliteTag); + match.appendChild(document.createTextNode(regs[0])); + match.style.backgroundColor = wordColor[regs[0].toLowerCase()]; + match.style.fontStyle = "inherit"; + match.style.color = "#000"; + + var after = node.splitText(regs.index); + after.nodeValue = after.nodeValue.substring(regs[0].length); + node.parentNode.insertBefore(match, after); + } + } + }; + + // remove highlighting + this.remove = function() + { + var arr = document.getElementsByTagName(hiliteTag); + var el; + while(arr.length && (el = arr[0])) { + el.parentNode.replaceChild(el.firstChild, el); + } + }; + + // start highlighting at target node + this.apply = function(input) + { + if(input == undefined || !input) return; + this.remove(); + this.setRegex(input); + this.hiliteWords(targetNode); + return matchingSlides; + }; + + } + + return { + + id: 'search', + + init: reveal => { + + deck = reveal; + deck.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' ); + + document.addEventListener( 'keydown', function( event ) { + if( event.key == "F" && (event.ctrlKey || event.metaKey) ) { //Control+Shift+f + event.preventDefault(); + toggleSearch(); + } + }, false ); + + }, + + open: openSearch + + } +}; + +export default Plugin; \ No newline at end of file diff --git a/plugin/search/search.esm.js b/plugin/search/search.esm.js new file mode 100644 index 0000000..76c822d --- /dev/null +++ b/plugin/search/search.esm.js @@ -0,0 +1 @@ +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")(),o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=function(t){return"object"==typeof t?null!==t:"function"==typeof t},u=r.document,a=c(u)&&c(u.createElement),l=!i&&!o((function(){return 7!=Object.defineProperty((t="div",a?u.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),f=function(t){if(!c(t))throw TypeError(String(t)+" is not an object");return t},s=function(t,e){if(!c(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!c(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!c(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!c(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},p=Object.defineProperty,g={f:i?p:function(t,e,n){if(f(t),e=s(e,!0),f(n),l)try{return p(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h=i?function(t,e,n){return g.f(t,e,d(1,n))}:function(t,e,n){return t[e]=n,t},y=function(t,e){try{h(r,t,e)}catch(n){r[t]=e}return e},v=r["__core-js_shared__"]||y("__core-js_shared__",{}),b=e((function(t){(t.exports=function(t,e){return v[t]||(v[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),x={}.hasOwnProperty,E=function(t,e){return x.call(t,e)},m=0,S=Math.random(),w=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++m+S).toString(36)},O=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())})),R=O&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,_=b("wks"),T=r.Symbol,j=R?T:T&&T.withoutSetter||w,P=function(t){return E(_,t)||(O&&E(T,t)?_[t]=T[t]:_[t]=j("Symbol."+t)),_[t]},I={};I[P("toStringTag")]="z";var C="[object z]"===String(I),N=Function.toString;"function"!=typeof v.inspectSource&&(v.inspectSource=function(t){return N.call(t)});var A,k,$,L,M=v.inspectSource,U=r.WeakMap,D="function"==typeof U&&/native code/.test(M(U)),F=b("keys"),K={},z=r.WeakMap;if(D){var B=new z,W=B.get,q=B.has,G=B.set;A=function(t,e){return G.call(B,t,e),e},k=function(t){return W.call(B,t)||{}},$=function(t){return q.call(B,t)}}else{var V=F[L="state"]||(F[L]=w(L));K[V]=!0,A=function(t,e){return h(t,V,e),e},k=function(t){return E(t,V)?t[V]:{}},$=function(t){return E(t,V)}}var Y={set:A,get:k,has:$,enforce:function(t){return $(t)?k(t):A(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=k(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},X=e((function(t){var e=Y.get,n=Y.enforce,o=String(String).split("String");(t.exports=function(t,e,i,c){var u=!!c&&!!c.unsafe,a=!!c&&!!c.enumerable,l=!!c&&!!c.noTargetGet;"function"==typeof i&&("string"!=typeof e||E(i,"name")||h(i,"name",e),n(i).source=o.join("string"==typeof e?e:"")),t!==r?(u?!l&&t[e]&&(a=!0):delete t[e],a?t[e]=i:h(t,e,i)):a?t[e]=i:y(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||M(this)}))})),H={}.toString,J=function(t){return H.call(t).slice(8,-1)},Q=P("toStringTag"),Z="Arguments"==J(function(){return arguments}()),tt=C?J:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Q))?n:Z?J(e):"Object"==(r=J(e))&&"function"==typeof e.callee?"Arguments":r},et=C?{}.toString:function(){return"[object "+tt(this)+"]"};C||X(Object.prototype,"toString",et,{unsafe:!0});var nt=/#|\.prototype\./,rt=function(t,e){var n=it[ot(t)];return n==ut||n!=ct&&("function"==typeof e?o(e):!!e)},ot=rt.normalize=function(t){return String(t).replace(nt,".").toLowerCase()},it=rt.data={},ct=rt.NATIVE="N",ut=rt.POLYFILL="P",at=rt,lt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return f(n),function(t){if(!c(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),ft="".split,st=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==J(t)?ft.call(t,""):Object(t)}:Object,pt=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},gt=function(t){return st(pt(t))},dt=Math.ceil,ht=Math.floor,yt=function(t){return isNaN(t=+t)?0:(t>0?ht:dt)(t)},vt=Math.min,bt=function(t){return t>0?vt(yt(t),9007199254740991):0},xt=Math.max,Et=Math.min,mt=function(t){return function(e,n,r){var o,i=gt(e),c=bt(i.length),u=function(t,e){var n=yt(t);return n<0?xt(n+e,0):Et(n,e)}(r,c);if(t&&n!=n){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((t||u in i)&&i[u]===n)return t||u||0;return!t&&-1}},St={includes:mt(!0),indexOf:mt(!1)}.indexOf,wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),Ot={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=gt(t),o=0,i=[];for(n in r)!E(K,n)&&E(r,n)&&i.push(n);for(;e.length>o;)E(r,n=e[o++])&&(~St(i,n)||i.push(n));return i}(t,wt)}},Rt=P("match"),_t=function(){var t=f(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function Tt(t,e){return RegExp(t,e)}var jt={UNSUPPORTED_Y:o((function(){var t=Tt("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:o((function(){var t=Tt("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Pt=r,It=function(t){return"function"==typeof t?t:void 0},Ct=function(t,e){return arguments.length<2?It(Pt[t])||It(r[t]):Pt[t]&&Pt[t][e]||r[t]&&r[t][e]},Nt=P("species"),At=g.f,kt=Ot.f,$t=Y.set,Lt=P("match"),Mt=r.RegExp,Ut=Mt.prototype,Dt=/a/g,Ft=/a/g,Kt=new Mt(Dt)!==Dt,zt=jt.UNSUPPORTED_Y;if(i&&at("RegExp",!Kt||zt||o((function(){return Ft[Lt]=!1,Mt(Dt)!=Dt||Mt(Ft)==Ft||"/a/i"!=Mt(Dt,"i")})))){for(var Bt=function(t,e){var n,r,o,i=this instanceof Bt,u=c(n=t)&&(void 0!==(r=n[Rt])?!!r:"RegExp"==J(n)),a=void 0===e;if(!i&&u&&t.constructor===Bt&&a)return t;Kt?u&&!a&&(t=t.source):t instanceof Bt&&(a&&(e=_t.call(t)),t=t.source),zt&&(o=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var l,f,s,p,g,d=(l=Kt?new Mt(t,e):Mt(t,e),f=i?this:Ut,s=Bt,lt&&"function"==typeof(p=f.constructor)&&p!==s&&c(g=p.prototype)&&g!==s.prototype&<(l,g),l);return zt&&o&&$t(d,{sticky:o}),d},Wt=function(t){t in Bt||At(Bt,t,{configurable:!0,get:function(){return Mt[t]},set:function(e){Mt[t]=e}})},qt=kt(Mt),Gt=0;qt.length>Gt;)Wt(qt[Gt++]);Ut.constructor=Bt,Bt.prototype=Ut,X(r,"RegExp",Bt)}!function(t){var e=Ct(t),n=g.f;i&&e&&!e[Nt]&&n(e,Nt,{configurable:!0,get:function(){return this}})}("RegExp");var Vt={}.propertyIsEnumerable,Yt=Object.getOwnPropertyDescriptor,Xt={f:Yt&&!Vt.call({1:2},1)?function(t){var e=Yt(this,t);return!!e&&e.enumerable}:Vt},Ht=Object.getOwnPropertyDescriptor,Jt={f:i?Ht:function(t,e){if(t=gt(t),e=s(e,!0),l)try{return Ht(t,e)}catch(t){}if(E(t,e))return d(!Xt.f.call(t,e),t[e])}},Qt={f:Object.getOwnPropertySymbols},Zt=Ct("Reflect","ownKeys")||function(t){var e=Ot.f(f(t)),n=Qt.f;return n?e.concat(n(t)):e},te=function(t,e){for(var n=Zt(e),r=g.f,o=Jt.f,i=0;i0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(a="(?: "+a+")",f=" "+f,l++),n=new RegExp("^(?:"+a+")",u)),ue&&(n=new RegExp("^"+a+"$(?!\\s)",u)),ie&&(e=i.lastIndex),r=ne.call(c?n:i,f),c?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:ie&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),ue&&r&&r.length>1&&re.call(r[0],n,(function(){for(o=1;o")})),he="$0"==="a".replace(/./,"$0"),ye=P("replace"),ve=!!/./[ye]&&""===/./[ye]("a","$0"),be=!o((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),xe=function(t){return function(e,n){var r,o,i=String(pt(e)),c=yt(n),u=i.length;return c<0||c>=u?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===u||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}},Ee={codeAt:xe(!1),charAt:xe(!0)}.charAt,me=function(t,e,n){return e+(n?Ee(t,e).length:1)},Se=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==J(t))throw TypeError("RegExp#exec called on incompatible receiver");return ae.call(t,e)},we=Math.max,Oe=Math.min,Re=Math.floor,_e=/\$([$&'`]|\d\d?|<[^>]*>)/g,Te=/\$([$&'`]|\d\d?)/g;!function(t,e,n,r){var i=P(t),c=!o((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),u=c&&!o((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[ge]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return e=!0,null},n[i](""),!e}));if(!c||!u||"replace"===t&&(!de||!he||ve)||"split"===t&&!be){var a=/./[i],l=n(i,""[t],(function(t,e,n,r,o){return e.exec===ae?c&&!o?{done:!0,value:a.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:he,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:ve}),f=l[0],s=l[1];X(String.prototype,t,f),X(RegExp.prototype,i,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&h(RegExp.prototype[i],"sham",!0)}("replace",2,(function(t,e,n,r){var o=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,c=o?"$":"$0";return[function(n,r){var o=pt(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,r){if(!o&&i||"string"==typeof r&&-1===r.indexOf(c)){var a=n(e,t,this,r);if(a.done)return a.value}var l=f(t),s=String(this),p="function"==typeof r;p||(r=String(r));var g=l.global;if(g){var d=l.unicode;l.lastIndex=0}for(var h=[];;){var y=Se(l,s);if(null===y)break;if(h.push(y),!g)break;""===String(y[0])&&(l.lastIndex=me(s,bt(l.lastIndex),d))}for(var v,b="",x=0,E=0;E=x&&(b+=s.slice(x,S)+T,x=S+m.length)}return b+s.slice(x)}];function u(t,n,r,o,i,c){var u=r+t.length,a=o.length,l=Te;return void 0!==i&&(i=Object(pt(i)),l=_e),e.call(c,l,(function(e,c){var l;switch(c.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":l=i[c.slice(1,-1)];break;default:var f=+c;if(0===f)return e;if(f>a){var s=Re(f/10);return 0===s?e:s<=a?void 0===o[s-1]?c.charAt(1):o[s-1]+c.charAt(1):e}l=o[f-1]}return void 0===l?"":l}))}}));export default function(){var t,e,n,r,o,i,c;function u(){(e=document.createElement("div")).classList.add("searchbox"),e.style.position="absolute",e.style.top="10px",e.style.right="10px",e.style.zIndex=10,e.innerHTML='\n\t\t',(n=e.querySelector(".searchinput")).style.width="240px",n.style.fontSize="14px",n.style.padding="4px 6px",n.style.color="#000",n.style.background="#fff",n.style.borderRadius="2px",n.style.border="0",n.style.outline="0",n.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",n.style["-webkit-appearance"]="none",t.getRevealElement().appendChild(e),n.addEventListener("keyup",(function(e){switch(e.keyCode){case 13:e.preventDefault(),function(){if(i){var e=n.value;""===e?(c&&c.remove(),r=null):(c=new f("slidecontent"),r=c.apply(e),o=0)}r&&(r.length&&r.length<=o&&(o=0),r.length>o&&(t.slide(r[o].h,r[o].v),o++))}(),i=!1;break;default:i=!0}}),!1),l()}function a(){e||u(),e.style.display="inline",n.focus(),n.select()}function l(){e||u(),e.style.display="none",c&&c.remove()}function f(e,n){var r=document.getElementById(e)||document.body,o=n||"EM",i=new RegExp("^(?:"+o+"|SCRIPT|FORM)$"),c=["#ff6","#a0ffff","#9f9","#f99","#f6f"],u=[],a=0,l="",f=[];this.setRegex=function(t){t=t.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),l=new RegExp("("+t+")","i")},this.getRegex=function(){return l.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(e){if(null!=e&&e&&l&&!i.test(e.nodeName)){if(e.hasChildNodes())for(var n=0;n0?ye:he)(e)},be=Math.min,xe=function(e){return e>0?be(ve(e),9007199254740991):0},me=Math.max,Ee=Math.min,Se=function(e){return function(t,n,r){var o,i=ge(t),c=xe(i.length),u=function(e,t){var n=ve(e);return n<0?me(n+t,0):Ee(n,t)}(r,c);if(e&&n!=n){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===n)return e||u||0;return!e&&-1}},we={includes:Se(!0),indexOf:Se(!1)}.indexOf,Re=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),Oe={f:Object.getOwnPropertyNames||function(e){return function(e,t){var n,r=ge(e),o=0,i=[];for(n in r)!E(z,n)&&E(r,n)&&i.push(n);for(;t.length>o;)E(r,n=t[o++])&&(~we(i,n)||i.push(n));return i}(e,Re)}},Te=I("match"),_e=function(){var e=f(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function je(e,t){return RegExp(e,t)}var Pe={UNSUPPORTED_Y:o((function(){var e=je("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:o((function(){var e=je("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Ie=r,Ce=function(e){return"function"==typeof e?e:void 0},Ne=function(e,t){return arguments.length<2?Ce(Ie[e])||Ce(r[e]):Ie[e]&&Ie[e][t]||r[e]&&r[e][t]},Ae=I("species"),ke=d.f,$e=Oe.f,Le=X.set,Me=I("match"),Ue=r.RegExp,De=Ue.prototype,Fe=/a/g,Ke=/a/g,ze=new Ue(Fe)!==Fe,Be=Pe.UNSUPPORTED_Y;if(i&&le("RegExp",!ze||Be||o((function(){return Ke[Me]=!1,Ue(Fe)!=Fe||Ue(Ke)==Ke||"/a/i"!=Ue(Fe,"i")})))){for(var We=function(e,t){var n,r,o,i=this instanceof We,u=c(n=e)&&(void 0!==(r=n[Te])?!!r:"RegExp"==Q(n)),a=void 0===t;if(!i&&u&&e.constructor===We&&a)return e;ze?u&&!a&&(e=e.source):e instanceof We&&(a&&(t=_e.call(e)),e=e.source),Be&&(o=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var l,f,s,p,d,g=(l=ze?new Ue(e,t):Ue(e,t),f=i?this:De,s=We,fe&&"function"==typeof(p=f.constructor)&&p!==s&&c(d=p.prototype)&&d!==s.prototype&&fe(l,d),l);return Be&&o&&Le(g,{sticky:o}),g},qe=function(e){e in We||ke(We,e,{configurable:!0,get:function(){return Ue[e]},set:function(t){Ue[e]=t}})},Ge=$e(Ue),Ve=0;Ge.length>Ve;)qe(Ge[Ve++]);De.constructor=We,We.prototype=De,H(r,"RegExp",We)}!function(e){var t=Ne(e),n=d.f;i&&t&&!t[Ae]&&n(t,Ae,{configurable:!0,get:function(){return this}})}("RegExp");var Ye={}.propertyIsEnumerable,Xe=Object.getOwnPropertyDescriptor,He={f:Xe&&!Ye.call({1:2},1)?function(e){var t=Xe(this,e);return!!t&&t.enumerable}:Ye},Je=Object.getOwnPropertyDescriptor,Qe={f:i?Je:function(e,t){if(e=ge(e),t=s(t,!0),l)try{return Je(e,t)}catch(e){}if(E(e,t))return g(!He.f.call(e,t),e[t])}},Ze={f:Object.getOwnPropertySymbols},et=Ne("Reflect","ownKeys")||function(e){var t=Oe.f(f(e)),n=Ze.f;return n?t.concat(n(e)):t},tt=function(e,t){for(var n=et(t),r=d.f,o=Qe.f,i=0;i0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(a="(?: "+a+")",f=" "+f,l++),n=new RegExp("^(?:"+a+")",u)),at&&(n=new RegExp("^"+a+"$(?!\\s)",u)),ct&&(t=i.lastIndex),r=rt.call(c?n:i,f),c?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:ct&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),at&&r&&r.length>1&&ot.call(r[0],n,(function(){for(o=1;o")})),vt="$0"==="a".replace(/./,"$0"),bt=I("replace"),xt=!!/./[bt]&&""===/./[bt]("a","$0"),mt=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Et=function(e){return function(t,n){var r,o,i=String(de(t)),c=ve(n),u=i.length;return c<0||c>=u?e?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===u||(o=i.charCodeAt(c+1))<56320||o>57343?e?i.charAt(c):r:e?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}},St={codeAt:Et(!1),charAt:Et(!0)}.charAt,wt=function(e,t,n){return t+(n?St(e,t).length:1)},Rt=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Q(e))throw TypeError("RegExp#exec called on incompatible receiver");return lt.call(e,t)},Ot=Math.max,Tt=Math.min,_t=Math.floor,jt=/\$([$&'`]|\d\d?|<[^>]*>)/g,Pt=/\$([$&'`]|\d\d?)/g;!function(e,t,n,r){var i=I(e),c=!o((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),u=c&&!o((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ht]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!c||!u||"replace"===e&&(!yt||!vt||xt)||"split"===e&&!mt){var a=/./[i],l=n(i,""[e],(function(e,t,n,r,o){return t.exec===lt?c&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:vt,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:xt}),f=l[0],s=l[1];H(String.prototype,e,f),H(RegExp.prototype,i,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}r&&h(RegExp.prototype[i],"sham",!0)}("replace",2,(function(e,t,n,r){var o=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,c=o?"$":"$0";return[function(n,r){var o=de(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):t.call(String(o),n,r)},function(e,r){if(!o&&i||"string"==typeof r&&-1===r.indexOf(c)){var a=n(t,e,this,r);if(a.done)return a.value}var l=f(e),s=String(this),p="function"==typeof r;p||(r=String(r));var d=l.global;if(d){var g=l.unicode;l.lastIndex=0}for(var h=[];;){var y=Rt(l,s);if(null===y)break;if(h.push(y),!d)break;""===String(y[0])&&(l.lastIndex=wt(s,xe(l.lastIndex),g))}for(var v,b="",x=0,m=0;m=x&&(b+=s.slice(x,S)+_,x=S+E.length)}return b+s.slice(x)}];function u(e,n,r,o,i,c){var u=r+e.length,a=o.length,l=Pt;return void 0!==i&&(i=Object(de(i)),l=jt),t.call(c,l,(function(t,c){var l;switch(c.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":l=i[c.slice(1,-1)];break;default:var f=+c;if(0===f)return t;if(f>a){var s=_t(f/10);return 0===s?t:s<=a?void 0===o[s-1]?c.charAt(1):o[s-1]+c.charAt(1):t}l=o[f-1]}return void 0===l?"":l}))}}));return function(){var e,t,n,r,o,i,c;function u(){(t=document.createElement("div")).classList.add("searchbox"),t.style.position="absolute",t.style.top="10px",t.style.right="10px",t.style.zIndex=10,t.innerHTML='\n\t\t',(n=t.querySelector(".searchinput")).style.width="240px",n.style.fontSize="14px",n.style.padding="4px 6px",n.style.color="#000",n.style.background="#fff",n.style.borderRadius="2px",n.style.border="0",n.style.outline="0",n.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",n.style["-webkit-appearance"]="none",e.getRevealElement().appendChild(t),n.addEventListener("keyup",(function(t){switch(t.keyCode){case 13:t.preventDefault(),function(){if(i){var t=n.value;""===t?(c&&c.remove(),r=null):(c=new f("slidecontent"),r=c.apply(t),o=0)}r&&(r.length&&r.length<=o&&(o=0),r.length>o&&(e.slide(r[o].h,r[o].v),o++))}(),i=!1;break;default:i=!0}}),!1),l()}function a(){t||u(),t.style.display="inline",n.focus(),n.select()}function l(){t||u(),t.style.display="none",c&&c.remove()}function f(t,n){var r=document.getElementById(t)||document.body,o=n||"EM",i=new RegExp("^(?:"+o+"|SCRIPT|FORM)$"),c=["#ff6","#a0ffff","#9f9","#f99","#f6f"],u=[],a=0,l="",f=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),l=new RegExp("("+e+")","i")},this.getRegex=function(){return l.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(t){if(null!=t&&t&&l&&!i.test(t.nodeName)){if(t.hasChildNodes())for(var n=0;n