@tryghost/sodo-search 1.5.2 → 1.5.4
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.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"test:unit": "yarn test:ci",
|
|
34
34
|
"lint": "eslint src --ext .js --cache",
|
|
35
35
|
"preship": "yarn lint",
|
|
36
|
-
"ship": "
|
|
37
|
-
"postship": "git push ${GHOST_UPSTREAM:-origin} --follow-tags && npm publish",
|
|
36
|
+
"ship": "node ../../.github/scripts/release-apps.js",
|
|
38
37
|
"prepublishOnly": "yarn build"
|
|
39
38
|
},
|
|
40
39
|
"eslintConfig": {
|
|
@@ -86,7 +85,7 @@
|
|
|
86
85
|
"@testing-library/react": "12.1.5",
|
|
87
86
|
"@vitejs/plugin-react": "4.2.1",
|
|
88
87
|
"jsdom": "24.1.3",
|
|
89
|
-
"nock": "13.
|
|
88
|
+
"nock": "13.5.6",
|
|
90
89
|
"vite": "4.5.3",
|
|
91
90
|
"vite-plugin-svgr": "3.3.0",
|
|
92
91
|
"vitest": "0.34.3"
|
package/umd/sodo-search.min.js
CHANGED
|
@@ -52,5 +52,5 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
52
52
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[sd]=this[sd]={accessors:{}}).accessors,s=this.prototype;function o(i){const l=Fr(i);r[l]||(zm(s,i),r[l]=!0)}return x.isArray(t)?t.forEach(o):o(t),this}}oo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),x.reduceDescriptors(oo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),x.freezeMethods(oo);var nt=oo;function Hl(e,t){const n=this||Bl,r=t||n,s=nt.from(r.headers);let o=r.data;return x.forEach(e,function(l){o=l.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function od(e){return!!(e&&e.__CANCEL__)}function Dr(e,t,n){D.call(this,e??"canceled",D.ERR_CANCELED,t,n),this.name="CanceledError"}x.inherits(Dr,D,{__CANCEL__:!0});function Mm(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new D("Request failed with status code "+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}var Um=We.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];x.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),x.isString(r)&&i.push("path="+r),x.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Bm(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vm(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function id(e,t){return e&&!Bm(t)?Vm(e,t):t}var Hm=We.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const l=x.isString(i)?s(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}();function Wm(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Km(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),f=r[o];i||(i=u),n[s]=a,r[s]=u;let p=o,c=0;for(;p!==s;)c+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const v=f&&u-f;return v?Math.round(c*1e3/v):void 0}}function ld(e,t){let n=0;const r=Km(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,l=o-n,a=r(l),u=o<=i;n=o;const f={loaded:o,total:i,progress:i?o/i:void 0,bytes:l,rate:a||void 0,estimated:a&&i&&u?(i-o)/a:void 0,event:s};f[t?"download":"upload"]=!0,e(f)}}var bm=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=nt.from(e.headers).normalize();let{responseType:i,withXSRFToken:l}=e,a;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}let f;if(x.isFormData(s)){if(We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((f=o.getContentType())!==!1){const[y,...h]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([y||"multipart/form-data",...h].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const y=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+h))}const c=id(e.baseURL,e.url);p.open(e.method.toUpperCase(),Zf(c,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function v(){if(!p)return;const y=nt.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),d={data:!i||i==="text"||i==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:y,config:e,request:p};Mm(function(w){n(w),u()},function(w){r(w),u()},d),p=null}if("onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new D("Request aborted",D.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new D("Network Error",D.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const d=e.transitional||td;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new D(h,d.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,p)),p=null},We.hasStandardBrowserEnv&&(l&&x.isFunction(l)&&(l=l(e)),l||l!==!1&&Hm(c))){const y=e.xsrfHeaderName&&e.xsrfCookieName&&Um.read(e.xsrfCookieName);y&&o.set(e.xsrfHeaderName,y)}s===void 0&&o.setContentType(null),"setRequestHeader"in p&&x.forEach(o.toJSON(),function(h,d){p.setRequestHeader(d,h)}),x.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),i&&i!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",ld(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",ld(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=y=>{p&&(r(!y||y.type?new Dr(null,e,p):y),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const m=Wm(c);if(m&&We.protocols.indexOf(m)===-1){r(new D("Unsupported protocol "+m+":",D.ERR_BAD_REQUEST,e));return}p.send(s||null)})};const Wl={http:ym,xhr:bm};x.forEach(Wl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ad=e=>`- ${e}`,qm=e=>x.isFunction(e)||e===null||e===!1;var ud={getAdapter:e=>{e=x.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!qm(n)&&(r=Wl[(i=String(n)).toLowerCase()],r===void 0))throw new D(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([l,a])=>`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
53
53
|
`+o.map(ad).join(`
|
|
54
54
|
`):" "+ad(o[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Wl};function Kl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Dr(null,e)}function cd(e){return Kl(e),e.headers=nt.from(e.headers),e.data=Hl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ud.getAdapter(e.adapter||Bl.adapter)(e).then(function(r){return Kl(e),r.data=Hl.call(e,e.transformResponse,r),r.headers=nt.from(r.headers),r},function(r){return od(r)||(Kl(e),r&&r.response&&(r.response.data=Hl.call(e,e.transformResponse,r.response),r.response.headers=nt.from(r.response.headers))),Promise.reject(r)})}const fd=e=>e instanceof nt?{...e}:e;function kn(e,t){t=t||{};const n={};function r(u,f,p){return x.isPlainObject(u)&&x.isPlainObject(f)?x.merge.call({caseless:p},u,f):x.isPlainObject(f)?x.merge({},f):x.isArray(f)?f.slice():f}function s(u,f,p){if(x.isUndefined(f)){if(!x.isUndefined(u))return r(void 0,u,p)}else return r(u,f,p)}function o(u,f){if(!x.isUndefined(f))return r(void 0,f)}function i(u,f){if(x.isUndefined(f)){if(!x.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function l(u,f,p){if(p in t)return r(u,f);if(p in e)return r(void 0,u)}const a={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,f)=>s(fd(u),fd(f),!0)};return x.forEach(Object.keys(Object.assign({},e,t)),function(f){const p=a[f]||s,c=p(e[f],t[f],f);x.isUndefined(c)&&p!==l||(n[f]=c)}),n}const dd="1.6.8",bl={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bl[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hd={};bl.transitional=function(t,n,r){function s(o,i){return"[Axios v"+dd+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,l)=>{if(t===!1)throw new D(s(i," has been removed"+(n?" in "+n:"")),D.ERR_DEPRECATED);return n&&!hd[i]&&(hd[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};function Jm(e,t,n){if(typeof e!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const l=e[o],a=l===void 0||i(l,o,e);if(a!==!0)throw new D("option "+o+" must be "+a,D.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new D("Unknown option "+o,D.ERR_BAD_OPTION)}}var ql={assertOptions:Jm,validators:bl};const Pt=ql.validators;class io{constructor(t){this.defaults=t,this.interceptors={request:new ed,response:new ed}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
55
|
-
`+o):r.stack=o}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=kn(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ql.assertOptions(r,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),s!=null&&(x.isFunction(s)?n.paramsSerializer={serialize:s}:ql.assertOptions(s,{encode:Pt.function,serialize:Pt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&x.merge(o.common,o[n.method]);o&&x.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=nt.concat(i,o);const l=[];let a=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(a=a&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let f,p=0,c;if(!a){const m=[cd.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),c=m.length,f=Promise.resolve(n);p<c;)f=f.then(m[p++],m[p++]);return f}c=l.length;let v=n;for(p=0;p<c;){const m=l[p++],y=l[p++];try{v=m(v)}catch(h){y.call(this,h);break}}try{f=cd.call(this,v)}catch(m){return Promise.reject(m)}for(p=0,c=u.length;p<c;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=kn(this.defaults,t);const n=id(t.baseURL,t.url);return Zf(n,t.params,t.paramsSerializer)}}x.forEach(["delete","get","head","options"],function(t){io.prototype[t]=function(n,r){return this.request(kn(r||{},{method:t,url:n,data:(r||{}).data}))}}),x.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(kn(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}io.prototype[t]=n(),io.prototype[t+"Form"]=n(!0)});var lo=io;class Jl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new Dr(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Jl(function(s){t=s}),cancel:t}}}var Qm=Jl;function Gm(e){return function(n){return e.apply(null,n)}}function Xm(e){return x.isObject(e)&&e.isAxiosError===!0}const Ql={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ql).forEach(([e,t])=>{Ql[t]=e});var Ym=Ql;function pd(e){const t=new lo(e),n=If(lo.prototype.request,t);return x.extend(n,lo.prototype,t,{allOwnKeys:!0}),x.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return pd(kn(e,s))},n}const G=pd(Bl);G.Axios=lo,G.CanceledError=Dr,G.CancelToken=Qm,G.isCancel=od,G.VERSION=dd,G.toFormData=ro,G.AxiosError=D,G.Cancel=G.CanceledError,G.all=function(t){return Promise.all(t)},G.spread=Gm,G.isAxiosError=Xm,G.mergeConfig=kn,G.AxiosHeaders=nt,G.formToJSON=e=>rd(x.isHTMLForm(e)?new FormData(e):e),G.getAdapter=ud.getAdapter,G.HttpStatusCode=Ym,G.default=G;var Zm=G,e0="@tryghost/content-api",t0="1.11.21",n0="https://github.com/TryGhost/SDK/tree/main/packages/content-api",r0="Ghost Foundation",s0="MIT",o0="cjs/content-api.js",i0="umd/content-api.min.js",l0="es/content-api.js",a0="lib/content-api.js",u0=["LICENSE","README.md","cjs/","lib/","umd/","es/"],c0={dev:'echo "Implement me!"',pretest:"yarn build",test:"NODE_ENV=testing c8 --all --reporter text --reporter cobertura mocha './test/**/*.test.js'",build:"rollup -c",lint:"eslint . --ext .js --cache",prepare:"NODE_ENV=production yarn build",posttest:"yarn lint"},f0={access:"public"},d0={"@babel/core":"7.24.4","@babel/polyfill":"7.12.1","@babel/preset-env":"7.24.4","@rollup/plugin-json":"6.1.0",c8:"9.1.0","core-js":"3.37.0","eslint-plugin-ghost":"3.4.0",mocha:"10.4.0",rollup:"2.79.1","rollup-plugin-babel":"4.4.0","rollup-plugin-commonjs":"10.1.0","rollup-plugin-node-resolve":"5.2.0","rollup-plugin-polyfill-node":"0.12.0","rollup-plugin-replace":"2.2.0","rollup-plugin-terser":"7.0.2",should:"13.2.3",sinon:"17.0.1"},h0={axios:"^1.0.0"},p0="048ccde4bd78d2dcd60e778d03eb8dc3227cece5",g0={name:e0,version:t0,repository:n0,author:r0,license:s0,main:o0,"umd:main":"umd/content-api.min.js",unpkg:i0,module:l0,source:a0,files:u0,scripts:c0,publishConfig:f0,devDependencies:d0,dependencies:h0,gitHead:p0};const m0=!1,y0=g0.version,gd="v5.0",md=["v2","v3","v4","v5","canary"],Le="@tryghost/content-api",v0=e=>{let t;return e==="v5"||e===void 0||e.match(/^v5\.\d+/)?t="/content/":e.match(/^v\d+\.\d+/)?t=`/${/^(v\d+)\.\d+/.exec(e)[1]}/content/`:t=`/${e}/content/`,t},w0=e=>{let{url:t,method:n,params:r,headers:s}=e;return Zm[n](t,{params:r,paramsSerializer:o=>Object.keys(o).reduce((i,l)=>{const a=encodeURIComponent([].concat(o[l]).join(","));return i.concat(`${l}=${a}`)},[]).join("&"),headers:s})};function Gl(e){let{url:t,key:n,host:r,version:s,userAgent:o,ghostPath:i="ghost",makeRequest:l=w0}=e;if(r&&(console.warn(`${Le}: The 'host' parameter is deprecated, please use 'url' instead`),t||(t=r)),this instanceof Gl)return Gl({url:t,key:n,version:s,userAgent:o,ghostPath:i,makeRequest:l});if(s===void 0)throw new Error(`${Le} Config Missing: 'version' is required. E.g. ${md.join(",")}`);let a;if(typeof s=="boolean")s===!0&&(a=gd),s=void 0;else{if(s&&!md.includes(s)&&!s.match(/^v\d+\.\d+/))throw new Error(`${Le} Config Invalid: 'version' ${s} is not supported`);s==="canary"?(console.warn(`${Le}: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead`),a=gd):s.match(/^v\d+$/)?(console.warn(`${Le}: The 'version' parameter has a deprecated format 'v{major}', please use 'v{major}.{minor}' format instead`),a=`${s}.0`):a=s}if(!t)throw new Error(`${Le} Config Missing: 'url' is required. E.g. 'https://site.com'`);if(!/https?:\/\//.test(t))throw new Error(`${Le} Config Invalid: 'url' ${t} requires a protocol. E.g. 'https://site.com'`);if(t.endsWith("/"))throw new Error(`${Le} Config Invalid: 'url' ${t} must not have a trailing slash. E.g. 'https://site.com'`);if(i.endsWith("/")||i.startsWith("/"))throw new Error(`${Le} Config Invalid: 'ghostPath' ${i} must not have a leading or trailing slash. E.g. 'ghost'`);if(n&&!/[0-9a-f]{26}/.test(n))throw new Error(`${Le} Config Invalid: 'key' ${n} must have 26 hex characters`);o===void 0&&(o=m0);const u=["posts","authors","tags","pages","settings","tiers","newsletters","offers"].reduce((p,c)=>{function v(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;return f(c,y,null,h)}function m(y){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=arguments.length>2?arguments[2]:void 0;if(!y||!y.id&&!y.slug)return Promise.reject(new Error(`${Le} read requires an id or slug.`));const g=Object.assign({},y,h);return f(c,g,y.id||`slug/${y.slug}`,d)}return Object.assign(p,{[c]:{read:m,browse:v}})},{});return delete u.settings.read,delete u.tiers.read,delete u.newsletters.read,delete u.offers.browse,u;function f(p,c,v){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(!m&&!n)return Promise.reject(new Error(`${Le} Config Missing: 'key' is required.`));delete c.id;const y=m?{Authorization:`GhostMembers ${m}`}:{};o&&(typeof o=="boolean"?y["User-Agent"]=`GhostContentSDK/${y0}`:y["User-Agent"]=o),a&&(y["Accept-Version"]=a),c=Object.assign({key:n},c);const h=`${t}/${i}/api${v0(s)}${p}/${v?v+"/":""}`;return l({url:h,method:"get",params:c,headers:y}).then(d=>Array.isArray(d.data[p])?d.data[p].length===1&&!d.data.meta?d.data[p][0]:Object.assign(d.data[p],{meta:d.data.meta}):d.data[p]).catch(d=>{if(d.response&&d.response.data&&d.response.data.errors){const g=d.response.data.errors[0],w=new Error(g.message),S=Object.keys(g);throw w.name=g.type,S.forEach(T=>{w[T]=g[T]}),w.response=d.response,w.request=d.request,w.config=d.config,w}else throw d})}}class S0{constructor({adminUrl:t,apiKey:n,dir:r}){Ln(this,yo);Ln(this,vo);Ln(this,wo);Ln(this,Nn);Ln(this,An);this.api=new Gl({url:t,key:n,version:"v5.0"});const s=r==="rtl",o=r==="rtl"?"reverse":"forward";this.postsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["title","excerpt"],store:!0},...Je(this,An,Co).call(this)}),this.authorsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["name"],store:!0},...Je(this,An,Co).call(this)}),this.tagsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["name"],store:!0},...Je(this,An,Co).call(this)}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async init(){let t=await this.api.posts.browse({limit:"10000",fields:"id,slug,title,excerpt,url,updated_at,visibility",order:"updated_at DESC"});(t||t.length>0)&&(t.length||(t=[t]),Je(this,yo,zd).call(this,t));let n=await this.api.authors.browse({limit:"10000",fields:"id,slug,name,url,profile_image",order:"updated_at DESC"});(n||n.length>0)&&(n.length||(n=[n]),Je(this,vo,Md).call(this,n));let r=await this.api.tags.browse({limit:"10000",fields:"id,slug,name,url",order:"updated_at DESC",filter:"visibility:public"});(r||r.length>0)&&(r.length||(r=[r]),Je(this,wo,Ud).call(this,r))}search(t){const n=this.postsIndex.search(t,{enrich:!0}),r=this.authorsIndex.search(t,{enrich:!0}),s=this.tagsIndex.search(t,{enrich:!0});return{posts:Je(this,Nn,xo).call(this,n),authors:Je(this,Nn,xo).call(this,r),tags:Je(this,Nn,xo).call(this,s)}}}yo=new WeakSet,zd=function(t){t.forEach(n=>{this.postsIndex.add(n)})},vo=new WeakSet,Md=function(t){t.forEach(n=>{this.authorsIndex.add(n)})},wo=new WeakSet,Ud=function(t){t.forEach(n=>{this.tagsIndex.add(n)})},Nn=new WeakSet,xo=function(t){const n=[],r={};return t.forEach(s=>{s.result.forEach(o=>{r[o.id]||(n.push(o.doc),r[o.id]=!0)})}),n},An=new WeakSet,Co=function(){const t=new RegExp("[一-鿿-ゟ゠-ヿ가-힣㐀-䶿𠀀-𪛟𪜀-𫝀-𫠠-𬺰-𰀀-𱍐-𲎯-豈-丽-]|[0-9A-Za-zа-яÀ-ſЀ-ӿ-ۿঀ-Ḁ-ỿ]+","mug");return{encode:n=>(""+n).toLowerCase().match(t)??[]}};const x0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},C0={Authors:"الكتّاب",Cancel:"إلغاء","No matches found":"لا يوجد نتائج مطابقة",Posts:"منشورات","Search posts, tags and authors":"قم بالبحث عن المنشورات، الوسوم و الكتّاب","Show more results":"اظهر المزيد من النتائج",Tags:"الوسوم"},$0={Authors:"Автори",Cancel:"Отказ","No matches found":"Няма намерени съвпадения",Posts:"Публикации","Search posts, tags and authors":"Търсене в публикации, етикети и автори","Show more results":"Покажи още резултати",Tags:"Етикети"},E0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},k0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},P0={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"},T0={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"},N0={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"},A0={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"},j0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},O0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},L0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},R0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},_0={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"},F0={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"},D0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},I0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},z0={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"},M0={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"},U0={Authors:"מחברים",Cancel:"ביטול","No matches found":"לא נמצאו התאמות",Posts:"פוסטים","Search posts, tags and authors":"חיפוש פוסטים, תגיות ומחברים","Show more results":"הצגת תוצאות נוספות",Tags:"תגיות"},B0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},V0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},H0={Authors:"Szerzők",Cancel:"Mégse","No matches found":"Nincs találat",Posts:"Bejegyzések","Search posts, tags and authors":"Keresés bejegyzések, címkék és szerzők között","Show more results":"További találatok megjelenítése",Tags:"Címkék"},W0={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"},K0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},b0={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"},q0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},J0={Authors:"작성자",Cancel:"취소","No matches found":"일치하는 결과가 없어요",Posts:"게시물","Search posts, tags and authors":"게시물, 태그, 작성자 검색","Show more results":"더 많은 결과 보기",Tags:"태그"},Q0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},G0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},X0={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"},Y0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Z0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},e1={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:"ट्यागहरू"},n1={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"},r1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},s1={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"},o1={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"},i1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},l1={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"},a1={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"},u1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},c1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},f1={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"},d1={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"},h1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},p1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},g1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},m1={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"},y1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},v1={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"},w1={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:""},x1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},C1={Authors:"Tác giả",Cancel:"Hủy bỏ","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"},$1={Authors:"作者",Cancel:"取消","No matches found":"未找到匹配项",Posts:"文章","Search posts, tags and authors":"搜索文章、标签和作者","Show more results":"显示更多结果",Tags:"标签"},E1={Authors:"作者",Cancel:"取消","No matches found":"無相符結果",Posts:"文章","Search posts, tags and authors":"搜尋文章、標籤與作者","Show more results":"更多結果",Tags:"標籤"},k1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},P1={Authors:"ஆசிரியர்கள்",Cancel:"ரத்து செய்","No matches found":"பொருத்தங்கள் எதுவும் இல்லை",Posts:"பதிவுகள்","Search posts, tags and authors":"பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்","Show more results":"மேலும் முடிவுகளைக் காட்டு",Tags:"குறிச்சொற்கள்"};var yd;function vd(){return yd||(yd={"/ghost/i18n/locales/af/search.json":function(){return x0},"/ghost/i18n/locales/ar/search.json":function(){return C0},"/ghost/i18n/locales/bg/search.json":function(){return $0},"/ghost/i18n/locales/bn/search.json":function(){return E0},"/ghost/i18n/locales/bs/search.json":function(){return k0},"/ghost/i18n/locales/ca/search.json":function(){return P0},"/ghost/i18n/locales/cs/search.json":function(){return T0},"/ghost/i18n/locales/da/search.json":function(){return N0},"/ghost/i18n/locales/de/search.json":function(){return A0},"/ghost/i18n/locales/de-CH/search.json":function(){return j0},"/ghost/i18n/locales/el/search.json":function(){return O0},"/ghost/i18n/locales/en/search.json":function(){return L0},"/ghost/i18n/locales/eo/search.json":function(){return R0},"/ghost/i18n/locales/es/search.json":function(){return _0},"/ghost/i18n/locales/et/search.json":function(){return F0},"/ghost/i18n/locales/fa/search.json":function(){return D0},"/ghost/i18n/locales/fi/search.json":function(){return I0},"/ghost/i18n/locales/fr/search.json":function(){return z0},"/ghost/i18n/locales/gd/search.json":function(){return M0},"/ghost/i18n/locales/he/search.json":function(){return U0},"/ghost/i18n/locales/hi/search.json":function(){return B0},"/ghost/i18n/locales/hr/search.json":function(){return V0},"/ghost/i18n/locales/hu/search.json":function(){return H0},"/ghost/i18n/locales/id/search.json":function(){return W0},"/ghost/i18n/locales/is/search.json":function(){return K0},"/ghost/i18n/locales/it/search.json":function(){return b0},"/ghost/i18n/locales/ja/search.json":function(){return q0},"/ghost/i18n/locales/ko/search.json":function(){return J0},"/ghost/i18n/locales/kz/search.json":function(){return Q0},"/ghost/i18n/locales/lt/search.json":function(){return G0},"/ghost/i18n/locales/lv/search.json":function(){return X0},"/ghost/i18n/locales/mk/search.json":function(){return Y0},"/ghost/i18n/locales/mn/search.json":function(){return Z0},"/ghost/i18n/locales/ms/search.json":function(){return e1},"/ghost/i18n/locales/ne/search.json":function(){return t1},"/ghost/i18n/locales/nl/search.json":function(){return n1},"/ghost/i18n/locales/nn/search.json":function(){return r1},"/ghost/i18n/locales/no/search.json":function(){return s1},"/ghost/i18n/locales/pl/search.json":function(){return o1},"/ghost/i18n/locales/pt/search.json":function(){return i1},"/ghost/i18n/locales/pt-BR/search.json":function(){return l1},"/ghost/i18n/locales/ro/search.json":function(){return a1},"/ghost/i18n/locales/ru/search.json":function(){return u1},"/ghost/i18n/locales/si/search.json":function(){return c1},"/ghost/i18n/locales/sk/search.json":function(){return f1},"/ghost/i18n/locales/sl/search.json":function(){return d1},"/ghost/i18n/locales/sq/search.json":function(){return h1},"/ghost/i18n/locales/sr/search.json":function(){return p1},"/ghost/i18n/locales/sr-Cyrl/search.json":function(){return g1},"/ghost/i18n/locales/sv/search.json":function(){return m1},"/ghost/i18n/locales/th/search.json":function(){return y1},"/ghost/i18n/locales/tr/search.json":function(){return v1},"/ghost/i18n/locales/uk/search.json":function(){return w1},"/ghost/i18n/locales/ur/search.json":function(){return S1},"/ghost/i18n/locales/uz/search.json":function(){return x1},"/ghost/i18n/locales/vi/search.json":function(){return C1},"/ghost/i18n/locales/zh/search.json":function(){return $1},"/ghost/i18n/locales/zh-Hant/search.json":function(){return E1},"/ghost/i18n/locales/sw/search.json":function(){return k1},"/ghost/i18n/locales/ta/search.json":function(){return P1}})}function wd(e){function t(n){var r=Sd(n,e);if(r!==null)return vd()[r]();throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return t.resolve=function(n){var r=Sd(n,e);return r!==null?r:require.resolve(n)},t}function Sd(e,t){var n=T1(e);e=ao(e);var r;e[0]==="/"&&(t="");for(var s=vd(),o=["",".js",".json"];n?r=ao(t+"/node_modules/"+e):r=ao(t+"/"+e),!r.endsWith("/..");){for(var i=0;i<o.length;i++){var l=r+o[i];if(s[l])return l}if(!n)break;var a=ao(t+"/..");if(a===t)break;t=a}return null}function T1(e){var t=e[0];if(t==="/"||t==="\\")return!1;var n=e[1],r=e[2];return!(t==="."&&(!n||n==="/"||n==="\\")||t==="."&&n==="."&&(!r||r==="/"||r==="\\")||n===":"&&(r==="/"||r==="\\"))}function ao(e){e=e.replace(/\\/g,"/");for(var t=e.split("/"),n=t[0]==="",r=1;r<t.length;r++)(t[r]==="."||t[r]==="")&&t.splice(r--,1);for(var r=1;r<t.length;r++)t[r]===".."&&r>0&&t[r-1]!==".."&&t[r-1]!=="."&&(t.splice(--r,2),r--);return e=t.join("/"),n&&e[0]!=="/"?e="/"+e:e.length===0&&(e="."),e}var uo={exports:{}};const R=e=>typeof e=="string",Ir=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},xd=e=>e==null?"":""+e,N1=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},A1=/###/g,Cd=e=>e&&e.indexOf("###")>-1?e.replace(A1,"."):e,$d=e=>!e||R(e),zr=(e,t,n)=>{const r=R(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if($d(e))return{};const o=Cd(r[s]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return $d(e)?{}:{obj:e,k:Cd(r[s])}},Ed=(e,t,n)=>{const{obj:r,k:s}=zr(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),l=zr(e,i,Object);for(;l.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),l=zr(e,i,Object),l&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},j1=(e,t,n,r)=>{const{obj:s,k:o}=zr(e,t,Object);s[o]=s[o]||[],s[o].push(n)},co=(e,t)=>{const{obj:n,k:r}=zr(e,t);if(n)return n[r]},O1=(e,t,n)=>{const r=co(e,n);return r!==void 0?r:co(t,n)},kd=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?R(e[r])||e[r]instanceof String||R(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):kd(e[r],t[r],n):e[r]=t[r]);return e},Pn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var L1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const R1=e=>R(e)?e.replace(/[&<>"'\/]/g,t=>L1[t]):e;class _1{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const F1=[" ",",","?","!",";"],D1=new _1(20),I1=(e,t,n)=>{t=t||"",n=n||"";const r=F1.filter(i=>t.indexOf(i)<0&&n.indexOf(i)<0);if(r.length===0)return!0;const s=D1.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!s.test(e);if(!o){const i=e.indexOf(n);i>0&&!s.test(e.substring(0,i))&&(o=!0)}return o},Xl=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let i,l="";for(let a=o;a<r.length;++a)if(a!==o&&(l+=n),l+=r[a],i=s[l],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&a<r.length-1)continue;o+=a-o+1;break}s=i}return s},fo=e=>e&&e.replace("_","-"),z1={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 ho{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||z1,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(R(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var Ke=new ho;class po{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(i=>{let[l,a]=i;for(let u=0;u<a;u++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(i=>{let[l,a]=i;for(let u=0;u<a;u++)l.apply(l,[t,...r])})}}class Pd extends po{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,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 n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):R(r)&&o?l.push(...r.split(o)):l.push(r)));const a=co(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!i||!R(r)?a:Xl(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(l=t.split("."),s=n,n=l[1]),this.addNamespaces(n),Ed(this.data,l,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(R(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),s=r,r=n,n=l[1]),this.addNamespaces(n);let a=co(this.data,l)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?kd(a,r,o):a={...a,...r},Ed(this.data,l,a),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Td={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const Nd={};class go extends po{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),N1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ke.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const i=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!I1(t,r,s);if(i&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(s)}return R(o)&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:i,namespaces:l}=this.extractFromKey(t[t.length-1],n),a=l[l.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const S=n.nsSeparator||this.options.nsSeparator;return s?{res:`${a}${S}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${S}${i}`}return s?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:i}const p=this.resolve(t,n);let c=p&&p.res;const v=p&&p.usedKey||i,m=p&&p.exactUsedKey||i,y=Object.prototype.toString.apply(c),h=["[object Number]","[object Function]","[object RegExp]"],d=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!R(c)&&typeof c!="boolean"&&typeof c!="number";if(g&&c&&w&&h.indexOf(y)<0&&!(R(d)&&Array.isArray(c))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,c,{...n,ns:l}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(p.res=S,p.usedParams=this.getUsedParamsDetails(n),p):S}if(o){const S=Array.isArray(c),T=S?[]:{},C=S?m:v;for(const P in c)if(Object.prototype.hasOwnProperty.call(c,P)){const j=`${C}${o}${P}`;T[P]=this.translate(j,{...n,joinArrays:!1,ns:l}),T[P]===j&&(T[P]=c[P])}c=T}}else if(g&&R(d)&&Array.isArray(c))c=c.join(d),c&&(c=this.extendTranslation(c,t,n,r));else{let S=!1,T=!1;const C=n.count!==void 0&&!R(n.count),P=go.hasDefaultValue(n),j=C?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",X=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),rt=X&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${j}`]||n[`defaultValue${A}`]||n.defaultValue;!this.isValidLookup(c)&&P&&(S=!0,c=rt),this.isValidLookup(c)||(T=!0,c=i);const ne=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:c,be=P&&rt!==c&&this.options.updateMissing;if(T||S||be){if(this.logger.log(be?"updateKey":"missingKey",u,a,i,be?rt:c),o){const ie=this.resolve(i,{...n,keySeparator:!1});ie&&ie.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 qe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&qe&&qe[0])for(let ie=0;ie<qe.length;ie++)Ee.push(qe[ie]);else this.options.saveMissingTo==="all"?Ee=this.languageUtils.toResolveHierarchy(n.lng||this.language):Ee.push(n.lng||this.language);const jn=(ie,De,Ht)=>{const k=P&&Ht!==c?Ht:ne;this.options.missingKeyHandler?this.options.missingKeyHandler(ie,a,De,k,be,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ie,a,De,k,be,n),this.emit("missingKey",ie,a,De,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Ee.forEach(ie=>{const De=this.pluralResolver.getSuffixes(ie,n);X&&n[`defaultValue${this.options.pluralSeparator}zero`]&&De.indexOf(`${this.options.pluralSeparator}zero`)<0&&De.push(`${this.options.pluralSeparator}zero`),De.forEach(Ht=>{jn([ie],i+Ht,n[`defaultValue${Ht}`]||rt)})}):jn(Ee,i,rt))}c=this.extendTranslation(c,t,n,p,r),T&&c===i&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${i}`),(T||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?c=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,S?c:void 0):c=this.options.parseMissingKeyHandler(c))}return s?(p.res=c,p.usedParams=this.getUsedParamsDetails(n),p):c}extendTranslation(t,n,r,s,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=R(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const c=t.match(this.interpolator.nestingRegexp);f=c&&c.length}let p=r.replace&&!R(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),u){const c=t.match(this.interpolator.nestingRegexp),v=c&&c.length;f<v&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var c=arguments.length,v=new Array(c),m=0;m<c;m++)v[m]=arguments[m];return o&&o[0]===v[0]&&!r.context?(i.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):i.translate(...v,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,a=R(l)?[l]:l;return t!=null&&a&&a.length&&r.applyPostProcessor!==!1&&(t=Td.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,i,l;return R(t)&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),f=u.key;s=f;let p=u.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const c=n.count!==void 0&&!R(n.count),v=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(R(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(h=>{this.isValidLookup(r)||(l=h,!Nd[`${y[0]}-${h}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Nd[`${y[0]}-${h}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),y.forEach(d=>{if(this.isValidLookup(r))return;i=d;const g=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(g,f,d,h,n);else{let S;c&&(S=this.pluralResolver.getSuffix(d,n.count,n));const T=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(g.push(f+S),n.ordinal&&S.indexOf(C)===0&&g.push(f+S.replace(C,this.options.pluralSeparator)),v&&g.push(f+T)),m){const P=`${f}${this.options.contextSeparator}${n.context}`;g.push(P),c&&(g.push(P+S),n.ordinal&&S.indexOf(C)===0&&g.push(P+S.replace(C,this.options.pluralSeparator)),v&&g.push(P+T))}}let w;for(;w=g.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(d,h,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:i,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!R(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Yl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ad{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ke.create("languageUtils")}getScriptPartFromCode(t){if(t=fo(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fo(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(R(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(t)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Yl(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Yl(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Yl(r[2].toLowerCase()))),r.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 n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),R(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return R(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):R(t)&&o(this.formatLanguageCode(t)),r.forEach(i=>{s.indexOf(i)<0&&o(this.formatLanguageCode(i))}),s}}let M1=[{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}],U1={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 B1=["v1","v2","v3"],V1=["v4"],jd={zero:0,one:1,two:2,few:3,many:4,other:5},H1=()=>{const e={};return M1.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:U1[t.fc]}})}),e};class W1{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ke.create("pluralResolver"),(!this.options.compatibilityJSON||V1.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=H1(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=fo(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=i,i}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>jd[s]-jd[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!B1.includes(this.options.compatibilityJSON)}}const Od=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=O1(e,t,n);return!o&&s&&R(n)&&(o=Xl(e,n,r),o===void 0&&(o=Xl(t,n,r))),o},Zl=e=>e.replace(/\$/g,"$$$$");class K1{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:i,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:f,unescapePrefix:p,nestingPrefix:c,nestingPrefixEscaped:v,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:h,maxReplaces:d,alwaysFormat:g}=t.interpolation;this.escape=n!==void 0?n:R1,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Pn(o):i||"{{",this.suffix=l?Pn(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=c?Pn(c):v||Pn("$t("),this.nestingSuffix=m?Pn(m):y||Pn(")"),this.nestingOptionsSeparator=h||",",this.maxReplaces=d||1e3,this.alwaysFormat=g!==void 0?g:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"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,n,r,s){let o,i,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=v=>{if(v.indexOf(this.formatSeparator)<0){const d=Od(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(d,void 0,r,{...s,...n,interpolationkey:v}):d}const m=v.split(this.formatSeparator),y=m.shift().trim(),h=m.join(this.formatSeparator).trim();return this.format(Od(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure),h,r,{...s,...n,interpolationkey:y})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>Zl(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?Zl(this.escape(v)):Zl(v)}].forEach(v=>{for(l=0;o=v.regex.exec(t);){const m=o[1].trim();if(i=u(m),i===void 0)if(typeof f=="function"){const h=f(t,o,s);i=R(h)?h:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))i="";else if(p){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),i="";else!R(i)&&!this.useRawValueToEscape&&(i=xd(i));const y=v.safeValue(i);if(t=t.replace(o[0],y),p?(v.regex.lastIndex+=i.length,v.regex.lastIndex-=o[0].length):v.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,i;const l=(a,u)=>{const f=this.nestingOptionsSeparator;if(a.indexOf(f)<0)return a;const p=a.split(new RegExp(`${f}[ ]*{`));let c=`{${p[1]}`;a=p[0],c=this.interpolate(c,i);const v=c.match(/'/g),m=c.match(/"/g);(v&&v.length%2===0&&!m||m.length%2!==0)&&(c=c.replace(/'/g,'"'));try{i=JSON.parse(c),u&&(i={...u,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,y),`${a}${f}${c}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,a};for(;s=this.nestingRegexp.exec(t);){let a=[];i={...r},i=i.replace&&!R(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(p=>p.trim());s[1]=f.shift(),a=f,u=!0}if(o=n(l.call(this,s[1].trim(),i),i),o&&s[0]===t&&!R(o))return o;R(o)||(o=xd(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),u&&(o=a.reduce((f,p)=>this.format(f,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const b1=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(i=>{if(i){const[l,...a]=i.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),f=l.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Tn=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const i=r+JSON.stringify(o);let l=t[i];return l||(l=e(fo(r),s),t[i]=l),l(n)}};class q1{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("formatter"),this.options=t,this.formats={number:Tn((n,r)=>s=>new Intl.NumberFormat(n,{...r}).format(s)),currency:Tn((n,r)=>s=>new Intl.NumberFormat(n,{...r,style:"currency"}).format(s)),datetime:Tn((n,r)=>s=>new Intl.DateTimeFormat(n,{...r}).format(s)),relativetime:Tn((n,r)=>s=>new Intl.RelativeTimeFormat(n,{...r}).format(s,r.range||"day")),list:Tn((n,r)=>s=>new Intl.ListFormat(n,{...r}).format(s))},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Tn(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{const{formatName:u,formatOptions:f}=b1(a);if(this.formats[u]){let p=l;try{const c=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},v=c.locale||c.lng||s.locale||s.lng||r;p=this.formats[u](l,v,{...f,...s,...c})}catch(c){this.logger.warn(c)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const J1=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Q1 extends po{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ke.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},i={},l={},a={};return t.forEach(u=>{let f=!0;n.forEach(p=>{const c=`${u}|${p}`;!r.reload&&this.store.hasResourceBundle(u,p)?this.state[c]=2:this.state[c]<0||(this.state[c]===1?i[c]===void 0&&(i[c]=!0):(this.state[c]=1,f=!1,i[c]===void 0&&(i[c]=!0),o[c]===void 0&&(o[c]=!0),a[p]===void 0&&(a[p]=!0)))}),f||(l[u]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const s=t.split("|"),o=s[0],i=s[1];n&&this.emit("failedLoading",o,i,n),!n&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{j1(a.loaded,[o],i),J1(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const f=a.loaded[u];f.length&&f.forEach(p=>{l[u][p]===void 0&&(l[u][p]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:i});return}this.readingCalls++;const l=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(u&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,o*2,i)},o);return}i(u,f)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(f=>l(null,f)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=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."),s&&s();R(t)&&(t=this.languageUtils.toResolveHierarchy(t)),R(n)&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(i,l)=>{i&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,i),!i&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,l),this.loaded(t,i,l)})}saveMissing(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend&&this.backend.create){const a={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(t,n,r,s,a):f=u(t,n,r,s),f&&typeof f.then=="function"?f.then(p=>l(null,p)).catch(l):l(null,f)}catch(f){l(f)}else u(t,n,r,s,l,a)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Ld=()=>({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]),R(e[1])&&(t.defaultValue=e[1]),R(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Rd=e=>(R(e.ns)&&(e.ns=[e.ns]),R(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),R(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),mo=()=>{},G1=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Mr extends po{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Rd(t),this.services={},this.logger=Ke,this.modules={external:[]},G1(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(R(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Ld();this.options={...s,...this.options,...Rd(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?Ke.init(o(this.modules.logger),this.options):Ke.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=q1);const p=new Ad(this.options);this.store=new Pd(this.options.resources,this.options);const c=this.services;c.logger=Ke,c.resourceStore=this.store,c.languageUtils=p,c.pluralResolver=new W1(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(c.formatter=o(f),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new K1(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Q1(o(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(v){for(var m=arguments.length,y=new Array(m>1?m-1:0),h=1;h<m;h++)y[h-1]=arguments[h];t.emit(v,...y)}),this.modules.languageDetector&&(c.languageDetector=o(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=o(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new go(this.services,this.options),this.translator.on("*",function(v){for(var m=arguments.length,y=new Array(m>1?m-1:0),h=1;h<m;h++)y[h-1]=arguments[h];t.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=function(){return t.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return t.store[f](...arguments),t}});const a=Ir(),u=()=>{const f=(p,c)=>{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),a.resolve(c),r(p,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mo;const s=R(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],i=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>i(a)),this.options.preload&&this.options.preload.forEach(l=>i(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const s=Ir();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=mo),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}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"&&Td.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 n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=Ir();this.emit("languageChanging",t);const o=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(a,function(){return r.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=R(a)?a:this.services.languageUtils.getBestMatchFromCodes(a);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{i(f,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),s}getFixedT(t,n,r){var s=this;const o=function(i,l){let a;if(typeof l!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),p=2;p<u;p++)f[p-2]=arguments[p];a=s.options.overloadTranslationOptionHandler([i,l].concat(f))}else a={...l};a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs,a.ns=a.ns||o.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||o.keyPrefix);const c=s.options.keySeparator||".";let v;return a.keyPrefix&&Array.isArray(i)?v=i.map(m=>`${a.keyPrefix}${c}${m}`):v=a.keyPrefix?`${a.keyPrefix}${c}${i}`:i,s.t(v,a)};return R(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}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 n=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 r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,i);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!s||i(o,t)))}loadNamespaces(t,n){const r=Ir();return this.options.ns?(R(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Ir();R(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=s.concat(o),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new Ad(Ld());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Mr(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mo;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Mr(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new Pd(this.store.data,s),o.services.resourceStore=o.store),o.translator=new go(o.services,s),o.translator.on("*",function(l){for(var a=arguments.length,u=new Array(a>1?a-1:0),f=1;f<a;f++)u[f-1]=arguments[f];o.emit(l,...u)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const _d=Mr.createInstance();_d.createInstance=Mr.createInstance;var X1=_d;const Y1=X1,Fd=["af","ar","bg","bn","bs","ca","cs","da","de","de-CH","el","en","eo","es","et","fa","fi","fr","gd","he","hi","hr","hu","id","is","it","ja","ko","kz","lt","lv","mk","mn","ms","ne","nl","nn","no","pl","pt","pt-BR","ro","ru","si","sk","sl","sq","sr","sr-Cyrl","sv","th","tr","uk","ur","uz","vi","zh","zh-Hant","sw","ta"];function Dd(e,t){return e.reduce((n,r)=>{let s;try{s=wd("/ghost/i18n/lib")(`../locales/${r}/${t}.json`)}catch{s=wd("/ghost/i18n/lib")(`../locales/en/${t}.json`)}return n[r]={[t]:{...s,...s.default&&typeof s.default=="object"?s.default:{}}},n},{})}uo.exports=(e="en",t="portal")=>{const n=Y1.createInstance();let r={};t==="newsletter"&&(r={prefix:"{",suffix:"}"});let s=Dd(Fd,t);return n.init({lng:e,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:!1,ns:t,defaultNS:t,interpolation:r,resources:s}),n},uo.exports.SUPPORTED_LOCALES=Fd,uo.exports.generateResources=Dd;var Z1=uo.exports,ey=Z1;const ty=Q(ey);class ny extends st.Component{constructor(t){super(t);const n=this.props.locale||"en",r=ty(n,"search"),s=r.dir()||"ltr",o=new S0({adminUrl:t.adminUrl,apiKey:t.apiKey,dir:s});this.state={searchIndex:o,showPopup:!1,indexStarted:!1,indexComplete:!1,t:r.t,dir:s},this.inputRef=st.createRef()}componentDidMount(){this.initSetup()}componentDidUpdate(t,n){var r,s,o;if(n.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=(o=(s=(r=window.document)==null?void 0:r.body)==null?void 0:s.style)==null?void 0:o.overflow,window.document.body.style.overflow="hidden"):window.document.body.style.overflow=this.bodyScroll||""}catch{}this.state.showPopup!==(n==null?void 0:n.showPopup)&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}setupCustomTriggerButton(){this.clickHandler=t=>{t.preventDefault(),this.setState({showPopup:!0});const n=document.createElement("input");n.style.opacity="0",n.style.position="fixed",n.style.top="0",document.body.appendChild(n),n.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(n)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(t=>{t.removeEventListener("click",this.clickHandler),t.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){const t="[data-ghost-search]";return document.querySelectorAll(t)||[]}handleSearchUrl(){const[t]=window.location.hash.substr(1).split("?");(t==="/search"||t==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){const t=this.getCustomTriggerButtons();t!=null&&t.length&&(this.handleKeyDown=n=>{if(n.key==="k"&&n.metaKey)return this.setState({showPopup:!0}),n.preventDefault(),n.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return E.jsx(de.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(t,n)=>{t==="update"&&this.setState({...this.state,...n})},t:this.state.t,dir:this.state.dir},children:E.jsx(yf,{})})}}const Id="sodo-search-root";function ry(){const e=document.createElement("div");e.id=Id,document.body.appendChild(e)}function sy(){const e=document.querySelector("script[data-sodo-search]");if(e){const t=e.dataset.sodoSearch,n=e.dataset.key,r=e.dataset.styles,s=e.dataset.locale||"en";return{adminUrl:t,apiKey:n,stylesUrl:r,locale:s}}return{}}function oy(){ry()}function iy(){var o;const{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=sy(),s=(o=e||window.location.origin)==null?void 0:o.replace(/\/+$/,"");oy(),Qp.render(E.jsx(st.StrictMode,{children:E.jsx(ny,{adminUrl:s,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(Id))}iy()});
|
|
55
|
+
`+o):r.stack=o}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=kn(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ql.assertOptions(r,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),s!=null&&(x.isFunction(s)?n.paramsSerializer={serialize:s}:ql.assertOptions(s,{encode:Pt.function,serialize:Pt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&x.merge(o.common,o[n.method]);o&&x.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=nt.concat(i,o);const l=[];let a=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(a=a&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let f,p=0,c;if(!a){const m=[cd.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),c=m.length,f=Promise.resolve(n);p<c;)f=f.then(m[p++],m[p++]);return f}c=l.length;let v=n;for(p=0;p<c;){const m=l[p++],y=l[p++];try{v=m(v)}catch(h){y.call(this,h);break}}try{f=cd.call(this,v)}catch(m){return Promise.reject(m)}for(p=0,c=u.length;p<c;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=kn(this.defaults,t);const n=id(t.baseURL,t.url);return Zf(n,t.params,t.paramsSerializer)}}x.forEach(["delete","get","head","options"],function(t){io.prototype[t]=function(n,r){return this.request(kn(r||{},{method:t,url:n,data:(r||{}).data}))}}),x.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(kn(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}io.prototype[t]=n(),io.prototype[t+"Form"]=n(!0)});var lo=io;class Jl{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new Dr(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Jl(function(s){t=s}),cancel:t}}}var Qm=Jl;function Gm(e){return function(n){return e.apply(null,n)}}function Xm(e){return x.isObject(e)&&e.isAxiosError===!0}const Ql={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ql).forEach(([e,t])=>{Ql[t]=e});var Ym=Ql;function pd(e){const t=new lo(e),n=If(lo.prototype.request,t);return x.extend(n,lo.prototype,t,{allOwnKeys:!0}),x.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return pd(kn(e,s))},n}const G=pd(Bl);G.Axios=lo,G.CanceledError=Dr,G.CancelToken=Qm,G.isCancel=od,G.VERSION=dd,G.toFormData=ro,G.AxiosError=D,G.Cancel=G.CanceledError,G.all=function(t){return Promise.all(t)},G.spread=Gm,G.isAxiosError=Xm,G.mergeConfig=kn,G.AxiosHeaders=nt,G.formToJSON=e=>rd(x.isHTMLForm(e)?new FormData(e):e),G.getAdapter=ud.getAdapter,G.HttpStatusCode=Ym,G.default=G;var Zm=G,e0="@tryghost/content-api",t0="1.11.21",n0="https://github.com/TryGhost/SDK/tree/main/packages/content-api",r0="Ghost Foundation",s0="MIT",o0="cjs/content-api.js",i0="umd/content-api.min.js",l0="es/content-api.js",a0="lib/content-api.js",u0=["LICENSE","README.md","cjs/","lib/","umd/","es/"],c0={dev:'echo "Implement me!"',pretest:"yarn build",test:"NODE_ENV=testing c8 --all --reporter text --reporter cobertura mocha './test/**/*.test.js'",build:"rollup -c",lint:"eslint . --ext .js --cache",prepare:"NODE_ENV=production yarn build",posttest:"yarn lint"},f0={access:"public"},d0={"@babel/core":"7.24.4","@babel/polyfill":"7.12.1","@babel/preset-env":"7.24.4","@rollup/plugin-json":"6.1.0",c8:"9.1.0","core-js":"3.37.0","eslint-plugin-ghost":"3.4.0",mocha:"10.4.0",rollup:"2.79.1","rollup-plugin-babel":"4.4.0","rollup-plugin-commonjs":"10.1.0","rollup-plugin-node-resolve":"5.2.0","rollup-plugin-polyfill-node":"0.12.0","rollup-plugin-replace":"2.2.0","rollup-plugin-terser":"7.0.2",should:"13.2.3",sinon:"17.0.1"},h0={axios:"^1.0.0"},p0="048ccde4bd78d2dcd60e778d03eb8dc3227cece5",g0={name:e0,version:t0,repository:n0,author:r0,license:s0,main:o0,"umd:main":"umd/content-api.min.js",unpkg:i0,module:l0,source:a0,files:u0,scripts:c0,publishConfig:f0,devDependencies:d0,dependencies:h0,gitHead:p0};const m0=!1,y0=g0.version,gd="v5.0",md=["v2","v3","v4","v5","canary"],Le="@tryghost/content-api",v0=e=>{let t;return e==="v5"||e===void 0||e.match(/^v5\.\d+/)?t="/content/":e.match(/^v\d+\.\d+/)?t=`/${/^(v\d+)\.\d+/.exec(e)[1]}/content/`:t=`/${e}/content/`,t},w0=e=>{let{url:t,method:n,params:r,headers:s}=e;return Zm[n](t,{params:r,paramsSerializer:o=>Object.keys(o).reduce((i,l)=>{const a=encodeURIComponent([].concat(o[l]).join(","));return i.concat(`${l}=${a}`)},[]).join("&"),headers:s})};function Gl(e){let{url:t,key:n,host:r,version:s,userAgent:o,ghostPath:i="ghost",makeRequest:l=w0}=e;if(r&&(console.warn(`${Le}: The 'host' parameter is deprecated, please use 'url' instead`),t||(t=r)),this instanceof Gl)return Gl({url:t,key:n,version:s,userAgent:o,ghostPath:i,makeRequest:l});if(s===void 0)throw new Error(`${Le} Config Missing: 'version' is required. E.g. ${md.join(",")}`);let a;if(typeof s=="boolean")s===!0&&(a=gd),s=void 0;else{if(s&&!md.includes(s)&&!s.match(/^v\d+\.\d+/))throw new Error(`${Le} Config Invalid: 'version' ${s} is not supported`);s==="canary"?(console.warn(`${Le}: The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead`),a=gd):s.match(/^v\d+$/)?(console.warn(`${Le}: The 'version' parameter has a deprecated format 'v{major}', please use 'v{major}.{minor}' format instead`),a=`${s}.0`):a=s}if(!t)throw new Error(`${Le} Config Missing: 'url' is required. E.g. 'https://site.com'`);if(!/https?:\/\//.test(t))throw new Error(`${Le} Config Invalid: 'url' ${t} requires a protocol. E.g. 'https://site.com'`);if(t.endsWith("/"))throw new Error(`${Le} Config Invalid: 'url' ${t} must not have a trailing slash. E.g. 'https://site.com'`);if(i.endsWith("/")||i.startsWith("/"))throw new Error(`${Le} Config Invalid: 'ghostPath' ${i} must not have a leading or trailing slash. E.g. 'ghost'`);if(n&&!/[0-9a-f]{26}/.test(n))throw new Error(`${Le} Config Invalid: 'key' ${n} must have 26 hex characters`);o===void 0&&(o=m0);const u=["posts","authors","tags","pages","settings","tiers","newsletters","offers"].reduce((p,c)=>{function v(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0;return f(c,y,null,h)}function m(y){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=arguments.length>2?arguments[2]:void 0;if(!y||!y.id&&!y.slug)return Promise.reject(new Error(`${Le} read requires an id or slug.`));const g=Object.assign({},y,h);return f(c,g,y.id||`slug/${y.slug}`,d)}return Object.assign(p,{[c]:{read:m,browse:v}})},{});return delete u.settings.read,delete u.tiers.read,delete u.newsletters.read,delete u.offers.browse,u;function f(p,c,v){let m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(!m&&!n)return Promise.reject(new Error(`${Le} Config Missing: 'key' is required.`));delete c.id;const y=m?{Authorization:`GhostMembers ${m}`}:{};o&&(typeof o=="boolean"?y["User-Agent"]=`GhostContentSDK/${y0}`:y["User-Agent"]=o),a&&(y["Accept-Version"]=a),c=Object.assign({key:n},c);const h=`${t}/${i}/api${v0(s)}${p}/${v?v+"/":""}`;return l({url:h,method:"get",params:c,headers:y}).then(d=>Array.isArray(d.data[p])?d.data[p].length===1&&!d.data.meta?d.data[p][0]:Object.assign(d.data[p],{meta:d.data.meta}):d.data[p]).catch(d=>{if(d.response&&d.response.data&&d.response.data.errors){const g=d.response.data.errors[0],w=new Error(g.message),S=Object.keys(g);throw w.name=g.type,S.forEach(T=>{w[T]=g[T]}),w.response=d.response,w.request=d.request,w.config=d.config,w}else throw d})}}class S0{constructor({adminUrl:t,apiKey:n,dir:r}){Ln(this,yo);Ln(this,vo);Ln(this,wo);Ln(this,Nn);Ln(this,An);this.api=new Gl({url:t,key:n,version:"v5.0"});const s=r==="rtl",o=r==="rtl"?"reverse":"forward";this.postsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["title","excerpt"],store:!0},...Je(this,An,Co).call(this)}),this.authorsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["name"],store:!0},...Je(this,An,Co).call(this)}),this.tagsIndex=new _l.Document({tokenize:o,rtl:s,document:{id:"id",index:["name"],store:!0},...Je(this,An,Co).call(this)}),this.init=this.init.bind(this),this.search=this.search.bind(this)}async init(){let t=await this.api.posts.browse({limit:"10000",fields:"id,slug,title,excerpt,url,updated_at,visibility",order:"updated_at DESC"});(t||t.length>0)&&(t.length||(t=[t]),Je(this,yo,zd).call(this,t));let n=await this.api.authors.browse({limit:"10000",fields:"id,slug,name,url,profile_image",order:"updated_at DESC"});(n||n.length>0)&&(n.length||(n=[n]),Je(this,vo,Md).call(this,n));let r=await this.api.tags.browse({limit:"10000",fields:"id,slug,name,url",order:"updated_at DESC",filter:"visibility:public"});(r||r.length>0)&&(r.length||(r=[r]),Je(this,wo,Ud).call(this,r))}search(t){const n=this.postsIndex.search(t,{enrich:!0}),r=this.authorsIndex.search(t,{enrich:!0}),s=this.tagsIndex.search(t,{enrich:!0});return{posts:Je(this,Nn,xo).call(this,n),authors:Je(this,Nn,xo).call(this,r),tags:Je(this,Nn,xo).call(this,s)}}}yo=new WeakSet,zd=function(t){t.forEach(n=>{this.postsIndex.add(n)})},vo=new WeakSet,Md=function(t){t.forEach(n=>{this.authorsIndex.add(n)})},wo=new WeakSet,Ud=function(t){t.forEach(n=>{this.tagsIndex.add(n)})},Nn=new WeakSet,xo=function(t){const n=[],r={};return t.forEach(s=>{s.result.forEach(o=>{r[o.id]||(n.push(o.doc),r[o.id]=!0)})}),n},An=new WeakSet,Co=function(){const t=new RegExp("[一-鿿-ゟ゠-ヿ가-힣㐀-䶿𠀀-𪛟𪜀-𫝀-𫠠-𬺰-𰀀-𱍐-𲎯-豈-丽-]|[0-9A-Za-zа-яÀ-ſЀ-ӿ-ۿঀ-Ḁ-ỿ-]+","mug");return{encode:n=>(""+n).toLowerCase().match(t)??[]}};const x0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},C0={Authors:"الكتّاب",Cancel:"إلغاء","No matches found":"لا يوجد نتائج مطابقة",Posts:"منشورات","Search posts, tags and authors":"قم بالبحث عن المنشورات، الوسوم و الكتّاب","Show more results":"اظهر المزيد من النتائج",Tags:"الوسوم"},$0={Authors:"Автори",Cancel:"Отказ","No matches found":"Няма съвпадения",Posts:"Публикации","Search posts, tags and authors":"Търсене в публикации, етикети и автори","Show more results":"Покажи още резултати",Tags:"Етикети"},E0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},k0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},P0={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"},T0={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"},N0={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"},A0={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"},j0={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"},O0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},L0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},R0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},_0={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"},F0={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"},D0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},I0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},z0={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"},M0={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"},U0={Authors:"מחברים",Cancel:"ביטול","No matches found":"לא נמצאו התאמות",Posts:"פוסטים","Search posts, tags and authors":"חיפוש פוסטים, תגיות ומחברים","Show more results":"הצגת תוצאות נוספות",Tags:"תגיות"},B0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},V0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},H0={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"},W0={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"},K0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},b0={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"},q0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},J0={Authors:"작성자",Cancel:"취소","No matches found":"일치하는 결과가 없어요",Posts:"게시물","Search posts, tags and authors":"게시물, 태그, 작성자 검색","Show more results":"더 많은 결과 보기",Tags:"태그"},Q0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},G0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},X0={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"},Y0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},Z0={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},e1={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:"ट्यागहरू"},n1={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"},r1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},s1={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"},o1={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"},i1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},l1={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"},a1={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"},u1={Authors:"Авторы",Cancel:"Отмена","No matches found":"Совпадений не найдено",Posts:"Записи","Search posts, tags and authors":"Поиск по записям, тегам и авторам","Show more results":"Показать больше результатов",Tags:"Теги"},c1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},f1={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"},d1={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"},h1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},p1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},g1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},m1={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"},y1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},v1={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"},w1={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:""},x1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},C1={Authors:"Tác giả",Cancel:"Hủy bỏ","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"},$1={Authors:"作者",Cancel:"取消","No matches found":"未找到匹配项",Posts:"文章","Search posts, tags and authors":"搜索文章、标签和作者","Show more results":"显示更多结果",Tags:"标签"},E1={Authors:"作者",Cancel:"取消","No matches found":"無相符結果",Posts:"文章","Search posts, tags and authors":"搜尋文章、標籤與作者","Show more results":"更多結果",Tags:"標籤"},k1={Authors:"",Cancel:"","No matches found":"",Posts:"","Search posts, tags and authors":"","Show more results":"",Tags:""},P1={Authors:"ஆசிரியர்கள்",Cancel:"ரத்து செய்","No matches found":"பொருத்தங்கள் எதுவும் இல்லை",Posts:"பதிவுகள்","Search posts, tags and authors":"பதிவுகள், குறிச்சொற்கள் மற்றும் ஆசிரியர்களைத் தேடுங்கள்","Show more results":"மேலும் முடிவுகளைக் காட்டு",Tags:"குறிச்சொற்கள்"};var yd;function vd(){return yd||(yd={"/ghost/i18n/locales/af/search.json":function(){return x0},"/ghost/i18n/locales/ar/search.json":function(){return C0},"/ghost/i18n/locales/bg/search.json":function(){return $0},"/ghost/i18n/locales/bn/search.json":function(){return E0},"/ghost/i18n/locales/bs/search.json":function(){return k0},"/ghost/i18n/locales/ca/search.json":function(){return P0},"/ghost/i18n/locales/cs/search.json":function(){return T0},"/ghost/i18n/locales/da/search.json":function(){return N0},"/ghost/i18n/locales/de/search.json":function(){return A0},"/ghost/i18n/locales/de-CH/search.json":function(){return j0},"/ghost/i18n/locales/el/search.json":function(){return O0},"/ghost/i18n/locales/en/search.json":function(){return L0},"/ghost/i18n/locales/eo/search.json":function(){return R0},"/ghost/i18n/locales/es/search.json":function(){return _0},"/ghost/i18n/locales/et/search.json":function(){return F0},"/ghost/i18n/locales/fa/search.json":function(){return D0},"/ghost/i18n/locales/fi/search.json":function(){return I0},"/ghost/i18n/locales/fr/search.json":function(){return z0},"/ghost/i18n/locales/gd/search.json":function(){return M0},"/ghost/i18n/locales/he/search.json":function(){return U0},"/ghost/i18n/locales/hi/search.json":function(){return B0},"/ghost/i18n/locales/hr/search.json":function(){return V0},"/ghost/i18n/locales/hu/search.json":function(){return H0},"/ghost/i18n/locales/id/search.json":function(){return W0},"/ghost/i18n/locales/is/search.json":function(){return K0},"/ghost/i18n/locales/it/search.json":function(){return b0},"/ghost/i18n/locales/ja/search.json":function(){return q0},"/ghost/i18n/locales/ko/search.json":function(){return J0},"/ghost/i18n/locales/kz/search.json":function(){return Q0},"/ghost/i18n/locales/lt/search.json":function(){return G0},"/ghost/i18n/locales/lv/search.json":function(){return X0},"/ghost/i18n/locales/mk/search.json":function(){return Y0},"/ghost/i18n/locales/mn/search.json":function(){return Z0},"/ghost/i18n/locales/ms/search.json":function(){return e1},"/ghost/i18n/locales/ne/search.json":function(){return t1},"/ghost/i18n/locales/nl/search.json":function(){return n1},"/ghost/i18n/locales/nn/search.json":function(){return r1},"/ghost/i18n/locales/no/search.json":function(){return s1},"/ghost/i18n/locales/pl/search.json":function(){return o1},"/ghost/i18n/locales/pt/search.json":function(){return i1},"/ghost/i18n/locales/pt-BR/search.json":function(){return l1},"/ghost/i18n/locales/ro/search.json":function(){return a1},"/ghost/i18n/locales/ru/search.json":function(){return u1},"/ghost/i18n/locales/si/search.json":function(){return c1},"/ghost/i18n/locales/sk/search.json":function(){return f1},"/ghost/i18n/locales/sl/search.json":function(){return d1},"/ghost/i18n/locales/sq/search.json":function(){return h1},"/ghost/i18n/locales/sr/search.json":function(){return p1},"/ghost/i18n/locales/sr-Cyrl/search.json":function(){return g1},"/ghost/i18n/locales/sv/search.json":function(){return m1},"/ghost/i18n/locales/th/search.json":function(){return y1},"/ghost/i18n/locales/tr/search.json":function(){return v1},"/ghost/i18n/locales/uk/search.json":function(){return w1},"/ghost/i18n/locales/ur/search.json":function(){return S1},"/ghost/i18n/locales/uz/search.json":function(){return x1},"/ghost/i18n/locales/vi/search.json":function(){return C1},"/ghost/i18n/locales/zh/search.json":function(){return $1},"/ghost/i18n/locales/zh-Hant/search.json":function(){return E1},"/ghost/i18n/locales/sw/search.json":function(){return k1},"/ghost/i18n/locales/ta/search.json":function(){return P1}})}function wd(e){function t(n){var r=Sd(n,e);if(r!==null)return vd()[r]();throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return t.resolve=function(n){var r=Sd(n,e);return r!==null?r:require.resolve(n)},t}function Sd(e,t){var n=T1(e);e=ao(e);var r;e[0]==="/"&&(t="");for(var s=vd(),o=["",".js",".json"];n?r=ao(t+"/node_modules/"+e):r=ao(t+"/"+e),!r.endsWith("/..");){for(var i=0;i<o.length;i++){var l=r+o[i];if(s[l])return l}if(!n)break;var a=ao(t+"/..");if(a===t)break;t=a}return null}function T1(e){var t=e[0];if(t==="/"||t==="\\")return!1;var n=e[1],r=e[2];return!(t==="."&&(!n||n==="/"||n==="\\")||t==="."&&n==="."&&(!r||r==="/"||r==="\\")||n===":"&&(r==="/"||r==="\\"))}function ao(e){e=e.replace(/\\/g,"/");for(var t=e.split("/"),n=t[0]==="",r=1;r<t.length;r++)(t[r]==="."||t[r]==="")&&t.splice(r--,1);for(var r=1;r<t.length;r++)t[r]===".."&&r>0&&t[r-1]!==".."&&t[r-1]!=="."&&(t.splice(--r,2),r--);return e=t.join("/"),n&&e[0]!=="/"?e="/"+e:e.length===0&&(e="."),e}var uo={exports:{}};const R=e=>typeof e=="string",Ir=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},xd=e=>e==null?"":""+e,N1=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},A1=/###/g,Cd=e=>e&&e.indexOf("###")>-1?e.replace(A1,"."):e,$d=e=>!e||R(e),zr=(e,t,n)=>{const r=R(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if($d(e))return{};const o=Cd(r[s]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return $d(e)?{}:{obj:e,k:Cd(r[s])}},Ed=(e,t,n)=>{const{obj:r,k:s}=zr(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),l=zr(e,i,Object);for(;l.obj===void 0&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),l=zr(e,i,Object),l&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},j1=(e,t,n,r)=>{const{obj:s,k:o}=zr(e,t,Object);s[o]=s[o]||[],s[o].push(n)},co=(e,t)=>{const{obj:n,k:r}=zr(e,t);if(n)return n[r]},O1=(e,t,n)=>{const r=co(e,n);return r!==void 0?r:co(t,n)},kd=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?R(e[r])||e[r]instanceof String||R(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):kd(e[r],t[r],n):e[r]=t[r]);return e},Pn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var L1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const R1=e=>R(e)?e.replace(/[&<>"'\/]/g,t=>L1[t]):e;class _1{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const F1=[" ",",","?","!",";"],D1=new _1(20),I1=(e,t,n)=>{t=t||"",n=n||"";const r=F1.filter(i=>t.indexOf(i)<0&&n.indexOf(i)<0);if(r.length===0)return!0;const s=D1.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let o=!s.test(e);if(!o){const i=e.indexOf(n);i>0&&!s.test(e.substring(0,i))&&(o=!0)}return o},Xl=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let i,l="";for(let a=o;a<r.length;++a)if(a!==o&&(l+=n),l+=r[a],i=s[l],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&a<r.length-1)continue;o+=a-o+1;break}s=i}return s},fo=e=>e&&e.replace("_","-"),z1={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 ho{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||z1,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(R(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var Ke=new ho;class po{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(i=>{let[l,a]=i;for(let u=0;u<a;u++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(i=>{let[l,a]=i;for(let u=0;u<a;u++)l.apply(l,[t,...r])})}}class Pd extends po{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,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 n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):R(r)&&o?l.push(...r.split(o)):l.push(r)));const a=co(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!i||!R(r)?a:Xl(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(l=t.split("."),s=n,n=l[1]),this.addNamespaces(n),Ed(this.data,l,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(R(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),s=r,r=n,n=l[1]),this.addNamespaces(n);let a=co(this.data,l)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?kd(a,r,o):a={...a,...r},Ed(this.data,l,a),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Td={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const Nd={};class go extends po{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),N1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ke.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const i=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!I1(t,r,s);if(i&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(s)}return R(o)&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:i,namespaces:l}=this.extractFromKey(t[t.length-1],n),a=l[l.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const S=n.nsSeparator||this.options.nsSeparator;return s?{res:`${a}${S}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${S}${i}`}return s?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:i}const p=this.resolve(t,n);let c=p&&p.res;const v=p&&p.usedKey||i,m=p&&p.exactUsedKey||i,y=Object.prototype.toString.apply(c),h=["[object Number]","[object Function]","[object RegExp]"],d=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!R(c)&&typeof c!="boolean"&&typeof c!="number";if(g&&c&&w&&h.indexOf(y)<0&&!(R(d)&&Array.isArray(c))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,c,{...n,ns:l}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(p.res=S,p.usedParams=this.getUsedParamsDetails(n),p):S}if(o){const S=Array.isArray(c),T=S?[]:{},C=S?m:v;for(const P in c)if(Object.prototype.hasOwnProperty.call(c,P)){const j=`${C}${o}${P}`;T[P]=this.translate(j,{...n,joinArrays:!1,ns:l}),T[P]===j&&(T[P]=c[P])}c=T}}else if(g&&R(d)&&Array.isArray(c))c=c.join(d),c&&(c=this.extendTranslation(c,t,n,r));else{let S=!1,T=!1;const C=n.count!==void 0&&!R(n.count),P=go.hasDefaultValue(n),j=C?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",X=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),rt=X&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${j}`]||n[`defaultValue${A}`]||n.defaultValue;!this.isValidLookup(c)&&P&&(S=!0,c=rt),this.isValidLookup(c)||(T=!0,c=i);const ne=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:c,be=P&&rt!==c&&this.options.updateMissing;if(T||S||be){if(this.logger.log(be?"updateKey":"missingKey",u,a,i,be?rt:c),o){const ie=this.resolve(i,{...n,keySeparator:!1});ie&&ie.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 qe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&qe&&qe[0])for(let ie=0;ie<qe.length;ie++)Ee.push(qe[ie]);else this.options.saveMissingTo==="all"?Ee=this.languageUtils.toResolveHierarchy(n.lng||this.language):Ee.push(n.lng||this.language);const jn=(ie,De,Ht)=>{const k=P&&Ht!==c?Ht:ne;this.options.missingKeyHandler?this.options.missingKeyHandler(ie,a,De,k,be,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ie,a,De,k,be,n),this.emit("missingKey",ie,a,De,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Ee.forEach(ie=>{const De=this.pluralResolver.getSuffixes(ie,n);X&&n[`defaultValue${this.options.pluralSeparator}zero`]&&De.indexOf(`${this.options.pluralSeparator}zero`)<0&&De.push(`${this.options.pluralSeparator}zero`),De.forEach(Ht=>{jn([ie],i+Ht,n[`defaultValue${Ht}`]||rt)})}):jn(Ee,i,rt))}c=this.extendTranslation(c,t,n,p,r),T&&c===i&&this.options.appendNamespaceToMissingKey&&(c=`${a}:${i}`),(T||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?c=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,S?c:void 0):c=this.options.parseMissingKeyHandler(c))}return s?(p.res=c,p.usedParams=this.getUsedParamsDetails(n),p):c}extendTranslation(t,n,r,s,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=R(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const c=t.match(this.interpolator.nestingRegexp);f=c&&c.length}let p=r.replace&&!R(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),u){const c=t.match(this.interpolator.nestingRegexp),v=c&&c.length;f<v&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var c=arguments.length,v=new Array(c),m=0;m<c;m++)v[m]=arguments[m];return o&&o[0]===v[0]&&!r.context?(i.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):i.translate(...v,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,a=R(l)?[l]:l;return t!=null&&a&&a.length&&r.applyPostProcessor!==!1&&(t=Td.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,i,l;return R(t)&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),f=u.key;s=f;let p=u.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const c=n.count!==void 0&&!R(n.count),v=c&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(R(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(h=>{this.isValidLookup(r)||(l=h,!Nd[`${y[0]}-${h}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Nd[`${y[0]}-${h}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),y.forEach(d=>{if(this.isValidLookup(r))return;i=d;const g=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(g,f,d,h,n);else{let S;c&&(S=this.pluralResolver.getSuffix(d,n.count,n));const T=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(g.push(f+S),n.ordinal&&S.indexOf(C)===0&&g.push(f+S.replace(C,this.options.pluralSeparator)),v&&g.push(f+T)),m){const P=`${f}${this.options.contextSeparator}${n.context}`;g.push(P),c&&(g.push(P+S),n.ordinal&&S.indexOf(C)===0&&g.push(P+S.replace(C,this.options.pluralSeparator)),v&&g.push(P+T))}}let w;for(;w=g.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(d,h,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:i,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!R(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Yl=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ad{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ke.create("languageUtils")}getScriptPartFromCode(t){if(t=fo(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fo(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(R(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(t)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Yl(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Yl(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Yl(r[2].toLowerCase()))),r.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 n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),R(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return R(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):R(t)&&o(this.formatLanguageCode(t)),r.forEach(i=>{s.indexOf(i)<0&&o(this.formatLanguageCode(i))}),s}}let M1=[{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}],U1={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 B1=["v1","v2","v3"],V1=["v4"],jd={zero:0,one:1,two:2,few:3,many:4,other:5},H1=()=>{const e={};return M1.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:U1[t.fc]}})}),e};class W1{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ke.create("pluralResolver"),(!this.options.compatibilityJSON||V1.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=H1(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=fo(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=i,i}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>jd[s]-jd[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!B1.includes(this.options.compatibilityJSON)}}const Od=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=O1(e,t,n);return!o&&s&&R(n)&&(o=Xl(e,n,r),o===void 0&&(o=Xl(t,n,r))),o},Zl=e=>e.replace(/\$/g,"$$$$");class K1{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:i,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:f,unescapePrefix:p,nestingPrefix:c,nestingPrefixEscaped:v,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:h,maxReplaces:d,alwaysFormat:g}=t.interpolation;this.escape=n!==void 0?n:R1,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Pn(o):i||"{{",this.suffix=l?Pn(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=c?Pn(c):v||Pn("$t("),this.nestingSuffix=m?Pn(m):y||Pn(")"),this.nestingOptionsSeparator=h||",",this.maxReplaces=d||1e3,this.alwaysFormat=g!==void 0?g:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"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,n,r,s){let o,i,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=v=>{if(v.indexOf(this.formatSeparator)<0){const d=Od(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(d,void 0,r,{...s,...n,interpolationkey:v}):d}const m=v.split(this.formatSeparator),y=m.shift().trim(),h=m.join(this.formatSeparator).trim();return this.format(Od(n,a,y,this.options.keySeparator,this.options.ignoreJSONStructure),h,r,{...s,...n,interpolationkey:y})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>Zl(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?Zl(this.escape(v)):Zl(v)}].forEach(v=>{for(l=0;o=v.regex.exec(t);){const m=o[1].trim();if(i=u(m),i===void 0)if(typeof f=="function"){const h=f(t,o,s);i=R(h)?h:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))i="";else if(p){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),i="";else!R(i)&&!this.useRawValueToEscape&&(i=xd(i));const y=v.safeValue(i);if(t=t.replace(o[0],y),p?(v.regex.lastIndex+=i.length,v.regex.lastIndex-=o[0].length):v.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,i;const l=(a,u)=>{const f=this.nestingOptionsSeparator;if(a.indexOf(f)<0)return a;const p=a.split(new RegExp(`${f}[ ]*{`));let c=`{${p[1]}`;a=p[0],c=this.interpolate(c,i);const v=c.match(/'/g),m=c.match(/"/g);(v&&v.length%2===0&&!m||m.length%2!==0)&&(c=c.replace(/'/g,'"'));try{i=JSON.parse(c),u&&(i={...u,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,y),`${a}${f}${c}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,a};for(;s=this.nestingRegexp.exec(t);){let a=[];i={...r},i=i.replace&&!R(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(p=>p.trim());s[1]=f.shift(),a=f,u=!0}if(o=n(l.call(this,s[1].trim(),i),i),o&&s[0]===t&&!R(o))return o;R(o)||(o=xd(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),u&&(o=a.reduce((f,p)=>this.format(f,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const b1=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(i=>{if(i){const[l,...a]=i.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),f=l.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Tn=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const i=r+JSON.stringify(o);let l=t[i];return l||(l=e(fo(r),s),t[i]=l),l(n)}};class q1{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("formatter"),this.options=t,this.formats={number:Tn((n,r)=>s=>new Intl.NumberFormat(n,{...r}).format(s)),currency:Tn((n,r)=>s=>new Intl.NumberFormat(n,{...r,style:"currency"}).format(s)),datetime:Tn((n,r)=>s=>new Intl.DateTimeFormat(n,{...r}).format(s)),relativetime:Tn((n,r)=>s=>new Intl.RelativeTimeFormat(n,{...r}).format(s,r.range||"day")),list:Tn((n,r)=>s=>new Intl.ListFormat(n,{...r}).format(s))},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Tn(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{const{formatName:u,formatOptions:f}=b1(a);if(this.formats[u]){let p=l;try{const c=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},v=c.locale||c.lng||s.locale||s.lng||r;p=this.formats[u](l,v,{...f,...s,...c})}catch(c){this.logger.warn(c)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const J1=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Q1 extends po{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ke.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},i={},l={},a={};return t.forEach(u=>{let f=!0;n.forEach(p=>{const c=`${u}|${p}`;!r.reload&&this.store.hasResourceBundle(u,p)?this.state[c]=2:this.state[c]<0||(this.state[c]===1?i[c]===void 0&&(i[c]=!0):(this.state[c]=1,f=!1,i[c]===void 0&&(i[c]=!0),o[c]===void 0&&(o[c]=!0),a[p]===void 0&&(a[p]=!0)))}),f||(l[u]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const s=t.split("|"),o=s[0],i=s[1];n&&this.emit("failedLoading",o,i,n),!n&&r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{j1(a.loaded,[o],i),J1(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const f=a.loaded[u];f.length&&f.forEach(p=>{l[u][p]===void 0&&(l[u][p]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:i});return}this.readingCalls++;const l=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(u&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,o*2,i)},o);return}i(u,f)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(f=>l(null,f)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=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."),s&&s();R(t)&&(t=this.languageUtils.toResolveHierarchy(t)),R(n)&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(i,l)=>{i&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,i),!i&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,l),this.loaded(t,i,l)})}saveMissing(t,n,r,s,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend&&this.backend.create){const a={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(t,n,r,s,a):f=u(t,n,r,s),f&&typeof f.then=="function"?f.then(p=>l(null,p)).catch(l):l(null,f)}catch(f){l(f)}else u(t,n,r,s,l,a)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Ld=()=>({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]),R(e[1])&&(t.defaultValue=e[1]),R(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Rd=e=>(R(e.ns)&&(e.ns=[e.ns]),R(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),R(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),mo=()=>{},G1=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Mr extends po{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Rd(t),this.services={},this.logger=Ke,this.modules={external:[]},G1(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(R(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Ld();this.options={...s,...this.options,...Rd(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?Ke.init(o(this.modules.logger),this.options):Ke.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=q1);const p=new Ad(this.options);this.store=new Pd(this.options.resources,this.options);const c=this.services;c.logger=Ke,c.resourceStore=this.store,c.languageUtils=p,c.pluralResolver=new W1(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(c.formatter=o(f),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new K1(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Q1(o(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(v){for(var m=arguments.length,y=new Array(m>1?m-1:0),h=1;h<m;h++)y[h-1]=arguments[h];t.emit(v,...y)}),this.modules.languageDetector&&(c.languageDetector=o(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=o(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new go(this.services,this.options),this.translator.on("*",function(v){for(var m=arguments.length,y=new Array(m>1?m-1:0),h=1;h<m;h++)y[h-1]=arguments[h];t.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=function(){return t.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return t.store[f](...arguments),t}});const a=Ir(),u=()=>{const f=(p,c)=>{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),a.resolve(c),r(p,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mo;const s=R(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],i=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>i(a)),this.options.preload&&this.options.preload.forEach(l=>i(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const s=Ir();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=mo),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}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"&&Td.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 n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=Ir();this.emit("languageChanging",t);const o=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(a,function(){return r.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const u=R(a)?a:this.services.languageUtils.getBestMatchFromCodes(a);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{i(f,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),s}getFixedT(t,n,r){var s=this;const o=function(i,l){let a;if(typeof l!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),p=2;p<u;p++)f[p-2]=arguments[p];a=s.options.overloadTranslationOptionHandler([i,l].concat(f))}else a={...l};a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs,a.ns=a.ns||o.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||o.keyPrefix);const c=s.options.keySeparator||".";let v;return a.keyPrefix&&Array.isArray(i)?v=i.map(m=>`${a.keyPrefix}${c}${m}`):v=a.keyPrefix?`${a.keyPrefix}${c}${i}`:i,s.t(v,a)};return R(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}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 n=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 r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,i);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!s||i(o,t)))}loadNamespaces(t,n){const r=Ir();return this.options.ns?(R(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Ir();R(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return o.length?(this.options.preload=s.concat(o),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new Ad(Ld());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Mr(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mo;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Mr(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new Pd(this.store.data,s),o.services.resourceStore=o.store),o.translator=new go(o.services,s),o.translator.on("*",function(l){for(var a=arguments.length,u=new Array(a>1?a-1:0),f=1;f<a;f++)u[f-1]=arguments[f];o.emit(l,...u)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const _d=Mr.createInstance();_d.createInstance=Mr.createInstance;var X1=_d;const Y1=X1,Fd=["af","ar","bg","bn","bs","ca","cs","da","de","de-CH","el","en","eo","es","et","fa","fi","fr","gd","he","hi","hr","hu","id","is","it","ja","ko","kz","lt","lv","mk","mn","ms","ne","nl","nn","no","pl","pt","pt-BR","ro","ru","si","sk","sl","sq","sr","sr-Cyrl","sv","th","tr","uk","ur","uz","vi","zh","zh-Hant","sw","ta"];function Dd(e,t){return e.reduce((n,r)=>{let s;try{s=wd("/ghost/i18n/lib")(`../locales/${r}/${t}.json`)}catch{s=wd("/ghost/i18n/lib")(`../locales/en/${t}.json`)}return n[r]={[t]:{...s,...s.default&&typeof s.default=="object"?s.default:{}}},n},{})}uo.exports=(e="en",t="portal")=>{const n=Y1.createInstance();let r={};t==="newsletter"&&(r={prefix:"{",suffix:"}"});let s=Dd(Fd,t);return n.init({lng:e,nsSeparator:!1,keySeparator:!1,returnEmptyString:!1,fallbackLng:!1,ns:t,defaultNS:t,interpolation:r,resources:s}),n},uo.exports.SUPPORTED_LOCALES=Fd,uo.exports.generateResources=Dd;var Z1=uo.exports,ey=Z1;const ty=Q(ey);class ny extends st.Component{constructor(t){super(t);const n=this.props.locale||"en",r=ty(n,"search"),s=r.dir()||"ltr",o=new S0({adminUrl:t.adminUrl,apiKey:t.apiKey,dir:s});this.state={searchIndex:o,showPopup:!1,indexStarted:!1,indexComplete:!1,t:r.t,dir:s},this.inputRef=st.createRef()}componentDidMount(){this.initSetup()}componentDidUpdate(t,n){var r,s,o;if(n.showPopup!==this.state.showPopup)try{this.state.showPopup?(this.bodyScroll=(o=(s=(r=window.document)==null?void 0:r.body)==null?void 0:s.style)==null?void 0:o.overflow,window.document.body.style.overflow="hidden"):window.document.body.style.overflow=this.bodyScroll||""}catch{}this.state.showPopup!==(n==null?void 0:n.showPopup)&&!this.state.showPopup&&this.setState({searchValue:""}),this.state.showPopup&&!this.state.indexStarted&&this.setupSearchIndex()}async setupSearchIndex(){this.setState({indexStarted:!0}),await this.state.searchIndex.init(),this.setState({indexComplete:!0})}componentWillUnmount(){window.removeEventListener("hashchange",this.hashHandler,!1),window.removeEventListener("keydown",this.handleKeyDown,!1)}initSetup(){this.handleSearchUrl(),this.addKeyboardShortcuts(),this.setupCustomTriggerButton(),this.hashHandler=()=>{this.handleSearchUrl()},window.addEventListener("hashchange",this.hashHandler,!1)}setupCustomTriggerButton(){this.clickHandler=t=>{t.preventDefault(),this.setState({showPopup:!0});const n=document.createElement("input");n.style.opacity="0",n.style.position="fixed",n.style.top="0",document.body.appendChild(n),n.focus(),setTimeout(()=>{this.inputRef.current.focus(),document.body.removeChild(n)},150)},this.customTriggerButtons=this.getCustomTriggerButtons(),this.customTriggerButtons.forEach(t=>{t.removeEventListener("click",this.clickHandler),t.addEventListener("click",this.clickHandler)})}getCustomTriggerButtons(){const t="[data-ghost-search]";return document.querySelectorAll(t)||[]}handleSearchUrl(){const[t]=window.location.hash.substr(1).split("?");(t==="/search"||t==="/search/")&&(this.setState({showPopup:!0}),window.history.replaceState("",document.title,window.location.pathname))}addKeyboardShortcuts(){const t=this.getCustomTriggerButtons();t!=null&&t.length&&(this.handleKeyDown=n=>{if(n.key==="k"&&n.metaKey)return this.setState({showPopup:!0}),n.preventDefault(),n.stopPropagation(),!1},document.addEventListener("keydown",this.handleKeyDown))}render(){return E.jsx(de.Provider,{value:{page:"search",showPopup:this.state.showPopup,adminUrl:this.props.adminUrl,stylesUrl:this.props.stylesUrl,searchIndex:this.state.searchIndex,indexComplete:this.state.indexComplete,searchValue:this.state.searchValue,inputRef:this.inputRef,onAction:()=>{},dispatch:(t,n)=>{t==="update"&&this.setState({...this.state,...n})},t:this.state.t,dir:this.state.dir},children:E.jsx(yf,{})})}}const Id="sodo-search-root";function ry(){const e=document.createElement("div");e.id=Id,document.body.appendChild(e)}function sy(){const e=document.querySelector("script[data-sodo-search]");if(e){const t=e.dataset.sodoSearch,n=e.dataset.key,r=e.dataset.styles,s=e.dataset.locale||"en";return{adminUrl:t,apiKey:n,stylesUrl:r,locale:s}}return{}}function oy(){ry()}function iy(){var o;const{adminUrl:e,apiKey:t,stylesUrl:n,locale:r}=sy(),s=(o=e||window.location.origin)==null?void 0:o.replace(/\/+$/,"");oy(),Qp.render(E.jsx(st.StrictMode,{children:E.jsx(ny,{adminUrl:s,apiKey:t,stylesUrl:n,locale:r})}),document.getElementById(Id))}iy()});
|
|
56
56
|
//# sourceMappingURL=sodo-search.min.js.map
|