
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b446271b-ea24-50dc-a052-26fc7486002e")}catch(e){}}();
import{r as d}from"./index-D6da9p6-.js";import{I as $,R as k,g as A,a as F}from"./context-CxfOs_9L.js";function M(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const T={};function C(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&T[e[0]]||(typeof e[0]=="string"&&(T[e[0]]=new Date),M(...e))}const v=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function S(t,e,n){t.loadNamespaces(e,v(t,n))}function R(t,e,n,a){typeof n=="string"&&(n=[n]),n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,v(t,a))}function P(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const c=(w,m)=>{const s=e.services.backendConnector.state[`${w}|${m}`];return s===-1||s===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!c(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(a,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||c(a,t)&&(!i||c(o,t)))}function j(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(C("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,t))return!1}}):P(t,e,n)}const B=(t,e)=>{const n=d.useRef();return d.useEffect(()=>{n.current=t},[t,e]),n.current};function z(t,e,n,a){return t.getFixedT(e,n,a)}function J(t,e,n,a){return d.useCallback(z(t,e,n,a),[t,e,n,a])}function G(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:a,defaultNS:i}=d.useContext($)||{},o=n||a||F();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new k),!o){C("You will need to pass in an i18next instance by using initReactI18next");const r=(g,u)=>typeof u=="string"?u:u&&typeof u=="object"&&typeof u.defaultValue=="string"?u.defaultValue:Array.isArray(g)?g[g.length-1]:g,f=[r,{},!1];return f.t=r,f.i18n={},f.ready=!1,f}o.options.react&&o.options.react.wait!==void 0&&C("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...A(),...o.options.react,...e},{useSuspense:w,keyPrefix:m}=c;let s=t||i||o.options&&o.options.defaultNS;s=typeof s=="string"?[s]:s||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(s);const l=(o.isInitialized||o.initializedStoreOnce)&&s.every(r=>j(r,o,c)),E=J(o,e.lng||null,c.nsMode==="fallback"?s:s[0],m),x=()=>E,y=()=>z(o,e.lng||null,c.nsMode==="fallback"?s:s[0],m),[I,h]=d.useState(x);let N=s.join();e.lng&&(N=`${e.lng}${N}`);const L=B(N),p=d.useRef(!0);d.useEffect(()=>{const{bindI18n:r,bindI18nStore:f}=c;p.current=!0,!l&&!w&&(e.lng?R(o,e.lng,s,()=>{p.current&&h(y)}):S(o,s,()=>{p.current&&h(y)})),l&&L&&L!==N&&p.current&&h(y);function g(){p.current&&h(y)}return r&&o&&o.on(r,g),f&&o&&o.store.on(f,g),()=>{p.current=!1,r&&o&&r.split(" ").forEach(u=>o.off(u,g)),f&&o&&f.split(" ").forEach(u=>o.store.off(u,g))}},[o,N]),d.useEffect(()=>{p.current&&l&&h(x)},[o,m,l]);const b=[I,o,l];if(b.t=I,b.i18n=o,b.ready=l,l||!l&&!w)return b;throw new Promise(r=>{e.lng?R(o,e.lng,s,()=>r()):S(o,s,()=>r())})}export{G as u};
//# sourceMappingURL=useTranslation-CfKJAmGY.js.map

//# debugId=b446271b-ea24-50dc-a052-26fc7486002e
