@logistically/i18n-react-core
Version:
React integration for @logistically/i18n with state management agnostic design
56 lines • 74.4 kB
JavaScript
import{TranslationService as e}from"@logistically/i18n";import*as t from"react";import r,{createContext as n,useState as o,useEffect as i,useContext as a}from"react";import{unstable_batchedUpdates as s}from"react-dom";class c{constructor(t){this.listeners=new Set,this.config=t;const r={...t,debug:"boolean"==typeof t.debug?t.debug:t.debug?.enabled||!1};this.translationService=new e(r),this.state={locale:t.defaultLocale||"en",translations:{},isLoading:!1,error:null,isInitialized:!1}}getState(){return{...this.state}}setState(e){this.state={...this.state,...e},this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>e(this.getState()))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getActions(){return{setLocale:this.setLocale.bind(this),loadTranslations:this.loadTranslations.bind(this),translate:this.translate.bind(this),translatePlural:this.translatePlural.bind(this),formatDate:this.formatDate.bind(this),formatNumber:this.formatNumber.bind(this),getTextDirection:this.getTextDirection.bind(this),isRTLLocale:this.isRTLLocale.bind(this),reloadTranslations:this.reloadTranslations.bind(this),clearCache:this.clearCache.bind(this)}}async setLocale(e){if(this.state.locale!==e){this.setState({locale:e,isLoading:!0,error:null});try{await this.loadTranslations(e),this.setState({isLoading:!1,isInitialized:!0})}catch(e){throw this.setState({isLoading:!1,error:e}),e}}}async loadTranslations(e){try{this.setState({isLoading:!0,error:null}),this.translationService.reloadTranslations();const t=this.translationService.getKeys(e),r={};t.forEach(t=>{r[t]=this.translationService.translate(t,e)}),this.setState({translations:r,isLoading:!1,isInitialized:!0})}catch(e){throw this.setState({isLoading:!1,error:e}),e}}translate(e,t){try{return this.translationService.translate(e,this.state.locale,t)}catch(t){return("object"==typeof this.config.debug?this.config.debug:{enabled:!1}).logMissingKeys,e}}translatePlural(e,t,r){try{return this.translationService.translatePlural(e,t,this.state.locale,r)}catch(t){return("object"==typeof this.config.debug?this.config.debug:{enabled:!1}).logMissingKeys,e}}formatDate(e,t){return this.translationService.formatDateForLocale(e,this.state.locale,t)}formatNumber(e,t){return this.translationService.formatNumberForLocale(e,this.state.locale)}getTextDirection(e){return this.translationService.getTextDirection(e)}isRTLLocale(e){return this.translationService.isRTLLocale(e)}async reloadTranslations(){await this.loadTranslations(this.state.locale)}clearCache(){this.translationService.clearCache()}setAdapter(e){this.adapter=e}getAdapter(){return this.adapter}async initialize(e){const t=e||this.config.defaultLocale||"en";try{this.setState({isLoading:!0,error:null}),this.setState({locale:t}),await this.loadTranslations(t),this.setState({isLoading:!1,isInitialized:!0})}catch(e){throw this.setState({isLoading:!1,error:e}),e}}destroy(){this.listeners.clear(),this.translationService.clearCache()}getTranslationService(){return this.translationService}getConfig(){return this.config}isInitialized(){return this.state.isInitialized}}var u,l={exports:{}},f={};var d,p={};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?l.exports=function(){if(u)return f;u=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(t,r,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==r.key&&(o=""+r.key),"key"in r)for(var i in n={},r)"key"!==i&&(n[i]=r[i]);else n=r;return r=n.ref,{$$typeof:e,type:t,key:o,ref:void 0!==r?r:null,props:n}}return f.Fragment=t,f.jsx=r,f.jsxs=r,f}():l.exports=(d||(d=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===j?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case y:return"Fragment";case v:return"Profiler";case h:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList";case _:return"Activity"}if("object"==typeof t)switch(t.tag,t.$$typeof){case d:return"Portal";case m:return(t.displayName||"Context")+".Provider";case b:return(t._context.displayName||"Context")+".Consumer";case g:var r=t.render;return(t=t.displayName)||(t=""!==(t=r.displayName||r.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case O:return null!==(r=t.displayName||null)?r:e(t.type)||"Memo";case E:r=t._payload,t=t._init;try{return e(t(r))}catch(e){}}return null}function t(e){return""+e}function n(e){try{t(e);var r=!1}catch(e){r=!0}if(r){var n=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(t){if(t===y)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===E)return"<...>";try{var r=e(t);return r?"<"+r+">":"<...>"}catch(e){return"<...>"}}function i(){return Error("react-stack-top-frame")}function a(){var t=e(this.type);return A[t]||(A[t]=!0),void 0!==(t=this.props.ref)?t:null}function s(t,r,o,i,s,l,d,p){var y,h=r.children;if(void 0!==h)if(i){if(N(h)){for(i=0;i<h.length;i++)c(h[i]);Object.freeze&&Object.freeze(h)}}else c(h);if(P.call(r,"key")){h=e(t);var v=Object.keys(r).filter(function(e){return"key"!==e});i=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",C[h+i]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",C[h+i]=!0)}if(h=null,void 0!==o&&(n(o),h=""+o),function(e){if(P.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(r)&&(n(r.key),h=""+r.key),"key"in r)for(var b in o={},r)"key"!==b&&(o[b]=r[b]);else o=r;return h&&function(e){function t(){u||(u=!0)}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof t&&(t.displayName||t.name)),function(e,t,r,n,o,i,s,c){return r=i.ref,e={$$typeof:f,type:e,key:t,props:i,_owner:o},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:a}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:c}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,h,l,0,null===(y=x.A)?null:y.getOwner(),o,d,p)}function c(e){"object"==typeof e&&null!==e&&e.$$typeof===f&&e._store&&(e._store.validated=1)}var u,l=r,f=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),x=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,N=Array.isArray,T=console.createTask?console.createTask:function(){return null},A={},D=(l={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(l,i)(),L=T(o(i)),C={};p.Fragment=y,p.jsx=function(e,t,r,n,i){var a=1e4>x.recentlyCreatedOwnerStacks++;return s(e,t,r,!1,0,i,a?Error("react-stack-top-frame"):D,a?T(o(e)):L)},p.jsxs=function(e,t,r,n,i){var a=1e4>x.recentlyCreatedOwnerStacks++;return s(e,t,r,!0,0,i,a?Error("react-stack-top-frame"):D,a?T(o(e)):L)}}()),p);var y=l.exports;const h=n(null);class v{constructor(e){this.listeners=new Set,this.core=e,this.state=e.getState(),this.core.subscribe(e=>{this.state=e,this.notifyListeners()})}getState(){return this.state}getActions(){return this.core.getActions()}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e(this.state))}async initialize(){await this.core.initialize()}destroy(){this.listeners.clear(),this.core.destroy()}}const b=({children:e,config:t,initialLocale:r})=>{const[n,a]=o(null),[s,u]=o(!1);return i(()=>{const e=new c(t),n=new v(e),o={...n.getState(),...n.getActions()};a(o);const i=n.subscribe(e=>{const t=n.getActions();a({...e,...t})});return(async()=>{try{await e.initialize(r);const t=n.getState(),o=n.getActions();a({...t,...o}),u(!0)}catch(e){a({...n.getState(),...n.getActions()}),u(!0)}})(),()=>{i(),n.destroy()}},[t,r]),n?y.jsx(h.Provider,{value:n,children:e}):y.jsx(h.Provider,{value:null,children:y.jsx("div",{children:"Loading..."})})},m=()=>{const e=a(h);if(!e)throw new Error("useTranslationStore must be used within a TranslationProvider");return e},g=()=>{const e=m();return{t:(t,r)=>e.translate(t,r?.params),translate:e.translate,translatePlural:e.translatePlural,formatDate:e.formatDate,formatNumber:e.formatNumber,getTextDirection:e.getTextDirection,isLoading:e.isLoading,error:e.error,locale:e.locale,setLocale:e.setLocale,isRTLLocale:e.isRTLLocale,reloadTranslations:e.reloadTranslations,clearCache:e.clearCache}},w=()=>{const e=m();return{locale:e.locale,setLocale:e.setLocale,supportedLocales:["en","fr","es"],isRTL:e.isRTLLocale(e.locale),direction:e.getTextDirection(""),isRTLLocale:e.isRTLLocale}},S=e=>new v(e);function O(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=le[e],i=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+i)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(e){return"'"+e+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function E(e){return!!e&&!!e[ue]}function _(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===fe}(e)||Array.isArray(e)||!!e[ce]||!!(null===(t=e.constructor)||void 0===t?void 0:t[ce])||A(e)||D(e))}function j(e,t,r){void 0===r&&(r=!1),0===x(e)?(r?Object.keys:de)(e).forEach(function(n){r&&"symbol"==typeof n||t(n,e[n],e)}):e.forEach(function(r,n){return t(n,r,e)})}function x(e){var t=e[ue];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:A(e)?2:D(e)?3:0}function P(e,t){return 2===x(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function N(e,t,r){var n=x(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function T(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function A(e){return oe&&e instanceof Map}function D(e){return ie&&e instanceof Set}function L(e){return e.o||e.t}function C(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pe(e);delete t[ue];for(var r=de(t),n=0;n<r.length;n++){var o=r[n],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function k(e,t){return void 0===t&&(t=!1),M(e)||E(e)||!_(e)||(x(e)>1&&(e.set=e.add=e.clear=e.delete=$),Object.freeze(e),t&&j(e,function(e,t){return k(t,!0)},!0)),e}function $(){O(2)}function M(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function R(e){var t=ye[e];return t||O(18,e),t}function I(){return"production"===process.env.NODE_ENV||re||O(0),re}function V(e,t){t&&(R("Patches"),e.u=[],e.s=[],e.v=t)}function z(e){F(e),e.p.forEach(K),e.p=null}function F(e){e===re&&(re=e.l)}function U(e){return re={p:[],l:re,h:e,m:!0,_:0}}function K(e){var t=e[ue];0===t.i||1===t.i?t.j():t.g=!0}function W(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.O||R("ES5").S(t,e,n),n?(r[ue].P&&(z(t),O(4)),_(e)&&(e=G(t,e),t.l||B(t,e)),t.u&&R("Patches").M(r[ue].t,e,t.u,t.s)):e=G(t,r,[]),z(t),t.u&&t.v(t.u,t.s),e!==se?e:void 0}function G(e,t,r){if(M(t))return t;var n=t[ue];if(!n)return j(t,function(o,i){return q(e,n,t,o,i,r)},!0),t;if(n.A!==e)return t;if(!n.P)return B(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=C(n.k):n.o,i=o,a=!1;3===n.i&&(i=new Set(o),o.clear(),a=!0),j(i,function(t,i){return q(e,n,o,t,i,r,a)}),B(e,o,!1),r&&e.u&&R("Patches").N(n,r,e.u,e.s)}return n.o}function q(e,t,r,n,o,i,a){if("production"!==process.env.NODE_ENV&&o===r&&O(5),E(o)){var s=G(e,o,i&&t&&3!==t.i&&!P(t.R,n)?i.concat(n):void 0);if(N(r,n,s),!E(s))return;e.m=!1}else a&&r.add(o);if(_(o)&&!M(o)){if(!e.h.D&&e._<1)return;G(e,o),t&&t.A.l||B(e,o)}}function B(e,t,r){void 0===r&&(r=!1),!e.l&&e.h.D&&e.m&&k(t,r)}function H(e,t){var r=e[ue];return(r?L(r):e)[t]}function J(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Y(e){e.P||(e.P=!0,e.l&&Y(e.l))}function X(e){e.o||(e.o=C(e.t))}function Q(e,t,r){var n=A(t)?R("MapSet").F(t,r):D(t)?R("MapSet").T(t,r):e.O?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:I(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,i=he;r&&(o=[n],i=ve);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return n.k=c,n.j=s,c}(t,r):R("ES5").J(t,r);return(r?r.A:I()).p.push(n),n}function Z(e){return E(e)||O(22,e),function e(t){if(!_(t))return t;var r,n=t[ue],o=x(t);if(n){if(!n.P&&(n.i<4||!R("ES5").K(n)))return n.t;n.I=!0,r=ee(t,o),n.I=!1}else r=ee(t,o);return j(r,function(t,o){n&&function(e,t){return 2===x(e)?e.get(t):e[t]}(n.t,t)===o||N(r,t,e(o))}),3===o?new Set(r):r}(e)}function ee(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return C(e)}var te,re,ne="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),oe="undefined"!=typeof Map,ie="undefined"!=typeof Set,ae="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,se=ne?Symbol.for("immer-nothing"):((te={})["immer-nothing"]=!0,te),ce=ne?Symbol.for("immer-draftable"):"__$immer_draftable",ue=ne?Symbol.for("immer-state"):"__$immer_state",le={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},fe=""+Object.prototype.constructor,de="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pe=Object.getOwnPropertyDescriptors||function(e){var t={};return de(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},ye={},he={get:function(e,t){if(t===ue)return e;var r=L(e);if(!P(r,t))return function(e,t,r){var n,o=J(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!_(n)?n:n===H(e.t,t)?(X(e),e.o[t]=Q(e.A.h,n,e)):n},has:function(e,t){return t in L(e)},ownKeys:function(e){return Reflect.ownKeys(L(e))},set:function(e,t,r){var n=J(L(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=H(L(e),t),i=null==o?void 0:o[ue];if(i&&i.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(T(r,o)&&(void 0!==r||P(e.t,t)))return!0;X(e),Y(e)}return e.o[t]===r&&(void 0!==r||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==H(e.t,t)||t in e.t?(e.R[t]=!1,X(e),Y(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=L(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){O(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){O(12)}},ve={};j(he,function(e,t){ve[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ve.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&O(13),ve.set.call(this,e,t,void 0)},ve.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&O(14),he.set.call(this,e[0],t,r,e[0])};var be=function(){function e(e){var t=this;this.O=ae,this.D=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,a=Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];return i.produce(e,function(e){var n;return(n=r).call.apply(n,[t,e].concat(a))})}}var a;if("function"!=typeof r&&O(6),void 0!==n&&"function"!=typeof n&&O(7),_(e)){var s=U(t),c=Q(t,e,void 0),u=!0;try{a=r(c),u=!1}finally{u?z(s):F(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then(function(e){return V(s,n),W(e,s)},function(e){throw z(s),e}):(V(s,n),W(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=r(e))&&(a=e),a===se&&(a=void 0),t.D&&k(a,!0),n){var l=[],f=[];R("Patches").M(e,a,l,f),n(l,f)}return a}O(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.produceWithPatches(r,function(t){return e.apply(void 0,[t].concat(o))})};var n,o,i=t.produce(e,r,function(e,t){n=e,o=t});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(function(e){return[e,n,o]}):[i,n,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){_(e)||O(8),E(e)&&(e=Z(e));var t=U(this),r=Q(this,e,void 0);return r[ue].C=!0,F(t),r},t.finishDraft=function(e,t){var r=e&&e[ue];"production"!==process.env.NODE_ENV&&(r&&r.C||O(9),r.I&&O(10));var n=r.A;return V(n,t),W(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!ae&&O(20),this.O=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var o=R("Patches").$;return E(e)?o(e,t):this.produce(e,function(e){return o(e,t)})},e}(),me=new be,ge=me.produce;function we(e){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},we(e)}function Se(e){var t=function(e,t){if("object"!=we(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=we(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==we(t)?t:t+""}function Oe(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach(function(t){Oe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function je(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}me.produceWithPatches.bind(me),me.setAutoFreeze.bind(me),me.setUseProxies.bind(me),me.applyPatches.bind(me),me.createDraft.bind(me),me.finishDraft.bind(me);var xe="function"==typeof Symbol&&Symbol.observable||"@@observable",Pe=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ne={INIT:"@@redux/INIT"+Pe(),REPLACE:"@@redux/REPLACE"+Pe(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Pe()}};function Te(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ae(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";var r=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function De(e){var t=typeof e;return"production"!==process.env.NODE_ENV&&(t=Ae(e)),t}function Le(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?je(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?je(1):"Expected the enhancer to be a function. Instead, received: '"+De(r)+"'");return r(Le)(e,t)}if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?je(2):"Expected the root reducer to be a function. Instead, received: '"+De(e)+"'");var o=e,i=t,a=[],s=a,c=!1;function u(){s===a&&(s=a.slice())}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?je(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?je(4):"Expected the listener to be a function. Instead, received: '"+De(e)+"'");if(c)throw new Error("production"===process.env.NODE_ENV?je(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var t=!0;return u(),s.push(e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?je(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u();var r=s.indexOf(e);s.splice(r,1),a=null}}}function d(e){if(!Te(e))throw new Error("production"===process.env.NODE_ENV?je(7):"Actions must be plain objects. Instead, the actual type was: '"+De(e)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?je(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error("production"===process.env.NODE_ENV?je(9):"Reducers may not dispatch actions.");try{c=!0,i=o(i,e)}finally{c=!1}for(var t=a=s,r=0;r<t.length;r++){(0,t[r])()}return e}return d({type:Ne.INIT}),(n={dispatch:d,subscribe:f,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?je(10):"Expected the nextReducer to be a function. Instead, received: '"+De(e));o=e,d({type:Ne.REPLACE})}})[xe]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error("production"===process.env.NODE_ENV?je(11):"Expected the observer to be an object. Instead, received: '"+De(e)+"'");function r(){e.next&&e.next(l())}return r(),{unsubscribe:t(r)}}})[xe]=function(){return this},e},n}function Ce(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function ke(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];"production"!==process.env.NODE_ENV&&void 0===e[o]&&Ce('No reducer provided for key "'+o+'"'),"function"==typeof e[o]&&(r[o]=e[o])}var i,a,s=Object.keys(r);"production"!==process.env.NODE_ENV&&(i={});try{!function(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:Ne.INIT}))throw new Error("production"===process.env.NODE_ENV?je(12):'The slice reducer for key "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:Ne.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?je(13):'The slice reducer for key "'+t+"\" returned undefined when probed with a random type. Don't try to handle '"+Ne.INIT+'\' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(e){a=e}return function(e,t){if(void 0===e&&(e={}),a)throw a;if("production"!==process.env.NODE_ENV){var n=function(e,t,r,n){var o=Object.keys(t),i=r&&r.type===Ne.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Te(e))return"The "+i+' has unexpected type of "'+De(e)+'". Expected argument to be an object with the following keys: "'+o.join('", "')+'"';var a=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!n[e]});return a.forEach(function(e){n[e]=!0}),r&&r.type===Ne.REPLACE?void 0:a.length>0?"Unexpected "+(a.length>1?"keys":"key")+' "'+a.join('", "')+'" found in '+i+'. Expected to find one of the known reducer keys instead: "'+o.join('", "')+'". Unexpected keys will be ignored.':void 0}(e,r,t,i);n&&Ce(n)}for(var o=!1,c={},u=0;u<s.length;u++){var l=s[u],f=r[l],d=e[l],p=f(d,t);if(void 0===p){var y=t&&t.type;throw new Error("production"===process.env.NODE_ENV?je(14):"When called with an action of type "+(y?'"'+String(y)+'"':"(unknown type)")+', the slice reducer for key "'+l+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}c[l]=p,o=o||p!==d}return(o=o||s.length!==Object.keys(e).length)?c:e}}function $e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function Me(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error("production"===process.env.NODE_ENV?je(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map(function(e){return e(o)});return n=$e.apply(void 0,i)(r.dispatch),_e(_e({},r),{},{dispatch:n})}}}function Re(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var Ie=Re();Ie.withExtraArgument=Re;var Ve,ze=Ie,Fe=(Ve=function(e,t){return Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Ve(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ve(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ue=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ke=function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},We=Object.defineProperty,Ge=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ye=function(e,t,r){return t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Xe=function(e,t){for(var r in t||(t={}))He.call(t,r)&&Ye(e,r,t[r]);if(Be)for(var n=0,o=Be(t);n<o.length;n++){r=o[n];Je.call(t,r)&&Ye(e,r,t[r])}return e},Qe=function(e,t){return Ge(e,qe(t))},Ze="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?$e:$e.apply(null,arguments)};function et(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return t===r}function tt(e,t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return Xe(Xe({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function rt(e){return"function"==typeof e&&"type"in e&&function(e){return e&&"function"==typeof e.match}(e)}function nt(e,t){return{measureTime:function(e){var t=Date.now();try{return e()}finally{var r=Date.now();0}},warnIfExceeded:function(){}}}var ot=function(e){function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Fe(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Ke([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ke([void 0],e.concat(this))))},t}(Array),it=function(e){function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=e.apply(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Fe(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Ke([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ke([void 0],e.concat(this))))},t}(Array);function at(e){return _(e)?ge(e,function(){}):e}var st="production"===process.env.NODE_ENV,ct="Invariant failed";function ut(e,t){if(!e){if(st)throw new Error(ct);throw new Error(ct+": "+(t||""))}}function lt(e,t,r,n){return JSON.stringify(e,function(e,t){var r=[],n=[];t||(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"});return function(o,i){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?n.splice(a,1/0,o):n.push(o),~r.indexOf(i)&&(i=t.call(this,o,i))}else r.push(i);return null==e?i:e.call(this,o,i)}}(t,n),r)}function ft(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function dt(e,t,r){var n=pt(e,t,r);return{detectMutations:function(){return yt(e,t,n,r)}}}function pt(e,t,r,n,o){void 0===t&&(t=[]),void 0===n&&(n=""),void 0===o&&(o=new Set);var i={value:r};if(!e(r)&&!o.has(r))for(var a in o.add(r),i.children={},r){var s=n?n+"."+a:a;t.length&&-1!==t.indexOf(s)||(i.children[a]=pt(e,t,r[a],s))}return i}function yt(e,t,r,n,o,i){void 0===t&&(t=[]),void 0===o&&(o=!1),void 0===i&&(i="");var a=r?r.value:void 0,s=a===n;if(o&&!s&&!Number.isNaN(n))return{wasMutated:!0,path:i};if(e(a)||e(n))return{wasMutated:!1};var c={};for(var u in r.children)c[u]=!0;for(var u in n)c[u]=!0;var l=t.length>0,f=function(o){var a=i?i+"."+o:o;if(l&&t.some(function(e){return e instanceof RegExp?e.test(a):a===e}))return"continue";var c=yt(e,t,r.children[o],n[o],s,a);if(c.wasMutated)return{value:c}};for(var u in c){var d=f(u);if("object"==typeof d)return d.value}return{wasMutated:!1}}function ht(e){var t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||et(e)}function vt(e,t,r,n,o,i){var a;if(void 0===t&&(t=""),void 0===r&&(r=ht),void 0===o&&(o=[]),!r(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(null==i?void 0:i.has(e))return!1;for(var s=null!=n?n(e):Object.entries(e),c=o.length>0,u=function(e,s){var u=t?t+"."+e:e;if(c&&o.some(function(e){return e instanceof RegExp?e.test(u):u===e}))return"continue";return r(s)?"object"==typeof s&&(a=vt(s,u,r,n,o,i))?{value:a}:void 0:{value:{keyPath:u,value:s}}},l=0,f=s;l<f.length;l++){var d=f[l],p=u(d[0],d[1]);if("object"==typeof p)return p.value}return i&&bt(e)&&i.add(e),!1}function bt(e){if(!Object.isFrozen(e))return!1;for(var t=0,r=Object.values(e);t<r.length;t++){var n=r[t];if("object"==typeof n&&null!==n&&!bt(n))return!1}return!0}function mt(e){return"boolean"==typeof e}function gt(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=e.immutableCheck,o=void 0===n||n,i=e.serializableCheck,a=void 0===i||i,s=e.actionCreatorCheck,c=void 0===s||s,u=new ot;r&&(mt(r)?u.push(ze):u.push(ze.withExtraArgument(r.extraArgument)));if("production"!==process.env.NODE_ENV){if(o){var l={};mt(o)||(l=o),u.unshift(function(e){if(void 0===e&&(e={}),"production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=e.isImmutable,r=void 0===t?ft:t,n=e.ignoredPaths,o=(e.warnAfter,e.ignore);n=n||o;var i=dt.bind(null,r,n);return function(e){var t,r=e.getState,n=r(),o=i(n);return function(e){return function(a){var s=nt();s.measureTime(function(){n=r(),t=o.detectMutations(),o=i(n),ut(!t.wasMutated,"A state mutation was detected between dispatches, in the path '"+(t.path||"")+"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")});var c=e(a);return s.measureTime(function(){n=r(),t=o.detectMutations(),o=i(n),t.wasMutated&&ut(!t.wasMutated,"A state mutation was detected inside a dispatch, in the path: "+(t.path||"")+". Take a look at the reducer(s) handling the action "+lt(a)+". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)")}),s.warnIfExceeded(),c}}}}(l))}if(a){var f={};mt(a)||(f=a),u.push(function(e){if(void 0===e&&(e={}),"production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=e.isSerializable,r=void 0===t?ht:t,n=e.getEntries,o=e.ignoredActions,i=void 0===o?[]:o,a=e.ignoredActionPaths,s=void 0===a?["meta.arg","meta.baseQueryMeta"]:a,c=e.ignoredPaths,u=void 0===c?[]:c,l=(e.warnAfter,e.ignoreState),f=void 0!==l&&l,d=e.ignoreActions,p=void 0!==d&&d,y=e.disableCache,h=void 0!==y&&y||!WeakSet?void 0:new WeakSet;return function(e){return function(t){return function(o){var a=t(o),c=nt();return p||i.length&&-1!==i.indexOf(o.type)||c.measureTime(function(){var e=vt(o,"",r,n,s,h);e&&(e.keyPath,e.value)}),f||(c.measureTime(function(){var t=vt(e.getState(),"",r,n,u,h);t&&(t.keyPath,t.value)}),c.warnIfExceeded()),a}}}}(f))}if(c){var d={};mt(c)||(d=c),u.unshift(function(e){if(void 0===e&&(e={}),"production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=e.isActionCreator,r=void 0===t?rt:t;return function(){return function(e){return function(t){return r(t),e(t)}}}}(d))}}return u}(e)}}var wt="production"===process.env.NODE_ENV;function St(e){var t,r=gt(),n=e||{},o=n.reducer,i=void 0===o?void 0:o,a=n.middleware,s=void 0===a?r():a,c=n.devTools,u=void 0===c||c,l=n.preloadedState,f=void 0===l?void 0:l,d=n.enhancers,p=void 0===d?void 0:d;if("function"==typeof i)t=i;else{if(!et(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=ke(i)}var y=s;if("function"==typeof y&&(y=y(r),!wt&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!wt&&y.some(function(e){return"function"!=typeof e}))throw new Error("each middleware provided to configureStore must be a function");var h=Me.apply(void 0,y),v=$e;u&&(v=Ze(Xe({trace:!wt},"object"==typeof u&&u)));var b=new it(h),m=b;return Array.isArray(p)?m=Ke([h],p):"function"==typeof p&&(m=p(b)),Le(t,f,v.apply(void 0,m))}function Ot(e){var t,r={},n=[],o={addCase:function(e,i){if("production"!==process.env.NODE_ENV){if(n.length>0)throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");if(t)throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var a="string"==typeof e?e:e.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in r)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return r[a]=i,o},addMatcher:function(e,r){if("production"!==process.env.NODE_ENV&&t)throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:r}),o},addDefaultCase:function(e){if("production"!==process.env.NODE_ENV&&t)throw new Error("`builder.addDefaultCase` can only be called once");return t=e,o}};return e(o),[r,n,t]}var Et=!1;var _t=!1;var jt=["name","message","stack","code"],xt=function(e,t){this.payload=e,this.meta=t},Pt=function(e,t){this.payload=e,this.meta=t},Nt=function(e){if("object"==typeof e&&null!==e){for(var t={},r=0,n=jt;r<n.length;r++){var o=n[r];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},Tt=function(){function e(e,t,r){var n=tt(e+"/fulfilled",function(e,t,r,n){return{payload:e,meta:Qe(Xe({},n||{}),{arg:r,requestId:t,requestStatus:"fulfilled"})}}),o=tt(e+"/pending",function(e,t,r){return{payload:void 0,meta:Qe(Xe({},r||{}),{arg:t,requestId:e,requestStatus:"pending"})}}),i=tt(e+"/rejected",function(e,t,n,o,i){return{payload:o,error:(r&&r.serializeError||Nt)(e||"Rejected"),meta:Qe(Xe({},i||{}),{arg:n,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}}),a=!1,s="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){"production"!==process.env.NODE_ENV&&(a||(a=!0))},e}();return Object.assign(function(e){return function(a,c,u){var l,f=(null==r?void 0:r.idGenerator)?r.idGenerator(e):function(e){void 0===e&&(e=21);for(var t="",r=e;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t}(),d=new s;function p(e){l=e,d.abort()}var y=function(){return s=this,y=null,h=function(){var s,y,h,v,b,m;return Ue(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),v=null==(s=null==r?void 0:r.condition)?void 0:s.call(r,e,{getState:c,extra:u}),null===(w=v)||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,v];case 1:v=g.sent(),g.label=2;case 2:if(!1===v||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise(function(e,t){return d.signal.addEventListener("abort",function(){return t({name:"AbortError",message:l||"Aborted"})})}),a(o(f,e,null==(y=null==r?void 0:r.getPendingMeta)?void 0:y.call(r,{requestId:f,arg:e},{getState:c,extra:u}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:a,getState:c,extra:u,requestId:f,signal:d.signal,abort:p,rejectWithValue:function(e,t){return new xt(e,t)},fulfillWithValue:function(e,t){return new Pt(e,t)}})).then(function(t){if(t instanceof xt)throw t;return t instanceof Pt?n(t.payload,f,e,t.meta):n(t,f,e)})])];case 3:return h=g.sent(),[3,5];case 4:return m=g.sent(),h=m instanceof xt?i(null,f,e,m.payload,m.meta):i(m,f,e),[3,5];case 5:return r&&!r.dispatchConditionRejection&&i.match(h)&&h.meta.condition||a(h),[2,h]}var w})},new Promise(function(e,t){var r=function(e){try{o(h.next(e))}catch(e){t(e)}},n=function(e){try{o(h.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(r,n)};o((h=h.apply(s,y)).next())});var s,y,h}();return Object.assign(y,{abort:p,requestId:f,arg:e,unwrap:function(){return y.then(At)}})}},{pending:o,rejected:i,fulfilled:n,typePrefix:e})}return e.withTypes=function(){return e},e}();function At(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Dt="listenerMiddleware";tt(Dt+"/add"),tt(Dt+"/removeAll"),tt(Dt+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function e(e,t){var r=i[e];return r?r.enumerable=t:i[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[ue];return"production"!==process.env.NODE_ENV&&o(t),he.get(t,e)},set:function(t){var r=this[ue];"production"!==process.env.NODE_ENV&&o(r),he.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][ue];if(!o.P)switch(o.i){case 5:n(o)&&Y(o);break;case 4:r(o)&&Y(o)}}}function r(e){for(var t=e.t,r=e.k,n=de(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==ue){var a=t[i];if(void 0===a&&!P(t,i))return!0;var s=r[i],c=s&&s[ue];if(c?c.t!==a:!T(s,a))return!0}}var u=!!t[ue];return n.length!==de(t).length+(u?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);if(r&&!r.get)return!0;for(var n=0;n<t.length;n++)if(!t.hasOwnProperty(n))return!0;return!1}function o(e){e.g&&O(3,JSON.stringify(L(e)))}var i={};!function(e,t){ye[e]||(ye[e]=t)}("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var i=pe(r);delete i[ue];for(var a=de(i),s=0;s<a.length;s++){var c=a[s];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,t),i={i:n?5:4,A:r?r.A:I(),P:!1,I:!1,R:{},l:r,t:t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,ue,{value:i,writable:!0}),o},S:function(e,r,o){o?E(r)&&r[ue].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[ue];if(r){var o=r.t,i=r.k,a=r.R,s=r.i;if(4===s)j(i,function(t){t!==ue&&(void 0!==o[t]||P(o,t)?a[t]||e(i[t]):(a[t]=!0,Y(r)))}),j(o,function(e){void 0!==i[e]||P(i,e)||(a[e]=!1,Y(r))});else if(5===s){if(n(r)&&(Y(r),a.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)a[c]=!1;else for(var u=o.length;u<i.length;u++)a[u]=!0;for(var l=Math.min(i.length,o.length),f=0;f<l;f++)i.hasOwnProperty(f)||(a[f]=!0),void 0===a[f]&&e(i[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}();const Lt=e=>e?{message:e.message,name:e.name,stack:e.stack}:null,Ct=e=>{if(!e)return null;const t=new Error(e.message);return t.name=e.name,t.stack=e.stack,t},kt=Tt("translation/loadTranslations",async(e,{dispatch:t,getState:r})=>{const n=performance.now();try{const o=r(),i=r.core||o.core||o.translation.core;if(!i)throw new Error("Translation core not initialized");await i.loadTranslations(e);const a=performance.now();return t(Ut({translationTime:a-n})),{locale:e,success:!0}}catch(e){const r=performance.now();throw t(Ut({translationTime:r-n})),e}}),$t=Tt("translation/reloadTranslations",async(e,{dispatch:t,getState:r})=>{const n=performance.now();try{const e=r(),o=r.core||e.core||e.translation.core;if(!o)throw new Error("Translation core not initialized");await o.reloadTranslations();const i=performance.now();return t(Ut({translationTime:i-n})),{success:!0}}catch(e){const r=performance.now();throw t(Ut({translationTime:r-n})),e}}),Mt=function(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&e.initialState;var r,n="function"==typeof e.initialState?e.initialState:at(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function u(){"production"!==process.env.NODE_ENV&&"object"==typeof e.extraReducers&&(_t||(_t=!0));var t="function"==typeof e.extraReducers?Ot(e.extraReducers):[e.extraReducers],r=t[0],o=void 0===r?{}:r,i=t[1],a=void 0===i?[]:i,c=t[2],u=void 0===c?void 0:c,l=Xe(Xe({},o),s);return function(e,t,r,n){void 0===r&&(r=[]),"production"!==process.env.NODE_ENV&&"object"==typeof t&&(Et||(Et=!0));var o,i="function"==typeof t?Ot(t):[t,r,n],a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return at(e())};else{var u=at(e);o=function(){return u}}function l(e,t){void 0===e&&(e=o());var r=Ke([a[t.type]],s.filter(function(e){return(0,e.matcher)(t)}).map(function(e){return e.reducer}));return 0===r.filter(function(e){return!!e}).length&&(r=[c]),r.reduce(function(e,r){if(r){var n;if(E(e))return void 0===(n=r(e,t))?e:n;if(_(e))return ge(e,function(e){return r(e,t)});if(void 0===(n=r(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return e},e)}return l.getInitialState=o,l}(n,function(e){for(var t in l)e.addCase(t,l[t]);for(var r=0,n=a;r<n.length;r++){var o=n[r];e.addMatcher(o.matcher,o.reducer)}u&&e.addDefaultCase(u)})}return i.forEach(function(e){var r,n,i=o[e],u=t+"/"+e;"reducer"in i?(r=i.reducer,n=i.prepare):r=i,a[e]=r,s[u]=r,c[e]=n?tt(u,n):tt(u)}),{name:t,reducer:function(e,t){return r||(r=u()),r(e,t)},actions:c,caseReducers:a,getInitialState:function(){return r||(r=u()),r.getInitialState()}}}({name:"translation",initialState:{locale:"en",translations:{},isLoading:!1,error:null,isInitialized:!1,lastUpdated:Date.now(),pendingActions:[],performanceMetrics:{translationTime:0,cacheHitRate:0,lastCacheCleanup:Date.now()}},reducers:{setLocale:(e,t)=>{e.locale=t.payload,e.lastUpdated=Date.now()},setLoading:(e,t)=>{e.isLoading=t.payload},setError:(e,t)=>{t.payload instanceof Error?e.error=Lt(t.payload):e.error=t.payload??null,e.lastUpdated=Date.now()},setInitialized:(e,t)=>{e.isInitialized=t.payload},setTranslations:(e,t)=>{e.translations=t.payload,e.lastUpdated=Date.now()},setPerformanceMetrics:(e,t)=>{e.performanceMetrics={...e.performanceMetrics,...t.payload}},addPendingAction:(e,t)=>{e.pendingActions.includes(t.payload)||e.pendingActions.push(t.payload)},removePendingAction:(e,t)=>{e.pendingActions=e.pendingActions.filter(e=>e!==t.payload)},updateLastUpdated:e=>{e.lastUpdated=Date.now()},clearCache:e=>{e.translations={},e.performanceMetrics.lastCacheCleanup=Date.now(),e.lastUpdated=Date.now()}},extraReducers:e=>{e.addCase(kt.pending,e=>{e.isLoading=!0,e.error=null,e.pendingActions.includes("loadTranslations")||e.pendingActions.push("loadTranslations")}).addCase(kt.fulfilled,(e,t)=>{e.isLoading=!1,e.error=null,e.pendingActions=e.pendingActions.filter(e=>"loadTranslations"!==e),e.lastUpdated=Date.now()}).addCase(kt.rejected,(e,t)=>{e.isLoading=!1,e.error=Lt(t.error),e.pendingActions=e.pendingActions.filter(e=>"loadTranslations"!==e),e.lastUpdated=Date.now()}).addCase($t.pending,e=>{e.isLoading=!0,e.error=null,e.pendingActions.includes("reloadTranslations")||e.pendingActions.push("reloadTranslations")}).addCase($t.fulfilled,e=>{e.isLoading=!1,e.error=null,e.pendingActions=e.pendingActions.filter(e=>"reloadTranslations"!==e),e.lastUpdated=Date.now()}).addCase($t.rejected,(e,t)=>{e.isLoading=!1,e.error=Lt(t.error),e.pendingActions=e.pendingActions.filter(e=>"reloadTranslations"!==e),e.lastUpdated=Date.now()})}}),{setLocale:Rt,setLoading:It,setError:Vt,setInitialized:zt,setTranslations:Ft,setPerformanceMetrics:Ut,addPendingAction:Kt,removePendingAction:Wt,updateLastUpdated:Gt,clearCache:qt}=Mt.actions,Bt=Mt.reducer;class Ht{constructor(e,t){this.unsubscribe=null,this.core=e,this.store=t,this.unsubscribe=this.core.subscribe(e=>{this.store.dispatch(Ft(e.translations)),this.store.dispatch(Rt(e.locale)),this.store.dispatch(It(e.isLoading)),this.store.dispatch(Vt(e.error)),this.store.dispatch(zt(e.isInitialized))})}getState(){const e=this.store.getState().translation;return{...e,error:Ct(e.error)}}getActions(){const e=this.store.dispatch;return{setLocale:async t=>{await this.core.setLocale(t),e(Rt(t))},loadTranslations:async t=>{await this.core.loadTranslations(t),e(kt(t))},translate:(t,r)=>{const n=this.core.translate(t,r);return e(Gt()),n},translatePlural:(t,r,n)=>{const o=this.core.translatePlural(t,r,n);return e(Gt()),o},formatDate:(t,r)=>{const n=this.core.formatDate(t,r);return e(Gt()),n},formatNumber:(t,r)=>{const n=this.core.formatNumber(t,r);return e(Gt()),n},getTextDirection:e=>this.core.getTextDirection(e),isRTLLocale:e=>this.core.isRTLLocale(e),reloadTranslations:async()=>{await this.core.reloadTranslations(),e($t())},clearCache:()=>{this.core.clearCache(),e(qt())}}}subscribe(e){let t=this.getState();return this.store.subscribe(()=>{const r=this.getState();r!==t&&(t=r,e(r))})}async initialize(e){try{this.store.dispatch(It(!0)),this.store.dispatch(Vt(null)),await this.core.initialize(),this.store.dispatch(zt(!0)),this.store.dispatch(It(!1))}catch(e){throw this.store.dispatch(Vt(e)),this.store.dispatch(It(!1)),e}}destroy(){this.unsubscribe&&"function"==typeof this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.core.destroy()}}const Jt=(e,t)=>new Ht(e,t),Yt=()=>{const{useSelector:e,useDispatch:t}=require("react-redux"),r=t(),n=e(e=>e.translation),o={setLocale:e=>r(Rt(e)),loadTranslations:e=>r(kt(e)),reloadTranslations:()=>r($t()),clearCache:()=>r(qt()),setPerformanceMetrics:e=>r(Ut(e))};return{...n,error:Ct(n.error),...o}},Xt=()=>{const{useSelector:e,useDispatch:t}=require("react-redux"),r=t(),n=e(e=>e.translation),o={setLocale:e=>{const t=performance.now();r(Rt(e));const n=performance.now();r(Ut({translationTime:n-t}))},loadTranslations:e=>r(kt(e)),reloadTranslations:()=>r($t()),clearCache:()=>r(qt()),setPerformanceMetrics:e=>r(Ut(e))};return{...n,error:Ct(n.error),...o,getPerformanceMetrics:()=>n.performanceMetrics,isActionPending:e=>n.pendingActions.includes(e),getLastUpdated:()=>n.lastUpdated}};var Qt,Zt={exports:{}},er={};var tr,rr={};
/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?Zt.exports=function(){if(Qt)return er;Qt=1;var e=r,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),c=n({inst:{value:r,getSnapshot:t}}),u=c[0].inst,l=c[1];return i(function(){u.value=r,u.getSnapshot=t,s(u)&&l({inst:u})},[e,r,t]),o(function(){return s(u)&&l({inst:u}),e(function(){s(u)&&l({inst:u})})},[e]),a(r),r};return er.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,er}():Zt.exports=(tr||(tr=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=r,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,i=t.useEffect,a=t.useLayoutEffect,s=t.useDebugValue,c=!1,u=!1,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(r,l){c||void 0===t.startTransition||(c=!0);var f=l();if(!u){var d=l();n(f,d)||(u=!0)}var p=(d=o({inst:{value:f,getSnapshot:l}}))[0].inst,y=d[1];return a(function(){p.value=f,p.getSnapshot=l,e(p)&&y({inst:p})},[r,f,l]),i(function(){return e(p)&&y({inst:p}),r(function(){e(p)&&y({inst:p})})},[r]),s(f),f};rr.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:l,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),rr);var nr,or=Zt.exports,ir={};var ar,sr={};
/**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?function(){if(nr)return ir;nr=1;var e=r,t=or,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,c=e.useDebugValue;ir.useSyncExternalStoreWithSelector=function(e,t,r,u,l){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=s(function(){function e(e){if(!a){if(a=!0,o=e,e=u(e),void 0!==l&&d.hasValue){var t=d.value;if(l(t,e))return i=t}return i=e}if(t=i,n(o,e))return t;var r=u(e);return void 0!==l&&l(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,s=void 0===r?null:r;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,r,u,l]);var p=o(e,f[0],f[1]);return a(function(){d.hasValue=!0,d.value=p},[p]),c(p),p}}():ar||(ar=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=r,t=or,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,c=e.useDebugValue;sr.useSyncExternalStoreWithSelector=function(e,t,r,u,l){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=s(function(){function e(e){if(!a){if(a=!0,o=e,e=u(e),void 0!==l&&d.hasValue){var t=d.value;if(l(t,e))return i=t}return i=e}if(t=i,n(o,e))return t;var r=u(e);return void 0!==l&&l(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,s=void 0===r?null:r;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,r,u,l]);var p=o(e,f[0],f[1]);return a(function(){d.hasValue=!0,d.value=p},[p]),c(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}());let cr=function(e){e()};const ur=()=>cr,lr=Symbol.for("react-redux-context"),fr="undefined"!=typeof globalThis?globalThis:{};function dr(){var e;if(!t.createContext)return{};const r=null!=(e=fr[lr])?e:fr[lr]=new Map;let n=r.get(t.createContext);return n||(n=t.createContext(null),"production"!==process.env.NODE_ENV&&(n.displayName="ReactRedux"),r.set(t.createContext,n)),n}const pr=dr();var yr,hr={exports:{}},vr={};var br,mr={};
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?hr.exports=function(){if(yr)return vr;yr=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case c:case u:case n:case i:case o:case f:return e;default:switch(e=e&&e.$$typeof){case s:case l:case y:case p:case a:return e;default:return d}}case r:return d}}}function w(e){return g(e)===u}return vr.AsyncMode=c,vr.ConcurrentMode=u,vr.ContextConsumer=s,vr.ContextProvider=a,vr.Element=t,vr.ForwardRef=l,vr.Fragment=n,vr.Lazy=y,vr.Memo=p,vr.Portal=r,vr.Profiler=i,vr.StrictMode=o,vr.Suspense=f,vr.isAsyncMode=function(e){return w(e)||g(e)===c},vr.isConcurrentMode=w,vr.isContextConsumer=function(e){return g(e)===s},vr.isContextProvider=function(e){return g(e)===a},vr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},vr.isForwardRef=function(e){return g(e)===l},vr.isFragment=function(e){return g(e)===n},vr.isLazy=function(e){return g(e)===y},vr.isMemo=function(e){return g(e)===p},vr.isPortal=function(e){return g(e)===r},vr.isProfiler=function(e){return g(e)===i},vr.isStrictMode=function(e){return g(e)===o},vr.isSuspense=function(e){return g(e)===f},vr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m||e.$$typeof===h)},vr.typeOf=g,vr}():hr.exports=(br||(br=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var h=e.type;switch(h){case c:case u:case n:case i:case o:case f:return h;default:var v=h&&h.$$typeof;switch(v){case s:case l:case y:case p:case a:return v;default:return d}}case r:return d}}}var w=c,S=u,O=s,E=a,_=t,j=l,x=n,P=y,N=p,T=r,A=i,D=o,L=f,C=!1;function k(e){return g(e)===u}mr.AsyncMode=w,mr.ConcurrentMode=S,mr.ContextConsumer=O,mr.ContextProvider=E,mr.Element=_,mr.ForwardRef=j,mr.Fragment=x,mr.Lazy=P,mr.Memo=N,mr.Portal=T,mr.Profiler=A,mr.StrictMode=D,mr.Suspense=L,mr.isAsyncMode=function(e){return C||(C=!0),k(e)||g(e)===c},mr.isConcurrentMode=k,mr.isContextConsumer=function(e){return g(e)===s},mr.isContextProvider=function(e){return g(e)===a},mr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},mr.isForwardRef=function(e){return g(e)===l},mr.isFragment=function(e){return g(e)===n},mr.isLazy=function(e){return g(e)===y},mr.isMemo=function(e){return g(e)===p},mr.isPortal=function(e){return g(e)===r},mr.isProfiler=function(e){return g(e)===i},mr.isStrictMode=function(e){return g(e)===o},mr.isSuspense=function(e){return g(e)===f},mr.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m||e.$$typeof===h)},mr.typeOf=g}()),mr);var gr=hr.exports,wr={};wr[gr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},wr[gr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};var Sr,Or={};
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Er,_r={};
/**
* @license React
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/"production"===process.env.NODE_ENV?function(){if(Sr)return Or;Sr=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:switch(e=e.type){case n:case i:case o:case l:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case u:case p:case d:case a:return e;default:return y}}case r:return y}}}e=Symbol.for("react.module.reference"),Or.ContextConsumer=s,Or.ContextProvider=a,Or.Element=t,Or.ForwardRef=u,Or.Fragment=n,Or.Lazy=p,Or.Memo=d,Or.Portal=r,Or.Profiler=i,Or.StrictMode=o,Or.Suspense=l,Or.SuspenseList=f,Or.isAsyncMode=function(){return!1},Or.isConcurrentMode=function(){return!1},Or.isContextConsumer=function(e){return h(e)===s},Or.isContextProvider=function(e){return h(e)===a},Or.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Or.isForwardRef=function(e){return h(e)===u},Or.isFragment=function(e){return h(e)===n},Or.isLazy=function(e){return h(e)===p},Or.isMemo=function(e){return h(e)===d},Or.isPortal=function(e){return h(e)===r},Or.isProfiler=function(e){return h(e)===i},Or.isStrictMode=function(e){return h(e)===o},Or.isSuspense=function(e){return h(e)===l},Or.isSuspenseList=function(e){return h(e)===f},Or.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===i||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},Or.typeOf=h}():Er||(Er=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:var h=e.type;switch(h){case n:case i:case o:case l:case f:return h;default:var v=h&&h.$$typeof;switch(v){case c:case s:case u:case p:case d:case a:return v;default:return y}}case r:return y}}}e=Symbol.for("react.module.reference");var v=s,b=a,m=t,g=u,w=n,S=p,O=d,E=r,_=i,j=o,x=l,P=f,N=!1,T=!1;_r.ContextConsumer=v,_r.ContextProvider=b,_r.Element=m,_r.ForwardRef=g,_r.Fragment=w,_r.Lazy=S,_r.Memo=O,_r.Portal=E,_r.Profiler=_,_r.StrictMode=j,_r.Suspense=x,_r.SuspenseList=P,_r.isAsyncMode=function(e){return N||(N=!0),!1},_r.isConcurrentMode=function(e){return T||(T=!0),!1},_r.isContextConsumer=function(e){return h(e)===s},_r.isContextProvider=function(e){return h(e)===a},_r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},_r.isForwardRef=function(e){return h(e)===u},_r.isFragment=function(e){return h(e)===n},_r.isLazy=function(e){return h(e)===p},_r.isMemo=function(e){return h(e)===d},_r.isPortal=function(e){return h(e)===r},_r.isProfiler=function(e){return h(e)===i},_r.isStrictMode=function(e){return h(e)===o},_r.isSuspense=function(e){return h(e)===l},_r.isSuspenseList=function(e){return h(e)===f},_r.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===i||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},_r.typeOf=h}());const jr={notify(){},get:()=>[]};function xr(e,t){let r,n=jr,o=0,i=!1;function a(){u.onStateChange&&u.onStateChange()}function s(){o++,r||(r=t?t.addNestedSub(a):e.subscribe(a),n=function(){const e=ur();let t=null,r=null;return{clear(){t=null,r=null},notify(){e(()=>{let e=t;for(;e;)e.callback(),e=e.next})},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,o=r={callback:e,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){n&&null!==t&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function c(){o--,r&&0===o&&(r(),r=void 0,n.clear(),n=jr)}const u={addNestedSub:function(e){s();const t=n.subscribe(e);let r=!1;return()=>{r||(r=!0,t(),c())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>n};return u}const Pr=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?t.useLayoutEffect:t.useEffect;function Nr({store:e,context:r,children:n,serverState:o,stabilityCheck:i="once",noopCheck:a="once"}){const s=t.useMemo(()=>{const t=xr(e);return{store:e,subscription:t,getServerState:o?()=>o:void 0,stabilityCheck:i,noopCheck:a}},[e,o,i,a]),c=t.useMemo(()=>e.getState(),[e]);Pr(()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),c!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}},[s,c]);const u=r||pr;return t.createElement(u.Provider,{value:s},n)}cr=s;const Tr=n(null),Ar=({children:e,config:t,initialLocale:r,store:n})=>{const[a,s]=o(null),[u,l]=o(null),[f,d]=o(!1);return i(()=>{const e=new c(t),r=n||(e=>{const t=St({reducer:{translation:Bt},middleware:e=>e({serializableCheck:{ignoredActions:["translation/setError","translation/loadTranslations/pending","translation/loadTranslations/fulfilled","translation/loadTranslations/rejected","translation/reloadTranslations/pending","translation/reloadTranslations/fulfilled","translation/reloadTranslations/rejected"],ignoredActionPaths:["payload.error","error"],ignoredPaths:["translation.error"],warnAfter:128},immutableCheck:{ignoredPaths:["translation.error"]}}),devTools:"production"!==process.env.NODE_ENV});return t.core=e,t})(e),o=Jt(e,r);s(r),l(o);return(async()=>{try{await o.initialize(t),d(!0)}catch(e){d(!0)}})(),()=>{o.destroy()}},[t,n]),a&&u&&f?y.jsx(Tr.Provider,{value:a,children:y.jsx(Nr,{store:a,children:e})}):y.jsx("div",{children:"Initializing Redux Translation Provider..."})},Dr=()=>{const e=a(Tr);if(!e)throw new Error("useReduxStore must be used within a ReduxTranslationProvider");return e},Lr=()=>Dr(),Cr=({translationKey:e,params:t,locale:r,fallback:n,component:o="span",className:i,style:a,children:s,debug:c=!1,...u})=>{const{t:l,translate:f,isLoading:d,error:p}=g();if(d)return y.jsx(o,{className:i,style:a,...u,children:n||e});if(p)return y.jsx(o,{className:i,style:a,...u,children:n||e});let h;try{h=r?f(e,t):l(e,{params:t})}catch(p){h=n||e}const v=h===e&&n?n:h;return y.jsx(o,{className:i,style:a,...u,children:s||v})},kr=e=>y.jsx(Cr,{component:"span",...e}),$r=e=>y.jsx(Cr,{component:"div",...e}),Mr=e=>y.jsx(Cr,{component:"p",...e}),Rr=e=>y.jsx(Cr,{component:"h1",...e}),Ir=e=>y.jsx(Cr,{component:"h2",...e}),Vr=e=>y.jsx(Cr,{component:"h3",...e}),zr=e=>y.jsx(Cr,{component:"label",...e}),Fr=e=>y.jsx(Cr,{component:"button",...e});class Ur{constructor(t){this.config=t;const r={...t,debug:"boolean"==typeof t.debug?t.debug:t.debug?.enabled||!1};this.translationService=new e(r)}async getTranslation(e){try{this.translationService.reloadTranslations();const t=this.translationService.getKeys(e),r={};return t.forEach(t=>{r[t]=this.translationService.translate(t,e)}),r}catch(e){return{}}}async preloadTranslations(e){const t=e.map(e=>this.getTranslation(e));await Promise.all(t)}async createSSRContext(e){return{locale:e,translations:await this.getTranslation(e),preloadedLocales:this.config.ssr?.preloadLocales||[]}}serializeContext(e){return JSON.stringify(e)}deserializeContext(e){try{return JSON.parse(e)}catch(e){return{locale:"en",translations:{},preloadedLocales:[]}}}createSSRUtils(e){return{locale:e.locale,translations:e.translations,t:(t,r)=>{const n=e.translations[t]||t;return r?Object.keys(r).reduce((e,t)=>e.replace(`{${t}}`,r[t]),n):n}}}destroy(){}}const Kr=async(e,t)=>new Ur(t).getTranslation(e),Wr=async(e,t)=>{const r=new Ur(t);await r.preloadTranslations(e)},Gr=async(e,t)=>new Ur(t).createSSRContext(e),qr=e=>new Ur({}).serializeContext(e),Br=e=>new Ur({}).deserializeContext(e),Hr=async(e,t)=>{const r=new Ur(t),n=await r.createSSRContext(e);return{props:{ssrContext:r.serializeContext(n)}}},Jr=async(e,t)=>{const r=new Ur(t);return{t:(t,n)=>{try{return r.translationService.translate(t,e,n)}catch{return t}},translations:await r.getTranslation(e),locale:e}};export{v as ContextAdapter,Ht as ReduxAdapter,Ar as ReduxTranslationProvider,Ur as SSRTranslationUtils,Fr as TranslatedButton,$r as TranslatedDiv,Rr as TranslatedH1,Ir as TranslatedH2,Vr as TranslatedH3,zr as TranslatedLabel,Mr as TranslatedP,kr as TranslatedSpan,Cr as TranslatedText,c as TranslationCore,b as TranslationProvider,S as createContextAdapter,Jt as createReduxAdapter,Gr as createSSRContext,Br as deserializeContext,Hr as getServerSideTranslations,Jr as getServerTranslation,Kr as getTranslation,kt as loadTranslationsAsync,Wr as preloadTranslations,$t as reloadTranslationsAsync,qr as serializeContext,Bt as translationReducer,w as useLocale,Lr as useReduxAdapter,Dr as useReduxStore,Yt as useReduxTranslation,Xt as useReduxTranslationWithMetrics,g as useTranslation,m as useTranslationStore};
//# sourceMappingURL=index.esm.js.map