text: /*! SearchinGhost v1.6.2 (https://github.com/gmfmi/searchinGhost#readme) license MIT */
  var SearchinGhost=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i,o;!function(n,i,o){var a;(a=o.define)&&a.amd?a([],(function(){return i})):(a=o.modules)?a[n.toLowerCase()]=i:"object"===r(e)?t.exports=i:o[n]=i}("FlexSearch",function t(e){function n(t,e){var n=e?e.id:t&&t.id;this.id=n||0===n?n:A++,this.init(t,e),s(this,"index",(function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)})),s(this,"length",(function(){return this.index.length}))}function i(t,e,n,r){return this.u!==this.g&&(this.o=this.o.concat(n),this.u++,r&&this.o.length>=r&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(e,this.o),this.F&&this.F(this.o))),this}function o(t,e){for(var n=t.length,r=w(e),i=[],o=0,a=0;o<n;o++){var s=t[o];(r&&e(s)||!r&&!e[s])&&(i[a++]=s)}return i}function a(t,e,n,r,i,o,a,s,c,u){var f;if(n=y(n,a?0:i,s,o,e,c,u),s&&(s=n.page,f=n.next,n=n.result),a)e=this.where(a,null,i,n);else{for(e=n,n=this.l,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=n[e[a]];e=o}return n=e,r&&(w(r)||(1<(j=r.split(":")).length?r=v:(j=j[0],r=p)),n.sort(r)),n=g(s,f,n),this.cache&&this.j.set(t,n),n}function s(t,e,n){Object.defineProperty(t,e,{get:n})}function c(t){return new RegExp(t,"g")}function u(t,e){for(var n=0;n<e.length;n+=2)t=t.replace(e[n],e[n+1]);return t}function f(t,e,n,r,i,o,a,s){return e[n]?e[n]:(i=i?(s-(a||s/1.5))*o+(a||s/1.5)*i:o,e[n]=i,i>=a&&((t=(t=t[s-(i+.5>>0)])[n]||(t[n]=[]))[t.length]=r),i)}function h(t,e){if(t)for(var n=Object.keys(t),r=0,i=n.length;r<i;r++){var o=n[r],a=t[o];if(a)for(var s=0,c=a.length;s<c;s++){if(a[s]===e){1===c?delete t[o]:a.splice(s,1);break}_(a[s])&&h(a[s],e)}}}function l(t){for(var e="",n="",r="",i=0;i<t.length;i++){var o=t[i];o!==n&&(i&&"h"===o?(r="a"===r||"e"===r||"i"===r||"o"===r||"u"===r||"y"===r,(("a"===n||"e"===n||"i"===n||"o"===n||"u"===n||"y"===n)&&r||" "===n)&&(e+=o)):e+=o),r=i===t.length-1?"":t[i+1],n=o}return e}function d(t,e){return 0>(t=t.length-e.length)?1:t?-1:0}function p(t,e){return(t=t[j])<(e=e[j])?-1:t>e?1:0}function v(t,e){for(var n=j.length,r=0;r<n;r++)t=t[j[r]],e=e[j[r]];return t<e?-1:t>e?1:0}function g(t,e,n){return t?{page:t,next:e?""+e:null,result:n}:n}function y(t,e,n,r,i,o,a){var s,c=[];if(!0===n){n="0";var u=""}else u=n&&n.split(":");var f=t.length;if(1<f){var h,l,d,p,v,y,m,w,_,x,k=I(),E=[],j=0,O=!0,N=0;if(u&&(2===u.length?(w=u,u=!1):u=_=parseInt(u[0],10)),a){for(h=I();j<f;j++)if("not"===i[j])for(p=(l=t[j]).length,d=0;d<p;d++)h["@"+l[d]]=1;else m=j+1;if(S(m))return g(n,s,c);j=0}else y=b(i)&&i;for(;j<f;j++){var R=j===(m||f)-1;if(!y||!j)if((d=y||i&&i[j])&&"and"!==d){if("or"!==d)continue;x=!1}else x=o=!0;if(p=(l=t[j]).length){if(O){if(!v){v=l;continue}var A=v.length;for(d=0;d<A;d++){var D="@"+(O=v[d]);a&&h[D]||(k[D]=1,o||(c[N++]=O))}v=null,O=!1}for(D=!1,d=0;d<p;d++){var C="@"+(A=l[d]),B=o?k[C]||0:j;if(!(!B&&!r||a&&h[C]||!o&&k[C]))if(B===j){if(R){if((!_||--_<N)&&(c[N++]=A,e&&N===e))return g(n,N+(u||0),c)}else k[C]=j+1;D=!0}else r&&((C=E[B]||(E[B]=[]))[C.length]=A)}if(x&&!D&&!r)break}else if(x&&!r)return g(n,s,l)}if(v)if(j=v.length,a)for(d=u?parseInt(u,10):0;d<j;d++)h["@"+(t=v[d])]||(c[N++]=t);else c=v;if(r)for(N=c.length,w?(j=parseInt(w[0],10)+1,d=parseInt(w[1],10)+1):(j=E.length,d=0);j--;)if(A=E[j]){for(p=A.length;d<p;d++)if(r=A[d],(!a||!h["@"+r])&&(c[N++]=r,e&&N===e))return g(n,j+":"+d,c);d=0}}else!f||i&&"not"===i[0]||(c=t[0],u&&(u=parseInt(u[0],10)));return e&&(a=c.length,u&&u>a&&(u=0),(s=(u=u||0)+e)<a?c=c.slice(u,s):(s=0,u&&(c=c.slice(u)))),g(n,s,c)}function b(t){return"string"==typeof t}function m(t){return t.constructor===Array}function w(t){return"function"==typeof t}function _(t){return"object"===r(t)}function S(t){return void 0===t}function x(t){for(var e=Array(t),n=0;n<t;n++)e[n]=I();return e}function I(){return Object.create(null)}function k(){var t,e;self.onmessage=function(n){if(n=n.data)if(n.search){var r=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:r})}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(e=new Function(n.register.substring(n.register.indexOf("{")+1,n.register.lastIndexOf("}")))())(n.options))}}function E(n,r,i,o){n=e("flexsearch","id"+n,k,(function(t){(t=t.data)&&t.result&&o(t.id,t.content,t.result,t.limit,t.where,t.cursor,t.suggest)}),r);var a=t.toString();return i.id=r,n.postMessage({register:a,options:i,id:r}),n}var j,O={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},N={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}},R=[],A=0,D={},C={};n.create=function(t,e){return new n(t,e)},n.registerMatcher=function(t){for(var e in t)t.hasOwnProperty(e)&&R.push(c(e),t[e]);return this},n.registerEncoder=function(t,e){return M[t]=e.bind(M),this},n.registerLanguage=function(t,e){return D[t]=e.filter,C[t]=e.stemmer,this},n.encode=function(t,e){return M[t](e)},n.prototype.init=function(t,e){if(this.v=[],e){var r=e.preset;t=e}else t||(t=O),r=t.preset;if(e={},b(t)?(e=N[t],t={}):r&&(e=N[r]),r=t.worker)if("undefined"==typeof Worker)t.worker=!1,this.m=null;else{var o=parseInt(r,10)||4;this.C=-1,this.u=0,this.o=[],this.F=null,this.m=Array(o);for(var a=0;a<o;a++)this.m[a]=E(this.id,a,t,i.bind(this))}if(this.f=t.tokenize||e.f||this.f||O.f,this.split=S(r=t.split)?this.split||O.split:b(r)?c(r):r,this.D=t.rtl||this.D||O.D,this.async="undefined"==typeof Promise||S(r=t.async)?this.async||O.async:r,this.g=S(r=t.worker)?this.g||O.g:r,this.threshold=S(r=t.threshold)?e.threshold||this.threshold||O.threshold:r,this.b=S(r=t.resolution)?r=e.b||this.b||O.b:r,r<=this.threshold&&(this.b=this.threshold+1),this.depth="strict"!==this.f||S(r=t.depth)?e.depth||this.depth||O.depth:r,this.w=(r=S(r=t.encode)?e.encode||O.encode:r)&&M[r]&&M[r].bind(M)||(w(r)?r:this.w||!1),(r=t.matcher)&&this.addMatcher(r),r=(e=t.lang)||t.filter){if(b(r)&&(r=D[r]),m(r)){o=this.w,a=I();for(var s=0;s<r.length;s++){var u=o?o(r[s]):r[s];a[u]=1}r=a}this.filter=r}if(r=e||t.stemmer){var f;for(f in e=b(r)?C[r]:r,o=this.w,a=[],e)e.hasOwnProperty(f)&&(s=o?o(f):f,a.push(c(s+"($|\\W)"),o?o(e[f]):e[f]));this.stemmer=f=a}if(this.a=a=(r=t.doc)?function t(e){var n=I();for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];m(i)?n[r]=i.slice(0):_(i)?n[r]=t(i):n[r]=i}return n}(r):this.a||O.a,this.i=x(this.b-(this.threshold||0)),this.h=I(),this.c=I(),a){if(this.l=I(),t.doc=null,f=a.index={},e=a.keys=[],o=a.field,s=a.tag,u=a.store,m(a.id)||(a.id=a.id.split(":")),u){var h=I();if(b(u))h[u]=1;else if(m(u))for(var l=0;l<u.length;l++)h[u[l]]=1;else _(u)&&(h=u);a.store=h}if(s){if(this.G=I(),u=I(),o)if(b(o))u[o]=t;else if(m(o))for(h=0;h<o.length;h++)u[o[h]]=t;else _(o)&&(u=o);for(m(s)||(a.tag=s=[s]),o=0;o<s.length;o++)this.G[s[o]]=I();this.I=s,o=u}var d;if(o)for(m(o)||(_(o)?(d=o,a.field=o=Object.keys(o)):a.field=o=[o]),a=0;a<o.length;a++)m(s=o[a])||(d&&(t=d[s]),e[a]=s,o[a]=s.split(":")),f[s]=new n(t);t.doc=r}return this.B=!0,this.j=!!(this.cache=r=S(r=t.cache)?this.cache||O.cache:r)&&new U(r),this},n.prototype.encode=function(t){return t&&(R.length&&(t=u(t,R)),this.v.length&&(t=u(t,this.v)),this.w&&(t=this.w(t)),this.stemmer&&(t=u(t,this.stemmer))),t},n.prototype.addMatcher=function(t){var e=this.v;for(var n in t)t.hasOwnProperty(n)&&e.push(c(n),t[n]);return this},n.prototype.add=function(t,e,n,r,i){if(this.a&&_(t))return this.A("add",t,e);if(e&&b(e)&&(t||0===t)){var a="@"+t;if(this.c[a]&&!r)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[a]=""+this.C,n&&n(),this;if(!i){if(this.async&&"function"!=typeof importScripts){var s=this;return a=new Promise((function(n){setTimeout((function(){s.add(t,e,null,r,!0),s=null,n()}))})),n?(a.then(n),this):a}if(n)return this.add(t,e,null,r,!0),n(),this}if(!(e=this.encode(e)).length)return this;i=w(n=this.f)?n(e):e.split(this.split),this.filter&&(i=o(i,this.filter));var c=I();c._ctx=I();for(var u=i.length,h=this.threshold,l=this.depth,d=this.b,p=this.i,v=this.D,g=0;g<u;g++){var y=i[g];if(y){var m=y.length,S=(v?g+1:u-g)/u,k="";switch(n){case"reverse":case"both":for(var E=m;--E;)f(p,c,k=y[E]+k,t,v?1:(m-E)/m,S,h,d-1);k="";case"forward":for(E=0;E<m;E++)f(p,c,k+=y[E],t,v?(E+1)/m:1,S,h,d-1);break;case"full":for(E=0;E<m;E++)for(var j=(v?E+1:m-E)/m,O=m;O>E;O--)f(p,c,k=y.substring(E,O),t,j,S,h,d-1);break;default:if(m=f(p,c,y,t,1,S,h,d-1),l&&1<u&&m>=h)for(m=c._ctx[y]||(c._ctx[y]=I()),y=this.h[y]||(this.h[y]=x(d-(h||0))),0>(S=g-l)&&(S=0),(k=g+l+1)>u&&(k=u);S<k;S++)S!==g&&f(y,m,i[S],t,0,d-(S<g?g-S:S-g),h,d-1)}}}this.c[a]=1,this.B=!1}return this},n.prototype.A=function(t,e,n){if(m(e)){var r=e.length;if(r--){for(var i=0;i<r;i++)this.A(t,e[i]);return this.A(t,e[r],n)}}else{var o,a=this.a.index,s=this.a.keys,c=this.a.tag;i=this.a.store;var u=this.a.id;r=e;for(var f=0;f<u.length;f++)r=r[u[f]];if("remove"===t&&(delete this.l[r],u=s.length,u--)){for(e=0;e<u;e++)a[s[e]].remove(r);return a[s[u]].remove(r,n)}if(c){for(o=0;o<c.length;o++){var h=c[o],l=e;for(u=h.split(":"),f=0;f<u.length;f++)l=l[u[f]];l="@"+l}o=(o=this.G[h])[l]||(o[l]=[])}for(var d=0,p=(u=this.a.field).length;d<p;d++){for(h=u[d],c=e,l=0;l<h.length;l++)c=c[h[l]];h=a[s[d]],l="add"===t?h.add:h.update,d===p-1?l.call(h,r,c,n):l.call(h,r,c)}if(i){for(n=Object.keys(i),t=I(),a=0;a<n.length;a++)if(i[s=n[a]]){s=s.split(":");var v=void 0,g=void 0;for(u=0;u<s.length;u++)v=(v||e)[c=s[u]],g=(g||t)[c]=v}e=t}o&&(o[o.length]=e),this.l[r]=e}return this},n.prototype.update=function(t,e,n){return this.a&&_(t)?this.A("update",t,e):(this.c["@"+t]&&b(e)&&(this.remove(t),this.add(t,e,n,!0)),this)},n.prototype.remove=function(t,e,n){if(this.a&&_(t))return this.A("remove",t,e);var r="@"+t;if(this.c[r]){if(this.g)return this.m[this.c[r]].postMessage({remove:!0,id:t}),delete this.c[r],e&&e(),this;if(!n){if(this.async&&"function"!=typeof importScripts){var i=this;return r=new Promise((function(e){setTimeout((function(){i.remove(t,null,!0),i=null,e()}))})),e?(r.then(e),this):r}if(e)return this.remove(t,null,!0),e(),this}for(e=0;e<this.b-(this.threshold||0);e++)h(this.i[e],t);this.depth&&h(this.h,t),delete this.c[r],this.B=!1}return this},n.prototype.search=function(t,e,n,r){if(_(e)){if(m(e))for(var i=0;i<e.length;i++)e[i].query=t;else e.query=t;t=e,e=1e3}else e&&w(e)?(n=e,e=1e3):e||0===e||(e=1e3);if(!this.g){var s=[],c=t;if(_(t)&&!m(t)){n||(n=t.callback)&&(c.callback=null);var u=t.sort,f=t.page;e=t.limit,M=t.threshold;var h=t.suggest;t=t.query}if(this.a){M=this.a.index;var l,p,v=c.where,g=c.bool||"or",S=c.field,x=g;if(S)m(S)||(S=[S]);else if(m(c)){var k=c;S=[],x=[];for(var E=0;E<c.length;E++)i=(r=c[E]).bool||g,S[E]=r.field,x[E]=i,"not"===i?l=!0:"and"===i&&(p=!0)}else S=this.a.keys;for(g=S.length,E=0;E<g;E++)k&&(c=k[E]),f&&!b(c)&&(c.page=null,c.limit=0),s[E]=M[S[E]].search(c,0);if(n)return n(a.call(this,t,x,s,u,e,h,v,f,p,l));if(this.async){var j=this;return new Promise((function(n){Promise.all(s).then((function(r){n(a.call(j,t,x,r,u,e,h,v,f,p,l))}))}))}return a.call(this,t,x,s,u,e,h,v,f,p,l)}if(M||(M=this.threshold||0),!r){if(this.async&&"function"!=typeof importScripts){var O=this;return M=new Promise((function(t){setTimeout((function(){t(O.search(c,e,null,!0)),O=null}))})),n?(M.then(n),this):M}if(n)return n(this.search(c,e,null,!0)),this}if(!t||!b(t))return s;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 s;n=w(n=this.f)?n(c):c.split(this.split),this.filter&&(n=o(n,this.filter)),k=n.length,r=!0,i=[];var N=I(),R=0;if(1<k&&(this.depth&&"strict"===this.f?g=!0:n.sort(d)),!g||(E=this.h))for(var A=this.b;R<k;R++){var D=n[R];if(D){if(g){if(!S)if(E[D])S=D,N[D]=1;else if(!h)return s;if(h&&R===k-1&&!i.length)g=!1,N[D=S||D]=0;else if(!S)continue}if(!N[D]){var C=[],B=!1,L=0,F=g?E[S]:this.i;if(F)for(var T=void 0,P=0;P<A-M;P++)(T=F[P]&&F[P][D])&&(C[L++]=T,B=!0);if(B)S=D,i[i.length]=1<L?C.concat.apply([],C):C[0];else if(!h){r=!1;break}N[D]=1}}}else r=!1;return r&&(s=y(i,e,f,h)),this.cache&&this.j.set(t,s),s}this.F=n,this.u=0,this.o=[];for(var M=0;M<this.g;M++)this.m[M].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,r){var i,o,a,s=this.l,c=[],u=0;if(_(t)){n||(n=e);var f=Object.keys(t),h=f.length;if(i=!1,1===h&&"id"===f[0])return[s[t.id]];if((o=this.I)&&!r)for(var l=0;l<o.length;l++){var d=o[l],p=t[d];if(!S(p)){if(a=this.G[d]["@"+p],0==--h)return a;f.splice(f.indexOf(d),1),delete t[d];break}}for(o=Array(h),l=0;l<h;l++)o[l]=f[l].split(":")}else{if(w(t)){for(n=(e=r||Object.keys(s)).length,f=0;f<n;f++)t(h=s[e[f]])&&(c[u++]=h);return c}if(S(e))return[s[t]];if("id"===t)return[s[e]];f=[t],h=1,o=[t.split(":")],i=!0}for(l=(r=a||r||Object.keys(s)).length,d=0;d<l;d++){p=a?r[d]:s[r[d]];for(var v=!0,g=0;g<h;g++){i||(e=t[f[g]]);var y=o[g],b=y.length,m=p;if(1<b)for(var x=0;x<b;x++)m=m[y[x]];else m=m[y[0]];if(m!==e){v=!1;break}}if(v&&(c[u++]=p,n&&u===n))break}return c},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:R.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(var 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){for(var t=this.a.keys,e=0;e<t.length;e++)this.a.index[t[e]].destroy();this.a=this.l=null}return this},n.prototype.export=function(t){var e=!t||S(t.serialize)||t.serialize;if(this.a){var n=!t||S(t.doc)||t.doc,r=!t||S(t.index)||t.index;t=[];var i=0;if(r)for(r=this.a.keys;i<r.length;i++){var o=this.a.index[r[i]];t[i]=[o.i,o.h,Object.keys(o.c)]}n&&(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||S(e.serialize)||e.serialize)&&(t=JSON.parse(t));var n=I();if(this.a){var r=!e||S(e.doc)||e.doc,i=0;if(!e||S(e.index)||e.index){for(var o=(e=this.a.keys).length,a=t[0][2];i<a.length;i++)n[a[i]]=1;for(i=0;i<o;i++){a=this.a.index[e[i]];var s=t[i];s&&(a.i=s[0],a.h=s[1],a.c=n)}}r&&(this.l=_(r)?r:t[i])}else{for(r=t[2],i=0;i<r.length;i++)n[r[i]]=1;this.i=t[0],this.h=t[1],this.c=n}};var B,L,F,T,P=(L=c("\\s+"),F=c("[^a-z0-9 ]"),T=[c("[-/]")," ",F,"",L," "],function(t){return l(u(t.toLowerCase(),T))}),M={icase:function(t){return t.toLowerCase()},simple:function(){var t=c("\\s+"),e=c("[^a-z0-9 ]"),n=c("[-/]"),r=[c("[àáâãäå]"),"a",c("[èéêë]"),"e",c("[ìíîï]"),"i",c("[òóôõöő]"),"o",c("[ùúûüű]"),"u",c("[ýŷÿ]"),"y",c("ñ"),"n",c("[çc]"),"k",c("ß"),"s",c(" & ")," and ",n," ",e,"",t," "];return function(t){return" "===(t=u(t.toLowerCase(),r))?"":t}}(),advanced:function(){var t=c("ae"),e=c("ai"),n=c("ay"),r=c("ey"),i=c("oe"),o=c("ue"),a=c("ie"),s=c("sz"),f=c("zs"),h=c("ck"),d=c("cc"),p=[t,"a",e,"ei",n,"ei",r,"ei",i,"o",o,"u",a,"i",s,"s",f,"s",c("sh"),"s",h,"k",d,"k",c("th"),"t",c("dt"),"t",c("ph"),"f",c("pf"),"f",c("ou"),"o",c("uo"),"u"];return function(t,e){return t?(2<(t=this.simple(t)).length&&(t=u(t,p)),e||1<t.length&&(t=l(t)),t):t}}(),extra:(B=[c("p"),"b",c("z"),"s",c("[cgq]"),"k",c("n"),"m",c("d"),"t",c("[vw]"),"f",c("[aeiouy]"),""],function(t){if(!t)return t;if(1<(t=this.advanced(t,!0)).length){t=t.split(" ");for(var e=0;e<t.length;e++){var n=t[e];1<n.length&&(t[e]=n[0]+u(n.substring(1),B))}t=l(t=t.join(" "))}return t}),balance:P},U=function(){function t(t){this.clear(),this.H=!0!==t&&t}return t.prototype.clear=function(){this.cache=I(),this.count=I(),this.index=I(),this.s=[]},t.prototype.set=function(t,e){if(this.H&&S(this.cache[t])){var n=this.s.length;if(n===this.H){n--;var r=this.s[n];delete this.cache[r],delete this.count[r],delete this.index[r]}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){var e=this.cache[t];if(this.H&&e){var n=++this.count[t],r=this.index,i=r[t];if(0<i){for(var o=this.s,a=i;this.count[o[--i]]<=n&&-1!==i;);if(++i!==a){for(n=a;n>i;n--)a=o[n-1],o[n]=a,r[a]=n;o[i]=t,r[t]=i}}}return e},t}();return n}((i={},o="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL,function(t,e,n,r,a){return n=o?URL.createObjectURL(new Blob(["("+n.toString()+")()"],{type:"text/javascript"})):t+".min.js",i[t+="-"+e]||(i[t]=[]),i[t][a]=new Worker(n),i[t][a].onmessage=r,i[t][a]})),this)},function(t,e,n){(function(n){var r,i,o,a;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
  /*!
      localForage -- Offline Storage, Improved
      Version 1.9.0
      https://localforage.github.io/localForage
      (c) 2013-2017 Mozilla, Apache License 2.0
  */a=function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,(function(t){var n=e[a][1][t];return i(n||t)}),u,u.exports,t,e,n,r)}return n[a].exports}for(var o=!1,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,r){(function(t){"use strict";var n,r,i=t.MutationObserver||t.WebKitMutationObserver;if(i){var o=0,a=new i(f),s=t.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){f(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(f,0)};else{var c=new t.MessageChannel;c.port1.onmessage=f,n=function(){c.port2.postMessage(0)}}var u=[];function f(){var t,e;r=!0;for(var n=u.length;n;){for(e=u,u=[],t=-1;++t<n;)e[t]();n=u.length}r=!1}e.exports=function(t){1!==u.push(t)||r||n()}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){"use strict";var r=t(1);function i(){}var o={},a=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&p(this,t)}function h(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){r((function(){var r;try{r=e(n)}catch(e){return o.reject(t,e)}r===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,r)}))}function d(t){var e=t&&t.then;if(t&&("object"===s(t)||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var n=!1;function r(e){n||(n=!0,o.reject(t,e))}function i(e){n||(n=!0,o.resolve(t,e))}var a=v((function(){e(i,r)}));"error"===a.status&&r(a.value)}function v(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}e.exports=f,f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===c||"function"!=typeof e&&this.state===a)return this;var n=new this.constructor(i);return this.state!==u?l(n,this.state===c?t:e,this.outcome):this.queue.push(new h(n,t,e)),n},h.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){o.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=v(d,e);if("error"===n.status)return o.reject(t,n.value);var r=n.value;if(r)p(t,r);else{t.state=c,t.outcome=e;for(var i=-1,a=t.queue.length;++i<a;)t.queue[i].callFulfilled(e)}return t},o.reject=function(t,e){t.state=a,t.outcome=e;for(var n=-1,r=t.queue.length;++n<r;)t.queue[n].callRejected(e);return t},f.resolve=function(t){return t instanceof this?t:o.resolve(new this(i),t)},f.reject=function(t){var e=new this(i);return o.reject(e,t)},f.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,u=new this(i);++c<n;)f(t[c],c);return u;function f(t,i){e.resolve(t).then((function(t){a[i]=t,++s!==n||r||(r=!0,o.resolve(u,a))}),(function(t){r||(r=!0,o.reject(u,t))}))}},f.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,r=!1;if(!n)return this.resolve([]);for(var a,s=-1,c=new this(i);++s<n;)a=t[s],e.resolve(a).then((function(t){r||(r=!0,o.resolve(c,t))}),(function(t){r||(r=!0,o.reject(c,t))}));return c}},{1:1}],3:[function(t,e,r){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":s(t)},i=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}();function o(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<t.length;r+=1)n.append(t[r]);return n.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var a=Promise;function c(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function u(t,e,n){"function"==typeof e&&t.then(e),"function"==typeof n&&t.catch(n)}function f(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l=void 0,d={},p=Object.prototype.toString;function v(t){return"boolean"==typeof l?a.resolve(l):function(t){return new a((function(e){var n=t.transaction("local-forage-detect-blob-support","readwrite"),r=o([""]);n.objectStore("local-forage-detect-blob-support").put(r,"key"),n.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},n.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);e(n||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}(t).then((function(t){return l=t}))}function g(t){var e=d[t.name],n={};n.promise=new a((function(t,e){n.resolve=t,n.reject=e})),e.deferredOperations.push(n),e.dbReady?e.dbReady=e.dbReady.then((function(){return n.promise})):e.dbReady=n.promise}function y(t){var e=d[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function b(t,e){var n=d[t.name].deferredOperations.pop();if(n)return n.reject(e),n.promise}function m(t,e){return new a((function(n,r){if(d[t.name]=d[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return n(t.db);g(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var a=i.open.apply(i,o);e&&(a.onupgradeneeded=function(e){var n=a.result;try{n.createObjectStore(t.storeName),e.oldVersion<=1&&n.createObjectStore("local-forage-detect-blob-support")}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),a.onerror=function(t){t.preventDefault(),r(a.error)},a.onsuccess=function(){n(a.result),y(t)}}))}function w(t){return m(t,!1)}function _(t){return m(t,!0)}function S(t,e){if(!t.db)return!0;var n=!t.db.objectStoreNames.contains(t.storeName),r=t.version<t.db.version,i=t.version>t.db.version;if(r&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),i||n){if(n){var o=t.db.version+1;o>t.version&&(t.version=o)}return!0}return!1}function x(t){return o([function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n),i=0;i<e;i++)r[i]=t.charCodeAt(i);return n}(atob(t.data))],{type:t.type})}function I(t){return t&&t.__local_forage_encoded_blob}function k(t){var e=this,n=e._initReady().then((function(){var t=d[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return u(n,t,t),n}function E(t,e,n,r){void 0===r&&(r=1);try{var i=t.db.transaction(t.storeName,e);n(null,i)}catch(i){if(r>0&&(!t.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!t.db||"NotFoundError"===i.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),_(t)})).then((function(){return function(t){g(t);for(var e=d[t.name],n=e.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return t.db=null,w(t).then((function(e){return t.db=e,S(t)?_(t):e})).then((function(r){t.db=e.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(e){throw b(t,e),e}))}(t).then((function(){E(t,e,n,r-1)}))})).catch(n);n(i)}}var j={_driver:"asyncStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]=t[r];var i=d[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},d[n.name]=i),i.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=k);var o=[];function s(){return a.resolve()}for(var c=0;c<i.forages.length;c++){var u=i.forages[c];u!==e&&o.push(u._initReady().catch(s))}var f=i.forages.slice(0);return a.all(o).then((function(){return n.db=i.db,w(n)})).then((function(t){return n.db=t,S(n,e._defaultConfig.version)?_(n):t})).then((function(t){n.db=i.db=t,e._dbInfo=n;for(var r=0;r<f.length;r++){var o=f[r];o!==e&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=new a((function(e,r){n.ready().then((function(){E(n._dbInfo,"readonly",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var n=a.result;if(n){var r=n.value;I(r)&&(r=x(r));var i=t(r,n.key,s++);void 0!==i?e(i):n.continue()}else e()},a.onerror=function(){r(a.error)}}catch(t){r(t)}}))})).catch(r)}));return c(r,e),r},getItem:function(t,e){var n=this;t=f(t);var r=new a((function(e,r){n.ready().then((function(){E(n._dbInfo,"readonly",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),I(t)&&(t=x(t)),e(t)},a.onerror=function(){r(a.error)}}catch(t){r(t)}}))})).catch(r)}));return c(r,e),r},setItem:function(t,e,n){var r=this;t=f(t);var i=new a((function(n,i){var o;r.ready().then((function(){return o=r._dbInfo,"[object Blob]"===p.call(e)?v(o.db).then((function(t){return t?e:(n=e,new a((function(t,e){var r=new FileReader;r.onerror=e,r.onloadend=function(e){var r=btoa(e.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):e})).then((function(e){E(r._dbInfo,"readwrite",(function(o,a){if(o)return i(o);try{var s=a.objectStore(r._dbInfo.storeName);null===e&&(e=void 0);var c=s.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),n(e)},a.onabort=a.onerror=function(){var t=c.error?c.error:c.transaction.error;i(t)}}catch(t){i(t)}}))})).catch(i)}));return c(i,n),i},removeItem:function(t,e){var n=this;t=f(t);var r=new a((function(e,r){n.ready().then((function(){E(n._dbInfo,"readwrite",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName).delete(t);o.oncomplete=function(){e()},o.onerror=function(){r(a.error)},o.onabort=function(){var t=a.error?a.error:a.transaction.error;r(t)}}catch(t){r(t)}}))})).catch(r)}));return c(r,e),r},clear:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){E(e._dbInfo,"readwrite",(function(r,i){if(r)return n(r);try{var o=i.objectStore(e._dbInfo.storeName).clear();i.oncomplete=function(){t()},i.onabort=i.onerror=function(){var t=o.error?o.error:o.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return c(n,t),n},length:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){E(e._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(e._dbInfo.storeName).count();o.onsuccess=function(){t(o.result)},o.onerror=function(){n(o.error)}}catch(t){n(t)}}))})).catch(n)}));return c(n,t),n},key:function(t,e){var n=this,r=new a((function(e,r){t<0?e(null):n.ready().then((function(){E(n._dbInfo,"readonly",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===t||s?e(n.key):(s=!0,n.advance(t)):e(null)},c.onerror=function(){r(c.error)}}catch(t){r(t)}}))})).catch(r)}));return c(r,e),r},keys:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){E(e._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];o.onsuccess=function(){var e=o.result;e?(a.push(e.key),e.continue()):t(a)},o.onerror=function(){n(o.error)}}catch(t){n(t)}}))})).catch(n)}));return c(n,t),n},dropInstance:function(t,e){e=h.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,o=this;if(t.name){var s=t.name===n.name&&o._dbInfo.db,u=s?a.resolve(o._dbInfo.db):w(t).then((function(e){var n=d[t.name],r=n.forages;n.db=e;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=e;return e}));r=t.storeName?u.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var n=e.version+1;g(t);var r=d[t.name],o=r.forages;e.close();for(var s=0;s<o.length;s++){var c=o[s];c._dbInfo.db=null,c._dbInfo.version=n}return new a((function(e,r){var o=i.open(t.name,n);o.onerror=function(t){o.result.close(),r(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}})).then((function(t){r.db=t;for(var e=0;e<o.length;e++){var n=o[e];n._dbInfo.db=t,y(n._dbInfo)}})).catch((function(e){throw(b(t,e)||a.resolve()).catch((function(){})),e}))}})):u.then((function(e){g(t);var n=d[t.name],r=n.forages;e.close();for(var o=0;o<r.length;o++)r[o]._dbInfo.db=null;return new a((function(e,n){var r=i.deleteDatabase(t.name);r.onerror=r.onblocked=function(t){var e=r.result;e&&e.close(),n(t)},r.onsuccess=function(){var t=r.result;t&&t.close(),e(t)}})).then((function(t){n.db=t;for(var e=0;e<r.length;e++)y(r[e]._dbInfo)})).catch((function(e){throw(b(t,e)||a.resolve()).catch((function(){})),e}))}))}else r=a.reject("Invalid arguments");return c(r,e),r}},O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=/^~~local_forage_type~([^~]+)~/,R="__lfsc__:".length,A=R+"arbf".length,D=Object.prototype.toString;function C(t){var e,n,r,i,o,a=.75*t.length,s=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var u=new ArrayBuffer(a),f=new Uint8Array(u);for(e=0;e<s;e+=4)n=O.indexOf(t[e]),r=O.indexOf(t[e+1]),i=O.indexOf(t[e+2]),o=O.indexOf(t[e+3]),f[c++]=n<<2|r>>4,f[c++]=(15&r)<<4|i>>2,f[c++]=(3&i)<<6|63&o;return u}function B(t){var e,n=new Uint8Array(t),r="";for(e=0;e<n.length;e+=3)r+=O[n[e]>>2],r+=O[(3&n[e])<<4|n[e+1]>>4],r+=O[(15&n[e+1])<<2|n[e+2]>>6],r+=O[63&n[e+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var L={serialize:function(t,e){var n="";if(t&&(n=D.call(t)),t&&("[object ArrayBuffer]"===n||t.buffer&&"[object ArrayBuffer]"===D.call(t.buffer))){var r,i="__lfsc__:";t instanceof ArrayBuffer?(r=t,i+="arbf"):(r=t.buffer,"[object Int8Array]"===n?i+="si08":"[object Uint8Array]"===n?i+="ui08":"[object Uint8ClampedArray]"===n?i+="uic8":"[object Int16Array]"===n?i+="si16":"[object Uint16Array]"===n?i+="ur16":"[object Int32Array]"===n?i+="si32":"[object Uint32Array]"===n?i+="ui32":"[object Float32Array]"===n?i+="fl32":"[object Float64Array]"===n?i+="fl64":e(new Error("Failed to get type for BinaryArray"))),e(i+B(r))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+t.type+"~"+B(this.result);e("__lfsc__:blob"+n)},o.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(n){console.error("Couldn't convert value into a JSON string: ",t),e(null,n)}},deserialize:function(t){if("__lfsc__:"!==t.substring(0,R))return JSON.parse(t);var e,n=t.substring(A),r=t.substring(R,A);if("blob"===r&&N.test(n)){var i=n.match(N);e=i[1],n=n.substring(i[0].length)}var a=C(n);switch(r){case"arbf":return a;case"blob":return o([a],{type:e});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:C,bufferToString:B};function F(t,e,n,r){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function T(t,e,n,r,i,o){t.executeSql(n,r,i,(function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,s){s.rows.length?o(t,a):F(t,e,(function(){t.executeSql(n,r,i,o)}),o)}),o):o(t,a)}),o)}function P(t,e,n,r){var i=this;t=f(t);var o=new a((function(o,a){i.ready().then((function(){void 0===e&&(e=null);var s=e,c=i._dbInfo;c.serializer.serialize(e,(function(e,u){u?a(u):c.db.transaction((function(n){T(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){o(s)}),(function(t,e){a(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(r>0)return void o(P.apply(i,[t,s,n,r-1]));a(e)}}))}))})).catch(a)}));return c(o,n),o}function M(t){return new a((function(e,n){t.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],o=0;o<r.rows.length;o++)i.push(r.rows.item(o).name);e({db:t,storeNames:i})}),(function(t,e){n(e)}))}),(function(t){n(t)}))}))}var U={_driver:"webSQLStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var r in t)n[r]="string"!=typeof t[r]?t[r].toString():t[r];var i=new a((function(t,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(t){return r(t)}n.db.transaction((function(i){F(i,n,(function(){e._dbInfo=n,t()}),(function(t,e){r(e)}))}),r)}));return n.serializer=L,i},_support:"function"==typeof openDatabase,iterate:function(t,e){var n=this,r=new a((function(e,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){T(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var o=r.rows,a=o.length,s=0;s<a;s++){var c=o.item(s),u=c.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=t(u,c.key,s+1)))return void e(u)}e()}),(function(t,e){r(e)}))}))})).catch(r)}));return c(r,e),r},getItem:function(t,e){var n=this;t=f(t);var r=new a((function(e,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){T(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return c(r,e),r},setItem:function(t,e,n){return P.apply(this,[t,e,n,1])},removeItem:function(t,e){var n=this;t=f(t);var r=new a((function(e,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){T(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){r(e)}))}))})).catch(r)}));return c(r,e),r},clear:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){T(e,r,"DELETE FROM "+r.storeName,[],(function(){t()}),(function(t,e){n(e)}))}))})).catch(n)}));return c(n,t),n},length:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){T(e,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(e,n){var r=n.rows.item(0).c;t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return c(n,t),n},key:function(t,e){var n=this,r=new a((function(e,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){T(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,n){var r=n.rows.length?n.rows.item(0).key:null;e(r)}),(function(t,e){r(e)}))}))})).catch(r)}));return c(r,e),r},keys:function(t){var e=this,n=new a((function(t,n){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){T(e,r,"SELECT key FROM "+r.storeName,[],(function(e,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);t(r)}),(function(t,e){n(e)}))}))})).catch(n)}));return c(n,t),n},dropInstance:function(t,e){e=h.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var r,i=this;return c(r=t.name?new a((function(e){var r;r=t.name===n.name?i._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:r,storeNames:[t.storeName]}):e(M(r))})).then((function(t){return new a((function(e,n){t.db.transaction((function(r){function i(t){return new a((function(e,n){r.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){n(e)}))}))}for(var o=[],s=0,c=t.storeNames.length;s<c;s++)o.push(i(t.storeNames[s]));a.all(o).then((function(){e()})).catch((function(t){n(t)}))}),(function(t){n(t)}))}))})):a.reject("Invalid arguments"),e),r}};function z(t,e){var n=t.name+"/";return t.storeName!==e.storeName&&(n+=t.storeName+"/"),n}function W(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(t){return!0}}()||localStorage.length>0}var q={_driver:"localStorageWrapper",_initStorage:function(t){var e={};if(t)for(var n in t)e[n]=t[n];return e.keyPrefix=z(t,this._defaultConfig),W()?(this._dbInfo=e,e.serializer=L,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}(),iterate:function(t,e){var n=this,r=n.ready().then((function(){for(var e=n._dbInfo,r=e.keyPrefix,i=r.length,o=localStorage.length,a=1,s=0;s<o;s++){var c=localStorage.key(s);if(0===c.indexOf(r)){var u=localStorage.getItem(c);if(u&&(u=e.serializer.deserialize(u)),void 0!==(u=t(u,c.substring(i),a++)))return u}}}));return c(r,e),r},getItem:function(t,e){var n=this;t=f(t);var r=n.ready().then((function(){var e=n._dbInfo,r=localStorage.getItem(e.keyPrefix+t);return r&&(r=e.serializer.deserialize(r)),r}));return c(r,e),r},setItem:function(t,e,n){var r=this;t=f(t);var i=r.ready().then((function(){void 0===e&&(e=null);var n=e;return new a((function(i,o){var a=r._dbInfo;a.serializer.serialize(e,(function(e,r){if(r)o(r);else try{localStorage.setItem(a.keyPrefix+t,e),i(n)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||o(t),o(t)}}))}))}));return c(i,n),i},removeItem:function(t,e){var n=this;t=f(t);var r=n.ready().then((function(){var e=n._dbInfo;localStorage.removeItem(e.keyPrefix+t)}));return c(r,e),r},clear:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(t)&&localStorage.removeItem(r)}}));return c(n,t),n},length:function(t){var e=this.keys().then((function(t){return t.length}));return c(e,t),e},key:function(t,e){var n=this,r=n.ready().then((function(){var e,r=n._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(r.keyPrefix.length)),e}));return c(r,e),r},keys:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var o=localStorage.key(i);0===o.indexOf(t.keyPrefix)&&r.push(o.substring(t.keyPrefix.length))}return r}));return c(n,t),n},dropInstance:function(t,e){if(e=h.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}var r,i=this;return c(r=t.name?new a((function(e){t.storeName?e(z(t,i._defaultConfig)):e(t.name+"/")})).then((function(t){for(var e=localStorage.length-1;e>=0;e--){var n=localStorage.key(e);0===n.indexOf(t)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),e),r}},G=function(t,e){for(var n,r,i=t.length,o=0;o<i;){if((n=t[o])===(r=e)||"number"==typeof n&&"number"==typeof r&&isNaN(n)&&isNaN(r))return!0;o++}return!1},H=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},J={},K={},Q={INDEXEDDB:j,WEBSQL:U,LOCALSTORAGE:q},X=[Q.INDEXEDDB._driver,Q.WEBSQL._driver,Q.LOCALSTORAGE._driver],V=["dropInstance"],Y=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(V),$={description:"",driver:X.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Z(t,e){t[e]=function(){var n=arguments;return t.ready().then((function(){return t[e].apply(t,n)}))}}function tt(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var n in e)e.hasOwnProperty(n)&&(H(e[n])?arguments[0][n]=e[n].slice():arguments[0][n]=e[n])}return arguments[0]}var et=new(function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Q)if(Q.hasOwnProperty(n)){var r=Q[n],i=r._driver;this[n]=i,J[i]||this.defineDriver(r)}this._defaultConfig=tt({},$),this._config=tt({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":r(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,n){var r=new a((function(e,n){try{var r=t._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void n(i);for(var o=Y.concat("_initStorage"),s=0,u=o.length;s<u;s++){var f=o[s];if((!G(V,f)||t[f])&&"function"!=typeof t[f])return void n(i)}!function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),n=a.reject(e);return c(n,arguments[arguments.length-1]),n}},n=0,r=V.length;n<r;n++){var i=V[n];t[i]||(t[i]=e(i))}}();var h=function(n){J[r]&&console.info("Redefining LocalForage driver: "+r),J[r]=t,K[r]=n,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(h,n):h(!!t._support):h(!0)}catch(t){n(t)}}));return u(r,e,n),r},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,n){var r=J[t]?a.resolve(J[t]):a.reject(new Error("Driver not found."));return u(r,e,n),r},t.prototype.getSerializer=function(t){var e=a.resolve(L);return u(e,t),e},t.prototype.ready=function(t){var e=this,n=e._driverSet.then((function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready}));return u(n,t,t),n},t.prototype.setDriver=function(t,e,n){var r=this;H(t)||(t=[t]);var i=this._getSupportedDrivers(t);function o(){r._config.driver=r.driver()}function s(t){return r._extend(t),o(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=c.then((function(){var t=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(t).then((function(t){r._driver=t._driver,o(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(t){return function(){var e=0;return function n(){for(;e<t.length;){var i=t[e];return e++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}o();var c=new Error("No available storage method found.");return r._driverSet=a.reject(c),r._driverSet}()}}(i)}))})).catch((function(){o();var t=new Error("No available storage method found.");return r._driverSet=a.reject(t),r._driverSet})),u(this._driverSet,e,n),this._driverSet},t.prototype.supports=function(t){return!!K[t]},t.prototype._extend=function(t){tt(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];this.supports(i)&&e.push(i)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=Y.length;t<e;t++)Z(this,Y[t])},t.prototype.createInstance=function(e){return new t(e)},t}());e.exports=et},{3:3}]},{},[4])(4)},"object"===s(e)&&void 0!==t?t.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(e,i):r)||(t.exports=o))}).call(this,n(3))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var r=n(0),i=n.n(r),o=n(1);function a(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,c,"next",t)}function c(t){a(o,r,i,s,c,"throw",t)}s(void 0)}))}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var h=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config={url:window.location.origin,key:"",version:"v3",loadOn:"focus",searchOn:"keyup",limit:10,inputId:["search-bar"],outputId:["search-results"],outputChildsType:"li",postsFields:["title","url","excerpt","custom_excerpt","published_at","feature_image"],postsExtraFields:["tags"],postsFormats:["plaintext"],indexedFields:["title","string_tags","excerpt","plaintext"],template:function(t){var e='<a href="'.concat(t.url,'">');return t.feature_image&&(e+='<img src="'.concat(t.feature_image,'">')),e+="<section>",t.tags.length>0?e+='<header>\n                            <span class="head-tags">'.concat(t.tags[0].name,'</span>\n                            <span class="head-date">').concat(t.published_at,"</span>\n                          </header>"):e+='<header>\n                            <span class="head-tags">UNKNOWN</span>\n                            <span class="head-date">'.concat(t.published_at,"</span>\n                          </header>"),e+="<h2>".concat(t.title,"</h2>"),e+="</section></a>"},emptyTemplate:function(){},customProcessing:function(t){return t.tags&&(t.string_tags=t.tags.map((function(t){return t.name})).join(" ").toLowerCase()),t},date:{locale:document.documentElement.lang||"en-US",options:{year:"numeric",month:"short",day:"numeric"}},cacheMaxAge:1800,onFetchStart:function(){},onFetchEnd:function(t){},onIndexBuildStart:function(){},onIndexBuildEnd:function(t){},onSearchStart:function(){},onSearchEnd:function(t){},indexOptions:{},searchOptions:{},debug:!1},this.dataLoaded=!1,this.postsCount=0,this.storage=o,this.initConfig(e),this.triggerDataLoad()}var e,n,r,a,u,h,l;return e=t,(n=[{key:"initConfig",value:function(t){for(var e=this,n=0,r=Object.entries(t);n<r.length;n++){var i=c(r[n],2),o=i[0],a=i[1];this.config[o]=a}Array.isArray(this.config.inputId)||(this.config.inputId=[this.config.inputId]),Array.isArray(this.config.outputId)||(this.config.outputId=[this.config.outputId]),this.config.searchOptions.limit=this.config.limit,this.originalPostsFields=this.config.postsFields,this.config.postsFields.includes("updated_at")||this.config.postsFields.push("updated_at"),this.config.inputId&&this.config.inputId.length>0&&(this.searchBarEls=[],this.config.inputId.forEach((function(t){var n=document.getElementById(t);n?(e.searchBarEls.push(n),e.addSearchListeners(n)):e.error("Enable to find the input element #".concat(t,", please check your configuration"))}))),this.config.outputId&&this.config.outputId.length>0&&(this.searchResultEls=[],this.config.outputId.forEach((function(t){var n=document.getElementById(t);n?e.searchResultEls.push(n):e.error("Enable to find the output element #".concat(t,", please check your configuration"))}))),this.index=this.getNewSearchIndex()}},{key:"addSearchListeners",value:function(t){var e=this,n=t.closest("form");switch(n&&n.addEventListener("submit",(function(t){t.preventDefault()})),this.config.searchOn){case"keyup":t.addEventListener("keyup",(function(){var n=t.value.toLowerCase();e.search(n)}));break;case"submit":n.addEventListener("submit",(function(){var n=t.value.toLowerCase();e.search(n)}));break;case!1:case"none":break;default:this.error('Unknown "searchOn" option: \''.concat(this.config.searchOn,"'"))}}},{key:"triggerDataLoad",value:(l=s(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=this.config.loadOn,t.next="focus"===t.t0?3:"page"===t.t0?5:!1===t.t0||"none"===t.t0?7:8;break;case 3:return this.searchBarEls.forEach((function(t){t.addEventListener("focus",s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadData();case 2:case"end":return t.stop()}}),t)}))))})),t.abrupt("break",9);case 5:return window.addEventListener("load",s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.loadData();case 2:case"end":return t.stop()}}),t)})))),t.abrupt("break",9);case 7:return t.abrupt("break",9);case 8:this.error('Unknown "loadOn" option: \''.concat(this.config.loadOn,"'"));case 9:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"loadData",value:(h=s(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.dataLoaded){t.next=2;break}return t.abrupt("return");case 2:if(this.storage){t.next=7;break}return this.log("No local storage available, switch to degraded mode"),t.next=6,this.fetch();case 6:return t.abrupt("return");case 7:return t.next=9,this.storage.getItem("SearchinGhost_index");case 9:if(!(e=t.sent)){t.next=20;break}return this.log("Found an index stored locally, loads it"),this.config.onIndexBuildStart(),this.index.import(e),this.dataLoaded=!0,this.config.onIndexBuildEnd(this.index),t.next=18,this.validateCache();case 18:t.next=23;break;case 20:return this.log("No already stored index found"),t.next=23,this.fetch();case 23:case"end":return t.stop()}}),t,this)}))),function(){return h.apply(this,arguments)})},{key:"validateCache",value:(u=s(regeneratorRuntime.mark((function t(){var e,n,r,i,o,a,s,c,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.storage.getItem("SearchinGhost_cache_info");case 2:if(e=t.sent){t.next=8;break}return this.log("No cache info local object found"),t.next=7,this.fetch();case 7:return t.abrupt("return");case 8:if(n=JSON.parse(e),r=new Date(n.lastCacheCheck),!((i=Math.round((new Date-r)/1e3))<this.config.cacheMaxAge)){t.next=14;break}return this.log("Skip cache refreshing, updated less than ".concat(this.config.cacheMaxAge,"s ago (").concat(i,"s)")),t.abrupt("return");case 14:return o={limit:1,fields:["updated_at"],order:"updated_at DESC"},a=this.buildUrl(o),t.prev=16,t.next=19,fetch(a);case 19:if(s=t.sent.json(),console.log(s),c=s.posts?s.posts[0].updated_at:0,u=s.meta.pagination.total,c===n.lastestPostUpdatedAt){t.next=29;break}return this.log("Posts update found, purge outdated local cache"),t.next=27,this.fetch();case 27:t.next=38;break;case 29:if(!(u<n.totalPosts)){t.next=35;break}return this.log("Deleted or unpublished posts found, purge outdated local cache"),t.next=33,this.fetch();case 33:t.next=38;break;case 35:this.log("Local cached data up to date"),n.lastCacheCheck=(new Date).toISOString(),this.storage.setItem("SearchinGhost_cache_info",JSON.stringify(n));case 38:t.next=43;break;case 40:t.prev=40,t.t0=t.catch(16),console.error("Unable to fetch the latest post information to check cache state",t.t0);case 43:case 44:case"end":return t.stop()}}),t,this,[[16,40]])}))),function(){return u.apply(this,arguments)})},{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(s(regeneratorRuntime.mark((function t(){var e,n,r,i,o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.log("Fetching data from Ghost API"),this.config.onFetchStart(),e={limit:"all",fields:this.config.postsFields,order:"updated_at DESC"},this.config.postsExtraFields.length>0&&(e.include=this.config.postsExtraFields),this.config.postsFormats.length>0&&(e.formats=this.config.postsFormats),n=this.buildUrl(e),t.prev=6,t.next=9,fetch(n);case 9:r=t.sent.json(),i=r.posts,this.config.onFetchEnd(i),this.config.onIndexBuildStart(),this.index=this.getNewSearchIndex(),i.forEach((function(t){var e=a.format(t);e&&a.index.add(e)})),this.dataLoaded=!0,this.config.onIndexBuildEnd(this.index),this.storage&&(o={lastCacheCheck:(new Date).toISOString(),lastestPostUpdatedAt:i[0].updated_at,totalPosts:r.meta.pagination.total},this.storage.setItem("SearchinGhost_index",this.index.export()),this.storage.setItem("SearchinGhost_cache_info",JSON.stringify(o))),this.log("Search index build complete"),t.next=24;break;case 21:t.prev=21,t.t0=t.catch(6),this.error("Unable to fetch Ghost data.\n",t.t0);case 24:case 25:case"end":return t.stop()}}),t,this,[[6,21]])}))))},{key:"format",value:function(t){return t.id=this.postsCount++,t.published_at=this.prettyDate(t.published_at),this.originalPostsFields.includes("updated_at")||delete t.updated_at,t.custom_excerpt&&(t.excerpt=t.custom_excerpt,delete t.custom_excerpt),t=this.config.customProcessing(t)}},{key:"search",value:(a=s(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.loadData();case 2:return this.config.onSearchStart(),n=this.index.search(e,this.config.searchOptions),this.searchResultEls&&this.searchResultEls.length>0&&this.display(n),this.config.onSearchEnd(n),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"display",value:function(t){var e=this;this.searchResultEls.forEach((function(t){t.innerHTML=""})),t.length<1?this.insertTemplate(this.config.emptyTemplate()):t.forEach((function(t){e.insertTemplate(e.config.template(t))}))}},{key:"insertTemplate",value:function(t){var e=this;t&&this.searchResultEls.forEach((function(n){if(e.config.outputChildsType){var r=document.createElement(e.config.outputChildsType);r.classList.add("".concat(n.id,"-item")),r.innerHTML=t,n.appendChild(r)}else n.insertAdjacentHTML("beforeend",t)}))}},{key:"getNewSearchIndex",value:function(){for(var t={doc:{id:"id",field:this.config.indexedFields},encode:"simple",tokenize:"forward",threshold:0,resolution:4,depth:0},e=0,n=Object.entries(this.config.indexOptions);e<n.length;e++){var r=c(n[e],2),o=r[0],a=r[1];t[o]=a}return new i.a(t)}},{key:"buildUrl",value:function(t){for(var e="".concat(this.config.url,"/ghost/api/").concat(this.config.version,"/content/posts/?key=").concat(this.config.key),n=0,r=Object.entries(t);n<r.length;n++){var i=c(r[n],2),o=i[0],a=i[1];e+="&".concat(o,"=").concat(a)}return encodeURI(e)}},{key:"prettyDate",value:function(t){return new Date(t).toLocaleDateString(this.config.date.locale,this.config.date.options)}},{key:"getLocalStorageOption",value:function(){try{return window.localStorage.setItem("storage-availability-test",""),window.localStorage.removeItem("storage-availability-test"),window.localStorage}catch(t){return}}},{key:"log",value:function(t,e){this.config.debug&&(e?console.log(t,e):console.log(t))}},{key:"error",value:function(t,e){e?console.error(t,e):console.error(t)}}])&&f(e.prototype,n),r&&f(e,r),t}()},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r}]).default;