@tolgee/web
Advanced tools
Comparing version 5.33.3-prerelease.2efc0e6b.0 to 5.33.3-prerelease.4a586561.0
@@ -1,2 +0,2 @@ | ||
var e,t=Object.defineProperty,n=Object.defineProperties,a=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(e,n,a)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,l=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,a(t)),u=(e,t)=>{var n={};for(var a in e)o.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&r)for(var a of r(e))t.indexOf(a)<0&&i.call(e,a)&&(n[a]=e[a]);return n};function g(e,t){for(var n=0;n<t.length;n++){const a=t[n];if("string"!=typeof a&&!Array.isArray(a))for(const t in a)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(a,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function d(e){return Boolean(e&&"function"==typeof e.then)}function f(e,t){return d(e)?Promise.resolve(e).then(t):t(e)}function p(e,t,n){function a(n){const a=t(n);throw e.emit(a),console.error(a),a}try{const e=n();return d(e)?e.catch(a):e}catch(e){a(e)}}function h(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function v(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function m(e){return v(e)||[]}function y(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?m(t):m(null==t?void 0:t[e]);var n}function b(e){return Array.from(new Set(e))}function E(e){return e?e.replace(/\/+$/,""):e}const w=(e,t)=>fetch(e,t);const O=(e=w)=>(t,n)=>{let a=(r=null==n?void 0:n.headers,Object.fromEntries(new Headers(r).entries()));var r;return a["x-api-key"]&&(a=Object.assign({"x-tolgee-sdk-type":"JS","x-tolgee-sdk-version":"prerelease"},a)),e(t,Object.assign(Object.assign({},n),{headers:a}))},L=(e,t)=>{let n=[];return{listen(e){const t=t=>{e(t)};return n.push(t),{unsubscribe(){n=n.filter((e=>t!==e))}}},emit(a){t()&&n.forEach((t=>t({type:e,value:a})))}}};function A(e){let t=[],n=[];function a(){if(0===n.length)return;const e=n;n=[],t.forEach((t=>{t(e)}))}return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(t,r){e()&&e()&&(n.push(t),r?setTimeout(a,0):a())}})}class N extends Error{constructor(e,t,n=!1){const{language:a,namespace:r}=e;super(`Tolgee: Failed to fetch record for "${a}"${r&&` and "${r}"`}`),this.cause=t,this.isDev=n,this.name="RecordFetchError",this.language=a,this.namespace=r}}class k extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageDetectorError"}}class T extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageStorageError"}}const j=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):j(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},x=e=>Object.fromEntries(j(e).entries()),C=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},R=({language:e,namespace:t})=>t?`${e}:${t}`:e;function P(e,t,n,a,r,o,i,s){const l=new Map,c=new Map;let u={},g=0;function f(t,n,a){const r=R(t);c.set(r,{data:x(n),version:a}),e.onCacheChange.emit(C(r))}async function p(a,r){let o;if(r)try{o=await n(a)}catch(t){const n=new N(a,t,!0);e.onError.emit(n),console.warn(n)}return o||(o=await async function(n){function a(t){const a=new N(n,t);throw e.onError.emit(a),console.error(a),a}const r=t(n);if(d(r)){const e=await r.catch(a);if(void 0!==e)return e}const o=u[R(n)];if("function"!=typeof o)return o;try{return await o()}catch(e){a(e)}}(a)),o}const h=Object.freeze({addStaticData(e){if(Array.isArray(e))for(const t of e){const e=R(t),n=c.get(e);n&&0!==n.version||f(t,x(t.data),0)}else e&&(u=Object.assign(Object.assign({},u),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=C(e),a=c.get(e);a&&0!==a.version||f(n,x(t),0)}})))},invalidate(){l.clear(),g+=1},addRecord(e,t){f(e,x(t),g)},exists(e,t=!1){const n=c.get(R(e));return n&&t?n.version===g:Boolean(n)},getRecord(e){const t=a(e),n=R(t),r=c.get(n);if(r)return Object.assign(Object.assign({},t),{cacheKey:n,data:r.data})},getAllRecords:()=>Array.from(c.entries()).map((([e])=>h.getRecord(C(e)))),getTranslation(e,t){var n;return null===(n=c.get(R(e)))||void 0===n?void 0:n.data[t]},getTranslationNs(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=c.get(R({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return[r]}return b(e)},getTranslationFallback(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=c.get(R({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return t}},changeTranslation(t,n,a){var r;const o=null===(r=c.get(R(t)))||void 0===r?void 0:r.data;(null==o?void 0:o[n])&&(o[n]=a,e.onCacheChange.emit(Object.assign(Object.assign({},t),{key:n})))},isFetching(e){if(r())return!0;if(void 0===e)return l.size>0;const t=m(e);return Boolean(Array.from(l.keys()).find((e=>t.includes(C(e).namespace))))},isLoading(e,t){const n=m(t);if(r())return!0;const a=Array.from(l.keys());return Boolean(a.find((t=>{const a=C(t);return(!n.length||n.includes(a.namespace))&&!h.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const n=e.map((e=>{const n=a(e),r=R(n);if(null==t?void 0:t.useCache){if(h.exists(n,!0))return Object.assign(Object.assign({},n),{new:!1,cacheKey:r,data:h.getRecord(n).data})}const o=l.get(r);if(o)return Object.assign(Object.assign({},n),{new:!1,promise:o,cacheKey:r});const i=p(n,!(null==t?void 0:t.noDev))||Promise.resolve(void 0);return l.set(r,i),Object.assign(Object.assign({},n),{new:!0,promise:i,cacheKey:r})}));i.notify(),s.notify();const r=n.map((e=>e.promise)).filter(Boolean),o=await Promise.all(r);return n.forEach((e=>{var t;e.promise&&(e.data=x(null!==(t=o[0])&&void 0!==t?t:{}),o.shift());const n=l.get(e.cacheKey)!==e.promise;e.new&&!n&&(l.delete(e.cacheKey),e.data?h.addRecord(e,e.data):h.getRecord(e)||h.addRecord(e,{}))})),i.notify(),s.notify(),n.map((e=>{var t;return{language:e.language,namespace:e.namespace,data:null!==(t=e.data)&&void 0!==t?t:{},cacheKey:e.cacheKey}}))}});return h}function D(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}const S="invalid",I={observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:S,apiUrl:"https://app.tolgee.io",autoLoadRequiredData:!0,fetch:O(),onTranslationMissing:({key:e})=>e,disableCache:!1},F=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function U(e,t){const n=F(I,null==t?void 0:t.initialOptions,e);return n.apiUrl=E(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=O(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function _(e,t,n,a,r,o,i,s){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},u=async({keysAndDefaults:e,target:t})=>{var n;const i=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:a(t),namespace:r({key:e,ns:t})[0],translation:o({key:e,ns:t})})));null===(n=c.ui)||void 0===n||n.handleElementClick(i,t)},g=(e,t)=>{var n;return(null===(n=c.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function d(e){const t=o({key:e.key,ns:e.ns});return j.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:t().fetch}}function v(e){c.observer=null==e?void 0:e()}function m(){return Boolean(c.observer)}function y(e){e&&c.formatters.push(e)}function b(e){c.finalFormatter=e}function E(e){l.ui=e}function w(){return Boolean(l.ui)}function O(e){c.languageStorage=e}function L(e){c.languageDetector=e}function A(e){e&&c.backends.push(e)}function N(e){c.devBackend=e}const j=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:b,addFormatter:y,setObserver:v,hasObserver:m,setUi:E,hasUi:w,setDevBackend:N,addBackend:A,setLanguageDetector:L,setLanguageStorage:O}))},findPositions:g,run(){var e,n;const{apiKey:a,apiUrl:r,projectId:o,observerOptions:f,tagNewKeys:p,filterTag:h}=t();c.ui=null===(e=l.ui)||void 0===e?void 0:e.call(l,{apiKey:a,apiUrl:r,projectId:o,highlight:j.highlight,changeTranslation:i,findPositions:g,onPermanentChange:e=>s.onPermanentChange.emit(e),tagNewKeys:p,filterTag:h}),null===(n=c.observer)||void 0===n||n.run({mouseHighlight:!0,options:f,translate:d,onClick:u})},stop(){var e;c.ui=void 0,null===(e=c.observer)||void 0===e||e.stop()},getLanguageStorage:()=>c.languageStorage,getInitialLanguage(){const e=n();return f(p(s.onError,(e=>new T("Tolgee: Failed to load language",e)),(()=>{var e;return null===(e=c.languageStorage)||void 0===e?void 0:e.getLanguage(h())})),(t=>e&&!e.includes(t)||!t?function(){if(!c.languageDetector)return;const e=n();return p(s.onError,(e=>new k("Tolgee: Failed to detect language",e)),(()=>{var t;return null===(t=c.languageDetector)||void 0===t?void 0:t.getLanguage(Object.assign({availableLanguages:e},h()))}))}():t))},setStoredLanguage:e=>p(s.onError,(e=>new T("Tolgee: Failed to store language",e)),(()=>{var t;return null===(t=c.languageStorage)||void 0===t?void 0:t.setLanguage(e,h())})),getDevBackend:()=>c.devBackend,getBackendRecord:async({language:e,namespace:t})=>{for(const n of c.backends){const a=await n.getRecord(Object.assign({language:e,namespace:t},h()));if(void 0!==a)return a}},getBackendDevRecord:async({language:e,namespace:n})=>{var a;const{apiKey:r,apiUrl:o,projectId:i,filterTag:s}=t();if(r&&o&&j.hasDevBackend())return null===(a=c.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:r,apiUrl:o,projectId:i,language:e,namespace:n,filterTag:s},h()))},getLanguageDetector:()=>c.languageDetector,retranslate(){var e;null===(e=c.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=c.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(j.getDevBackend()),formatTranslation(n){var a,{formatEnabled:r}=n,o=D(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:u,params:g,ns:d,orEmpty:f}=o,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(o));let v=null!=p?p:f?"":h;const m=e(),y=r||!(null===(a=c.observer)||void 0===a?void 0:a.outputNotFormattable),b=e=>c.observer&&!u?c.observer.wrap({key:i,translation:e,defaultValue:l,params:g,ns:d}):e;v=b(v);try{if(p&&m&&y)for(const e of c.formatters)v=e.format({translation:v,language:m,params:g});c.finalFormatter&&p&&m&&y&&(v=c.finalFormatter.format({translation:v,language:m,params:g}))}catch(e){console.error(e);const n=("string"==typeof(E=e)?E:"string"==typeof(null==E?void 0:E.message)?E.message:void 0)||S,a=t().onFormatError,r=typeof a;v="string"===r?a:"function"===r?a(n,o):S,v=b(v)}var E;return v}});return j}const $=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const M=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:r,language:o}=e,i=D(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:o};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function K({options:e}){const t=function(){let e=!0;function t(){return e}const n=Object.freeze({onPendingLanguageChange:L("pendingLanguage",t),onLanguageChange:L("language",t),onLoadingChange:L("loading",t),onFetchingChange:L("fetching",t),onInitialLoaded:L("initialLoad",t),onRunningChange:L("running",t),onCacheChange:L("cache",t),onPermanentChange:L("permanentChange",t),onError:L("error",t),onUpdate:A(t),setEmitterActive(t){e=t},on:(e,t)=>{switch(e){case"pendingLanguage":return n.onPendingLanguageChange.listen(t);case"language":return n.onLanguageChange.listen(t);case"loading":return n.onLoadingChange.listen(t);case"fetching":return n.onFetchingChange.listen(t);case"initialLoad":return n.onInitialLoaded.listen(t);case"running":return n.onRunningChange.listen(t);case"cache":return n.onCacheChange.listen(t);case"update":return n.onUpdate.listen(t);case"permanentChange":return n.onPermanentChange.listen(t);case"error":return n.onError.listen(t)}}});return n.onInitialLoaded.listen((e=>n.onUpdate.emit(e,!1))),n.onLanguageChange.listen((e=>n.onUpdate.emit(e,!1))),n.onCacheChange.listen((e=>n.onUpdate.emit(e,!0))),n}(),n=$(!1,(()=>i.isFetching()),t.onFetchingChange.emit),a=$(!1,(()=>T.isLoading()),t.onLoadingChange.emit),r=function(e,t,n){let a,r=U();const o=Object.freeze({init(e){r=U(e,r)},isRunning:()=>r.isRunning,setRunning(e){r.isRunning!==e&&(r.isRunning=e,n.emit(e))},isInitialLoading:()=>r.isInitialLoading,isCacheDisabled:()=>r.initialOptions.disableCache,setInitialLoading(e){r.isInitialLoading=e},getLanguage:()=>r.language||r.initialOptions.language,setLanguage(t){r.language!==t&&(r.language=t,e.emit(t))},getPendingLanguage:()=>r.pendingLanguage||o.getLanguage(),setPendingLanguage(e){r.pendingLanguage!==e&&(r.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},r.initialOptions),a),addActiveNs(e){m(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t?r.activeNamespaces.set(e,t+1):r.activeNamespaces.set(e,1)}))},removeActiveNs(e){m(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t&&t>1?r.activeNamespaces.set(e,t-1):r.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>b([o.getDefaultNs(),...r.initialOptions.ns||[],...m(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||o.getLanguage();return t?b([t,...y(t,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>m(r.initialOptions.fallbackNs),getNs(){var e,t;return(null===(e=r.initialOptions.ns)||void 0===e?void 0:e.length)?r.initialOptions.ns:[null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:""]},getDefaultNs(e){var t,n,a;return void 0===e?null!==(a=null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:null===(n=r.initialOptions.ns)||void 0===n?void 0:n[0])&&void 0!==a?a:"":e},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const e=Object.keys(r.initialOptions.staticData).map((e=>C(e).language));return Array.from(new Set(e))}},getAvailableNs:()=>r.initialOptions.availableNs,withDefaultNs:e=>({namespace:void 0===e.namespace?o.getDefaultNs():e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:E(e.apiUrl)}):void 0}});return o}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),o=_(r.getLanguage,r.getInitialOptions,r.getAvailableLanguages,c,w,O,g,t),i=P(t,o.getBackendRecord,o.getBackendDevRecord,r.withDefaultNs,r.isInitialLoading,r.isCacheDisabled,n,a);let s;function l(e){return r.getDefaultNs(e)}function c(e){return b([...m(l(e)),...r.getFallbackNs()])}function u(e){return b([...m(null!=e?e:l()),...r.getRequiredNamespaces()])}function g(e,t,n){const a=r.withDefaultNs(e),o=i.getTranslation(a,t);return i.changeTranslation(a,t,n),{revert(){i.changeTranslation(a,t,o)}}}function p(e){r.init(e),i.addStaticData(r.getInitialOptions().staticData)}function v(e,t){const n=r.getFallbackLangs(e),a=u(t),o=[];return n.forEach((e=>{a.forEach((t=>{o.push({language:e,namespace:t})}))})),o}function w({key:e,ns:t}){const n=r.getFallbackLangs(),a=c(null!=t?t:void 0);return i.getTranslationNs(a,n,e)}function O({key:e,ns:t,language:n}){const a=c(null!=t?t:void 0),o=r.getFallbackLangs(n);return i.getTranslationFallback(a,o,e)}function N(){const e=f(k(),(()=>{const e=v(t,n).filter((e=>!i.exists(e,!0)));var t,n;if(e.length&&r.getInitialOptions().autoLoadRequiredData)return i.loadRecords(e,{useCache:!0})}));if(d(e))return r.setInitialLoading(!0),n.notify(),a.notify(),Promise.resolve(e).then((()=>{r.setInitialLoading(!1),n.notify(),a.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}function k(){if(r.getLanguage())return;return f(o.getInitialLanguage(),(e=>{const t=e||r.getInitialOptions().defaultLanguage;t&&r.setLanguage(t)}))}e&&p(e),t.onUpdate.listen((()=>{r.isRunning()&&o.retranslate()}));const T=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),r),o),i),{init:p,getTranslation:O,changeTranslation:g,getTranslationNs:w,getDefaultAndFallbackNs:c,findPositions:o.findPositions,getRequiredDescriptors:v,async changeLanguage(e){r.getPendingLanguage()===e&&r.getLanguage()===e||(r.setPendingLanguage(e),r.isRunning()&&r.getInitialOptions().autoLoadRequiredData&&await i.loadRecords(v(e),{useCache:!0}),e===r.getPendingLanguage()&&(r.setLanguage(e),await o.setStoredLanguage(e)))},async addActiveNs(e,t){t||r.addActiveNs(e),r.isRunning()&&await i.loadRecords(v(void 0,e),{useCache:!0})},async loadRecord(e,t){var n;return null===(n=(await T.loadRecords([e],t))[0])||void 0===n?void 0:n.data},isLoading:e=>i.isLoading(r.getLanguage(),e),isLoaded(e){const t=r.getLanguage();if(!t)return!1;const n=r.getFallbackLangs(t),a=u(e),o=[];return n.forEach((e=>{a.forEach((t=>{i.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=M(...e),n=O(t);return o.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(r.getInitialOptions().apiKey&&r.getInitialOptions().apiUrl),async loadRequired(e){(null==e?void 0:e.language)||await k();const t=v(null==e?void 0:e.language);return T.loadRecords(t,e)},async loadMatrix(e){const t=function(e){let t=[],n=[];if(Array.isArray(e.languages))t=e.languages;else if("all"===e.languages){const e=T.getAvailableLanguages();if(!e)throw new Error(h("availableLanguages"));t=e}if(Array.isArray(e.namespaces))n=e.namespaces;else if("all"===e.namespaces){const e=T.getAvailableNs();if(!e)throw new Error(h("availableNs"));n=e}const a=[];return t.forEach((e=>{n.forEach((t=>{a.push({language:e,namespace:t})}))})),a}(e);return T.loadRecords(t,e)},run:()=>(function(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!r.getAvailableLanguages())throw new Error(h("availableLanguages"));if(!r.getLanguage()&&!r.getInitialOptions().defaultLanguage)throw new Error(h(["defaultLanguage","language"]))}(),r.isRunning()||(r.setRunning(!0),o.run(),s=N()),Promise.resolve(s)),stop(){r.isRunning()&&(o.stop(),r.setRunning(!1))}}));return T}const B=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=F(e.options,n),t),init(t){const n=function(e){const t=K({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRequired:t.loadRequired,loadMatrix:t.loadMatrix,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,getRequiredDescriptors:t.getRequiredDescriptors,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,findPositions:t.findPositions,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(F(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},V=0,z=1,W=2;class q extends Error{constructor(e,t,n){let a,r="";e===V?a="Empty parameter":e===z?(a="Unexpected character",r="Did you forget to use FormatIcu to render ICU message syntax?"):a="Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`+(r?"\n"+r:"")),this.code=e,this.index=t}}function H(e){return/\s/.test(e)}const Y=0,G=1,X=2,J=3,Z=4,Q=new Set([X,G,Y]),ee="'",te=new Set(["{","}",ee]),ne=e=>/[0-9a-zA-Z_]/.test(e);function ae(e,t){const[n,a]=function(e){let t=Y,n="",a="",r="";const o=[],i=[];let s=0;function l(t){throw new q(t,s,e)}const c=()=>{o.push(n),n=""},u=()=>{""===a&&l(V),i.push(a),a=""};for(s=0;s<e.length;s++)switch(r=e[s],t){case Y:r===ee?(n+=r,t=G):"{"===r?(c(),t=J):(n+=r,t=Y);break;case G:te.has(r)?(n=n.slice(0,-1)+r,t=X):(n+=r,t=Y);break;case X:r===ee?t=Y:(n+=r,t=X);break;case J:"}"===r?(u(),t=Y):H(r)?""!==a&&(u(),t=Z):(ne(r)||l(z),a+=r,t=J);break;case Z:"}"==r?t=Y:H(r)?t=Z:l(z)}return Q.has(t)||l(W),c(),[o,i]}(e),r=[n[0]];for(let o=1;o<n.length;o++){const i=null==t?void 0:t[a[o-1]];if(void 0===i)throw new Error(`Missing parameter "${a[o-1]}" in "${e}"`);r.push(String(i)),r.push(n[o])}return r.join("")}const re=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>ae(e,t)}),e),oe="__tolgee_dev_tools",ie="__tolgee_preferredLanguages",se="data-tolgee-key-only",le="data-tolgee-restricted",ce="_tolgee",ue="_tolgee-highlighter";function ge(){var e,t;return void 0===(null==(t=null==(e=globalThis.window)?void 0:e.document)?void 0:t.createElement)}function de(e){if(ge())throw new Error(`${e}: Can't run on the server`)}function fe(e,t){return{oldTextContent:e,keys:t}}function pe(e){return e.textContent}function he(e,t){e.textContent=t}function ve(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,r=void 0===e.ns||void 0===t.ns||-1!==(null==(n=e.ns)?void 0:n.findIndex((e=>{var n;return null==(n=t.ns)?void 0:n.includes(e)})));return a&&r}const me={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function ye({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;const r=function(e){for(;e;){if(null!==e.getAttribute("disabled"))return!1;e=e.parentElement}return!0}(n);let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(ue),Object.entries(me).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const i=n.getBoundingClientRect();o.style.pointerEvents=r?"none":"auto",o.style.borderWidth=t+"px",o.style.top=i.top-t+"px",o.style.left=i.left-t+"px",o.style.width=i.width+"px",o.style.height=i.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null==(e=t.highlightEl)||e.remove(),t.highlightEl=void 0}}(0,a)}})}const be={capture:!0},Ee={capture:!0,passive:!0},we=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function Oe({highlightKeys:e,elementStore:t,onClick:n,options:a}){var r,o;const i=new Set;let s,l,c=[];const u=(null==(r=a.targetElement)?void 0:r.getRootNode())||document,g=(null==(o=a.targetElement)?void 0:o.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null==(e=n.unhighlight)||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=L(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null==(n=a.highlight)||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of we.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(L(t,(e=>e.id===oe))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null==(e=null==n?void 0:n.highlight)||e.call(n)}function w(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(s),d())}function O(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function L(e,t){return e.id===oe?null:t(e)?e:(null==e?void 0:e.parentElement)?L(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){O("keydown",y,be),O("keyup",b,be),O("mousemove",m,Ee),O("scroll",E,Ee),O("click",w,be),O("mouseenter",v,be),O("mouseover",v,be),O("mouseout",v,be),O("mouseleave",v,be),O("mousedown",v,be),O("mouseup",v,be)}})}function Le(e,t,n){const a=ye({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=Oe({highlightKeys:e.highlightKeys,elementStore:t,onClick(e){const a=t.get(e);n({target:e,keysAndDefaults:s(a)})},options:e});function o(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${le}]`)}function i(e,n){var a;n.highlightEl&&(null==(a=n.unhighlight)||a.call(n)),e.removeAttribute(ce),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({isRestricted:o,register(e,n,r){if(o(e))return;const i=e;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(ce,"true")),s.nodes.set(n,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===se&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ve({key:e,ns:v(n)},{key:t.key,ns:v(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null==(n=t.unhighlight)||n.call(t))}))}})}function Ae(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:r,onClick:o}){if(ge())return{stop(){t=!1},wrapper:r};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var r,o;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!=(r=s[e.tagName.toUpperCase()])?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null==(t=s[e.tagName.toUpperCase()])?void 0:t.some((t=>e.hasAttribute(t))))||(null==(n=s["*"])?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!=(o=s[n.tagName.toUpperCase()])?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,r),l=Le(a,n,o);function c(e){for(const t of e){const e=t.parentElement;if(e&&l.isRestricted(e))continue;const n=pe(t),a=n?r.unwrap(n):null;if(a){const{text:e,keys:r}=a;he(t,e);const o=fe(n,r),s=i.getSuitableParent(t);l.register(s,t,o)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:pe(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===se)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(se);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(se)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(se))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===se))&&l.cleanupLingeringKeyAttributes();const r=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>r.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>r.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>r.delete(e)));break;case"attributes":t.attributeName===se&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>r.add(e)))}c([...r])})),f=a.targetElement||document;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(se),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:r}}return Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null==(a=null==(n=null==e?void 0:e.elementRegistry)?void 0:n.forEachElement)||a.call(n,t)},highlight(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[];return r.forEach((e=>{var t;return null==(t=e.highlight)?void 0:t.call(e)})),{unhighlight(){r.forEach((e=>{var t;return null==(t=e.unhighlight)?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[],o=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ve({key:t,ns:v(n)},{key:e.key,ns:v(e.ns)})&&o.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),o},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""})}var Ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ke={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),r=[],o=0;;){var i=t<e.length;if(!i||o>=n-1){var s=a.subarray(0,o);if(r.push(String.fromCharCode.apply(null,s)),!i)return r.join("");e=e.subarray(t),t=0,o=0}var l=e[t++];if(0==(128&l))a[o++]=l;else if(192==(224&l)){var c=63&e[t++];a[o++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[o++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[o++]=g>>>10&1023|55296,g=56320|1023&g),a[o++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},r="function"==typeof Buffer&&Buffer.from,o=r?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>o.length){r+=8,r=(r*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(r);l.set(o),o=l}if(0!=(4294967168&i)){if(0==(4294965248&i))o[a++]=i>>>6&31|192;else if(0==(4294901760&i))o[a++]=i>>>12&15|224,o[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;o[a++]=i>>>18&7|240,o[a++]=i>>>12&63|128,o[a++]=i>>>6&63|128}o[a++]=63&i|128}else o[a++]=i}return o.slice?o.slice(0,a):o.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),o(e)};var s=!r&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;r?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(r?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:Ne);const Te=g({__proto__:null,default:ke},[ke]);null==(e=console.assert)||e.call(console,Te);const je=["",""],xe=RegExp(`([${je.join("")}]{9})+`,"gu");function Ce(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>je[Number(e)])).join("")}function Re(e){const t=Array.from(e).map((e=>je.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function Pe({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}function a(e){return Ce(e+"\n")}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null==(t=e.match(xe))?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(Re))||[]}(e);a.forEach((e=>{const a=function(e){return e.split("\n").filter((e=>e.length)).map((e=>{if("{"===e[0])return e;{const n=Number(e);return t.numberToValue(n)}}))}(e);a.forEach((e=>{const t=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(e);if(t){const{k:e,d:a,n:r}=t;n.push({key:e,defaultValue:a,ns:r})}}))}));const r=function(e){return e.replace(xe,"")}(e);return{text:r,keys:n}},wrap({key:r,defaultValue:o,translation:i,ns:s}){let l;if(e){l=a(n({key:r,ns:s}))}else{const e=n({key:r,ns:s,defaultValue:o}),i=t.valueToNumber(e);l=a(String(i))}const c=i||"";return"string"==typeof c?c+l:c},testTextNode(e){var t,n,a;return null!=(a=(null==(t=e.textContent)?void 0:t.includes(`${je[0]}${je[0]}`))||(null==(n=e.textContent)?void 0:n.includes(`${je[1]}${je[0]}`)))&&a},testAttribute:e=>e.value.includes(`${je[0]}${je[0]}`)||e.value.includes(`${je[1]}${je[0]}`)})}function De(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function Se({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:r,ns:o}=function(e){let t=!1,n="",a="",r="KEY";const o={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{o.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==r||","!==s?"KEY"!==r||"|"!==s?"NAMESPACE"!==r||","!==s?"KEY"!==r||":"!==s?"DEFAULT_VALUE"!==r||":"!==s?"PARAM_NAME"!==r||":"!==s?"PARAM_VALUE"!==r||","!==s?n+=s:(r="PARAM_NAME",o.params[a]=n,n=""):(r="PARAM_VALUE",a=n,n=""):(r="PARAM_NAME",o.defaultValue=n,n=""):(r="PARAM_NAME",o.key=n,n=""):(r="DEFAULT_VALUE",i(n),n=""):(r="NAMESPACE",o.key=n,n=""):(r="DEFAULT_VALUE",o.key=n,n=""):t=!0;return"KEY"===r&&(o.key=n),"DEFAULT_VALUE"===r&&(o.defaultValue=n),"PARAM_VALUE"===r&&(o.params[a]=n),"NAMESPACE"===r&&i(n),o}(e);return{translated:n({key:t,params:a,defaultValue:r,ns:o,noWrap:!0}),key:t,params:a,defaultValue:r,ns:o}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){return"string"==typeof e?e.replace(new RegExp("[,:|\\\\]","gs"),"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:r,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${o(e)}:${o(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==r?`,${o(r)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>o(e))).join("|")}`:"";return`${e}${o(n)}${u}${l}${s}${t}`},unwrap(n){const o=new RegExp(`(\\\\?)(${r(e)}(.*?)${r(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=o.exec(n));){let e=s[1];const[t,r,o,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!De(d,n)){u+=o;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,r,o;return null!=(o=(null==(a=n.textContent)?void 0:a.includes(e))&&(null==(r=n.textContent)?void 0:r.includes(t)))&&o},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Ie=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=Ae();return Object.freeze(c(l({},e),{run(t){const n=Se({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(c(l({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&he(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=Ae();return Object.freeze(c(l({},e),{run(t){const n=Pe({fullKeyEncode:t.options.fullKeyEncode});e.run(c(l({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Ue(e){const t=Fe.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function _e(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,r=0;const o=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Ue(e[i]),n+=5,n>=8&&(o[r++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",r=Math.pow(2,16)-1;for(let e=0;e<n;e+=r)e+r>n&&(r=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+r));return a}(o.buffer)}function $e(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=_e(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Me(...e){const t="undefined"==typeof window?void 0:window.location.origin;return new URL(function(...e){let t=e[0];return e.slice(1).forEach((e=>{var n;n=e,t=`${t.replace(/\/+$/,"")}/${n=n.replace(/^\/+/,"")}`})),t}(...e),t)}const Ke=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:r,filterTag:o,fetch:i}){var s;const l=null!=(s=$e(t))?s:r;let c;if(c=Me(e,void 0!==l?`/v2/projects/${l}/translations/${n}`:`/v2/projects/translations/${n}`),a&&c.searchParams.append("ns",a),null==o||o.forEach((e=>{c.searchParams.append("filterTag",e)})),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===r)throw new Error("You need to specify 'projectId' when using PAT key");return i(c.toString(),{headers:{"X-API-Key":t||"","Content-Type":"application/json"},next:{revalidate:0}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e);function Be({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:r=300}){let o=!1;const i=()=>new Promise(((a,o)=>{const i=function(e,t){const n=n=>{var a,r;e.includes(null==(a=n.data)?void 0:a.type)&&t(null==(r=n.data)?void 0:r.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),o()}),r);function l(){i.unsubscribe()}}));return{cancel(){o=!0},promise:(async()=>{for(let e=0;e<a;e++){if(o)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!o)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}let Ve=null;function ze(e){var t;return Ve||(Ve=(t=`https://cdn.jsdelivr.net/npm/@tolgee/web@${e}/dist/tolgee-in-context-tools.umd.min.js`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window["@tolgee/in-context-tools"].InContextTools))),Ve}const We="__tolgee_apiKey",qe="__tolgee_apiUrl";function He(){const e=sessionStorage.getItem(We)||void 0,t=sessionStorage.getItem(qe)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Ye(){sessionStorage.removeItem(We),sessionStorage.removeItem(qe)}let Ge=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(Ge=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=Be({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Ye)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return He()&&(async()=>{const e=await ze("prerelease");return t=>{const n=He();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Xe="__tolgee_currentLanguage";const Je=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(de("LanguageStorage"),localStorage.getItem(Xe)||void 0),setLanguage(e){de("LanguageStorage"),localStorage.setItem(Xe,e)}}),e);function Ze(e,t){const n=t.find((t=>t===e));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),r=a(e),o=t.find((e=>a(e)===r));return o||void 0}const Qe=()=>(e,t)=>(t.setLanguageDetector({getLanguage:({availableLanguages:e})=>(de("LanguageDetector"),Ze(window.navigator.language,e))}),e);const et=(e,t)=>{const n=function(e){const t=e.get("Accept-Language");if(!t)return[];const n=t.split(",").map((e=>{const[t]=e.trim().split(";");return t}));return[...new Set(n.filter((e=>e&&"*"!==e)))]}(e);return n[0]&&Ze(n[0],t)};function tt(e){return e.endsWith("/")?e.slice(0,-1):e}const nt={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${tt(n)}/${e}/${t}.json`:`${tt(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"},timeout:void 0,fallbackOnFail:!1};function at(e){const t=c(l(l({},nt),e),{headers:l(l({},nt.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:r,headers:o,timeout:i,fallbackOnFail:s}=t,g=u(t,["prefix","getPath","getData","headers","timeout","fallbackOnFail"]);return{async getRecord({namespace:e,language:t,fetch:c}){const d=a({namespace:e,language:t,prefix:n});try{const e=await((e,t,n,a)=>{var r=a,{signal:o}=r,i=u(r,["signal"]);const s=new AbortController;return new Promise(((a,r)=>{const c=e(t,l({signal:s.signal},i));let u=!1;function g(e){!u&&r(e),u=!0}function d(){const e=new Error(`TIMEOUT: ${t}`);s.abort(e),g(e)}if(o&&o.addEventListener("abort",d),void 0!==n){const e=setTimeout(d,n);c.finally((()=>clearTimeout(e)))}c.catch(g).then((function(e){!u&&a(e),u=!0}))}))})(c,d,i,l({headers:o},g));if(!e.ok)throw new Error(`${e.url} ${e.status}`);return await r(e)}catch(e){if(s)return;throw e}}}}const rt=e=>(t,n)=>(n.addBackend(at(e)),t);function ot(){return B().use(Ge())}const it=()=>e=>e;export{rt as BackendFetch,Ge as BrowserExtensionPlugin,oe as DEVTOOLS_ID,Ke as DevBackend,it as DevTools,re as FormatSimple,Qe as LanguageDetector,k as LanguageDetectorError,Je as LanguageStorage,T as LanguageStorageError,Ie as ObserverPlugin,ie as PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY,N as RecordFetchError,ce as TOLGEE_ATTRIBUTE_NAME,le as TOLGEE_RESTRICT_ATTRIBUTE,se as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,ot as Tolgee,B as TolgeeCore,O as createFetchFunction,Ze as detectLanguage,et as detectLanguageFromHeaders,v as getFallback,m as getFallbackArray,$e as getProjectIdFromApiKey,M as getTranslateProps,ge as isSSR}; | ||
var e,t=Object.defineProperty,n=Object.defineProperties,a=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(e,n,a)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,l=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&s(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,a(t)),u=(e,t)=>{var n={};for(var a in e)o.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&r)for(var a of r(e))t.indexOf(a)<0&&i.call(e,a)&&(n[a]=e[a]);return n};function g(e,t){for(var n=0;n<t.length;n++){const a=t[n];if("string"!=typeof a&&!Array.isArray(a))for(const t in a)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(a,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function d(e){return Boolean(e&&"function"==typeof e.then)}function f(e,t){return d(e)?Promise.resolve(e).then(t):t(e)}function p(e,t,n){function a(n){const a=t(n);throw e.emit(a),console.error(a),a}try{const e=n();return d(e)?e.catch(a):e}catch(e){a(e)}}function h(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function v(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function m(e){return v(e)||[]}function y(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?m(t):m(null==t?void 0:t[e]);var n}function b(e){return Array.from(new Set(e))}function E(e){return e?e.replace(/\/+$/,""):e}const w=(e,t)=>fetch(e,t);const L=(e=w)=>(t,n)=>{let a=(r=null==n?void 0:n.headers,Object.fromEntries(new Headers(r).entries()));var r;return a["x-api-key"]&&(a=Object.assign({"x-tolgee-sdk-type":"JS","x-tolgee-sdk-version":"prerelease"},a)),e(t,Object.assign(Object.assign({},n),{headers:a}))},O=(e,t)=>{let n=[];return{listen(e){const t=t=>{e(t)};return n.push(t),{unsubscribe(){n=n.filter((e=>t!==e))}}},emit(a){t()&&n.forEach((t=>t({type:e,value:a})))}}};function A(e){let t=[],n=[];function a(){if(0===n.length)return;const e=n;n=[],t.forEach((t=>{t(e)}))}return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(t,r){e()&&e()&&(n.push(t),r?setTimeout(a,0):a())}})}class N extends Error{constructor(e,t,n=!1){const{language:a,namespace:r}=e;super(`Tolgee: Failed to fetch record for "${a}"${r&&` and "${r}"`}`),this.cause=t,this.isDev=n,this.name="RecordFetchError",this.language=a,this.namespace=r}}class k extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageDetectorError"}}class T extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageStorageError"}}const j=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):j(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},x=e=>Object.fromEntries(j(e).entries()),R=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},C=({language:e,namespace:t})=>t?`${e}:${t}`:e;function P(e,t,n,a,r,o,i){const s=new Map,l=new Map;let c={},u=0;function g(t,n,a){const r=C(t);l.set(r,{data:x(n),version:a}),e.onCacheChange.emit(R(r))}async function f(a,r){let o;if(r)try{o=await n(a)}catch(t){const n=new N(a,t,!0);e.onError.emit(n),console.warn(n)}return o||(o=await async function(n){function a(t){const a=new N(n,t);throw e.onError.emit(a),console.error(a),a}const r=t(n);if(d(r)){const e=await r.catch(a);if(void 0!==e)return e}const o=c[C(n)];if("function"!=typeof o)return o;try{return await o()}catch(e){a(e)}}(a)),o}const p=Object.freeze({addStaticData(e){if(Array.isArray(e))for(const t of e){const e=C(t),n=l.get(e);n&&0!==n.version||g(t,x(t.data),0)}else e&&(c=Object.assign(Object.assign({},c),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=R(e),a=l.get(e);a&&0!==a.version||g(n,x(t),0)}})))},invalidate(){s.clear(),u+=1},addRecord(e,t){g(e,x(t),u)},exists(e,t=!1){const n=l.get(C(e));return n&&t?n.version===u:Boolean(n)},getRecord(e){const t=a(e),n=C(t),r=l.get(n);if(r)return Object.assign(Object.assign({},t),{cacheKey:n,data:r.data})},getAllRecords:()=>Array.from(l.entries()).map((([e])=>p.getRecord(R(e)))),getTranslation(e,t){var n;return null===(n=l.get(C(e)))||void 0===n?void 0:n.data[t]},getTranslationNs(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=l.get(C({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return[r]}return b(e)},getTranslationFallback(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=l.get(C({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return t}},changeTranslation(t,n,a){var r;const o=null===(r=l.get(C(t)))||void 0===r?void 0:r.data;(null==o?void 0:o[n])&&(o[n]=a,e.onCacheChange.emit(Object.assign(Object.assign({},t),{key:n})))},isFetching(e){if(r())return!0;if(void 0===e)return s.size>0;const t=m(e);return Boolean(Array.from(s.keys()).find((e=>t.includes(R(e).namespace))))},isLoading(e,t){const n=m(t);if(r())return!0;const a=Array.from(s.keys());return Boolean(a.find((t=>{const a=R(t);return(!n.length||n.includes(a.namespace))&&!p.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const n=e.map((e=>{const n=a(e),r=C(n);if(null==t?void 0:t.useCache){if(p.exists(n,!0))return Object.assign(Object.assign({},n),{new:!1,cacheKey:r,data:p.getRecord(n).data})}const o=s.get(r);if(o)return Object.assign(Object.assign({},n),{new:!1,promise:o,cacheKey:r});const i=f(n,!(null==t?void 0:t.noDev))||Promise.resolve(void 0);return s.set(r,i),Object.assign(Object.assign({},n),{new:!0,promise:i,cacheKey:r})}));o.notify(),i.notify();const r=n.map((e=>e.promise)).filter(Boolean),l=await Promise.all(r);return n.forEach((e=>{var t;e.promise&&(e.data=x(null!==(t=l[0])&&void 0!==t?t:{}),l.shift());const n=s.get(e.cacheKey)!==e.promise;e.new&&!n&&(s.delete(e.cacheKey),e.data?p.addRecord(e,e.data):p.getRecord(e)||p.addRecord(e,{}))})),o.notify(),i.notify(),n.map((e=>{var t;return{language:e.language,namespace:e.namespace,data:null!==(t=e.data)&&void 0!==t?t:{},cacheKey:e.cacheKey}}))}});return p}function D(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}const S="invalid",I={observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:S,apiUrl:"https://app.tolgee.io",autoLoadRequiredData:!0,fetch:L(),onTranslationMissing:({key:e})=>e},F=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function U(e,t){const n=F(I,null==t?void 0:t.initialOptions,e);return n.apiUrl=E(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=L(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function _(e,t,n,a,r,o,i,s){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},u=async({keysAndDefaults:e,target:t})=>{var n;const i=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:a(t),namespace:r({key:e,ns:t})[0],translation:o({key:e,ns:t})})));null===(n=c.ui)||void 0===n||n.handleElementClick(i,t)},g=(e,t)=>{var n;return(null===(n=c.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function d(e){const t=o({key:e.key,ns:e.ns});return j.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function h(){return{fetch:t().fetch}}function v(e){c.observer=null==e?void 0:e()}function m(){return Boolean(c.observer)}function y(e){e&&c.formatters.push(e)}function b(e){c.finalFormatter=e}function E(e){l.ui=e}function w(){return Boolean(l.ui)}function L(e){c.languageStorage=e}function O(e){c.languageDetector=e}function A(e){e&&c.backends.push(e)}function N(e){c.devBackend=e}const j=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:b,addFormatter:y,setObserver:v,hasObserver:m,setUi:E,hasUi:w,setDevBackend:N,addBackend:A,setLanguageDetector:O,setLanguageStorage:L}))},findPositions:g,run(){var e,n;const{apiKey:a,apiUrl:r,projectId:o,observerOptions:f,tagNewKeys:p,filterTag:h}=t();c.ui=null===(e=l.ui)||void 0===e?void 0:e.call(l,{apiKey:a,apiUrl:r,projectId:o,highlight:j.highlight,changeTranslation:i,findPositions:g,onPermanentChange:e=>s.onPermanentChange.emit(e),tagNewKeys:p,filterTag:h}),null===(n=c.observer)||void 0===n||n.run({mouseHighlight:!0,options:f,translate:d,onClick:u})},stop(){var e;c.ui=void 0,null===(e=c.observer)||void 0===e||e.stop()},getLanguageStorage:()=>c.languageStorage,getInitialLanguage(){const e=n();return f(p(s.onError,(e=>new T("Tolgee: Failed to load language",e)),(()=>{var e;return null===(e=c.languageStorage)||void 0===e?void 0:e.getLanguage(h())})),(t=>e&&!e.includes(t)||!t?function(){if(!c.languageDetector)return;const e=n();return p(s.onError,(e=>new k("Tolgee: Failed to detect language",e)),(()=>{var t;return null===(t=c.languageDetector)||void 0===t?void 0:t.getLanguage(Object.assign({availableLanguages:e},h()))}))}():t))},setStoredLanguage:e=>p(s.onError,(e=>new T("Tolgee: Failed to store language",e)),(()=>{var t;return null===(t=c.languageStorage)||void 0===t?void 0:t.setLanguage(e,h())})),getDevBackend:()=>c.devBackend,getBackendRecord:async({language:e,namespace:t})=>{for(const n of c.backends){const a=await n.getRecord(Object.assign({language:e,namespace:t},h()));if(void 0!==a)return a}},getBackendDevRecord:async({language:e,namespace:n})=>{var a;const{apiKey:r,apiUrl:o,projectId:i,filterTag:s}=t();if(r&&o&&j.hasDevBackend())return null===(a=c.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:r,apiUrl:o,projectId:i,language:e,namespace:n,filterTag:s},h()))},getLanguageDetector:()=>c.languageDetector,retranslate(){var e;null===(e=c.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=c.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(j.getDevBackend()),formatTranslation(n){var a,{formatEnabled:r}=n,o=D(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:u,params:g,ns:d,orEmpty:f}=o,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(o));let v=null!=p?p:f?"":h;const m=e(),y=r||!(null===(a=c.observer)||void 0===a?void 0:a.outputNotFormattable),b=e=>c.observer&&!u?c.observer.wrap({key:i,translation:e,defaultValue:l,params:g,ns:d}):e;v=b(v);try{if(p&&m&&y)for(const e of c.formatters)v=e.format({translation:v,language:m,params:g});c.finalFormatter&&p&&m&&y&&(v=c.finalFormatter.format({translation:v,language:m,params:g}))}catch(e){console.error(e);const n=("string"==typeof(E=e)?E:"string"==typeof(null==E?void 0:E.message)?E.message:void 0)||S,a=t().onFormatError,r=typeof a;v="string"===r?a:"function"===r?a(n,o):S,v=b(v)}var E;return v}});return j}const $=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const M=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:r,language:o}=e,i=D(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:o};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function K({options:e}){const t=function(){let e=!0;function t(){return e}const n=Object.freeze({onPendingLanguageChange:O("pendingLanguage",t),onLanguageChange:O("language",t),onLoadingChange:O("loading",t),onFetchingChange:O("fetching",t),onInitialLoaded:O("initialLoad",t),onRunningChange:O("running",t),onCacheChange:O("cache",t),onPermanentChange:O("permanentChange",t),onError:O("error",t),onUpdate:A(t),setEmitterActive(t){e=t},on:(e,t)=>{switch(e){case"pendingLanguage":return n.onPendingLanguageChange.listen(t);case"language":return n.onLanguageChange.listen(t);case"loading":return n.onLoadingChange.listen(t);case"fetching":return n.onFetchingChange.listen(t);case"initialLoad":return n.onInitialLoaded.listen(t);case"running":return n.onRunningChange.listen(t);case"cache":return n.onCacheChange.listen(t);case"update":return n.onUpdate.listen(t);case"permanentChange":return n.onPermanentChange.listen(t);case"error":return n.onError.listen(t)}}});return n.onInitialLoaded.listen((e=>n.onUpdate.emit(e,!1))),n.onLanguageChange.listen((e=>n.onUpdate.emit(e,!1))),n.onCacheChange.listen((e=>n.onUpdate.emit(e,!0))),n}(),n=$(!1,(()=>i.isFetching()),t.onFetchingChange.emit),a=$(!1,(()=>T.isLoading()),t.onLoadingChange.emit),r=function(e,t,n){let a,r=U();const o=Object.freeze({init(e){r=U(e,r)},isRunning:()=>r.isRunning,setRunning(e){r.isRunning!==e&&(r.isRunning=e,n.emit(e))},isInitialLoading:()=>r.isInitialLoading,setInitialLoading(e){r.isInitialLoading=e},getLanguage:()=>r.language||r.initialOptions.language,setLanguage(t){r.language!==t&&(r.language=t,e.emit(t))},getPendingLanguage:()=>r.pendingLanguage||o.getLanguage(),setPendingLanguage(e){r.pendingLanguage!==e&&(r.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},r.initialOptions),a),addActiveNs(e){m(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t?r.activeNamespaces.set(e,t+1):r.activeNamespaces.set(e,1)}))},removeActiveNs(e){m(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t&&t>1?r.activeNamespaces.set(e,t-1):r.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>b([o.getDefaultNs(),...r.initialOptions.ns||[],...m(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||o.getLanguage();return t?b([t,...y(t,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>m(r.initialOptions.fallbackNs),getNs(){var e,t;return(null===(e=r.initialOptions.ns)||void 0===e?void 0:e.length)?r.initialOptions.ns:[null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:""]},getDefaultNs(e){var t,n,a;return void 0===e?null!==(a=null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:null===(n=r.initialOptions.ns)||void 0===n?void 0:n[0])&&void 0!==a?a:"":e},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const e=Object.keys(r.initialOptions.staticData).map((e=>R(e).language));return Array.from(new Set(e))}},getAvailableNs:()=>r.initialOptions.availableNs,withDefaultNs:e=>({namespace:void 0===e.namespace?o.getDefaultNs():e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:E(e.apiUrl)}):void 0}});return o}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),o=_(r.getLanguage,r.getInitialOptions,r.getAvailableLanguages,c,w,L,g,t),i=P(t,o.getBackendRecord,o.getBackendDevRecord,r.withDefaultNs,r.isInitialLoading,n,a);let s;function l(e){return r.getDefaultNs(e)}function c(e){return b([...m(l(e)),...r.getFallbackNs()])}function u(e){return b([...m(null!=e?e:l()),...r.getRequiredNamespaces()])}function g(e,t,n){const a=r.withDefaultNs(e),o=i.getTranslation(a,t);return i.changeTranslation(a,t,n),{revert(){i.changeTranslation(a,t,o)}}}function p(e){r.init(e),i.addStaticData(r.getInitialOptions().staticData)}function v(e,t){const n=r.getFallbackLangs(e),a=u(t),o=[];return n.forEach((e=>{a.forEach((t=>{o.push({language:e,namespace:t})}))})),o}function w({key:e,ns:t}){const n=r.getFallbackLangs(),a=c(null!=t?t:void 0);return i.getTranslationNs(a,n,e)}function L({key:e,ns:t,language:n}){const a=c(null!=t?t:void 0),o=r.getFallbackLangs(n);return i.getTranslationFallback(a,o,e)}function N(){const e=f(k(),(()=>{const e=v(t,n).filter((e=>!i.exists(e,!0)));var t,n;if(e.length&&r.getInitialOptions().autoLoadRequiredData)return i.loadRecords(e,{useCache:!0})}));if(d(e))return r.setInitialLoading(!0),n.notify(),a.notify(),Promise.resolve(e).then((()=>{r.setInitialLoading(!1),n.notify(),a.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}function k(){if(r.getLanguage())return;return f(o.getInitialLanguage(),(e=>{const t=e||r.getInitialOptions().defaultLanguage;t&&r.setLanguage(t)}))}e&&p(e),t.onUpdate.listen((()=>{r.isRunning()&&o.retranslate()}));const T=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),r),o),i),{init:p,getTranslation:L,changeTranslation:g,getTranslationNs:w,getDefaultAndFallbackNs:c,findPositions:o.findPositions,getRequiredDescriptors:v,async changeLanguage(e){r.getPendingLanguage()===e&&r.getLanguage()===e||(r.setPendingLanguage(e),r.isRunning()&&r.getInitialOptions().autoLoadRequiredData&&await i.loadRecords(v(e),{useCache:!0}),e===r.getPendingLanguage()&&(r.setLanguage(e),await o.setStoredLanguage(e)))},async addActiveNs(e,t){t||r.addActiveNs(e),r.isRunning()&&await i.loadRecords(v(void 0,e),{useCache:!0})},async loadRecord(e,t){var n;return null===(n=(await T.loadRecords([e],t))[0])||void 0===n?void 0:n.data},isLoading:e=>i.isLoading(r.getLanguage(),e),isLoaded(e){const t=r.getLanguage();if(!t)return!1;const n=r.getFallbackLangs(t),a=u(e),o=[];return n.forEach((e=>{a.forEach((t=>{i.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=M(...e),n=L(t);return o.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(r.getInitialOptions().apiKey&&r.getInitialOptions().apiUrl),async loadRequired(e){(null==e?void 0:e.language)||await k();const t=v(null==e?void 0:e.language);return T.loadRecords(t,e)},async loadMatrix(e){const t=function(e){let t=[],n=[];if(Array.isArray(e.languages))t=e.languages;else if("all"===e.languages){const e=T.getAvailableLanguages();if(!e)throw new Error(h("availableLanguages"));t=e}if(Array.isArray(e.namespaces))n=e.namespaces;else if("all"===e.namespaces){const e=T.getAvailableNs();if(!e)throw new Error(h("availableNs"));n=e}const a=[];return t.forEach((e=>{n.forEach((t=>{a.push({language:e,namespace:t})}))})),a}(e);return T.loadRecords(t,e)},run:()=>(function(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!r.getAvailableLanguages())throw new Error(h("availableLanguages"));if(!r.getLanguage()&&!r.getInitialOptions().defaultLanguage)throw new Error(h(["defaultLanguage","language"]))}(),r.isRunning()||(r.setRunning(!0),o.run(),s=N()),Promise.resolve(s)),stop(){r.isRunning()&&(o.stop(),r.setRunning(!1))}}));return T}const B=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=F(e.options,n),t),init(t){const n=function(e){const t=K({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRequired:t.loadRequired,loadMatrix:t.loadMatrix,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,getRequiredDescriptors:t.getRequiredDescriptors,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,findPositions:t.findPositions,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(F(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},V=0,z=1,W=2;class q extends Error{constructor(e,t,n){let a,r="";e===V?a="Empty parameter":e===z?(a="Unexpected character",r="Did you forget to use FormatIcu to render ICU message syntax?"):a="Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`+(r?"\n"+r:"")),this.code=e,this.index=t}}function H(e){return/\s/.test(e)}const Y=0,G=1,X=2,J=3,Z=4,Q=new Set([X,G,Y]),ee="'",te=new Set(["{","}",ee]),ne=e=>/[0-9a-zA-Z_]/.test(e);function ae(e,t){const[n,a]=function(e){let t=Y,n="",a="",r="";const o=[],i=[];let s=0;function l(t){throw new q(t,s,e)}const c=()=>{o.push(n),n=""},u=()=>{""===a&&l(V),i.push(a),a=""};for(s=0;s<e.length;s++)switch(r=e[s],t){case Y:r===ee?(n+=r,t=G):"{"===r?(c(),t=J):(n+=r,t=Y);break;case G:te.has(r)?(n=n.slice(0,-1)+r,t=X):(n+=r,t=Y);break;case X:r===ee?t=Y:(n+=r,t=X);break;case J:"}"===r?(u(),t=Y):H(r)?""!==a&&(u(),t=Z):(ne(r)||l(z),a+=r,t=J);break;case Z:"}"==r?t=Y:H(r)?t=Z:l(z)}return Q.has(t)||l(W),c(),[o,i]}(e),r=[n[0]];for(let o=1;o<n.length;o++){const i=null==t?void 0:t[a[o-1]];if(void 0===i)throw new Error(`Missing parameter "${a[o-1]}" in "${e}"`);r.push(String(i)),r.push(n[o])}return r.join("")}const re=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>ae(e,t)}),e),oe="__tolgee_dev_tools",ie="__tolgee_preferredLanguages",se="data-tolgee-key-only",le="data-tolgee-restricted",ce="_tolgee",ue="_tolgee-highlighter";function ge(){var e,t;return void 0===(null==(t=null==(e=globalThis.window)?void 0:e.document)?void 0:t.createElement)}function de(e){if(ge())throw new Error(`${e}: Can't run on the server`)}function fe(e,t){return{oldTextContent:e,keys:t}}function pe(e){return e.textContent}function he(e,t){e.textContent=t}function ve(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,r=void 0===e.ns||void 0===t.ns||-1!==(null==(n=e.ns)?void 0:n.findIndex((e=>{var n;return null==(n=t.ns)?void 0:n.includes(e)})));return a&&r}const me={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function ye({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;const r=function(e){for(;e;){if(null!==e.getAttribute("disabled"))return!1;e=e.parentElement}return!0}(n);let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(ue),Object.entries(me).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const i=n.getBoundingClientRect();o.style.pointerEvents=r?"none":"auto",o.style.borderWidth=t+"px",o.style.top=i.top-t+"px",o.style.left=i.left-t+"px",o.style.width=i.width+"px",o.style.height=i.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null==(e=t.highlightEl)||e.remove(),t.highlightEl=void 0}}(0,a)}})}const be={capture:!0},Ee={capture:!0,passive:!0},we=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function Le({highlightKeys:e,elementStore:t,onClick:n,options:a}){var r,o;const i=new Set;let s,l,c=[];const u=(null==(r=a.targetElement)?void 0:r.getRootNode())||document,g=(null==(o=a.targetElement)?void 0:o.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null==(e=n.unhighlight)||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=O(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null==(n=a.highlight)||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of we.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(O(t,(e=>e.id===oe))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null==(e=null==n?void 0:n.highlight)||e.call(n)}function w(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(s),d())}function L(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function O(e,t){return e.id===oe?null:t(e)?e:(null==e?void 0:e.parentElement)?O(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){L("keydown",y,be),L("keyup",b,be),L("mousemove",m,Ee),L("scroll",E,Ee),L("click",w,be),L("mouseenter",v,be),L("mouseover",v,be),L("mouseout",v,be),L("mouseleave",v,be),L("mousedown",v,be),L("mouseup",v,be)}})}function Oe(e,t,n){const a=ye({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=Le({highlightKeys:e.highlightKeys,elementStore:t,onClick(e){const a=t.get(e);n({target:e,keysAndDefaults:s(a)})},options:e});function o(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${le}]`)}function i(e,n){var a;n.highlightEl&&(null==(a=n.unhighlight)||a.call(n)),e.removeAttribute(ce),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({isRestricted:o,register(e,n,r){if(o(e))return;const i=e;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(ce,"true")),s.nodes.set(n,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===se&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>ve({key:e,ns:v(n)},{key:t.key,ns:v(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null==(n=t.unhighlight)||n.call(t))}))}})}function Ae(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:r,onClick:o}){if(ge())return{stop(){t=!1},wrapper:r};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var r,o;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!=(r=s[e.tagName.toUpperCase()])?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null==(t=s[e.tagName.toUpperCase()])?void 0:t.some((t=>e.hasAttribute(t))))||(null==(n=s["*"])?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!=(o=s[n.tagName.toUpperCase()])?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,r),l=Oe(a,n,o);function c(e){for(const t of e){const e=t.parentElement;if(e&&l.isRestricted(e))continue;const n=pe(t),a=n?r.unwrap(n):null;if(a){const{text:e,keys:r}=a;he(t,e);const o=fe(n,r),s=i.getSuitableParent(t);l.register(s,t,o)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:pe(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===se)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(se);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(se)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(se))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===se))&&l.cleanupLingeringKeyAttributes();const r=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>r.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>r.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>r.delete(e)));break;case"attributes":t.attributeName===se&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>r.add(e)))}c([...r])})),f=a.targetElement||document;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(se),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:r}}return Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null==(a=null==(n=null==e?void 0:e.elementRegistry)?void 0:n.forEachElement)||a.call(n,t)},highlight(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[];return r.forEach((e=>{var t;return null==(t=e.highlight)?void 0:t.call(e)})),{unhighlight(){r.forEach((e=>{var t;return null==(t=e.unhighlight)?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[],o=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{ve({key:t,ns:v(n)},{key:e.key,ns:v(e.ns)})&&o.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),o},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""})}var Ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ke={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),r=[],o=0;;){var i=t<e.length;if(!i||o>=n-1){var s=a.subarray(0,o);if(r.push(String.fromCharCode.apply(null,s)),!i)return r.join("");e=e.subarray(t),t=0,o=0}var l=e[t++];if(0==(128&l))a[o++]=l;else if(192==(224&l)){var c=63&e[t++];a[o++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[o++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[o++]=g>>>10&1023|55296,g=56320|1023&g),a[o++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},r="function"==typeof Buffer&&Buffer.from,o=r?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>o.length){r+=8,r=(r*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(r);l.set(o),o=l}if(0!=(4294967168&i)){if(0==(4294965248&i))o[a++]=i>>>6&31|192;else if(0==(4294901760&i))o[a++]=i>>>12&15|224,o[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;o[a++]=i>>>18&7|240,o[a++]=i>>>12&63|128,o[a++]=i>>>6&63|128}o[a++]=63&i|128}else o[a++]=i}return o.slice?o.slice(0,a):o.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),o(e)};var s=!r&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;r?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(r?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:Ne);const Te=g({__proto__:null,default:ke},[ke]);null==(e=console.assert)||e.call(console,Te);const je=["",""],xe=RegExp(`([${je.join("")}]{9})+`,"gu");function Re(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>je[Number(e)])).join("")}function Ce(e){const t=Array.from(e).map((e=>je.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function Pe({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}function a(e){return Re(e+"\n")}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null==(t=e.match(xe))?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(Ce))||[]}(e);a.forEach((e=>{const a=function(e){return e.split("\n").filter((e=>e.length)).map((e=>{if("{"===e[0])return e;{const n=Number(e);return t.numberToValue(n)}}))}(e);a.forEach((e=>{const t=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(e);if(t){const{k:e,d:a,n:r}=t;n.push({key:e,defaultValue:a,ns:r})}}))}));const r=function(e){return e.replace(xe,"")}(e);return{text:r,keys:n}},wrap({key:r,defaultValue:o,translation:i,ns:s}){let l;if(e){l=a(n({key:r,ns:s}))}else{const e=n({key:r,ns:s,defaultValue:o}),i=t.valueToNumber(e);l=a(String(i))}const c=i||"";return"string"==typeof c?c+l:c},testTextNode(e){var t,n,a;return null!=(a=(null==(t=e.textContent)?void 0:t.includes(`${je[0]}${je[0]}`))||(null==(n=e.textContent)?void 0:n.includes(`${je[1]}${je[0]}`)))&&a},testAttribute:e=>e.value.includes(`${je[0]}${je[0]}`)||e.value.includes(`${je[1]}${je[0]}`)})}function De(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function Se({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:r,ns:o}=function(e){let t=!1,n="",a="",r="KEY";const o={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{o.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==r||","!==s?"KEY"!==r||"|"!==s?"NAMESPACE"!==r||","!==s?"KEY"!==r||":"!==s?"DEFAULT_VALUE"!==r||":"!==s?"PARAM_NAME"!==r||":"!==s?"PARAM_VALUE"!==r||","!==s?n+=s:(r="PARAM_NAME",o.params[a]=n,n=""):(r="PARAM_VALUE",a=n,n=""):(r="PARAM_NAME",o.defaultValue=n,n=""):(r="PARAM_NAME",o.key=n,n=""):(r="DEFAULT_VALUE",i(n),n=""):(r="NAMESPACE",o.key=n,n=""):(r="DEFAULT_VALUE",o.key=n,n=""):t=!0;return"KEY"===r&&(o.key=n),"DEFAULT_VALUE"===r&&(o.defaultValue=n),"PARAM_VALUE"===r&&(o.params[a]=n),"NAMESPACE"===r&&i(n),o}(e);return{translated:n({key:t,params:a,defaultValue:r,ns:o,noWrap:!0}),key:t,params:a,defaultValue:r,ns:o}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){return"string"==typeof e?e.replace(new RegExp("[,:|\\\\]","gs"),"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:r,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${o(e)}:${o(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==r?`,${o(r)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>o(e))).join("|")}`:"";return`${e}${o(n)}${u}${l}${s}${t}`},unwrap(n){const o=new RegExp(`(\\\\?)(${r(e)}(.*?)${r(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=o.exec(n));){let e=s[1];const[t,r,o,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!De(d,n)){u+=o;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,r,o;return null!=(o=(null==(a=n.textContent)?void 0:a.includes(e))&&(null==(r=n.textContent)?void 0:r.includes(t)))&&o},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Ie=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=Ae();return Object.freeze(c(l({},e),{run(t){const n=Se({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(c(l({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&he(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=Ae();return Object.freeze(c(l({},e),{run(t){const n=Pe({fullKeyEncode:t.options.fullKeyEncode});e.run(c(l({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Ue(e){const t=Fe.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function _e(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,r=0;const o=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Ue(e[i]),n+=5,n>=8&&(o[r++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",r=Math.pow(2,16)-1;for(let e=0;e<n;e+=r)e+r>n&&(r=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+r));return a}(o.buffer)}function $e(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=_e(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Me(...e){const t="undefined"==typeof window?void 0:window.location.origin;return new URL(function(...e){let t=e[0];return e.slice(1).forEach((e=>{var n;n=e,t=`${t.replace(/\/+$/,"")}/${n=n.replace(/^\/+/,"")}`})),t}(...e),t)}const Ke=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:r,filterTag:o,fetch:i}){var s;const l=null!=(s=$e(t))?s:r;let c;if(c=Me(e,void 0!==l?`/v2/projects/${l}/translations/${n}`:`/v2/projects/translations/${n}`),a&&c.searchParams.append("ns",a),null==o||o.forEach((e=>{c.searchParams.append("filterTag",e)})),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===r)throw new Error("You need to specify 'projectId' when using PAT key");return i(c.toString(),{headers:{"X-API-Key":t||"","Content-Type":"application/json"},next:{revalidate:0}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e);function Be({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:r=300}){let o=!1;const i=()=>new Promise(((a,o)=>{const i=function(e,t){const n=n=>{var a,r;e.includes(null==(a=n.data)?void 0:a.type)&&t(null==(r=n.data)?void 0:r.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),o()}),r);function l(){i.unsubscribe()}}));return{cancel(){o=!0},promise:(async()=>{for(let e=0;e<a;e++){if(o)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!o)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}let Ve=null;function ze(e){var t;return Ve||(Ve=(t=`https://cdn.jsdelivr.net/npm/@tolgee/web@${e}/dist/tolgee-in-context-tools.umd.min.js`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window["@tolgee/in-context-tools"].InContextTools))),Ve}const We="__tolgee_apiKey",qe="__tolgee_apiUrl";function He(){const e=sessionStorage.getItem(We)||void 0,t=sessionStorage.getItem(qe)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function Ye(){sessionStorage.removeItem(We),sessionStorage.removeItem(qe)}let Ge=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(Ge=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=Be({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(Ye)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return He()&&(async()=>{const e=await ze("prerelease");return t=>{const n=He();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Xe="__tolgee_currentLanguage";const Je=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(de("LanguageStorage"),localStorage.getItem(Xe)||void 0),setLanguage(e){de("LanguageStorage"),localStorage.setItem(Xe,e)}}),e);function Ze(e,t){const n=t.find((t=>t===e));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),r=a(e),o=t.find((e=>a(e)===r));return o||void 0}const Qe=()=>(e,t)=>(t.setLanguageDetector({getLanguage:({availableLanguages:e})=>(de("LanguageDetector"),Ze(window.navigator.language,e))}),e);const et=(e,t)=>{const n=function(e){const t=e.get("Accept-Language");if(!t)return[];const n=t.split(",").map((e=>{const[t]=e.trim().split(";");return t}));return[...new Set(n.filter((e=>e&&"*"!==e)))]}(e);return n[0]&&Ze(n[0],t)};function tt(e){return e.endsWith("/")?e.slice(0,-1):e}const nt={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${tt(n)}/${e}/${t}.json`:`${tt(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"},timeout:void 0,fallbackOnFail:!1};function at(e){const t=c(l(l({},nt),e),{headers:l(l({},nt.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:r,headers:o,timeout:i,fallbackOnFail:s}=t,g=u(t,["prefix","getPath","getData","headers","timeout","fallbackOnFail"]);return{async getRecord({namespace:e,language:t,fetch:c}){const d=a({namespace:e,language:t,prefix:n});try{const e=await((e,t,n,a)=>{var r=a,{signal:o}=r,i=u(r,["signal"]);const s=new AbortController;return new Promise(((a,r)=>{const c=e(t,l({signal:s.signal},i));let u=!1;function g(e){!u&&r(e),u=!0}function d(){const e=new Error(`TIMEOUT: ${t}`);s.abort(e),g(e)}if(o&&o.addEventListener("abort",d),void 0!==n){const e=setTimeout(d,n);c.finally((()=>clearTimeout(e)))}c.catch(g).then((function(e){!u&&a(e),u=!0}))}))})(c,d,i,l({headers:o},g));if(!e.ok)throw new Error(`${e.url} ${e.status}`);return await r(e)}catch(e){if(s)return;throw e}}}}const rt=e=>(t,n)=>(n.addBackend(at(e)),t);function ot(){return B().use(Ge())}const it=()=>e=>e;export{rt as BackendFetch,Ge as BrowserExtensionPlugin,oe as DEVTOOLS_ID,Ke as DevBackend,it as DevTools,re as FormatSimple,Qe as LanguageDetector,k as LanguageDetectorError,Je as LanguageStorage,T as LanguageStorageError,Ie as ObserverPlugin,ie as PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY,N as RecordFetchError,ce as TOLGEE_ATTRIBUTE_NAME,le as TOLGEE_RESTRICT_ATTRIBUTE,se as TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE,ot as Tolgee,B as TolgeeCore,L as createFetchFunction,Ze as detectLanguage,et as detectLanguageFromHeaders,v as getFallback,m as getFallbackArray,$e as getProjectIdFromApiKey,M as getTranslateProps,ge as isSSR}; | ||
//# sourceMappingURL=tolgee-web.production.esm.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/web"]={})}(this,(function(e){"use strict";var t,n=Object.defineProperty,a=Object.defineProperties,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,t,a)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&l(e,n,t[n]);if(o)for(var n of o(t))s.call(t,n)&&l(e,n,t[n]);return e},u=(e,t)=>a(e,r(t)),g=(e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&s.call(e,a)&&(n[a]=e[a]);return n};function d(e,t){for(var n=0;n<t.length;n++){const a=t[n];if("string"!=typeof a&&!Array.isArray(a))for(const t in a)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(a,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function f(e){return Boolean(e&&"function"==typeof e.then)}function p(e,t){return f(e)?Promise.resolve(e).then(t):t(e)}function h(e,t,n){function a(n){const a=t(n);throw e.emit(a),console.error(a),a}try{const e=n();return f(e)?e.catch(a):e}catch(e){a(e)}}function v(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function m(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function y(e){return m(e)||[]}function b(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?y(t):y(null==t?void 0:t[e]);var n}function E(e){return Array.from(new Set(e))}function L(e){return e?e.replace(/\/+$/,""):e}const w=(e,t)=>fetch(e,t);const O=(e=w)=>(t,n)=>{let a=(r=null==n?void 0:n.headers,Object.fromEntries(new Headers(r).entries()));var r;return a["x-api-key"]&&(a=Object.assign({"x-tolgee-sdk-type":"JS","x-tolgee-sdk-version":"prerelease"},a)),e(t,Object.assign(Object.assign({},n),{headers:a}))},A=(e,t)=>{let n=[];return{listen(e){const t=t=>{e(t)};return n.push(t),{unsubscribe(){n=n.filter((e=>t!==e))}}},emit(a){t()&&n.forEach((t=>t({type:e,value:a})))}}};function T(e){let t=[],n=[];function a(){if(0===n.length)return;const e=n;n=[],t.forEach((t=>{t(e)}))}return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(t,r){e()&&e()&&(n.push(t),r?setTimeout(a,0):a())}})}class N extends Error{constructor(e,t,n=!1){const{language:a,namespace:r}=e;super(`Tolgee: Failed to fetch record for "${a}"${r&&` and "${r}"`}`),this.cause=t,this.isDev=n,this.name="RecordFetchError",this.language=a,this.namespace=r}}class k extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageDetectorError"}}class j extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageStorageError"}}const R=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):R(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},x=e=>Object.fromEntries(R(e).entries()),C=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},P=({language:e,namespace:t})=>t?`${e}:${t}`:e;function D(e,t,n,a,r,o,i,s){const l=new Map,c=new Map;let u={},g=0;function d(t,n,a){const r=P(t);c.set(r,{data:x(n),version:a}),e.onCacheChange.emit(C(r))}async function p(a,r){let o;if(r)try{o=await n(a)}catch(t){const n=new N(a,t,!0);e.onError.emit(n),console.warn(n)}return o||(o=await async function(n){function a(t){const a=new N(n,t);throw e.onError.emit(a),console.error(a),a}const r=t(n);if(f(r)){const e=await r.catch(a);if(void 0!==e)return e}const o=u[P(n)];if("function"!=typeof o)return o;try{return await o()}catch(e){a(e)}}(a)),o}const h=Object.freeze({addStaticData(e){if(Array.isArray(e))for(const t of e){const e=P(t),n=c.get(e);n&&0!==n.version||d(t,x(t.data),0)}else e&&(u=Object.assign(Object.assign({},u),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=C(e),a=c.get(e);a&&0!==a.version||d(n,x(t),0)}})))},invalidate(){l.clear(),g+=1},addRecord(e,t){d(e,x(t),g)},exists(e,t=!1){const n=c.get(P(e));return n&&t?n.version===g:Boolean(n)},getRecord(e){const t=a(e),n=P(t),r=c.get(n);if(r)return Object.assign(Object.assign({},t),{cacheKey:n,data:r.data})},getAllRecords:()=>Array.from(c.entries()).map((([e])=>h.getRecord(C(e)))),getTranslation(e,t){var n;return null===(n=c.get(P(e)))||void 0===n?void 0:n.data[t]},getTranslationNs(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=c.get(P({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return[r]}return E(e)},getTranslationFallback(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=c.get(P({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return t}},changeTranslation(t,n,a){var r;const o=null===(r=c.get(P(t)))||void 0===r?void 0:r.data;(null==o?void 0:o[n])&&(o[n]=a,e.onCacheChange.emit(Object.assign(Object.assign({},t),{key:n})))},isFetching(e){if(r())return!0;if(void 0===e)return l.size>0;const t=y(e);return Boolean(Array.from(l.keys()).find((e=>t.includes(C(e).namespace))))},isLoading(e,t){const n=y(t);if(r())return!0;const a=Array.from(l.keys());return Boolean(a.find((t=>{const a=C(t);return(!n.length||n.includes(a.namespace))&&!h.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const n=e.map((e=>{const n=a(e),r=P(n);if(null==t?void 0:t.useCache){if(h.exists(n,!0))return Object.assign(Object.assign({},n),{new:!1,cacheKey:r,data:h.getRecord(n).data})}const o=l.get(r);if(o)return Object.assign(Object.assign({},n),{new:!1,promise:o,cacheKey:r});const i=p(n,!(null==t?void 0:t.noDev))||Promise.resolve(void 0);return l.set(r,i),Object.assign(Object.assign({},n),{new:!0,promise:i,cacheKey:r})}));i.notify(),s.notify();const r=n.map((e=>e.promise)).filter(Boolean),o=await Promise.all(r);return n.forEach((e=>{var t;e.promise&&(e.data=x(null!==(t=o[0])&&void 0!==t?t:{}),o.shift());const n=l.get(e.cacheKey)!==e.promise;e.new&&!n&&(l.delete(e.cacheKey),e.data?h.addRecord(e,e.data):h.getRecord(e)||h.addRecord(e,{}))})),i.notify(),s.notify(),n.map((e=>{var t;return{language:e.language,namespace:e.namespace,data:null!==(t=e.data)&&void 0!==t?t:{},cacheKey:e.cacheKey}}))}});return h}function S(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}const F="invalid",I={observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:F,apiUrl:"https://app.tolgee.io",autoLoadRequiredData:!0,fetch:O(),onTranslationMissing:({key:e})=>e,disableCache:!1},_=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function U(e,t){const n=_(I,null==t?void 0:t.initialOptions,e);return n.apiUrl=L(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=O(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function $(e,t,n,a,r,o,i,s){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},u=async({keysAndDefaults:e,target:t})=>{var n;const i=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:a(t),namespace:r({key:e,ns:t})[0],translation:o({key:e,ns:t})})));null===(n=c.ui)||void 0===n||n.handleElementClick(i,t)},g=(e,t)=>{var n;return(null===(n=c.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function d(e){const t=o({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function f(){return{fetch:t().fetch}}function v(e){c.observer=null==e?void 0:e()}function m(){return Boolean(c.observer)}function y(e){e&&c.formatters.push(e)}function b(e){c.finalFormatter=e}function E(e){l.ui=e}function L(){return Boolean(l.ui)}function w(e){c.languageStorage=e}function O(e){c.languageDetector=e}function A(e){e&&c.backends.push(e)}function T(e){c.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:b,addFormatter:y,setObserver:v,hasObserver:m,setUi:E,hasUi:L,setDevBackend:T,addBackend:A,setLanguageDetector:O,setLanguageStorage:w}))},findPositions:g,run(){var e,n;const{apiKey:a,apiUrl:r,projectId:o,observerOptions:f,tagNewKeys:p,filterTag:h}=t();c.ui=null===(e=l.ui)||void 0===e?void 0:e.call(l,{apiKey:a,apiUrl:r,projectId:o,highlight:N.highlight,changeTranslation:i,findPositions:g,onPermanentChange:e=>s.onPermanentChange.emit(e),tagNewKeys:p,filterTag:h}),null===(n=c.observer)||void 0===n||n.run({mouseHighlight:!0,options:f,translate:d,onClick:u})},stop(){var e;c.ui=void 0,null===(e=c.observer)||void 0===e||e.stop()},getLanguageStorage:()=>c.languageStorage,getInitialLanguage(){const e=n();return p(h(s.onError,(e=>new j("Tolgee: Failed to load language",e)),(()=>{var e;return null===(e=c.languageStorage)||void 0===e?void 0:e.getLanguage(f())})),(t=>e&&!e.includes(t)||!t?function(){if(!c.languageDetector)return;const e=n();return h(s.onError,(e=>new k("Tolgee: Failed to detect language",e)),(()=>{var t;return null===(t=c.languageDetector)||void 0===t?void 0:t.getLanguage(Object.assign({availableLanguages:e},f()))}))}():t))},setStoredLanguage:e=>h(s.onError,(e=>new j("Tolgee: Failed to store language",e)),(()=>{var t;return null===(t=c.languageStorage)||void 0===t?void 0:t.setLanguage(e,f())})),getDevBackend:()=>c.devBackend,getBackendRecord:async({language:e,namespace:t})=>{for(const n of c.backends){const a=await n.getRecord(Object.assign({language:e,namespace:t},f()));if(void 0!==a)return a}},getBackendDevRecord:async({language:e,namespace:n})=>{var a;const{apiKey:r,apiUrl:o,projectId:i,filterTag:s}=t();if(r&&o&&N.hasDevBackend())return null===(a=c.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:r,apiUrl:o,projectId:i,language:e,namespace:n,filterTag:s},f()))},getLanguageDetector:()=>c.languageDetector,retranslate(){var e;null===(e=c.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=c.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(n){var a,{formatEnabled:r}=n,o=S(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:u,params:g,ns:d,orEmpty:f}=o,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(o));let v=null!=p?p:f?"":h;const m=e(),y=r||!(null===(a=c.observer)||void 0===a?void 0:a.outputNotFormattable),b=e=>c.observer&&!u?c.observer.wrap({key:i,translation:e,defaultValue:l,params:g,ns:d}):e;v=b(v);try{if(p&&m&&y)for(const e of c.formatters)v=e.format({translation:v,language:m,params:g});c.finalFormatter&&p&&m&&y&&(v=c.finalFormatter.format({translation:v,language:m,params:g}))}catch(e){console.error(e);const n=("string"==typeof(E=e)?E:"string"==typeof(null==E?void 0:E.message)?E.message:void 0)||F,a=t().onFormatError,r=typeof a;v="string"===r?a:"function"===r?a(n,o):F,v=b(v)}var E;return v}});return N}const M=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const B=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:r,language:o}=e,i=S(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:o};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function K({options:e}){const t=function(){let e=!0;function t(){return e}const n=Object.freeze({onPendingLanguageChange:A("pendingLanguage",t),onLanguageChange:A("language",t),onLoadingChange:A("loading",t),onFetchingChange:A("fetching",t),onInitialLoaded:A("initialLoad",t),onRunningChange:A("running",t),onCacheChange:A("cache",t),onPermanentChange:A("permanentChange",t),onError:A("error",t),onUpdate:T(t),setEmitterActive(t){e=t},on:(e,t)=>{switch(e){case"pendingLanguage":return n.onPendingLanguageChange.listen(t);case"language":return n.onLanguageChange.listen(t);case"loading":return n.onLoadingChange.listen(t);case"fetching":return n.onFetchingChange.listen(t);case"initialLoad":return n.onInitialLoaded.listen(t);case"running":return n.onRunningChange.listen(t);case"cache":return n.onCacheChange.listen(t);case"update":return n.onUpdate.listen(t);case"permanentChange":return n.onPermanentChange.listen(t);case"error":return n.onError.listen(t)}}});return n.onInitialLoaded.listen((e=>n.onUpdate.emit(e,!1))),n.onLanguageChange.listen((e=>n.onUpdate.emit(e,!1))),n.onCacheChange.listen((e=>n.onUpdate.emit(e,!0))),n}(),n=M(!1,(()=>i.isFetching()),t.onFetchingChange.emit),a=M(!1,(()=>k.isLoading()),t.onLoadingChange.emit),r=function(e,t,n){let a,r=U();const o=Object.freeze({init(e){r=U(e,r)},isRunning:()=>r.isRunning,setRunning(e){r.isRunning!==e&&(r.isRunning=e,n.emit(e))},isInitialLoading:()=>r.isInitialLoading,isCacheDisabled:()=>r.initialOptions.disableCache,setInitialLoading(e){r.isInitialLoading=e},getLanguage:()=>r.language||r.initialOptions.language,setLanguage(t){r.language!==t&&(r.language=t,e.emit(t))},getPendingLanguage:()=>r.pendingLanguage||o.getLanguage(),setPendingLanguage(e){r.pendingLanguage!==e&&(r.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},r.initialOptions),a),addActiveNs(e){y(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t?r.activeNamespaces.set(e,t+1):r.activeNamespaces.set(e,1)}))},removeActiveNs(e){y(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t&&t>1?r.activeNamespaces.set(e,t-1):r.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>E([o.getDefaultNs(),...r.initialOptions.ns||[],...y(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||o.getLanguage();return t?E([t,...b(t,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>y(r.initialOptions.fallbackNs),getNs(){var e,t;return(null===(e=r.initialOptions.ns)||void 0===e?void 0:e.length)?r.initialOptions.ns:[null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:""]},getDefaultNs(e){var t,n,a;return void 0===e?null!==(a=null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:null===(n=r.initialOptions.ns)||void 0===n?void 0:n[0])&&void 0!==a?a:"":e},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const e=Object.keys(r.initialOptions.staticData).map((e=>C(e).language));return Array.from(new Set(e))}},getAvailableNs:()=>r.initialOptions.availableNs,withDefaultNs:e=>({namespace:void 0===e.namespace?o.getDefaultNs():e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:L(e.apiUrl)}):void 0}});return o}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),o=$(r.getLanguage,r.getInitialOptions,r.getAvailableLanguages,c,m,w,g,t),i=D(t,o.getBackendRecord,o.getBackendDevRecord,r.withDefaultNs,r.isInitialLoading,r.isCacheDisabled,n,a);let s;function l(e){return r.getDefaultNs(e)}function c(e){return E([...y(l(e)),...r.getFallbackNs()])}function u(e){return E([...y(null!=e?e:l()),...r.getRequiredNamespaces()])}function g(e,t,n){const a=r.withDefaultNs(e),o=i.getTranslation(a,t);return i.changeTranslation(a,t,n),{revert(){i.changeTranslation(a,t,o)}}}function d(e){r.init(e),i.addStaticData(r.getInitialOptions().staticData)}function h(e,t){const n=r.getFallbackLangs(e),a=u(t),o=[];return n.forEach((e=>{a.forEach((t=>{o.push({language:e,namespace:t})}))})),o}function m({key:e,ns:t}){const n=r.getFallbackLangs(),a=c(null!=t?t:void 0);return i.getTranslationNs(a,n,e)}function w({key:e,ns:t,language:n}){const a=c(null!=t?t:void 0),o=r.getFallbackLangs(n);return i.getTranslationFallback(a,o,e)}function O(){const e=p(N(),(()=>{const e=h(t,n).filter((e=>!i.exists(e,!0)));var t,n;if(e.length&&r.getInitialOptions().autoLoadRequiredData)return i.loadRecords(e,{useCache:!0})}));if(f(e))return r.setInitialLoading(!0),n.notify(),a.notify(),Promise.resolve(e).then((()=>{r.setInitialLoading(!1),n.notify(),a.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}function N(){if(r.getLanguage())return;return p(o.getInitialLanguage(),(e=>{const t=e||r.getInitialOptions().defaultLanguage;t&&r.setLanguage(t)}))}e&&d(e),t.onUpdate.listen((()=>{r.isRunning()&&o.retranslate()}));const k=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),r),o),i),{init:d,getTranslation:w,changeTranslation:g,getTranslationNs:m,getDefaultAndFallbackNs:c,findPositions:o.findPositions,getRequiredDescriptors:h,async changeLanguage(e){r.getPendingLanguage()===e&&r.getLanguage()===e||(r.setPendingLanguage(e),r.isRunning()&&r.getInitialOptions().autoLoadRequiredData&&await i.loadRecords(h(e),{useCache:!0}),e===r.getPendingLanguage()&&(r.setLanguage(e),await o.setStoredLanguage(e)))},async addActiveNs(e,t){t||r.addActiveNs(e),r.isRunning()&&await i.loadRecords(h(void 0,e),{useCache:!0})},async loadRecord(e,t){var n;return null===(n=(await k.loadRecords([e],t))[0])||void 0===n?void 0:n.data},isLoading:e=>i.isLoading(r.getLanguage(),e),isLoaded(e){const t=r.getLanguage();if(!t)return!1;const n=r.getFallbackLangs(t),a=u(e),o=[];return n.forEach((e=>{a.forEach((t=>{i.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=B(...e),n=w(t);return o.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(r.getInitialOptions().apiKey&&r.getInitialOptions().apiUrl),async loadRequired(e){(null==e?void 0:e.language)||await N();const t=h(null==e?void 0:e.language);return k.loadRecords(t,e)},async loadMatrix(e){const t=function(e){let t=[],n=[];if(Array.isArray(e.languages))t=e.languages;else if("all"===e.languages){const e=k.getAvailableLanguages();if(!e)throw new Error(v("availableLanguages"));t=e}if(Array.isArray(e.namespaces))n=e.namespaces;else if("all"===e.namespaces){const e=k.getAvailableNs();if(!e)throw new Error(v("availableNs"));n=e}const a=[];return t.forEach((e=>{n.forEach((t=>{a.push({language:e,namespace:t})}))})),a}(e);return k.loadRecords(t,e)},run:()=>(function(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!r.getAvailableLanguages())throw new Error(v("availableLanguages"));if(!r.getLanguage()&&!r.getInitialOptions().defaultLanguage)throw new Error(v(["defaultLanguage","language"]))}(),r.isRunning()||(r.setRunning(!0),o.run(),s=O()),Promise.resolve(s)),stop(){r.isRunning()&&(o.stop(),r.setRunning(!1))}}));return k}const V=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=_(e.options,n),t),init(t){const n=function(e){const t=K({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRequired:t.loadRequired,loadMatrix:t.loadMatrix,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,getRequiredDescriptors:t.getRequiredDescriptors,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,findPositions:t.findPositions,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(_(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},z=0,W=1,G=2;class Y extends Error{constructor(e,t,n){let a,r="";e===z?a="Empty parameter":e===W?(a="Unexpected character",r="Did you forget to use FormatIcu to render ICU message syntax?"):a="Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`+(r?"\n"+r:"")),this.code=e,this.index=t}}function H(e){return/\s/.test(e)}const q=0,X=1,J=2,Z=3,Q=4,ee=new Set([J,X,q]),te="'",ne=new Set(["{","}",te]),ae=e=>/[0-9a-zA-Z_]/.test(e);function re(e,t){const[n,a]=function(e){let t=q,n="",a="",r="";const o=[],i=[];let s=0;function l(t){throw new Y(t,s,e)}const c=()=>{o.push(n),n=""},u=()=>{""===a&&l(z),i.push(a),a=""};for(s=0;s<e.length;s++)switch(r=e[s],t){case q:r===te?(n+=r,t=X):"{"===r?(c(),t=Z):(n+=r,t=q);break;case X:ne.has(r)?(n=n.slice(0,-1)+r,t=J):(n+=r,t=q);break;case J:r===te?t=q:(n+=r,t=J);break;case Z:"}"===r?(u(),t=q):H(r)?""!==a&&(u(),t=Q):(ae(r)||l(W),a+=r,t=Z);break;case Q:"}"==r?t=q:H(r)?t=Q:l(W)}return ee.has(t)||l(G),c(),[o,i]}(e),r=[n[0]];for(let o=1;o<n.length;o++){const i=null==t?void 0:t[a[o-1]];if(void 0===i)throw new Error(`Missing parameter "${a[o-1]}" in "${e}"`);r.push(String(i)),r.push(n[o])}return r.join("")}const oe="__tolgee_dev_tools",ie="data-tolgee-key-only",se="data-tolgee-restricted",le="_tolgee",ce="_tolgee-highlighter";function ue(){var e,t;return void 0===(null==(t=null==(e=globalThis.window)?void 0:e.document)?void 0:t.createElement)}function ge(e){if(ue())throw new Error(`${e}: Can't run on the server`)}function de(e,t){return{oldTextContent:e,keys:t}}function fe(e){return e.textContent}function pe(e,t){e.textContent=t}function he(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,r=void 0===e.ns||void 0===t.ns||-1!==(null==(n=e.ns)?void 0:n.findIndex((e=>{var n;return null==(n=t.ns)?void 0:n.includes(e)})));return a&&r}const ve={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function me({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;const r=function(e){for(;e;){if(null!==e.getAttribute("disabled"))return!1;e=e.parentElement}return!0}(n);let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(ce),Object.entries(ve).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const i=n.getBoundingClientRect();o.style.pointerEvents=r?"none":"auto",o.style.borderWidth=t+"px",o.style.top=i.top-t+"px",o.style.left=i.left-t+"px",o.style.width=i.width+"px",o.style.height=i.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null==(e=t.highlightEl)||e.remove(),t.highlightEl=void 0}}(0,a)}})}const ye={capture:!0},be={capture:!0,passive:!0},Ee=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function Le({highlightKeys:e,elementStore:t,onClick:n,options:a}){var r,o;const i=new Set;let s,l,c=[];const u=(null==(r=a.targetElement)?void 0:r.getRootNode())||document,g=(null==(o=a.targetElement)?void 0:o.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null==(e=n.unhighlight)||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=O(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null==(n=a.highlight)||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of Ee.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(O(t,(e=>e.id===oe))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null==(e=null==n?void 0:n.highlight)||e.call(n)}function L(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(s),d())}function w(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function O(e,t){return e.id===oe?null:t(e)?e:(null==e?void 0:e.parentElement)?O(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){w("keydown",y,ye),w("keyup",b,ye),w("mousemove",m,be),w("scroll",E,be),w("click",L,ye),w("mouseenter",v,ye),w("mouseover",v,ye),w("mouseout",v,ye),w("mouseleave",v,ye),w("mousedown",v,ye),w("mouseup",v,ye)}})}function we(e,t,n){const a=me({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=Le({highlightKeys:e.highlightKeys,elementStore:t,onClick(e){const a=t.get(e);n({target:e,keysAndDefaults:s(a)})},options:e});function o(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${se}]`)}function i(e,n){var a;n.highlightEl&&(null==(a=n.unhighlight)||a.call(n)),e.removeAttribute(le),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({isRestricted:o,register(e,n,r){if(o(e))return;const i=e;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(le,"true")),s.nodes.set(n,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===ie&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>he({key:e,ns:m(n)},{key:t.key,ns:m(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null==(n=t.unhighlight)||n.call(t))}))}})}function Oe(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:r,onClick:o}){if(ue())return{stop(){t=!1},wrapper:r};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var r,o;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!=(r=s[e.tagName.toUpperCase()])?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null==(t=s[e.tagName.toUpperCase()])?void 0:t.some((t=>e.hasAttribute(t))))||(null==(n=s["*"])?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!=(o=s[n.tagName.toUpperCase()])?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,r),l=we(a,n,o);function c(e){for(const t of e){const e=t.parentElement;if(e&&l.isRestricted(e))continue;const n=fe(t),a=n?r.unwrap(n):null;if(a){const{text:e,keys:r}=a;pe(t,e);const o=de(n,r),s=i.getSuitableParent(t);l.register(s,t,o)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:fe(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===ie)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(ie);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(ie)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(ie))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===ie))&&l.cleanupLingeringKeyAttributes();const r=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>r.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>r.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>r.delete(e)));break;case"attributes":t.attributeName===ie&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>r.add(e)))}c([...r])})),f=a.targetElement||document;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(ie),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:r}}return Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null==(a=null==(n=null==e?void 0:e.elementRegistry)?void 0:n.forEachElement)||a.call(n,t)},highlight(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[];return r.forEach((e=>{var t;return null==(t=e.highlight)?void 0:t.call(e)})),{unhighlight(){r.forEach((e=>{var t;return null==(t=e.unhighlight)?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[],o=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{he({key:t,ns:m(n)},{key:e.key,ns:m(e.ns)})&&o.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),o},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""})}var Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Te={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),r=[],o=0;;){var i=t<e.length;if(!i||o>=n-1){var s=a.subarray(0,o);if(r.push(String.fromCharCode.apply(null,s)),!i)return r.join("");e=e.subarray(t),t=0,o=0}var l=e[t++];if(0==(128&l))a[o++]=l;else if(192==(224&l)){var c=63&e[t++];a[o++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[o++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[o++]=g>>>10&1023|55296,g=56320|1023&g),a[o++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},r="function"==typeof Buffer&&Buffer.from,o=r?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>o.length){r+=8,r=(r*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(r);l.set(o),o=l}if(0!=(4294967168&i)){if(0==(4294965248&i))o[a++]=i>>>6&31|192;else if(0==(4294901760&i))o[a++]=i>>>12&15|224,o[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;o[a++]=i>>>18&7|240,o[a++]=i>>>12&63|128,o[a++]=i>>>6&63|128}o[a++]=63&i|128}else o[a++]=i}return o.slice?o.slice(0,a):o.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),o(e)};var s=!r&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;r?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(r?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:Ae);const Ne=d({__proto__:null,default:Te},[Te]);null==(t=console.assert)||t.call(console,Ne);const ke=["",""],je=RegExp(`([${ke.join("")}]{9})+`,"gu");function Re(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>ke[Number(e)])).join("")}function xe(e){const t=Array.from(e).map((e=>ke.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function Ce({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}function a(e){return Re(e+"\n")}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null==(t=e.match(je))?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(xe))||[]}(e);a.forEach((e=>{const a=function(e){return e.split("\n").filter((e=>e.length)).map((e=>{if("{"===e[0])return e;{const n=Number(e);return t.numberToValue(n)}}))}(e);a.forEach((e=>{const t=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(e);if(t){const{k:e,d:a,n:r}=t;n.push({key:e,defaultValue:a,ns:r})}}))}));const r=function(e){return e.replace(je,"")}(e);return{text:r,keys:n}},wrap({key:r,defaultValue:o,translation:i,ns:s}){let l;if(e){l=a(n({key:r,ns:s}))}else{const e=n({key:r,ns:s,defaultValue:o}),i=t.valueToNumber(e);l=a(String(i))}const c=i||"";return"string"==typeof c?c+l:c},testTextNode(e){var t,n,a;return null!=(a=(null==(t=e.textContent)?void 0:t.includes(`${ke[0]}${ke[0]}`))||(null==(n=e.textContent)?void 0:n.includes(`${ke[1]}${ke[0]}`)))&&a},testAttribute:e=>e.value.includes(`${ke[0]}${ke[0]}`)||e.value.includes(`${ke[1]}${ke[0]}`)})}function Pe(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function De({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:r,ns:o}=function(e){let t=!1,n="",a="",r="KEY";const o={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{o.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==r||","!==s?"KEY"!==r||"|"!==s?"NAMESPACE"!==r||","!==s?"KEY"!==r||":"!==s?"DEFAULT_VALUE"!==r||":"!==s?"PARAM_NAME"!==r||":"!==s?"PARAM_VALUE"!==r||","!==s?n+=s:(r="PARAM_NAME",o.params[a]=n,n=""):(r="PARAM_VALUE",a=n,n=""):(r="PARAM_NAME",o.defaultValue=n,n=""):(r="PARAM_NAME",o.key=n,n=""):(r="DEFAULT_VALUE",i(n),n=""):(r="NAMESPACE",o.key=n,n=""):(r="DEFAULT_VALUE",o.key=n,n=""):t=!0;return"KEY"===r&&(o.key=n),"DEFAULT_VALUE"===r&&(o.defaultValue=n),"PARAM_VALUE"===r&&(o.params[a]=n),"NAMESPACE"===r&&i(n),o}(e);return{translated:n({key:t,params:a,defaultValue:r,ns:o,noWrap:!0}),key:t,params:a,defaultValue:r,ns:o}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){return"string"==typeof e?e.replace(new RegExp("[,:|\\\\]","gs"),"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:r,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${o(e)}:${o(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==r?`,${o(r)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>o(e))).join("|")}`:"";return`${e}${o(n)}${u}${l}${s}${t}`},unwrap(n){const o=new RegExp(`(\\\\?)(${r(e)}(.*?)${r(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=o.exec(n));){let e=s[1];const[t,r,o,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!Pe(d,n)){u+=o;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,r,o;return null!=(o=(null==(a=n.textContent)?void 0:a.includes(e))&&(null==(r=n.textContent)?void 0:r.includes(t)))&&o},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Se="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Fe(e){const t=Se.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Ie(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,r=0;const o=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Fe(e[i]),n+=5,n>=8&&(o[r++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",r=Math.pow(2,16)-1;for(let e=0;e<n;e+=r)e+r>n&&(r=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+r));return a}(o.buffer)}function _e(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Ie(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Ue(...e){const t="undefined"==typeof window?void 0:window.location.origin;return new URL(function(...e){let t=e[0];return e.slice(1).forEach((e=>{var n;n=e,t=`${t.replace(/\/+$/,"")}/${n=n.replace(/^\/+/,"")}`})),t}(...e),t)}function $e({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:r=300}){let o=!1;const i=()=>new Promise(((a,o)=>{const i=function(e,t){const n=n=>{var a,r;e.includes(null==(a=n.data)?void 0:a.type)&&t(null==(r=n.data)?void 0:r.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),o()}),r);function l(){i.unsubscribe()}}));return{cancel(){o=!0},promise:(async()=>{for(let e=0;e<a;e++){if(o)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!o)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}let Me=null;function Be(e){var t;return Me||(Me=(t=`https://cdn.jsdelivr.net/npm/@tolgee/web@${e}/dist/tolgee-in-context-tools.umd.min.js`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window["@tolgee/in-context-tools"].InContextTools))),Me}const Ke="__tolgee_apiKey",Ve="__tolgee_apiUrl";function ze(){const e=sessionStorage.getItem(Ke)||void 0,t=sessionStorage.getItem(Ve)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function We(){sessionStorage.removeItem(Ke),sessionStorage.removeItem(Ve)}e.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(e.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=$e({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(We)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return ze()&&(async()=>{const e=await Be("prerelease");return t=>{const n=ze();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Ge="__tolgee_currentLanguage";function Ye(e,t){const n=t.find((t=>t===e));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),r=a(e),o=t.find((e=>a(e)===r));return o||void 0}function He(e){return e.endsWith("/")?e.slice(0,-1):e}const qe={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${He(n)}/${e}/${t}.json`:`${He(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"},timeout:void 0,fallbackOnFail:!1};function Xe(e){const t=u(c(c({},qe),e),{headers:c(c({},qe.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:r,headers:o,timeout:i,fallbackOnFail:s}=t,l=g(t,["prefix","getPath","getData","headers","timeout","fallbackOnFail"]);return{async getRecord({namespace:e,language:t,fetch:u}){const d=a({namespace:e,language:t,prefix:n});try{const e=await((e,t,n,a)=>{var r=a,{signal:o}=r,i=g(r,["signal"]);const s=new AbortController;return new Promise(((a,r)=>{const l=e(t,c({signal:s.signal},i));let u=!1;function g(e){!u&&r(e),u=!0}function d(){const e=new Error(`TIMEOUT: ${t}`);s.abort(e),g(e)}if(o&&o.addEventListener("abort",d),void 0!==n){const e=setTimeout(d,n);l.finally((()=>clearTimeout(e)))}l.catch(g).then((function(e){!u&&a(e),u=!0}))}))})(u,d,i,c({headers:o},l));if(!e.ok)throw new Error(`${e.url} ${e.status}`);return await r(e)}catch(e){if(s)return;throw e}}}}e.BackendFetch=e=>(t,n)=>(n.addBackend(Xe(e)),t),e.DEVTOOLS_ID=oe,e.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:r,filterTag:o,fetch:i}){var s;const l=null!=(s=_e(t))?s:r;let c;if(c=Ue(e,void 0!==l?`/v2/projects/${l}/translations/${n}`:`/v2/projects/translations/${n}`),a&&c.searchParams.append("ns",a),null==o||o.forEach((e=>{c.searchParams.append("filterTag",e)})),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===r)throw new Error("You need to specify 'projectId' when using PAT key");return i(c.toString(),{headers:{"X-API-Key":t||"","Content-Type":"application/json"},next:{revalidate:0}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),e.DevTools=()=>e=>e,e.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>re(e,t)}),e),e.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage:({availableLanguages:e})=>(ge("LanguageDetector"),Ye(window.navigator.language,e))}),e),e.LanguageDetectorError=k,e.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(ge("LanguageStorage"),localStorage.getItem(Ge)||void 0),setLanguage(e){ge("LanguageStorage"),localStorage.setItem(Ge,e)}}),e),e.LanguageStorageError=j,e.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=Oe();return Object.freeze(u(c({},e),{run(t){const n=De({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(u(c({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&pe(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=Oe();return Object.freeze(u(c({},e),{run(t){const n=Ce({fullKeyEncode:t.options.fullKeyEncode});e.run(u(c({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),e.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",e.RecordFetchError=N,e.TOLGEE_ATTRIBUTE_NAME=le,e.TOLGEE_RESTRICT_ATTRIBUTE=se,e.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=ie,e.Tolgee=function(){return V().use(e.BrowserExtensionPlugin())},e.TolgeeCore=V,e.createFetchFunction=O,e.detectLanguage=Ye,e.detectLanguageFromHeaders=(e,t)=>{const n=function(e){const t=e.get("Accept-Language");if(!t)return[];const n=t.split(",").map((e=>{const[t]=e.trim().split(";");return t}));return[...new Set(n.filter((e=>e&&"*"!==e)))]}(e);return n[0]&&Ye(n[0],t)},e.getFallback=m,e.getFallbackArray=y,e.getProjectIdFromApiKey=_e,e.getTranslateProps=B,e.isSSR=ue,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/web"]={})}(this,(function(e){"use strict";var t,n=Object.defineProperty,a=Object.defineProperties,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,t,a)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&l(e,n,t[n]);if(o)for(var n of o(t))s.call(t,n)&&l(e,n,t[n]);return e},u=(e,t)=>a(e,r(t)),g=(e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&s.call(e,a)&&(n[a]=e[a]);return n};function d(e,t){for(var n=0;n<t.length;n++){const a=t[n];if("string"!=typeof a&&!Array.isArray(a))for(const t in a)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(a,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function f(e){return Boolean(e&&"function"==typeof e.then)}function p(e,t){return f(e)?Promise.resolve(e).then(t):t(e)}function h(e,t,n){function a(n){const a=t(n);throw e.emit(a),console.error(a),a}try{const e=n();return f(e)?e.catch(a):e}catch(e){a(e)}}function v(e){const t=(Array.isArray(e)?e:[e]).map((e=>`'${e}'`)),n=t.slice(-2).join(" or ");return`Tolgee: You need to specify ${[...t.slice(0,-2),n].join(", ")} option`}function m(e){return"string"==typeof e?[e]:Array.isArray(e)?e:void 0}function y(e){return m(e)||[]}function b(e,t){return"object"!=typeof(n=t)||Array.isArray(n)||null===n?y(t):y(null==t?void 0:t[e]);var n}function E(e){return Array.from(new Set(e))}function L(e){return e?e.replace(/\/+$/,""):e}const w=(e,t)=>fetch(e,t);const O=(e=w)=>(t,n)=>{let a=(r=null==n?void 0:n.headers,Object.fromEntries(new Headers(r).entries()));var r;return a["x-api-key"]&&(a=Object.assign({"x-tolgee-sdk-type":"JS","x-tolgee-sdk-version":"prerelease"},a)),e(t,Object.assign(Object.assign({},n),{headers:a}))},A=(e,t)=>{let n=[];return{listen(e){const t=t=>{e(t)};return n.push(t),{unsubscribe(){n=n.filter((e=>t!==e))}}},emit(a){t()&&n.forEach((t=>t({type:e,value:a})))}}};function T(e){let t=[],n=[];function a(){if(0===n.length)return;const e=n;n=[],t.forEach((t=>{t(e)}))}return Object.freeze({listen(e){const n=t=>{e(t)};return t.push(n),{unsubscribe(){t=t.filter((e=>n!==e))}}},emit(t,r){e()&&e()&&(n.push(t),r?setTimeout(a,0):a())}})}class N extends Error{constructor(e,t,n=!1){const{language:a,namespace:r}=e;super(`Tolgee: Failed to fetch record for "${a}"${r&&` and "${r}"`}`),this.cause=t,this.isDev=n,this.name="RecordFetchError",this.language=a,this.namespace=r}}class k extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageDetectorError"}}class j extends Error{constructor(e,t){super(e),this.cause=t,this.name="LanguageStorageError"}}const R=e=>{const t=new Map;return Object.entries(e).forEach((([e,n])=>{null!=n&&("object"!=typeof n?t.set(e,n):R(n).forEach(((n,a)=>{t.set(e+"."+a,n)})))})),t},x=e=>Object.fromEntries(R(e).entries()),C=e=>{const[t,...n]=e.split(":");return{language:t,namespace:n.join(":")||""}},P=({language:e,namespace:t})=>t?`${e}:${t}`:e;function D(e,t,n,a,r,o,i){const s=new Map,l=new Map;let c={},u=0;function g(t,n,a){const r=P(t);l.set(r,{data:x(n),version:a}),e.onCacheChange.emit(C(r))}async function d(a,r){let o;if(r)try{o=await n(a)}catch(t){const n=new N(a,t,!0);e.onError.emit(n),console.warn(n)}return o||(o=await async function(n){function a(t){const a=new N(n,t);throw e.onError.emit(a),console.error(a),a}const r=t(n);if(f(r)){const e=await r.catch(a);if(void 0!==e)return e}const o=c[P(n)];if("function"!=typeof o)return o;try{return await o()}catch(e){a(e)}}(a)),o}const p=Object.freeze({addStaticData(e){if(Array.isArray(e))for(const t of e){const e=P(t),n=l.get(e);n&&0!==n.version||g(t,x(t.data),0)}else e&&(c=Object.assign(Object.assign({},c),e),Object.entries(e).forEach((([e,t])=>{if("function"!=typeof t){const n=C(e),a=l.get(e);a&&0!==a.version||g(n,x(t),0)}})))},invalidate(){s.clear(),u+=1},addRecord(e,t){g(e,x(t),u)},exists(e,t=!1){const n=l.get(P(e));return n&&t?n.version===u:Boolean(n)},getRecord(e){const t=a(e),n=P(t),r=l.get(n);if(r)return Object.assign(Object.assign({},t),{cacheKey:n,data:r.data})},getAllRecords:()=>Array.from(l.entries()).map((([e])=>p.getRecord(C(e)))),getTranslation(e,t){var n;return null===(n=l.get(P(e)))||void 0===n?void 0:n.data[t]},getTranslationNs(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=l.get(P({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return[r]}return E(e)},getTranslationFallback(e,t,n){var a;for(const r of e)for(const e of t){const t=null===(a=l.get(P({language:e,namespace:r})))||void 0===a?void 0:a.data[n];if(null!=t)return t}},changeTranslation(t,n,a){var r;const o=null===(r=l.get(P(t)))||void 0===r?void 0:r.data;(null==o?void 0:o[n])&&(o[n]=a,e.onCacheChange.emit(Object.assign(Object.assign({},t),{key:n})))},isFetching(e){if(r())return!0;if(void 0===e)return s.size>0;const t=y(e);return Boolean(Array.from(s.keys()).find((e=>t.includes(C(e).namespace))))},isLoading(e,t){const n=y(t);if(r())return!0;const a=Array.from(s.keys());return Boolean(a.find((t=>{const a=C(t);return(!n.length||n.includes(a.namespace))&&!p.exists({namespace:a.namespace,language:e})})))},async loadRecords(e,t){const n=e.map((e=>{const n=a(e),r=P(n);if(null==t?void 0:t.useCache){if(p.exists(n,!0))return Object.assign(Object.assign({},n),{new:!1,cacheKey:r,data:p.getRecord(n).data})}const o=s.get(r);if(o)return Object.assign(Object.assign({},n),{new:!1,promise:o,cacheKey:r});const i=d(n,!(null==t?void 0:t.noDev))||Promise.resolve(void 0);return s.set(r,i),Object.assign(Object.assign({},n),{new:!0,promise:i,cacheKey:r})}));o.notify(),i.notify();const r=n.map((e=>e.promise)).filter(Boolean),l=await Promise.all(r);return n.forEach((e=>{var t;e.promise&&(e.data=x(null!==(t=l[0])&&void 0!==t?t:{}),l.shift());const n=s.get(e.cacheKey)!==e.promise;e.new&&!n&&(s.delete(e.cacheKey),e.data?p.addRecord(e,e.data):p.getRecord(e)||p.addRecord(e,{}))})),o.notify(),i.notify(),n.map((e=>{var t;return{language:e.language,namespace:e.namespace,data:null!==(t=e.data)&&void 0!==t?t:{},cacheKey:e.cacheKey}}))}});return p}function S(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n}const F="invalid",I={observerOptions:{tagAttributes:{textarea:["placeholder"],input:["value","placeholder"],img:["alt"],"*":["aria-label","title"]},restrictedElements:["script","style"],highlightKeys:["Alt"],highlightColor:"rgb(255, 0, 0)",highlightWidth:5,inputPrefix:"%-%tolgee:",inputSuffix:"%-%",passToParent:["option","optgroup"],fullKeyEncode:!1},observerType:"invisible",onFormatError:F,apiUrl:"https://app.tolgee.io",autoLoadRequiredData:!0,fetch:O(),onTranslationMissing:({key:e})=>e},_=(...e)=>{let t={};return e.forEach((e=>{t=Object.assign(Object.assign(Object.assign({},t),e),{observerOptions:Object.assign(Object.assign({},t.observerOptions),null==e?void 0:e.observerOptions)})})),t};function U(e,t){const n=_(I,null==t?void 0:t.initialOptions,e);return n.apiUrl=L(n.apiUrl),(null==e?void 0:e.fetch)&&(n.fetch=O(e.fetch)),{initialOptions:n,activeNamespaces:(null==t?void 0:t.activeNamespaces)||new Map,language:null==t?void 0:t.language,pendingLanguage:null==t?void 0:t.language,isInitialLoading:!1,isRunning:!1}}function $(e,t,n,a,r,o,i,s){const l={ui:void 0},c={formatters:[],finalFormatter:void 0,observer:void 0,devBackend:void 0,backends:[],ui:void 0,languageDetector:void 0,languageStorage:void 0},u=async({keysAndDefaults:e,target:t})=>{var n;const i=e.map((({key:e,ns:t,defaultValue:n})=>({key:e,defaultValue:n,fallbackNamespaces:a(t),namespace:r({key:e,ns:t})[0],translation:o({key:e,ns:t})})));null===(n=c.ui)||void 0===n||n.handleElementClick(i,t)},g=(e,t)=>{var n;return(null===(n=c.observer)||void 0===n?void 0:n.findPositions(e,t))||[]};function d(e){const t=o({key:e.key,ns:e.ns});return N.formatTranslation(Object.assign(Object.assign({},e),{translation:t,formatEnabled:!0}))}function f(){return{fetch:t().fetch}}function v(e){c.observer=null==e?void 0:e()}function m(){return Boolean(c.observer)}function y(e){e&&c.formatters.push(e)}function b(e){c.finalFormatter=e}function E(e){l.ui=e}function L(){return Boolean(l.ui)}function w(e){c.languageStorage=e}function O(e){c.languageDetector=e}function A(e){e&&c.backends.push(e)}function T(e){c.devBackend=e}const N=Object.freeze({addPlugin:function(e,t){t(e,Object.freeze({setFinalFormatter:b,addFormatter:y,setObserver:v,hasObserver:m,setUi:E,hasUi:L,setDevBackend:T,addBackend:A,setLanguageDetector:O,setLanguageStorage:w}))},findPositions:g,run(){var e,n;const{apiKey:a,apiUrl:r,projectId:o,observerOptions:f,tagNewKeys:p,filterTag:h}=t();c.ui=null===(e=l.ui)||void 0===e?void 0:e.call(l,{apiKey:a,apiUrl:r,projectId:o,highlight:N.highlight,changeTranslation:i,findPositions:g,onPermanentChange:e=>s.onPermanentChange.emit(e),tagNewKeys:p,filterTag:h}),null===(n=c.observer)||void 0===n||n.run({mouseHighlight:!0,options:f,translate:d,onClick:u})},stop(){var e;c.ui=void 0,null===(e=c.observer)||void 0===e||e.stop()},getLanguageStorage:()=>c.languageStorage,getInitialLanguage(){const e=n();return p(h(s.onError,(e=>new j("Tolgee: Failed to load language",e)),(()=>{var e;return null===(e=c.languageStorage)||void 0===e?void 0:e.getLanguage(f())})),(t=>e&&!e.includes(t)||!t?function(){if(!c.languageDetector)return;const e=n();return h(s.onError,(e=>new k("Tolgee: Failed to detect language",e)),(()=>{var t;return null===(t=c.languageDetector)||void 0===t?void 0:t.getLanguage(Object.assign({availableLanguages:e},f()))}))}():t))},setStoredLanguage:e=>h(s.onError,(e=>new j("Tolgee: Failed to store language",e)),(()=>{var t;return null===(t=c.languageStorage)||void 0===t?void 0:t.setLanguage(e,f())})),getDevBackend:()=>c.devBackend,getBackendRecord:async({language:e,namespace:t})=>{for(const n of c.backends){const a=await n.getRecord(Object.assign({language:e,namespace:t},f()));if(void 0!==a)return a}},getBackendDevRecord:async({language:e,namespace:n})=>{var a;const{apiKey:r,apiUrl:o,projectId:i,filterTag:s}=t();if(r&&o&&N.hasDevBackend())return null===(a=c.devBackend)||void 0===a?void 0:a.getRecord(Object.assign({apiKey:r,apiUrl:o,projectId:i,language:e,namespace:n,filterTag:s},f()))},getLanguageDetector:()=>c.languageDetector,retranslate(){var e;null===(e=c.observer)||void 0===e||e.retranslate()},highlight:(e,t)=>{var n,a;return(null===(a=null===(n=c.observer)||void 0===n?void 0:n.highlight)||void 0===a?void 0:a.call(n,e,t))||{unhighlight(){}}},unwrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.unwrap(e):{text:e,keys:[]}},wrap(e){var t;return c.observer?null===(t=c.observer)||void 0===t?void 0:t.wrap(e):e.translation},hasDevBackend:()=>Boolean(N.getDevBackend()),formatTranslation(n){var a,{formatEnabled:r}=n,o=S(n,["formatEnabled"]);const{key:i,translation:s,defaultValue:l,noWrap:u,params:g,ns:d,orEmpty:f}=o,p=null!=s?s:l;let h="";null==s&&(h=t().onTranslationMissing(o));let v=null!=p?p:f?"":h;const m=e(),y=r||!(null===(a=c.observer)||void 0===a?void 0:a.outputNotFormattable),b=e=>c.observer&&!u?c.observer.wrap({key:i,translation:e,defaultValue:l,params:g,ns:d}):e;v=b(v);try{if(p&&m&&y)for(const e of c.formatters)v=e.format({translation:v,language:m,params:g});c.finalFormatter&&p&&m&&y&&(v=c.finalFormatter.format({translation:v,language:m,params:g}))}catch(e){console.error(e);const n=("string"==typeof(E=e)?E:"string"==typeof(null==E?void 0:E.message)?E.message:void 0)||F,a=t().onFormatError,r=typeof a;v="string"===r?a:"function"===r?a(n,o):F,v=b(v)}var E;return v}});return N}const M=(e,t,n)=>{let a=e;return Object.freeze({init(e){a=e},notify(){const e=t();a!==e&&n(e),a=e}})};const B=(e,...t)=>{let n,a={};return"object"==typeof e?a=e:(a.key=e,"string"==typeof t[0]?(a.defaultValue=t[0],n=t[1]):"object"==typeof t[0]&&(n=t[0])),n&&(a=Object.assign(Object.assign({},function(e){var{ns:t,noWrap:n,orEmpty:a,params:r,language:o}=e,i=S(e,["ns","noWrap","orEmpty","params","language"]);const s={ns:t,noWrap:n,orEmpty:a,language:o};return Object.assign(Object.assign({},s),{params:Object.assign({},i)})}(n)),a)),a};function K({options:e}){const t=function(){let e=!0;function t(){return e}const n=Object.freeze({onPendingLanguageChange:A("pendingLanguage",t),onLanguageChange:A("language",t),onLoadingChange:A("loading",t),onFetchingChange:A("fetching",t),onInitialLoaded:A("initialLoad",t),onRunningChange:A("running",t),onCacheChange:A("cache",t),onPermanentChange:A("permanentChange",t),onError:A("error",t),onUpdate:T(t),setEmitterActive(t){e=t},on:(e,t)=>{switch(e){case"pendingLanguage":return n.onPendingLanguageChange.listen(t);case"language":return n.onLanguageChange.listen(t);case"loading":return n.onLoadingChange.listen(t);case"fetching":return n.onFetchingChange.listen(t);case"initialLoad":return n.onInitialLoaded.listen(t);case"running":return n.onRunningChange.listen(t);case"cache":return n.onCacheChange.listen(t);case"update":return n.onUpdate.listen(t);case"permanentChange":return n.onPermanentChange.listen(t);case"error":return n.onError.listen(t)}}});return n.onInitialLoaded.listen((e=>n.onUpdate.emit(e,!1))),n.onLanguageChange.listen((e=>n.onUpdate.emit(e,!1))),n.onCacheChange.listen((e=>n.onUpdate.emit(e,!0))),n}(),n=M(!1,(()=>i.isFetching()),t.onFetchingChange.emit),a=M(!1,(()=>k.isLoading()),t.onLoadingChange.emit),r=function(e,t,n){let a,r=U();const o=Object.freeze({init(e){r=U(e,r)},isRunning:()=>r.isRunning,setRunning(e){r.isRunning!==e&&(r.isRunning=e,n.emit(e))},isInitialLoading:()=>r.isInitialLoading,setInitialLoading(e){r.isInitialLoading=e},getLanguage:()=>r.language||r.initialOptions.language,setLanguage(t){r.language!==t&&(r.language=t,e.emit(t))},getPendingLanguage:()=>r.pendingLanguage||o.getLanguage(),setPendingLanguage(e){r.pendingLanguage!==e&&(r.pendingLanguage=e,t.emit(e))},getInitialOptions:()=>Object.assign(Object.assign({},r.initialOptions),a),addActiveNs(e){y(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t?r.activeNamespaces.set(e,t+1):r.activeNamespaces.set(e,1)}))},removeActiveNs(e){y(e).forEach((e=>{const t=r.activeNamespaces.get(e);void 0!==t&&t>1?r.activeNamespaces.set(e,t-1):r.activeNamespaces.delete(e)}))},getRequiredNamespaces:()=>E([o.getDefaultNs(),...r.initialOptions.ns||[],...y(r.initialOptions.fallbackNs),...r.activeNamespaces.keys()]),getFallbackLangs(e){const t=e||o.getLanguage();return t?E([t,...b(t,r.initialOptions.fallbackLanguage)]):[]},getFallbackNs:()=>y(r.initialOptions.fallbackNs),getNs(){var e,t;return(null===(e=r.initialOptions.ns)||void 0===e?void 0:e.length)?r.initialOptions.ns:[null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:""]},getDefaultNs(e){var t,n,a;return void 0===e?null!==(a=null!==(t=r.initialOptions.defaultNs)&&void 0!==t?t:null===(n=r.initialOptions.ns)||void 0===n?void 0:n[0])&&void 0!==a?a:"":e},getAvailableLanguages(){if(r.initialOptions.availableLanguages)return r.initialOptions.availableLanguages;if(r.initialOptions.staticData){const e=Object.keys(r.initialOptions.staticData).map((e=>C(e).language));return Array.from(new Set(e))}},getAvailableNs:()=>r.initialOptions.availableNs,withDefaultNs:e=>({namespace:void 0===e.namespace?o.getDefaultNs():e.namespace,language:e.language}),overrideCredentials(e){a=e?Object.assign(Object.assign({},e),{apiUrl:L(e.apiUrl)}):void 0}});return o}(t.onLanguageChange,t.onPendingLanguageChange,t.onRunningChange),o=$(r.getLanguage,r.getInitialOptions,r.getAvailableLanguages,c,m,w,g,t),i=D(t,o.getBackendRecord,o.getBackendDevRecord,r.withDefaultNs,r.isInitialLoading,n,a);let s;function l(e){return r.getDefaultNs(e)}function c(e){return E([...y(l(e)),...r.getFallbackNs()])}function u(e){return E([...y(null!=e?e:l()),...r.getRequiredNamespaces()])}function g(e,t,n){const a=r.withDefaultNs(e),o=i.getTranslation(a,t);return i.changeTranslation(a,t,n),{revert(){i.changeTranslation(a,t,o)}}}function d(e){r.init(e),i.addStaticData(r.getInitialOptions().staticData)}function h(e,t){const n=r.getFallbackLangs(e),a=u(t),o=[];return n.forEach((e=>{a.forEach((t=>{o.push({language:e,namespace:t})}))})),o}function m({key:e,ns:t}){const n=r.getFallbackLangs(),a=c(null!=t?t:void 0);return i.getTranslationNs(a,n,e)}function w({key:e,ns:t,language:n}){const a=c(null!=t?t:void 0),o=r.getFallbackLangs(n);return i.getTranslationFallback(a,o,e)}function O(){const e=p(N(),(()=>{const e=h(t,n).filter((e=>!i.exists(e,!0)));var t,n;if(e.length&&r.getInitialOptions().autoLoadRequiredData)return i.loadRecords(e,{useCache:!0})}));if(f(e))return r.setInitialLoading(!0),n.notify(),a.notify(),Promise.resolve(e).then((()=>{r.setInitialLoading(!1),n.notify(),a.notify(),t.onInitialLoaded.emit()}));t.onInitialLoaded.emit()}function N(){if(r.getLanguage())return;return p(o.getInitialLanguage(),(e=>{const t=e||r.getInitialOptions().defaultLanguage;t&&r.setLanguage(t)}))}e&&d(e),t.onUpdate.listen((()=>{r.isRunning()&&o.retranslate()}));const k=Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),r),o),i),{init:d,getTranslation:w,changeTranslation:g,getTranslationNs:m,getDefaultAndFallbackNs:c,findPositions:o.findPositions,getRequiredDescriptors:h,async changeLanguage(e){r.getPendingLanguage()===e&&r.getLanguage()===e||(r.setPendingLanguage(e),r.isRunning()&&r.getInitialOptions().autoLoadRequiredData&&await i.loadRecords(h(e),{useCache:!0}),e===r.getPendingLanguage()&&(r.setLanguage(e),await o.setStoredLanguage(e)))},async addActiveNs(e,t){t||r.addActiveNs(e),r.isRunning()&&await i.loadRecords(h(void 0,e),{useCache:!0})},async loadRecord(e,t){var n;return null===(n=(await k.loadRecords([e],t))[0])||void 0===n?void 0:n.data},isLoading:e=>i.isLoading(r.getLanguage(),e),isLoaded(e){const t=r.getLanguage();if(!t)return!1;const n=r.getFallbackLangs(t),a=u(e),o=[];return n.forEach((e=>{a.forEach((t=>{i.exists({language:e,namespace:t})||o.push({language:e,namespace:t})}))})),0===o.length},t:(...e)=>{const t=B(...e),n=w(t);return o.formatTranslation(Object.assign(Object.assign({},t),{translation:n}))},isDev:()=>Boolean(r.getInitialOptions().apiKey&&r.getInitialOptions().apiUrl),async loadRequired(e){(null==e?void 0:e.language)||await N();const t=h(null==e?void 0:e.language);return k.loadRecords(t,e)},async loadMatrix(e){const t=function(e){let t=[],n=[];if(Array.isArray(e.languages))t=e.languages;else if("all"===e.languages){const e=k.getAvailableLanguages();if(!e)throw new Error(v("availableLanguages"));t=e}if(Array.isArray(e.namespaces))n=e.namespaces;else if("all"===e.namespaces){const e=k.getAvailableNs();if(!e)throw new Error(v("availableNs"));n=e}const a=[];return t.forEach((e=>{n.forEach((t=>{a.push({language:e,namespace:t})}))})),a}(e);return k.loadRecords(t,e)},run:()=>(function(){if((o.getLanguageDetector()||o.getLanguageStorage())&&!r.getAvailableLanguages())throw new Error(v("availableLanguages"));if(!r.getLanguage()&&!r.getInitialOptions().defaultLanguage)throw new Error(v(["defaultLanguage","language"]))}(),r.isRunning()||(r.setRunning(!0),o.run(),s=O()),Promise.resolve(s)),stop(){r.isRunning()&&(o.stop(),r.setRunning(!1))}}));return k}const V=()=>{const e={plugins:[],options:{}},t=Object.freeze({use:n=>(e.plugins.push(n),t),updateDefaults:n=>(e.options=_(e.options,n),t),init(t){const n=function(e){const t=K({options:e});function n(e){const n=t.isRunning();n&&t.stop(),e(),t.isDev()&&t.invalidate(),n&&t.run()}t.isDev()&&t.invalidate();const a=Object.freeze({on:t.on,setEmitterActive:t.setEmitterActive,getLanguage:t.getLanguage,getPendingLanguage:t.getPendingLanguage,changeLanguage:t.changeLanguage,changeTranslation:t.changeTranslation,addActiveNs:t.addActiveNs,removeActiveNs:t.removeActiveNs,loadRequired:t.loadRequired,loadMatrix:t.loadMatrix,loadRecords:t.loadRecords,loadRecord:t.loadRecord,addStaticData:t.addStaticData,getRecord:t.getRecord,getAllRecords:t.getAllRecords,isLoaded:t.isLoaded,getRequiredDescriptors:t.getRequiredDescriptors,isInitialLoading:t.isInitialLoading,isLoading:t.isLoading,isFetching:t.isFetching,isRunning:t.isRunning,run:t.run,stop:t.stop,t:t.t,highlight:t.highlight,findPositions:t.findPositions,getInitialOptions:t.getInitialOptions,isDev:t.isDev,wrap:t.wrap,unwrap:t.unwrap,overrideCredentials(e){n((()=>t.overrideCredentials(e)))},addPlugin(e){e&&n((()=>t.addPlugin(a,e)))},updateOptions(e){e&&n((()=>t.init(e)))}});return a}(_(e.options,t));return e.plugins.forEach(n.addPlugin),n}});return t},z=0,W=1,G=2;class Y extends Error{constructor(e,t,n){let a,r="";e===z?a="Empty parameter":e===W?(a="Unexpected character",r="Did you forget to use FormatIcu to render ICU message syntax?"):a="Unexpected end",super(`Tolgee parser: ${a} at ${t} in "${n}"`+(r?"\n"+r:"")),this.code=e,this.index=t}}function H(e){return/\s/.test(e)}const q=0,X=1,J=2,Z=3,Q=4,ee=new Set([J,X,q]),te="'",ne=new Set(["{","}",te]),ae=e=>/[0-9a-zA-Z_]/.test(e);function re(e,t){const[n,a]=function(e){let t=q,n="",a="",r="";const o=[],i=[];let s=0;function l(t){throw new Y(t,s,e)}const c=()=>{o.push(n),n=""},u=()=>{""===a&&l(z),i.push(a),a=""};for(s=0;s<e.length;s++)switch(r=e[s],t){case q:r===te?(n+=r,t=X):"{"===r?(c(),t=Z):(n+=r,t=q);break;case X:ne.has(r)?(n=n.slice(0,-1)+r,t=J):(n+=r,t=q);break;case J:r===te?t=q:(n+=r,t=J);break;case Z:"}"===r?(u(),t=q):H(r)?""!==a&&(u(),t=Q):(ae(r)||l(W),a+=r,t=Z);break;case Q:"}"==r?t=q:H(r)?t=Q:l(W)}return ee.has(t)||l(G),c(),[o,i]}(e),r=[n[0]];for(let o=1;o<n.length;o++){const i=null==t?void 0:t[a[o-1]];if(void 0===i)throw new Error(`Missing parameter "${a[o-1]}" in "${e}"`);r.push(String(i)),r.push(n[o])}return r.join("")}const oe="__tolgee_dev_tools",ie="data-tolgee-key-only",se="data-tolgee-restricted",le="_tolgee",ce="_tolgee-highlighter";function ue(){var e,t;return void 0===(null==(t=null==(e=globalThis.window)?void 0:e.document)?void 0:t.createElement)}function ge(e){if(ue())throw new Error(`${e}: Can't run on the server`)}function de(e,t){return{oldTextContent:e,keys:t}}function fe(e){return e.textContent}function pe(e,t){e.textContent=t}function he(e,t){var n;const a=void 0===e.key||void 0===t.key||t.key===e.key,r=void 0===e.ns||void 0===t.ns||-1!==(null==(n=e.ns)?void 0:n.findIndex((e=>{var n;return null==(n=t.ns)?void 0:n.includes(e)})));return a&&r}const ve={position:"fixed",boxSizing:"content-box",zIndex:String(Number.MAX_SAFE_INTEGER),contain:"layout",display:"block",borderStyle:"solid",borderRadius:"4px"};function me({highlightColor:e,highlightWidth:t}){return Object.freeze({initHighlighter(n,a){!function(n,a){a.highlight=()=>{if(!n.isConnected)return;const r=function(e){for(;e;){if(null!==e.getAttribute("disabled"))return!1;e=e.parentElement}return!0}(n);let o=a.highlightEl;o||(o=document.createElement("div"),o.classList.add(ce),Object.entries(ve).forEach((([e,t])=>{o.style[e]=t})),o.style.borderColor=e,a.highlightEl=o,document.body.appendChild(o));const i=n.getBoundingClientRect();o.style.pointerEvents=r?"none":"auto",o.style.borderWidth=t+"px",o.style.top=i.top-t+"px",o.style.left=i.left-t+"px",o.style.width=i.width+"px",o.style.height=i.height+"px"}}(n,a),function(e,t){t.unhighlight=()=>{var e;null==(e=t.highlightEl)||e.remove(),t.highlightEl=void 0}}(0,a)}})}const ye={capture:!0},be={capture:!0,passive:!0},Ee=new Map([["Control","ctrlKey"],["Alt","altKey"],["Meta","metaKey"],["Shift","shiftKey"]]);function Le({highlightKeys:e,elementStore:t,onClick:n,options:a}){var r,o;const i=new Set;let s,l,c=[];const u=(null==(r=a.targetElement)?void 0:r.getRootNode())||document,g=(null==(o=a.targetElement)?void 0:o.ownerDocument)||document;function d(){var e;const n=t.get(s);n&&(n.preventClean=!1,null==(e=n.unhighlight)||e.call(n),s=void 0)}function f(){const e=l;let n;if(e&&A()){n=function(e){for(const n of e){const e=O(n,(e=>t.get(e)));if(void 0!==e)return e||void 0}}(u.elementsFromPoint(e.x,e.y)||[])}!function(e){var n;if(s!==e){d();const a=t.get(e);a&&(a.preventClean=!0,null==(n=a.highlight)||n.call(a),s=e)}}(n)}function p(e){l=e,f()}function h(e){for(const[t,n]of Ee.entries())i.has(t)&&!e[n]?i.delete(t):!i.has(t)&&e[n]&&i.add(t)}function v(e){var t;h(e),A()&&(t=e.target,!Boolean(O(t,(e=>e.id===oe))))&&(e.stopPropagation(),e.preventDefault())}function m(e){h(e),p({x:e.clientX,y:e.clientY})}function y(e){h(e),f()}function b(e){h(e),f()}function E(){var e;const n=t.get(s);null==(e=null==n?void 0:n.highlight)||e.call(n)}function L(e){v(e),h(e),p({x:e.clientX,y:e.clientY}),A()&&s&&(n(s),d())}function w(e,t,n){g.addEventListener(e,t,n),c.push([e,t,n])}function O(e,t){return e.id===oe?null:t(e)?e:(null==e?void 0:e.parentElement)?O(e.parentElement,t):void 0}function A(){for(const t of e)if(!i.has(t))return!1;return!0}return Object.freeze({stop(){!function(){for(const e of c)g.removeEventListener(...e);c=[]}()},run(){w("keydown",y,ye),w("keyup",b,ye),w("mousemove",m,be),w("scroll",E,be),w("click",L,ye),w("mouseenter",v,ye),w("mouseover",v,ye),w("mouseout",v,ye),w("mouseleave",v,ye),w("mousedown",v,ye),w("mouseup",v,ye)}})}function we(e,t,n){const a=me({highlightColor:e.highlightColor,highlightWidth:e.highlightWidth}),r=Le({highlightKeys:e.highlightKeys,elementStore:t,onClick(e){const a=t.get(e);n({target:e,keysAndDefaults:s(a)})},options:e});function o(t){return-1!==e.restrictedElements.indexOf(t.tagName.toLowerCase())||null!==t.closest(`[${se}]`)}function i(e,n){var a;n.highlightEl&&(null==(a=n.unhighlight)||a.call(n)),e.removeAttribute(le),t.remove(e)}function s(e){return function(e){return Array.from(e.nodes.values()).reduce(((e,t)=>[...e,...t.keys.map((e=>({key:e.key,defaultValue:e.defaultValue,ns:e.ns})))]),[])}(e)}return Object.freeze({isRestricted:o,register(e,n,r){if(o(e))return;const i=e;let s=t.get(i);s||(s=function(e){return{element:e,nodes:new Map}}(i),t.set(i,s),i.setAttribute(le,"true")),s.nodes.set(n,r),a.initHighlighter(i,s)},forEachElement:t.forEachElement,cleanupLingeringKeyAttributes(){t.forEachElement(((e,t)=>{if(!t.preventClean){for(const[e]of t.nodes)if(e.nodeType===Node.ATTRIBUTE_NODE){const n=e;n.name===ie&&null===n.ownerElement&&t.nodes.delete(n)}0===t.nodes.size&&i(e,t)}}))},cleanupRemovedNodes(e){t.forEachElement(((t,n)=>{n.preventClean||(e.has(t)||function(e,t){for(const[n]of e.nodes)t.has(n)&&e.nodes.delete(n)}(n,e),(e.has(t)||0===n.nodes.size)&&i(t,n))}))},findAll(e,n){const a=[];return t.forEachElement(((t,r)=>{for(const t of r.nodes.values()){if(t.keys.find((t=>he({key:e,ns:m(n)},{key:t.key,ns:m(t.ns)})))){a.push(r);break}}})),a},run(e){e&&r.run()},stop(){r.stop(),t.forEachElement(((e,t)=>{var n;t.highlightEl&&(null==(n=t.unhighlight)||n.call(t))}))}})}function Oe(){let e,t=!1;const n=function(){const e=new Map;return Object.freeze({set(t,n){e.set(t,n)},get:t=>t&&e.get(t),remove:t=>e.delete(t),forEachElement(t){e.forEach(((e,n)=>t(n,e)))}})}();function a({mouseHighlight:e,options:a,wrapper:r,onClick:o}){if(ue())return{stop(){t=!1},wrapper:r};const i=function(e){const t=Object.freeze({getSuitableParent(n){const a=function(e){return e.parentElement?e.parentElement:e.ownerElement&&e.ownerElement||void 0}(n);if(void 0===a)throw console.error(n),new Error("No suitable parent found for node above.");if(!e.passToParent)return a;if(Array.isArray(e.passToParent)){const t=e=>a.tagName.toLowerCase()===e.toLowerCase();if(-1===e.passToParent.findIndex(t))return a}return"function"!=typeof e.passToParent||e.passToParent(a)?t.getSuitableParent(a):a}});return t}(a),s=function(e,t){const n=Object.freeze({handleAttributes(n,a=!0){var r,o;const i=[],s=Object.fromEntries(Object.entries(e.tagAttributes).map((([e,t])=>[e.toUpperCase(),t])));if(n.nodeType===Node.ELEMENT_NODE){const e=n;let a=null!=(r=s[e.tagName.toUpperCase()])?r:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((t=>e.hasAttribute(t))).map((t=>e.getAttributeNode(t))).filter((e=>t.testAttribute(e))))}if(a){const e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,(e=>{var t,n;return(null==(t=s[e.tagName.toUpperCase()])?void 0:t.some((t=>e.hasAttribute(t))))||(null==(n=s["*"])?void 0:n.some((t=>e.hasAttribute(t))))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}));for(;e.nextNode();){const n=e.currentNode;let a=null!=(o=s[n.tagName.toUpperCase()])?o:[];"*"in s&&(a=a.concat(s["*"])),i.push(...a.filter((e=>n.hasAttribute(e))).map((e=>n.getAttributeNode(e))).filter((e=>t.testAttribute(e))))}}return i},handleChildList(e){const t=[];return t.push(...e.flatMap((e=>n.handleAttributes(e,!0)))),t.push(...e.flatMap((e=>n.handleText(e)))),t},handleText(e){if(e.nodeType===Node.TEXT_NODE)return t.testTextNode(e)?[e]:[];const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>t.testTextNode(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;a.nextNode();)n.push(a.currentNode);return n}});return n}(a,r),l=we(a,n,o);function c(e){for(const t of e){const e=t.parentElement;if(e&&l.isRestricted(e))continue;const n=fe(t),a=n?r.unwrap(n):null;if(a){const{text:e,keys:r}=a;pe(t,e);const o=de(n,r),s=i.getSuitableParent(t);l.register(s,t,o)}}}function u(e){const t=i.getSuitableParent(e);l.register(t,e,{oldTextContent:"",keys:[{key:fe(e)}],keyAttributeOnly:!0})}function g(e,t){if(e.nodeType===Node.ATTRIBUTE_NODE){const t=e;if(t.name===ie)return void u(t)}if(e.nodeType===Node.ELEMENT_NODE){const t=e.getAttributeNode(ie);t&&u(t)}if(!t)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,(e=>e.hasAttribute(ie)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));for(;n.nextNode();){u(n.currentNode.getAttributeNode(ie))}}const d=new MutationObserver((e=>{if(!t)return;const n=e.filter((e=>"childList"===e.type)).flatMap((e=>Array.from(e.removedNodes))),a=new Set(n);for(const e of n){if(e.nodeType===Node.ELEMENT_NODE)for(let t=0;t<e.attributes.length;t++)a.add(e.attributes[t]);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;t.nextNode();){const e=t.currentNode;if(e.nodeType===Node.ELEMENT_NODE){const t=e;for(let e=0;e<t.attributes.length;e++)a.add(t.attributes[e])}a.add(e)}}a.size>0&&l.cleanupRemovedNodes(a),e.some((e=>"attributes"===e.type&&e.attributeName===ie))&&l.cleanupLingeringKeyAttributes();const r=new Set;for(const t of e)switch(t.type){case"characterData":s.handleText(t.target).forEach((e=>r.add(e)));break;case"childList":g(t.target,!0),t.addedNodes.length>0&&s.handleChildList(Array.from(t.addedNodes)).forEach((e=>r.add(e))),t.removedNodes.length>0&&s.handleChildList(Array.from(t.removedNodes)).forEach((e=>r.delete(e)));break;case"attributes":t.attributeName===ie&&g(t.target,!1),s.handleAttributes(t.target,!1).forEach((e=>r.add(e)))}c([...r])})),f=a.targetElement||document;t=!0,l.run(e),g(f,!0),c(s.handleChildList([f]));const p=new Set;return p.add(ie),Object.values(a.tagAttributes).forEach((e=>e.forEach((e=>p.add(e.toLowerCase()))))),d.observe(f,{attributes:!0,attributeFilter:[...p],childList:!0,subtree:!0,characterData:!0}),{stop(){t=!1,l.stop(),d.disconnect()},elementRegistry:l,wrapper:r}}return Object.freeze({run(t){e=a(t)},stop(){null==e||e.stop()},forEachElement(t){var n,a;null==(a=null==(n=null==e?void 0:e.elementRegistry)?void 0:n.forEachElement)||a.call(n,t)},highlight(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[];return r.forEach((e=>{var t;return null==(t=e.highlight)?void 0:t.call(e)})),{unhighlight(){r.forEach((e=>{var t;return null==(t=e.unhighlight)?void 0:t.call(e)}))}}},findPositions(t,n){var a;const r=(null==(a=null==e?void 0:e.elementRegistry)?void 0:a.findAll(t,n))||[],o=[];return r.sort(((e,t)=>e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),r.forEach((e=>{const a=e.element.getBoundingClientRect();e.nodes.forEach((e=>{e.keys.forEach((e=>{he({key:t,ns:m(n)},{key:e.key,ns:m(e.ns)})&&o.push({position:{x:a.x,y:a.y,width:a.width,height:a.height},keyName:e.key,keyNamespace:e.ns||""})}))}))})),o},unwrap:t=>e?e.wrapper.unwrap(t):{text:t,keys:[]},wrap:t=>e?e.wrapper.wrap(t):t.translation||""})}var Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Te={};!function(e){function t(e){for(var t=0,n=Math.min(65536,e.length+1),a=new Uint16Array(n),r=[],o=0;;){var i=t<e.length;if(!i||o>=n-1){var s=a.subarray(0,o);if(r.push(String.fromCharCode.apply(null,s)),!i)return r.join("");e=e.subarray(t),t=0,o=0}var l=e[t++];if(0==(128&l))a[o++]=l;else if(192==(224&l)){var c=63&e[t++];a[o++]=(31&l)<<6|c}else if(224==(240&l)){c=63&e[t++];var u=63&e[t++];a[o++]=(31&l)<<12|c<<6|u}else if(240==(248&l)){var g=(7&l)<<18|(c=63&e[t++])<<12|(u=63&e[t++])<<6|63&e[t++];g>65535&&(g-=65536,a[o++]=g>>>10&1023|55296,g=56320|1023&g),a[o++]=g}}}var n="Failed to ",a=function(e,t,a){if(e)throw new Error("".concat(n).concat(t,": the '").concat(a,"' option is unsupported."))},r="function"==typeof Buffer&&Buffer.from,o=r?function(e){return Buffer.from(e)}:function(e){for(var t=0,n=e.length,a=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);t<n;){var i=e.charCodeAt(t++);if(i>=55296&&i<=56319){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,i=((1023&i)<<10)+(1023&s)+65536)}if(i>=55296&&i<=56319)continue}if(a+4>o.length){r+=8,r=(r*=1+t/e.length*2)>>>3<<3;var l=new Uint8Array(r);l.set(o),o=l}if(0!=(4294967168&i)){if(0==(4294965248&i))o[a++]=i>>>6&31|192;else if(0==(4294901760&i))o[a++]=i>>>12&15|224,o[a++]=i>>>6&63|128;else{if(0!=(4292870144&i))continue;o[a++]=i>>>18&7|240,o[a++]=i>>>12&63|128,o[a++]=i>>>6&63|128}o[a++]=63&i|128}else o[a++]=i}return o.slice?o.slice(0,a):o.subarray(0,a)};function i(){this.encoding="utf-8"}i.prototype.encode=function(e,t){return a(t&&t.stream,"encode","stream"),o(e)};var s=!r&&"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL,l=["utf-8","utf8","unicode-1-1-utf-8"],c=t;r?c=function(e,t){return(e instanceof Buffer?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)).toString(t)}:s&&(c=function(e){try{return function(e){var t;try{var n=new Blob([e],{type:"text/plain;charset=UTF-8"});t=URL.createObjectURL(n);var a=new XMLHttpRequest;return a.open("GET",t,!1),a.send(),a.responseText}finally{t&&URL.revokeObjectURL(t)}}(e)}catch(n){return t(e)}});var u="construct 'TextDecoder'",g="".concat(n," ").concat(u,": the ");function d(e,t){if(a(t&&t.fatal,u,"fatal"),e=e||"utf-8",!(r?Buffer.isEncoding(e):-1!==l.indexOf(e.toLowerCase())))throw new RangeError("".concat(g," encoding label provided ('").concat(e,"') is invalid."));this.encoding=e,this.fatal=!1,this.ignoreBOM=!1}d.prototype.decode=function(e,t){var n;return a(t&&t.stream,"decode","stream"),n=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),c(n,this.encoding)},e.TextEncoder=e.TextEncoder||i,e.TextDecoder=e.TextDecoder||d}("undefined"!=typeof window?window:Ae);const Ne=d({__proto__:null,default:Te},[Te]);null==(t=console.assert)||t.call(console,Ne);const ke=["",""],je=RegExp(`([${ke.join("")}]{9})+`,"gu");function Re(e){const t=function(e){return Array.from((new TextEncoder).encode(e))}(e).map(Number),n=t.map((e=>function(e){const t=8-e.length;return"0".repeat(t)+e}(e.toString(2))+"0")).join("");return Array.from(n).map((e=>ke[Number(e)])).join("")}function xe(e){const t=Array.from(e).map((e=>ke.indexOf(e))).map(String).join("").match(/(.{9})/g),n=Uint8Array.from((null==t?void 0:t.map((e=>parseInt(e.slice(0,8),2))))||[]);return a=n,(new TextDecoder).decode(new Uint8Array(a));var a}function Ce({fullKeyEncode:e}){const t=function(){const e=[];return Object.freeze({valueToNumber(t){let n=e.indexOf(t);return-1===n&&(n=e.length,e.push(t)),n},numberToValue:t=>e[t]})}();function n(e){const t={k:e.key,n:e.ns||void 0,d:e.defaultValue};return JSON.stringify(t)}function a(e){return Re(e+"\n")}return Object.freeze({unwrap(e){const n=[],a=function(e){var t;const n=null==(t=e.match(je))?void 0:t.filter((e=>e.length>8));return(null==n?void 0:n.map(xe))||[]}(e);a.forEach((e=>{const a=function(e){return e.split("\n").filter((e=>e.length)).map((e=>{if("{"===e[0])return e;{const n=Number(e);return t.numberToValue(n)}}))}(e);a.forEach((e=>{const t=function(e){try{return JSON.parse(e||"{}")}catch(e){return void console.error(e)}}(e);if(t){const{k:e,d:a,n:r}=t;n.push({key:e,defaultValue:a,ns:r})}}))}));const r=function(e){return e.replace(je,"")}(e);return{text:r,keys:n}},wrap({key:r,defaultValue:o,translation:i,ns:s}){let l;if(e){l=a(n({key:r,ns:s}))}else{const e=n({key:r,ns:s,defaultValue:o}),i=t.valueToNumber(e);l=a(String(i))}const c=i||"";return"string"==typeof c?c+l:c},testTextNode(e){var t,n,a;return null!=(a=(null==(t=e.textContent)?void 0:t.includes(`${ke[0]}${ke[0]}`))||(null==(n=e.textContent)?void 0:n.includes(`${ke[1]}${ke[0]}`)))&&a},testAttribute:e=>e.value.includes(`${ke[0]}${ke[0]}`)||e.value.includes(`${ke[1]}${ke[0]}`)})}function Pe(e,t){let n=0;for(;e>-1&&"\\"===t[e-1];)n++,e--;return n%2==1}function De({inputPrefix:e,inputSuffix:t,translate:n}){function a(e){const{key:t,params:a,defaultValue:r,ns:o}=function(e){let t=!1,n="",a="",r="KEY";const o={key:"",ns:void 0,params:{},defaultValue:void 0},i=e=>{o.ns=e};for(const s of e)"\\"!==s||t?t?(t=!1,n+=s):"KEY"!==r||","!==s?"KEY"!==r||"|"!==s?"NAMESPACE"!==r||","!==s?"KEY"!==r||":"!==s?"DEFAULT_VALUE"!==r||":"!==s?"PARAM_NAME"!==r||":"!==s?"PARAM_VALUE"!==r||","!==s?n+=s:(r="PARAM_NAME",o.params[a]=n,n=""):(r="PARAM_VALUE",a=n,n=""):(r="PARAM_NAME",o.defaultValue=n,n=""):(r="PARAM_NAME",o.key=n,n=""):(r="DEFAULT_VALUE",i(n),n=""):(r="NAMESPACE",o.key=n,n=""):(r="DEFAULT_VALUE",o.key=n,n=""):t=!0;return"KEY"===r&&(o.key=n),"DEFAULT_VALUE"===r&&(o.defaultValue=n),"PARAM_VALUE"===r&&(o.params[a]=n),"NAMESPACE"===r&&i(n),o}(e);return{translated:n({key:t,params:a,defaultValue:r,ns:o,noWrap:!0}),key:t,params:a,defaultValue:r,ns:o}}function r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){return"string"==typeof e?e.replace(new RegExp("[,:|\\\\]","gs"),"\\$&"):"number"==typeof e||"bigint"==typeof e?e.toString():(console.warn(`Parameters of type "${typeof e}" are not supported in "text" wrapper mode.`),e)}return Object.freeze({wrap({key:n,params:a,defaultValue:r,ns:i}){let s=Object.entries(a||{}).map((([e,t])=>`${o(e)}:${o(t)}`)).join(",");s=s.length?`:${s}`:"";const l=void 0!==r?`,${o(r)}`:"",c="string"==typeof i?[i]:i,u=(null==c?void 0:c.length)?`|${c.map((e=>o(e))).join("|")}`:"";return`${e}${o(n)}${u}${l}${s}${t}`},unwrap(n){const o=new RegExp(`(\\\\?)(${r(e)}(.*?)${r(t)})`,"gs"),i=[];let s,l=!1,c=0,u="";for(;null!==(s=o.exec(n));){let e=s[1];const[t,r,o,g]=s,{index:d,input:f}=s;if(u+=f.substr(c,d-c),c=d+t.length,"\\"===e){if(!Pe(d,n)){u+=o;continue}e=""}const p=a(g);i.push({key:p.key,params:p.params,defaultValue:p.defaultValue,ns:p.ns}),l=!0,u+=e+p.translated}return u+=n.substring(c),l?{text:u,keys:i}:{text:n,keys:[]}},testTextNode(n){var a,r,o;return null!=(o=(null==(a=n.textContent)?void 0:a.includes(e))&&(null==(r=n.textContent)?void 0:r.includes(t)))&&o},testAttribute:n=>n.value.includes(e)&&n.value.includes(t)})}const Se="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";function Fe(e){const t=Se.indexOf(e);if(-1===t)throw new Error("Invalid character found: "+e);return t}function Ie(e){const t=(e=e.toUpperCase()).length;let n=0,a=0,r=0;const o=new Uint8Array(5*t/8|0);for(let i=0;i<t;i++)a=a<<5|Fe(e[i]),n+=5,n>=8&&(o[r++]=a>>>n-8&255,n-=8);return function(e){const t=new Uint8Array(e),n=t.length;let a="",r=Math.pow(2,16)-1;for(let e=0;e<n;e+=r)e+r>n&&(r=n-e),a+=String.fromCharCode.apply(null,t.subarray(e,e+r));return a}(o.buffer)}function _e(e){if(e)try{const[t,n]=e.split("_");if("tgpak"===t){const[e]=Ie(n).split("_");return Number(e)}}catch(e){console.warn("Tolgee: Api key can't be parsed")}}function Ue(...e){const t="undefined"==typeof window?void 0:window.location.origin;return new URL(function(...e){let t=e[0];return e.slice(1).forEach((e=>{var n;n=e,t=`${t.replace(/\/+$/,"")}/${n=n.replace(/^\/+/,"")}`})),t}(...e),t)}function $e({message:e,recievingMessage:t,data:n,attempts:a=1,timeout:r=300}){let o=!1;const i=()=>new Promise(((a,o)=>{const i=function(e,t){const n=n=>{var a,r;e.includes(null==(a=n.data)?void 0:a.type)&&t(null==(r=n.data)?void 0:r.data)};return window.addEventListener("message",n,!1),{unsubscribe(){window.removeEventListener("message",n)}}}(t,(function(e){clearTimeout(s),l(),a(e)}));window.postMessage({type:e,data:n},window.origin);const s=setTimeout((function(){l(),o()}),r);function l(){i.unsubscribe()}}));return{cancel(){o=!0},promise:(async()=>{for(let e=0;e<a;e++){if(o)return new Promise((()=>{}));try{return await i()}catch(e){continue}}if(!o)throw`Didn't recieve ${t.join(" or ")} in time.`;return new Promise((()=>{}))})()}}let Me=null;function Be(e){var t;return Me||(Me=(t=`https://cdn.jsdelivr.net/npm/@tolgee/web@${e}/dist/tolgee-in-context-tools.umd.min.js`,new Promise(((e,n)=>{const a=document.createElement("script");a.src=t,a.addEventListener("load",(()=>e())),a.addEventListener("error",(e=>n(e.error))),document.head.appendChild(a)}))).then((()=>window["@tolgee/in-context-tools"].InContextTools))),Me}const Ke="__tolgee_apiKey",Ve="__tolgee_apiUrl";function ze(){const e=sessionStorage.getItem(Ke)||void 0,t=sessionStorage.getItem(Ve)||void 0;if(e&&t)return{apiKey:e,apiUrl:t}}function We(){sessionStorage.removeItem(Ke),sessionStorage.removeItem(Ve)}e.BrowserExtensionPlugin=()=>e=>e;(()=>{if("undefined"==typeof window)return!1;try{return"undefined"!=typeof sessionStorage&&sessionStorage}catch(e){return console.error("sessionStorage not available",e),!1}})()&&(e.BrowserExtensionPlugin=()=>e=>{const t=function(){let e;return{update:async function(t){null==e||e();const{cancel:n,promise:a}=$e({message:"TOLGEE_READY",recievingMessage:["TOLGEE_PLUGIN_READY","TOLGEE_PLUGIN_UPDATED"],data:t,attempts:4});return e=n,a}}}();e.on("running",(({value:n})=>{var a;n&&(a=()=>{t.update({uiPresent:!0,uiVersion:void 0,mode:e.isDev()?"development":"production",config:{apiUrl:e.getInitialOptions().apiUrl||"",apiKey:e.getInitialOptions().apiKey||""}}).catch(We)},"loading"!==document.readyState?Promise.resolve().then((()=>{a()})):document.addEventListener&&document.addEventListener("DOMContentLoaded",a))}));return ze()&&(async()=>{const e=await Be("prerelease");return t=>{const n=ze();return t.addPlugin(e({credentials:n})),t}})().then((t=>{e.addPlugin(t)})).catch((e=>{console.error("Tolgee: Failed to load in-context tools"),console.error(e)})),e});const Ge="__tolgee_currentLanguage";function Ye(e,t){const n=t.find((t=>t===e));if(n)return n;const a=e=>e.replace(/^(.+?)(-.*)?$/,"$1"),r=a(e),o=t.find((e=>a(e)===r));return o||void 0}function He(e){return e.endsWith("/")?e.slice(0,-1):e}const qe={prefix:"/i18n",getPath:({namespace:e,language:t,prefix:n})=>e?`${He(n)}/${e}/${t}.json`:`${He(n)}/${t}.json`,getData:function(e){return e.json()},headers:{Accept:"application/json"},timeout:void 0,fallbackOnFail:!1};function Xe(e){const t=u(c(c({},qe),e),{headers:c(c({},qe.headers),null==e?void 0:e.headers)}),{prefix:n,getPath:a,getData:r,headers:o,timeout:i,fallbackOnFail:s}=t,l=g(t,["prefix","getPath","getData","headers","timeout","fallbackOnFail"]);return{async getRecord({namespace:e,language:t,fetch:u}){const d=a({namespace:e,language:t,prefix:n});try{const e=await((e,t,n,a)=>{var r=a,{signal:o}=r,i=g(r,["signal"]);const s=new AbortController;return new Promise(((a,r)=>{const l=e(t,c({signal:s.signal},i));let u=!1;function g(e){!u&&r(e),u=!0}function d(){const e=new Error(`TIMEOUT: ${t}`);s.abort(e),g(e)}if(o&&o.addEventListener("abort",d),void 0!==n){const e=setTimeout(d,n);l.finally((()=>clearTimeout(e)))}l.catch(g).then((function(e){!u&&a(e),u=!0}))}))})(u,d,i,c({headers:o},l));if(!e.ok)throw new Error(`${e.url} ${e.status}`);return await r(e)}catch(e){if(s)return;throw e}}}}e.BackendFetch=e=>(t,n)=>(n.addBackend(Xe(e)),t),e.DEVTOOLS_ID=oe,e.DevBackend=()=>(e,t)=>(t.setDevBackend({getRecord({apiUrl:e,apiKey:t,language:n,namespace:a,projectId:r,filterTag:o,fetch:i}){var s;const l=null!=(s=_e(t))?s:r;let c;if(c=Ue(e,void 0!==l?`/v2/projects/${l}/translations/${n}`:`/v2/projects/translations/${n}`),a&&c.searchParams.append("ns",a),null==o||o.forEach((e=>{c.searchParams.append("filterTag",e)})),"tgpat"===function(e){if(!e)return;const[t]=e.split("_");return"tgpak"===t?"tgpak":"tgpat"===t?"tgpat":"legacy"}(t)&&void 0===r)throw new Error("You need to specify 'projectId' when using PAT key");return i(c.toString(),{headers:{"X-API-Key":t||"","Content-Type":"application/json"},next:{revalidate:0}}).then((e=>{if(e.ok)return e.json().then((e=>e[n]));throw new Error(e.statusText)}))}}),e),e.DevTools=()=>e=>e,e.FormatSimple=()=>(e,t)=>(t.setFinalFormatter({format:({translation:e,params:t})=>re(e,t)}),e),e.LanguageDetector=()=>(e,t)=>(t.setLanguageDetector({getLanguage:({availableLanguages:e})=>(ge("LanguageDetector"),Ye(window.navigator.language,e))}),e),e.LanguageDetectorError=k,e.LanguageStorage=()=>(e,t)=>(t.setLanguageStorage({getLanguage:()=>(ge("LanguageStorage"),localStorage.getItem(Ge)||void 0),setLanguage(e){ge("LanguageStorage"),localStorage.setItem(Ge,e)}}),e),e.LanguageStorageError=j,e.ObserverPlugin=()=>(e,t)=>("text"===e.getInitialOptions().observerType?t.setObserver((()=>{const e=Oe();return Object.freeze(u(c({},e),{run(t){const n=De({inputPrefix:t.options.inputPrefix,inputSuffix:t.options.inputSuffix,translate:t.translate});e.run(u(c({},t),{wrapper:n}))},retranslate(){e.forEachElement(((t,n)=>{for(const[t,a]of n.nodes.entries()){if(a.keyAttributeOnly)return;const n=e.unwrap(a.oldTextContent);n&&pe(t,n.text)}}))},outputNotFormattable:!0}))})):t.setObserver((()=>{const e=Oe();return Object.freeze(u(c({},e),{run(t){const n=Ce({fullKeyEncode:t.options.fullKeyEncode});e.run(u(c({},t),{wrapper:n}))},retranslate(){},outputNotFormattable:!1}))})),e),e.PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY="__tolgee_preferredLanguages",e.RecordFetchError=N,e.TOLGEE_ATTRIBUTE_NAME=le,e.TOLGEE_RESTRICT_ATTRIBUTE=se,e.TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE=ie,e.Tolgee=function(){return V().use(e.BrowserExtensionPlugin())},e.TolgeeCore=V,e.createFetchFunction=O,e.detectLanguage=Ye,e.detectLanguageFromHeaders=(e,t)=>{const n=function(e){const t=e.get("Accept-Language");if(!t)return[];const n=t.split(",").map((e=>{const[t]=e.trim().split(";");return t}));return[...new Set(n.filter((e=>e&&"*"!==e)))]}(e);return n[0]&&Ye(n[0],t)},e.getFallback=m,e.getFallbackArray=y,e.getProjectIdFromApiKey=_e,e.getTranslateProps=B,e.isSSR=ue,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); | ||
//# sourceMappingURL=tolgee-web.production.umd.min.js.map |
{ | ||
"name": "@tolgee/web", | ||
"version": "5.33.3-prerelease.2efc0e6b.0", | ||
"version": "5.33.3-prerelease.4a586561.0", | ||
"description": "Tolgee for web", | ||
@@ -48,3 +48,3 @@ "declaration": true, | ||
"dependencies": { | ||
"@tolgee/core": "5.33.3-prerelease.2efc0e6b.0" | ||
"@tolgee/core": "5.33.3-prerelease.4a586561.0" | ||
}, | ||
@@ -100,3 +100,3 @@ "devDependencies": { | ||
"homepage": "https://github.com/tolgee/tolgee-js#readme", | ||
"gitHead": "799332abc27675f19c1b722ac063cbe2451f500e", | ||
"gitHead": "015d697be5ab0ce506ca01c48af8d3a5f1a17272", | ||
"publishConfig": { | ||
@@ -103,0 +103,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52933181
304553
+ Added@tolgee/core@5.33.3-prerelease.4a586561.0(transitive)
- Removed@tolgee/core@5.33.3-prerelease.2efc0e6b.0(transitive)