@tryghost/sodo-search 1.8.4 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/sodo-search",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "https://github.com/TryGhost/Ghost",
|
|
6
6
|
"author": "Ghost Foundation",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@testing-library/jest-dom": "5.17.0",
|
|
97
97
|
"@testing-library/react": "12.1.5",
|
|
98
98
|
"@vitejs/plugin-react": "4.7.0",
|
|
99
|
-
"jsdom": "
|
|
99
|
+
"jsdom": "28.1.0",
|
|
100
100
|
"nock": "13.5.6",
|
|
101
101
|
"vite": "5.4.20",
|
|
102
102
|
"vite-plugin-svgr": "3.3.0",
|
package/umd/sodo-search.min.js
CHANGED
|
@@ -48,7 +48,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
48
48
|
display: none;
|
|
49
49
|
}
|
|
50
50
|
`,r=this.context.stylesUrl;return r?L.jsxs(L.Fragment,{children:[L.jsx("link",{rel:"stylesheet",href:r}),L.jsx("style",{dangerouslySetInnerHTML:{__html:t}}),L.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]}):L.jsxs(L.Fragment,{children:[L.jsx("style",{dangerouslySetInnerHTML:{__html:t}}),L.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"})]})}renderFrameContainer(){const t=Qy(),r={...t.frame.common};return L.jsx("div",{style:t.modalContainer,className:"gh-root-frame",children:L.jsxs(qy,{style:r,title:"portal-popup",head:this.renderFrameStyles(),searchdir:this.context.dir,children:[L.jsx("div",{onClick:n=>this.handlePopupClose(n),className:"absolute top-0 bottom-0 left-0 right-0 block backdrop-blur-[2px] animate-fadein z-0 bg-gradient-to-br from-[rgba(0,0,0,0.2)] to-[rgba(0,0,0,0.1)]"}),L.jsx(td,{})]})})}render(){const{showPopup:t}=this.context;return t?this.renderFrameContainer():null}}ho(id,"contextType",Fe);var z;function Ae(e,t,r){const n=typeof r,i=typeof e;if(n!=="undefined"){if(i!=="undefined"){if(r){if(i==="function"&&n===i)return function(a){return e(r(a))};if(t=e.constructor,t===r.constructor){if(t===Array)return r.concat(e);if(t===Map){var s=new Map(r);for(var o of e)s.set(o[0],o[1]);return s}if(t===Set){o=new Set(r);for(s of e.values())o.add(s);return o}}}return e}return r}return i==="undefined"?t:e}function ye(){return Object.create(null)}function lt(e){return typeof e=="string"}function hi(e){return typeof e=="object"}function yv(e){const t=[];for(const r of e.keys())t.push(r);return t}function di(e,t){if(lt(t))e=e[t];else for(let r=0;e&&r<t.length;r++)e=e[t[r]];return e}function vv(e){let t=0;for(let r=0,n;r<e.length;r++)(n=e[r])&&t<n.length&&(t=n.length);return t}const wv=/[^\p{L}\p{N}]+/u,$v=/(\d{3})/g,xv=/(\D)(\d{3})/g,Sv=/(\d{3})(\D)/g,sd=/[\u0300-\u036f]/g;function pi(e={}){if(!this||this.constructor!==pi)return new pi(...arguments);if(arguments.length)for(e=0;e<arguments.length;e++)this.assign(arguments[e]);else this.assign(e)}z=pi.prototype,z.assign=function(e){this.normalize=Ae(e.normalize,!0,this.normalize);let t=e.include,r=t||e.exclude||e.split,n;if(r||r===""){if(typeof r=="object"&&r.constructor!==RegExp){let i="";n=!t,t||(i+="\\p{Z}"),r.letter&&(i+="\\p{L}"),r.number&&(i+="\\p{N}",n=!!t),r.symbol&&(i+="\\p{S}"),r.punctuation&&(i+="\\p{P}"),r.control&&(i+="\\p{C}"),(r=r.char)&&(i+=typeof r=="object"?r.join(""):r);try{this.split=new RegExp("["+(t?"^":"")+i+"]+","u")}catch{this.split=/\s+/}}else this.split=r,n=r===!1||2>"a1a".split(r).length;this.numeric=Ae(e.numeric,n)}else{try{this.split=Ae(this.split,wv)}catch{this.split=/\s+/}this.numeric=Ae(e.numeric,Ae(this.numeric,!0))}if(this.prepare=Ae(e.prepare,null,this.prepare),this.finalize=Ae(e.finalize,null,this.finalize),r=e.filter,this.filter=typeof r=="function"?r:Ae(r&&new Set(r),null,this.filter),this.dedupe=Ae(e.dedupe,!0,this.dedupe),this.matcher=Ae((r=e.matcher)&&new Map(r),null,this.matcher),this.mapper=Ae((r=e.mapper)&&new Map(r),null,this.mapper),this.stemmer=Ae((r=e.stemmer)&&new Map(r),null,this.stemmer),this.replacer=Ae(e.replacer,null,this.replacer),this.minlength=Ae(e.minlength,1,this.minlength),this.maxlength=Ae(e.maxlength,1024,this.maxlength),this.rtl=Ae(e.rtl,!1,this.rtl),(this.cache=r=Ae(e.cache,!0,this.cache))&&(this.H=null,this.S=typeof r=="number"?r:2e5,this.B=new Map,this.G=new Map,this.L=this.K=128),this.h="",this.M=null,this.A="",this.N=null,this.matcher)for(const i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(const i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this},z.addStemmer=function(e,t){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(e,t),this.A+=(this.A?"|":"")+e,this.N=null,this.cache&&vr(this),this},z.addFilter=function(e){return typeof e=="function"?this.filter=e:(this.filter||(this.filter=new Set),this.filter.add(e)),this.cache&&vr(this),this},z.addMapper=function(e,t){return typeof e=="object"?this.addReplacer(e,t):1<e.length?this.addMatcher(e,t):(this.mapper||(this.mapper=new Map),this.mapper.set(e,t),this.cache&&vr(this),this)},z.addMatcher=function(e,t){return typeof e=="object"?this.addReplacer(e,t):2>e.length&&(this.dedupe||this.mapper)?this.addMapper(e,t):(this.matcher||(this.matcher=new Map),this.matcher.set(e,t),this.h+=(this.h?"|":"")+e,this.M=null,this.cache&&vr(this),this)},z.addReplacer=function(e,t){return typeof e=="string"?this.addMatcher(e,t):(this.replacer||(this.replacer=[]),this.replacer.push(e,t),this.cache&&vr(this),this)},z.encode=function(e){if(this.cache&&e.length<=this.K)if(this.H){if(this.B.has(e))return this.B.get(e)}else this.H=setTimeout(vr,50,this);this.normalize&&(typeof this.normalize=="function"?e=this.normalize(e):e=sd?e.normalize("NFKD").replace(sd,"").toLowerCase():e.toLowerCase()),this.prepare&&(e=this.prepare(e)),this.numeric&&3<e.length&&(e=e.replace(xv,"$1 $2").replace(Sv,"$1 $2").replace($v,"$1 "));const t=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let r=[],n=this.split||this.split===""?e.split(this.split):e;for(let s=0,o,a;s<n.length;s++)if((o=a=n[s])&&!(o.length<this.minlength||o.length>this.maxlength)){if(t)r.push(o);else if(!this.filter||(typeof this.filter=="function"?this.filter(o):!this.filter.has(o))){if(this.cache&&o.length<=this.L)if(this.H){var i=this.G.get(o);if(i||i===""){i&&r.push(i);continue}}else this.H=setTimeout(vr,50,this);if(this.stemmer&&2<o.length&&(this.N||(this.N=new RegExp("(?!^)("+this.A+")$")),o=o.replace(this.N,l=>this.stemmer.get(l))),o&&(this.mapper||this.dedupe&&1<o.length)){i="";for(let l=0,f="",h,g;l<o.length;l++)h=o.charAt(l),h===f&&this.dedupe||((g=this.mapper&&this.mapper.get(h))||g===""?g===f&&this.dedupe||!(f=g)||(i+=g):i+=f=h);o=i}if(this.matcher&&1<o.length&&(this.M||(this.M=new RegExp("("+this.h+")","g")),o=o.replace(this.M,l=>this.matcher.get(l))),o&&this.replacer)for(i=0;o&&i<this.replacer.length;i+=2)o=o.replace(this.replacer[i],this.replacer[i+1]);this.cache&&a.length<=this.L&&(this.G.set(a,o),this.G.size>this.S&&(this.G.clear(),this.L=this.L/1.1|0)),o&&r.push(o)}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&e.length<=this.K&&(this.B.set(e,r),this.B.size>this.S&&(this.B.clear(),this.K=this.K/1.1|0)),r};function vr(e){e.H=null,e.B.clear(),e.G.clear()}let rn,gi;async function Ev(e){e=e.data;var t=e.task;const r=e.id;let n=e.args;switch(t){case"init":gi=e.options||{},(t=e.factory)?(Function("return "+t)()(self),rn=new self.FlexSearch.Index(gi),delete self.FlexSearch):rn=new wt(gi),postMessage({id:r});break;default:let i;t==="export"&&(n[1]?(n[0]=gi.export,n[2]=0,n[3]=1):n=null),t==="import"?n[0]&&(e=await gi.import.call(rn,n[0]),rn.import(n[0],e)):(i=n&&rn[t].apply(rn,n))&&i.then&&(i=await i),postMessage(t==="search"?{id:r,msg:i}:{id:r})}}function El(e){mi.call(e,"add"),mi.call(e,"append"),mi.call(e,"search"),mi.call(e,"update"),mi.call(e,"remove")}let Cl,od,Us;function Cv(){Cl=Us=0}function mi(e){this[e+"Async"]=function(){const t=arguments;var r=t[t.length-1];let n;if(typeof r=="function"&&(n=r,delete t[t.length-1]),Cl?Us||(Us=Date.now()-od>=this.priority*this.priority*3):(Cl=setTimeout(Cv,0),od=Date.now()),Us){const s=this;return new Promise(o=>{setTimeout(function(){o(s[e+"Async"].apply(s,t))},0)})}const i=this[e].apply(this,t);return r=i.then?i:new Promise(s=>s(i)),n&&r.then(n),r}}let nn=0;function yi(e={}){function t(o){function a(l){l=l.data||l;const f=l.id,h=f&&i.h[f];h&&(h(l.msg),delete i.h[f])}if(this.worker=o,this.h=ye(),this.worker)return n?this.worker.on("message",a):this.worker.onmessage=a,e.config?new Promise(function(l){i.h[++nn]=function(){l(i),1e9<nn&&(nn=0)},i.worker.postMessage({id:nn,task:"init",factory:r,options:e})}):(this.worker.postMessage({task:"init",factory:r,options:e}),this.priority=e.priority||4,this)}if(!this||this.constructor!==yi)return new yi(e);let r=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;r&&(r=r.toString());const n=typeof window>"u",i=this,s=kv(r,n,e.worker);return s.then?s.then(function(o){return t.call(i,o)}):t.call(this,s)}Zt("add"),Zt("append"),Zt("search"),Zt("update"),Zt("remove"),Zt("clear"),Zt("export"),Zt("import"),El(yi.prototype);function Zt(e){yi.prototype[e]=function(){const t=this,r=[].slice.call(arguments);var n=r[r.length-1];let i;return typeof n=="function"&&(i=n,r.pop()),n=new Promise(function(s){e==="export"&&typeof r[0]=="function"&&(r[0]=null),t.h[++nn]=s,t.worker.postMessage({task:e,id:nn,args:r})}),i?(n.then(i),this):n}}function kv(e,t,r){return t?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>Qd).then(function(n){return new n.Worker("undefined/node/node.mjs")}):e?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Ev.toString()],{type:"text/javascript"}))):new window.Worker(typeof r=="string"?r:(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("sodo-search.min.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js"),{type:"module"})}function kl(e,t=0){let r=[],n=[];t&&(t=25e4/t*5e3|0);for(const i of e.entries())n.push(i),n.length===t&&(r.push(n),n=[]);return n.length&&r.push(n),r}function Pl(e,t){t||(t=new Map);for(let r=0,n;r<e.length;r++)n=e[r],t.set(n[0],n[1]);return t}function ad(e,t=0){let r=[],n=[];t&&(t=25e4/t*1e3|0);for(const i of e.entries())n.push([i[0],kl(i[1])[0]]),n.length===t&&(r.push(n),n=[]);return n.length&&r.push(n),r}function ld(e,t){t||(t=new Map);for(let r=0,n,i;r<e.length;r++)n=e[r],i=t.get(n[0]),t.set(n[0],Pl(n[1],i));return t}function ud(e){let t=[],r=[];for(const n of e.keys())r.push(n),r.length===25e4&&(t.push(r),r=[]);return r.length&&t.push(r),t}function cd(e,t){t||(t=new Set);for(let r=0;r<e.length;r++)t.add(e[r]);return t}function Bs(e,t,r,n,i,s,o=0){const a=n&&n.constructor===Array;var l=a?n.shift():n;if(!l)return this.export(e,t,i,s+1);if((l=e((t?t+".":"")+(o+1)+"."+r,JSON.stringify(l)))&&l.then){const f=this;return l.then(function(){return Bs.call(f,e,t,r,a?n:null,i,s,o+1)})}return Bs.call(this,e,t,r,a?n:null,i,s,o+1)}function fd(e,t){let r="";for(const n of e.entries()){e=n[0];const i=n[1];let s="";for(let o=0,a;o<i.length;o++){a=i[o]||[""];let l="";for(let f=0;f<a.length;f++)l+=(l?",":"")+(t==="string"?'"'+a[f]+'"':a[f]);l="["+l+"]",s+=(s?",":"")+l}s='["'+e+'",['+s+"]]",r+=(r?",":"")+s}return r}function hd(e,t,r,n){let i=[];for(let s=0,o;s<e.index.length;s++)if(o=e.index[s],t>=o.length)t-=o.length;else{t=o[n?"splice":"slice"](t,r);const a=t.length;if(a&&(i=i.length?i.concat(t):t,r-=a,n&&(e.length-=a),!r))break;t=0}return i}function wr(e){if(!this||this.constructor!==wr)return new wr(e);this.index=e?[e]:[],this.length=e?e.length:0;const t=this;return new Proxy([],{get(r,n){if(n==="length")return t.length;if(n==="push")return function(i){t.index[t.index.length-1].push(i),t.length++};if(n==="pop")return function(){if(t.length)return t.length--,t.index[t.index.length-1].pop()};if(n==="indexOf")return function(i){let s=0;for(let o=0,a,l;o<t.index.length;o++){if(a=t.index[o],l=a.indexOf(i),0<=l)return s+l;s+=a.length}return-1};if(n==="includes")return function(i){for(let s=0;s<t.index.length;s++)if(t.index[s].includes(i))return!0;return!1};if(n==="slice")return function(i,s){return hd(t,i||0,s||t.length,!1)};if(n==="splice")return function(i,s){return hd(t,i||0,s||t.length,!0)};if(n==="constructor")return Array;if(typeof n!="symbol")return(r=t.index[n/2**31|0])&&r[n]},set(r,n,i){return r=n/2**31|0,(t.index[r]||(t.index[r]=[]))[n]=i,t.length++,!0}})}wr.prototype.clear=function(){this.index.length=0},wr.prototype.destroy=function(){this.proxy=this.index=null},wr.prototype.push=function(){};function vt(e=8){if(!this||this.constructor!==vt)return new vt(e);this.index=ye(),this.h=[],this.size=0,32<e?(this.B=pd,this.A=BigInt(e)):(this.B=dd,this.A=e)}vt.prototype.get=function(e){const t=this.index[this.B(e)];return t&&t.get(e)},vt.prototype.set=function(e,t){var r=this.B(e);let n=this.index[r];n?(r=n.size,n.set(e,t),(r-=n.size)&&this.size++):(this.index[r]=n=new Map([[e,t]]),this.h.push(n),this.size++)};function ut(e=8){if(!this||this.constructor!==ut)return new ut(e);this.index=ye(),this.h=[],this.size=0,32<e?(this.B=pd,this.A=BigInt(e)):(this.B=dd,this.A=e)}ut.prototype.add=function(e){var t=this.B(e);let r=this.index[t];r?(t=r.size,r.add(e),(t-=r.size)&&this.size++):(this.index[t]=r=new Set([e]),this.h.push(r),this.size++)},z=vt.prototype,z.has=ut.prototype.has=function(e){const t=this.index[this.B(e)];return t&&t.has(e)},z.delete=ut.prototype.delete=function(e){const t=this.index[this.B(e)];t&&t.delete(e)&&this.size--},z.clear=ut.prototype.clear=function(){this.index=ye(),this.h=[],this.size=0},z.values=ut.prototype.values=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].values())yield t},z.keys=ut.prototype.keys=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].keys())yield t},z.entries=ut.prototype.entries=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].entries())yield t};function dd(e){let t=2**this.A-1;if(typeof e=="number")return e&t;let r=0,n=this.A+1;for(let i=0;i<e.length;i++)r=(r*n^e.charCodeAt(i))&t;return this.A===32?r+2**31:r}function pd(e){let t=BigInt(2)**this.A-BigInt(1);var r=typeof e;if(r==="bigint")return e&t;if(r==="number")return BigInt(e)&t;r=BigInt(0);let n=this.A+BigInt(1);for(let i=0;i<e.length;i++)r=(r*n^BigInt(e.charCodeAt(i)))&t;return r}$r.prototype.add=function(e,t,r){if(hi(e)&&(t=e,e=di(t,this.key)),t&&(e||e===0)){if(!r&&this.reg.has(e))return this.update(e,t);for(let a=0,l;a<this.field.length;a++){l=this.D[a];var n=this.index.get(this.field[a]);if(typeof l=="function"){var i=l(t);i&&n.add(e,i,!1,!0)}else i=l.I,(!i||i(t))&&(l.constructor===String?l=[""+l]:lt(l)&&(l=[l]),Tl(t,l,this.J,0,n,e,l[0],r))}if(this.tag)for(n=0;n<this.F.length;n++){var s=this.F[n];i=this.tag.get(this.R[n]);let a=ye();if(typeof s=="function"){if(s=s(t),!s)continue}else{var o=s.I;if(o&&!o(t))continue;s.constructor===String&&(s=""+s),s=di(t,s)}if(i&&s){lt(s)&&(s=[s]);for(let l=0,f,h;l<s.length;l++)if(f=s[l],!a[f]&&(a[f]=1,(o=i.get(f))?h=o:i.set(f,h=[]),!r||!h.includes(e))){if(h.length===2**31-1){if(o=new wr(h),this.fastupdate)for(let g of this.reg.values())g.includes(h)&&(g[g.indexOf(h)]=o);i.set(f,h=o)}h.push(e),this.fastupdate&&((o=this.reg.get(e))?o.push(h):this.reg.set(e,[h]))}}}if(this.store&&(!r||!this.store.has(e))){let a;if(this.C){a=ye();for(let l=0,f;l<this.C.length;l++){if(f=this.C[l],(r=f.I)&&!r(t))continue;let h;if(typeof f=="function"){if(h=f(t),!h)continue;f=[f.V]}else if(lt(f)||f.constructor===String){a[f]=t[f];continue}Al(t,a,f,0,f[0],h)}}this.store.set(e,a||t)}this.worker&&(this.fastupdate||this.reg.add(e))}return this};function Al(e,t,r,n,i,s){if(e=e[i],n===r.length-1)t[i]=s||e;else if(e)if(e.constructor===Array)for(t=t[i]=Array(e.length),i=0;i<e.length;i++)Al(e,t,r,n,i);else t=t[i]||(t[i]=ye()),i=r[++n],Al(e,t,r,n,i)}function Tl(e,t,r,n,i,s,o,a){if(e=e[o])if(n===t.length-1){if(e.constructor===Array){if(r[n]){for(t=0;t<e.length;t++)i.add(s,e[t],!0,!0);return}e=e.join(" ")}i.add(s,e,a,!0)}else if(e.constructor===Array)for(o=0;o<e.length;o++)Tl(e,t,r,n,i,s,o,a);else o=t[++n],Tl(e,t,r,n,i,s,o,a);else i.db&&i.remove(s)}function gd(e,t,r,n,i,s,o){const a=e.length;let l=[],f,h;f=ye();for(let g=0,d,$,S,C;g<t;g++)for(let m=0;m<a;m++)if(S=e[m],g<S.length&&(d=S[g]))for(let v=0;v<d.length;v++){if($=d[v],(h=f[$])?f[$]++:(h=0,f[$]=1),C=l[h]||(l[h]=[]),!o){let w=g+(m||!i?0:s||0);C=C[w]||(C[w]=[])}if(C.push($),o&&r&&h===a-1&&C.length-n===r)return n?C.slice(n):C}if(e=l.length)if(i)l=1<l.length?md(l,r,n,o,s):(l=l[0]).length>r||n?l.slice(n,r+n):l;else{if(e<a)return[];if(l=l[e-1],r||n)if(o)(l.length>r||n)&&(l=l.slice(n,r+n));else{i=[];for(let g=0,d;g<l.length;g++)if(d=l[g],d.length>n)n-=d.length;else if((d.length>r||n)&&(d=d.slice(n,r+n),r-=d.length,n&&(n-=d.length)),i.push(d),!r)break;l=1<i.length?[].concat.apply([],i):i[0]}}return l}function md(e,t,r,n,i){const s=[],o=ye();let a;var l=e.length;let f;if(n){for(i=l-1;0<=i;i--)if(f=(n=e[i])&&n.length){for(l=0;l<f;l++)if(a=n[l],!o[a]){if(o[a]=1,r)r--;else if(s.push(a),s.length===t)return s}}}else for(let h=l-1,g,d=0;0<=h;h--){g=e[h];for(let $=0;$<g.length;$++)if(f=(n=g[$])&&n.length){for(let S=0;S<f;S++)if(a=n[S],!o[a])if(o[a]=1,r)r--;else{let C=($+(h<l-1&&i||0))/(h+1)|0;if((s[C]||(s[C]=[])).push(a),++d===t)return s}}}return s}function Pv(e,t,r){const n=ye(),i=[];for(let s=0,o;s<t.length;s++){o=t[s];for(let a=0;a<o.length;a++)n[o[a]]=1}if(r)for(let s=0,o;s<e.length;s++)o=e[s],n[o]&&(i.push(o),n[o]=0);else for(let s=0,o,a;s<e.result.length;s++)for(o=e.result[s],t=0;t<o.length;t++)a=o[t],n[a]&&((i[s]||(i[s]=[])).push(a),n[a]=0);return i}function jl(e,t,r,n){if(!e.length)return e;if(e.length===1)return e=e[0],e=r||e.length>t?t?e.slice(r,r+t):e.slice(r):e,n?er.call(this,e):e;let i=[];for(let s=0,o,a;s<e.length;s++)if((o=e[s])&&(a=o.length)){if(r){if(r>=a){r-=a;continue}r<a&&(o=t?o.slice(r,r+t):o.slice(r),a=o.length,r=0)}if(a>t&&(o=o.slice(0,t),a=t),!i.length&&a>=t)return n?er.call(this,o):o;if(i.push(o),t-=a,!t)break}return i=1<i.length?[].concat.apply([],i):i[0],n?er.call(this,i):i}function Ms(e,t,r){var n=r[0];if(n.then)return Promise.all(r).then(function(h){return e[t].apply(e,h)});if(n[0]&&n[0].index)return e[t].apply(e,n);n=[];let i=[],s=0,o=0,a,l,f;for(let h=0,g;h<r.length;h++)if(g=r[h]){let d;if(g.constructor===oe)d=g.result;else if(g.constructor===Array)d=g;else if(s=g.limit||0,o=g.offset||0,f=g.suggest,l=g.resolve,a=g.enrich&&l,g.index)g.resolve=!1,d=g.index.search(g).result,g.resolve=l;else if(g.and)d=e.and(g.and);else if(g.or)d=e.or(g.or);else if(g.xor)d=e.xor(g.xor);else if(g.not)d=e.not(g.not);else continue;if(d.then)i.push(d);else if(d.length)n[h]=d;else if(!f&&(t==="and"||t==="xor")){n=[];break}}return{O:n,P:i,limit:s,offset:o,enrich:a,resolve:l,suggest:f}}oe.prototype.or=function(){const{O:e,P:t,limit:r,offset:n,enrich:i,resolve:s}=Ms(this,"or",arguments);return yd.call(this,e,t,r,n,i,s)};function yd(e,t,r,n,i,s){if(t.length){const o=this;return Promise.all(t).then(function(a){e=[];for(let l=0,f;l<a.length;l++)(f=a[l]).length&&(e[l]=f);return yd.call(o,e,[],r,n,i,s)})}return e.length&&(this.result.length&&e.push(this.result),2>e.length?this.result=e[0]:(this.result=md(e,r,n,!1,this.h),n=0)),s?this.resolve(r,n,i):this}oe.prototype.and=function(){let e=this.result.length,t,r,n,i;if(!e){const s=arguments[0];s&&(e=!!s.suggest,i=s.resolve,t=s.limit,r=s.offset,n=s.enrich&&i)}if(e){const{O:s,P:o,limit:a,offset:l,enrich:f,resolve:h,suggest:g}=Ms(this,"and",arguments);return vd.call(this,s,o,a,l,f,h,g)}return i?this.resolve(t,r,n):this};function vd(e,t,r,n,i,s,o){if(t.length){const a=this;return Promise.all(t).then(function(l){e=[];for(let f=0,h;f<l.length;f++)(h=l[f]).length&&(e[f]=h);return vd.call(a,e,[],r,n,i,s,o)})}if(e.length)if(this.result.length&&e.unshift(this.result),2>e.length)this.result=e[0];else{if(t=vv(e))return this.result=gd(e,t,r,n,o,this.h,s),s?i?er.call(this.index,this.result):this.result:this;this.result=[]}else o||(this.result=e);return s?this.resolve(r,n,i):this}oe.prototype.xor=function(){const{O:e,P:t,limit:r,offset:n,enrich:i,resolve:s,suggest:o}=Ms(this,"xor",arguments);return wd.call(this,e,t,r,n,i,s,o)};function wd(e,t,r,n,i,s,o){if(t.length){const a=this;return Promise.all(t).then(function(l){e=[];for(let f=0,h;f<l.length;f++)(h=l[f]).length&&(e[f]=h);return wd.call(a,e,[],r,n,i,s,o)})}if(e.length)if(this.result.length&&e.unshift(this.result),2>e.length)this.result=e[0];else return this.result=Av.call(this,e,r,n,s,this.h),s?i?er.call(this.index,this.result):this.result:this;else o||(this.result=e);return s?this.resolve(r,n,i):this}function Av(e,t,r,n,i){const s=[],o=ye();let a=0;for(let l=0,f;l<e.length;l++)if(f=e[l]){a<f.length&&(a=f.length);for(let h=0,g;h<f.length;h++)if(g=f[h])for(let d=0,$;d<g.length;d++)$=g[d],o[$]=o[$]?2:1}for(let l=0,f,h=0;l<a;l++)for(let g=0,d;g<e.length;g++)if((d=e[g])&&(f=d[l])){for(let $=0,S;$<f.length;$++)if(S=f[$],o[S]===1)if(r)r--;else if(n){if(s.push(S),s.length===t)return s}else{const C=l+(g?i:0);if(s[C]||(s[C]=[]),s[C].push(S),++h===t)return s}}return s}oe.prototype.not=function(){const{O:e,P:t,limit:r,offset:n,enrich:i,resolve:s,suggest:o}=Ms(this,"not",arguments);return $d.call(this,e,t,r,n,i,s,o)};function $d(e,t,r,n,i,s,o){if(t.length){const a=this;return Promise.all(t).then(function(l){e=[];for(let f=0,h;f<l.length;f++)(h=l[f]).length&&(e[f]=h);return $d.call(a,e,[],r,n,i,s,o)})}if(e.length&&this.result.length)this.result=Tv.call(this,e,r,n,s);else if(s)return this.resolve(r,n,i);return s?i?er.call(this.index,this.result):this.result:this}function Tv(e,t,r,n){const i=[];e=new Set(e.flat().flat());for(let s=0,o,a=0;s<this.result.length;s++)if(o=this.result[s]){for(let l=0,f;l<o.length;l++)if(f=o[l],!e.has(f)){if(r)r--;else if(n){if(i.push(f),i.length===t)return i}else if(i[s]||(i[s]=[]),i[s].push(f),++a===t)return i}}return i}function oe(e){if(!this||this.constructor!==oe)return new oe(e);if(e&&e.index)return e.resolve=!1,this.index=e.index,this.h=e.boost||0,this.result=e.index.search(e).result,this;this.index=null,this.result=e||[],this.h=0}oe.prototype.limit=function(e){if(this.result.length){const t=[];for(let r=0,n;r<this.result.length;r++)if(n=this.result[r])if(n.length<=e){if(t[r]=n,e-=n.length,!e)break}else{t[r]=n.slice(0,e);break}this.result=t}return this},oe.prototype.offset=function(e){if(this.result.length){const t=[];for(let r=0,n;r<this.result.length;r++)(n=this.result[r])&&(n.length<=e?e-=n.length:(t[r]=n.slice(e),e=0));this.result=t}return this},oe.prototype.boost=function(e){return this.h+=e,this},oe.prototype.resolve=function(e,t,r){const n=this.result,i=this.index;return this.result=this.index=null,n.length?(typeof e=="object"&&(r=e.enrich,t=e.offset,e=e.limit),jl.call(i,n,e||100,t,r)):n},$r.prototype.search=function(e,t,r,n){r||(!t&&hi(e)?(r=e,e=""):hi(t)&&(r=t,t=0));let i=[];var s=[],o;let a,l,f,h=0;var g=!0;let d;if(r){r.constructor===Array&&(r={index:r}),e=r.query||e;var $=r.pluck;a=r.merge,l=$||r.field||(l=r.index)&&(l.index?null:l),f=this.tag&&r.tag;var S=r.suggest;g=r.resolve!==!1,g||$||!(l=l||this.field)||(lt(l)?$=l:(l.constructor===Array&&l.length===1&&(l=l[0]),$=l.field||l.index)),d=(o=this.store&&r.enrich&&g)&&r.highlight,t=r.limit||t;var C=r.offset||0;if(t||(t=100),f&&(!this.db||!n)){f.constructor!==Array&&(f=[f]);var m=[];for(let E=0,j;E<f.length;E++)if(j=f[E],j.field&&j.tag){var v=j.tag;if(v.constructor===Array)for(var w=0;w<v.length;w++)m.push(j.field,v[w]);else m.push(j.field,v)}else{v=Object.keys(j);for(let T=0,_,R;T<v.length;T++)if(_=v[T],R=j[_],R.constructor===Array)for(w=0;w<R.length;w++)m.push(_,R[w]);else m.push(_,R)}if(f=m,!e){if(g=[],m.length)for(s=0;s<m.length;s+=2){if(this.db){if($=this.index.get(m[s]),!$)continue;g.push($=$.db.tag(m[s+1],t,C,o))}else $=jv.call(this,m[s],m[s+1],t,C,o);i.push({field:m[s],tag:m[s+1],result:$})}return g.length?Promise.all(g).then(function(E){for(let j=0;j<E.length;j++)i[j].result=E[j];return i}):i}}l&&l.constructor!==Array&&(l=[l])}l||(l=this.field),m=!n&&(this.worker||this.db)&&[];let k;for(let E=0,j,T,_;E<l.length;E++){if(T=l[E],this.db&&this.tag&&!this.D[E])continue;let R;if(lt(T)||(R=T,T=R.field,e=R.query||e,t=R.limit||t,C=R.offset||C,S=R.suggest||S,o=this.store&&(R.enrich||o)),n)j=n[E];else if(v=R||r,w=this.index.get(T),f&&(this.db&&(v.tag=f,k=w.db.support_tag_search,v.field=l),k||(v.enrich=!1)),m){m[E]=w.search(e,t,v),v&&o&&(v.enrich=o);continue}else j=w.search(e,t,v),v&&o&&(v.enrich=o);if(_=j&&(g?j.length:j.result.length),f&&_){if(v=[],w=0,this.db&&n){if(!k)for(let B=l.length;B<n.length;B++){let q=n[B];if(q&&q.length)w++,v.push(q);else if(!S)return g?i:new oe(i)}}else for(let B=0,q,Ue;B<f.length;B+=2){if(q=this.tag.get(f[B]),!q){if(S)continue;return g?i:new oe(i)}if(Ue=(q=q&&q.get(f[B+1]))&&q.length)w++,v.push(q);else if(!S)return g?i:new oe(i)}if(w){if(j=Pv(j,v,g),_=j.length,!_&&!S)return g?j:new oe(j);w--}}if(_)s[h]=T,i.push(j),h++;else if(l.length===1)return g?i:new oe(i)}if(m){if(this.db&&f&&f.length&&!k)for(o=0;o<f.length;o+=2){if(s=this.index.get(f[o]),!s){if(S)continue;return g?i:new oe(i)}m.push(s.db.tag(f[o+1],t,C,!1))}const E=this;return Promise.all(m).then(function(j){return j.length?E.search(e,t,r,j):j})}if(!h)return g?i:new oe(i);if($&&(!o||!this.store))return i[0];for(m=[],C=0;C<s.length;C++){if(S=i[C],o&&S.length&&typeof S[0].doc>"u"&&(this.db?m.push(S=this.index.get(this.field[0]).db.enrich(S)):S=er.call(this,S)),$)return g?S:new oe(S);i[C]={field:s[C],result:S}}if(o&&this.db&&m.length){const E=this;return Promise.all(m).then(function(j){for(let T=0;T<j.length;T++)i[T].result=j[T];return a?Sd(i):d?xd(i,e,E.index,E.field,E.D,d):i})}return a?Sd(i):d?xd(i,e,this.index,this.field,this.D,d):i};function xd(e,t,r,n,i,s){let o,a,l;for(let f=0,h,g,d,$;f<e.length;f++){if(h=e[f].field,!h)continue;let S=e[f].result;d=r.get(h),g=d.encoder,l=d.tokenize,$=i[n.indexOf(h)],g!==o&&(o=g,a=o.encode(t));for(let C=0;C<S.length;C++){let m="",v=di(S[C].doc,$).split(/\s+/);for(let w=0,k,E;w<v.length;w++){k=v[w],E=g.encode(k),E=1<E.length?E.join(" "):E[0];let j;if(E&&k)for(let T=0,_;T<a.length;T++)if(_=a[T],l==="strict"){if(E===_){m+=(m?" ":"")+s.replace("$1",k),j=!0;break}}else{const R=E.indexOf(_);if(-1<R){m+=(m?" ":"")+k.substring(0,R)+s.replace("$1",k.substring(R,_.length))+k.substring(R+_.length),j=!0;break}}j||(m+=(m?" ":"")+v[w])}S[C].highlight=m}}return e}function Sd(e){const t=[],r=ye();for(let n=0,i,s;n<e.length;n++){i=e[n],s=i.result;for(let o=0,a,l,f;o<s.length;o++)l=s[o],typeof l!="object"&&(l={id:l}),a=l.id,(f=r[a])?f.push(i.field):(l.field=r[a]=[i.field],t.push(l))}return t}function jv(e,t,r,n,i){if(e=this.tag.get(e),!e)return[];if((t=(e=e&&e.get(t))&&e.length-n)&&0<t)return(t>r||n)&&(e=e.slice(n,n+r)),i&&(e=er.call(this,e)),e}function er(e){if(!this||!this.store)return e;const t=Array(e.length);for(let r=0,n;r<e.length;r++)n=e[r],t[r]={id:n,doc:this.store.get(n)};return t}function $r(e){if(!this||this.constructor!==$r)return new $r(e);const t=e.document||e.doc||e;let r,n;if(this.D=[],this.field=[],this.J=[],this.key=(r=t.key||t.id)&&Ds(r,this.J)||"id",(n=e.keystore||0)&&(this.keystore=n),this.fastupdate=!!e.fastupdate,this.reg=!this.fastupdate||e.worker||e.db?n?new ut(n):new Set:n?new vt(n):new Map,this.C=(r=t.store||null)&&r&&r!==!0&&[],this.store=r&&(n?new vt(n):new Map),this.cache=(r=e.cache||null)&&new xr(r),e.cache=!1,this.worker=e.worker,this.priority=e.priority||4,this.index=Nv.call(this,e,t),this.tag=null,(r=t.tag)&&(typeof r=="string"&&(r=[r]),r.length)){this.tag=new Map,this.F=[],this.R=[];for(let i=0,s,o;i<r.length;i++){if(s=r[i],o=s.field||s,!o)throw Error("The tag field from the document descriptor is undefined.");s.custom?this.F[i]=s.custom:(this.F[i]=Ds(o,this.J),s.filter&&(typeof this.F[i]=="string"&&(this.F[i]=new String(this.F[i])),this.F[i].I=s.filter)),this.R[i]=o,this.tag.set(o,new Map)}}if(this.worker){this.fastupdate=!1,e=[];for(const i of this.index.values())i.then&&e.push(i);if(e.length){const i=this;return Promise.all(e).then(function(s){let o=0;for(const a of i.index.entries()){const l=a[0];a[1].then&&i.index.set(l,s[o++])}return i})}}else e.db&&(this.fastupdate=!1,this.mount(e.db))}z=$r.prototype,z.mount=function(e){let t=this.field;if(this.tag)for(let i=0,s;i<this.R.length;i++){s=this.R[i];var r=void 0;this.index.set(s,r=new wt({},this.reg)),t===this.field&&(t=t.slice(0)),t.push(s),r.tag=this.tag.get(s)}r=[];const n={db:e.db,type:e.type,fastupdate:e.fastupdate};for(let i=0,s,o;i<t.length;i++){n.field=o=t[i],s=this.index.get(o);const a=new e.constructor(e.id,n);a.id=e.id,r[i]=a.mount(s),s.document=!0,i?s.bypass=!0:s.store=this.store}return this.db=!0,Promise.all(r)},z.commit=async function(e,t){const r=[];for(const n of this.index.values())r.push(n.commit(e,t));await Promise.all(r),this.reg.clear()},z.destroy=function(){const e=[];for(const t of this.index.values())e.push(t.destroy());return Promise.all(e)};function Nv(e,t){const r=new Map;let n=t.index||t.field||t;lt(n)&&(n=[n]);for(let i=0,s,o;i<n.length;i++){if(s=n[i],lt(s)||(o=s,s=s.field),o=hi(o)?Object.assign({},e,o):e,this.worker){const a=new yi(o);r.set(s,a)}this.worker||r.set(s,new wt(o,this.reg)),o.custom?this.D[i]=o.custom:(this.D[i]=Ds(s,this.J),o.filter&&(typeof this.D[i]=="string"&&(this.D[i]=new String(this.D[i])),this.D[i].I=o.filter)),this.field[i]=s}if(this.C){e=t.store,lt(e)&&(e=[e]);for(let i=0,s,o;i<e.length;i++)s=e[i],o=s.field||s,s.custom?(this.C[i]=s.custom,s.custom.V=o):(this.C[i]=Ds(o,this.J),s.filter&&(typeof this.C[i]=="string"&&(this.C[i]=new String(this.C[i])),this.C[i].I=s.filter))}return r}function Ds(e,t){const r=e.split(":");let n=0;for(let i=0;i<r.length;i++)e=r[i],e[e.length-1]==="]"&&(e=e.substring(0,e.length-2))&&(t[n]=!0),e&&(r[n++]=e);return n<r.length&&(r.length=n),1<n?r:r[0]}z.append=function(e,t){return this.add(e,t,!0)},z.update=function(e,t){return this.remove(e).add(e,t)},z.remove=function(e){hi(e)&&(e=di(e,this.key));for(var t of this.index.values())t.remove(e,!0);if(this.reg.has(e)){if(this.tag&&!this.fastupdate)for(let r of this.tag.values())for(let n of r){t=n[0];const i=n[1],s=i.indexOf(e);-1<s&&(1<i.length?i.splice(s,1):r.delete(t))}this.store&&this.store.delete(e),this.reg.delete(e)}return this.cache&&this.cache.remove(e),this},z.clear=function(){const e=[];for(const t of this.index.values()){const r=t.clear();r.then&&e.push(r)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),e.length?Promise.all(e):this},z.contain=function(e){return this.db?this.index.get(this.field[0]).db.has(e):this.reg.has(e)},z.cleanup=function(){for(const e of this.index.values())e.cleanup();return this},z.get=function(e){return this.db?this.index.get(this.field[0]).db.enrich(e).then(function(t){return t[0]&&t[0].doc||null}):this.store.get(e)||null},z.set=function(e,t){return typeof e=="object"&&(t=e,e=di(t,this.key)),this.store.set(e,t),this},z.searchCache=Ed,z.export=function(e,t,r=0,n=0){if(r<this.field.length){const o=this.field[r];if((t=this.index.get(o).export(e,o,r,n=1))&&t.then){const a=this;return t.then(function(){return a.export(e,o,r+1)})}return this.export(e,o,r+1)}let i,s;switch(n){case 0:i="reg",s=ud(this.reg),t=null;break;case 1:i="tag",s=this.tag&&ad(this.tag,this.reg.size),t=null;break;case 2:i="doc",s=this.store&&kl(this.store),t=null;break;default:return}return Bs.call(this,e,t,i,s,r,n)},z.import=function(e,t){var r=e.split(".");r[r.length-1]==="json"&&r.pop();const n=2<r.length?r[0]:"";if(r=2<r.length?r[2]:r[1],this.worker&&n)return this.index.get(n).import(e);if(t){if(typeof t=="string"&&(t=JSON.parse(t)),n)return this.index.get(n).import(r,t);switch(r){case"reg":this.fastupdate=!1,this.reg=cd(t,this.reg);for(let i=0,s;i<this.field.length;i++)s=this.index.get(this.field[i]),s.fastupdate=!1,s.reg=this.reg;if(this.worker){t=[];for(const i of this.index.values())t.push(i.import(e));return Promise.all(t)}break;case"tag":this.tag=ld(t,this.tag);break;case"doc":this.store=Pl(t,this.store)}}},El($r.prototype);function Ed(e,t,r){e=(typeof e=="object"?""+e.query:e).toLowerCase(),this.cache||(this.cache=new xr);let n=this.cache.get(e);if(!n){if(n=this.search(e,t,r),n.then){const i=this;n.then(function(s){return i.cache.set(e,s),s})}this.cache.set(e,n)}return n}function xr(e){this.limit=e&&e!==!0?e:1e3,this.cache=new Map,this.h=""}xr.prototype.set=function(e,t){this.cache.set(this.h=e,t),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},xr.prototype.get=function(e){const t=this.cache.get(e);return t&&this.h!==e&&(this.cache.delete(e),this.cache.set(this.h=e,t)),t},xr.prototype.remove=function(e){for(const t of this.cache){const r=t[0];t[1].includes(e)&&this.cache.delete(r)}},xr.prototype.clear=function(){this.cache.clear(),this.h=""};const Cd={normalize:!1,numeric:!1,dedupe:!1},zs={},Nl=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"]]),kd=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Pd=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],Ad={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 Td={Exact:Cd,Default:zs,Normalize:zs,LatinBalance:{mapper:Nl},LatinAdvanced:{mapper:Nl,matcher:kd,replacer:Pd},LatinExtra:{mapper:Nl,replacer:Pd.concat([/(?!^)[aeo]/g,""]),matcher:kd},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(e){for(let r=0;r<e.length;r++){var t=e[r];let n=t.charAt(0),i=Ad[n];for(let s=1,o;s<t.length&&(o=t.charAt(s),o==="h"||o==="w"||!(o=Ad[o])||o===i||(n+=o,i=o,n.length!==4));s++);e[r]=n}}},CJK:{split:""},LatinExact:Cd,LatinDefault:zs,LatinSimple:zs};wt.prototype.remove=function(e,t){const r=this.reg.size&&(this.fastupdate?this.reg.get(e):this.reg.has(e));if(r){if(this.fastupdate){for(let n=0,i;n<r.length;n++)if(i=r[n])if(2>i.length)i.pop();else{const s=i.indexOf(e);s===r.length-1?i.pop():i.splice(s,1)}}else vi(this.map,e),this.depth&&vi(this.ctx,e);t||this.reg.delete(e)}return this.db&&(this.commit_task.push({del:e}),this.T&&Id(this)),this.cache&&this.cache.remove(e),this};function vi(e,t){let r=0;var n=typeof t>"u";if(e.constructor===Array){for(let i=0,s,o;i<e.length;i++)if((s=e[i])&&s.length)if(n)r++;else if(o=s.indexOf(t),0<=o){1<s.length?(s.splice(o,1),r++):delete e[i];break}else r++}else for(let i of e.entries()){n=i[0];const s=vi(i[1],t);s?r+=s:e.delete(n)}return r}const Ov={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};wt.prototype.add=function(e,t,r,n){if(t&&(e||e===0)){if(!n&&!r&&this.reg.has(e))return this.update(e,t);if(t=this.encoder.encode(t),n=t.length){const f=ye(),h=ye(),g=this.depth,d=this.resolution;for(let $=0;$<n;$++){let S=t[this.rtl?n-1-$:$];var i=S.length;if(i&&(g||!h[S])){var s=this.score?this.score(t,S,$,null,0):Vs(d,n,$),o="";switch(this.tokenize){case"full":if(2<i){for(let C=0,m;C<i;C++)for(s=i;s>C;s--){o=S.substring(C,s),m=this.rtl?i-1-C:C;var a=this.score?this.score(t,S,$,o,m):Vs(d,n,$,i,m);wi(this,h,o,a,e,r)}break}case"bidirectional":case"reverse":if(1<i){for(a=i-1;0<a;a--){o=S[this.rtl?i-1-a:a]+o;var l=this.score?this.score(t,S,$,o,a):Vs(d,n,$,i,a);wi(this,h,o,l,e,r)}o=""}case"forward":if(1<i){for(a=0;a<i;a++)o+=S[this.rtl?i-1-a:a],wi(this,h,o,s,e,r);break}default:if(wi(this,h,S,s,e,r),g&&1<n&&$<n-1){for(i=ye(),o=this.U,s=S,a=Math.min(g+1,this.rtl?$+1:n-$),i[s]=1,l=1;l<a;l++)if((S=t[this.rtl?n-1-$-l:$+l])&&!i[S]){i[S]=1;const C=this.score?this.score(t,s,$,S,l-1):Vs(o+(n/2>o?0:1),n,$,a-1,l-1),m=this.bidirectional&&S>s;wi(this,f,m?s:S,C,e,r,m?S:s)}}}}}this.fastupdate||this.reg.add(e)}else t=""}return this.db&&(t||this.commit_task.push({del:e}),this.T&&Id(this)),this};function wi(e,t,r,n,i,s,o){let a=o?e.ctx:e.map,l;if((!t[r]||o&&!(l=t[r])[o])&&(o?(t=l||(t[r]=ye()),t[o]=1,(l=a.get(o))?a=l:a.set(o,a=new Map)):t[r]=1,(l=a.get(r))?a=l:a.set(r,a=l=[]),a=a[n]||(a[n]=[]),!s||!a.includes(i))){if(a.length===2**31-1){if(t=new wr(a),e.fastupdate)for(let f of e.reg.values())f.includes(a)&&(f[f.indexOf(a)]=t);l[n]=a=t}a.push(i),e.fastupdate&&((n=e.reg.get(i))?n.push(a):e.reg.set(i,[a]))}}function Vs(e,t,r,n,i){return r&&1<e?t+(n||0)<=e?r+(i||0):(e-1)/(t+(n||0))*(r+(i||0))+1|0:0}wt.prototype.search=function(e,t,r){r||(t||typeof e!="object"?typeof t=="object"&&(r=t,t=0):(r=e,e=""));let n=[],i,s,o,a=0,l,f,h,g,d;r?(e=r.query||e,t=r.limit||t,a=r.offset||0,s=r.context,o=r.suggest,d=(l=r.resolve!==!1)&&r.enrich,h=r.boost,g=r.resolution,f=this.db&&r.tag):l=this.resolve;let $=this.encoder.encode(e);if(i=$.length,t=t||(l?100:0),i===1)return Nd.call(this,$[0],"",t,a,l,d,f);if(s=this.depth&&s!==!1,i===2&&s&&!o)return Nd.call(this,$[1],$[0],t,a,l,d,f);let S=ye(),C=0,m;if(s&&(m=$[0],C=1),g||g===0||(g=m?this.U:this.resolution),this.db){if(this.db.search&&(e=this.db.search(this,$,t,a,o,l,d,f),e!==!1))return e;const v=this;return async function(){for(let w,k;C<i;C++){if((k=$[C])&&!S[k]){if(S[k]=1,w=await Ol(v,k,m,0,0,!1,!1),w=Od(w,n,o,g)){n=w;break}m&&(o&&w&&n.length||(m=k))}o&&m&&C===i-1&&!n.length&&(g=v.resolution,m="",C=-1,S=ye())}return jd(n,g,t,a,o,h,l)}()}for(let v,w;C<i;C++){if((w=$[C])&&!S[w]){if(S[w]=1,v=Ol(this,w,m,0,0,!1,!1),v=Od(v,n,o,g)){n=v;break}m&&(o&&v&&n.length||(m=w))}o&&m&&C===i-1&&!n.length&&(g=this.resolution,m="",C=-1,S=ye())}return jd(n,g,t,a,o,h,l)};function jd(e,t,r,n,i,s,o){let a=e.length,l=e;if(1<a)l=gd(e,t,r,n,i,s,o);else if(a===1)return o?jl.call(null,e[0],r,n):new oe(e[0]);return o?l:new oe(l)}function Nd(e,t,r,n,i,s,o){return e=Ol(this,e,t,r,n,i,s,o),this.db?e.then(function(a){return i?a||[]:new oe(a)}):e&&e.length?i?jl.call(this,e,r,n):new oe(e):i?[]:new oe}function Od(e,t,r,n){let i=[];if(e&&e.length){if(e.length<=n){t.push(e);return}for(let s=0,o;s<n;s++)(o=e[s])&&(i[s]=o);if(i.length){t.push(i);return}}if(!r)return i}function Ol(e,t,r,n,i,s,o,a){let l;return r&&(l=e.bidirectional&&t>r)&&(l=r,r=t,t=l),e.db?e.db.get(t,r,n,i,s,o,a):(e=r?(e=e.ctx.get(r))&&e.get(t):e.map.get(t),e)}function wt(e,t){if(!this||this.constructor!==wt)return new wt(e);if(e){var r=lt(e)?e:e.preset;r&&(e=Object.assign({},Ov[r],e))}else e={};r=e.context;const n=r===!0?{depth:1}:r||{},i=lt(e.encoder)?Td[e.encoder]:e.encode||e.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new pi(i):{encode:i},this.resolution=e.resolution||9,this.tokenize=r=(r=e.tokenize)&&r!=="default"&&r!=="exact"&&r||"strict",this.depth=r==="strict"&&n.depth||0,this.bidirectional=n.bidirectional!==!1,this.fastupdate=!!e.fastupdate,this.score=e.score||null,(r=e.keystore||0)&&(this.keystore=r),this.map=r?new vt(r):new Map,this.ctx=r?new vt(r):new Map,this.reg=t||(this.fastupdate?r?new vt(r):new Map:r?new ut(r):new Set),this.U=n.resolution||3,this.rtl=i.rtl||e.rtl||!1,this.cache=(r=e.cache||null)&&new xr(r),this.resolve=e.resolve!==!1,(r=e.db)&&(this.db=this.mount(r)),this.T=e.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=e.priority||4}z=wt.prototype,z.mount=function(e){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),e.mount(this)},z.commit=function(e,t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,e,t)},z.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function Id(e){e.commit_timer||(e.commit_timer=setTimeout(function(){e.commit_timer=null,e.db.commit(e,void 0,void 0)},1))}z.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=[{clear:!0}]),this},z.append=function(e,t){return this.add(e,t,!0)},z.contain=function(e){return this.db?this.db.has(e):this.reg.has(e)},z.update=function(e,t){const r=this,n=this.remove(e);return n&&n.then?n.then(()=>r.add(e,t)):this.add(e,t)},z.cleanup=function(){return this.fastupdate?(vi(this.map),this.depth&&vi(this.ctx),this):this},z.searchCache=Ed,z.export=function(e,t,r=0,n=0){let i,s;switch(n){case 0:i="reg",s=ud(this.reg);break;case 1:i="cfg",s=null;break;case 2:i="map",s=kl(this.map,this.reg.size);break;case 3:i="ctx",s=ad(this.ctx,this.reg.size);break;default:return}return Bs.call(this,e,t,i,s,r,n)},z.import=function(e,t){if(t)switch(typeof t=="string"&&(t=JSON.parse(t)),e=e.split("."),e[e.length-1]==="json"&&e.pop(),e.length===3&&e.shift(),e=1<e.length?e[1]:e[0],e){case"reg":this.fastupdate=!1,this.reg=cd(t,this.reg);break;case"map":this.map=Pl(t,this.map);break;case"ctx":this.ctx=ld(t,this.ctx)}},z.serialize=function(e=!0){let t="",r="",n="";if(this.reg.size){let s;for(var i of this.reg.keys())s||(s=typeof i),t+=(t?",":"")+(s==="string"?'"'+i+'"':i);t="index.reg=new Set(["+t+"]);",r=fd(this.map,s),r="index.map=new Map(["+r+"]);";for(const o of this.ctx.entries()){i=o[0];let a=fd(o[1],s);a="new Map(["+a+"])",a='["'+i+'",'+a+"]",n+=(n?",":"")+a}n="index.ctx=new Map(["+n+"]);"}return e?"function inject(index){"+t+r+n+"}":t+r+n},El(wt.prototype);const _d=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Hs=["map","ctx","tag","reg","cfg"],Sr=ye();function bd(e,t={}){if(!this)return new bd(e,t);typeof e=="object"&&(t=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=t.field?t.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=t.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}z=bd.prototype,z.mount=function(e){return e.encoder?(e.db=this,this.open()):e.mount(this)},z.open=function(){if(this.db)return this.db;let e=this;navigator.storage&&navigator.storage.persist(),Sr[e.id]||(Sr[e.id]=[]),Sr[e.id].push(e.field);const t=_d.open(e.id,1);return t.onupgradeneeded=function(){const r=e.db=this.result;for(let n=0,i;n<Hs.length;n++){i=Hs[n];for(let s=0,o;s<Sr[e.id].length;s++)o=Sr[e.id][s],r.objectStoreNames.contains(i+(i!=="reg"&&o?":"+o:""))||r.createObjectStore(i+(i!=="reg"&&o?":"+o:""))}},e.db=tr(t,function(r){e.db=r,e.db.onversionchange=function(){e.close()}})},z.close=function(){this.db&&this.db.close(),this.db=null},z.destroy=function(){const e=_d.deleteDatabase(this.id);return tr(e)},z.clear=function(){const e=[];for(let r=0,n;r<Hs.length;r++){n=Hs[r];for(let i=0,s;i<Sr[this.id].length;i++)s=Sr[this.id][i],e.push(n+(n!=="reg"&&s?":"+s:""))}const t=this.db.transaction(e,"readwrite");for(let r=0;r<e.length;r++)t.objectStore(e[r]).clear();return tr(t)},z.get=function(e,t,r=0,n=0,i=!0,s=!1){e=this.db.transaction((t?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((t?"ctx":"map")+(this.field?":"+this.field:"")).get(t?t+":"+e:e);const o=this;return tr(e).then(function(a){let l=[];if(!a||!a.length)return l;if(i){if(!r&&!n&&a.length===1)return a[0];for(let f=0,h;f<a.length;f++)if((h=a[f])&&h.length){if(n>=h.length){n-=h.length;continue}const g=r?n+Math.min(h.length-n,r):h.length;for(let d=n;d<g;d++)l.push(h[d]);if(n=0,l.length===r)break}return s?o.enrich(l):l}return a})},z.tag=function(e,t=0,r=0,n=!1){e=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(e);const i=this;return tr(e).then(function(s){return!s||!s.length||r>=s.length?[]:!t&&!r?s:(s=s.slice(r,r+t),n?i.enrich(s):s)})},z.enrich=function(e){typeof e!="object"&&(e=[e]);const t=this.db.transaction("reg","readonly").objectStore("reg"),r=[];for(let n=0;n<e.length;n++)r[n]=tr(t.get(e[n]));return Promise.all(r).then(function(n){for(let i=0;i<n.length;i++)n[i]={id:e[i],doc:n[i]?JSON.parse(n[i]):null};return n})},z.has=function(e){return e=this.db.transaction("reg","readonly").objectStore("reg").getKey(e),tr(e).then(function(t){return!!t})},z.search=null,z.info=function(){},z.transaction=function(e,t,r){e+=e!=="reg"&&this.field?":"+this.field:"";let n=this.h[e+":"+t];if(n)return r.call(this,n);let i=this.db.transaction(e,t);this.h[e+":"+t]=n=i.objectStore(e);const s=r.call(this,n);return this.h[e+":"+t]=null,tr(i).finally(function(){return i=n=null,s})},z.commit=async function(e,t,r){if(t)await this.clear(),e.commit_task=[];else{let n=e.commit_task;e.commit_task=[];for(let i=0,s;i<n.length;i++)if(s=n[i],s.clear){await this.clear(),t=!0;break}else n[i]=s.del;t||(r||(n=n.concat(yv(e.reg))),n.length&&await this.remove(n))}e.reg.size&&(await this.transaction("map","readwrite",function(n){for(const i of e.map){const s=i[0],o=i[1];o.length&&(t?n.put(o,s):n.get(s).onsuccess=function(){let a=this.result;var l;if(a&&a.length){const f=Math.max(a.length,o.length);for(let h=0,g,d;h<f;h++)if((d=o[h])&&d.length){if((g=a[h])&&g.length)for(l=0;l<d.length;l++)g.push(d[l]);else a[h]=d;l=1}}else a=o,l=1;l&&n.put(a,s)})}}),await this.transaction("ctx","readwrite",function(n){for(const i of e.ctx){const s=i[0],o=i[1];for(const a of o){const l=a[0],f=a[1];f.length&&(t?n.put(f,s+":"+l):n.get(s+":"+l).onsuccess=function(){let h=this.result;var g;if(h&&h.length){const d=Math.max(h.length,f.length);for(let $=0,S,C;$<d;$++)if((C=f[$])&&C.length){if((S=h[$])&&S.length)for(g=0;g<C.length;g++)S.push(C[g]);else h[$]=C;g=1}}else h=f,g=1;g&&n.put(h,s+":"+l)})}}}),e.store?await this.transaction("reg","readwrite",function(n){for(const i of e.store){const s=i[0],o=i[1];n.put(typeof o=="object"?JSON.stringify(o):1,s)}}):e.bypass||await this.transaction("reg","readwrite",function(n){for(const i of e.reg.keys())n.put(1,i)}),e.tag&&await this.transaction("tag","readwrite",function(n){for(const i of e.tag){const s=i[0],o=i[1];o.length&&(n.get(s).onsuccess=function(){let a=this.result;a=a&&a.length?a.concat(o):o,n.put(a,s)})}}),e.map.clear(),e.ctx.clear(),e.tag&&e.tag.clear(),e.store&&e.store.clear(),e.document||e.reg.clear())};function Il(e,t,r){const n=e.value;let i,s=0;for(let o=0,a;o<n.length;o++){if(a=r?n:n[o]){for(let l=0,f,h;l<t.length;l++)if(h=t[l],f=a.indexOf(h),0<=f)if(i=1,1<a.length)a.splice(f,1);else{n[o]=[];break}s+=a.length}if(r)break}s?i&&e.update(n):e.delete(),e.continue()}z.remove=function(e){return typeof e!="object"&&(e=[e]),Promise.all([this.transaction("map","readwrite",function(t){t.openCursor().onsuccess=function(){const r=this.result;r&&Il(r,e)}}),this.transaction("ctx","readwrite",function(t){t.openCursor().onsuccess=function(){const r=this.result;r&&Il(r,e)}}),this.transaction("tag","readwrite",function(t){t.openCursor().onsuccess=function(){const r=this.result;r&&Il(r,e,!0)}}),this.transaction("reg","readwrite",function(t){for(let r=0;r<e.length;r++)t.delete(e[r])})])};function tr(e,t){return new Promise((r,n)=>{e.onsuccess=e.oncomplete=function(){t&&t(this.result),t=null,r(this.result)},e.onerror=e.onblocked=n,e=null})}const Ws={Encoder:pi,Document:$r},Iv=Td,_v={finalize:e=>{let t=[];for(const r of e)t.push(...Fv(r));return t}};function bv(e){return e>=19968&&e<=40959||e>=12352&&e<=12543||e>=44032&&e<=55203||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=191471||e>=196608&&e<=205743||e>=191472&&e<=192095||e>=63744&&e<=64255||e>=194560&&e<=195103}function Fv(e){const t=[];let r="";for(const n of e){const i=n.codePointAt(0);bv(i)?(r&&(t.push(r),r=""),t.push(n)):r+=n}return r&&t.push(r),t}const _l=new Ws.Encoder(Iv.Default,_v);class Lv{constructor({adminUrl:t,apiKey:r,dir:n}){Am(this,ae);const i=n==="rtl",s=n==="rtl"?"reverse":"forward";this.apiUrl=t,this.apiKey=r,this.postsIndex=new Ws.Document({tokenize:s,rtl:i,document:{id:"id",index:["title","excerpt"],store:!0},encoder:_l}),this.authorsIndex=new Ws.Document({tokenize:s,rtl:i,document:{id:"id",index:["name"],store:!0},encoder:_l}),this.tagsIndex=new Ws.Document({tokenize:s,rtl:i,document:{id:"id",index:["name"],store:!0},encoder:_l}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async init(){await Je(this,ae,Tm).call(this),await Je(this,ae,Om).call(this),await Je(this,ae,bm).call(this)}search(t){const r=this.postsIndex.search(t,{enrich:!0}),n=this.authorsIndex.search(t,{enrich:!0}),i=this.tagsIndex.search(t,{enrich:!0});return{posts:Je(this,ae,po).call(this,r),authors:Je(this,ae,po).call(this,n),tags:Je(this,ae,po).call(this,i)}}}ae=new WeakSet,Tm=async function(){const t=await Je(this,ae,jm).call(this);t.length>0&&Je(this,ae,Nm).call(this,t)},jm=async function(){try{const t=`${this.apiUrl}/ghost/api/content/search-index/posts/?key=${this.apiKey}`;return(await(await fetch(t)).json()).posts}catch(t){return console.error("Error fetching posts:",t),[]}},Nm=function(t){t.forEach(r=>{this.postsIndex.add(r)})},Om=async function(){const t=await Je(this,ae,Im).call(this);t.length>0&&Je(this,ae,_m).call(this,t)},Im=async function(){try{const t=`${this.apiUrl}/ghost/api/content/search-index/authors/?key=${this.apiKey}`;return(await(await fetch(t)).json()).authors}catch(t){return console.error("Error fetching authors:",t),[]}},_m=function(t){t.forEach(r=>{this.authorsIndex.add(r)})},bm=async function(){const t=await Je(this,ae,Fm).call(this);t.length>0&&Je(this,ae,Lm).call(this,t)},Fm=async function(){try{const t=`${this.apiUrl}/ghost/api/content/search-index/tags/?key=${this.apiKey}`;return(await(await fetch(t)).json()).tags}catch(t){return console.error("Error fetching tags:",t),[]}},Lm=function(t){t.forEach(r=>{this.tagsIndex.add(r)})},po=function(t){const r=[],n={};return t.forEach(i=>{i.result.forEach(s=>{n[s.id]||(r.push(s.doc),n[s.id]=!0)})}),r};var sn={exports:{}};const Rv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Uv={Authors:"الكتّاب",Cancel:"إلغاء","No matches found":"لا يوجد نتائج مطابقة",Posts:"منشورات","Search posts, tags and authors":"قم بالبحث عن المنشورات، الوسوم و الكتّاب","Show more results":"اظهر المزيد من النتائج",Tags:"الوسوم"},Bv={Authors:"Автори",Cancel:"Отказ","No matches found":"Няма съвпадения",Posts:"Публикации","Search posts, tags and authors":"Търсене в публикации, етикети и автори","Show more results":"Покажи още резултати",Tags:"Етикети"},Mv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Dv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},zv={Authors:"Autors",Cancel:"Cancel·la","No matches found":"No s'ha trobat cap resultat",Posts:"Articles","Search posts, tags and authors":"Cerca articles, etiquetes i autors","Show more results":"Mostra més resultats",Tags:"Etiquetes"},Vv={Authors:"Autoři",Cancel:"Zrušit","No matches found":"Nenalezeno",Posts:"Články","Search posts, tags and authors":"Prohledat články, štítky a autory","Show more results":"Zobrazit více výsledků",Tags:"Štítky"},Hv={Authors:"Forfattere",Cancel:"Annuller","No matches found":"Ingen resultater fundet",Posts:"Indlæg","Search posts, tags and authors":"Søg i indlæg, tags og forfattere","Show more results":"Vis flere resultater",Tags:"Tags"},Wv={Authors:"Autor*innen",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Posts","Search posts, tags and authors":"Posts, Tags und Autor*innen durchsuchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},Kv={Authors:"Autoren",Cancel:"Abbrechen","No matches found":"Keine Treffer gefunden",Posts:"Beiträge","Search posts, tags and authors":"Nach Posts, Tags und Autoren suchen","Show more results":"Mehr Ergebnisse anzeigen",Tags:"Tags"},qv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Gv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Xv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Yv={Authors:"Autores",Cancel:"Cancelar","No matches found":"No se encontraron resultados",Posts:"Publicaciones","Search posts, tags and authors":"Buscar publicaciones, etiquetas y autores","Show more results":"Mostrar más resultados",Tags:"Etiquetas"},Jv={Authors:"Autorid",Cancel:"Tühista","No matches found":"Vasteid ei leitud",Posts:"Postitused","Search posts, tags and authors":"Otsi postitusi, silte ja autoreid","Show more results":"Näita rohkem tulemusi",Tags:"Sildid"},Qv={Authors:"Autoreak",Cancel:"Utzi","No matches found":"Ez da bat datorren ezer topatu",Posts:"Artikuluak","Search posts, tags and authors":"Bilatu artikuluak, etiketak eta autoreak","Show more results":"Erakutsi emaitza gehiago",Tags:"Etiketak"},Zv={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},e1={Authors:"Kirjoittajat",Cancel:"Peruuta","No matches found":"Ei hakutuloksia",Posts:"Kirjoitukset","Search posts, tags and authors":"Etsi kirjoituksia, tunnisteita ja kirjoittajia","Show more results":"Näytä enemmän tuloksia",Tags:"Tunnisteet"},t1={Authors:"Auteurs",Cancel:"Annuler","No matches found":"Aucun résultat trouvé",Posts:"Articles","Search posts, tags and authors":"Rechercher des articles, des catégories et des auteurs","Show more results":"Plus de résultats",Tags:"Catégories"},r1={Authors:"Ùghdaran",Cancel:"Sguir dheth","No matches found":"Cha deach dad a lorg a fhreagras ris na lorg thu",Posts:"Postaichean","Search posts, tags and authors":"Lorg sna postaichean, tagaichean agus ùghdaran","Show more results":"Seall barrachd thoraidhean",Tags:"Tagaichean"},n1={Authors:"מחברים",Cancel:"ביטול","No matches found":"לא נמצאו התאמות",Posts:"פוסטים","Search posts, tags and authors":"חיפוש פוסטים, תגיות ומחברים","Show more results":"הצגת תוצאות נוספות",Tags:"תגיות"},i1={Authors:"लेखक",Cancel:"रद्द करें","No matches found":"कोई मैच नहीं मिला",Posts:"पोस्ट","Search posts, tags and authors":"पोस्ट, टैग और लेखक की तलाश करें","Show more results":"और परिणाम दिखाएं",Tags:"टैग"},s1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},o1={Authors:"Szerzők",Cancel:"Mégse","No matches found":"Nincs találat",Posts:"Bejegyzések","Search posts, tags and authors":"Keresés a bejegyzések, a címkék és a szerzők között","Show more results":"További találatok megjelenítése",Tags:"Címkék"},a1={Authors:"Penulis",Cancel:"Batalkan","No matches found":"Tidak ada hasil yang ditemukan",Posts:"Postingan","Search posts, tags and authors":"Cari postingan, tag, dan penulis","Show more results":"Tampilkan lebih banyak hasil",Tags:"Tag"},l1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},u1={Authors:"Autori",Cancel:"Annulla","No matches found":"Nessun risultato trovato",Posts:"Articoli","Search posts, tags and authors":"Cerca articoli, tag e autori","Show more results":"Mostra più risultati",Tags:"Tag"},c1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},f1={Authors:"작성자",Cancel:"취소","No matches found":"일치하는 결과가 없어요",Posts:"게시물","Search posts, tags and authors":"게시물, 태그, 작성자 검색","Show more results":"더 많은 결과 보기",Tags:"태그"},h1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},d1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},p1={Authors:"Autori",Cancel:"Atcelt","No matches found":"Nav atrasta neviena atbilstība",Posts:"Ziņas","Search posts, tags and authors":"Meklēt ziņas, atzīmes un autorus","Show more results":"Rādīt vairāk rezultātu",Tags:"Tagi"},g1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},m1={Authors:"Нийтлэгчид",Cancel:"Цуцлах","No matches found":"Тохирох хайлтын үр дүн олдсонгүй",Posts:"Нийтлэлүүд","Search posts, tags and authors":"Нийтлэл, ангилал, нийтлэгчдээр хайх","Show more results":"Илүү олон үр дүн харуулах",Tags:"Ангилалууд"},y1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},v1={Authors:"Forfattere",Cancel:"Avbryt","No matches found":"Ingen treff funnet",Posts:"Innlegg","Search posts, tags and authors":"Søk i innlegg, etiketter og forfattere","Show more results":"Vis flere resultater",Tags:"Etiketter"},w1={Authors:"लेखकहरू",Cancel:"रद्द गर्नुहोस्","No matches found":"कुनै परिणाम भेटिएन",Posts:"पोस्टहरू","Search posts, tags and authors":"पोस्टहरू, ट्यागहरू र लेखकहरू खोज्नुहोस्","Show more results":"थप परिणामहरू देखाउनुहोस्",Tags:"ट्यागहरू"},$1={Authors:"Auteurs",Cancel:"Annuleren","No matches found":"Geen resultaten gevonden",Posts:"Berichten","Search posts, tags and authors":"Zoek berichten, tags en auteurs","Show more results":"Meer resultaten weergeven",Tags:"Tags"},x1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},S1={Authors:"ਲੇਖਕ",Cancel:"ਰੱਦ ਕਰੋ","No matches found":"ਕੋਈ ਮੇਲ ਨਹੀਂ ਮਿਲਿਆ",Posts:"ਪੋਸਟਾਂ","Search posts, tags and authors":"ਪੋਸਟਾਂ, ਟੈਗ ਅਤੇ ਲੇਖਕ ਖੋਜੋ","Show more results":"ਹੋਰ ਨਤੀਜੇ ਦਿਖਾਓ",Tags:"ਟੈਗ"},E1={Authors:"Autorzy",Cancel:"Anuluj","No matches found":"Nie znaleziono dopasowań",Posts:"Posty","Search posts, tags and authors":"Szukaj postów, tagów lub autorów","Show more results":"Pokaż więcej wyników",Tags:"Tagi"},C1={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Procurar publicações, marcadores e autores","Show more results":"Mostrar mais resultados",Tags:"Marcadores"},k1={Authors:"Autores",Cancel:"Cancelar","No matches found":"Nenhum resultado encontrado",Posts:"Publicações","Search posts, tags and authors":"Buscar posts, tags e autores","Show more results":"Mostrar mais resultados",Tags:"Tags"},P1={Authors:"Autori",Cancel:"Anulează","No matches found":"Nu s-au găsit rezultate",Posts:"Postări","Search posts, tags and authors":"Caută postări, etichete și autori","Show more results":"Afișează mai multe rezultate",Tags:"Etichete"},A1={Authors:"Авторы",Cancel:"Отмена","No matches found":"Совпадений не найдено",Posts:"Записи","Search posts, tags and authors":"Поиск по записям, тегам и авторам","Show more results":"Показать больше результатов",Tags:"Теги"},T1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},j1={Authors:"Autori",Cancel:"Zrušiť","No matches found":"Nenašli sa žiadne výsledky",Posts:"Príspevky","Search posts, tags and authors":"Vyhľadajte príspevky, tagy a autorov","Show more results":"Zobraziť viac výsledkov",Tags:"Tagy"},N1={Authors:"Avtorji",Cancel:"Prekliči","No matches found":"Ni najdenih zadetkov",Posts:"Članki","Search posts, tags and authors":"Iščite članke, oznake in avtorje","Show more results":"Prikaži več rezultatov",Tags:"Oznake"},O1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},I1={Authors:"Autori",Cancel:"Otkažite","No matches found":"Nema rezultata",Posts:"Objave","Search posts, tags and authors":"Pretražite objave, tag-ove i autore","Show more results":"Prikažite više rezultata",Tags:"Tag-ovi"},_1={Authors:"Аутори",Cancel:"Откажите","No matches found":"Нема резултата",Posts:"Објаве","Search posts, tags and authors":"Претражите објаве, tag-ове и ауторе","Show more results":"Прикажите више резултата",Tags:"Tag-ови"},b1={Authors:"Författare",Cancel:"Avbryt","No matches found":"Inga träffar hittade",Posts:"Inlägg","Search posts, tags and authors":"Sök inlägg, taggar och författare","Show more results":"Visa fler resultat",Tags:"Taggar"},F1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},L1={Authors:"ஆசிரியர்கள்",Cancel:"ரத்து செய்","No matches found":"பொருத்தங்கள் எதுவும் இல்லை",Posts:"பதிவுகள்","Search posts, tags and authors":"பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்","Show more results":"மேலும் முடிவுகளைக் காட்டு",Tags:"குறிச்சொற்கள்"},R1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},U1={Authors:"Yazarlar",Cancel:"İptal","No matches found":"Eşleşme bulunamadı",Posts:"Yazılar","Search posts, tags and authors":"Yazıları, etiketleri ve yazarları ara","Show more results":"Daha fazla sonuç göster",Tags:"Etiketler"},B1={Authors:"Автори",Cancel:"Скасувати","No matches found":"Збігів не знайдено",Posts:"Публікації","Search posts, tags and authors":"Шукайте публікацій, теги та авторів","Show more results":"Показати більше результатів",Tags:"Теги"},M1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},D1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},z1={Authors:"Tác giả",Cancel:"Hủy","No matches found":"Không tìm thấy",Posts:"Bài viết","Search posts, tags and authors":"Tìm bài viết, chuyên mục & tác giả","Show more results":"Xem thêm kết quả",Tags:"Chuyên mục"},V1={Authors:"作者",Cancel:"取消","No matches found":"未找到匹配项",Posts:"文章","Search posts, tags and authors":"搜索文章、标签和作者","Show more results":"显示更多结果",Tags:"标签"},H1={Authors:"作者",Cancel:"取消","No matches found":"無相符結果",Posts:"文章","Search posts, tags and authors":"搜尋文章、標籤與作者","Show more results":"更多結果",Tags:"標籤"};var Fd;function Ld(){return Fd||(Fd={"/ghost/i18n/locales/af/search.json":function(){return Rv},"/ghost/i18n/locales/ar/search.json":function(){return Uv},"/ghost/i18n/locales/bg/search.json":function(){return Bv},"/ghost/i18n/locales/bn/search.json":function(){return Mv},"/ghost/i18n/locales/bs/search.json":function(){return Dv},"/ghost/i18n/locales/ca/search.json":function(){return zv},"/ghost/i18n/locales/cs/search.json":function(){return Vv},"/ghost/i18n/locales/da/search.json":function(){return Hv},"/ghost/i18n/locales/de/search.json":function(){return Wv},"/ghost/i18n/locales/de-CH/search.json":function(){return Kv},"/ghost/i18n/locales/el/search.json":function(){return qv},"/ghost/i18n/locales/en/search.json":function(){return Gv},"/ghost/i18n/locales/eo/search.json":function(){return Xv},"/ghost/i18n/locales/es/search.json":function(){return Yv},"/ghost/i18n/locales/et/search.json":function(){return Jv},"/ghost/i18n/locales/eu/search.json":function(){return Qv},"/ghost/i18n/locales/fa/search.json":function(){return Zv},"/ghost/i18n/locales/fi/search.json":function(){return e1},"/ghost/i18n/locales/fr/search.json":function(){return t1},"/ghost/i18n/locales/gd/search.json":function(){return r1},"/ghost/i18n/locales/he/search.json":function(){return n1},"/ghost/i18n/locales/hi/search.json":function(){return i1},"/ghost/i18n/locales/hr/search.json":function(){return s1},"/ghost/i18n/locales/hu/search.json":function(){return o1},"/ghost/i18n/locales/id/search.json":function(){return a1},"/ghost/i18n/locales/is/search.json":function(){return l1},"/ghost/i18n/locales/it/search.json":function(){return u1},"/ghost/i18n/locales/ja/search.json":function(){return c1},"/ghost/i18n/locales/ko/search.json":function(){return f1},"/ghost/i18n/locales/kz/search.json":function(){return h1},"/ghost/i18n/locales/lt/search.json":function(){return d1},"/ghost/i18n/locales/lv/search.json":function(){return p1},"/ghost/i18n/locales/mk/search.json":function(){return g1},"/ghost/i18n/locales/mn/search.json":function(){return m1},"/ghost/i18n/locales/ms/search.json":function(){return y1},"/ghost/i18n/locales/nb/search.json":function(){return v1},"/ghost/i18n/locales/ne/search.json":function(){return w1},"/ghost/i18n/locales/nl/search.json":function(){return $1},"/ghost/i18n/locales/nn/search.json":function(){return x1},"/ghost/i18n/locales/pa/search.json":function(){return S1},"/ghost/i18n/locales/pl/search.json":function(){return E1},"/ghost/i18n/locales/pt/search.json":function(){return C1},"/ghost/i18n/locales/pt-BR/search.json":function(){return k1},"/ghost/i18n/locales/ro/search.json":function(){return P1},"/ghost/i18n/locales/ru/search.json":function(){return A1},"/ghost/i18n/locales/si/search.json":function(){return T1},"/ghost/i18n/locales/sk/search.json":function(){return j1},"/ghost/i18n/locales/sl/search.json":function(){return N1},"/ghost/i18n/locales/sq/search.json":function(){return O1},"/ghost/i18n/locales/sr/search.json":function(){return I1},"/ghost/i18n/locales/sr-Cyrl/search.json":function(){return _1},"/ghost/i18n/locales/sv/search.json":function(){return b1},"/ghost/i18n/locales/sw/search.json":function(){return F1},"/ghost/i18n/locales/ta/search.json":function(){return L1},"/ghost/i18n/locales/th/search.json":function(){return R1},"/ghost/i18n/locales/tr/search.json":function(){return U1},"/ghost/i18n/locales/uk/search.json":function(){return B1},"/ghost/i18n/locales/ur/search.json":function(){return M1},"/ghost/i18n/locales/uz/search.json":function(){return D1},"/ghost/i18n/locales/vi/search.json":function(){return z1},"/ghost/i18n/locales/zh/search.json":function(){return V1},"/ghost/i18n/locales/zh-Hant/search.json":function(){return H1}})}function Er(e){function t(r){var n=Rd(r,e);if(n!==null)return Ld()[n]();throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return t.resolve=function(r){var n=Rd(r,e);return n!==null?n:require.resolve(r)},t}function Rd(e,t){var r=W1(e);e=Ks(e);var n;e[0]==="/"&&(t="");for(var i=Ld(),s=["",".js",".json"];r?n=Ks(t+"/node_modules/"+e):n=Ks(t+"/"+e),!n.endsWith("/..");){for(var o=0;o<s.length;o++){var a=n+s[o];if(i[a])return a}if(!r)break;var l=Ks(t+"/..");if(l===t)break;t=l}return null}function W1(e){var t=e[0];if(t==="/"||t==="\\")return!1;var r=e[1],n=e[2];return!(t==="."&&(!r||r==="/"||r==="\\")||t==="."&&r==="."&&(!n||n==="/"||n==="\\")||r===":"&&(n==="/"||n==="\\"))}function Ks(e){e=e.replace(/\\/g,"/");for(var t=e.split("/"),r=t[0]==="",n=1;n<t.length;n++)(t[n]==="."||t[n]==="")&&t.splice(n--,1);for(var n=1;n<t.length;n++)t[n]===".."&&n>0&&t[n-1]!==".."&&t[n-1]!=="."&&(t.splice(--n,2),n--);return e=t.join("/"),r&&e[0]!=="/"?e="/"+e:e.length===0&&(e="."),e}var $i={exports:{}};const W=e=>typeof e=="string",xi=()=>{let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r},Ud=e=>e==null?"":""+e,K1=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},q1=/###/g,Bd=e=>e&&e.indexOf("###")>-1?e.replace(q1,"."):e,Md=e=>!e||W(e),Si=(e,t,r)=>{const n=W(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(Md(e))return{};const s=Bd(n[i]);!e[s]&&r&&(e[s]=new r),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++i}return Md(e)?{}:{obj:e,k:Bd(n[i])}},Dd=(e,t,r)=>{const{obj:n,k:i}=Si(e,t,Object);if(n!==void 0||t.length===1){n[i]=r;return}let s=t[t.length-1],o=t.slice(0,t.length-1),a=Si(e,o,Object);for(;a.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),a=Si(e,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${s}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=r},G1=(e,t,r,n)=>{const{obj:i,k:s}=Si(e,t,Object);i[s]=i[s]||[],i[s].push(r)},qs=(e,t)=>{const{obj:r,k:n}=Si(e,t);if(r)return r[n]},X1=(e,t,r)=>{const n=qs(e,r);return n!==void 0?n:qs(t,r)},zd=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?W(e[n])||e[n]instanceof String||W(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):zd(e[n],t[n],r):e[n]=t[n]);return e},on=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Y1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const J1=e=>W(e)?e.replace(/[&<>"'\/]/g,t=>Y1[t]):e;class Q1{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const Z1=[" ",",","?","!",";"],ew=new Q1(20),tw=(e,t,r)=>{t=t||"",r=r||"";const n=Z1.filter(o=>t.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const i=ew.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!i.test(e);if(!s){const o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(s=!0)}return s},bl=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let s=0;s<n.length;){if(!i||typeof i!="object")return;let o,a="";for(let l=s;l<n.length;++l)if(l!==s&&(a+=r),a+=n[l],o=i[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<n.length-1)continue;s+=l-s+1;break}i=o}return i},Gs=e=>e&&e.replace("_","-"),rw={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Xs{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||rw,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(W(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new Xs(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xs(this.logger,t)}}var $t=new Xs;class Ys{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[a,l]=o;for(let f=0;f<l;f++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,l]=o;for(let f=0;f<l;f++)a.apply(a,[t,...n])})}}class Vd extends Ys{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,r],n&&(Array.isArray(n)?a.push(...n):W(n)&&s?a.push(...n.split(s)):a.push(n)));const l=qs(this.data,a);return!l&&!r&&!n&&t.indexOf(".")>-1&&(t=a[0],r=a[1],n=a.slice(2).join(".")),l||!o||!W(n)?l:bl(this.data&&this.data[t]&&this.data[t][r],n,s)}addResource(t,r,n,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let a=[t,r];n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(a=t.split("."),i=r,r=a[1]),this.addNamespaces(r),Dd(this.data,a,i),s.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in n)(W(n[s])||Array.isArray(n[s]))&&this.addResource(t,r,s,n[s],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,r];t.indexOf(".")>-1&&(a=t.split("."),i=n,n=r,r=a[1]),this.addNamespaces(r);let l=qs(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?zd(l,n,s):l={...l,...n},Dd(this.data,a,l),o.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,r)}:this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var Hd={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,r,n,i))}),t}};const Wd={};class Js extends Ys{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),K1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$t.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let s=r.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!tw(t,n,i);if(o&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:W(s)?[s]:s};const f=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),t=f.join(i)}return{key:t,namespaces:W(s)?[s]:s}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(t[t.length-1],r),l=a[a.length-1],f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(h){const E=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${E}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${E}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:o}const g=this.resolve(t,r);let d=g&&g.res;const $=g&&g.usedKey||o,S=g&&g.exactUsedKey||o,C=Object.prototype.toString.apply(d),m=["[object Number]","[object Function]","[object RegExp]"],v=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k=!W(d)&&typeof d!="boolean"&&typeof d!="number";if(w&&d&&k&&m.indexOf(C)<0&&!(W(v)&&Array.isArray(d))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler($,d,{...r,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(g.res=E,g.usedParams=this.getUsedParamsDetails(r),g):E}if(s){const E=Array.isArray(d),j=E?[]:{},T=E?S:$;for(const _ in d)if(Object.prototype.hasOwnProperty.call(d,_)){const R=`${T}${s}${_}`;j[_]=this.translate(R,{...r,joinArrays:!1,ns:a}),j[_]===R&&(j[_]=d[_])}d=j}}else if(w&&W(v)&&Array.isArray(d))d=d.join(v),d&&(d=this.extendTranslation(d,t,r,n));else{let E=!1,j=!1;const T=r.count!==void 0&&!W(r.count),_=Js.hasDefaultValue(r),R=T?this.pluralResolver.getSuffix(f,r.count,r):"",B=r.ordinal&&T?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",q=T&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),Ue=q&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${R}`]||r[`defaultValue${B}`]||r.defaultValue;!this.isValidLookup(d)&&_&&(E=!0,d=Ue),this.isValidLookup(d)||(j=!0,d=o);const le=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:d,Be=_&&Ue!==d&&this.options.updateMissing;if(j||E||Be){if(this.logger.log(Be?"updateKey":"missingKey",f,l,o,Be?Ue:d),s){const I=this.resolve(o,{...r,keySeparator:!1});I&&I.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Ee=[];const Me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Me&&Me[0])for(let I=0;I<Me.length;I++)Ee.push(Me[I]);else this.options.saveMissingTo==="all"?Ee=this.languageUtils.toResolveHierarchy(r.lng||this.language):Ee.push(r.lng||this.language);const A=(I,U,Y)=>{const O=_&&Y!==d?Y:le;this.options.missingKeyHandler?this.options.missingKeyHandler(I,l,U,O,Be,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(I,l,U,O,Be,r),this.emit("missingKey",I,l,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?Ee.forEach(I=>{const U=this.pluralResolver.getSuffixes(I,r);q&&r[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(Y=>{A([I],o+Y,r[`defaultValue${Y}`]||Ue)})}):A(Ee,o,Ue))}d=this.extendTranslation(d,t,r,g,n),j&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${l}:${o}`),(j||E)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,E?d:void 0):d=this.options.parseMissingKeyHandler(d))}return i?(g.res=d,g.usedParams=this.getUsedParamsDetails(r),g):d}extendTranslation(t,r,n,i,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=W(t)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const d=t.match(this.interpolator.nestingRegexp);h=d&&d.length}let g=n.replace&&!W(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,n.lng||this.language||i.usedLng,n),f){const d=t.match(this.interpolator.nestingRegexp),$=d&&d.length;h<$&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var d=arguments.length,$=new Array(d),S=0;S<d;S++)$[S]=arguments[S];return s&&s[0]===$[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${$[0]} in key: ${r[0]}`),null):o.translate(...$,r)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,l=W(a)?[a]:a;return t!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(t=Hd.handle(l,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,s,o,a;return W(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const f=this.extractFromKey(l,r),h=f.key;i=h;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const d=r.count!==void 0&&!W(r.count),$=d&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),S=r.context!==void 0&&(W(r.context)||typeof r.context=="number")&&r.context!=="",C=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);g.forEach(m=>{this.isValidLookup(n)||(a=m,!Wd[`${C[0]}-${m}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(Wd[`${C[0]}-${m}`]=!0,this.logger.warn(`key "${i}" for languages "${C.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(v=>{if(this.isValidLookup(n))return;o=v;const w=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,h,v,m,r);else{let E;d&&(E=this.pluralResolver.getSuffix(v,r.count,r));const j=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(w.push(h+E),r.ordinal&&E.indexOf(T)===0&&w.push(h+E.replace(T,this.options.pluralSeparator)),$&&w.push(h+j)),S){const _=`${h}${this.options.contextSeparator}${r.context}`;w.push(_),d&&(w.push(_+E),r.ordinal&&E.indexOf(T)===0&&w.push(_+E.replace(T,this.options.pluralSeparator)),$&&w.push(_+j))}}let k;for(;k=w.pop();)this.isValidLookup(n)||(s=k,n=this.getResource(v,m,k,r))}))})}),{res:n,usedKey:i,exactUsedKey:s,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!W(t.replace);let i=n?t.replace:t;if(n&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const s of r)delete i[s]}return i}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}const Fl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Kd{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$t.create("languageUtils")}getScriptPartFromCode(t){if(t=Gs(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=Gs(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(W(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(t)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fl(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fl(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fl(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),W(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],s=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return W(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):W(t)&&s(this.formatLanguageCode(t)),n.forEach(o=>{i.indexOf(o)<0&&s(this.formatLanguageCode(o))}),i}}let nw=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],iw={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const sw=["v1","v2","v3"],ow=["v4"],qd={zero:0,one:1,two:2,few:3,many:4,other:5},aw=()=>{const e={};return nw.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:iw[t.fc]}})}),e};class lw{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=$t.create("pluralResolver"),(!this.options.compatibilityJSON||ow.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=aw(),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const n=Gs(t==="dev"?"en":t),i=r.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(!t.match(/-|_/))return;const l=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(l,r)}return this.pluralRulesCache[s]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,s)=>qd[i]-qd[s]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const s=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!sw.includes(this.options.compatibilityJSON)}}const Gd=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=X1(e,t,r);return!s&&i&&W(r)&&(s=bl(e,r,n),s===void 0&&(s=bl(t,r,n))),s},Ll=e=>e.replace(/\$/g,"$$$$");class uw{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$t.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:s,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:f,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:d,nestingPrefixEscaped:$,nestingSuffix:S,nestingSuffixEscaped:C,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:w}=t.interpolation;this.escape=r!==void 0?r:J1,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?on(s):o||"{{",this.suffix=a?on(a):l||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=d?on(d):$||on("$t("),this.nestingSuffix=S?on(S):C||on(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,n,i){let s,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=$=>{if($.indexOf(this.formatSeparator)<0){const v=Gd(r,l,$,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,n,{...i,...r,interpolationkey:$}):v}const S=$.split(this.formatSeparator),C=S.shift().trim(),m=S.join(this.formatSeparator).trim();return this.format(Gd(r,l,C,this.options.keySeparator,this.options.ignoreJSONStructure),m,n,{...i,...r,interpolationkey:C})};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:$=>Ll($)},{regex:this.regexp,safeValue:$=>this.escapeValue?Ll(this.escape($)):Ll($)}].forEach($=>{for(a=0;s=$.regex.exec(t);){const S=s[1].trim();if(o=f(S),o===void 0)if(typeof h=="function"){const m=h(t,s,i);o=W(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,S))o="";else if(g){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),o="";else!W(o)&&!this.useRawValueToEscape&&(o=Ud(o));const C=$.safeValue(o);if(t=t.replace(s[0],C),g?($.regex.lastIndex+=o.length,$.regex.lastIndex-=s[0].length):$.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,o;const a=(l,f)=>{const h=this.nestingOptionsSeparator;if(l.indexOf(h)<0)return l;const g=l.split(new RegExp(`${h}[ ]*{`));let d=`{${g[1]}`;l=g[0],d=this.interpolate(d,o);const $=d.match(/'/g),S=d.match(/"/g);($&&$.length%2===0&&!S||S.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),f&&(o={...f,...o})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,C),`${l}${h}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];o={...n},o=o.replace&&!W(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let f=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const h=i[1].split(this.formatSeparator).map(g=>g.trim());i[1]=h.shift(),l=h,f=!0}if(s=r(a.call(this,i[1].trim(),o),o),s&&i[0]===t&&!W(s))return s;W(s)||(s=Ud(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),s=""),f&&(s=l.reduce((h,g)=>this.format(h,g,n.lng,{...n,interpolationkey:i[1].trim()}),s.trim())),t=t.replace(i[0],s),this.regexp.lastIndex=0}return t}}const cw=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),f=l.join(":").trim().replace(/^'+|'+$/g,""),h=a.trim();r[h]||(r[h]=f),f==="false"&&(r[h]=!1),f==="true"&&(r[h]=!0),isNaN(f)||(r[h]=parseInt(f,10))}})}return{formatName:t,formatOptions:r}},an=e=>{const t={};return(r,n,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const o=n+JSON.stringify(s);let a=t[o];return a||(a=e(Gs(n),i),t[o]=a),a(r)}};class fw{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$t.create("formatter"),this.options=t,this.formats={number:an((r,n)=>{const i=new Intl.NumberFormat(r,{...n});return s=>i.format(s)}),currency:an((r,n)=>{const i=new Intl.NumberFormat(r,{...n,style:"currency"});return s=>i.format(s)}),datetime:an((r,n)=>{const i=new Intl.DateTimeFormat(r,{...n});return s=>i.format(s)}),relativetime:an((r,n)=>{const i=new Intl.RelativeTimeFormat(r,{...n});return s=>i.format(s,n.range||"day")}),list:an((r,n)=>{const i=new Intl.ListFormat(r,{...n});return s=>i.format(s)})},this.init(t)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=an(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=r.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(a=>a.indexOf(")")>-1)){const a=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,a)].join(this.formatSeparator)}return s.reduce((a,l)=>{const{formatName:f,formatOptions:h}=cw(l);if(this.formats[f]){let g=a;try{const d=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},$=d.locale||d.lng||i.locale||i.lng||n;g=this.formats[f](a,$,{...h,...i,...d})}catch(d){this.logger.warn(d)}return g}else this.logger.warn(`there was no format function for ${f}`);return a},t)}}const hw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class dw extends Ys{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=$t.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const s={},o={},a={},l={};return t.forEach(f=>{let h=!0;r.forEach(g=>{const d=`${f}|${g}`;!n.reload&&this.store.hasResourceBundle(f,g)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,h=!1,o[d]===void 0&&(o[d]=!0),s[d]===void 0&&(s[d]=!0),l[g]===void 0&&(l[g]=!0)))}),h||(a[f]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),s=i[0],o=i[1];r&&this.emit("failedLoading",s,o,r),!r&&n&&this.store.addResourceBundle(s,o,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const a={};this.queue.forEach(l=>{G1(l.loaded,[s],o),hw(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(f=>{a[f]||(a[f]={});const h=l.loaded[f];h.length&&h.forEach(g=>{a[f][g]===void 0&&(a[f][g]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:s,callback:o});return}this.readingCalls++;const a=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&h&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,s*2,o)},s);return}o(f,h)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const f=l(t,r);f&&typeof f.then=="function"?f.then(h=>a(null,h)).catch(a):a(null,f)}catch(f){a(f)}return}return l(t,r,a)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();W(t)&&(t=this.languageUtils.toResolveHierarchy(t)),W(r)&&(r=[r]);const s=this.queueLoad(t,r,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${r}loading namespace ${s} for language ${i} failed`,o),!o&&a&&this.logger.log(`${r}loaded namespace ${s} for language ${i}`,a),this.loaded(t,o,a)})}saveMissing(t,r,n,i,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:s},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(t,r,n,i,l):h=f(t,r,n,i),h&&typeof h.then=="function"?h.then(g=>a(null,g)).catch(a):a(null,h)}catch(h){a(h)}else f(t,r,n,i,a,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}const Xd=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),W(e[1])&&(t.defaultValue=e[1]),W(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Yd=e=>(W(e.ns)&&(e.ns=[e.ns]),W(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),W(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Qs=()=>{},pw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class Ei extends Ys{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Yd(t),this.services={},this.logger=$t,this.modules={external:[]},pw(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(W(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=Xd();this.options={...i,...this.options,...Yd(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const s=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?$t.init(s(this.modules.logger),this.options):$t.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=fw);const g=new Kd(this.options);this.store=new Vd(this.options.resources,this.options);const d=this.services;d.logger=$t,d.resourceStore=this.store,d.languageUtils=g,d.pluralResolver=new lw(g,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=s(h),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new uw(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new dw(s(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function($){for(var S=arguments.length,C=new Array(S>1?S-1:0),m=1;m<S;m++)C[m-1]=arguments[m];t.emit($,...C)}),this.modules.languageDetector&&(d.languageDetector=s(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=s(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Js(this.services,this.options),this.translator.on("*",function($){for(var S=arguments.length,C=new Array(S>1?S-1:0),m=1;m<S;m++)C[m-1]=arguments[m];t.emit($,...C)}),this.modules.external.forEach($=>{$.init&&$.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Qs),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const l=xi(),f=()=>{const h=(g,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(d),n(g,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),l}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qs;const i=W(t)?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const s=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(s,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(a)})}else n(null)}reloadResources(t,r,n){const i=xi();return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),n||(n=Qs),this.services.backendConnector.reload(t,r,s=>{i.resolve(),n(s)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Hd.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=xi();this.emit("languageChanging",t);const s=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,f)=>{f?(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const f=W(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(f)),this.loadResources(f,h=>{o(h,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,r,n){var i=this;const s=function(o,a){let l;if(typeof a!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),g=2;g<f;g++)h[g-2]=arguments[g];l=i.options.overloadTranslationOptionHandler([o,a].concat(h))}else l={...a};l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const d=i.options.keySeparator||".";let $;return l.keyPrefix&&Array.isArray(o)?$=o.map(S=>`${l.keyPrefix}${d}${S}`):$=l.keyPrefix?`${l.keyPrefix}${d}${o}`:o,i.t($,l)};return W(t)?s.lng=t:s.lngs=t,s.ns=r,s.keyPrefix=n,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const f=this.services.backendConnector.state[`${a}|${l}`];return f===-1||f===0||f===2};if(r.precheck){const a=r.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,t)&&(!i||o(s,t)))}loadNamespaces(t,r){const n=xi();return this.options.ns?(W(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=xi();W(t)&&(t=[t]);const i=this.options.preload||[],s=t.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=i.concat(s),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["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"],n=this.services&&this.services.languageUtils||new Kd(Xd());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Ei(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qs;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},s=new Ei(i);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(a=>{s[a]=this[a]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n&&(s.store=new Vd(this.store.data,i),s.services.resourceStore=s.store),s.translator=new Js(s.services,i),s.translator.on("*",function(a){for(var l=arguments.length,f=new Array(l>1?l-1:0),h=1;h<l;h++)f[h-1]=arguments[h];s.emit(a,...f)}),s.init(i,r),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Jd=Ei.createInstance();Jd.createInstance=Ei.createInstance;var gw=Jd;const Qd=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),ln=Du(Qd);let Zs;const mw=new Uint8Array(16);function yw(){if(!Zs&&(Zs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zs(mw)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function vw(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}let Zd,Rl,Ul=0,Bl=0;function ww(e,t,r){let n=0;const i=new Array(16);e=e||{};let s=e.node||Zd,o=e.clockseq!==void 0?e.clockseq:Rl;if(s==null||o==null){const d=e.random||(e.rng||yw)();s==null&&(s=Zd=[d[0]|1,d[1],d[2],d[3],d[4],d[5]]),o==null&&(o=Rl=(d[6]<<8|d[7])&16383)}let a=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:Bl+1;const f=a-Ul+(l-Bl)/1e4;if(f<0&&e.clockseq===void 0&&(o=o+1&16383),(f<0||a>Ul)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ul=a,Bl=l,Rl=o,a+=122192928e5;const h=((a&268435455)*1e4+l)%4294967296;i[n++]=h>>>24&255,i[n++]=h>>>16&255,i[n++]=h>>>8&255,i[n++]=h&255;const g=a/4294967296*1e4&268435455;i[n++]=g>>>8&255,i[n++]=g&255,i[n++]=g>>>24&15|16,i[n++]=g>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(let d=0;d<6;++d)i[n+d]=s[d];return t||vw(i)}function $w(e,t){var s,o;const r=(((s=e.stack)==null?void 0:s.split(/\n/g))||[])[1],[n,...i]=((o=t.stack)==null?void 0:o.split(/\n/g))||[];return[n,r,...i].join(`
|
|
51
|
-
`)}var xw=Object.defineProperty,Sw=(e,t,r)=>t in e?xw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ct=(e,t,r)=>
|
|
51
|
+
`)}var xw=Object.defineProperty,Sw=(e,t,r)=>t in e?xw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ct=(e,t,r)=>Sw(e,typeof t!="symbol"?t+"":t,r);class Z extends Error{constructor(t={}){super(),ct(this,"statusCode"),ct(this,"errorType"),ct(this,"level"),ct(this,"id"),ct(this,"context"),ct(this,"help"),ct(this,"errorDetails"),ct(this,"code"),ct(this,"property"),ct(this,"redirect"),ct(this,"hideStack"),this.statusCode=500,this.errorType="InternalServerError",this.level="normal",this.message="The server has encountered an error.",this.id=ww(),this.id=t.id||this.id,this.statusCode=t.statusCode||this.statusCode,this.level=t.level||this.level,this.context=t.context,this.help=t.help,this.errorType=this.name=t.errorType||this.errorType,this.errorDetails=t.errorDetails,this.code=t.code||null,this.property=t.property||null,this.redirect=t.redirect||null,this.message=t.message||this.message,this.hideStack=t.hideStack||!1,t.err&&(typeof t.err=="string"&&(t.err=new Error(t.err)),Object.getOwnPropertyNames(t.err).forEach(r=>{if(["errorType","name","statusCode","message","level"].indexOf(r)===-1){if(r==="code"){this[r]=this[r]||t.err[r];return}if(r==="stack"&&!this.hideStack){this[r]=$w(this,t.err);return}this[r]=t.err[r]||this[r]}}))}}const ee=(e,t)=>{const r={...t};return Object.keys(e).forEach(n=>{e[n]!==void 0&&(r[n]=e[n])}),r};class un extends Z{constructor(t={}){super(ee(t,{statusCode:500,level:"critical",errorType:"InternalServerError",message:"The server has encountered an error."}))}}class ep extends Z{constructor(t={}){super(ee(t,{statusCode:400,level:"critical",errorType:"IncorrectUsageError",message:"We detected a misuse. Please read the stack trace."}))}}class tp extends Z{constructor(t={}){super(ee(t,{statusCode:404,errorType:"NotFoundError",message:"Resource could not be found.",hideStack:!0}))}}class Ml extends Z{constructor(t={}){super(ee(t,{statusCode:400,errorType:"BadRequestError",message:"The request could not be understood."}))}}class rp extends Z{constructor(t={}){super(ee(t,{statusCode:401,errorType:"UnauthorizedError",message:"You are not authorised to make this request."}))}}class Dl extends Z{constructor(t={}){super(ee(t,{statusCode:403,errorType:"NoPermissionError",message:"You do not have permission to perform this request."}))}}class zl extends Z{constructor(t={}){super(ee(t,{statusCode:422,errorType:"ValidationError",message:"The request failed validation."}))}}class np extends Z{constructor(t={}){super(ee(t,{statusCode:415,errorType:"UnsupportedMediaTypeError",message:"The media in the request is not supported by the server."}))}}class ip extends Z{constructor(t={}){super(ee(t,{statusCode:429,errorType:"TooManyRequestsError",message:"Server has received too many similar requests in a short space of time."}))}}class Vl extends Z{constructor(t={}){super(ee(t,{statusCode:503,errorType:"MaintenanceError",message:"The server is temporarily down for maintenance."}))}}class sp extends Z{constructor(t={}){super(ee(t,{statusCode:405,errorType:"MethodNotAllowedError",message:"Method not allowed for resource."}))}}class op extends Z{constructor(t={}){super(ee(t,{statusCode:406,errorType:"RequestNotAcceptableError",message:"Request not acceptable for provided Accept-Version header.",hideStack:!0}))}}class ap extends Z{constructor(t={}){super(ee(t,{statusCode:416,errorType:"RangeNotSatisfiableError",message:"Range not satisfiable for provided Range header.",hideStack:!0}))}}class lp extends Z{constructor(t={}){super(ee(t,{statusCode:413,errorType:"RequestEntityTooLargeError",message:"Request was too big for the server to handle."}))}}class up extends Z{constructor(t={}){super(ee(t,{statusCode:503,errorType:"TokenRevocationError",message:"Token is no longer available."}))}}class cp extends Z{constructor(t={}){super(ee(t,{statusCode:400,errorType:"VersionMismatchError",message:"Requested version does not match server version."}))}}class fp extends Z{constructor(t={}){super(ee(t,{statusCode:500,errorType:"DataExportError",message:"The server encountered an error whilst exporting data."}))}}class hp extends Z{constructor(t={}){super(ee(t,{statusCode:500,errorType:"DataImportError",message:"The server encountered an error whilst importing data."}))}}class dp extends Z{constructor(t={}){super(ee(t,{statusCode:500,errorType:"EmailError",message:"The server encountered an error whilst sending email."}))}}class pp extends Z{constructor(t={}){super(ee(t,{statusCode:422,errorType:"ThemeValidationError",message:"The theme has a validation error.",errorDetails:{}}))}}class gp extends Z{constructor(t={}){super(ee(t,{statusCode:409,errorType:"DisabledFeatureError",message:"Unable to complete the request, this feature is disabled."}))}}class mp extends Z{constructor(t={}){super(ee(t,{statusCode:409,errorType:"UpdateCollisionError",message:"Unable to complete the request, there was a conflict."}))}}class yp extends Z{constructor(t={}){super(ee(t,{errorType:"HostLimitError",hideStack:!0,statusCode:403,message:"Unable to complete the request, this resource is limited."}))}}class vp extends Z{constructor(t={}){super(ee(t,{errorType:"HelperWarning",hideStack:!0,statusCode:400,message:"A theme helper has done something unexpected."}))}}class wp extends Z{constructor(t={}){super(ee(t,{errorType:"PasswordResetRequiredError",statusCode:401,message:"For security, you need to create a new password. An email has been sent to you with instructions!"}))}}class $p extends Z{constructor(t={}){super(ee(t,{errorType:"UnhandledJobError",message:"Processed job threw an unhandled error",level:"critical"}))}}class xp extends Z{constructor(t={}){super(ee(t,{errorType:"NoContentError",statusCode:204,hideStack:!0}))}}class Sp extends Z{constructor(t={}){super(ee(t,{errorType:"ConflictError",statusCode:409,message:"The server has encountered an conflict."}))}}class Ep extends Z{constructor(t={}){super(ee(t,{errorType:"MigrationError",message:"An error has occurred applying a database migration.",level:"critical"}))}}const Cp=Object.freeze(Object.defineProperty({__proto__:null,BadRequestError:Ml,ConflictError:Sp,DataExportError:fp,DataImportError:hp,DisabledFeatureError:gp,EmailError:dp,HelperWarning:vp,HostLimitError:yp,IncorrectUsageError:ep,InternalServerError:un,MaintenanceError:Vl,MethodNotAllowedError:sp,MigrationError:Ep,NoContentError:xp,NoPermissionError:Dl,NotFoundError:tp,PasswordResetRequiredError:wp,RangeNotSatisfiableError:ap,RequestEntityTooLargeError:lp,RequestNotAcceptableError:op,ThemeValidationError:pp,TokenRevocationError:up,TooManyRequestsError:ip,UnauthorizedError:rp,UnhandledJobError:$p,UnsupportedMediaTypeError:np,UpdateCollisionError:mp,ValidationError:zl,VersionMismatchError:cp},Symbol.toStringTag,{value:"Module"}));/**
|
|
52
52
|
* @license Apache-2.0
|
|
53
53
|
*
|
|
54
54
|
* Copyright (c) 2018 The Stdlib Authors.
|