daux.io/daux_libraries/search.min.js

3 lines
33 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=s(t);if(e){var r=s(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return l(this,n)}}var h,u,a,f,d,p,_={},g=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function v(t,e){for(var n in e)t[n]=e[n];return t}function m(t){var e=t.parentNode;e&&e.removeChild(t)}function b(t,e,n){var i,r=arguments,s={};for(i in e)"key"!==i&&"ref"!==i&&(s[i]=e[i]);if(arguments.length>3)for(n=[n],i=3;i<arguments.length;i++)n.push(r[i]);if(null!=n&&(s.children=n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===s[i]&&(s[i]=t.defaultProps[i]);return w(t,s,e&&e.key,e&&e.ref,null)}function w(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r};return null==r&&(s.__v=s),h.vnode&&h.vnode(s),s}function k(t){return t.children}function x(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function O(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return O(t)}}function P(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!a++||d!==h.debounceRendering)&&((d=h.debounceRendering)||f)(C)}function C(){for(var t;a=u.length;)t=u.sort((function(t,e){return t.__v.__b-e.__v.__b})),u=[],t.some((function(t){var e,n,i,r,s,o,l;t.__d&&(o=(s=(e=t).__v).__e,(l=e.__P)&&(n=[],(i=v({},s)).__v=i,r=T(l,s,i,e.__n,void 0!==l.ownerSVGElement,null,n,null==o?S(s):o),D(n,s),r!=o&&O(s)))}))}function j(t,e,n,i,r,s,o,l,c,h){var u,a,f,d,p,y,v,b,x,O=i&&i.__k||g,P=O.length;for(c==_&&(c=null!=o?o[0]:P?S(i,0):null),n.__k=[],u=0;u<e.length;u++)if(null!=(d=n.__k[u]=null==(d=e[u])||"boolean"==typeof d?null:"string"==typeof d||"number"==typeof d?w(null,d,null,null,d):Array.isArray(d)?w(k,{children:d},null,null,null):null!=d.__e||null!=d.__c?w(d.type,d.props,d.key,null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(f=O[u])||f&&d.key==f.key&&d.type===f.type)O[u]=void 0;else for(a=0;a<P;a++){if((f=O[a])&&d.key==f.key&&d.type===f.type){O[a]=void 0;break}f=null}if(p=T(t,d,f=f||_,r,s,o,l,c,h),(a=d.ref)&&f.ref!=a&&(b||(b=[]),f.ref&&b.push(f.ref,null,d),b.push(a,d.__c||p,d)),null!=p){if(null==v&&(v=p),x=void 0,void 0!==d.__d)x=d.__d,d.__d=void 0;else if(o==f||p!=c||null==p.parentNode){t:if(null==c||c.parentNode!==t)t.appendChild(p),x=null;else{for(y=c,a=0;(y=y.nextSibling)&&a<P;a+=2)if(y==p)break t;t.insertBefore(p,c),x=c}"option"==n.type&&(t.value="")}c=void 0!==x?x:p.nextSibling,"function"==typeof n.type&&(n.__d=c)}else c&&f.__e==c&&c.parentNode!=t&&(c=S(f))}if(n.__e=v,null!=o&&"function"!=typeof n.type)for(u=o.length;u--;)null!=o[u]&&m(o[u]);for(u=P;u--;)null!=O[u]&&U(O[u],O[u]);if(b)for(u=0;u<b.length;u++)A(b[u],b[++u],b[++u])}function R(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]="number"==typeof n&&!1===y.test(e)?n+"px":null==n?"":n}function L(t,e,n,i,r){var s,o,l,c,h;if(r?"className"===e&&(e="class"):"class"===e&&(e="className"),"style"===e)if(s=t.style,"string"==typeof n)s.cssText=n;else{if("string"==typeof i&&(s.cssText="",i=null),i)for(c in i)n&&c in n||R(s,c,"");if(n)for(h in n)i&&n[h]===i[h]||R(s,h,n[h])}else"o"===e[0]&&"n"===e[1]?(o=e!==(e=e.replace(/Capture$/,"")),l=e.toLowerCase(),e=(l in t?l:e).slice(2),n?(i||t.addEventListener(e,N,o),(t.l||(t.l={}))[e]=n):t.removeEventListener(e,N,o)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&"size"!==e&&!r&&e in t?t[e]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==n||!1===n?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(e)?t.removeAttribute(e):t.setAttribute(e,n))}function N(t){this.l[t.type](h.event?h.event(t):t)}function T(t,e,n,i,r,s,o,l,c){var u,a,f,d,p,_,g,y,m,b,w,S=e.type;if(void 0!==e.constructor)return null;(u=h.__b)&&u(e);try{t:if("function"==typeof S){if(y=e.props,m=(u=S.contextType)&&i[u.__c],b=u?m?m.props.value:u.__:i,n.__c?g=(a=e.__c=n.__c).__=a.__E:("prototype"in S&&S.prototype.render?e.__c=a=new S(y,b):(e.__c=a=new x(y,b),a.constructor=S,a.render=I),m&&m.sub(a),a.props=y,a.state||(a.state={}),a.context=b,a.__n=i,f=a.__d=!0,a.__h=[]),null==a.__s&&(a.__s=a.state),null!=S.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=v({},a.__s)),v(a.__s,S.getDerivedStateFromProps(y,a.__s))),d=a.props,p=a.state,f)null==S.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else{if(null==S.getDerivedStateFromProps&&y!==d&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(y,b),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(y,a.__s,b)||e.__v===n.__v){for(a.props=y,a.state=a.__s,e.__v!==n.__v&&(a.__d=!1),a.__v=e,e.__e=n.__e,e.__k=n.__k,a.__h.length&&o.push(a),u=0;u<e.__k.length;u++)e.__k[u]&&(e.__k[u].__=e);break t}null!=a.componentWillUpdate&&a.componentWillUpdate(y,a.__s,b),null!=a.componentDidUpdate&&a.__h.push((function(){a.componentDidUpdate(d,p,_)}))}a.context=b,a.props=y,a.state=a.__s,(u=h.__r)&&u(e),a.__d=!1,a.__v=e,a.__P=t,u=a.render(a.props,a.state,a.context),null!=a.getChildContext&&(i=v(v({},i),a.getChildContext())),f||null==a.getSnapshotBeforeUpdate||(_=a.getSnapshotBeforeUpdate(d,p)),w=null!=u&&u.type==k&&null==u.key?u.props.children:u,j(t,Array.isArray(w)?w:[w],e,n,i,r,s,o,l,c),a.base=e.__e,a.__h.length&&o.push(a),g&&(a.__E=a.__=null),a.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=E(n.__e,e,n,i,r,s,o,c);(u=h.diffed)&&u(e)}catch(t){e.__v=null,h.__e(t,e,n)}return e.__e}function D(t,e){h.__c&&h.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){h.__e(t,e.__v)}}))}function E(t,e,n,i,r,s,o,l){var c,h,u,a,f,d=n.props,p=e.props;if(r="svg"===e.type||r,null!=s)for(c=0;c<s.length;c++)if(null!=(h=s[c])&&((null===e.type?3===h.nodeType:h.localName===e.type)||t==h)){t=h,s[c]=null;break}if(null==t){if(null===e.type)return document.createTextNode(p);t=r?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,p.is&&{is:p.is}),s=null,l=!1}if(null===e.type)d!==p&&t.data!=p&&(t.data=p);else{if(null!=s&&(s=g.slice.call(t.childNodes)),u=(d=n.props||_).dangerouslySetInnerHTML,a=p.dangerouslySetInnerHTML,!l){if(null!=s)for(d={},f=0;f<t.attributes.length;f++)d[t.attributes[f].name]=t.attributes[f].value;(a||u)&&(a&&u&&a.__html==u.__html||(t.innerHTML=a&&a.__html||""))}(function(t,e,n,i,r){var s;for(s in n)"children"===s||"key"===s||s in e||L(t,s,null,n[s],i);for(s in e)r&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||L(t,s,e[s],n[s],i)})(t,p,d,r,l),a?e.__k=[]:(c=e.props.children,j(t,Array.isArray(c)?c:[c],e,n,i,"foreignObject"!==e.type&&r,s,o,_,l)),l||("value"in p&&void 0!==(c=p.value)&&c!==t.value&&L(t,"value",c,d.value,!1),"checked"in p&&void 0!==(c=p.checked)&&c!==t.checked&&L(t,"checked",c,d.checked,!1))}return t}function A(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){h.__e(t,n)}}function U(t,e,n){var i,r,s;if(h.unmount&&h.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||A(i,null,e)),n||"function"==typeof t.type||(n=null!=(r=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){h.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&U(i[s],e,n);null!=r&&m(r)}function I(t,e,n){return this.constructor(t,n)}function M(t,e,n){var i,r,s;h.__&&h.__(t,e),r=(i=n===p)?null:n&&n.__k||e.__k,t=b(k,null,[t]),s=[],T(e,(i?e:n||e).__k=t,r||_,_,void 0!==e.ownerSVGElement,n&&!i?[n]:r?null:e.childNodes.length?g.slice.call(e.childNodes):null,s,n||_,i),D(s,t)}h={__e:function(t,e){for(var n,i;e=e.__;)if((n=e.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(i=!0,n.setState(n.constructor.getDerivedStateFromError(t))),null!=n.componentDidCatch&&(i=!0,n.componentDidCatch(t)),i)return P(n.__E=n)}catch(e){t=e}throw t}},x.prototype.setState=function(t,e){var n;n=this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(n,this.props)),t&&v(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),P(this))},x.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),P(this))},x.prototype.render=k,u=[],a=0,f="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,p=_;var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var W=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){!function(e,n,i){let r;(r=i.define)&&r.amd?r([],(function(){return n})):(r=i.modules)?r["FlexSearch".toLowerCase()]=n:t.exports=n}(0,function t(e){function n(t,e){const n=e?e.id:t&&t.id;this.id=n||0===n?n:R++,this.init(t,e),o(this,"index",(function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)})),o(this,"length",(function(){return this.index.length}))}function i(t,e,n,i){return this.u!==this.g&&(this.o=this.o.concat(n),this.u++,i&&this.o.length>=i&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(e,this.o),this.F&&this.F(this.o))),this}function r(t,e){const n=t.length,i=m(e),r=[];for(let s=0,o=0;s<n;s++){const n=t[s];(i&&e(n)||!i&&!e[n])&&(r[o++]=n)}return r}function s(t,e,n,i,r,s,o,l,c,h){let u;if(n=g(n,o?0:r,l,s,e,c,h),l&&(l=n.page,u=n.next,n=n.result),o)e=this.where(o,null,r,n);else{for(e=n,n=this.l,r=e.length,s=Array(r),o=0;o<r;o++)s[o]=n[e[o]];e=s}return n=e,i&&(m(i)||(T=i.split(":"),1<T.length?i=p:(T=T[0],i=d)),n.sort(i)),n=_(l,u,n),this.cache&&this.j.set(t,n),n}function o(t,e,n){Object.defineProperty(t,e,{get:n})}function l(t){return new RegExp(t,"g")}function c(t,e){for(let n=0;n<e.length;n+=2)t=t.replace(e[n],e[n+1]);return t}function h(t,e,n,i,r,s,o,l){return e[n]?e[n]:(r=r?(l-(o||l/1.5))*s+(o||l/1.5)*r:s,e[n]=r,r>=o&&((t=(t=t[l-(r+.5>>0)])[n]||(t[n]=[]))[t.length]=i),r)}function u(t,e){if(t){const n=Object.keys(t);for(let i=0,r=n.length;i<r;i++){const r=n[i],s=t[r];if(s)for(let n=0,i=s.length;n<i;n++){if(s[n]===e){1===i?delete t[r]:s.splice(n,1);break}b(s[n])&&u(s[n],e)}}}}function a(t){let e="",n="";var i="";for(let r=0;r<t.length;r++){const s=t[r];s!==n&&(r&&"h"===s?(i="a"===i||"e"===i||"i"===i||"o"===i||"u"===i||"y"===i,(("a"===n||"e"===n||"i"===n||"o"===n||"u"===n||"y"===n)&&i||" "===n)&&(e+=s)):e+=s),i=r===t.length-1?"":t[r+1],n=s}return e}function f(t,e){return 0>(t=t.length-e.length)?1:t?-1:0}function d(t,e){return(t=t[T])<(e=e[T])?-1:t>e?1:0}function p(t,e){const n=T.length;for(let i=0;i<n;i++)t=t[T[i]],e=e[T[i]];return t<e?-1:t>e?1:0}function _(t,e,n){return t?{page:t,next:e?""+e:null,result:n}:n}function g(t,e,n,i,r,s,o){let l,c=[];if(!0===n){n="0";var h=""}else h=n&&n.split(":");const u=t.length;if(1<u){const m=x(),b=[];let k,S;var a,f=0;let O;var d=!0;let P,C,j,R,L,N,T=0;if(h&&(2===h.length?(R=h,h=!1):h=L=parseInt(h[0],10)),o){for(k=x();f<u;f++)if("not"===r[f])for(S=t[f],O=S.length,a=0;a<O;a++)k["@"+S[a]]=1;else j=f+1;if(w(j))return _(n,l,c);f=0}else C=y(r)&&r;for(;f<u;f++){const y=f===(j||u)-1;if(!C||!f)if((a=C||r&&r[f])&&"and"!==a){if("or"!==a)continue;N=!1}else N=s=!0;if(S=t[f],O=S.length){if(d){if(!P){P=S;continue}var p=P.length;for(a=0;a<p;a++){var g="@"+(d=P[a]);o&&k[g]||(m[g]=1,s||(c[T++]=d))}P=null,d=!1}for(g=!1,a=0;a<O;a++){var v="@"+(p=S[a]);const t=s?m[v]||0:f;if(!(!t&&!i||o&&k[v]||!s&&m[v]))if(t===f){if(y){if((!L||--L<T)&&(c[T++]=p,e&&T===e))return _(n,T+(h||0),c)}else m[v]=f+1;g=!0}else i&&((v=b[t]||(b[t]=[]))[v.length]=p)}if(N&&!g&&!i)break}else if(N&&!i)return _(n,l,S)}if(P)if(f=P.length,o)for(a=h?parseInt(h,10):0;a<f;a++)k["@"+(t=P[a])]||(c[T++]=t);else c=P;if(i)for(T=c.length,R?(f=parseInt(R[0],10)+1,a=parseInt(R[1],10)+1):(f=b.length,a=0);f--;)if(p=b[f]){for(O=p.length;a<O;a++)if(i=p[a],(!o||!k["@"+i])&&(c[T++]=i,e&&T===e))return _(n,f+":"+a,c);a=0}}else!u||r&&"not"===r[0]||(c=t[0],h&&(h=parseInt(h[0],10)));return e&&(o=c.length,h&&h>o&&(h=0),l=(h=h||0)+e,l<o?c=c.slice(h,l):(l=0,h&&(c=c.slice(h)))),_(n,l,c)}function y(t){return"string"==typeof t}function v(t){return t.constructor===Array}function m(t){return"function"==typeof t}function b(t){return"object"==typeof t}function w(t){return void 0===t}function k(t){const e=Array(t);for(let n=0;n<t;n++)e[n]=x();return e}function x(){return Object.create(null)}function S(){let t,e;self.onmessage=function(n){if(n=n.data)if(n.search){const i=e.search(n.content,n.threshold?{limit:n.limit,threshold:n.threshold,where:n.where}:n.limit);self.postMessage({id:t,content:n.content,limit:n.limit,result:i})}else n.add?e.add(n.id,n.content):n.update?e.update(n.id,n.content):n.remove?e.remove(n.id):n.clear?e.clear():n.info?((n=e.info()).worker=t,console.log(n)):n.register&&(t=n.id,n.options.cache=!1,n.options.async=!1,n.options.worker=!1,e=new Function(n.register.substring(n.register.indexOf("{")+1,n.register.lastIndexOf("}")))(),e=new e(n.options))}}function O(n,i,r,s){n=e("flexsearch","id"+n,S,(function(t){(t=t.data)&&t.result&&s(t.id,t.content,t.result,t.limit,t.where,t.cursor,t.suggest)}),i);const o=t.toString();return r.id=i,n.postMessage({register:o,options:r,id:i}),n}const P={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},C={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1,b:3},score:{encode:"extra",f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,b:9,depth:1}},j=[];let R=0;const L={},N={};let T;n.create=function(t,e){return new n(t,e)},n.registerMatcher=function(t){for(const e in t)t.hasOwnProperty(e)&&j.push(l(e),t[e]);return this},n.registerEncoder=function(t,e){return E[t]=e.bind(E),this},n.registerLanguage=function(t,e){return L[t]=e.filter,N[t]=e.stemmer,this},n.encode=function(t,e){return E[t](e)},n.prototype.init=function(t,e){if(this.v=[],e){var r=e.preset;t=e}else t||(t=P),r=t.preset;if(e={},y(t)?(e=C[t],t={}):r&&(e=C[r]),r=t.worker)if("undefined"==typeof Worker)t.worker=!1,this.m=null;else{var s=parseInt(r,10)||4;this.C=-1,this.u=0,this.o=[],this.F=null,this.m=Array(s);for(var o=0;o<s;o++)this.m[o]=O(this.id,o,t,i.bind(this))}if(this.f=t.tokenize||e.f||this.f||P.f,this.split=w(r=t.split)?this.split||P.split:y(r)?l(r):r,this.D=t.rtl||this.D||P.D,this.async="undefined"==typeof Promise||w(r=t.async)?this.async||P.async:r,this.g=w(r=t.worker)?this.g||P.g:r,this.threshold=w(r=t.threshold)?e.threshold||this.threshold||P.threshold:r,this.b=w(r=t.resolution)?r=e.b||this.b||P.b:r,r<=this.threshold&&(this.b=this.threshold+1),this.depth="strict"!==this.f||w(r=t.depth)?e.depth||this.depth||P.depth:r,this.w=(r=w(r=t.encode)?e.encode||P.encode:r)&&E[r]&&E[r].bind(E)||(m(r)?r:this.w||!1),(r=t.matcher)&&this.addMatcher(r),r=(e=t.lang)||t.filter){if(y(r)&&(r=L[r]),v(r)){s=this.w,o=x();for(var c=0;c<r.length;c++){var h=s?s(r[c]):r[c];o[h]=1}r=o}this.filter=r}if(r=e||t.stemmer){var u;for(u in e=y(r)?N[r]:r,s=this.w,o=[],e)e.hasOwnProperty(u)&&(c=s?s(u):u,o.push(l(c+"($|\\W)"),s?s(e[u]):e[u]));this.stemmer=u=o}if(this.a=o=(r=t.doc)?function t(e){const n=x();for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];v(r)?n[i]=r.slice(0):b(r)?n[i]=t(r):n[i]=r}return n}(r):this.a||P.a,this.i=k(this.b-(this.threshold||0)),this.h=x(),this.c=x(),o){if(this.l=x(),t.doc=null,u=o.index={},e=o.keys=[],s=o.field,c=o.tag,h=o.store,v(o.id)||(o.id=o.id.split(":")),h){var a=x();if(y(h))a[h]=1;else if(v(h))for(let t=0;t<h.length;t++)a[h[t]]=1;else b(h)&&(a=h);o.store=a}if(c){if(this.G=x(),h=x(),s)if(y(s))h[s]=t;else if(v(s))for(a=0;a<s.length;a++)h[s[a]]=t;else b(s)&&(h=s);for(v(c)||(o.tag=c=[c]),s=0;s<c.length;s++)this.G[c[s]]=x();this.I=c,s=h}if(s){let i;for(v(s)||(b(s)?(i=s,o.field=s=Object.keys(s)):o.field=s=[s]),o=0;o<s.length;o++)v(c=s[o])||(i&&(t=i[c]),e[o]=c,s[o]=c.split(":")),u[c]=new n(t)}t.doc=r}return this.B=!0,this.j=!!(this.cache=r=w(r=t.cache)?this.cache||P.cache:r)&&new A(r),this},n.prototype.encode=function(t){return t&&(j.length&&(t=c(t,j)),this.v.length&&(t=c(t,this.v)),this.w&&(t=this.w(t)),this.stemmer&&(t=c(t,this.stemmer))),t},n.prototype.addMatcher=function(t){const e=this.v;for(const n in t)t.hasOwnProperty(n)&&e.push(l(n),t[n]);return this},n.prototype.add=function(t,e,n,i,s){if(this.a&&b(t))return this.A("add",t,e);if(e&&y(e)&&(t||0===t)){var o="@"+t;if(this.c[o]&&!i)return this.update(t,e);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:t,content:e}),this.c[o]=""+this.C,n&&n(),this;if(!s){if(this.async&&"function"!=typeof importScripts){let r=this;return o=new Promise((function(n){setTimeout((function(){r.add(t,e,null,i,!0),r=null,n()}))})),n?(o.then(n),this):o}if(n)return this.add(t,e,null,i,!0),n(),this}if(!(e=this.encode(e)).length)return this;s=m(n=this.f)?n(e):e.split(this.split),this.filter&&(s=r(s,this.filter));const d=x();d._ctx=x();const p=s.length,_=this.threshold,g=this.depth,y=this.b,v=this.i,b=this.D;for(let e=0;e<p;e++){var l=s[e];if(l){var c=l.length,u=(b?e+1:p-e)/p,a="";switch(n){case"reverse":case"both":for(var f=c;--f;)h(v,d,a=l[f]+a,t,b?1:(c-f)/c,u,_,y-1);a="";case"forward":for(f=0;f<c;f++)h(v,d,a+=l[f],t,b?(f+1)/c:1,u,_,y-1);break;case"full":for(f=0;f<c;f++){const e=(b?f+1:c-f)/c;for(let n=c;n>f;n--)h(v,d,a=l.substring(f,n),t,e,u,_,y-1)}break;default:if(c=h(v,d,l,t,1,u,_,y-1),g&&1<p&&c>=_)for(c=d._ctx[l]||(d._ctx[l]=x()),l=this.h[l]||(this.h[l]=k(y-(_||0))),0>(u=e-g)&&(u=0),(a=e+g+1)>p&&(a=p);u<a;u++)u!==e&&h(l,c,s[u],t,0,y-(u<e?e-u:u-e),_,y-1)}}}this.c[o]=1,this.B=!1}return this},n.prototype.A=function(t,e,n){if(v(e)){var i=e.length;if(i--){for(var r=0;r<i;r++)this.A(t,e[r]);return this.A(t,e[i],n)}}else{var s,o=this.a.index,l=this.a.keys,c=this.a.tag;r=this.a.store;var h=this.a.id;i=e;for(var u=0;u<h.length;u++)i=i[h[u]];if("remove"===t&&(delete this.l[i],h=l.length,h--)){for(e=0;e<h;e++)o[l[e]].remove(i);return o[l[h]].remove(i,n)}if(c){for(s=0;s<c.length;s++){var a=c[s],f=e;for(h=a.split(":"),u=0;u<h.length;u++)f=f[h[u]];f="@"+f}s=(s=this.G[a])[f]||(s[f]=[])}for(let r=0,s=(h=this.a.field).length;r<s;r++){for(a=h[r],c=e,f=0;f<a.length;f++)c=c[a[f]];a=o[l[r]],f="add"===t?a.add:a.update,r===s-1?f.call(a,i,c,n):f.call(a,i,c)}if(r){for(n=Object.keys(r),t=x(),o=0;o<n.length;o++)if(r[l=n[o]]){let n,i;for(l=l.split(":"),h=0;h<l.length;h++)n=(n||e)[c=l[h]],i=(i||t)[c]=n}e=t}s&&(s[s.length]=e),this.l[i]=e}return this},n.prototype.update=function(t,e,n){return this.a&&b(t)?this.A("update",t,e):(this.c["@"+t]&&y(e)&&(this.remove(t),this.add(t,e,n,!0)),this)},n.prototype.remove=function(t,e,n){if(this.a&&b(t))return this.A("remove",t,e);var i="@"+t;if(this.c[i]){if(this.g)return this.m[this.c[i]].postMessage({remove:!0,id:t}),delete this.c[i],e&&e(),this;if(!n){if(this.async&&"function"!=typeof importScripts){let n=this;return i=new Promise((function(e){setTimeout((function(){n.remove(t,null,!0),n=null,e()}))})),e?(i.then(e),this):i}if(e)return this.remove(t,null,!0),e(),this}for(e=0;e<this.b-(this.threshold||0);e++)u(this.i[e],t);this.depth&&u(this.h,t),delete this.c[i],this.B=!1}return this},n.prototype.search=function(t,e,n,i){if(b(e)){if(v(e))for(var o=0;o<e.length;o++)e[o].query=t;else e.query=t;t=e,e=1e3}else e&&m(e)?(n=e,e=1e3):e||0===e||(e=1e3);if(!this.g){var l=[],c=t;if(b(t)&&!v(t)){n||(n=t.callback)&&(c.callback=null);var h=t.sort,u=t.page;e=t.limit,O=t.threshold;var a=t.suggest;t=t.query}if(this.a){O=this.a.index;const r=c.where;var d=c.bool||"or",p=c.field;let f,g,m=d;if(p)v(p)||(p=[p]);else if(v(c)){var _=c;p=[],m=[];for(var w=0;w<c.length;w++)o=(i=c[w]).bool||d,p[w]=i.field,m[w]=o,"not"===o?f=!0:"and"===o&&(g=!0)}else p=this.a.keys;for(d=p.length,w=0;w<d;w++)_&&(c=_[w]),u&&!y(c)&&(c.page=null,c.limit=0),l[w]=O[p[w]].search(c,0);if(n)return n(s.call(this,t,m,l,h,e,a,r,u,g,f));if(this.async){const n=this;return new Promise((function(i){Promise.all(l).then((function(o){i(s.call(n,t,m,o,h,e,a,r,u,g,f))}))}))}return s.call(this,t,m,l,h,e,a,r,u,g,f)}if(O||(O=this.threshold||0),!i){if(this.async&&"function"!=typeof importScripts){let t=this;return O=new Promise((function(n){setTimeout((function(){n(t.search(c,e,null,!0)),t=null}))})),n?(O.then(n),this):O}if(n)return n(this.search(c,e,null,!0)),this}if(!t||!y(t))return l;if(c=t,this.cache)if(this.B){if(n=this.j.get(t))return n}else this.j.clear(),this.B=!0;if(!(c=this.encode(c)).length)return l;n=m(n=this.f)?n(c):c.split(this.split),this.filter&&(n=r(n,this.filter)),_=n.length,i=!0,o=[];var k=x(),S=0;if(1<_&&(this.depth&&"strict"===this.f?d=!0:n.sort(f)),!d||(w=this.h)){const t=this.b;for(;S<_;S++){let e=n[S];if(e){if(d){if(!p)if(w[e])p=e,k[e]=1;else if(!a)return l;if(a&&S===_-1&&!o.length)d=!1,e=p||e,k[e]=0;else if(!p)continue}if(!k[e]){const n=[];let r=!1,s=0;const l=d?w[p]:this.i;if(l){let i;for(let o=0;o<t-O;o++)(i=l[o]&&l[o][e])&&(n[s++]=i,r=!0)}if(r)p=e,o[o.length]=1<s?n.concat.apply([],n):n[0];else if(!a){i=!1;break}k[e]=1}}}}else i=!1;return i&&(l=g(o,e,u,a)),this.cache&&this.j.set(t,l),l}this.F=n,this.u=0,this.o=[];for(var O=0;O<this.g;O++)this.m[O].postMessage({search:!0,limit:e,content:t})},n.prototype.find=function(t,e){return this.where(t,e,1)[0]||null},n.prototype.where=function(t,e,n,i){const r=this.l,s=[];let o,l=0;var c;let h;if(b(t)){n||(n=e);var u=Object.keys(t),a=u.length;if(o=!1,1===a&&"id"===u[0])return[r[t.id]];if((c=this.I)&&!i)for(var f=0;f<c.length;f++){var d=c[f],p=t[d];if(!w(p)){if(h=this.G[d]["@"+p],0==--a)return h;u.splice(u.indexOf(d),1),delete t[d];break}}for(c=Array(a),f=0;f<a;f++)c[f]=u[f].split(":")}else{if(m(t)){for(n=(e=i||Object.keys(r)).length,u=0;u<n;u++)t(a=r[e[u]])&&(s[l++]=a);return s}if(w(e))return[r[t]];if("id"===t)return[r[e]];u=[t],a=1,c=[t.split(":")],o=!0}for(f=(i=h||i||Object.keys(r)).length,d=0;d<f;d++){p=h?i[d]:r[i[d]];let f=!0;for(let n=0;n<a;n++){o||(e=t[u[n]]);const i=c[n],r=i.length;let s=p;if(1<r)for(let t=0;t<r;t++)s=s[i[t]];else s=s[i[0]];if(s!==e){f=!1;break}}if(f&&(s[l++]=p,n&&l===n))break}return s},n.prototype.info=function(){if(!this.g)return{id:this.id,items:this.length,cache:!(!this.cache||!this.cache.s)&&this.cache.s.length,matcher:j.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f};for(let t=0;t<this.g;t++)this.m[t].postMessage({info:!0,id:this.id})},n.prototype.clear=function(){return this.destroy().init()},n.prototype.destroy=function(){if(this.cache&&(this.j.clear(),this.j=null),this.i=this.h=this.c=null,this.a){const t=this.a.keys;for(let e=0;e<t.length;e++)this.a.index[t[e]].destroy();this.a=this.l=null}return this},n.prototype.export=function(t){const e=!t||w(t.serialize)||t.serialize;if(this.a){const e=!t||w(t.doc)||t.doc;var n=!t||w(t.index)||t.index;t=[];let i=0;if(n)for(n=this.a.keys;i<n.length;i++){const e=this.a.index[n[i]];t[i]=[e.i,e.h,Object.keys(e.c)]}e&&(t[i]=this.l)}else t=[this.i,this.h,Object.keys(this.c)];return e&&(t=JSON.stringify(t)),t},n.prototype.import=function(t,e){(!e||w(e.serialize)||e.serialize)&&(t=JSON.parse(t));const n=x();if(this.a){var i=!e||w(e.doc)||e.doc,r=0;if(!e||w(e.index)||e.index){const i=(e=this.a.keys).length;for(var s=t[0][2];r<s.length;r++)n[s[r]]=1;for(r=0;r<i;r++){s=this.a.index[e[r]];const i=t[r];i&&(s.i=i[0],s.h=i[1],s.c=n)}}i&&(this.l=b(i)?i:t[r])}else{for(i=t[2],r=0;r<i.length;r++)n[i[r]]=1;this.i=t[0],this.h=t[1],this.c=n}};const D=function(){const t=l("\\s+"),e=l("[^a-z0-9 ]"),n=[l("[-/]")," ",e,"",t," "];return function(t){return a(c(t.toLowerCase(),n))}}(),E={icase:function(t){return t.toLowerCase()},simple:function(){const t=l("\\s+"),e=l("[^a-z0-9 ]"),n=l("[-/]"),i=[l("[àáâãäå]"),"a",l("[èéêë]"),"e",l("[ìíîï]"),"i",l("[òóôõöő]"),"o",l("[ùúûüű]"),"u",l("[ýŷÿ]"),"y",l("ñ"),"n",l("[çc]"),"k",l("ß"),"s",l(" & ")," and ",n," ",e,"",t," "];return function(t){return" "===(t=c(t.toLowerCase(),i))?"":t}}(),advanced:function(){const t=l("ae"),e=l("ai"),n=l("ay"),i=l("ey"),r=l("oe"),s=l("ue"),o=l("ie"),h=l("sz"),u=l("zs"),f=l("ck"),d=l("cc"),p=[t,"a",e,"ei",n,"ei",i,"ei",r,"o",s,"u",o,"i",h,"s",u,"s",l("sh"),"s",f,"k",d,"k",l("th"),"t",l("dt"),"t",l("ph"),"f",l("pf"),"f",l("ou"),"o",l("uo"),"u"];return function(t,e){return t?(2<(t=this.simple(t)).length&&(t=c(t,p)),e||1<t.length&&(t=a(t)),t):t}}(),extra:function(){const t=[l("p"),"b",l("z"),"s",l("[cgq]"),"k",l("n"),"m",l("d"),"t",l("[vw]"),"f",l("[aeiouy]"),""];return function(e){if(!e)return e;if(1<(e=this.advanced(e,!0)).length){e=e.split(" ");for(let n=0;n<e.length;n++){const i=e[n];1<i.length&&(e[n]=i[0]+c(i.substring(1),t))}e=a(e=e.join(" "))}return e}}(),balance:D},A=function(){function t(t){this.clear(),this.H=!0!==t&&t}return t.prototype.clear=function(){this.cache=x(),this.count=x(),this.index=x(),this.s=[]},t.prototype.set=function(t,e){if(this.H&&w(this.cache[t])){let n=this.s.length;if(n===this.H){n--;const t=this.s[n];delete this.cache[t],delete this.count[t],delete this.index[t]}this.index[t]=n,this.s[n]=t,this.count[t]=-1,this.cache[t]=e,this.get(t)}else this.cache[t]=e},t.prototype.get=function(t){const e=this.cache[t];if(this.H&&e){var n=++this.count[t];const e=this.index;let r=e[t];if(0<r){const s=this.s;for(var i=r;this.count[s[--r]]<=n&&-1!==r;);if(r++,r!==i){for(n=i;n>r;n--)i=s[n-1],s[n]=i,e[i]=n;s[r]=t,e[t]=r}}}return e},t}();return n}(function(){const t={},e="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;return function(n,i,r,s,o){return r=e?URL.createObjectURL(new Blob(["("+r.toString()+")()"],{type:"text/javascript"})):n+".min.js",t[n+="-"+i]||(t[n]=[]),t[n][o]=new Worker(r),t[n][o].onmessage=s,t[n][o]}}()),B)})),z=window.searchTranslation,F=z.Link_previous,H=z.Link_next,q=z.Search_no_results,G=z.Search_one_character_or_more,$=z.Search_one_result,J=z.Search_results,V=z.Search_should_be_x_or_more,K=z.Search_too_short,Q=F,X=H,Y=q,Z=G,tt=$,et=J,nt=V,it=K;function rt(t){var e,n=t.counter,i=t.start,r=t.settings,s=t.onPageSelect,o=Math.ceil(n/r.show),l=i/r.show;e=l<=2?Math.min(o,3):Math.min(o,l+2);for(var c=[],h=function(t){t===l?c.push(b("li",{className:"current"},t+1)):c.push(b("li",null,b("a",{className:"SearchResults__footer__link",onClick:function(){return s(t*r.show)}},t+1)))},u=0;u<e;u++)h(u);return b("div",{className:"SearchResults__footer"},b("ul",{className:"SearchResults__footer__links Pager"},i>0&&b("li",{className:"Pager--prev"},b("a",{className:"SearchResults__footer__link",onClick:function(){return s(i-r.show)}},Q)),c,l+1!==o&&b("li",{className:"Pager--next"},b("a",{className:"SearchResults__footer__link",onClick:function(){return s(i+r.show)}},X))))}function st(t){var e,n=t.settings,i=t.item;return i.text&&(e=i.text.split(" ").slice(0,n.descriptiveWords).join(" "),i.text.length<e.length&&"."!==e.charAt(e.length-1)&&(e+=" ...")),b("div",{className:"SearchResult"},b("div",{className:"SearchResults__title"},b("a",{href:n.base_url+i.url},i.title)),n.showURL&&b("div",{className:"SearchResults__url"},b("a",{href:n.base_url+i.url},i.url.toLowerCase().replace(/https?:\/\//g,""))),e&&b("div",{className:"SearchResults__text"},e))}var ot=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(r,e);var i=c(r);function r(e){var n;return t(this,r),(n=i.call(this,e)).handleClose=function(){n.props.onClose()},n.scrollTop=function(){n.resultRef&&(n.resultRef.scrollTop=0)},n.handlePaginate=function(t){n.setState({start:t},n.scrollTop)},n.handleChange=function(t){n.setState({search:t.target.value,start:0},n.scrollTop),n.props.settings.field.value=t.target.value},n.state={search:n.props.settings.field.value||"",start:0},n}return n(r,[{key:"getResults",value:function(){var t=this.props.settings,e=this.state.start,n=[],i=0,r=[];if(this.state.search.length<t.minimumLength)return n.push(it),n.push(1===t.minimumLength?Z:nt.replace("!min",t.minimumLength)),{warnings:n,counter:i,results:r,start:e};var s=this.props.onSearch(this.state.search);return 0===(i=s.length)?(n.push(Y),{warnings:n,counter:i,results:r,start:e}):(t.showTitleCount&&this.props.onTitleChange("(".concat(i,")")),{warnings:n,counter:i,results:r=s.filter((function(n,i){return i>=e&&i<t.show+e})),start:e})}},{key:"render",value:function(){var t=this,e=this.props.settings,n=this.getResults(),i=n.warnings,r=n.counter,s=n.results,o=n.start;return b("div",null,b("div",{className:"SearchResultsBackdrop"}),b("div",{className:"SearchResults",ref:function(e){return t.resultRef=e}},b("input",{className:"Search__field",placeholder:"Search...",autoComplete:"on",autoSave:"text_search",type:"search",value:this.state.search,onInput:this.handleChange}),b("button",{className:"SearchResults__close",onClick:this.handleClose},"×"),b("div",{className:"SearchResults__count"},1===r?tt:et.replace("!count",r)),i.map((function(t){return b("div",{key:t,className:"SearchResults__warning"},t)})),s.map((function(t){return b(st,{key:t.title,item:t,settings:e})})),r>e.show&&b(rt,{counter:r,start:o,settings:e,onPageSelect:this.handlePaginate})))}}]),r}(x),lt=document.title;function ct(t){var e=new RegExp("[?|&]".concat(t,"=([^&;]+?)(&|#|;|$)")).exec(window.location.search);return decodeURIComponent((e&&e[1]||"").replace(/\+/g,"%20"))||null}var ht=function(){function e(n){var s=this;t(this,e),this.keyUpHandler=function(t){27===t.which&&s.handleClose()},this.handleClose=function(){document.title=lt,document.removeEventListener("keyup",s.keyUpHandler),document.body.classList.remove("with-search"),M(null,s.resultContainer),s.resultContainer=null},this.settings=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({field:document.getElementById("search_input"),form:document.getElementById("search_form"),show:10,showURL:!0,showTitleCount:!0,minimumLength:3,descriptiveWords:25,highlightTerms:!0,highlightEveryTerm:!1,contentLocation:"daux_search_index.js"},n),this.searchIndex={pages:[]}}return n(e,[{key:"loadData",value:function(){var t=this;if(!this.loadingPromise){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=this.settings.base_url+this.settings.contentLocation;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n),this.loadingPromise=new Promise((function(t){window.load_search_index=function(e){return t(e)}})).then((function(e){t.searchIndex=new W({doc:{id:"url",field:["title","text","tags"]}});var n=e.pages;if(window.searchLanguage){var i="".concat(window.searchLanguage,"/");n=n.filter((function(t){return 0===t.url.indexOf(i)}))}t.searchIndex.add(n)}))}return this.loadingPromise}},{key:"run",value:function(){var t=this;ct("q")&&(this.settings.field.value=ct("q"),this.loadData().then((function(){t.displaySearch()}))),this.settings.field.addEventListener("keyup",(function(e){t.loadData(),13===parseInt(e.keyCode,10)&&t.loadData().then((function(){t.displaySearch()}))})),this.settings.form.addEventListener("submit",(function(e){e.preventDefault(),t.loadData().then((function(){t.displaySearch()}))}))}},{key:"displaySearch",value:function(){var t=this;this.resultContainer||(this.resultContainer=document.createElement("div"),document.body.appendChild(this.resultContainer)),document.addEventListener("keyup",this.keyUpHandler),M(b(ot,{onSearch:function(e){return t.searchIndex.search(e)},onClose:this.handleClose,onTitleChange:function(t){document.title="".concat(t," ").concat(lt)},settings:this.settings}),this.resultContainer),document.body.classList.add("with-search"),document.body.scrollTop=0}}]),e}();window.search=function(t){new ht(t).run()}}();
//# sourceMappingURL=search.min.js.map