Files
site/public/assets/js/fuse_search.1ada4bca.js

10 lines
13 KiB
JavaScript

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=38)}({0:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"d",function(){return o}),n.d(t,"c",function(){return i}),n.d(t,"b",function(){return a});var r=function(e,t){0===e.length?t.innerHTML="<li class='results-empty'>\n <a href='#search-term'>".concat(t.dataset.resultsEmpty,"</a>\n </li>"):t.innerHTML=e.reduce(function(e,t){var n=t.href,r=t.title;return"".concat(e,"<li><a href='").concat(n,"'>").concat(r,"</a></li>")},"")},o=function(e){e.innerHTML="<li class='searching'>\n <a href='#search-results'>".concat(e.dataset.searching,"&hellip;</a>\n </li>")},i=function(e){if("URLSearchParams"in window)return new URLSearchParams(window.location.search).get(e);e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},a=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onload=function(){if(n.status>=200&&n.status<400){var e=JSON.parse(n.responseText);t(null,e)}else t(new Error(n.statusText))},n.onerror=function(){t(new Error("Failed to get JSON! ".concat(n.statusText)))},n.send()}},14:function(e,t,n){
/*!
* Fuse.js v3.2.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=n(5),i=n(7),a=n(4),s=function(){function e(t,n){var r=n.location,o=void 0===r?0:r,i=n.distance,s=void 0===i?100:i,c=n.threshold,u=void 0===c?.6:c,l=n.maxPatternLength,h=void 0===l?32:l,f=n.isCaseSensitive,d=void 0!==f&&f,v=n.tokenSeparator,p=void 0===v?/ +/g:v,g=n.findAllMatches,y=void 0!==g&&g,m=n.minMatchCharLength,x=void 0===m?1:m;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:o,distance:s,threshold:u,maxPatternLength:h,isCaseSensitive:d,tokenSeparator:p,findAllMatches:y,minMatchCharLength:x},this.pattern=this.options.isCaseSensitive?t:t.toLowerCase(),this.pattern.length<=h&&(this.patternAlphabet=a(this.pattern))}return r(e,[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,n=t.maxPatternLength,r=t.tokenSeparator;if(this.pattern.length>n)return o(e,this.pattern,r);var a=this.options,s=a.location,c=a.distance,u=a.threshold,l=a.findAllMatches,h=a.minMatchCharLength;return i(e,this.pattern,this.patternAlphabet,{location:s,distance:c,threshold:u,findAllMatches:l,minMatchCharLength:h})}}]),e}();e.exports=s},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){return function e(t,n,o){if(n){var i=n.indexOf("."),a=n,s=null;-1!==i&&(a=n.slice(0,i),s=n.slice(i+1));var c=t[a];if(null!=c)if(s||"string"!=typeof c&&"number"!=typeof c)if(r(c))for(var u=0,l=c.length;u<l;u+=1)e(c[u],s,o);else s&&e(c,s,o);else o.push(c.toString())}else o.push(t);return o}(e,t,[])}},function(e,t,n){"use strict";e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=-1,o=-1,i=0,a=e.length;i<a;i+=1){var s=e[i];s&&-1===r?r=i:s||-1===r||((o=i-1)-r+1>=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,r=0;r<n;r+=1)t[e.charAt(r)]=0;for(var o=0;o<n;o+=1)t[e.charAt(o)]|=1<<n-o-1;return t}},function(e,t,n){"use strict";var r=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(r,"\\$&").replace(n,"|")),i=e.match(o),a=!!i,s=[];if(a)for(var c=0,u=i.length;c<u;c+=1){var l=i[c];s.push([e.indexOf(l),l.length-1])}return{score:a?.5:1,isMatch:a,matchedIndices:s}}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.errors,r=void 0===n?0:n,o=t.currentLocation,i=void 0===o?0:o,a=t.expectedLocation,s=void 0===a?0:a,c=t.distance,u=void 0===c?100:c,l=r/e.length,h=Math.abs(s-i);return u?l+h/u:h?1:l}},function(e,t,n){"use strict";var r=n(6),o=n(3);e.exports=function(e,t,n,i){for(var a=i.location,s=void 0===a?0:a,c=i.distance,u=void 0===c?100:c,l=i.threshold,h=void 0===l?.6:l,f=i.findAllMatches,d=void 0!==f&&f,v=i.minMatchCharLength,p=void 0===v?1:v,g=s,y=e.length,m=h,x=e.indexOf(t,g),k=t.length,S=[],b=0;b<y;b+=1)S[b]=0;if(-1!==x){var M=r(t,{errors:0,currentLocation:x,expectedLocation:g,distance:u});if(m=Math.min(M,m),-1!==(x=e.lastIndexOf(t,g+k))){var w=r(t,{errors:0,currentLocation:x,expectedLocation:g,distance:u});m=Math.min(w,m)}}x=-1;for(var L=[],_=1,O=k+y,A=1<<k-1,C=0;C<k;C+=1){for(var I=0,j=O;I<j;){r(t,{errors:C,currentLocation:g+j,expectedLocation:g,distance:u})<=m?I=j:O=j,j=Math.floor((O-I)/2+I)}O=j;var P=Math.max(1,g-j+1),T=d?y:Math.min(g+j,y)+k,E=Array(T+2);E[T+1]=(1<<C)-1;for(var z=T;z>=P;z-=1){var F=z-1,R=n[e.charAt(F)];if(R&&(S[F]=1),E[z]=(E[z+1]<<1|1)&R,0!==C&&(E[z]|=(L[z+1]|L[z])<<1|1|L[z+1]),E[z]&A&&(_=r(t,{errors:C,currentLocation:F,expectedLocation:g,distance:u}))<=m){if(m=_,(x=F)<=g)break;P=Math.max(1,2*g-x)}}if(r(t,{errors:C+1,currentLocation:g,expectedLocation:g,distance:u})>m)break;L=E}return{isMatch:x>=0,score:0===_?.001:_,matchedIndices:o(S,p)}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=n(1),i=n(2),a=n(0),s=function(){function e(t,n){var r=n.location,o=void 0===r?0:r,a=n.distance,s=void 0===a?100:a,c=n.threshold,u=void 0===c?.6:c,l=n.maxPatternLength,h=void 0===l?32:l,f=n.caseSensitive,d=void 0!==f&&f,v=n.tokenSeparator,p=void 0===v?/ +/g:v,g=n.findAllMatches,y=void 0!==g&&g,m=n.minMatchCharLength,x=void 0===m?1:m,k=n.id,S=void 0===k?null:k,b=n.keys,M=void 0===b?[]:b,w=n.shouldSort,L=void 0===w||w,_=n.getFn,O=void 0===_?i:_,A=n.sortFn,C=void 0===A?function(e,t){return e.score-t.score}:A,I=n.tokenize,j=void 0!==I&&I,P=n.matchAllTokens,T=void 0!==P&&P,E=n.includeMatches,z=void 0!==E&&E,F=n.includeScore,R=void 0!==F&&F,H=n.verbose,J=void 0!==H&&H;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:o,distance:s,threshold:u,maxPatternLength:h,isCaseSensitive:d,tokenSeparator:p,findAllMatches:y,minMatchCharLength:x,id:S,keys:M,includeMatches:z,includeScore:R,shouldSort:L,getFn:O,sortFn:C,verbose:J,tokenize:j,matchAllTokens:T},this.setCollection(t)}return r(e,[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"search",value:function(e){this._log('---------\nSearch pattern: "'+e+'"');var t=this._prepareSearchers(e),n=t.tokenSearchers,r=t.fullSearcher,o=this._search(n,r),i=o.weights,a=o.results;return this._computeScore(i,a),this.options.shouldSort&&this._sort(a),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),r=0,i=n.length;r<i;r+=1)t.push(new o(n[r],this.options));return{tokenSearchers:t,fullSearcher:new o(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,r={},o=[];if("string"==typeof n[0]){for(var i=0,a=n.length;i<a;i+=1)this._analyze({key:"",value:n[i],record:i,index:i},{resultMap:r,results:o,tokenSearchers:e,fullSearcher:t});return{weights:null,results:o}}for(var s={},c=0,u=n.length;c<u;c+=1)for(var l=n[c],h=0,f=this.options.keys.length;h<f;h+=1){var d=this.options.keys[h];if("string"!=typeof d){if(s[d.name]={weight:1-d.weight||1},d.weight<=0||d.weight>1)throw new Error("Key weight has to be > 0 and <= 1");d=d.name}else s[d]={weight:1};this._analyze({key:d,value:this.options.getFn(l,d),record:l,index:c},{resultMap:r,results:o,tokenSearchers:e,fullSearcher:t})}return{weights:s,results:o}}},{key:"_analyze",value:function(e,t){var n=e.key,r=e.arrayIndex,o=void 0===r?-1:r,i=e.value,s=e.record,c=e.index,u=t.tokenSearchers,l=void 0===u?[]:u,h=t.fullSearcher,f=void 0===h?[]:h,d=t.resultMap,v=void 0===d?{}:d,p=t.results,g=void 0===p?[]:p;if(null!=i){var y=!1,m=-1,x=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=f.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var S=i.split(this.options.tokenSeparator),b=[],M=0;M<l.length;M+=1){var w=l[M];this._log('\nPattern: "'+w.pattern+'"');for(var L=!1,_=0;_<S.length;_+=1){var O=S[_],A=w.search(O),C={};A.isMatch?(C[O]=A.score,y=!0,L=!0,b.push(A.score)):(C[O]=1,this.options.matchAllTokens||b.push(1)),this._log('Token: "'+O+'", score: '+C[O])}L&&(x+=1)}m=b[0];for(var I=b.length,j=1;j<I;j+=1)m+=b[j];m/=I,this._log("Token score average:",m)}var P=k.score;m>-1&&(P=(P+m)/2),this._log("Score average:",P);var T=!this.options.tokenize||!this.options.matchAllTokens||x>=l.length;if(this._log("\nCheck Matches: "+T),(y||k.isMatch)&&T){var E=v[c];E?E.output.push({key:n,arrayIndex:o,value:i,score:P,matchedIndices:k.matchedIndices}):(v[c]={item:s,output:[{key:n,arrayIndex:o,value:i,score:P,matchedIndices:k.matchedIndices}]},g.push(v[c]))}}else if(a(i))for(var z=0,F=i.length;z<F;z+=1)this._analyze({key:n,arrayIndex:z,value:i[z],record:s,index:c},{resultMap:v,results:g,tokenSearchers:l,fullSearcher:f})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var n=0,r=t.length;n<r;n+=1){for(var o=t[n].output,i=o.length,a=1,s=1,c=0;c<i;c+=1){var u=e?e[o[c].key].weight:1,l=(1===u?o[c].score:o[c].score||.001)*u;1!==u?s=Math.min(s,l):(o[c].nScore=l,a*=l)}t[n].score=1===s?a:s,this._log(t[n])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];this.options.verbose&&this._log("\n\nOutput:\n\n",JSON.stringify(e));var n=[];this.options.includeMatches&&n.push(function(e,t){var n=e.output;t.matches=[];for(var r=0,o=n.length;r<o;r+=1){var i=n[r];if(0!==i.matchedIndices.length){var a={indices:i.matchedIndices,value:i.value};i.key&&(a.key=i.key),i.hasOwnProperty("arrayIndex")&&i.arrayIndex>-1&&(a.arrayIndex=i.arrayIndex),t.matches.push(a)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var r=0,o=e.length;r<o;r+=1){var i=e[r];if(this.options.id&&(i.item=this.options.getFn(i.item,this.options.id)[0]),n.length){for(var a={item:i.item},s=0,c=n.length;s<c;s+=1)n[s](i,a);t.push(a)}else t.push(i.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}]),e}();e.exports=s}])},e.exports=r()},38:function(e,t,n){"use strict";n.r(t);var r=n(14),o=n.n(r),i=n(0),a=function(e,t,n){Object(i.d)(n);var r=e?t.search(e).map(function(e){return{href:e.href,title:e.title}}):[];Object(i.a)(r,n)},s={shouldSort:!0,threshold:.5,location:0,distance:500,maxPatternLength:32,minMatchCharLength:1,keys:[{name:"title",weight:.7},{name:"content",weight:.3}]},c=document.getElementById("search-term"),u=document.getElementById("search-results"),l=Object(i.c)("q");c.value=l,c.focus(),Object(i.d)(u),Object(i.b)("".concat(window.location.pathname,"index.json"),function(e,t){if(e)console.error(e);else{var n=new o.a(t,s);a(l,n,u),c.addEventListener("input",function(e){a(e.target.value,n,u)})}})}});