/*!

* Simple-Jekyll-Search v1.6.0 (https://github.com/christian-fei/Simple-Jekyll-Search)
* Copyright 2015-2018, Christian Fei
* Licensed under the MIT License.
*/

!function(){“use strict”;function t(){return 0}function e(t){return Boolean(t)&&“[object Object]”===Object.prototype.toString.call(t)}function n(t){return l.push(t),l}var r={load:function(t,e){var n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject(“Microsoft.XMLHTTP”);n.open(“GET”,t,!0),n.onreadystatechange=function(t,e){return function(){if(4===t.readyState&&200===t.status)try{e(null,JSON.parse(t.responseText))}catch(n){e(n,null)}}}(n,e),n.send()}},i=function(t,e){var n=e.length,r=t.length;if(r>n)return!1;if(r===n)return t===e;t:for(var i=0,o=0;i<r;i++){for(var u=t.charCodeAt(i);o<n;)if(e.charCodeAt(o++)===u)continue t;return!1}return!0},o=new function(){this.matches=function(t,e){return i(e,t)}},u=new function(){this.matches=function(t,e){return“string”==typeof t&&(t=t.trim()).toLowerCase().indexOf(e.toLowerCase())>=0}},a={put:function(t){return e(t)?n(t):function(t){return Boolean(t)&&“[object Array]”===Object.prototype.toString.call(t)}(t)?function(t){for(var r=[],i=0,o=t.length;i)&&r.push(n(t));return r}(t):undefined},clear:function(){return l.length=0,l},search:function(t){return t?function(t,e,n,r){for(var i=[],o=0;o<t.length&&i.length<r.limit;o++){var u=function(t,e,n,r){for(var i in t)if(!function(t,e){for(var n=!1,r=0,i=(e=e||[]).length;r<i;r++){var o=e;!n&&new RegExp(t).test(o)&&(n=!0)}return n}(t,r.exclude)&&n.matches(t,e))return t}(t,e,n,r);u&&i.push(u)}return i}(l,t,c.searchStrategy,c).sort(c.sort):[]},setOptions:function(e){(c=e||{}).fuzzy=e.fuzzy||!1,c.limit=e.limit||10,c.searchStrategy=e.fuzzy?o:u,c.sort=e.sort||t}},l=,c={};c.fuzzy=!1,c.limit=10,c.searchStrategy=c.fuzzy?o:u,c.sort=t;var f={compile:function(t){return s.template.replace(s.pattern,function(e,n){var r=s.middleware(n,t,s.template);return void 0!==r?r:t||e})},setOptions:function(t){s.pattern=t.pattern||s.pattern,s.template=t.template||s.template,“function”==typeof t.middleware&&(s.middleware=t.middleware)}},s={};s.pattern=/{(.*?)}/g,s.template=“”,s.middleware=function(){};var p={merge:function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n=t,“undefined”!=typeof e&&(n=e));return n},isJSON:function(t){try{return!!(t instanceof Object&&JSON.parse(JSON.stringify(t)))}catch(e){return!1}}};!function(t){function e(t){a.put(t),u.searchInput.addEventListener(“keyup”,function(t){(function(t){return-1===.indexOf(t)})(t.which)&&(u.resultsContainer.innerHTML=“”,i(t.target.value))})}function n(t){u.resultsContainer.innerHTML+=t}function i(t){(function(t){return t&&t.length>0})(t)&&function(t){var e=t.length;if(0===e)return n(u.noResultsText);for(var r=0;r))}(a.search(t))}function o(t){throw new Error(“SimpleJekyllSearch — ”+t)}var u={searchInput:null,resultsContainer:null,json:[],searchResultTemplate:'<li><a href=“{url}” title=“{desc}”>{title}</a></li>',templateMiddleware:function(){},sortMiddleware:function(){return 0},noResultsText:“No results found”,limit:10,fuzzy:!1,exclude:[]},l=,c=function s(t){if(!function(t){return!!t&&“undefined”!=typeof t.required&&t.required instanceof Array}(t))throw new Error(“– OptionsValidator: required options missing”);if(!(this instanceof s))return new s(t);var e=t.required;this.getRequiredOptions=function(){return e},this.validate=function(t){var n=[];return e.forEach(function(e){“undefined”==typeof t&&n.push(e)}),n}}({required:l});t.SimpleJekyllSearch=function(t){return c.validate(t).length>0&&o(“You must specify the following required options: ”+l),u=p.merge(u,t),f.setOptions({template:u.searchResultTemplate,middleware:u.templateMiddleware}),a.setOptions({fuzzy:u.fuzzy,limit:u.limit,sort:u.sortMiddleware}),p.isJSON(u.json)?e(u.json):function(t){r.load(t,function(n,r){n&&o(“failed to get JSON (”t“)”),e®})}(u.json),{search:i}},t.SimpleJekyllSearch.init=t.SimpleJekyllSearch,“function”==typeof t.SimpleJekyllSearchInit&&t.SimpleJekyllSearchInit.call(this,t.SimpleJekyllSearch)}(window)}();