@teammy/server 0.2.23 → 0.2.25
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/LICENSE +21 -0
- package/README.md +11 -7
- package/dist/main.js +21235 -13704
- package/dist/native-pi-entry.js +815 -19
- package/dist/project-pi-entry.js +818 -22
- package/dist/runtime/en/shared/system.md +9 -0
- package/dist/runtime/en/shared/tools.json +22 -0
- package/dist/runtime/en/workflows/directory-analysis/prompt.md +11 -0
- package/dist/runtime/en/workflows/file-summary/prompt.md +7 -0
- package/dist/runtime/en/workflows/session-handoff/prompt.md +31 -0
- package/dist/runtime/en/workflows/session-overview/prompt.md +26 -0
- package/dist/runtime/en/workflows/task-bootstrap/prompt.md +84 -0
- package/dist/runtime/shared/system.md +1 -1
- package/dist/runtime/workflows/session-handoff/prompt.md +1 -1
- package/dist/runtime/workflows/session-overview/prompt.md +1 -1
- package/dist/web/THIRD-PARTY-LICENSES.md +2025 -0
- package/dist/web/assets/Assistant-C-GBv5St.js +1 -0
- package/dist/web/assets/Computers-B-FvcufX.js +14 -0
- package/dist/web/assets/{Computers-BtcIsnDD.css → Computers-BJKv9oJv.css} +1 -1
- package/dist/web/assets/Conversation-Dzr18Rmq.js +1 -0
- package/dist/web/assets/Dashboard-5ksfc6l9.js +1 -0
- package/dist/web/assets/Files-DqrIDBJI.js +1 -0
- package/dist/web/assets/Help-JsdkpQ8l.js +2413 -0
- package/dist/web/assets/MessageComposer-DOJ1PYXg.js +1 -0
- package/dist/web/assets/MessageComposer-DqcbXBIG.css +1 -0
- package/dist/web/assets/ResourceLibrary--aVsAt6m.js +6 -0
- package/dist/web/assets/TerminalPane-jJa53g04.js +22 -0
- package/dist/web/assets/WorkspaceTree-CuwIu3vj.js +1 -0
- package/dist/web/assets/file-links-BnaVOi2G.js +1 -0
- package/dist/web/assets/index-B9gF6reY.css +1 -0
- package/dist/web/assets/index-Ck_8bv0N.js +40 -0
- package/dist/web/assets/project-links-CodATITq.js +105 -0
- package/dist/web/assets/workflow-DR-M8YZx.svg +111 -0
- package/dist/web/downloads/teammy-inbox-skill.zip +0 -0
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +4 -4
- package/dist/web/notification-worker.js +2 -10
- package/node_modules/i18next/LICENSE +21 -0
- package/node_modules/i18next/README.md +77 -0
- package/node_modules/i18next/dist/cjs/i18next.js +2495 -0
- package/node_modules/i18next/dist/esm/i18next.js +2505 -0
- package/node_modules/i18next/dist/esm/package.json +1 -0
- package/node_modules/i18next/dist/umd/i18next.js +2501 -0
- package/node_modules/i18next/dist/umd/i18next.min.js +1 -0
- package/node_modules/i18next/i18next.js +2501 -0
- package/node_modules/i18next/i18next.min.js +1 -0
- package/node_modules/i18next/index.d.mts +71 -0
- package/node_modules/i18next/index.d.ts +739 -0
- package/node_modules/i18next/package.json +125 -0
- package/node_modules/i18next/typescript/helpers.d.ts +73 -0
- package/node_modules/i18next/typescript/options.d.ts +871 -0
- package/node_modules/i18next/typescript/t.d.ts +1449 -0
- package/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/jose/README.md +150 -0
- package/node_modules/jose/dist/types/index.d.ts +55 -0
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +25 -0
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +40 -0
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +25 -0
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +46 -0
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +29 -0
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +51 -0
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +10 -0
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +15 -0
- package/node_modules/jose/dist/types/jwks/local.d.ts +17 -0
- package/node_modules/jose/dist/types/jwks/remote.d.ts +94 -0
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +21 -0
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +25 -0
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +23 -0
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +26 -0
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +41 -0
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +31 -0
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +38 -0
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +57 -0
- package/node_modules/jose/dist/types/jwt/sign.d.ts +21 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +21 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +36 -0
- package/node_modules/jose/dist/types/key/export.d.ts +19 -0
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +33 -0
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +30 -0
- package/node_modules/jose/dist/types/key/import.d.ts +67 -0
- package/node_modules/jose/dist/types/types.d.ts +802 -0
- package/node_modules/jose/dist/types/util/base64url.d.ts +16 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +9 -0
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +10 -0
- package/node_modules/jose/dist/types/util/errors.d.ts +182 -0
- package/node_modules/jose/dist/webapi/index.js +70 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +26 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +15 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +35 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +41 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +105 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +55 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +60 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +103 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +20 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +8 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +23 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +12 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +58 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +42 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +42 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +19 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +13 -0
- package/node_modules/jose/dist/webapi/key/export.js +35 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +35 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +36 -0
- package/node_modules/jose/dist/webapi/key/import.js +53 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +138 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +75 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +90 -0
- package/node_modules/jose/dist/webapi/lib/deflate.js +41 -0
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +116 -0
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +190 -0
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +75 -0
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +46 -0
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +89 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +150 -0
- package/node_modules/jose/dist/webapi/lib/key.js +157 -0
- package/node_modules/jose/dist/webapi/lib/key_algorithm.js +15 -0
- package/node_modules/jose/dist/webapi/lib/key_descriptor.js +9 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +195 -0
- package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +16 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +33 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +19 -0
- package/node_modules/jose/dist/webapi/util/errors.js +109 -0
- package/node_modules/jose/package.json +134 -0
- package/node_modules/oauth4webapi/LICENSE.md +21 -0
- package/node_modules/oauth4webapi/README.md +104 -0
- package/node_modules/oauth4webapi/build/index.d.ts +3046 -0
- package/node_modules/oauth4webapi/build/index.js +2530 -0
- package/node_modules/oauth4webapi/build/index.js.map +1 -0
- package/node_modules/oauth4webapi/package.json +112 -0
- package/node_modules/openid-client/LICENSE.md +21 -0
- package/node_modules/openid-client/README.md +258 -0
- package/node_modules/openid-client/build/index.d.ts +2478 -0
- package/node_modules/openid-client/build/index.js +1347 -0
- package/node_modules/openid-client/build/index.js.map +1 -0
- package/node_modules/openid-client/build/passport.d.ts +258 -0
- package/node_modules/openid-client/build/passport.js +264 -0
- package/node_modules/openid-client/build/passport.js.map +1 -0
- package/node_modules/openid-client/package.json +130 -0
- package/package.json +5 -1
- package/dist/web/assets/Assistant-Dks48Y5w.js +0 -1
- package/dist/web/assets/Computers-CaCzZeCc.js +0 -13
- package/dist/web/assets/Conversation-kAMzKADw.js +0 -1
- package/dist/web/assets/Dashboard-ComNJNOg.js +0 -1
- package/dist/web/assets/Dropdown-DGFI68Vd.js +0 -55
- package/dist/web/assets/Files-Blsq_C-B.js +0 -1
- package/dist/web/assets/Help-BM23uS-t.js +0 -1079
- package/dist/web/assets/Markdown-CXnZDm5J.js +0 -29
- package/dist/web/assets/MessageComposer-BoOgfyPA.js +0 -1
- package/dist/web/assets/MessageComposer-hKEluJsT.css +0 -1
- package/dist/web/assets/ResourceLibrary-C12_47kE.js +0 -6
- package/dist/web/assets/TerminalPane-BTRM-36z.js +0 -22
- package/dist/web/assets/WorkspaceTree-Co7XG2RG.js +0 -1
- package/dist/web/assets/file-links-CoVqmrXg.js +0 -1
- package/dist/web/assets/index-CeKzFsxV.css +0 -1
- package/dist/web/assets/index-mhJ33-bH.js +0 -10
- package/dist/web/assets/task-links-BE36-8mc.js +0 -1
- /package/dist/web/assets/{Dropdown-ktgqMqAD.css → project-links-ktgqMqAD.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).i18next=t()}(this,function(){"use strict";const e=e=>"string"==typeof e,t=()=>{let e,t;const s=new Promise((s,i)=>{e=s,t=i});return s.resolve=e,s.reject=t,s},s=e=>null==e?"":String(e),i=t=>e(t)&&/^[A-Za-z0-9_@.-]{1,128}$/.test(t)&&!t.includes("..")&&!["__proto__","constructor","prototype"].includes(t),o=e=>e?.callbackApi??e?.constructor?.callbackApi,n=/###/g,r=e=>e&&e.includes("###")?e.replace(n,"."):e,a=t=>!t||e(t),l=(t,s,i)=>{const o=e(s)?s.split("."):s;let n=0;for(;n<o.length-1;){if(a(t))return{};const e=r(o[n]);!t[e]&&i&&(t[e]=new i),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++n}return a(t)?{}:{obj:t,k:r(o[n])}},c=(e,t,s)=>{const{obj:i,k:o}=l(e,t,Object);if(void 0!==i||1===t.length)return void(i[o]=s);let n=t[t.length-1],r=t.slice(0,t.length-1),a=l(e,r,Object);for(;void 0===a.obj&&r.length;)n=`${r[r.length-1]}.${n}`,r=r.slice(0,r.length-1),a=l(e,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${n}`]&&(a.obj=void 0);a.obj[`${a.k}.${n}`]=s},h=(e,t)=>{const{obj:s,k:i}=l(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},u=e=>null===e||"object"!=typeof e||e instanceof String,p=(e,t,s)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(Object.prototype.hasOwnProperty.call(e,i)?u(e[i])||u(t[i])?s&&(e[i]=t[i]):p(e[i],t[i],s):e[i]=t[i]);return e},g=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),d={"&":"&","<":"<",">":">",'"':""","'":"'"},f=t=>e(t)?t.replace(/[&<>"']/g,e=>d[e]):t;const m=[" ",",","?","!",";"],y=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),b=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}if(!s)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(s);let o=e;for(let e=0;e<i.length;){if(!o||"object"!=typeof o)return;let t,n="";for(let r=e;r<i.length;++r)if(r!==e&&(n+=s),n+=i[r],t=o[n],"function"!=typeof t&&"__proto__"!==n||Object.prototype.hasOwnProperty.call(o,n)||(t=void 0),void 0!==t){if(["string","number","boolean"].includes(typeof t)&&r<i.length-1)continue;e+=r-e+1;break}o=t}return o},v=e=>e?.replace(/_/g,"-"),x={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class k{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug,this.seen=new Set}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}once(e,t,...s){return!this.debug||this.seen.has(e)||this.seen.size>=1e3?null:(this.seen.add(e),this[t](...s))}forward(t,s,i,o){return o&&!this.debug?null:(t=t.map(t=>e(t)?t.replace(/[\r\n\x00-\x1F\x7F]/g," "):t),e(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[s](t))}create(e){return new k(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new k(this.logger,e)}}var S=new k;const L=new WeakSet;class w{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)}),this}off(e,t){("string"==typeof e?e.split(" "):[e]).forEach(e=>{this.observers[e]&&(t?(this.observers[e].delete(t),L.has(t)&&this.observers[e].forEach((s,i)=>{i.listener===t&&this.observers[e].delete(i)})):delete this.observers[e])})}once(e,t){const s=(...i)=>{this.off(e,s),t(...i)};return s.listener=t,L.add(t),this.on(e,s),this}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,s])=>{for(let i=0;i<s;i++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s(e,...t)})}}}const $=new WeakSet,O=(t,...s)=>{if(s.some(t=>!e(t)))throw new TypeError(`${t}: pass language, namespace${"addResource"===t?" and key":""} as separate strings; the dotted form ('en.translation.key') was removed in i18next v27`)};class C extends w{constructor(e,t={ns:["translation"],defaultNS:"translation"},s=S){super(),this.data=e||{},this.options=t,this.logger=s.create("resourceStore"),void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(t,s,i,o={}){const n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,r=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[t,s];i&&(Array.isArray(i)?a.push(...i):e(i)&&n?a.push(...i.split(n)):a.push(i));const l=h(this.data,a);return null==l&&r&&e(i)?b(this.data?.[t]?.[s],i,n):l}addResource(e,t,s,i,o={silent:!1}){O("addResource",e,t,s);const n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let r=[e,t];s&&(r=r.concat(n?s.split(n):s)),this.addNamespaces(t),c(this.data,r,i),o.silent||this.emit("added",e,t,s,i)}addResources(e,t,s,i={silent:!1}){O("addResources",e,t),Object.keys(s||{}).forEach(i=>{"__proto__"!==i&&"constructor"!==i&&this.addResource(e,t,i,s[i],{silent:!0})}),i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,o,n={silent:!1,skipCopy:!1}){O("addResourceBundle",e,t);const r=[e,t];this.addNamespaces(t);let a=h(this.data,r)||{};n.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?p(a,s,o):a={...a,...s},c(this.data,r,a),n.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{const s=t[e];return!!$.has(s)||!(!s||0===Object.keys(s).length)&&("object"==typeof s&&$.add(s),!0)})}toJSON(){return this.data}}const R=Symbol("i18next/PATH_KEY");function j(e,t){const{[R]:s}=e(function(){const e=[],t=Object.create(null);let s;return t.get=(i,o)=>(s?.revoke?.(),o===R?e:(e.push(o),s=Proxy.revocable(i,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),i=t?.keySeparator||".",o=t?.nsSeparator??":",n="strict"===t?.enableSelector;if(s.length>1&&o){const e=t?.ns,r=n?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(r){if((n?r:r.length>1?r.slice(1):[]).includes(s[0]))return`${s[0]}${o}${s.slice(1).join(i)}`}}return s.join(i)}const P=t=>!e(t)&&"boolean"!=typeof t&&"number"!=typeof t;class N extends w{constructor(e,t={}){var s,i;super(),s=e,i=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils","postProcessors"].forEach(e=>{s[e]&&(i[e]=s[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=(e.logger||S).create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const i=this.resolve(e,s);if(void 0===i?.res)return!1;const o=P(i.res);return!1!==s.returnObjects||!o}extractFromKey(t,s){let i=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let n=s.ns||this.options.defaultNS||[];const r=i&&t.includes(i),a=!(this.options.userDefinedKeySeparator||s.keySeparator||this.options.userDefinedNsSeparator||s.nsSeparator||((e,t,s)=>{t=t||"",s=s||"";const i=m.filter(e=>!t.includes(e)&&!s.includes(e));if(0===i.length)return!0;const o=y.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`);let n=!o.test(e);if(!n){const t=e.indexOf(s);t>0&&!o.test(e.substring(0,t))&&(n=!0)}return n})(t,i,o));if(r&&!a){const s=t.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:t,namespaces:e(n)?[n]:n};const r=t.split(i);(i!==o||i===o&&this.options.ns.includes(r[0]))&&(n=r.shift()),t=r.join(!1===o?i:o)}return{key:t,namespaces:e(n)?[n]:n}}translate(t,s,i){let o="object"==typeof s?{...s}:s;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==t)return"";"function"==typeof t&&(t=j(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>"function"==typeof e?j(e,{...this.options,...o}):String(e));const n=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(t[t.length-1],o),c=l[l.length-1];let h=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===h&&(h=":");const u=o.lng||this.language,p=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return p?n?{res:`${c}${h}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${h}${a}`:n?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:a;const g=this.resolve(t,o);let d=g?.res;const f=g?.usedKey||a,m=g?.exactUsedKey||a,y=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!e(o.count),x=N.hasDefaultValue(o),k=v?this.pluralResolver.getSuffix(u,o.count,o):"",S=o.ordinal&&v?this.pluralResolver.getSuffix(u,o.count,{ordinal:!1}):"",L=v&&!o.ordinal&&0===o.count,w=this.options.pluralSeparator,$=o.defaultValue??(v?o[`defaultValue${o.ordinal?`${w}ordinal${w}`:w}other`]:void 0),O=o[`defaultValue${k}`]??o[`defaultValue${S}`]??$,C=(L?o[`defaultValue${w}zero`]:void 0)??O;let R=d;b&&!d&&x&&(R=C);const E=P(R),F=Object.prototype.toString.apply(R),T=b&&R&&E&&!["[object Number]","[object Function]","[object RegExp]"].includes(F)&&!(e(y)&&Array.isArray(R)),A=T&&!o.returnObjects&&!this.options.returnObjects;if(A&&this.options.returnedObjectHandler){const e=this.options.returnedObjectHandler(f,R,{...o,ns:l});return n?(g.res=e,g.usedParams=this.getUsedParamsDetails(o),g):e}if(A&&this.logger.warn("accessing an object - but returnObjects options is not enabled!"),T&&!A){if(r){const e=Array.isArray(R),t=e?[]:{},s=e?m:f;for(const e in R)if(Object.prototype.hasOwnProperty.call(R,e)){const i=`${s}${r}${e}`;t[e]=x&&!d?this.translate(i,{...o,defaultValue:P(C)?C[e]:void 0,joinArrays:!1,ns:l}):this.translate(i,{...o,joinArrays:!1,ns:l}),t[e]===i&&(t[e]=R[e])}d=t}}else if(b&&e(y)&&Array.isArray(d))d=d.join(y),d&&(d=this.extendTranslation(d,t,o,g,i));else{let e=!1,s=!1;A&&(d=void 0),this.isValidLookup(d)||!x||A&&P(C)||(e=!0,d=C),this.isValidLookup(d)||e&&""===d||(s=!0,d=a);const n=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:d,l=x&&C!==d&&this.options.updateMissing;if(!A&&(s||e||l)){if(this.logger.log(l?"updateKey":"missingKey",u,c,v&&!l?`${a}${this.pluralResolver.getSuffix(u,o.count,o)}`:a,l?C:d),r){const e=this.resolve(a,{...o,keySeparator:!1});e&&e.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 e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(o.lng||this.language):e.push(o.lng||this.language);const s=(e,t,s)=>{const i=x&&s!==d?s:n;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,i,l,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,i,l,o,void 0,this.utils?.hasLoadedNamespace),this.emit("missingKey",e,c,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,o),i=o[`defaultValue${w}zero`];L&&null!=i&&!t.includes(`${w}zero`)&&t.push(`${w}zero`),t.forEach(t=>{s([e],a+t,o[`defaultValue${t}`]??(t===k?O:$)??C)})}):s(e,a,C))}d=this.extendTranslation(d,t,o,g,i),s&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}${h}${a}`),(s||e)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${h}${a}`:a,e?d:void 0,o))}return n?(g.res=d,g.usedParams=this.getUsedParamsDetails(o),g):d}extendTranslation(t,s,i,o,n){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const r=e(t)&&(void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const e=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null;a=e&&e.length}let l=i.replace&&!e(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,i.lng||this.language||o.usedLng,i),r){const e=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null;a<(e&&e.length)&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),!1!==i.nest&&(t=this.interpolator.nest(t,(...e)=>n?.[0]!==e[0]||i.context?this.translate(...e,s):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${s[0]}`),null),i)),i.interpolation&&this.interpolator.reset()}const r=i.postProcess||this.options.postProcess,a=e(r)?[r]:r;if(null!=t&&a?.length&&!1!==i.applyPostProcessor){const e=this.options?.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i;a.forEach(i=>{const o=this.postProcessors?.[i];o?t=o.process(t,s,e,this)??t:this.logger.once(`postProcess:${i}`,"warn",`postProcess: '${i}' is not registered on this i18next instance; call use() with it on this instance`)})}return t}resolve(t,s={}){let i,o,n,r,a;return e(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(e=>"function"==typeof e?j(e,{...this.options,...s}):e)),t.forEach(t=>{if(this.isValidLookup(i))return;const l=this.extractFromKey(t,s),c=l.key;o=c;let h=l.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const u=void 0!==s.count&&!e(s.count),p=u&&!s.ordinal&&0===s.count,g=void 0!==s.context&&(e(s.context)||"number"==typeof s.context)&&""!==s.context,d=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);h.forEach(e=>{this.isValidLookup(i)||(a=e,this.checkedLoadedFor[`${d[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(this.checkedLoadedFor[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${d.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach(t=>{if(this.isValidLookup(i))return;r=t;const o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,t,e,s);else{let e;u&&(e=this.pluralResolver.getSuffix(t,s.count,s));const i=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(s.ordinal&&e.startsWith(n)&&o.push(c+e.replace(n,this.options.pluralSeparator)),o.push(c+e),p&&o.push(c+i)),g){const t=`${c}${this.options.contextSeparator||"_"}${s.context}`;o.push(t),u&&(s.ordinal&&e.startsWith(n)&&o.push(t+e.replace(n,this.options.pluralSeparator)),o.push(t+e),p&&o.push(t+i))}if(u){const t=`${s.ordinal?n:this.options.pluralSeparator}other`;e!==t&&(g&&o.unshift(`${c}${this.options.contextSeparator||"_"}${s.context}${t}`),o.unshift(c+t))}}let a;for(;a=o.pop();)this.isValidLookup(i)||(n=a,i=this.getResource(t,e,a,s))}))})}),{res:i,usedKey:o,exactUsedKey:n,usedLng:r,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!e(t.replace);let o=i?t.replace:t;if(i&&void 0!==t.count&&(o={...o,count:t.count}),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const e of s)delete o[e]}return o}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class E{constructor(e,t=S){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=t.create("languageUtils"),this.resolveHierarchyCache={},this.formattedCodes=new Map}clearCache(){this.resolveHierarchyCache={},this.formattedCodes.clear()}getScriptPartFromCode(e){if(!(e=v(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=v(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(t){if(!e(t))return t;let s=this.formattedCodes.get(t);return void 0!==s||(s=this.formatUncached(t),this.formattedCodes.size>=1e3&&this.formattedCodes.clear(),this.formattedCodes.set(t,s)),s}formatUncached(e){const t=e.includes("-");if(t||!1!==this.options.cleanCode){let s;try{s=Intl.getCanonicalLocales(e)[0]}catch(e){}if(s&&(t||s.toLowerCase()===e.toLowerCase()))return this.options.lowerCaseLng?s.toLowerCase():s;if(s)return e.toLowerCase()}return this.options.lowerCaseLng||this.options.cleanCode&&!t?e.toLowerCase():e}isSupportedCode(e){if(("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length)return!0;if(!Array.isArray(this.supportedLngs))return this.supportedLngs.includes(e);const t=this.formatLanguageCode(e);return this.supportedLngs.some(e=>this.formatLanguageCode(e)===t)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const s=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(s)||(t=s)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.map(e=>this.formatLanguageCode(e)).find(e=>e===i||!(!e.includes("-")&&!i.includes("-"))&&!(!e.includes("-")||i.includes("-")||e.slice(0,e.indexOf("-"))!==i))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(t,s){if(!t)return[];if("function"==typeof t&&(t=t(s)),e(t)&&(t=[t]),Array.isArray(t))return t;const i=e=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(!s)return i("default")||[];let o=i(s);return o||(o=i(this.getScriptPartFromCode(s))),o||(o=i(this.formatLanguageCode(s))),o||(o=i(this.getLanguagePartFromCode(s))),o||(o=i("default")),o||[]}toResolveHierarchy(t,s){const i=this.options.fallbackLng,o=Array.isArray(i)?i.join("|"):i;o!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=o);const n=void 0===s||!1===s||e(s),r=void 0===s&&"function"==typeof this.options.fallbackLng;let a=null;if(e(t)&&n&&!r){let e;e=void 0===s?"undefined":!1===s?"boolean:false":`string:${s}`,a=`${t.length}:${t}|${e}`}if(null!==a){const e=this.resolveHierarchyCache[a];if(void 0!==e)return e.slice()}const l=this.getFallbackCodes((!1===s?[]:s)||this.options.fallbackLng||[],t),c=[],h=e=>{e&&(this.isSupportedCode(e)?c.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return e(t)&&(t.includes("-")||t.includes("_"))?("languageOnly"!==this.options.load&&h(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&h(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&h(this.getLanguagePartFromCode(t))):e(t)&&h(this.formatLanguageCode(t)),l.forEach(e=>{const t=this.formatLanguageCode(e);c.includes(t)||h(t)}),null!==a?(Object.keys(this.resolveHierarchyCache).length>=1e3&&(this.resolveHierarchyCache={}),this.resolveHierarchyCache[a]=c,c.slice()):c}}const F={zero:0,one:1,two:2,few:3,many:4,other:5},T={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class A{constructor(e,t={},s=S){this.languageUtils=e,this.options=t,this.logger=s.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=v("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let n;try{n=new Intl.PluralRules(s,{type:i})}catch(s){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),T;if(!e.match(/-|_/))return T;const i=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(i,t)}return Object.keys(this.pluralRulesCache).length>=1e3&&(this.pluralRulesCache={}),this.pluralRulesCache[o]=n,n}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((e,t)=>F[e]-F[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const V=(t,s,i,o=".",n=!0)=>{let r=((e,t,s)=>{const i=h(e,s);return void 0!==i?i:h(t,s)})(t,s,i);return null==r&&n&&e(i)&&(r=b(t,i,o),void 0===r&&(r=b(s,i,o))),r},I=e=>s(e).replace(/["'\\&<>\u0000-\u001f]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`);class D{constructor(e={},t=S){this.logger=t.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:o,suffix:n,formatSeparator:r,unescapeSuffix:a,unescapePrefix:l,nestingPrefix:c,nestingSuffix:h,nestingOptionsSeparator:u,maxReplaces:p,alwaysFormat:d}=e.interpolation;this.escape=void 0!==t?t:f,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=o?g(o):"{{",this.suffix=n?g(n):"}}",this.formatSeparator=r||",",this.unescapePrefix=a?"":l?g(l):"-",this.unescapeSuffix=this.unescapePrefix?"":a?g(a):"",this.prefixText=o||"{{",this.nestingPrefixText=c||"$t(",this.nestingPrefix=g(c||"$t("),this.nestingSuffix=g(h||")"),this.nestingOptionsSeparator=u||",",this.maxReplaces=p||1e3,this.alwaysFormat=void 0!==d&&d,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,o,n,r){let a,l,c;const h=t,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=e=>{if(!e.includes(this.formatSeparator)){const t=V(i,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(t,void 0,o,{...n,...i,interpolationkey:e}):t}const t=e.split(this.formatSeparator),s=t.shift().trim(),r=t.join(this.formatSeparator).trim();return this.format(V(i,u,s,this.options.keySeparator,this.options.ignoreJSONStructure),r,o,{...n,...i,interpolationkey:s})};this.resetRegExp(),"string"==typeof t&&/\$t\([^)]*\{[^}]*\{\{-/.test(t)&&this.logger.warn("nesting options string contains a variable inserted unescaped with {{- }}: if its value is attacker-controlled it can inject additional nesting options (e.g. redirect lng/ns). Use {{var}} there, which is escaped for the options, or sanitise untrusted input before passing it to t().");const d=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;if(e(t)&&!t.includes(this.prefixText))return t;if(!r&&(r=e=>this.escapeValue?this.escape(e):e,e(t)&&t.includes(this.nestingPrefixText))){const e=new RegExp(this.nestingRegexp),s=new RegExp(`${g(this.nestingOptionsSeparator)}[ ]*{`);let a,l="",c=0;for(;a=e.exec(t);){const e=a.index+this.nestingPrefixText.length,h=s.exec(a[1]),u=h?e+h.index+h[0].length-1:-1,p=e+a[1].lastIndexOf("}")+1;-1!==u&&p>u&&!t.startsWith(this.prefixText,u)&&(l+=this.interpolate(t.slice(c,u),i,o,n,r)+t.slice(u,p),c=p)}if(c)return l+this.interpolate(t.slice(c),i,o,n,r)}const m=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:r}],y=[];let b=0;return m.forEach(i=>{for(c=0;a=i.regex.exec(t);){const o=a.index-b,r=y.find(([e,t])=>o>=e&&o<t);if(r){i.regex.lastIndex=r[1]+b;continue}const u=a[1].trim();if(l=p(u),void 0===l)if("function"==typeof d){const s=d(t,a,n);l=e(s)?s:""}else if(n&&Object.prototype.hasOwnProperty.call(n,u.split(this.formatSeparator)[0].trim()))l="";else{if(f){this.logger.debug&&this.logger.once(`${h}\0${a[0]}`,"warn",`missed to pass in variable ${u} for interpolating ${h}`),l=a[0];continue}this.logger.warn(`missed to pass in variable ${u} for interpolating ${t}`),l=""}else e(l)||this.useRawValueToEscape||(l=s(l));const g=s(i.safeValue(l));if(t=t.slice(0,a.index)+g+t.slice(a.index+a[0].length),f?(i.regex===this.regexpUnescape?y.push([a.index,a.index+g.length]):b+=g.length-a[0].length,i.regex.lastIndex+=g.length,i.regex.lastIndex-=a[0].length):i.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,i,o={}){let n,r,a;const l=(e,t)=>{const s=this.nestingOptionsSeparator;if(!e.includes(s))return e;const i=e.split(new RegExp(`${g(s)}[ ]*{`)),n=`{${i[1]}`;let r;e=i[0];const l=e=>{r=this.interpolate(n,t,o.lng,o,e);const s=r.match(/'/g),i=r.match(/"/g);return((s?.length??0)%2==0&&!i||(i?.length??0)%2!=0)&&(r=r.replace(/'/g,'"')),JSON.parse(r)};try{const e=l(I),s=this.escapeValue?Object.keys(e).filter(e=>e.startsWith("defaultValue")||"joinArrays"===e):[];if(s.length){const t=l(e=>I(this.escape(e)));s.forEach(s=>{e[s]=t[s]})}a=t?{...t,...e}:e}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${r}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};if(e(t)&&!t.includes(this.nestingPrefixText))return t;const c=new RegExp(this.nestingRegexp);let h="",u=0;for(;n=c.exec(t);){let p=[];a={...o},a=a.replace&&!e(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const g=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==g&&(p=n[1].slice(g).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,g)),r=i(l.call(this,n[1].trim(),a),a),r&&n[0]===t&&!e(r))return r;e(r)||(r=s(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),p.length&&(r=p.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()}),r.trim())),h+=t.slice(u,n.index)+s(r),u=c.lastIndex,this.regexp.lastIndex=0}return u?h+t.slice(u):t}}const U=e=>{const t=new Map;return(s,i,o)=>{let n,r=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(r={...r,[o.interpolationkey]:void 0});try{n=i+JSON.stringify(r)}catch(t){return e(v(i),o)(s)}let a=t.get(n);return a||(a=e(v(i),o),t.size>=1e3&&t.delete(t.keys().next().value),t.set(n,a)),a(s)}},H=e=>(t,s,i)=>e(v(s),i)(t);class K{constructor(e={}){this.logger=S.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){e?.logger?.create&&(this.logger=e.logger.create("formatter")),this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?U:H;this.formats={number:s((e,t)=>{const s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)}),currency:s((e,t)=>{const s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)}),datetime:s((e,t)=>{const s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)}),relativetime:s((e,t)=>{const s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")}),list:s((e,t)=>{const s=new Intl.ListFormat(e,{...t});return e=>s.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=U(t)}format(e,t,s,i={}){if(!t)return e;if(null==e)return e;const o=t.split(this.formatSeparator),n=[];for(let e=0;e<o.length;e++){let t=o[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<o.length;)t=`${t}${this.formatSeparator}${o[++e]}`;n.push(t)}return n.reduce((e,t)=>{const{formatName:o,formatOptions:n}=(e=>{let t=e.toLowerCase().trim();const s={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const o=i[1].slice(0,-1);"currency"!==t||o.includes(":")?"relativetime"!==t||o.includes(":")?o.split(";").forEach(e=>{if(e){const[t,...i]=e.split(":"),o=i.join(":").trim().replace(/^'+|'+$/g,""),n=t.trim();s[n]||(s[n]=o),"false"===o&&(s[n]=!1),"true"===o&&(s[n]=!0),isNaN(o)||(s[n]=parseInt(o,10))}}):s.range||(s.range=o.trim()):s.currency||(s.currency=o.trim())}return{formatName:t,formatOptions:s}})(t);if(this.formats[o]){let t=e;try{const r=i?.formatParams?.[i.interpolationkey]||{},a=r.locale||r.lng||i.locale||i.lng||s;t=this.formats[o](e,a,{...n,...i,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class z extends w{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=(s.logger||S).create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.failed=new Set,this.queue=[],this.backend?.init?.(s,i.backend,i),this.callbackApi=o(this.backend),this.backend&&void 0===this.callbackApi&&(this.backend.read||this.backend.create)&&this.logger.deprecate("backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated")}queueLoad(e,t,s,i){const o={},n={},r={},a={};return e.forEach(e=>{let i=!0;t.forEach(t=>{const r=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:!s.reload&&this.state[r]<0||(1===this.state[r]?void 0===n[r]&&(n[r]=!0):(this.state[r]=1,i=!1,void 0===n[r]&&(n[r]=!0),void 0===o[r]&&(o[r]=!0),void 0===a[t]&&(a[t]=!0)))}),i||(r[e]=!0)}),(Object.keys(o).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(n),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(e,t,s){const i=e.split("|"),o=i[0],n=i[1];if(t&&this.emit("failedLoading",o,n,t),!t&&s&&this.store.addResourceBundle(o,n,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0),this.failed.delete(e),t&&(this.failed.add(e),this.failed.size>1e3)){const e=this.failed.values().next().value;this.failed.delete(e),this.state[e]<1&&delete this.state[e]}const r={},a=[];if(this.queue.forEach(s=>{if(((e,t,s)=>{const{obj:i,k:o}=l(e,t,Object);Object.prototype.hasOwnProperty.call(i,o)&&i[o]||(i[o]=[]),i[o].push(s)})(s.loaded,[o],n),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(s,e),t&&s.errors.push(t),0===s.pendingCount&&!s.done){Object.keys(s.loaded).forEach(e=>{Object.prototype.hasOwnProperty.call(r,e)||(r[e]={});const t=s.loaded[e];t.length&&t.forEach(t=>{void 0===r[e][t]&&(r[e][t]=!0)})}),s.done=!0;try{s.errors.length?s.callback(s.errors):s.callback()}catch(e){a.push(e)}}}),this.queue=this.queue.filter(e=>!e.done),this.emit("loaded",r),a.length)throw a[0]}read(e,t,s,i=0,o=this.retryTimeout,n){if(!e.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:o,callback:n});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&a&&i<this.maxRetries?setTimeout(()=>{this.read(e,t,s,i+1,2*o,n)},o):n(r,a)},a=this.backend[s].bind(this.backend);if(!1===this.callbackApi||void 0===this.callbackApi&&2===a.length){let s;try{s=a(e,t)}catch(e){return void r(e)}return void(s&&"function"==typeof s.then?s.then(e=>r(null,e),r):r(null,s))}return a(e,t,r)}prepareLoading(t,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();e(t)&&(t=this.languageUtils.toResolveHierarchy(t)),e(s)&&(s=[s]);const n=this.queueLoad(t,s,i,o);if(!n.toLoad.length)return n.pending.length||o(),null;n.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),i=s[0],o=s[1];this.read(i,o,"read",void 0,void 0,(s,n)=>{s&&this.logger.warn(`${t}loading namespace ${o} for language ${i} failed`,s),!s&&n&&this.logger.log(`${t}loaded namespace ${o} for language ${i}`,n),this.loaded(e,s,n)})}saveMissing(e,t,s,i,o,n={},r=()=>{},a=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(!a||a(t)){if(null!=s&&""!==s){if(this.backend?.create){const a={...n,isUpdate:o},l=this.backend.create.bind(this.backend);if(!1===this.callbackApi||void 0===this.callbackApi&&l.length<6)try{let o;o=!1===this.callbackApi||5===l.length?l(e,t,s,i,a):l(e,t,s,i),o&&"function"==typeof o.then?o.then(e=>r(null,e)).catch(r):r(null,o)}catch(e){r(e)}else l(e,t,s,i,r,a)}e&&e[0]&&this.store.addResource(e[0],t,s,i)}}else this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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!!!")}}const M=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:!1,fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!1,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let s={};if("object"==typeof t[1]&&(s=t[1]),e(t[1])&&(s.defaultValue=t[1]),e(t[2])&&(s.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach(t=>{s[t]=e[t]})}return s},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_=t=>(e(t.ns)&&(t.ns=[t.ns]),e(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),e(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),B=()=>{},W=e=>{const t=M(),s={...t,...e};return s.interpolation={...t.interpolation,...e.interpolation},"function"!=typeof s.overloadTranslationOptionHandler&&(s.overloadTranslationOptionHandler=t.overloadTranslationOptionHandler),s},J=t=>{const s=[].concat(t.supportedLngs||[],t.preload||[]);s.push(...Object.keys(t.resources||{}));const i=t.fallbackLng;return e(i)||Array.isArray(i)?s.push(...[].concat(i)):i&&"object"==typeof i&&Object.keys(i).forEach(e=>{"default"!==e&&s.push(e),s.push(...[].concat(i[e]))}),s},q=(t,s)=>!(!e(s)||i(s)||t.configuredLngs?.has(s))&&(t.logger.once(`lng:${s}`,"warn",`refused the language code '${s.slice(0,64)}' from lng, changeLanguage(), the language detector or loadLanguages(): it is not configured and has other characters than letters, digits, '-', '_', '@' and '.' (or '..', or more than 128). List it in supportedLngs to use it`),!0);class Y extends w{constructor(e={},t){var s;if(super(),this.userOptions=_(e),this.options=W(this.userOptions),this.services={postProcessors:Object.create(null)},this.logger=new k(null,this.options),this.modules={external:[]},s=this,Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(e=>{"function"==typeof s[e]&&(s[e]=s[e].bind(s))}),t&&!this.isInitialized&&!e.isClone){if(!this.userOptions.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(s={},i){this.isInitializing=!0,"function"==typeof s&&(i=s,s={}),null==s.defaultNS&&s.ns&&(e(s.ns)?s.defaultNS=s.ns:s.ns.includes("translation")||(s.defaultNS=s.ns[0])),_(s);const n={...this.userOptions,...s};this.options=W({...this.options,...s}),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),this.options.isClone||(this.configuredLngs=new Set([...this.configuredLngs||[],...J(n)]));const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){this.logger.init(r(this.modules.logger),this.options);const{logger:e}=this;let t;this.pendingWarnings?.forEach(e=>this.logger.warn(e)),this.pendingWarnings=void 0,t=this.modules.formatter?this.modules.formatter:K;const s=new E(this.options,e);this.store=new C(this.options.resources,this.options,e);const i=this.services;i.logger=e,i.resourceStore=this.store,i.languageUtils=s,i.pluralResolver=new A(s,{prepend:this.options.pluralSeparator},e),t&&(i.formatter=r(t),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new D(this.options,e),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},i.backendConnector=new z(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options),i.languageDetector.async&&void 0===o(i.languageDetector)&&this.logger.deprecate("languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated")),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,i||(i=B),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const a=t(),l=()=>{const e=(e,t)=>{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(t),i(e,t)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(t,s=B){let i=s;const o=e(t)?t:this.language;if("function"==typeof t&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===o?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return i();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};if(o)t(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),i(e)})}else i(null)}reloadResources(e,s,i){const o=t();if("function"==typeof e&&(i=e,e=void 0),"function"==typeof s&&(i=s,s=void 0),!e){const t=Object.keys(this.services.backendConnector.state).map(e=>e.split("|")[0]);e=[...new Set([...this.languages||[],...t])].filter(e=>"cimode"!==e)}return s||(s=this.options.ns),i||(i=B),this.services.backendConnector.reload(e,s,e=>{o.resolve(),i(e)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");const t=t=>{if(this.modules[t]&&this.modules[t]!==e){const e=`use: this ${t} replaces the ${t} passed to an earlier use() call; only one ${t} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(e):(this.pendingWarnings=this.pendingWarnings||[]).push(e)}this.modules[t]=e};return"backend"===e.type&&t("backend"),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&t("languageDetector"),"i18nFormat"===e.type&&t("i18nFormat"),"postProcessor"===e.type&&(this.services.postProcessors[e.name]=e),"formatter"===e.type&&t("formatter"),"3rdParty"===e.type&&this.modules.external.push(e),this}hydrate(e,t){return this.options.isClone?this:this.services.resourceStore?(e&&!this.initializedStoreOnce&&(this.services.resourceStore.data=e,Object.values(e).forEach(e=>{Object.keys(e).forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),t&&!this.initializedLanguageOnce&&(this.changeLanguage(t),this.initializedLanguageOnce=!0),this):(this.logger.warn("hydrate: call init() first, the instance has no resource store yet"),this)}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}this.resolvedLanguage||this.languages.includes(e)||!this.store.hasLanguageSomeTranslations(e)||(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(s,i){this.isLanguageChangingTo=s;const n=t();this.emit("languageChanging",s);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,t)=>{t?this.isLanguageChangingTo===s&&(r(t),this.translator.changeLanguage(t),this.isLanguageChangingTo=void 0,this.emit("languageChanged",t),this.logger.log("languageChanged",t)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),i&&i(e,(...e)=>this.t(...e))},l=t=>{s||t||!this.services.languageDetector||(t=[]);const{supportedLngs:i}=this.options;if(t&&!i){const e=[].concat(t).filter(e=>!q(this,e));e.length<[].concat(t).length&&(t=e)}const o=e(t)?t:t&&t[0];let n=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(e(t)?[t]:t);i&&q(this,n)&&(n=this.services.languageUtils.getBestMatchFromCodes([])),n&&(this.language||r(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,e=>{a(e,n)})};if(s||!this.services.languageDetector||this.services.languageDetector.async)if(!s&&this.services.languageDetector&&this.services.languageDetector.async){const e=o(this.services.languageDetector);!1===e||void 0===e&&0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l)}else l(s);else l(this.services.languageDetector.detect());return n}getFixedT(t,s,i,o){const n=o?.scopeNs,r=(e,t,...s)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},o.lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs;const a=void 0!==o.ns&&null!==o.ns;o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||i||r.keyPrefix);const l={...this.options,...o};Array.isArray(n)&&!a&&(l.ns=n),"function"==typeof o.keyPrefix&&(o.keyPrefix=j(o.keyPrefix,l));const c=this.options.keySeparator||".";let h;return o.keyPrefix&&Array.isArray(e)?h=e.map(e=>("function"==typeof e&&(e=j(e,l)),`${o.keyPrefix}${c}${e}`)):("function"==typeof e&&(e=j(e,l)),h=o.keyPrefix?`${o.keyPrefix}${c}${e}`:e),this.t(h,o)};return e(t)?r.lng=t:r.lngs=t,r.ns=s,r.keyPrefix=i,r}t(...e){return this.translator?this.translator.translate(...e):(this.logger.warn("t: called before init(); returning an empty string"),"")}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e,this.translator?.options&&(this.translator.options.defaultNS=e)}hasLoadedNamespace(e,t={}){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 s=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const n=(e,t)=>{const s=this.services.backendConnector.state[`${e}|${t}`];return-1===s||0===s||2===s};if(t.precheck){const e=t.precheck(this,n);if(void 0!==e)return e}if(this.hasResourceBundle(s,e))return!0;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:r}=this.services,a=t.lng?r.isSupportedCode(s)&&r.toResolveHierarchy(s,!1)[0]:s;return!(a&&!n(a,e)||i&&!n(o,e))}loadNamespaces(s,i){const o=t();return this.options.ns&&this.services.backendConnector?(e(s)&&(s=[s]),s.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{o.resolve(),i&&i(e)}),o):(i&&i(),Promise.resolve())}loadLanguages(s,i){const o=t();e(s)&&(s=[s]);const n=this.options.preload||[],r=s.filter(e=>!n.includes(e)&&!q(this,e)&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=n.concat(r),this.loadResources(e=>{o.resolve(),i&&i(e)}),o):(i&&i(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"ltr";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new E(M());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new Y(e,t);return s.createInstance=Y.createInstance,s}cloneInstance(e={},t=B){const s=e.forkResourceStore;s&&delete(e={...e}).forkResourceStore;const i={...this.options,preload:!1,...e,isClone:!0},o=new Y(i);o.logger=void 0!==e.debug||void 0!==e.prefix?this.logger.clone(e):this.logger;if(["store","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.postProcessors=Object.create(this.services.postProcessors),o.services.utils={...o.services.utils,hasLoadedNamespace:o.hasLoadedNamespace.bind(o),reloadResources:o.reloadResources.bind(o)},s){const e=t=>{const s=Array.isArray(t)?[...t]:{...t};return Object.keys(s).forEach(t=>{s[t]&&"object"==typeof s[t]&&(s[t]=e(s[t]))}),s},t=e(this.store.data);o.store=new C(t,i,this.logger),o.services.resourceStore=o.store}if(e.interpolation){const t={...M().interpolation,...this.options.interpolation,...e.interpolation},s={...i,interpolation:t};o.services.interpolator=new D(s,this.logger)}return o.configuredLngs=new Set([...this.configuredLngs||[],...J(e)]),o.translator=new N(o.services,i),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(i,t),o.translator.options=i,o.translator.backendConnector.newestCloneHasLoadedNamespace=o.hasLoadedNamespace.bind(o),o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Q=Y.createInstance();return Q.keyFromSelector=j,Q.isSafeLanguageCode=i,Q});
|