Files
2025-10-19 13:20:58 +02:00

9 lines
81 KiB
Plaintext

var t,e,n,i,r,s,o,l,h,a,c,u,f={},d=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function y(e,n,i){var r,s,o,l={};for(o in n)"key"==o?r=n[o]:"ref"==o?s=n[o]:l[o]=n[o];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===l[o]&&(l[o]=e.defaultProps[o]);return x(e,l,r,s,null)}function x(t,i,r,s,o){var l={type:t,props:i,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++n:o,__i:-1,__u:0};return null==o&&null!=e.vnode&&e.vnode(l),l}function w(t){return t.children}function b(t,e){this.props=t,this.context=e}function v(t,e){if(null==e)return t.__?v(t.__,t.__i+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?v(t):null}function k(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 k(t)}}function A(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!S.__r++||r!=e.debounceRendering)&&((r=e.debounceRendering)||s)(S)}function S(){for(var t,n,r,s,l,h,a,c=1;i.length;)i.length>c&&i.sort(o),t=i.shift(),c=i.length,t.__d&&(r=void 0,l=(s=(n=t).__v).__e,h=[],a=[],n.__P&&((r=_({},s)).__v=s.__v+1,e.vnode&&e.vnode(r),M(n.__P,r,s,n.__n,n.__P.namespaceURI,32&s.__u?[l]:null,h,null==l?v(s):l,!!(32&s.__u),a),r.__v=s.__v,r.__.__k[r.__i]=r,D(h,r,a),r.__e!=l&&k(r)));S.__r=0}function C(t,e,n,i,r,s,o,l,h,a,c){var u,p,_,m,y,b,k=i&&i.__k||d,A=e.length;for(h=function(t,e,n,i,r){var s,o,l,h,a,c=n.length,u=c,f=0;for(t.__k=new Array(r),s=0;s<r;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?(h=s+f,(o=t.__k[s]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?x(null,o,null,null,null):g(o)?x(w,{children:o},null,null,null):null==o.constructor&&o.__b>0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,l=null,-1!=(a=o.__i=N(o,n,h,u))&&(u--,(l=n[a])&&(l.__u|=2)),null==l||null==l.__v?(-1==a&&(r>c?f--:r<c&&f++),"function"!=typeof o.type&&(o.__u|=4)):a!=h&&(a==h-1?f--:a==h+1?f++:(a>h?f--:f++,o.__u|=4))):t.__k[s]=null;if(u)for(s=0;s<c;s++)null!=(l=n[s])&&!(2&l.__u)&&(l.__e==i&&(i=v(l)),O(l,l));return i}(n,e,k,h,A),u=0;u<A;u++)null!=(_=n.__k[u])&&(p=-1==_.__i?f:k[_.__i]||f,_.__i=u,b=M(t,_,p,r,s,o,l,h,a,c),m=_.__e,_.ref&&p.ref!=_.ref&&(p.ref&&T(p.ref,null,_),c.push(_.ref,_.__c||m,_)),null==y&&null!=m&&(y=m),4&_.__u||p.__k===_.__k?h=E(_,h,t):"function"==typeof _.type&&void 0!==b?h=b:m&&(h=m.nextSibling),_.__u&=-7);return n.__e=y,h}function E(t,e,n){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=E(i[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=v(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function N(t,e,n,i){var r,s,o,l=t.key,h=t.type,a=e[n],c=null!=a&&!(2&a.__u);if(null===a&&null==t.key||c&&l==a.key&&h==a.type)return n;if(i>(c?1:0))for(r=n-1,s=n+1;r>=0||s<e.length;)if(null!=(a=e[o=r>=0?r--:s++])&&!(2&a.__u)&&l==a.key&&h==a.type)return o;return-1}function z(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||p.test(e)?n:n+"px"}function j(t,e,n,i,r){var s,o;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||z(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||z(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(l,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n.u=i.u:(n.u=h,t.addEventListener(e,s?c:a,s)):t.removeEventListener(e,s?c:a,s);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function I(t){return function(n){if(this.l){var i=this.l[n.type+t];if(null==n.t)n.t=h++;else if(n.t<i.u)return;return i(e.event?e.event(n):n)}}}function M(t,n,i,r,s,o,l,h,a,c){var u,f,d,p,y,x,v,k,A,S,E,N,z,j,I,M,D,T=n.type;if(null!=n.constructor)return null;128&i.__u&&(a=!!(32&i.__u),o=[h=n.__e=i.__e]),(u=e.__b)&&u(n);t:if("function"==typeof T)try{if(k=n.props,A="prototype"in T&&T.prototype.render,S=(u=T.contextType)&&r[u.__c],E=u?S?S.props.value:u.__:r,i.__c?v=(f=n.__c=i.__c).__=f.__E:(A?n.__c=f=new T(k,E):(n.__c=f=new b(k,E),f.constructor=T,f.render=U),S&&S.sub(f),f.props=k,f.state||(f.state={}),f.context=E,f.__n=r,d=f.__d=!0,f.__h=[],f._sb=[]),A&&null==f.__s&&(f.__s=f.state),A&&null!=T.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=_({},f.__s)),_(f.__s,T.getDerivedStateFromProps(k,f.__s))),p=f.props,y=f.state,f.__v=n,d)A&&null==T.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),A&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(A&&null==T.getDerivedStateFromProps&&k!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(k,E),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(k,f.__s,E)||n.__v==i.__v){for(n.__v!=i.__v&&(f.props=k,f.state=f.__s,f.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(t){t&&(t.__=n)}),N=0;N<f._sb.length;N++)f.__h.push(f._sb[N]);f._sb=[],f.__h.length&&l.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(k,f.__s,E),A&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(p,y,x)})}if(f.context=E,f.props=k,f.__P=t,f.__e=!1,z=e.__r,j=0,A){for(f.state=f.__s,f.__d=!1,z&&z(n),u=f.render(f.props,f.state,f.context),I=0;I<f._sb.length;I++)f.__h.push(f._sb[I]);f._sb=[]}else do{f.__d=!1,z&&z(n),u=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++j<25);f.state=f.__s,null!=f.getChildContext&&(r=_(_({},r),f.getChildContext())),A&&!d&&null!=f.getSnapshotBeforeUpdate&&(x=f.getSnapshotBeforeUpdate(p,y)),M=u,null!=u&&u.type===w&&null==u.key&&(M=L(u.props.children)),h=C(t,g(M)?M:[M],n,i,r,s,o,l,h,a,c),f.base=n.__e,n.__u&=-161,f.__h.length&&l.push(f),v&&(f.__E=f.__=null)}catch(t){if(n.__v=null,a||null!=o)if(t.then){for(n.__u|=a?160:128;h&&8==h.nodeType&&h.nextSibling;)h=h.nextSibling;o[o.indexOf(h)]=null,n.__e=h}else{for(D=o.length;D--;)m(o[D]);P(n)}else n.__e=i.__e,n.__k=i.__k,t.then||P(n);e.__e(t,n,i)}else null==o&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):h=n.__e=B(i.__e,n,i,r,s,o,l,a,c);return(u=e.diffed)&&u(n),128&n.__u?void 0:h}function P(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(P)}function D(t,n,i){for(var r=0;r<i.length;r++)T(i[r],i[++r],i[++r]);e.__c&&e.__c(n,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(t){t.call(n)})}catch(t){e.__e(t,n.__v)}})}function L(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:g(t)?t.map(L):_({},t)}function B(n,i,r,s,o,l,h,a,c){var u,d,p,_,y,x,w,b=r.props,k=i.props,A=i.type;if("svg"==A?o="http://www.w3.org/2000/svg":"math"==A?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=l)for(u=0;u<l.length;u++)if((y=l[u])&&"setAttribute"in y==!!A&&(A?y.localName==A:3==y.nodeType)){n=y,l[u]=null;break}if(null==n){if(null==A)return document.createTextNode(k);n=document.createElementNS(o,A,k.is&&k),a&&(e.__m&&e.__m(i,l),a=!1),l=null}if(null==A)b===k||a&&n.data==k||(n.data=k);else{if(l=l&&t.call(n.childNodes),b=r.props||f,!a&&null!=l)for(b={},u=0;u<n.attributes.length;u++)b[(y=n.attributes[u]).name]=y.value;for(u in b)if(y=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=y;else if(!(u in k)){if("value"==u&&"defaultValue"in k||"checked"==u&&"defaultChecked"in k)continue;j(n,u,null,y,o)}for(u in k)y=k[u],"children"==u?_=y:"dangerouslySetInnerHTML"==u?d=y:"value"==u?x=y:"checked"==u?w=y:a&&"function"!=typeof y||b[u]===y||j(n,u,y,b[u],o);if(d)a||p&&(d.__html==p.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),i.__k=[];else if(p&&(n.innerHTML=""),C("template"==i.type?n.content:n,g(_)?_:[_],i,r,s,"foreignObject"==A?"http://www.w3.org/1999/xhtml":o,l,h,l?l[0]:r.__k&&v(r,0),a,c),null!=l)for(u=l.length;u--;)m(l[u]);a||(u="value","progress"==A&&null==x?n.removeAttribute("value"):null!=x&&(x!==n[u]||"progress"==A&&!x||"option"==A&&x!=b[u])&&j(n,u,x,b[u],o),u="checked",null!=w&&w!=n[u]&&j(n,u,w,b[u],o))}return n}function T(t,n,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==n||(t.__u=t(n))}else t.current=n}catch(t){e.__e(t,i)}}function O(t,n,i){var r,s;if(e.unmount&&e.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||T(r,null,n)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){e.__e(t,n)}r.base=r.__P=null}if(r=t.__k)for(s=0;s<r.length;s++)r[s]&&O(r[s],n,i||"function"!=typeof t.type);i||m(t.__e),t.__c=t.__=t.__e=void 0}function U(t,e,n){return this.constructor(t,n)}t=d.slice,e={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(e){t=e}throw t}},n=0,b.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=_({},this.state),"function"==typeof t&&(t=t(_({},n),this.props)),t&&_(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),A(this))},b.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),A(this))},b.prototype.render=w,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(t,e){return t.__v.__b-e.__v.__b},S.__r=0,l=/(PointerCapture)$|Capture$/i,h=0,a=I(!1),c=I(!0),u=0;var $,H,F,R,q=0,K=[],W=e,J=W.__b,V=W.__r,G=W.diffed,Q=W.__c,X=W.unmount,Z=W.__;function Y(t,e){W.__h&&W.__h(H,t,q||e),q=0;var n=H.__H||(H.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function tt(t){return q=1,function(t,e){var n=Y($++,2);if(n.t=t,!n.__c&&(n.__=[ut(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=H,!H.__f)){var i=function(t,e,i){if(!n.__c.__H)return!0;var s=n.__c.__H.__.filter(function(t){return!!t.__c});if(s.every(function(t){return!t.__N}))return!r||r.call(this,t,e,i);var o=n.__c.props!==t;return s.forEach(function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),r&&r.call(this,t,e,i)||o};H.__f=!0;var r=H.shouldComponentUpdate,s=H.componentWillUpdate;H.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}s&&s.call(this,t,e,n)},H.shouldComponentUpdate=i}return n.__N||n.__}(ut,t)}function et(t,e){var n=Y($++,3);!W.__s&&ct(n.__H,e)&&(n.__=t,n.u=e,H.__H.__h.push(n))}function nt(t){return q=5,it(function(){return{current:t}},[])}function it(t,e){var n=Y($++,7);return ct(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function rt(t){var e=H.context[t.__c],n=Y($++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(H)),e.props.value):t.__}function st(){for(var t;t=K.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ht),t.__H.__h.forEach(at),t.__H.__h=[]}catch(e){t.__H.__h=[],W.__e(e,t.__v)}}W.__b=function(t){H=null,J&&J(t)},W.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Z&&Z(t,e)},W.__r=function(t){V&&V(t),$=0;var e=(H=t.__c).__H;e&&(F===H?(e.__h=[],H.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ht),e.__h.forEach(at),e.__h=[],$=0)),F=H},W.diffed=function(t){G&&G(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==K.push(e)&&R===W.requestAnimationFrame||((R=W.requestAnimationFrame)||lt)(st)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),F=H=null},W.__c=function(t,e){e.some(function(t){try{t.__h.forEach(ht),t.__h=t.__h.filter(function(t){return!t.__||at(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],W.__e(n,t.__v)}}),Q&&Q(t,e)},W.unmount=function(t){X&&X(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(t){try{ht(t)}catch(t){e=t}}),n.__H=void 0,e&&W.__e(e,n.__v))};var ot="function"==typeof requestAnimationFrame;function lt(t){var e,n=function(){clearTimeout(i),ot&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);ot&&(e=requestAnimationFrame(n))}function ht(t){var e=H,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),H=e}function at(t){var e=H;t.__c=t.__(),H=e}function ct(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function ut(t,e){return"function"==typeof e?e(t):e}const ft={showPopup:!1,setShowPopup:t=>{},searchValue:"",setSearchValue:t=>{},filter:"",searchIndex:null,indexStatus:"initial",t:t=>window.Spiritix?.t?.[t]||t,inputRef:null},dt=function(t){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,A(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+u++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}(ft);function pt(t){return y("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",focusable:"false","aria-hidden":"true"}),"\n ",y("circle",{cx:"11",cy:"11",r:"8"}),"\n ",y("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),"\n ")}function gt(t){return y("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:"24",width:"24",fill:"none",stroke:"currentColor","stroke-width":"2",focusable:"false","aria-hidden":"true"})," \n ",y("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"}),"\n ")}function _t(t){return y("svg",Object.assign({},t,{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"40px",height:"40px",viewBox:"0 0 40 40","enable-background":"new 0 0 40 40",xmlSpace:"preserve",focusable:"false","aria-hidden":"true"}),"\n ",y("path",{opacity:"0.2",fill:"currentColor",d:"M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"}),"\n ",y("path",{fill:"currentColor",d:"M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0C22.32,8.481,24.301,9.057,26.013,10.047z"},"\n ",y("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 20 20",to:"360 20 20",dur:"0.5s",repeatCount:"indefinite"}),"\n "),"\n ")}function mt({text:t,highlight:e}){const n=function({text:t,highlight:e}){let n="";e?.split(" ").forEach((t,e)=>{const i=String(t).replace(/\W/g,"\\&");e>0?n+="|^"+i+"|\\s"+i:n="^"+i+"|\\s"+i});const i=new RegExp(`${n}`,"ig");let r=t?.matchAll(i);const s=[];for(const t of r)s.push({startIdx:t?.index,endIdx:(t?.index||0)+(t?.[0].length||0)});return s}({text:t,highlight:e}),i=[];let r=0;return n.forEach(e=>{r===e.startIdx?(i.push({text:t?.slice(e.startIdx,e.endIdx),type:"highlight"}),r=e.endIdx):(i.push({text:t?.slice(r,e.startIdx),type:"normal"}),i.push({text:t?.slice(e.startIdx,e.endIdx),type:"highlight"}),r=e.endIdx)}),r<t?.length&&i.push({text:t?.slice(r,t.length),type:"normal"}),{parts:i,highlightIndexes:n}}function yt({word:t,isExcerpt:e}){return y("span",{className:`font-bold ${!e&&"text-gray-950 dark:text-gray-50"}`},t)}function xt({text:t="",highlight:e="",isExcerpt:n=!1}){t=t||"",e=e||"";let{parts:i,highlightIndexes:r}=mt({text:t,highlight:e});if(n&&r?.[0]){const n=r?.[0]?.startIdx;if(n>50){t="..."+t?.slice(n-20);const{parts:r}=mt({text:t,highlight:e});i=r}}const s=i.map((t,e)=>"highlight"===t?.type?y(yt,{key:e,word:t.text,isExcerpt:n}):y("span",{key:e},t.text));return y(w,null,"\n ",s,"\n ")}function wt({post:t}){const{searchValue:e}=rt(dt),{title:n,excerpt:i,url:r}=t;return y("a",{"data-sx-search-item":!0,className:"py-3 -mx-2 sm:-mx-3.5 px-2 sm:px-3.5 cursor-pointer block rounded-xl focus:outline-none \n hover:bg-gray-50 dark:hover:bg-gray-50/2 focus:bg-gray-100 dark:focus:bg-gray-50/5\n ",href:r},"\n ",y("div",{className:"text-base font-medium leading-tight text-gray-900 dark:text-gray-100"},"\n ",y(xt,{text:n,highlight:e,isExcerpt:!1}),"\n "),"\n ",y("p",{className:"text-gray-600 dark:text-gray-400 leading-normal text-sm mt-0 mb-0 truncate"},"\n ",y(xt,{text:i,highlight:e,isExcerpt:!0}),"\n "),"\n ")}function bt({posts:t}){const{t:e,filter:n}=rt(dt);return t?.length?y("div",{className:"flex flex-col py-3 px-4 sm:px-7 first:border-none border-t border-gray-950/5 dark:border-gray-50/5"},"\n ",n?null:y("div",{className:"uppercase text-xs text-gray-400 font-semibold mb-1 tracking-wide"},e("Posts")),"\n ",t?.slice(0,50).map(t=>y(wt,{key:t.slug,post:t})),"\n "):null}function vt({tag:t}){const{searchValue:e}=rt(dt),{name:n,url:i}=t;return y("a",{"data-sx-search-item":!0,className:"py-3 -mx-2 sm:-mx-3.5 px-2 sm:px-3.5 cursor-pointer flex items-center rounded-xl focus:outline-none \n hover:bg-gray-50 dark:hover:bg-gray-50/2 focus:bg-gray-100 dark:focus:bg-gray-50/5\n ",href:i},"\n ",y("p",{className:"me-2 text-sm font-bold text-gray-400"},"#"),"\n ",y("div",{className:"text-base font-medium leading-tight text-gray-900 dark:text-gray-100 truncate"},"\n ",y(xt,{text:n,highlight:e,isExcerpt:!1}),"\n "),"\n ")}function kt({tags:t}){const{t:e}=rt(dt);return t?.length?y("div",{className:"py-3 px-4 sm:px-7 first:border-none border-t border-gray-950/5 dark:border-gray-50/5"},"\n ",y("div",{className:"uppercase text-xs text-gray-400 font-semibold mb-1 tracking-wide"},e("Tags")),"\n ",t.map(t=>y(vt,{key:t.slug,tag:t})),"\n "):null}function At({author:t}){const{name:e,profile_image:n}=t,i=e?.charAt(0);return n?.length?y("img",{className:"rounded-full bg-gray-200 dark:bg-gray-800 w-7 h-7 me-2 object-cover",src:n,alt:e}):i?y("div",{className:"rounded-full bg-gray-200 dark:bg-gray-800 w-7 h-7 me-2 flex items-center justify-center font-bold border border-gray-950/5 dark:border-gray-50/5"},"\n ",y("span",{className:"text-gray-800 dark:text-gray-200"},i),"\n "):null}function St({author:t}){const{searchValue:e}=rt(dt),{name:n,url:i}=t;return y("a",{"data-sx-search-item":!0,className:"py-3 -mx-2 sm:-mx-3.5 px-2 sm:px-3.5 cursor-pointer flex items-center rounded-xl focus:outline-none \n hover:bg-gray-50 dark:hover:bg-gray-50/2 focus:bg-gray-100 dark:focus:bg-gray-50/5\n ",href:i},"\n ",y(At,{author:t}),"\n ",y("div",{className:"text-base font-medium leading-tight text-gray-900 dark:text-gray-100 truncate"},"\n ",y(xt,{text:n,highlight:e,isExcerpt:!1}),"\n "),"\n ")}function Ct({authors:t}){const{t:e}=rt(dt);return t?.length?y("div",{className:"py-3 px-4 sm:px-7 first:border-none border-t border-gray-950/5 dark:border-gray-50/5"},"\n ",y("div",{className:"uppercase text-xs text-gray-400 font-semibold mb-1 tracking-wide"},e("Authors")),"\n ",t.map(t=>y(St,{key:t.slug,author:t})),"\n "):null}function Et({posts:t,authors:e,tags:n}){const i=nt(null);return et(()=>{const t=t=>{const e=Array.from(i.current?.querySelectorAll("[data-sx-search-item]")||[]);if(document.activeElement?.hasAttribute("data-sx-search-item")){if(document.activeElement?.hasAttribute("data-sx-search-item")){const n=e.findIndex(t=>t===document.activeElement),i=e[n-1],r=e[n+1];"ArrowDown"===t.key&&r&&r?.focus(),"ArrowUp"===t.key&&i&&i?.focus()}}else"ArrowDown"===t.key&&e[0]?.focus(),"ArrowUp"===t.key&&e.at(-1)?.focus()};return window.addEventListener("keyup",t),()=>window.removeEventListener("keyup",t)},[]),y("div",{ref:i,className:"scrollbar-width-thin overflow-y-auto max-h-[calc(100vh-172px)] sm:max-h-[70vh] -mt-px"},"\n ",y(Ct,{authors:e}),"\n ",y(kt,{tags:n}),"\n ",y(bt,{posts:t}),"\n ")}function Nt(){const{searchValue:t="",filter:e,searchIndex:n,indexStatus:i,t:r}=rt(dt);let s=[],o=[],l=[];if("completed"===i&&t){const i=n?.search(t||"");o=i?.posts||[],l=e?[]:i?.authors||[],s=e?[]:i?.tags||[]}else if("completed"===i&&!t&&e){const t=n?.sample(50);o=t?.posts||[]}return o?.length||l?.length||s?.length?y(w,null,"\n ",y("div",{className:"border-t border-gray-950/5 dark:border-gray-50/5"}),"\n ",y(Et,{posts:o,authors:l,tags:s}),"\n "):t&&"completed"===i?y(w,null,"\n ",y("div",{className:"border-t border-gray-950/5 dark:border-gray-50/5"}),"\n ",y("div",{className:"py-4 px-7"},"\n ",y("p",{className:"text-base leading-normal"},"\n ",r("No matches found"),"\n "),"\n "),"\n "):"failed"===i?y(w,null,"\n ",y("div",{className:"border-t border-gray-950/5 dark:border-gray-50/5"}),"\n ",y("div",{className:"py-4 px-7"},"\n ",y("p",{className:"text-base leading-normal"},"\n ",r("Something went wrong, please try again."),"\n "),"\n "),"\n "):null}function zt(){const{setSearchValue:t,searchValue:e="",setShowPopup:n,inputRef:i,indexStatus:r,t:s}=rt(dt);return et(()=>{setTimeout(()=>{i?.current?.focus()},150)},[i]),y("div",{className:"z-10 relative flex items-center py-5 px-4 sm:px-7"},"\n ",y("div",{className:"flex-none flex items-center justify-center w-6 h-6 me-3"},"\n ",e?null:y(pt,{className:"flex-none w-6 h-6 text-gray-400 dark:text-gray-500",title:s("Quick search...")}),"\n\n ",e?y("button",{className:"relative top-px w-6 h-6",title:s("Clear"),onClick:()=>t("")},"\n ",y(gt,{className:"flex-none w-6 h-6 text-gray-400 hover:text-gray-950 dark:text-gray-500 dark:hover:text-gray-50 transition-colors"}),"\n "):null,"\n "),"\n\n ",y("input",{ref:i,value:e||"",onInput:e=>t(e.currentTarget.value),onKeyDown:t=>{"ArrowUp"!==t.key&&"ArrowDown"!==t.key||t.preventDefault()},name:"search",className:"grow -my-4.5 py-4.5 -ms-3 ps-3 text-base leading-7 bg-transparent focus-visible:outline-none placeholder:text-gray-400 dark:placeholder:text-gray-500 outline-none truncate",placeholder:s("Quick search..."),autoComplete:"off"}),"\n\n ",!["completed","failed"].includes(r)&&e?y(_t,{className:"flex-none h-7 w-7 ms-1 -me-1"}):null,"\n\n ",y("button",{className:"sm:hidden ms-3 text-sm text-gray-500",title:s("Close"),onClick:()=>n(!1)},"\n ",s("Close"),"\n "),"\n ")}function jt(){const{setShowPopup:t,showPopup:e}=rt(dt),n=e=>{e.target===e.currentTarget&&t(!1)};return et(()=>{const e=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("keyup",e),()=>window.removeEventListener("keyup",e)},[t]),et(()=>{const t=document.getElementById("sx-viewport");t?.toggleAttribute("inert",e)},[e]),e?y("div",{className:"fixed z-3999999 top-0 start-0 w-full h-full overflow-hidden has-animation",style:{"--animation-duration":"150ms"},role:"dialog","aria-modal":"true"},"\n ",y("div",{onClick:n,className:"absolute inset-0 z-0 block bg-black/20 dark:bg-black/50 backdrop-blur-xs animate-fade"},"\n "),"\n\n ",y("div",{onClick:n,className:"h-screen w-screen pt-20 antialiased z-50 relative px-outer"},"\n ",y("div",{className:"relative bg-white dark:bg-gray-950 w-full max-w-lg rounded-2xl shadow-pretty dark:shadow-xl m-auto translate-z-0 animate-slide-up"},"\n ",y("div",{className:"hidden dark:block absolute inset-0 -z-10 rounded-inherit bg-white/5 ring-1 ring-gray-50/10"}),"\n ",y(zt,null)," \n ",y(Nt,null),"\n "),"\n "),"\n "):null}
/**!
* FlexSearch.js v0.8.205 (Bundle/Module)
* Author and Copyright: Thomas Wilkerling
* Licence: Apache-2.0
* Hosted by Nextapps GmbH
* https://github.com/nextapps-de/flexsearch
*/var It;function Mt(t,e,n){const i=typeof n,r=typeof t;if("undefined"!==i){if("undefined"!==r){if(n){if("function"===r&&i===r)return function(e){return t(n(e))};if((e=t.constructor)===n.constructor){if(e===Array)return n.concat(t);if(e===Map){var s=new Map(n);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){for(s of(o=new Set(n),t.values()))o.add(s);return o}}}return t}return n}return"undefined"===r?e:t}function Pt(t,e){return void 0===t?e:t}function Dt(){return Object.create(null)}function Lt(t){return"string"==typeof t}function Bt(t){return"object"==typeof t}function Tt(t,e){if(Lt(e))t=t[e];else for(let n=0;t&&n<e.length;n++)t=t[e[n]];return t}const Ot=/[^\p{L}\p{N}]+/u,Ut=/(\d{3})/g,$t=/(\D)(\d{3})/g,Ht=/(\d{3})(\D)/g,Ft=/[\u0300-\u036f]/g;function Rt(t={}){if(!this||this.constructor!==Rt)return new Rt(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function qt(t){t.F=null,t.B.clear(),t.D.clear()}function Kt(t,e,n){n||(e||"object"!=typeof t?"object"==typeof e&&(n=e,e=0):n=t),n&&(t=n.query||t,e=n.limit||e);let i=""+(e||0);n&&(i+=(n.offset||0)+!!n.context+!!n.suggest+(!1!==n.resolve)+(n.resolution||this.resolution)+(n.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new Wt);let r=this.cache.get(t+i);if(!r){const s=n&&n.cache;s&&(n.cache=!1),r=this.search(t,e,n),s&&(n.cache=s),this.cache.set(t+i,r)}return r}function Wt(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}(It=Rt.prototype).assign=function(t){this.normalize=Mt(t.normalize,!0,this.normalize);let e,n=t.include,i=n||t.exclude||t.split;if(i||""===i){if("object"==typeof i&&i.constructor!==RegExp){let t="";e=!n,n||(t+="\\p{Z}"),i.letter&&(t+="\\p{L}"),i.number&&(t+="\\p{N}",e=!!n),i.symbol&&(t+="\\p{S}"),i.punctuation&&(t+="\\p{P}"),i.control&&(t+="\\p{C}"),(i=i.char)&&(t+="object"==typeof i?i.join(""):i);try{this.split=new RegExp("["+(n?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=i,e=!1===i||"a1a".split(i).length<2;this.numeric=Mt(t.numeric,e)}else{try{this.split=Mt(this.split,Ot)}catch(t){this.split=/\s+/}this.numeric=Mt(t.numeric,Mt(this.numeric,!0))}if(this.prepare=Mt(t.prepare,null,this.prepare),this.finalize=Mt(t.finalize,null,this.finalize),i=t.filter,this.filter="function"==typeof i?i:Mt(i&&new Set(i),null,this.filter),this.dedupe=Mt(t.dedupe,!0,this.dedupe),this.matcher=Mt((i=t.matcher)&&new Map(i),null,this.matcher),this.mapper=Mt((i=t.mapper)&&new Map(i),null,this.mapper),this.stemmer=Mt((i=t.stemmer)&&new Map(i),null,this.stemmer),this.replacer=Mt(t.replacer,null,this.replacer),this.minlength=Mt(t.minlength,1,this.minlength),this.maxlength=Mt(t.maxlength,1024,this.maxlength),this.rtl=Mt(t.rtl,!1,this.rtl),(this.cache=i=Mt(t.cache,!0,this.cache))&&(this.F=null,this.L="number"==typeof i?i:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},It.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&qt(this),this},It.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&qt(this),this},It.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&qt(this),this)},It.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&qt(this),this)},It.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&qt(this),this)},It.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(qt,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):Ft?t.normalize("NFKD").replace(Ft,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace($t,"$1 $2").replace(Ht,"$1 $2").replace(Ut,"$1 "));const n=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let i,r,s=[],o=Dt(),l=this.split||""===this.split?t.split(this.split):[t];for(let t,a,c=0;c<l.length;c++)if((t=a=l[c])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(i===t)continue;i=t}if(n)s.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.I)if(this.F){var h=this.D.get(t);if(h||""===h){h&&s.push(h);continue}}else this.F=setTimeout(qt,50,this);if(this.stemmer){let e;for(this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));e!==t&&t.length>2;)e=t,t=t.replace(this.K,t=>this.stemmer.get(t))}if(t&&(this.mapper||this.dedupe&&t.length>1)){h="";for(let e,n,i=0,r="";i<t.length;i++)e=t.charAt(i),e===r&&this.dedupe||((n=this.mapper&&this.mapper.get(e))||""===n?n===r&&this.dedupe||!(r=n)||(h+=n):h+=r=e);t=h}if(this.matcher&&t.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),t=t.replace(this.J,t=>this.matcher.get(t))),t&&this.replacer)for(h=0;t&&h<this.replacer.length;h+=2)t=t.replace(this.replacer[h],this.replacer[h+1]);if(this.cache&&a.length<=this.I&&(this.D.set(a,t),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),t){if(t!==a)if(e){if(o[t])continue;o[t]=1}else{if(r===t)continue;r=t}s.push(t)}}}return this.finalize&&(s=this.finalize(s)||s),this.cache&&t.length<=this.H&&(this.B.set(t,s),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),s},Wt.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},Wt.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},Wt.prototype.remove=function(t){for(const e of this.cache){const n=e[0];e[1].includes(t)&&this.cache.delete(n)}},Wt.prototype.clear=function(){this.cache.clear(),this.h=""};const Jt={normalize:!1,numeric:!1,dedupe:!1},Vt={},Gt=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),Qt=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Xt=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],Zt={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"ß":2,d:3,t:3,l:4,m:5,n:5,r:6};var Yt={Exact:Jt,Default:Vt,Normalize:Vt,LatinBalance:{mapper:Gt},LatinAdvanced:{mapper:Gt,matcher:Qt,replacer:Xt},LatinExtra:{mapper:Gt,replacer:Xt.concat([/(?!^)[aeo]/g,""]),matcher:Qt},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let n=0;n<t.length;n++){var e=t[n];let i=e.charAt(0),r=Zt[i];for(let t,n=1;n<e.length&&(t=e.charAt(n),"h"===t||"w"===t||!(t=Zt[t])||t===r||(i+=t,r=t,4!==i.length));n++);t[n]=i}}},CJK:{split:""},LatinExact:Jt,LatinDefault:Vt,LatinSimple:Vt};function te(t,e,n,i){let r=[];for(let s,o=0;o<t.index.length;o++)if(s=t.index[o],e>=s.length)e-=s.length;else{const o=(e=s[i?"splice":"slice"](e,n)).length;if(o&&(r=r.length?r.concat(e):e,n-=o,i&&(t.length-=o),!n))break;e=0}return r}function ee(t){if(!this||this.constructor!==ee)return new ee(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,n)=>"length"===n?e.length:"push"===n?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===n?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===n?function(t){let n=0;for(let i,r,s=0;s<e.index.length;s++){if(i=e.index[s],r=i.indexOf(t),r>=0)return n+r;n+=i.length}return-1}:"includes"===n?function(t){for(let n=0;n<e.index.length;n++)if(e.index[n].includes(t))return!0;return!1}:"slice"===n?function(t,n){return te(e,t||0,n||e.length,!1)}:"splice"===n?function(t,n){return te(e,t||0,n||e.length,!0)}:"constructor"===n?Array:"symbol"!=typeof n?(t=e.index[n/2**31|0])&&t[n]:void 0,set:(t,n,i)=>(t=n/2**31|0,(e.index[t]||(e.index[t]=[]))[n]=i,e.length++,!0)})}function ne(t=8){if(!this||this.constructor!==ne)return new ne(t);this.index=Dt(),this.h=[],this.size=0,t>32?(this.B=se,this.A=BigInt(t)):(this.B=re,this.A=t)}function ie(t=8){if(!this||this.constructor!==ie)return new ie(t);this.index=Dt(),this.h=[],this.size=0,t>32?(this.B=se,this.A=BigInt(t)):(this.B=re,this.A=t)}function re(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let n=0,i=this.A+1;for(let r=0;r<t.length;r++)n=(n*i^t.charCodeAt(r))&e;return 32===this.A?n+2**31:n}function se(t){let e=BigInt(2)**this.A-BigInt(1);var n=typeof t;if("bigint"===n)return t&e;if("number"===n)return BigInt(t)&e;n=BigInt(0);let i=this.A+BigInt(1);for(let r=0;r<t.length;r++)n=(n*i^BigInt(t.charCodeAt(r)))&e;return n}let oe,le,he,ae,ce;async function ue(t){var e=(t=t.data).task;const n=t.id;let i=t.args;if("init"===e)le=t.options||{},(e=t.factory)?(Function("return "+e)()(self),oe=new self.FlexSearch.Index(le),delete self.FlexSearch):oe=new en(le),postMessage({id:n});else{let r;"export"===e&&(i[1]?(i[0]=le.export,i[2]=0,i[3]=1):i=null),"import"===e?i[0]&&(t=await le.import.call(oe,i[0]),oe.import(i[0],t)):((r=i&&oe[e].apply(oe,i))&&r.then&&(r=await r),r&&r.await&&(r=await r.await),"search"===e&&r.result&&(r=r.result)),postMessage("search"===e?{id:n,msg:r}:{id:n})}}function fe(t){pe.call(t,"add"),pe.call(t,"append"),pe.call(t,"search"),pe.call(t,"update"),pe.call(t,"remove"),pe.call(t,"searchCache")}function de(){he=ce=0}function pe(t){this[t+"Async"]=function(){const e=arguments;var n=e[e.length-1];let i;if("function"==typeof n&&(i=n,delete e[e.length-1]),he?ce||(ce=Date.now()-ae>=this.priority*this.priority*3):(he=setTimeout(de,0),ae=Date.now()),ce){const n=this;return new Promise(i=>{setTimeout(function(){i(n[t+"Async"].apply(n,e))},0)})}const r=this[t].apply(this,e);return n=r.then?r:new Promise(t=>t(r)),i&&n.then(i),n}}ee.prototype.clear=function(){this.index.length=0},ee.prototype.push=function(){},ne.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},ne.prototype.set=function(t,e){var n=this.B(t);let i=this.index[n];i?(n=i.size,i.set(t,e),(n-=i.size)&&this.size++):(this.index[n]=i=new Map([[t,e]]),this.h.push(i),this.size++)},ie.prototype.add=function(t){var e=this.B(t);let n=this.index[e];n?(e=n.size,n.add(t),(e-=n.size)&&this.size++):(this.index[e]=n=new Set([t]),this.h.push(n),this.size++)},(It=ne.prototype).has=ie.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},It.delete=ie.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},It.clear=ie.prototype.clear=function(){this.index=Dt(),this.h=[],this.size=0},It.values=ie.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},It.keys=ie.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},It.entries=ie.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};let ge=0;function _e(t={},e){function n(n){function o(t){const e=(t=t.data||t).id,n=e&&s.h[e];n&&(n(t.msg),delete s.h[e])}if(this.worker=n,this.h=Dt(),this.worker)return r?this.worker.on("message",o):this.worker.onmessage=o,t.config?new Promise(function(e){ge>1e9&&(ge=0),s.h[++ge]=function(){e(s)},s.worker.postMessage({id:ge,task:"init",factory:i,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:i,options:t}),this)}if(!this||this.constructor!==_e)return new _e(t);let i="undefined"!=typeof self?self._factory:"undefined"!=typeof window?window._factory:null;i&&(i=i.toString());const r="undefined"==typeof window,s=this,o=function(t,e,n){return e?"undefined"!=typeof module?new(require("worker_threads").Worker)(__dirname+"/worker/node.js"):import("worker_threads").then(function(t){return new t.Worker(import.meta.dirname+"/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+ue.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof n?n:import.meta.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js"),{type:"module"})}(i,r,t.worker);return o.then?o.then(function(t){return n.call(s,t)}):n.call(this,o)}function me(t){_e.prototype[t]=function(){const e=this,n=[].slice.call(arguments);var i=n[n.length-1];let r;return"function"==typeof i&&(r=i,n.pop()),i=new Promise(function(i){"export"===t&&"function"==typeof n[0]&&(n[0]=null),ge>1e9&&(ge=0),e.h[++ge]=i,e.worker.postMessage({task:t,id:ge,args:n})}),r?(i.then(r),this):i}}function ye(t,e,n,i,r,s){if(t=t[r],i===n.length-1)e[r]=s||t;else if(t)if(t.constructor===Array)for(e=e[r]=Array(t.length),r=0;r<t.length;r++)ye(t,e,n,i,r);else e=e[r]||(e[r]=Dt()),r=n[++i],ye(t,e,n,i,r)}function xe(t,e,n,i,r,s,o,l){if(t=t[o])if(i===e.length-1){if(t.constructor===Array){if(n[i]){for(e=0;e<t.length;e++)r.add(s,t[e],!0,!0);return}t=t.join(" ")}r.add(s,t,l,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)xe(t,e,n,i,r,s,o,l);else o=e[++i],xe(t,e,n,i,r,s,o,l)}function we(t,e,n,i){if(!t.length)return t;if(1===t.length)return t=t[0],t=n||t.length>e?t.slice(n,n+e):t,i?Le.call(this,t):t;let r=[];for(let s,o,l=0;l<t.length;l++)if((s=t[l])&&(o=s.length)){if(n){if(n>=o){n-=o;continue}s=s.slice(n,n+e),o=s.length,n=0}if(o>e&&(s=s.slice(0,e),o=e),!r.length&&o>=e)return i?Le.call(this,s):s;if(r.push(s),!(e-=o))break}return r=r.length>1?[].concat.apply([],r):r[0],i?Le.call(this,r):r}function be(t,e,n,i){var r=i[0];if(r[0]&&r[0].query)return t[e].apply(t,r);if(!("and"!==e&&"not"!==e||t.result.length||t.await||r.suggest))return i.length>1&&(r=i[i.length-1]),(i=r.resolve)?t.await||t.result:t;let s,o,l,h,a,c=[],u=0,f=0;for(e=0;e<i.length;e++)if(r=i[e]){var d=void 0;if(r.constructor===Ne)d=r.await||r.result;else if(r.then||r.constructor===Array)d=r;else{u=r.limit||0,f=r.offset||0,l=r.suggest,o=r.resolve,s=((h=r.highlight||t.highlight)||r.enrich)&&o,d=r.queue;let n=r.async||d,i=r.index,p=r.query;if(i?t.index||(t.index=i):i=t.index,p||r.tag){const s=r.field||r.pluck;if(s&&(!p||t.query&&!h||(t.query=p,t.field=s,t.highlight=h),i=i.index.get(s)),d&&(a||t.await)){let s;a=1;const o=t.C.length,l=new Promise(function(t){s=t});(function(e,i){l.h=function(){i.index=null,i.resolve=!1;let r=n?e.searchAsync(i):e.search(i);return r.then?r.then(function(e){return t.C[o]=e=e.result||e,s(e),e}):(r=r.result||r,s(r),r)}})(i,Object.assign({},r)),t.C.push(l),c[e]=l;continue}r.resolve=!1,r.index=null,d=n?i.searchAsync(r):i.search(r),r.resolve=o,r.index=i}else if(r.and)d=ve(r,"and",i);else if(r.or)d=ve(r,"or",i);else if(r.not)d=ve(r,"not",i);else{if(!r.xor)continue;d=ve(r,"xor",i)}}d.await?(a=1,d=d.await):d.then?(a=1,d=d.then(function(t){return t.result||t})):d=d.result||d,c[e]=d}if(a&&!t.await&&(t.await=new Promise(function(e){t.return=e})),a){const e=Promise.all(c).then(function(i){for(let r=0;r<t.C.length;r++)if(t.C[r]===e){t.C[r]=function(){return n.call(t,i,u,f,s,o,l,h)};break}ze(t)});t.C.push(e)}else{if(!t.await)return n.call(t,c,u,f,s,o,l,h);t.C.push(function(){return n.call(t,c,u,f,s,o,l,h)})}return o?t.await||t.result:t}function ve(t,e,n){const i=(t=t[e])[0]||t;return i.index||(i.index=n),n=new Ne(i),t.length>1&&(n=n[e].apply(n,t.slice(1))),n}function ke(t,e,n,i,r,s,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=Ie(t,e,n,!1,this.h),n=0)),r&&(this.await=null),r?this.resolve(e,n,i,o):this}function Ae(t,e,n,i,r,s,o){if(!s&&!this.result.length)return r?this.result:this;let l;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let i=0;for(let e,n,r=0;r<t.length;r++)if((e=t[r])&&(n=e.length))i<n&&(i=n);else if(!s){i=0;break}i?(this.result=je(t,i,e,n,s,this.h,r),l=!0):this.result=[]}else s||(this.result=t);return r&&(this.await=null),r?this.resolve(e,n,i,o,l):this}function Se(t,e,n,i,r,s,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{s=n;var l=this.h;const i=[],o=Dt();let h=0;for(let e,n=0;n<t.length;n++)if(e=t[n]){h<e.length&&(h=e.length);for(let t,n=0;n<e.length;n++)if(t=e[n])for(let e,n=0;n<t.length;n++)e=t[n],o[e]=o[e]?2:1}for(let n,a=0,c=0;a<h;a++)for(let h,u=0;u<t.length;u++)if((h=t[u])&&(n=h[a]))for(let h,f=0;f<n.length;f++)if(h=n[f],1===o[h])if(s)s--;else if(r){if(i.push(h),i.length===e){t=i;break t}}else{const n=a+(u?l:0);if(i[n]||(i[n]=[]),i[n].push(h),++c===e){t=i;break t}}t=i}this.result=t,l=!0}else s||(this.result=t);return r&&(this.await=null),r?this.resolve(e,n,i,o,l):this}function Ce(t,e,n,i,r,s,o){if(!s&&!this.result.length)return r?this.result:this;if(t.length&&this.result.length){t:{s=n;var l=[];t=new Set(t.flat().flat());for(let n,i=0,o=0;i<this.result.length;i++)if(n=this.result[i])for(let h,a=0;a<n.length;a++)if(h=n[a],!t.has(h))if(s)s--;else if(r){if(l.push(h),l.length===e){t=l;break t}}else if(l[i]||(l[i]=[]),l[i].push(h),++o===e){t=l;break t}t=l}this.result=t,l=!0}return r&&(this.await=null),r?this.resolve(e,n,i,o,l):this}function Ee(t,e,n,i,r){let s,o,l;"string"==typeof r?(s=r,r=""):s=r.template,o=s.indexOf("$1"),l=s.substring(o+2),o=s.substring(0,o);let h=r&&r.boundary,a=!r||!1!==r.clip,c=r&&r.merge&&l&&o&&new RegExp(l+" "+o,"g");var u=0;if("object"==typeof(r=r&&r.ellipsis)){var f=r.template;u=f.length-2,r=r.pattern}let d,p;"string"!=typeof r&&(r=!1===r?"":"..."),u&&(r=f.replace("$1",r)),f=r.length-u,"object"==typeof h&&(d=h.before,0===d&&(d=-1),p=h.after,0===p&&(p=-1),h=h.total||9e5),u=new Map;for(let P,D,L,B=0;B<e.length;B++){let T;if(i)T=e,L=i;else{var g=e[B];if(L=g.field,!L)continue;T=g.result}D=n.get(L),P=D.encoder,"string"!=typeof(g=u.get(P))&&(g=P.encode(t),u.set(P,g));for(let t=0;t<T.length;t++){var _=T[t].doc;if(!_)continue;if(!(_=Tt(_,L)))continue;var m=_.trim().split(/\s+/);if(!m.length)continue;_="";var y=[];let e=[];for(var x=-1,w=-1,b=0,v=0;v<m.length;v++){var k=m[v],A=P.encode(k);let t;if((A=A.length>1?A.join(" "):A[0])&&k){for(var S=k.length,C=(P.split?k.replace(P.split,""):k).length-A.length,E="",N=0,z=0;z<g.length;z++){var j=g[z];if(j){var I=j.length;I+=C,N&&I<=N||(j=A.indexOf(j))>-1&&(E=(j?k.substring(0,j):"")+o+k.substring(j,j+I)+l+(j+I<S?k.substring(j+I):""),N=I,t=!0)}}E&&(h&&(x<0&&(x=_.length+(_?1:0)),w=_.length+(_?1:0)+E.length,b+=S,e.push(y.length),y.push({match:E})),_+=(_?" ":"")+E)}if(t){if(h&&b>=h)break}else _+=(_?" ":"")+(k=m[v]),h&&y.push({text:k})}if(b=e.length*(s.length-2),d||p||h&&_.length-b>h)if(v=w-x,d>0&&(v+=d),p>0&&(v+=p),v<=(b=h+b-2*f))m=d?x-(d>0?d:0):x-((b-v)/2|0),y=p?w+(p>0?p:0):m+b,a||(m>0&&" "!==_.charAt(m)&&" "!==_.charAt(m-1)&&((m=_.indexOf(" ",m))<0&&(m=0)),y<_.length&&" "!==_.charAt(y-1)&&" "!==_.charAt(y)&&((y=_.lastIndexOf(" ",y))<w?y=w:++y)),_=(m?r:"")+_.substring(m,y)+(y<_.length?r:"");else{for(w=[],x={},b={},v={},k={},A={},E=C=S=0,z=N=1;;){var M=void 0;for(let t,n=0;n<e.length;n++){if(t=e[n],E)if(C!==E){if(v[n+1])continue;if(t+=E,x[t]){S-=f,b[n+1]=1,v[n+1]=1;continue}if(t>=y.length-1){if(t>=y.length){v[n+1]=1,t>=m.length&&(b[n+1]=1);continue}S-=f}if(_=y[t].text,I=p&&A[n]){if(!(I>0)){v[n+1]=1;continue}if(_.length>I){if(v[n+1]=1,!a)continue;_=_.substring(0,I)}(I-=_.length)||(I=-1),A[n]=I}if(S+_.length+1<=h)_=" "+_,w[n]+=_;else{if(!a){v[n+1]=1;continue}(M=h-S-1)>0&&(_=" "+_.substring(0,M),w[n]+=_),v[n+1]=1}}else{if(v[n])continue;if(t-=C,x[t]){S-=f,v[n]=1,b[n]=1;continue}if(t<=0){if(t<0){v[n]=1,b[n]=1;continue}S-=f}if(_=y[t].text,I=d&&k[n]){if(!(I>0)){v[n]=1;continue}if(_.length>I){if(v[n]=1,!a)continue;_=_.substring(_.length-I)}(I-=_.length)||(I=-1),k[n]=I}if(S+_.length+1<=h)_+=" ",w[n]=_+w[n];else{if(!a){v[n]=1;continue}(M=_.length+1-(h-S))>=0&&M<_.length&&(_=_.substring(M)+" ",w[n]=_+w[n]),v[n]=1}}else{let e;if(_=y[t].match,d&&(k[n]=d),p&&(A[n]=p),n&&S++,t?!n&&f&&(S+=f):(b[n]=1,v[n]=1),t>=m.length-1||t<y.length-1&&y[t+1].match?e=1:f&&(S+=f),S-=s.length-2,n&&!(S+_.length<=h)){M=N=z=b[n]=0;break}w[n]=_,e&&(b[n+1]=1,v[n+1]=1)}S+=_.length,M=x[t]=1}if(M)C===E?E++:C++;else{if(C===E?N=0:z=0,!N&&!z)break;N?E=++C:E++}}_="";for(let t,e=0;e<w.length;e++)t=(e&&b[e]?" ":(e&&!r?" ":"")+r)+w[e],_+=t;r&&!b[w.length]&&(_+=r)}c&&(_=_.replace(c," ")),T[t].highlight=_}if(i)break}return e}function Ne(t,e){if(!this||this.constructor!==Ne)return new Ne(t,e);let n,i,r,s,o,l,h=0;if(t&&t.index){const n=t;if(e=n.index,h=n.boost||0,i=n.query){r=n.field||n.pluck,s=n.highlight;const i=n.resolve;t=n.async||n.queue,n.resolve=!1,n.index=null,t=t?e.searchAsync(n):e.search(n),n.resolve=i,n.index=e,t=t.result||t}else t=[]}if(t&&t.then){const e=this;t=t.then(function(t){e.C[0]=e.result=t.result||t,ze(e)}),n=[t],t=[],o=new Promise(function(t){l=t})}this.index=e||null,this.result=t||[],this.h=h,this.C=n||[],this.await=o||null,this.return=l||null,this.highlight=s||null,this.query=i||"",this.field=r||""}function ze(t,e){let n=t.result;var i=t.await;t.await=null;for(let e,r=0;r<t.C.length;r++)if(e=t.C[r])if("function"==typeof e)n=e(),t.C[r]=n=n.result||n,r--;else if(e.h)n=e.h(),t.C[r]=n=n.result||n,r--;else if(e.then)return t.await=i;return i=t.return,t.C=[],t.return=null,e||i(n),n}function je(t,e,n,i,r,s,o){const l=t.length;let h,a,c=[];h=Dt();for(let u,f,d,p,g=0;g<e;g++)for(let e=0;e<l;e++)if(d=t[e],g<d.length&&(u=d[g]))for(let t=0;t<u.length;t++){if(f=u[t],(a=h[f])?h[f]++:(a=0,h[f]=1),p=c[a]||(c[a]=[]),!o){let t=g+(e||!r?0:s||0);p=p[t]||(p[t]=[])}if(p.push(f),o&&n&&a===l-1&&p.length-i===n)return i?p.slice(i):p}if(t=c.length)if(r)c=c.length>1?Ie(c,n,i,o,s):(c=c[0])&&n&&c.length>n||i?c.slice(i,n+i):c;else{if(t<l)return[];if(c=c[t-1],n||i)if(o)(c.length>n||i)&&(c=c.slice(i,n+i));else{r=[];for(let t,e=0;e<c.length;e++)if(t=c[e])if(i&&t.length>i)i-=t.length;else if((n&&t.length>n||i)&&(t=t.slice(i,n+i),n-=t.length,i&&(i-=t.length)),r.push(t),!n)break;c=r}}return c}function Ie(t,e,n,i,r){const s=[],o=Dt();let l;var h=t.length;let a;if(i){for(r=h-1;r>=0;r--)if(a=(i=t[r])&&i.length)for(h=0;h<a;h++)if(l=i[h],!o[l])if(o[l]=1,n)n--;else if(s.push(l),s.length===e)return s}else for(let c,u=h-1,f=0;u>=0;u--){c=t[u];for(let t=0;t<c.length;t++)if(a=(i=c[t])&&i.length)for(let c=0;c<a;c++)if(l=i[c],!o[l])if(o[l]=1,n)n--;else{let n=(t+(u<h-1&&r||0))/(u+1)|0;if((s[n]||(s[n]=[])).push(l),++f===e)return s}}return s}function Me(t,e,n){const i=Dt(),r=[];for(let t,n=0;n<e.length;n++){t=e[n];for(let e=0;e<t.length;e++)i[t[e]]=1}if(n)for(let e,n=0;n<t.length;n++)e=t[n],i[e]&&(r.push(e),i[e]=0);else for(let n,s,o=0;o<t.result.length;o++)for(n=t.result[o],e=0;e<n.length;e++)s=n[e],i[s]&&((r[o]||(r[o]=[])).push(s),i[s]=0);return r}function Pe(t){const e=[],n=Dt(),i=Dt();for(let r,s,o,l,h,a,c,u=0;u<t.length;u++){r=t[u],s=r.field,o=r.result;for(let t=0;t<o.length;t++)h=o[t],"object"!=typeof h?h={id:l=h}:l=h.id,(a=n[l])?a.push(s):(h.field=n[l]=[s],e.push(h)),(c=h.highlight)&&(a=i[l],a||(i[l]=a={},h.highlight=a),a[s]=c)}return e}function De(t,e,n,i,r){return(t=this.tag.get(t))&&(t=t.get(e))?((e=t.length-i)>0&&((n&&e>n||i)&&(t=t.slice(i,i+n)),r&&(t=Le.call(this,t))),t):[]}function Le(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const e=Array(t.length);for(let n,i=0;i<t.length;i++)n=t[i],e[i]={id:n,doc:this.store.get(n)};return e}function Be(t){if(!this||this.constructor!==Be)return new Be(t);const e=t.document||t.doc||t;let n,i;if(this.B=[],this.field=[],this.D=[],this.key=(n=e.key||e.id)&&Oe(n,this.D)||"id",(i=t.keystore||0)&&(this.keystore=i),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?i?new ie(i):new Set:i?new ne(i):new Map,this.h=(n=e.store||null)&&n&&!0!==n&&[],this.store=n?i?new ne(i):new Map:null,this.cache=(n=t.cache||null)&&new Wt(n),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=Te.call(this,t,e),this.tag=null,(n=e.tag)&&("string"==typeof n&&(n=[n]),n.length)){this.tag=new Map,this.A=[],this.F=[];for(let t,e,i=0;i<n.length;i++){if(t=n[i],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.A[i]=t.custom:(this.A[i]=Oe(e,this.D),t.filter&&("string"==typeof this.A[i]&&(this.A[i]=new String(this.A[i])),this.A[i].G=t.filter)),this.F[i]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then(function(t){let n=0;for(const i of e.index.entries()){const r=i[0];let s=i[1];s.then&&(s=t[n],e.index.set(r,s),n++)}return e})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function Te(t,e){const n=new Map;let i=e.index||e.field||e;Lt(i)&&(i=[i]);for(let e,s,o=0;o<i.length;o++){if(e=i[o],Lt(e)||(s=e,e=e.field),s=Bt(s)?Object.assign({},t,s):t,this.worker){var r=void 0;r=new _e(s,r=(r=s.encoder)&&r.encode?r:new Rt("string"==typeof r?Yt[r]:r||{})),n.set(e,r)}this.worker||n.set(e,new en(s,this.reg)),s.custom?this.B[o]=s.custom:(this.B[o]=Oe(e,this.D),s.filter&&("string"==typeof this.B[o]&&(this.B[o]=new String(this.B[o])),this.B[o].G=s.filter)),this.field[o]=e}if(this.h){Lt(t=e.store)&&(t=[t]);for(let e,n,i=0;i<t.length;i++)e=t[i],n=e.field||e,e.custom?(this.h[i]=e.custom,e.custom.O=n):(this.h[i]=Oe(n,this.D),e.filter&&("string"==typeof this.h[i]&&(this.h[i]=new String(this.h[i])),this.h[i].G=e.filter))}return n}function Oe(t,e){const n=t.split(":");let i=0;for(let r=0;r<n.length;r++)"]"===(t=n[r])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[i]=!0),t&&(n[i++]=t);return i<n.length&&(n.length=i),i>1?n:n[0]}function Ue(t,e=0){let n=[],i=[];e&&(e=25e4/e*5e3|0);for(const r of t.entries())i.push(r),i.length===e&&(n.push(i),i=[]);return i.length&&n.push(i),n}function $e(t,e){e||(e=new Map);for(let n,i=0;i<t.length;i++)n=t[i],e.set(n[0],n[1]);return e}function He(t,e=0){let n=[],i=[];e&&(e=25e4/e*1e3|0);for(const r of t.entries())i.push([r[0],Ue(r[1])[0]]),i.length===e&&(n.push(i),i=[]);return i.length&&n.push(i),n}function Fe(t,e){e||(e=new Map);for(let n,i,r=0;r<t.length;r++)n=t[r],i=e.get(n[0]),e.set(n[0],$e(n[1],i));return e}function Re(t){let e=[],n=[];for(const i of t.keys())n.push(i),25e4===n.length&&(e.push(n),n=[]);return n.length&&e.push(n),e}function qe(t,e){e||(e=new Set);for(let n=0;n<t.length;n++)e.add(t[n]);return e}function Ke(t,e,n,i,r,s,o=0){const l=i&&i.constructor===Array;var h=l?i.shift():i;if(!h)return this.export(t,e,r,s+1);if((h=t((e?e+".":"")+(o+1)+"."+n,JSON.stringify(h)))&&h.then){const a=this;return h.then(function(){return Ke.call(a,t,e,n,l?i:null,r,s,o+1)})}return Ke.call(this,t,e,n,l?i:null,r,s,o+1)}function We(t,e){let n="";for(const i of t.entries()){t=i[0];const r=i[1];let s="";for(let t,n=0;n<r.length;n++){t=r[n]||[""];let i="";for(let n=0;n<t.length;n++)i+=(i?",":"")+("string"===e?'"'+t[n]+'"':t[n]);i="["+i+"]",s+=(s?",":"")+i}s='["'+t+'",['+s+"]]",n+=(n?",":"")+s}return n}function Je(t,e){let n=0;var i=void 0===e;if(t.constructor===Array){for(let r,s,o,l=0;l<t.length;l++)if((r=t[l])&&r.length){if(i)return 1;if(s=r.indexOf(e),s>=0){if(r.length>1)return r.splice(s,1),1;if(delete t[l],n)return 1;o=1}else{if(o)return 1;n++}}}else for(let r of t.entries())i=r[0],Je(r[1],e)?n++:t.delete(i);return n}me("add"),me("append"),me("search"),me("update"),me("remove"),me("clear"),me("export"),me("import"),_e.prototype.searchCache=Kt,fe(_e.prototype),Be.prototype.add=function(t,e,n){if(Bt(t)&&(t=Tt(e=t,this.key)),e&&(t||0===t)){if(!n&&this.reg.has(t))return this.update(t,e);for(let s,o=0;o<this.field.length;o++){s=this.B[o];var i=this.index.get(this.field[o]);if("function"==typeof s){var r=s(e);r&&i.add(t,r,n,!0)}else(!(r=s.G)||r(e))&&(s.constructor===String?s=[""+s]:Lt(s)&&(s=[s]),xe(e,s,this.D,0,i,t,s[0],n))}if(this.tag)for(i=0;i<this.A.length;i++){var s=this.A[i];r=this.tag.get(this.F[i]);let l=Dt();if("function"==typeof s){if(!(s=s(e)))continue}else{var o=s.G;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=Tt(e,s)}if(r&&s){Lt(s)&&(s=[s]);for(let e,i,h=0;h<s.length;h++)if(e=s[h],!l[e]&&(l[e]=1,(o=r.get(e))?i=o:r.set(e,i=[]),!n||!i.includes(t))){if(i.length===2**31-1){if(o=new ee(i),this.fastupdate)for(let t of this.reg.values())t.includes(i)&&(t[t.indexOf(i)]=o);r.set(e,i=o)}i.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(i):this.reg.set(t,[i]))}}}if(this.store&&(!n||!this.store.has(t))){let i;if(this.h){i=Dt();for(let t,r=0;r<this.h.length;r++){if(t=this.h[r],(n=t.G)&&!n(e))continue;let s;if("function"==typeof t){if(s=t(e),!s)continue;t=[t.O]}else if(Lt(t)||t.constructor===String){i[t]=e[t];continue}ye(e,i,t,0,t[0],s)}}this.store.set(t,i||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},Ne.prototype.or=function(){return be(this,"or",ke,arguments)},Ne.prototype.and=function(){return be(this,"and",Ae,arguments)},Ne.prototype.xor=function(){return be(this,"xor",Se,arguments)},Ne.prototype.not=function(){return be(this,"not",Ce,arguments)},(It=Ne.prototype).limit=function(t){if(this.await){const e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){const e=[];for(let n,i=0;i<this.result.length;i++)if(n=this.result[i]){if(!(n.length<=t)){e[i]=n.slice(0,t);break}if(e[i]=n,!(t-=n.length))break}this.result=e}return this},It.offset=function(t){if(this.await){const e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){const e=[];for(let n,i=0;i<this.result.length;i++)(n=this.result[i])&&(n.length<=t?t-=n.length:(e[i]=n.slice(t),t=0));this.result=e}return this},It.boost=function(t){if(this.await){const e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this},It.resolve=function(t,e,n,i,r){let s=this.await?ze(this,!0):this.result;if(s.then){const o=this;return s.then(function(){return o.resolve(t,e,n,i,r)})}return s.length&&("object"==typeof t?(i=t.highlight||this.highlight,n=!!i||t.enrich,e=t.offset,t=t.limit):(i=i||this.highlight,n=!!i||n),s=r?n?Le.call(this.index,s):s:we.call(this.index,s,t||100,e,n)),this.finalize(s,i)},It.finalize=function(t,e){if(t.then){const n=this;return t.then(function(t){return n.finalize(t,e)})}e&&t.length&&this.query&&(t=Ee(this.query,t,this.index.index,this.field,e));const n=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",n&&n(t),t},Be.prototype.search=function(t,e,n,i){n||(!e&&Bt(t)?(n=t,t=""):Bt(e)&&(n=e,e=0));let r=[];var s=[];let o,l,h,a,c,u,f,d,p=0,g=!0;if(n){n.constructor===Array&&(n={index:n}),t=n.query||t,o=n.pluck,l=n.merge,a=n.boost,u=o||n.field||(u=n.index)&&(u.index?null:u);var _=this.tag&&n.tag;h=n.suggest,g=!1!==n.resolve,c=n.cache,f=g&&this.store&&n.highlight;var m=!!f||g&&this.store&&n.enrich;e=n.limit||e;var y=n.offset||0;if(e||(e=g?100:0),_&&(!this.db||!i)){_.constructor!==Array&&(_=[_]);var x=[];for(let t,e=0;e<_.length;e++)if(t=_[e],t.field&&t.tag){var w=t.tag;if(w.constructor===Array)for(var b=0;b<w.length;b++)x.push(t.field,w[b]);else x.push(t.field,w)}else{w=Object.keys(t);for(let e,n,i=0;i<w.length;i++)if(e=w[i],n=t[e],n.constructor===Array)for(b=0;b<n.length;b++)x.push(e,n[b]);else x.push(e,n)}if(_=x,!t){if(s=[],x.length)for(_=0;_<x.length;_+=2){if(this.db){if(!(i=this.index.get(x[_])))continue;s.push(i=i.db.tag(x[_+1],e,y,m))}else i=De.call(this,x[_],x[_+1],e,y,m);r.push(g?{field:x[_],tag:x[_+1],result:i}:[i])}if(s.length){const t=this;return Promise.all(s).then(function(e){for(let t=0;t<e.length;t++)g?r[t].result=e[t]:r[t]=e[t];return g?r:new Ne(r.length>1?je(r,1,0,0,h,a):r[0],t)})}return g?r:new Ne(r.length>1?je(r,1,0,0,h,a):r[0],this)}}g||o||!(u=u||this.field)||(Lt(u)?o=u:(u.constructor===Array&&1===u.length&&(u=u[0]),o=u.field||u.index)),u&&u.constructor!==Array&&(u=[u])}u||(u=this.field),x=(this.worker||this.db)&&!i&&[];for(let o,l,a,k=0;k<u.length;k++){if(l=u[k],this.db&&this.tag&&!this.B[k])continue;let A;if(Lt(l)||(A=l,l=A.field,t=A.query||t,e=Pt(A.limit,e),y=Pt(A.offset,y),h=Pt(A.suggest,h),f=g&&this.store&&Pt(A.highlight,f),m=!!f||g&&this.store&&Pt(A.enrich,m),c=Pt(A.cache,c)),i)o=i[k];else{b=(w=A||n||{}).enrich;var v=this.index.get(l);if(_&&(this.db&&(w.tag=_,d=v.db.support_tag_search,w.field=u),!d&&b&&(w.enrich=!1)),o=c?v.searchCache(t,e,w):v.search(t,e,w),b&&(w.enrich=b),x){x[k]=o;continue}}if(a=(o=o.result||o)&&o.length,_&&a){if(w=[],b=0,this.db&&i){if(!d)for(v=u.length;v<i.length;v++){let t=i[v];if(t&&t.length)b++,w.push(t);else if(!h)return g?r:new Ne(r,this)}}else for(let t,e,n=0;n<_.length;n+=2){if(t=this.tag.get(_[n]),!t){if(h)continue;return g?r:new Ne(r,this)}if(e=(t=t&&t.get(_[n+1]))&&t.length)b++,w.push(t);else if(!h)return g?r:new Ne(r,this)}if(b){if(o=Me(o,w,g),a=o.length,!a&&!h)return g?o:new Ne(o,this);b--}}if(a)s[p]=l,r.push(o),p++;else if(1===u.length)return g?r:new Ne(r,this)}if(x){if(this.db&&_&&_.length&&!d)for(m=0;m<_.length;m+=2){if(!(s=this.index.get(_[m]))){if(h)continue;return g?r:new Ne(r,this)}x.push(s.db.tag(_[m+1],e,y,!1))}const i=this;return Promise.all(x).then(function(r){return n&&(n.resolve=g),r.length&&(r=i.search(t,e,n,r)),r})}if(!p)return g?r:new Ne(r,this);if(o&&(!m||!this.store))return r=r[0],g?r:new Ne(r,this);for(x=[],y=0;y<s.length;y++){if(_=r[y],m&&_.length&&void 0===_[0].doc&&(this.db?x.push(_=this.index.get(this.field[0]).db.enrich(_)):_=Le.call(this,_)),o)return g?f?Ee(t,_,this.index,o,f):_:new Ne(_,this);r[y]={field:s[y],result:_}}if(m&&this.db&&x.length){const e=this;return Promise.all(x).then(function(n){for(let t=0;t<n.length;t++)r[t].result=n[t];return f&&(r=Ee(t,r,e.index,o,f)),l?Pe(r):r})}return f&&(r=Ee(t,r,this.index,o,f)),l?Pe(r):r},(It=Be.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,i=0;i<this.F.length;i++){t=this.F[i];var n=void 0;this.index.set(t,n=new en({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),n.tag=this.tag.get(t)}n=[];const i={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let r,s,o=0;o<e.length;o++){i.field=s=e[o],r=this.index.get(s);const l=new t.constructor(t.id,i);l.id=t.id,n[o]=l.mount(r),r.document=!0,o?r.bypass=!0:r.store=this.store}const r=this;return this.db=Promise.all(n).then(function(){r.db=!0})},It.commit=async function(){const t=[];for(const e of this.index.values())t.push(e.commit());await Promise.all(t),this.reg.clear()},It.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},It.append=function(t,e){return this.add(t,e,!0)},It.update=function(t,e){return this.remove(t).add(t,e)},It.remove=function(t){for(var e of(Bt(t)&&(t=Tt(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let n of this.tag.values())for(let i of n){e=i[0];const r=i[1],s=r.indexOf(t);s>-1&&(r.length>1?r.splice(s,1):n.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},It.clear=function(){const t=[];for(const e of this.index.values()){const n=e.clear();n.then&&t.push(n)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},It.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},It.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},It.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(t){return t[0]&&t[0].doc||null}):this.store.get(t)||null},It.set=function(t,e){return"object"==typeof t&&(t=Tt(e=t,this.key)),this.store.set(t,e),this},It.searchCache=Kt,It.export=function(t,e,n=0,i=0){if(n<this.field.length){const r=this.field[n];if((e=this.index.get(r).export(t,r,n,i=1))&&e.then){const i=this;return e.then(function(){return i.export(t,r,n+1)})}return this.export(t,r,n+1)}let r,s;switch(i){case 0:r="reg",s=Re(this.reg),e=null;break;case 1:r="tag",s=this.tag&&He(this.tag,this.reg.size),e=null;break;case 2:r="doc",s=this.store&&Ue(this.store),e=null;break;default:return}return Ke.call(this,t,e,r,s||null,n,i)},It.import=function(t,e){var n=t.split(".");"json"===n[n.length-1]&&n.pop();const i=n.length>2?n[0]:"";if(n=n.length>2?n[2]:n[1],this.worker&&i)return this.index.get(i).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),i)return this.index.get(i).import(n,e);switch(n){case"reg":this.fastupdate=!1,this.reg=qe(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const n of this.index.values())e.push(n.import(t));return Promise.all(e)}break;case"tag":this.tag=Fe(e,this.tag);break;case"doc":this.store=$e(e,this.store)}}},fe(Be.prototype),en.prototype.remove=function(t,e){const n=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(n){if(this.fastupdate){for(let e,i,r=0;r<n.length;r++)if((e=n[r])&&(i=e.length))if(e[i-1]===t)e.pop();else{const n=e.indexOf(t);n>=0&&e.splice(n,1)}}else Je(this.map,t),this.depth&&Je(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&nn(this)),this.cache&&this.cache.remove(t),this};const Ve={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function Ge(t,e,n,i,r,s,o){let l,h;if(!(l=e[n])||o&&!l[o]){if(o?((e=l||(e[n]=Dt()))[o]=1,h=t.ctx,(l=h.get(o))?h=l:h.set(o,h=t.keystore?new ne(t.keystore):new Map)):(h=t.map,e[n]=1),(l=h.get(n))?h=l:h.set(n,h=l=[]),s)for(let n,s=0;s<l.length;s++)if((n=l[s])&&n.includes(r)){if(s<=i)return;n.splice(n.indexOf(r),1),t.fastupdate&&(e=t.reg.get(r))&&e.splice(e.indexOf(n),1);break}if(h=h[i]||(h[i]=[]),h.push(r),h.length===2**31-1){if(e=new ee(h),t.fastupdate)for(let n of t.reg.values())n.includes(h)&&(n[n.indexOf(h)]=e);l[i]=h=e}t.fastupdate&&((i=t.reg.get(r))?i.push(h):t.reg.set(r,[h]))}}function Qe(t,e,n,i,r){return n&&t>1?e+(i||0)<=t?n+(r||0):(t-1)/(e+(i||0))*(n+(r||0))+1|0:0}function Xe(t,e,n,i,r,s,o){let l=t.length,h=t;if(l>1)h=je(t,e,n,i,r,s,o);else if(1===l)return o?we.call(null,t[0],n,i):new Ne(t[0],this);return o?h:new Ne(h,this)}function Ze(t,e,n,i,r,s,o){return t=tn(this,t,e,n,i,r,s,o),this.db?t.then(function(t){return r?t||[]:new Ne(t,this)}):t&&t.length?r?we.call(this,t,n,i):new Ne(t,this):r?[]:new Ne([],this)}function Ye(t,e,n,i){let r=[];if(t&&t.length){if(t.length<=i)return void e.push(t);for(let e,n=0;n<i;n++)(e=t[n])&&(r[n]=e);if(r.length)return void e.push(r)}if(!n)return r}function tn(t,e,n,i,r,s,o,l){let h;return n&&(h=t.bidirectional&&e>n)&&(h=n,n=e,e=h),t.db?t.db.get(e,n,i,r,s,o,l):t=n?(t=t.ctx.get(n))&&t.get(e):t.map.get(e)}function en(t,e){if(!this||this.constructor!==en)return new en(t);if(t){var n=Lt(t)?t:t.preset;n&&(t=Object.assign({},Ve[n],t))}else t={};const i=!0===(n=t.context)?{depth:1}:n||{},r=Lt(t.encoder)?Yt[t.encoder]:t.encode||t.encoder||{};this.encoder=r.encode?r:"object"==typeof r?new Rt(r):{encode:r},this.resolution=t.resolution||9,this.tokenize=n=(n=t.tokenize)&&"default"!==n&&"exact"!==n&&n||"strict",this.depth="strict"===n&&i.depth||0,this.bidirectional=!1!==i.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(n=t.keystore||0)&&(this.keystore=n),this.map=n?new ne(n):new Map,this.ctx=n?new ne(n):new Map,this.reg=e||(this.fastupdate?n?new ne(n):new Map:n?new ie(n):new Set),this.N=i.resolution||3,this.rtl=r.rtl||t.rtl||!1,this.cache=(n=t.cache||null)&&new Wt(n),this.resolve=!1!==t.resolve,(n=t.db)&&(this.db=this.mount(n)),this.M=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function nn(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}en.prototype.add=function(t,e,n,i){if(e&&(t||0===t)){if(!i&&!n&&this.reg.has(t))return this.update(t,e);i=this.depth;const a=(e=this.encoder.encode(e,!i)).length;if(a){const c=Dt(),u=Dt(),f=this.resolution;for(let d=0;d<a;d++){let p=e[this.rtl?a-1-d:d];var r=p.length;if(r&&(i||!u[p])){var s=this.score?this.score(e,p,d,null,0):Qe(f,a,d),o="";switch(this.tokenize){case"tolerant":if(Ge(this,u,p,s,t,n),r>2){for(let e,i,l,h,a=1;a<r-1;a++)e=p.charAt(a),i=p.charAt(a+1),l=p.substring(0,a)+i,h=p.substring(a+2),Ge(this,u,o=l+e+h,s,t,n),Ge(this,u,o=l+h,s,t,n);Ge(this,u,p.substring(0,p.length-1),s,t,n)}break;case"full":if(r>2){for(let i,h=0;h<r;h++)for(s=r;s>h;s--){o=p.substring(h,s),i=this.rtl?r-1-h:h;var l=this.score?this.score(e,p,d,o,i):Qe(f,a,d,r,i);Ge(this,u,o,l,t,n)}break}case"bidirectional":case"reverse":if(r>1){for(l=r-1;l>0;l--){o=p[this.rtl?r-1-l:l]+o;var h=this.score?this.score(e,p,d,o,l):Qe(f,a,d,r,l);Ge(this,u,o,h,t,n)}o=""}case"forward":if(r>1){for(l=0;l<r;l++)Ge(this,u,o+=p[this.rtl?r-1-l:l],s,t,n);break}default:if(Ge(this,u,p,s,t,n),i&&a>1&&d<a-1)for(r=this.N,o=p,s=Math.min(i+1,this.rtl?d+1:a-d),l=1;l<s;l++){p=e[this.rtl?a-1-d-l:d+l];Ge(this,c,(h=this.bidirectional&&p>o)?o:p,this.score?this.score(e,o,d,p,l-1):Qe(r+(a/2>r?0:1),a,d,s-1,l-1),t,n,h?p:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(n?{ins:t}:{del:t}),this.M&&nn(this)),this},en.prototype.search=function(t,e,n){if(n||(e||"object"!=typeof t?"object"==typeof e&&(n=e,e=0):(n=t,t="")),n&&n.cache)return n.cache=!1,t=this.searchCache(t,e,n),n.cache=!0,t;let i,r,s,o,l,h,a,c,u=[],f=0;n&&(t=n.query||t,e=n.limit||e,f=n.offset||0,r=n.context,s=n.suggest,c=(o=n.resolve)&&n.enrich,h=n.boost,a=n.resolution,l=this.db&&n.tag),void 0===o&&(o=this.resolve),r=this.depth&&!1!==r;let d=this.encoder.encode(t,!r);if(i=d.length,e=e||(o?100:0),1===i)return Ze.call(this,d[0],"",e,f,o,c,l);if(2===i&&r&&!s)return Ze.call(this,d[1],d[0],e,f,o,c,l);let p,g=Dt(),_=0;if(r&&(p=d[0],_=1),a||0===a||(a=p?this.N:this.resolution),this.db){if(this.db.search&&!1!==(n=this.db.search(this,d,e,f,s,o,c,l)))return n;const t=this;return async function(){for(let e,n;_<i;_++){if((n=d[_])&&!g[n]){if(g[n]=1,e=await tn(t,n,p,0,0,!1,!1),e=Ye(e,u,s,a)){u=e;break}p&&(s&&e&&u.length||(p=n))}s&&p&&_===i-1&&!u.length&&(a=t.resolution,p="",_=-1,g=Dt())}return Xe(u,a,e,f,s,h,o)}()}for(let t,e;_<i;_++){if((e=d[_])&&!g[e]){if(g[e]=1,t=tn(this,e,p,0,0,!1,!1),t=Ye(t,u,s,a)){u=t;break}p&&(s&&t&&u.length||(p=e))}s&&p&&_===i-1&&!u.length&&(a=this.resolution,p="",_=-1,g=Dt())}return Xe(u,a,e,f,s,h,o)},(It=en.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},It.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},It.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},It.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},It.append=function(t,e){return this.add(t,e,!0)},It.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},It.update=function(t,e){const n=this,i=this.remove(t);return i&&i.then?i.then(()=>n.add(t,e)):this.add(t,e)},It.cleanup=function(){return this.fastupdate?(Je(this.map),this.depth&&Je(this.ctx),this):this},It.searchCache=Kt,It.export=function(t,e,n=0,i=0){let r,s;switch(i){case 0:r="reg",s=Re(this.reg);break;case 1:r="cfg",s=null;break;case 2:r="map",s=Ue(this.map,this.reg.size);break;case 3:r="ctx",s=He(this.ctx,this.reg.size);break;default:return}return Ke.call(this,t,e,r,s,n,i)},It.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=qe(e,this.reg);break;case"map":this.map=$e(e,this.map);break;case"ctx":this.ctx=Fe(e,this.ctx)}},It.serialize=function(t=!0){let e="",n="",i="";if(this.reg.size){let t;for(var r of this.reg.keys())t||(t=typeof r),e+=(e?",":"")+("string"===t?'"'+r+'"':r);e="index.reg=new Set(["+e+"]);",n=We(this.map,t),n="index.map=new Map(["+n+"]);";for(const e of this.ctx.entries()){r=e[0];let n=We(e[1],t);n="new Map(["+n+"])",n='["'+r+'",'+n+"]",i+=(i?",":"")+n}i="index.ctx=new Map(["+i+"]);"}return t?"function inject(index){"+e+n+i+"}":e+n+i},fe(en.prototype);const rn="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),sn=["map","ctx","tag","reg","cfg"],on=Dt();function ln(t,e,n){const i=t.value;let r,s=0;for(let t,o=0;o<i.length;o++){if(t=n?i:i[o]){for(let n,s,l=0;l<e.length;l++)if(s=e[l],n=t.indexOf(s),n>=0){if(r=1,!(t.length>1)){i[o]=[];break}t.splice(n,1)}s+=t.length}if(n)break}s?r&&t.update(i):t.delete(),t.continue()}function hn(t,e){return new Promise((n,i)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,n(this.result)},t.onerror=t.onblocked=i,t=null})}It=function t(e,n={}){if(!this||this.constructor!==t)return new t(e,n);"object"==typeof e&&(n=e,e=e.name),e||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(e?":"+e.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=n.field?n.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=n.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}.prototype,It.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},It.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist(),on[t.id]||(on[t.id]=[]),on[t.id].push(t.field);const e=rn.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let n,i=0;i<sn.length;i++){n=sn[i];for(let i,r=0;r<on[t.id].length;r++)i=on[t.id][r],e.objectStoreNames.contains(n+("reg"!==n&&i?":"+i:""))||e.createObjectStore(n+("reg"!==n&&i?":"+i:""))}},t.db=hn(e,function(e){t.db=e,t.db.onversionchange=function(){t.close()}})},It.close=function(){this.db&&this.db.close(),this.db=null},It.destroy=function(){return hn(rn.deleteDatabase(this.id))},It.clear=function(){const t=[];for(let e,n=0;n<sn.length;n++){e=sn[n];for(let n,i=0;i<on[this.id].length;i++)n=on[this.id][i],t.push(e+("reg"!==e&&n?":"+n:""))}const e=this.db.transaction(t,"readwrite");for(let n=0;n<t.length;n++)e.objectStore(t[n]).clear();return hn(e)},It.get=function(t,e,n=0,i=0,r=!0,s=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);const o=this;return hn(t).then(function(t){let e=[];if(!t||!t.length)return e;if(r){if(!n&&!i&&1===t.length)return t[0];for(let r,s=0;s<t.length;s++)if((r=t[s])&&r.length){if(i>=r.length){i-=r.length;continue}const t=n?i+Math.min(r.length-i,n):r.length;for(let n=i;n<t;n++)e.push(r[n]);if(i=0,e.length===n)break}return s?o.enrich(e):e}return t})},It.tag=function(t,e=0,n=0,i=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const r=this;return hn(t).then(function(t){return!t||!t.length||n>=t.length?[]:e||n?(t=t.slice(n,n+e),i?r.enrich(t):t):t})},It.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),n=[];for(let i=0;i<t.length;i++)n[i]=hn(e.get(t[i]));return Promise.all(n).then(function(e){for(let n=0;n<e.length;n++)e[n]={id:t[n],doc:e[n]?JSON.parse(e[n]):null};return e})},It.has=function(t){return hn(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then(function(t){return!!t})},It.search=null,It.info=function(){},It.transaction=function(t,e,n){t+="reg"!==t&&this.field?":"+this.field:"";let i=this.h[t+":"+e];if(i)return n.call(this,i);let r=this.db.transaction(t,e);this.h[t+":"+e]=i=r.objectStore(t);const s=n.call(this,i);return this.h[t+":"+e]=null,hn(r).finally(function(){return r=i=null,s})},It.commit=async function(t){let e=t.commit_task,n=[];t.commit_task=[];for(let t,i=0;i<e.length;i++)t=e[i],t.del&&n.push(t.del);n.length&&await this.remove(n),t.reg.size&&(await this.transaction("map","readwrite",function(e){for(const n of t.map){const t=n[0],i=n[1];i.length&&(e.get(t).onsuccess=function(){let n=this.result;var r;if(n&&n.length){const t=Math.max(n.length,i.length);for(let e,s,o=0;o<t;o++)if((s=i[o])&&s.length){if((e=n[o])&&e.length)for(r=0;r<s.length;r++)e.push(s[r]);else n[o]=s;r=1}}else n=i,r=1;r&&e.put(n,t)})}}),await this.transaction("ctx","readwrite",function(e){for(const n of t.ctx){const t=n[0],i=n[1];for(const n of i){const i=n[0],r=n[1];r.length&&(e.get(t+":"+i).onsuccess=function(){let n=this.result;var s;if(n&&n.length){const t=Math.max(n.length,r.length);for(let e,i,o=0;o<t;o++)if((i=r[o])&&i.length){if((e=n[o])&&e.length)for(s=0;s<i.length;s++)e.push(i[s]);else n[o]=i;s=1}}else n=r,s=1;s&&e.put(n,t+":"+i)})}}}),t.store?await this.transaction("reg","readwrite",function(e){for(const n of t.store){const t=n[0],i=n[1];e.put("object"==typeof i?JSON.stringify(i):1,t)}}):t.bypass||await this.transaction("reg","readwrite",function(e){for(const n of t.reg.keys())e.put(1,n)}),t.tag&&await this.transaction("tag","readwrite",function(e){for(const n of t.tag){const t=n[0],i=n[1];i.length&&(e.get(t).onsuccess=function(){let n=this.result;n=n&&n.length?n.concat(i):i,e.put(n,t)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},It.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&ln(e,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&ln(e,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&ln(e,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let n=0;n<t.length;n++)e.delete(t[n])})])};var an={Encoder:Rt,Document:Be};const cn=Yt,un={finalize:t=>{let e=[];for(const n of t)e.push(...dn(n));return e}};function fn(t){return t>=19968&&t<=40959||t>=12352&&t<=12543||t>=44032&&t<=55203||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=191471||t>=196608&&t<=205743||t>=191472&&t<=192095||t>=63744&&t<=64255||t>=194560&&t<=195103}function dn(t){const e=[];let n="";for(const i of t){const t=i.codePointAt(0);t&&fn(t)?(n&&(e.push(n),n=""),e.push(i)):n+=i}return n&&e.push(n),e}const pn=new an.Encoder({...cn.Default,...un});class gn{constructor({contentApiUrl:t,contentApiKey:e,dir:n="ltr",filter:i=""}){this.contentApiUrl=t,this.contentApiKey=e,this.dir=n,this.filter=i;const r="rtl"===n,s="rtl"===n?"reverse":"forward";this.postsIndex=new an.Document({tokenize:s,rtl:r,document:{id:"id",index:["title","excerpt"],store:!0},encoder:pn}),this.authorsIndex=new an.Document({tokenize:s,rtl:r,document:{id:"id",index:["name"],store:!0},encoder:pn}),this.tagsIndex=new an.Document({tokenize:s,rtl:r,document:{id:"id",index:["name"],store:!0},encoder:pn}),this.init=this.init.bind(this),this.search=this.search.bind(this),this.sample=this.sample.bind(this)}async#t(){let t=[];if(!this.filter)return[];const e=async(t=1)=>{const e=new URLSearchParams({filter:`tags:[${this.filter}]`,limit:"100",fields:"id,slug,title,excerpt,url,updated_at,visibility",order:"updated_at DESC",page:`${t}`}),n=`${this.contentApiUrl}/posts/?key=${this.contentApiKey}&${e}`,i=await fetch(n);return await i.json()},n=await e(1);if(t=n?.posts||[],n?.meta?.pagination?.pages>1){const i=Math.min(n.meta.pagination.pages,10),r=[];for(let t=2;t<=i;t++)r.push(e(t));(await Promise.allSettled(r)).forEach((e,n)=>{"rejected"!==e.status?t.push(...e.value?.posts||[]):console.error("Error fetching filtered posts with page="+(n+2))})}return t}async#e(){if(this.filter)return this.#t();const t=`${this.contentApiUrl}/search-index/posts/?key=${this.contentApiKey}`,e=await fetch(t);return(await e.json()).posts}async#n(){try{const t=`${this.contentApiUrl}/search-index/authors/?key=${this.contentApiKey}`,e=await fetch(t);return(await e.json()).authors}catch(t){return console.error("Error fetching authors:",t),window.Spiritix.safeReportError?.(t),[]}}async#i(){try{const t=`${this.contentApiUrl}/search-index/tags/?key=${this.contentApiKey}`,e=await fetch(t);return(await e.json()).tags}catch(t){return console.error("Error fetching tags:",t),window.Spiritix.safeReportError?.(t),[]}}#r(t){t.forEach(t=>{this.postsIndex.add(t)})}#s(t){t.forEach(t=>{!t?.url||/\/404\/$/.test(t.url)||this.authorsIndex.add(t)})}#o(t){t.forEach(t=>{!t?.url||/\/404\/$/.test(t.url)||this.tagsIndex.add(t)})}async init(){const[t,e,n]=await Promise.all([this.#e(),this.#n(),this.#i()]);t.length>0&&this.#r(t),e.length>0&&this.#s(e),n.length>0&&this.#o(n)}#l(t){const e=[],n={};return t.forEach(t=>{t.result.forEach(t=>{!n[t.id]&&t.doc&&(e.push(t.doc),n[t.id]=!0)})}),e}search(t){const e=this.postsIndex.search(t,{enrich:!0}),n=this.authorsIndex.search(t,{enrich:!0}),i=this.tagsIndex.search(t,{enrich:!0});return{posts:this.#l(e),authors:this.#l(n),tags:this.#l(i)}}sample(t=100){const e=[];if(this.postsIndex.store&&"function"==typeof this.postsIndex.store[Symbol.iterator])for(const[n,i]of this.postsIndex.store){if(e.length>=t)break;i&&e.push(i)}return{posts:e,authors:[],tags:[]}}}function _n({contentApiUrl:t,contentApiKey:e,dir:n}){const[i,r]=tt(!1),[s,o]=tt(""),[l,h]=tt(""),[a,c]=tt([]),u=nt(null),f=nt(null),d=it(()=>document.querySelectorAll("[data-ghost-search]")||[],[]),p=function(t,e){return q=8,it(function(){return t},e)}(i=>{let r=a.find(t=>t.filter===i);if(r||(r={filter:i||"",status:"initial",index:new gn({contentApiUrl:t,contentApiKey:e,dir:n,filter:i}),retries:0},c(a.concat({...r}))),r={...r},"initial"===r.status){r.status="started",c(t=>t.map(t=>t.filter===r.filter?{...r}:t));const t=performance.now();f.current=t,r.index.init().then(()=>{r.status="completed"}).catch(t=>{r.retries+=1,r.status=r.retries>=3?"failed":"initial",window.Spiritix.safeReportError?.(t)}).finally(()=>{const e="initial"===r.status?100:0;setTimeout(()=>{t===f.current&&c(t=>t.map(t=>t.filter===r.filter?{...r}:t))},e)})}},[a,t,e,n]);et(()=>{i&&p(s)},[i,p]),et(()=>{const t=t=>{if(t.preventDefault(),t.currentTarget instanceof Element){const e=t.currentTarget,n=e?.getAttribute("data-ghost-search")?.trim()||"";n&&p(n)}};return d.forEach(e=>e.addEventListener("mouseenter",t)),()=>d.forEach(e=>e.removeEventListener("mouseenter",t))},[d,p]),et(()=>{const t=t=>{if(t.preventDefault(),t.currentTarget instanceof Element){const e=t.currentTarget,n=e?.getAttribute("data-ghost-search")?.trim()||"";o(n)}r(!0);const e=document.createElement("input");e.style.opacity="0",e.style.position="fixed",e.style.top="0",document.body.appendChild(e),e.focus(),setTimeout(()=>{u?.current?.focus(),document.body.removeChild(e)},150)};return d.forEach(e=>e.addEventListener("click",t)),()=>d.forEach(e=>e.removeEventListener("click",t))},[d]),et(()=>{const t=()=>{const[t]=window.location.hash.substring(1).split("?");"/search"!==t&&"/search/"!==t||(r(!0),window.history.replaceState("",document.title,window.location.pathname))};return t(),window.addEventListener("hashchange",t,!1),()=>window.removeEventListener("hashchange",t,!1)},[]),et(()=>{if(!d?.length)return;const t=t=>{if("k"===t.key&&t.metaKey)return r(!0),t.preventDefault(),t.stopPropagation(),!1};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[d]),et(()=>(document.body.classList.toggle("has-modal",i),i||(f.current=null,h(""),o(""),c(t=>t.map(t=>({...t,status:"completed"!==t.status?"initial":t.status,retries:0})))),()=>document.body.classList.toggle("has-modal",!1)),[i]);const g=a.find(t=>t.filter===s);if(!g)return null;const _={showPopup:i,setShowPopup:r,searchValue:l,setSearchValue:h,filter:s,searchIndex:g.index,indexStatus:g.status,t:t=>window.Spiritix?.t?.[t]||t,inputRef:u};return y(dt.Provider,{value:_},"\n ",y(jt,null),"\n ")}function mn(t){if(t=t?.replace("_","-"),!t||t.indexOf("-")<0)return t;return function(t){if("string"==typeof t&&t.indexOf("-")>-1){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(t){}return e||t}return t}(t.split("-")[0])}function yn(){const t=document.documentElement.getAttribute("data-sx-content-api-url")?.replace(/\/+$/,""),e=document.documentElement.getAttribute("data-sx-content-api-key"),n=document.documentElement.getAttribute("lang")||"en",i=function(t){try{if(Intl?.Locale){const e=new Intl.Locale(t),n=e?.getTextInfo?.();if(n?.direction)return n.direction}}catch(t){}return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(mn(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}(n)||"ltr";return{contentApiUrl:t,contentApiKey:e,locale:n,dir:i}}!function(){const{contentApiUrl:n,contentApiKey:i,dir:r}=yn(),s=function(){const t=document.createElement("div");return t.id="sx-search-root",document.body.appendChild(t),t}();if(!n||!i)throw Error("Spritix Search: Content API key or URL not found!");!function(n,i){var r,s,o;i==document&&(i=document.documentElement),e.__&&e.__(n,i),r=i.__k,s=[],o=[],M(i,n=i.__k=y(w,null,[n]),r||f,f,i.namespaceURI,r?null:i.firstChild?t.call(i.childNodes):null,s,r?r.__e:i.firstChild,!1,o),D(s,n,o)}(y(_n,{contentApiUrl:n,contentApiKey:i,dir:r}),s)}();