@sisense/sdk-ui 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var A5=Object.defineProperty,E5=Object.defineProperties;var O5=Object.getOwnPropertyDescriptors;var Ed=Object.getOwnPropertySymbols;var A_=Object.prototype.hasOwnProperty,E_=Object.prototype.propertyIsEnumerable;var at=Math.pow,ag=(e,t,i)=>t in e?A5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ie=(e,t)=>{for(var i in t||(t={}))A_.call(t,i)&&ag(e,i,t[i]);if(Ed)for(var i of Ed(t))E_.call(t,i)&&ag(e,i,t[i]);return e},Ue=(e,t)=>E5(e,O5(t));var ro=(e,t)=>{var i={};for(var n in e)A_.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&Ed)for(var n of Ed(e))t.indexOf(n)<0&&E_.call(e,n)&&(i[n]=e[n]);return i};var sg=(e,t,i)=>(ag(e,typeof t!="symbol"?t+"":t,i),i);var Pa=(e,t,i)=>new Promise((n,o)=>{var r=A=>{try{_(i.next(A))}catch(E){o(E)}},u=A=>{try{_(i.throw(A))}catch(E){o(E)}},_=A=>A.done?n(A.value):Promise.resolve(A.value).then(r,u);_((i=i.apply(e,t)).next())});const Ae=require("react/jsx-runtime"),Je=require("react"),ja=require("react-dom"),eE=require("react-dom/server");function ox(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const Zc=ox(Ae),Oe=ox(Je),L5=ox(ja),N5={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Xh{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||N5,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,n,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Xh(this.logger,Ie({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xh(this.logger,t)}}var ir=new Xh;class of{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(i)}),this}off(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==i)}}emit(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];this.observers[t]&&[].concat(this.observers[t]).forEach(u=>{u(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(u=>{u.apply(u,[t,...n])})}}function Jl(){let e,t;const i=new Promise((n,o)=>{e=n,t=o});return i.resolve=e,i.reject=t,i}function O_(e){return e==null?"":""+e}function D5(e,t,i){e.forEach(n=>{t[n]&&(i[n]=t[n])})}function rx(e,t,i){function n(u){return u&&u.indexOf("###")>-1?u.replace(/###/g,"."):u}function o(){return!e||typeof e=="string"}const r=typeof t!="string"?[].concat(t):t.split(".");for(;r.length>1;){if(o())return{};const u=n(r.shift());!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={}}return o()?{}:{obj:e,k:n(r.shift())}}function L_(e,t,i){const{obj:n,k:o}=rx(e,t,Object);n[o]=i}function I5(e,t,i,n){const{obj:o,k:r}=rx(e,t,Object);o[r]=o[r]||[],o[r].push(i)}function qh(e,t){const{obj:i,k:n}=rx(e,t);if(i)return i[n]}function R5(e,t,i){const n=qh(e,i);return n!==void 0?n:qh(t,i)}function tE(e,t,i){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?i&&(e[n]=t[n]):tE(e[n],t[n],i):e[n]=t[n]);return e}function ws(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var j5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function B5(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>j5[t]):e}const z5=[" ",",","?","!",";"];function F5(e,t,i){t=t||"",i=i||"";const n=z5.filter(u=>t.indexOf(u)<0&&i.indexOf(u)<0);if(n.length===0)return!0;const o=new RegExp(`(${n.map(u=>u==="?"?"\\?":u).join("|")})`);let r=!o.test(e);if(!r){const u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(r=!0)}return r}function Zh(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(i);let o=e;for(let r=0;r<n.length;++r){if(!o||typeof o[n[r]]=="string"&&r+1<n.length)return;if(o[n[r]]===void 0){let u=2,_=n.slice(r,r+u).join(i),A=o[_];for(;A===void 0&&n.length>r+u;)u++,_=n.slice(r,r+u).join(i),A=o[_];if(A===void 0)return;if(A===null)return null;if(t.endsWith(_)){if(typeof A=="string")return A;if(_&&typeof A[_]=="string")return A[_]}const E=n.slice(r+u).join(i);return E?Zh(A,E,i):void 0}o=o[n[r]]}return o}function Kh(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class N_ extends of{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let _=[t,i];n&&typeof n!="string"&&(_=_.concat(n)),n&&typeof n=="string"&&(_=_.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(_=t.split("."));const A=qh(this.data,_);return A||!u||typeof n!="string"?A:Zh(this.data&&this.data[t]&&this.data[t][i],n,r)}addResource(t,i,n,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const u=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let _=[t,i];n&&(_=_.concat(u?n.split(u):n)),t.indexOf(".")>-1&&(_=t.split("."),o=i,i=_[1]),this.addNamespaces(i),L_(this.data,_,o),r.silent||this.emit("added",t,i,n,o)}addResources(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in n)(typeof n[r]=="string"||Object.prototype.toString.apply(n[r])==="[object Array]")&&this.addResource(t,i,r,n[r],{silent:!0});o.silent||this.emit("added",t,i,n)}addResourceBundle(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[t,i];t.indexOf(".")>-1&&(_=t.split("."),o=n,n=i,i=_[1]),this.addNamespaces(i);let A=qh(this.data,_)||{};o?tE(A,n,r):A=Ie(Ie({},A),n),L_(this.data,_,A),u.silent||this.emit("added",t,i,n)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ie({},this.getResource(t,i)):this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(o=>i[o]&&Object.keys(i[o]).length>0)}toJSON(){return this.data}}var iE={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,n,o){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,n,o))}),t}};const D_={};class Jh extends of{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),D5(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ir.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,i);return n&&n.res!==void 0}extractFromKey(t,i){let n=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const u=n&&t.indexOf(n)>-1,_=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!F5(t,n,o);if(u&&!_){const A=t.match(this.interpolator.nestingRegexp);if(A&&A.length>0)return{key:t,namespaces:r};const E=t.split(n);(n!==o||n===o&&this.options.ns.indexOf(E[0])>-1)&&(r=E.shift()),t=E.join(o)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,n){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i=Ie({},i)),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:u,namespaces:_}=this.extractFromKey(t[t.length-1],i),A=_[_.length-1],E=i.lng||this.language,H=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(H){const G=i.nsSeparator||this.options.nsSeparator;return o?{res:`${A}${G}${u}`,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:`${A}${G}${u}`}return o?{res:u,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:u}const q=this.resolve(t,i);let g=q&&q.res;const te=q&&q.usedKey||u,W=q&&q.exactUsedKey||u,C=Object.prototype.toString.apply(g),Y=["[object Number]","[object Function]","[object RegExp]"],Z=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,K=!this.i18nFormat||this.i18nFormat.handleAsObject;if(K&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&Y.indexOf(C)<0&&!(typeof Z=="string"&&C==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const G=this.options.returnedObjectHandler?this.options.returnedObjectHandler(te,g,Ue(Ie({},i),{ns:_})):`key '${u} (${this.language})' returned an object instead of string.`;return o?(q.res=G,q):G}if(r){const G=C==="[object Array]",j=G?[]:{},B=G?W:te;for(const z in g)if(Object.prototype.hasOwnProperty.call(g,z)){const O=`${B}${r}${z}`;j[z]=this.translate(O,Ue(Ie({},i),{joinArrays:!1,ns:_})),j[z]===O&&(j[z]=g[z])}g=j}}else if(K&&typeof Z=="string"&&C==="[object Array]")g=g.join(Z),g&&(g=this.extendTranslation(g,t,i,n));else{let G=!1,j=!1;const B=i.count!==void 0&&typeof i.count!="string",z=Jh.hasDefaultValue(i),O=B?this.pluralResolver.getSuffix(E,i.count,i):"",R=i.ordinal&&B?this.pluralResolver.getSuffix(E,i.count,{ordinal:!1}):"",T=i[`defaultValue${O}`]||i[`defaultValue${R}`]||i.defaultValue;!this.isValidLookup(g)&&z&&(G=!0,g=T),this.isValidLookup(g)||(j=!0,g=u);const m=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:g,S=z&&T!==g&&this.options.updateMissing;if(j||G||S){if(this.logger.log(S?"updateKey":"missingKey",E,A,u,S?T:g),r){const U=this.resolve(u,Ue(Ie({},i),{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let y=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let U=0;U<P.length;U++)y.push(P[U]);else this.options.saveMissingTo==="all"?y=this.languageUtils.toResolveHierarchy(i.lng||this.language):y.push(i.lng||this.language);const F=(U,N,b)=>{const x=z&&b!==g?b:m;this.options.missingKeyHandler?this.options.missingKeyHandler(U,A,N,x,S,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(U,A,N,x,S,i),this.emit("missingKey",U,A,N,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?y.forEach(U=>{this.pluralResolver.getSuffixes(U,i).forEach(N=>{F([U],u+N,i[`defaultValue${N}`]||T)})}):F(y,u,T))}g=this.extendTranslation(g,t,i,q,n),j&&g===u&&this.options.appendNamespaceToMissingKey&&(g=`${A}:${u}`),(j||G)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}:${u}`:u,G?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(q.res=g,q):g}extendTranslation(t,i,n,o,r){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,Ie(Ie({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Ue(Ie({},n),{interpolation:Ie(Ie({},this.options.interpolation),n.interpolation)}));const E=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let H;if(E){const g=t.match(this.interpolator.nestingRegexp);H=g&&g.length}let q=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(q=Ie(Ie({},this.options.interpolation.defaultVariables),q)),t=this.interpolator.interpolate(t,q,n.lng||this.language,n),E){const g=t.match(this.interpolator.nestingRegexp),te=g&&g.length;H<te&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(n.lng=o.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,te=new Array(g),W=0;W<g;W++)te[W]=arguments[W];return r&&r[0]===te[0]&&!n.context?(u.logger.warn(`It seems you are nesting recursively key: ${te[0]} in key: ${i[0]}`),null):u.translate(...te,i)},n)),n.interpolation&&this.interpolator.reset()}const _=n.postProcess||this.options.postProcess,A=typeof _=="string"?[_]:_;return t!=null&&A&&A.length&&n.applyPostProcessor!==!1&&(t=iE.handle(A,t,i,this.options&&this.options.postProcessPassResolved?Ie({i18nResolved:o},n):n,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,r,u,_;return typeof t=="string"&&(t=[t]),t.forEach(A=>{if(this.isValidLookup(n))return;const E=this.extractFromKey(A,i),H=E.key;o=H;let q=E.namespaces;this.options.fallbackNS&&(q=q.concat(this.options.fallbackNS));const g=i.count!==void 0&&typeof i.count!="string",te=g&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),W=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",C=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);q.forEach(Y=>{this.isValidLookup(n)||(_=Y,!D_[`${C[0]}-${Y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(_)&&(D_[`${C[0]}-${Y}`]=!0,this.logger.warn(`key "${o}" for languages "${C.join(", ")}" won't get resolved as namespace "${_}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(Z=>{if(this.isValidLookup(n))return;u=Z;const K=[H];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(K,H,Z,Y,i);else{let G;g&&(G=this.pluralResolver.getSuffix(Z,i.count,i));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(K.push(H+G),i.ordinal&&G.indexOf(B)===0&&K.push(H+G.replace(B,this.options.pluralSeparator)),te&&K.push(H+j)),W){const z=`${H}${this.options.contextSeparator}${i.context}`;K.push(z),g&&(K.push(z+G),i.ordinal&&G.indexOf(B)===0&&K.push(z+G.replace(B,this.options.pluralSeparator)),te&&K.push(z+j))}}let J;for(;J=K.pop();)this.isValidLookup(n)||(r=J,n=this.getResource(Z,Y,J,i))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:u,usedNS:_}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,n,o):this.resourceStore.getResource(t,i,n,o)}static hasDefaultValue(t){const i="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i===n.substring(0,i.length)&&t[n]!==void 0)return!0;return!1}}function lg(e){return e.charAt(0).toUpperCase()+e.slice(1)}class I_{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ir.create("languageUtils")}getScriptPartFromCode(t){if(t=Kh(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=Kh(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(o=>o.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=lg(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=lg(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=lg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach(n=>{if(i)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(i=o)}),!i&&this.options.supportedLngs&&t.forEach(n=>{if(i)return;const o=this.getLanguagePartFromCode(n);if(this.isSupportedCode(o))return i=o;i=this.options.supportedLngs.find(r=>{if(r===o)return r;if(!(r.indexOf("-")<0&&o.indexOf("-")<0)&&r.indexOf(o)===0)return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];let n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}toResolveHierarchy(t,i){const n=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],r=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),n.forEach(u=>{o.indexOf(u)<0&&r(this.formatLanguageCode(u))}),o}}let W5=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],H5={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const $5=["v1","v2","v3"],U5=["v4"],R_={zero:0,one:1,two:2,few:3,many:4,other:5};function V5(){const e={};return W5.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:H5[t.fc]}})}),e}class G5{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=ir.create("pluralResolver"),(!this.options.compatibilityJSON||U5.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=V5()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Kh(t),{type:i.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(o=>`${i}${o}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((o,r)=>R_[o]-R_[r]).map(o=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o}`):n.numbers.map(o=>this.getSuffix(t,o,i)):[]}getSuffix(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,n);return o?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(i)}`:this.getSuffixRetroCompatible(o,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const n=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let o=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const r=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!$5.includes(this.options.compatibilityJSON)}}function j_(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=R5(e,t,i);return!r&&o&&typeof i=="string"&&(r=Zh(e,i,n),r===void 0&&(r=Zh(t,i,n))),r}class Y5{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const i=t.interpolation;this.escape=i.escape!==void 0?i.escape:B5,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?ws(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?ws(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?ws(i.nestingPrefix):i.nestingPrefixEscaped||ws("$t("),this.nestingSuffix=i.nestingSuffix?ws(i.nestingSuffix):i.nestingSuffixEscaped||ws(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const i=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(i,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,i,n,o){let r,u,_;const A=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function E(W){return W.replace(/\$/g,"$$$$")}const H=W=>{if(W.indexOf(this.formatSeparator)<0){const K=j_(i,A,W,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(K,void 0,n,Ue(Ie(Ie({},o),i),{interpolationkey:W})):K}const C=W.split(this.formatSeparator),Y=C.shift().trim(),Z=C.join(this.formatSeparator).trim();return this.format(j_(i,A,Y,this.options.keySeparator,this.options.ignoreJSONStructure),Z,n,Ue(Ie(Ie({},o),i),{interpolationkey:Y}))};this.resetRegExp();const q=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:W=>E(W)},{regex:this.regexp,safeValue:W=>this.escapeValue?E(this.escape(W)):E(W)}].forEach(W=>{for(_=0;r=W.regex.exec(t);){const C=r[1].trim();if(u=H(C),u===void 0)if(typeof q=="function"){const Z=q(t,r,o);u=typeof Z=="string"?Z:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))u="";else if(g){u=r[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),u="";else typeof u!="string"&&!this.useRawValueToEscape&&(u=O_(u));const Y=W.safeValue(u);if(t=t.replace(r[0],Y),g?(W.regex.lastIndex+=u.length,W.regex.lastIndex-=r[0].length):W.regex.lastIndex=0,_++,_>=this.maxReplaces)break}}),t}nest(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,r,u;function _(A,E){const H=this.nestingOptionsSeparator;if(A.indexOf(H)<0)return A;const q=A.split(new RegExp(`${H}[ ]*{`));let g=`{${q[1]}`;A=q[0],g=this.interpolate(g,u);const te=g.match(/'/g),W=g.match(/"/g);(te&&te.length%2===0&&!W||W.length%2!==0)&&(g=g.replace(/'/g,'"'));try{u=JSON.parse(g),E&&(u=Ie(Ie({},E),u))}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${A}`,C),`${A}${H}${g}`}return delete u.defaultValue,A}for(;o=this.nestingRegexp.exec(t);){let A=[];u=Ie({},n),u=u.replace&&typeof u.replace!="string"?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;let E=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const H=o[1].split(this.formatSeparator).map(q=>q.trim());o[1]=H.shift(),A=H,E=!0}if(r=i(_.call(this,o[1].trim(),u),u),r&&o[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=O_(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),r=""),E&&(r=A.reduce((H,q)=>this.format(H,q,n.lng,Ue(Ie({},n),{interpolationkey:o[1].trim()})),r.trim())),t=t.replace(o[0],r),this.regexp.lastIndex=0}return t}}function X5(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);t==="currency"&&o.indexOf(":")<0?i.currency||(i.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?i.range||(i.range=o.trim()):o.split(";").forEach(u=>{if(!u)return;const[_,...A]=u.split(":"),E=A.join(":").trim().replace(/^'+|'+$/g,"");i[_.trim()]||(i[_.trim()]=E),E==="false"&&(i[_.trim()]=!1),E==="true"&&(i[_.trim()]=!0),isNaN(E)||(i[_.trim()]=parseInt(E,10))})}return{formatName:t,formatOptions:i}}function _s(e){const t={};return function(n,o,r){const u=o+JSON.stringify(r);let _=t[u];return _||(_=e(Kh(o),r),t[u]=_),_(n)}}class q5{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("formatter"),this.options=t,this.formats={number:_s((i,n)=>{const o=new Intl.NumberFormat(i,Ie({},n));return r=>o.format(r)}),currency:_s((i,n)=>{const o=new Intl.NumberFormat(i,Ue(Ie({},n),{style:"currency"}));return r=>o.format(r)}),datetime:_s((i,n)=>{const o=new Intl.DateTimeFormat(i,Ie({},n));return r=>o.format(r)}),relativetime:_s((i,n)=>{const o=new Intl.RelativeTimeFormat(i,Ie({},n));return r=>o.format(r,n.range||"day")}),list:_s((i,n)=>{const o=new Intl.ListFormat(i,Ie({},n));return r=>o.format(r)})},this.init(t)}init(t){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=_s(i)}format(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((_,A)=>{const{formatName:E,formatOptions:H}=X5(A);if(this.formats[E]){let q=_;try{const g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},te=g.locale||g.lng||o.locale||o.lng||n;q=this.formats[E](_,te,Ie(Ie(Ie({},H),o),g))}catch(g){this.logger.warn(g)}return q}else this.logger.warn(`there was no format function for ${E}`);return _},t)}}function Z5(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class K5 extends of{constructor(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=ir.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,o.backend,o)}queueLoad(t,i,n,o){const r={},u={},_={},A={};return t.forEach(E=>{let H=!0;i.forEach(q=>{const g=`${E}|${q}`;!n.reload&&this.store.hasResourceBundle(E,q)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?u[g]===void 0&&(u[g]=!0):(this.state[g]=1,H=!1,u[g]===void 0&&(u[g]=!0),r[g]===void 0&&(r[g]=!0),A[q]===void 0&&(A[q]=!0)))}),H||(_[E]=!0)}),(Object.keys(r).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(u),toLoadLanguages:Object.keys(_),toLoadNamespaces:Object.keys(A)}}loaded(t,i,n){const o=t.split("|"),r=o[0],u=o[1];i&&this.emit("failedLoading",r,u,i),n&&this.store.addResourceBundle(r,u,n),this.state[t]=i?-1:2;const _={};this.queue.forEach(A=>{I5(A.loaded,[r],u),Z5(A,t),i&&A.errors.push(i),A.pendingCount===0&&!A.done&&(Object.keys(A.loaded).forEach(E=>{_[E]||(_[E]={});const H=A.loaded[E];H.length&&H.forEach(q=>{_[E][q]===void 0&&(_[E][q]=!0)})}),A.done=!0,A.errors.length?A.callback(A.errors):A.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(A=>!A.done)}read(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:n,tried:o,wait:r,callback:u});return}this.readingCalls++;const _=(E,H)=>{if(this.readingCalls--,this.waitingReads.length>0){const q=this.waitingReads.shift();this.read(q.lng,q.ns,q.fcName,q.tried,q.wait,q.callback)}if(E&&H&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,n,o+1,r*2,u)},r);return}u(E,H)},A=this.backend[n].bind(this.backend);if(A.length===2){try{const E=A(t,i);E&&typeof E.then=="function"?E.then(H=>_(null,H)).catch(_):_(null,E)}catch(E){_(E)}return}return A(t,i,_)}prepareLoading(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(u=>{this.loadOne(u)})}load(t,i,n){this.prepareLoading(t,i,{},n)}reload(t,i,n){this.prepareLoading(t,i,{reload:!0},n)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,(u,_)=>{u&&this.logger.warn(`${i}loading namespace ${r} for language ${o} failed`,u),!u&&_&&this.logger.log(`${i}loaded namespace ${r} for language ${o}`,_),this.loaded(t,u,_)})}saveMissing(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},_=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${n}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const A=Ue(Ie({},u),{isUpdate:r}),E=this.backend.create.bind(this.backend);if(E.length<6)try{let H;E.length===5?H=E(t,i,n,o,A):H=E(t,i,n,o),H&&typeof H.then=="function"?H.then(q=>_(null,q)).catch(_):_(null,H)}catch(H){_(H)}else E(t,i,n,o,_,A)}!t||!t[0]||this.store.addResource(t[0],i,n,o)}}}function B_(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let i={};if(typeof t[1]=="object"&&(i=t[1]),typeof t[1]=="string"&&(i.defaultValue=t[1]),typeof t[2]=="string"&&(i.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(o=>{i[o]=n[o]})}return i},interpolation:{escapeValue:!0,format:(e,t,i,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function z_(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Od(){}function J5(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(i=>{typeof e[i]=="function"&&(e[i]=e[i].bind(e))})}class Kc extends of{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=z_(t),this.services={},this.logger=ir,this.modules={external:[]},J5(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=B_();this.options=Ie(Ie(Ie({},o),this.options),z_(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ie(Ie({},o.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(H){return H?typeof H=="function"?new H:H:null}if(!this.options.isClone){this.modules.logger?ir.init(r(this.modules.logger),this.options):ir.init(null,this.options);let H;this.modules.formatter?H=this.modules.formatter:typeof Intl!="undefined"&&(H=q5);const q=new I_(this.options);this.store=new N_(this.options.resources,this.options);const g=this.services;g.logger=ir,g.resourceStore=this.store,g.languageUtils=q,g.pluralResolver=new G5(q,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),H&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(g.formatter=r(H),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Y5(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new K5(r(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(te){for(var W=arguments.length,C=new Array(W>1?W-1:0),Y=1;Y<W;Y++)C[Y-1]=arguments[Y];t.emit(te,...C)}),this.modules.languageDetector&&(g.languageDetector=r(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=r(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new Jh(this.services,this.options),this.translator.on("*",function(te){for(var W=arguments.length,C=new Array(W>1?W-1:0),Y=1;Y<W;Y++)C[Y-1]=arguments[Y];t.emit(te,...C)}),this.modules.external.forEach(te=>{te.init&&te.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Od),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const H=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);H.length>0&&H[0]!=="dev"&&(this.options.lng=H[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(H=>{this[H]=function(){return t.store[H](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(H=>{this[H]=function(){return t.store[H](...arguments),t}});const A=Jl(),E=()=>{const H=(q,g)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),A.resolve(g),n(q,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return H(null,this.t.bind(this));this.changeLanguage(this.options.lng,H)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),A}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Od;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode")return n();const r=[],u=_=>{if(!_)return;this.services.languageUtils.toResolveHierarchy(_).forEach(E=>{r.indexOf(E)<0&&r.push(E)})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(A=>u(A)),this.options.preload&&this.options.preload.forEach(_=>u(_)),this.services.backendConnector.load(r,this.options.ns,_=>{!_&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(_)})}else n(null)}reloadResources(t,i,n){const o=Jl();return t||(t=this.languages),i||(i=this.options.ns),n||(n=Od),this.services.backendConnector.reload(t,i,r=>{o.resolve(),n(r)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&iE.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let i=0;i<this.languages.length;i++){const n=this.languages[i];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,i){var n=this;this.isLanguageChangingTo=t;const o=Jl();this.emit("languageChanging",t);const r=A=>{this.language=A,this.languages=this.services.languageUtils.toResolveHierarchy(A),this.resolvedLanguage=void 0,this.setResolvedLanguage(A)},u=(A,E)=>{E?(r(E),this.translator.changeLanguage(E),this.isLanguageChangingTo=void 0,this.emit("languageChanged",E),this.logger.log("languageChanged",E)):this.isLanguageChangingTo=void 0,o.resolve(function(){return n.t(...arguments)}),i&&i(A,function(){return n.t(...arguments)})},_=A=>{!t&&!A&&this.services.languageDetector&&(A=[]);const E=typeof A=="string"?A:this.services.languageUtils.getBestMatchFromCodes(A);E&&(this.language||r(E),this.translator.language||this.translator.changeLanguage(E),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(E)),this.loadResources(E,H=>{u(H,E)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(_):this.services.languageDetector.detect(_):_(t),o}getFixedT(t,i,n){var o=this;const r=function(u,_){let A;if(typeof _!="object"){for(var E=arguments.length,H=new Array(E>2?E-2:0),q=2;q<E;q++)H[q-2]=arguments[q];A=o.options.overloadTranslationOptionHandler([u,_].concat(H))}else A=Ie({},_);A.lng=A.lng||r.lng,A.lngs=A.lngs||r.lngs,A.ns=A.ns||r.ns,A.keyPrefix=A.keyPrefix||n||r.keyPrefix;const g=o.options.keySeparator||".";let te;return A.keyPrefix&&Array.isArray(u)?te=u.map(W=>`${A.keyPrefix}${g}${W}`):te=A.keyPrefix?`${A.keyPrefix}${g}${u}`:u,o.t(te,A)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=n,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=i.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=this.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};if(i.precheck){const _=i.precheck(this,u);if(_!==void 0)return _}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(n,t)&&(!o||u(r,t)))}loadNamespaces(t,i){const n=Jl();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),i&&i(o)}),n):(i&&i(),Promise.resolve())}loadLanguages(t,i){const n=Jl();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],r=t.filter(u=>o.indexOf(u)<0);return r.length?(this.options.preload=o.concat(r),this.loadResources(u=>{n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new I_(B_());return i.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new Kc(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Od;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const o=Ue(Ie(Ie({},this.options),t),{isClone:!0}),r=new Kc(o);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(_=>{r[_]=this[_]}),r.services=Ie({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n&&(r.store=new N_(this.store.data,o),r.services.resourceStore=r.store),r.translator=new Jh(r.services,o),r.translator.on("*",function(_){for(var A=arguments.length,E=new Array(A>1?A-1:0),H=1;H<A;H++)E[H-1]=arguments[H];r.emit(_,...E)}),r.init(o,i),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const nE=Kc.createInstance();nE.createInstance=Kc.createInstance;const Q5={error:"Error"},ez={error:"Помилка"},F_="common",tz={en:Q5,uk:ez},Go=nE.createInstance({defaultNS:F_,resources:iz(tz,F_),lng:"en",fallbackLng:"en"}),ax={i18nextInstance:Go,initPromise:Go.init().then(()=>Go)},Sh=new Map;Sh.set("common",ax);const sx=e=>{if(Sh.has(e.namespace))return Sh.get(e.namespace);if(e.plugins)for(const r of e.plugins)Go.use(r);Object.keys(e.resource).forEach(r=>{Go.addResourceBundle(r,e.namespace,e.resource[r])});const t=Go.cloneInstance({defaultNS:e.namespace});let i=ax.initPromise.then(()=>t);t.on("languageChanged",r=>{Go.language!==r&&Go.changeLanguage(r)}),Go.on("languageChanged",r=>{t.language!==r&&t.changeLanguage(r)});const n=e.language||"en";Go.language!==n&&(i=i.then(()=>t.changeLanguage(n)).then(()=>t));const o={initPromise:i,i18nextInstance:t};return Sh.set(e.namespace,o),o};function iz(e,t){return Object.keys(e).reduce((i,n)=>(i[n]={[t]:e[n]},i),{})}class lx extends Error{constructor(t,i,n){const{key:o,interpolationOptions:r}=i,u=n||ax.i18nextInstance.t,_=Object.assign(Object.assign({},r),{ns:t}),A=u(o,Object.assign(Object.assign({},_),{lng:"en"}));super(A),this.key=o,this.namespace=t,this.interpolationOptions=_}}function oE(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Qh.apply(this,arguments)}var Ba=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nz(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),i}function oz(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const W_={};function Sy(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&W_[t[0]]||(typeof t[0]=="string"&&(W_[t[0]]=new Date),oz(...t))}const rE=(e,t)=>()=>{if(e.isInitialized)t();else{const i=()=>{setTimeout(()=>{e.off("initialized",i)},0),t()};e.on("initialized",i)}};function H_(e,t,i){e.loadNamespaces(t,rE(e,i))}function $_(e,t,i,n){typeof i=="string"&&(i=[i]),i.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,rE(e,n))}function rz(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=t.languages[0],o=t.options?t.options.fallbackLng:!1,r=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=t.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};return i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!u(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||u(n,e)&&(!o||u(r,e)))}function az(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Sy("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:i.lng,precheck:(o,r)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!r(o.isLanguageChangingTo,e))return!1}}):rz(e,t,i)}const sz=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,lz={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},cz=e=>lz[e],uz=e=>e.replace(sz,cz);let Ty={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uz};function dz(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ty=Ie(Ie({},Ty),e)}function hz(){return Ty}let aE;function pz(e){aE=e}function fz(){return aE}const mz={type:"3rdParty",init(e){dz(e.options.react),pz(e)}},sE=Je.createContext();class gz{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const vz=(e,t)=>{const i=Je.useRef();return Je.useEffect(()=>{i.current=e},[e,t]),i.current};function rf(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:i}=t,{i18n:n,defaultNS:o}=Je.useContext(sE)||{},r=i||n||fz();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new gz),!r){Sy("You will need to pass in an i18next instance by using initReactI18next");const J=(j,B)=>typeof B=="string"?B:B&&typeof B=="object"&&typeof B.defaultValue=="string"?B.defaultValue:Array.isArray(j)?j[j.length-1]:j,G=[J,{},!1];return G.t=J,G.i18n={},G.ready=!1,G}r.options.react&&r.options.react.wait!==void 0&&Sy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const u=Ie(Ie(Ie({},hz()),r.options.react),t),{useSuspense:_,keyPrefix:A}=u;let E=o||r.options&&r.options.defaultNS;E=typeof E=="string"?[E]:E||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(E);const H=(r.isInitialized||r.initializedStoreOnce)&&E.every(J=>az(J,r,u));function q(){return r.getFixedT(t.lng||null,u.nsMode==="fallback"?E:E[0],A)}const[g,te]=Je.useState(q);let W=E.join();t.lng&&(W=`${t.lng}${W}`);const C=vz(W),Y=Je.useRef(!0);Je.useEffect(()=>{const{bindI18n:J,bindI18nStore:G}=u;Y.current=!0,!H&&!_&&(t.lng?$_(r,t.lng,E,()=>{Y.current&&te(q)}):H_(r,E,()=>{Y.current&&te(q)})),H&&C&&C!==W&&Y.current&&te(q);function j(){Y.current&&te(q)}return J&&r&&r.on(J,j),G&&r&&r.store.on(G,j),()=>{Y.current=!1,J&&r&&J.split(" ").forEach(B=>r.off(B,j)),G&&r&&G.split(" ").forEach(B=>r.store.off(B,j))}},[r,W]);const Z=Je.useRef(!0);Je.useEffect(()=>{Y.current&&!Z.current&&te(q),Z.current=!1},[r,A]);const K=[g,r,H];if(K.t=g,K.i18n=r,K.ready=H,H||!H&&!_)return K;throw new Promise(J=>{t.lng?$_(r,t.lng,E,()=>J()):H_(r,E,()=>J())})}const yz={errors:{noSisenseContext:"Sisense context is not initialized",restApiNotReady:"Rest API is not initialized",componentRenderError:"Unable to render the component",sisenseContextNoAuthentication:"Authentication method is not specified",chartNoSisenseContext:"Sisense Context for Chart not found. To fix, add a dataSet to the Chart or wrap the component inside a Sisense context provider.",widgetByIdNoSisenseContext:"Sisense Context for Dashboard Widget not found. To fix, wrap the component inside a Sisense context provider.",widgetByIdInvalidIdentifier:"Failed to retrieve widget. Please make sure the dashboard widget exists and is accessible.",dashboardWidgetsInvalidIdentifiers:"Failed to retrieve dashboard widgets. Please make sure the dashboard exists and is accessible.",executeQueryNoSisenseContext:"Sisense Context for query execution not found. To fix, wrap the component inside a Sisense context provider.",executeQueryNoDataSource:"No dataSource provided to execute query",dataOptions:{noDimensionsAndMeasures:"Neither dimensions nor measures found. Data options should have at least one dimension or measure.",attributeNotFound:'Attribute "{{attributeName}}" not found in the data',measureNotFound:'Measure "{{measureName}}" not found in the data',filterAttributeNotFound:'Filter attribute "{{attributeName}}" not found in the data',highlightAttributeNotFound:'Highlight attribute "{{attributeName}}" not found in the data'},optionsTranslation:{invalidStyleOptions:"Invalid style options for '{{chartType}}' chart",invalidInternalDataOptions:"Data options are not correctly converted for '{{chartType}}' chart"},themeNotFound:"Theme with oid {{themeOid}} not found in the Sisense instance",paletteNotFound:"Palette '{{paletteName}}' not found in the Sisense instance",chartTypeNotSupported:"Chart type {{chartType}} is not supported",chartInvalidProps:"Invalid chart props",unsupportedWidgetType:"Can't extract props for unsupported widget type - {{widgetType}}",sisenseContextNotFound:"Sisense Context not found. Please ensure it is provided.",dashboardInvalidIdentifier:"Failed to retrieve dashboard. Please make sure the dashboard exists and is accessible.",sharedFormula:{identifierExpected:"Failed to identify shared formula. Please provide oid or both name and datasource",failedToFetch:"Failed to fetch shared formula"},widgetModel:{incomleteWidget:"Widget can not be transformed to DTO because of incomplete property ({{prop}})",unsupportedWidgetTypeDto:"Saving the widget of type {{chartType}} is not supported",pivotWidgetNotSupported:"Pivot widget is not supported for method {{methodName}}",textWidgetNotSupported:"Text widget is not supported for method {{methodName}}",onlyTableWidgetSupported:"Only table widget is supported for method {{methodName}}",onlyPivotWidgetSupported:"Only pivot widget is supported for method {{methodName}}",onlyTextWidgetSupported:"Only text widget is supported for method {{methodName}}",onlyPluginWidgetSupported:"Only plugin widget is supported for method {{methodName}}",unsupportedWidgetType:"Unsupported widget type: {{widgetType}}",unsupportedFusionWidgetType:"Unsupported Fusion widget type: {{widgetType}}"},unknownFilterInFilterRelations:"Filter relations contain unknown filter",filterRelationsNotSupported:"Filter relations not supported yet",invalidFilterType:"Invalid filter type",secondsDateTimeLevelSupportedOnlyForLive:"Seconds datetime level is supported only for the 'live' datasource",missingMenuRoot:"Missing initialized menu root",missingModalRoot:"Missing initialized modal root",missingDataSource:"The 'dataSource' value is missing. It must be provided explicitly, or a 'defaultDataSource' should be specified in the Sisense context provider.",incorrectOnDataReadyHandler:"'onDataReady' handler must return a valid data object",undefinedDataSource:"Data source is not defined",emptyModel:"Empty model",missingMetadata:"Missing metadata",missingModelTitle:"Missing model title",httpClientNotFound:"HttpClient not found.",serverSettingsNotLoaded:"Failed to load server settings",requiredColumnMissing:"Missing required column",unexpectedChartType:"Unexpected chart type: {{chartType}}",noRowNumColumn:"Data has no row num column",ticIntervalCalculationFailed:"Unable to calculate tic interval. Try specifying datetime granularity.",polarChartDesignOptionsExpected:"Polar chart design options expected for polar chart",polarChartDesignOptionsNotExpected:"Polar chart design options not expected for non-polar chart",indicatorInvalidRelativeSize:"Invalid relative size options",unsupportedMapType:"Unsupported map type: {{mapType}}",mapLoadingFailed:"Failed loading map",cascadingFilterOriginalNotFound:"Error in cascading filters reassembling. Original cascading filter not found",dashboardLoadFailed:"Failed to load Dashboard. {{error}}",widgetLoadFailed:"Failed to load Widget. {{error}}",dashboardWithOidNotFound:"Dashboard with oid {{dashboardOid}} not found",failedToAddWidget:"Failed to add widget to dashboard",widgetWithOidNotFound:"Widget with oid {{widgetOid}} not found",widgetWithOidNotFoundInDashboard:"Widget with oid {{widgetOid}} not found in dashboard with oid {{dashboardOid}}",widgetEmptyResponse:"Empty response for widget with oid {{widgetOid}}",dateFilterIncorrectOperator:"Incorrect operator: {{operator}}",synchronizedFilterInvalidProps:"`useSynchronizedFilter` hook must take at least one of [non-null `filterFromProps`] or [`createEmptyFilter` function]",methodNotImplemented:"Method not implemented.",noPivotClient:"Pivot client not initialized",unexpectedCacheValue:"Unexpected cache value",notAMembersFilter:"Filter is not a MembersFilter",drilldownNoInitialDimension:"Initial dimension has to be specified to use drilldown with custom components",otherWidgetTypesNotSupported:"Other widget types are not supported yet",dataBrowser:{dimensionNotFound:"Dimension with id {{dimensionId}} not found",attributeNotFound:"Attribute with id {{attributeId}} not found"},addFilterPopover:{noDataSources:"No data sources available. Try to define `dataSource` in widgets or `defaultDataSource` on the dashboard level."},tabberInvalidConfiguration:"Tabber widget configuration is invalid"},errorBoxText:"$t(common:error): {{errorMessage}}",chartNoData:"No Results",filters:"Filters",widgetDetails:"Widget Details",cancel:"Cancel",includeAll:"Include all",formatting:{number:{abbreviations:{thousand:"K",million:"M",billion:"B",trillion:"T"}}},criteriaFilter:{displayModePrefix:"All items",equals:"Equals {{val}}",notEquals:"Does not equal {{val}}",lessThan:"Less than {{val}}",lessThanOrEqual:"Less than or equal to {{val}}",greaterThan:"Greater than {{val}}",greaterThanOrEqual:"Greater than or equal to {{val}}",between:"Between {{valA}} and {{valB}}",notBetween:"Not between {{valA}} and {{valB}}",top:"Top {{valA}} by {{valB}}",bottom:"Last {{valA}} by {{valB}}",is:"Is {{val}}",isNot:"Is not {{val}}",contains:"Contains {{val}}",notContains:"Doesn't contain {{val}}",startsWith:"Starts with {{val}}",notStartsWith:"Doesn't start with {{val}}",endsWith:"Ends with {{val}}",notEndsWith:"Doesn't end with {{val}}",like:"Is like {{val}}",byMeasure:"By measure",by:"by"},dateFilter:{last:"Last",next:"Next",from:"From",to:"To",count:"Count",select:"Select",today:"Today",days:"Days",weeks:"Weeks",months:"Months",quarters:"Quarters",years:"Years",earliestDate:"Earliest Date",latestDate:"Latest Date",todayOutOfRange:"Today is out of available date range",dateRange:{fromTo:"{{from}} to {{to}}",from:"From {{val}}",to:"To {{val}}"}},boxplot:{tooltip:{whiskers:"Whiskers",box:"Box",min:"Min",median:"Median",max:"Max"}},treemap:{tooltip:{ofTotal:"of total",of:"of"}},advanced:{tooltip:{min:"Lower Bound",max:"Upper Bound",forecastValue:"Forecast Value",forecast:"Forecast",trend:"Trend",trendLocalValue:"Local Value",confidenceInterval:"Confidence Interval",trendType:"Type",trendDataKey:"Trend Data",trendData:{min:"Min",max:"Max",median:"Median",average:"Average"}}},arearange:{tooltip:{min:"Min",max:"Max"}},unsupportedFilterMessage:"Unsupported Filter (applied to the data query)",unsupportedFilter:"Unsupported filter {{filter}}",commonFilter:{clearSelectionButton:"Clear Selection",selectMenuItem:"Select",unselectMenuItem:"Un-Select"},customFilterTileMessage:"filtered with custom filter",filterRelations:{and:"AND",or:"OR",andOrFormulaApplied:"AND/OR Formula applied"},drilldown:{drillMenuItem:"Drill",breadcrumbsAllSuffix:"All",breadcrumbsPrev:"Prev",breadcrumbsNext:"Next",popover:{members:"Members",table:"Table",column:"Column"}},widgetHeader:{info:{details:"Widget Details",tooltip:"Click to view full details"}},plugins:{registerPrompt:"Unknown plugin type: {{pluginType}}. Please register this plugin so it can be rendered."},ai:{analyticsChatbot:"Analytics Chatbot",dataTopics:"Data Topics",chatbotDescription:"Analytics Chatbot is designed to help you interact with your data using natural language.",topicSelectPrompt:"Pick a topic you would like to explore:",preview:"Preview",clearHistoryPrompt:"Do you want to clear this chat?",config:{inputPromptText:'Ask a question or type "/" for ideas',welcomeText:"Welcome to the Analytics Assistant! I can help you explore and gain insights from your data.",suggestionsWelcomeText:"Some questions you may have:"},buttons:{insights:"Insights",correctResponse:"Correct response",incorrectResponse:"Incorrect response",clearChat:"Clear chat",refresh:"Refresh",readMore:"Read more",collapse:"Collapse",yes:"Yes",no:"No",seeMore:"See more"},disclaimer:{poweredByAi:"Content is powered by AI, so surprises and mistakes are possible.",rateRequest:"Please rate responses so we can improve!"},errors:{chatUnavailable:"Chat unavailable. Please try again later.",fetchHistory:"Something went wrong and we were unable to retrieve the chat thread. Let's start over!",recommendationsNotAvailable:"Recommendations aren't available right now. Try again in a few minutes.",insightsNotAvailable:"No insights available.",VectorDBEmptyResponseError:"The AI configuration is not ready, please wait a few minutes and try again.",LlmBadConfigurationError:"The LLM configuration is wrong. Reach out to your Admin to update the LLM provider configuration.",ChartTypeUnsupportedError:"Requested chart type is not supported.",BlockedByLlmContentFiltering:"This question is blocked by our content management policy. Please try asking a different question.",LlmContextLengthExceedsLimitError:"Looks like you've reached the message length limit, please clear this conversation.",UserPromptExeedsLimitError:"The prompt exceeds the limit. Rephrase your question and use shorter prompt.",unexpectedChatResponse:"Oh snap, something went wrong. Please try again later or try asking a different question.",unexpected:"Oh snap, something went wrong. Please try again later.",unknownResponse:"Received unknown responseType, raw response=",invalidInput:"Invalid input",noAvailableDataTopics:"None of the provided data models or perspectives are available"}},attribute:{datetimeName:{years:"Years in {{columnName}}",quarters:"Quarters in {{columnName}}",months:"Months in {{columnName}}",weeks:"Weeks in {{columnName}}",days:"Days in {{columnName}}",hours:"Hours in {{columnName}}",minutes:"Minutes in {{columnName}}"}},filterEditor:{buttons:{apply:"Apply",cancel:"Cancel",selectAll:"Select All",clearAll:"Clear All"},labels:{includeAll:"Include all (no filter applied)",allowMultiSelection:"Allow multiselect for lists",from:"From",to:"To",includeCurrent:"Including current"},placeholders:{selectFromList:"Select from list",enterEntry:"Type your entry...",enterValue:"Enter value...",select:"Select"},conditions:{exclude:"Is not",contains:"Contains",notContain:"Does not contain",startsWith:"Starts with",notStartsWith:"Does not start with",endsWith:"Ends with",notEndsWith:"Does not end with",equals:"Equals",notEquals:"Does not equal",isEmpty:"Is empty",isNotEmpty:"Is not empty",lessThan:"Smaller than",lessThanOrEqual:"Equals or smaller than",greaterThan:"Greater than",greaterThanOrEqual:"Equals or greater than",isWithin:"Is within"},validationErrors:{invalidNumber:"Numbers only",invalidNumericRange:'"To" must be greater than "From"'},datetimeLevels:{year:"Year",quarter:"Quarter",month:"Month",week:"Week",day:"Day",aggrigatedHour:"Hour (aggregated)",aggrigatedMinutesRoundTo15:"15-min (aggregated)"},relativeTypes:{last:"Last",this:"This",next:"Next"},datetimePositions:{before:"Before",after:"After"}},dataBrowser:{addFilter:"Add Filter",selectField:"Select Field",configureFilter:"Configure Filter",noResults:"No results",searchPlaceholder:"Search"},pivotTable:{grandTotal:"Grand Total",subTotal:"{{value}} Total"},dashboard:{toolbar:{undo:"Undo",redo:"Redo",cancel:"Cancel",apply:"Apply",editLayout:"Edit Layout"}},jumpToDashboard:{defaultCaption:"Jump to"}},bz={errors:{noSisenseContext:"Контекст Sisense не ініціалізовано",restApiNotReady:"Rest API не ініціалізовано",componentRenderError:"Не вдалося відобразити компонент",sisenseContextNoAuthentication:"Не вказано метод аутентифікації",chartNoSisenseContext:"Контекст Sisense для діаграми не знайдено. Щоб виправити, додайте набір даних до Chart або оберніть компонент у SisenseContextProvider.",widgetByIdNoSisenseContext:"Контекст Sisense для віджета дашборди не знайдено. Щоб виправити, оберніть компонент у SisenseContextProvider.",widgetByIdInvalidIdentifier:"Не вдалося отримати віджет. Переконайтеся, що віджет дашборди існує і доступний.",dashboardWidgetsInvalidIdentifiers:"Не вдалося отримати віджети дашборди. Переконайтеся, що дашборда існує і доступна.",executeQueryNoSisenseContext:"Контекст Sisense для виконання запиту не знайдено. Щоб виправити, оберніть компонент у SisenseContextProvider.",executeQueryNoDataSource:"Не надано dataSource для виконання запиту",dataOptions:{noDimensionsAndMeasures:"Не знайдено ні dimension-ів, ні measure-ів. Параметри даних повинні мати щонайменше один dimension або measure.",attributeNotFound:'Атрибут "{{attributeName}}" не знайдено в даних',measureNotFound:'Measure "{{measureName}}" не знайдено в даних',filterAttributeNotFound:'Атрибут фільтра "{{attributeName}}" не знайдено в даних',highlightAttributeNotFound:'Атрибут виділення "{{attributeName}}" не знайдено в даних'},optionsTranslation:{invalidStyleOptions:"Недійсні параметри `styleOptions` для діаграми '{{chartType}}'",invalidInternalDataOptions:"Параметри `dataOptions` некоректно перетворені для діаграми '{{chartType}}'"},themeNotFound:"Тему з oid {{themeOid}} не знайдено на Sisense-сервері",paletteNotFound:'Палітру "{{paletteName}}" не знайдено на Sisense-сервері',chartTypeNotSupported:"Тип діаграми {{chartType}} не підтримується",chartInvalidProps:"Недійсні параметри діаграми",unsupportedWidgetType:"Неможливо отримати властивості для непідтримуваного типу віджета - {{widgetType}}",sisenseContextNotFound:"Контекст Sisense не знайдено. Переконайтеся, що він наданий.",dashboardInvalidIdentifier:"Не вдалося отримати дашборд. Переконайтеся, що дашборд існує і доступний.",sharedFormula:{identifierExpected:"Не вдалося ідентифікувати загальну формулу. Будь ласка, надайте oid або пару name та datasource",failedToFetch:"Не вдалося отримати спільну формулу"},widgetModel:{incomleteWidget:"Неможливо створити DTO віджету через неповноту властивості ({{prop}})",unsupportedWidgetTypeDto:"Сберігання віджету типу {{chartType}} не підтримується",pivotWidgetNotSupported:"Метод {{methodName}} не підтримується для півот віджету",textWidgetNotSupported:"Метод {{methodName}} не підтримується для текстового віджету",onlyTableWidgetSupported:"Метод {{methodName}} підтримується тільки для табличних віджетів",onlyPivotWidgetSupported:"Метод {{methodName}} підтримується тільки для півот віджетів",onlyTextWidgetSupported:"Метод {{methodName}} підтримується тільки для текстових віджетів",onlyPluginWidgetSupported:"Метод {{methodName}} підтримується тільки для плагінних віджетів",unsupportedWidgetType:"Тип віджету {{widgetType}} не підтримується",unsupportedFusionWidgetType:"Тип Fusion віджету {{widgetType}} не підтримується"},unknownFilterInFilterRelations:"Логічні відношення фільтрів містять невідомий фільтр",filterRelationsNotSupported:"Відносини фільтрів ще не підтримуються",invalidFilterType:"Недійсний тип фільтра",secondsDateTimeLevelSupportedOnlyForLive:"Рівень часу в секундах підтримується лише для 'live' джерела даних",missingMenuRoot:"Відсутній ініціалізований корінь меню",missingModalRoot:"Відсутній ініціалізований корінь модального вікна",missingDataSource:"Значення 'dataSource' відсутнє. Воно має бути передано явно, або 'defaultDataSource' має бути вказано в SisenseContextProvider.",incorrectOnDataReadyHandler:"'onDataReady' має повертати дійсний об'єкт даних",undefinedDataSource:"Не задане джерело даних",emptyModel:"Пуста модель",missingMetadata:"Поле metadata відсутнє",missingModelTitle:"Не знайдено заголовоку моделі",httpClientNotFound:"HttpClient не знайдено",serverSettingsNotLoaded:"Failed to load server settings",requiredColumnMissing:"Відсутній обов’язковий стовпець",unexpectedChartType:"Невідомий тип графіка: {{chartType}}",noRowNumColumn:"Дані не містять row num column",ticIntervalCalculationFailed:"Неможливо обрахувати tic interval. Спробуйте задати datetime granularity.",polarChartDesignOptionsExpected:"Polar chart design options очікуються для polar chart",polarChartDesignOptionsNotExpected:"Polar chart design options не очікуються для non-polar chart",indicatorInvalidRelativeSize:"Невірні опції relative size",unsupportedMapType:"Непідтримуваний тип мапи: {{mapType}}",mapLoadingFailed:"Не вдалося завантажити мапу",cascadingFilterOriginalNotFound:"Помилка при реструктуризації каскадних фільтрів. Оригінальний фільтр не знайдено",dashboardLoadFailed:"Не вдалося завантажити Dashboard. {{error}}",widgetLoadFailed:"Не вдалося завантажити віджет. {{error}}",dashboardWithOidNotFound:"Dashboard з oid {{dashboardOid}} не знайдено",failedToAddWidget:"Не вдалося додати віджет",widgetWithOidNotFound:"Віджет з oid {{widgetOid}} не знайдено",widgetWithOidNotFoundInDashboard:"Віджет з oid {{widgetOid}} не знайдено в Dashboard з oid {{dashboardOid}}",widgetEmptyResponse:"Пуста відповідь для віджета з oid {{widgetOid}}",dateFilterIncorrectOperator:"Некорректний оператор: {{operator}}",synchronizedFilterInvalidProps:"`useSynchronizedFilter` хук потребує одне з [non-null `filterFromProps`] чи [`createEmptyFilter` function]",methodNotImplemented:"Метод не реалізовано.",noPivotClient:"Pivot client не ініціалізовано",unexpectedCacheValue:"Неочікуване значення кешу",notAMembersFilter:"Фільтр не є MembersFilter",drilldownNoInitialDimension:"Initial dimension має бути задано щоб використовувати drilldown з користувацькими компонентами",otherWidgetTypesNotSupported:"Інші типи віджетів поки що не підтримуються",dataBrowser:{dimensionNotFound:"Dimension з id {{dimensionId}} не знайдено",attributeNotFound:"Attribute з id {{attributeId}} не знайдено"},addFilterPopover:{noDataSources:"Не знайдено жодного джерела даних. Спробуйте задати `dataSource` у віджетах або `defaultDataSource` на рівні дашборди."},tabberInvalidConfiguration:"Конфігурація Tabber віджета невірна"},errorBoxText:"$t(common:error): {{errorMessage}}",chartNoData:"Результатів немає",filters:"Фільтри",widgetDetails:"Деталі віджета",cancel:"Відміна",includeAll:"Всі елементи",formatting:{number:{abbreviations:{thousand:"Тис.",million:"Млн",billion:"Млрд",trillion:"Трлн"}}},criteriaFilter:{displayModePrefix:"Всі елементи",equals:"Дорівнює {{val}}",notEquals:"Не дорівнює {{val}}",lessThan:"Менше ніж {{val}}",lessThanOrEqual:"Менше або дорівнює {{val}}",greaterThan:"Більше ніж {{val}}",greaterThanOrEqual:"Більше або дорівнює {{val}}",between:"Між {{valA}} та {{valB}}",notBetween:"Не між {{valA}} та {{valB}}",top:"Перші {{valA}} за {{valB}}",bottom:"Останні {{valA}} за {{valB}}",is:"Є {{val}}",isNot:"Не є {{val}}",contains:"Містить {{val}}",notContains:"Не містить {{val}}",startsWith:"Починається з {{val}}",notStartsWith:"Не починається з {{val}}",endsWith:"Закінчується на {{val}}",notEndsWith:"Не закінчується на {{val}}",like:"Схоже на {{val}}",byMeasure:"By measure",by:"by"},dateFilter:{last:"Останній",next:"Наступний",from:"Від",to:"До",count:"Кількість",select:"Вибрати",today:"Сьогодні",days:"Дні",weeks:"Тижні",months:"Місяці",quarters:"Квартали",years:"Роки",earliestDate:"Найбільш Рання Дата",latestDate:"Найбільш Пізня Дата",todayOutOfRange:"Сьогоднішній день поза доступним діапазоном дат",dateRange:{fromTo:"{{from}} до {{to}}",from:"Від {{val}}",to:"До {{val}}"}},boxplot:{tooltip:{whiskers:"Вуса",box:"Коробка",min:"Мінімум",median:"Медіана",max:"Максимум"}},treemap:{tooltip:{ofTotal:"загальної кількості",of:"з"}},advanced:{tooltip:{min:"Lower Bound",max:"Upper Bound",forecastValue:"Forecast Value",forecast:"Forecast",trend:"Trend",trendLocalValue:"Local Value",confidenceInterval:"Confidence Interval",trendType:"Type",trendDataKey:"Trend Data",trendData:{min:"Min",max:"Max",median:"Median",average:"Average"}}},arearange:{tooltip:{min:"Мінімум",max:"Максимум"}},dashboard:{toolbar:{undo:"Скасувати",redo:"Повторити",cancel:"Відмінити",apply:"Застосувати",editLayout:"Редагувати макет"}},unsupportedFilterMessage:"Непідтримуваний Фільтр (застосовано до запиту даних)",unsupportedFilter:"Непідтримуваний фільтр {{filter}}",commonFilter:{clearSelectionButton:"Очистити виділення",selectMenuItem:"Вибрати",unselectMenuItem:"Cкасувати вибір"},customFilterTileMessage:"застосовано користувацький фільтр",drilldown:{drillMenuItem:"Деталізація",breadcrumbsAllSuffix:"Все",breadcrumbsPrev:"Попередній",breadcrumbsNext:"Наступний",popover:{members:"Учасники",table:"Таблиця",column:"Колонка"}},widgetHeader:{info:{details:"Деталі віджета",tooltip:"Натисніть щоб побачити повну інформацію"}},plugins:{registerPrompt:"Невідомий плагін: {{pluginType}}. Будь ласка зареєструйте цей плагін щоб він міг бути відображений."},ai:{analyticsChatbot:"Аналітичний чат-бот",dataTopics:"Теми Даних",chatbotDescription:"Аналітичний чат-бот розроблено, щоб допомогти вам взаємодіяти з вашими даними за допомогою розмовної мови.",topicSelectPrompt:"Виберіть тему, яку б ви хотіли дослідити:",preview:"Попередній перегляд",clearHistoryPrompt:"Ви дійсно хочете очистити чат?",config:{inputPromptText:"Поставте запитання або введіть «/» для отримання ідей",welcomeText:"Вітаємо в Аналітичному помічнику! Я можу допомогти вам досліджувати та зрозуміти ваші дані.",suggestionsWelcomeText:"Деякі запитання, які у вас можуть виникнути:"},buttons:{insights:"Інсайти",correctResponse:"Коректна відповідь",incorrectResponse:"Некоректна відповідь",clearChat:"Очистити чат",refresh:"Оновити",readMore:"Читати ще",collapse:"Згорнути",yes:"Так",no:"Ні",seeMore:"Більше"},disclaimer:{poweredByAi:"Вміст створено за допомогою ШІ, тому можливі несподіванки та помилки.",rateRequest:" Будь ласка, оцінюйте відповіді, щоб ми могли покращити продукт!"},errors:{chatUnavailable:"Чат недоступний. Спробуйте пізніше.",fetchHistory:"Щось пішло не так, і ми не змогли відновити історію чату. Почнімо спочатку!",recommendationsNotAvailable:"Наразі рекомендації недоступні. Спробуйте ще раз через кілька хвилин.",insightsNotAvailable:"Немає доступних інсайтів.",VectorDBEmptyResponseError:"AI ще конфігурується, будь ласка зачекайте та спробуйте ще раз за хвилинку чи дві.",LlmBadConfigurationError:"Схоже що LLM невірно сконфігурований. Зверніться до вашого Адміністратора щоб він оновив конфігурацію LLM провайдера.",ChartTypeUnsupportedError:"Графік такого типу покищо не підтримується.",BlockedByLlmContentFiltering:"Це питання заблоковано нашою політикою керування вмістом. Будь ласка спробуйте поставити інше запитання.",LlmContextLengthExceedsLimitError:"Схоже ви досягли ліміту кількості сповіщеннь, будь ласка очистіть поточний чат аби розпочати новий.",UserPromptExeedsLimitError:"Цей запит перевищює максимально дозволений ліміт. Будь ласка перефразуйте та зробіть запит коротше.",unexpectedChatResponse:"Ой, щось пішло не так. Повторіть спробу пізніше або спробуйте поставити інше запитання.",unexpected:"Ой, лихо! Шось йому стало. Спробуйте трохи пізніше.",unknownResponse:"Отримано невідомий тип відповіді, необроблена відповідь=",invalidInput:"Недійсне введення",noAvailableDataTopics:"Жодне з наданих моделей даних або перспектив доступне"}},filterRelations:{and:"І",or:"АБО",andOrFormulaApplied:"Застосовано формулу І/АБО"},attribute:{datetimeName:{years:"Роки в {{columnName}}",quarters:"Квартали в {{columnName}}",months:"Місяці в {{columnName}}",weeks:"Тижні в {{columnName}}",days:"Дні в {{columnName}}",hours:"Години в {{columnName}}",minutes:"Хвилини в {{columnName}}"}},filterEditor:{buttons:{apply:"Застосувати",cancel:"Відміна",selectAll:"Обрати всі",clearAll:"Очистити всі"},labels:{includeAll:"Обрати всі (фільтр не використовується)",allowMultiSelection:"Дозволити вибір кількох значень для списків",from:"Від",to:"До",includeCurrent:"Включаючи поточний"},placeholders:{selectFromList:"Виберіть зі списку",enterEntry:"Введіть значення...",enterValue:"Введіть значення...",select:"Вибрати"},conditions:{exclude:"Не є",contains:"Mістить",notContain:"Не містить",startsWith:"Починається з",notStartsWith:"Не починається з",endsWith:"Закінчується на",notEndsWith:"Не закінчується на",equals:"Дорівнює",notEquals:"Не дорівнює",isEmpty:"Порожній",isNotEmpty:"Не порожній",lessThan:"Менше ніж",lessThanOrEqual:"Менше або дорівнює",greaterThan:"Більше ніж",greaterThanOrEqual:"Більше або дорівнює",isWithin:"В межах"},validationErrors:{invalidNumber:"Тільки цифри",invalidNumericRange:'"До" має бути більше, ніж "Від"'},datetimeLevels:{year:"Year",quarter:"Quarter",month:"Month",week:"Week",day:"Day",aggrigatedHour:"Hour (aggregated)",aggrigatedMinutesRoundTo15:"15-min (aggregated)"},relativeTypes:{last:"Останній",this:"Поточний",next:"Наступний"},datetimePositions:{before:"Перед",after:"Після"}},pivotTable:{grandTotal:"Загальний підсумок",subTotal:"Усього {{value}}"},dataBrowser:{addFilter:"Додати фільтр",selectField:"Вибрати поле",configureFilter:"Налаштувати фільтр",noResults:"Немає результатів",searchPlaceholder:"Пошук"},jumpToDashboard:{defaultCaption:"Перейти до"}},cx="sdkUi",xz={en:yz,uk:bz};function lE(){return sx({resource:xz,plugins:[mz],language:"en",namespace:cx})}const{i18nextInstance:cE}=lE(),wz={errors:{measure:{unsupportedType:"Unsupported measure type",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure must have 'context' property"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",noAggAggregation:"DimensionalBaseMeasure must have 'agg' or 'aggregation' property"},notAFormula:"Jaql is not a formula"},dataModelConfig:{noName:"'name' must be specified in config for DataModel",noMetadata:"'metadata' must be specified in config for DataModel"},filter:{unsupportedType:"Unsupported filter type: {{filterType}}",unsupportedDatetimeLevel:'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter of {{attributeId}} - member cannot be null",unsupportedConditionFilter:"Jaql contains unsupported condition filter: {{filter}}",formulaFiltersNotSupported:"Formula-based filter not supported yet: {{filter}}"},unsupportedDimensionalElement:"Unsupported dimensional element type"}},_z={errors:{measure:{unsupportedType:"Непідтримуваний тип measure",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure має мати властивість 'context'"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",noAggAggregation:"DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'"},notAFormula:"Jaql не формула"},dataModelConfig:{noName:"'name' має бути вказано в конфігурації для DataModel",noMetadata:"'metadata' має бути вказано в конфігурації для DataModel"},filter:{unsupportedType:"Непідтримуваний тип фільтра: {{filterType}}",unsupportedDatetimeLevel:'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter у {{attributeId}} - member не може бути нульовим",unsupportedConditionFilter:"Jaql містить непідтримуваний condition фільтр: {{filter}}",formulaFiltersNotSupported:"Фільтри, що містять формули наразі не підтримуються: {{filter}}"},unsupportedDimensionalElement:"Непідтримуваний тип елемента"}},uE="sdkData",Cz={en:wz,uk:_z};function Sz(){return sx({resource:Cz,language:"en",namespace:uE})}const{i18nextInstance:Tz}=Sz();function Mz(){this.__data__=[],this.size=0}function Ru(e,t){return e===t||e!==e&&t!==t}function af(e,t){for(var i=e.length;i--;)if(Ru(e[i][0],t))return i;return-1}var kz=Array.prototype,Pz=kz.splice;function Az(e){var t=this.__data__,i=af(t,e);if(i<0)return!1;var n=t.length-1;return i==n?t.pop():Pz.call(t,i,1),--this.size,!0}function Ez(e){var t=this.__data__,i=af(t,e);return i<0?void 0:t[i][1]}function Oz(e){return af(this.__data__,e)>-1}function Lz(e,t){var i=this.__data__,n=af(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}function Wr(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Wr.prototype.clear=Mz;Wr.prototype.delete=Az;Wr.prototype.get=Ez;Wr.prototype.has=Oz;Wr.prototype.set=Lz;function Nz(){this.__data__=new Wr,this.size=0}function Dz(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function Iz(e){return this.__data__.get(e)}function Rz(e){return this.__data__.has(e)}var dE=typeof global=="object"&&global&&global.Object===Object&&global,jz=typeof self=="object"&&self&&self.Object===Object&&self,mn=dE||jz||Function("return this")(),mo=mn.Symbol,hE=Object.prototype,Bz=hE.hasOwnProperty,zz=hE.toString,Ql=mo?mo.toStringTag:void 0;function Fz(e){var t=Bz.call(e,Ql),i=e[Ql];try{e[Ql]=void 0;var n=!0}catch(r){}var o=zz.call(e);return n&&(t?e[Ql]=i:delete e[Ql]),o}var Wz=Object.prototype,Hz=Wz.toString;function $z(e){return Hz.call(e)}var Uz="[object Null]",Vz="[object Undefined]",U_=mo?mo.toStringTag:void 0;function jo(e){return e==null?e===void 0?Vz:Uz:U_&&U_ in Object(e)?Fz(e):$z(e)}function hn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Gz="[object AsyncFunction]",Yz="[object Function]",Xz="[object GeneratorFunction]",qz="[object Proxy]";function Va(e){if(!hn(e))return!1;var t=jo(e);return t==Yz||t==Xz||t==Gz||t==qz}var cg=mn["__core-js_shared__"],V_=function(){var e=/[^.]+$/.exec(cg&&cg.keys&&cg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Zz(e){return!!V_&&V_ in e}var Kz=Function.prototype,Jz=Kz.toString;function ts(e){if(e!=null){try{return Jz.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Qz=/[\\^$.*+?()[\]{}|]/g,eF=/^\[object .+?Constructor\]$/,tF=Function.prototype,iF=Object.prototype,nF=tF.toString,oF=iF.hasOwnProperty,rF=RegExp("^"+nF.call(oF).replace(Qz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function aF(e){if(!hn(e)||Zz(e))return!1;var t=Va(e)?rF:eF;return t.test(ts(e))}function sF(e,t){return e==null?void 0:e[t]}function is(e,t){var i=sF(e,t);return aF(i)?i:void 0}var Jc=is(mn,"Map"),Qc=is(Object,"create");function lF(){this.__data__=Qc?Qc(null):{},this.size=0}function cF(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uF="__lodash_hash_undefined__",dF=Object.prototype,hF=dF.hasOwnProperty;function pF(e){var t=this.__data__;if(Qc){var i=t[e];return i===uF?void 0:i}return hF.call(t,e)?t[e]:void 0}var fF=Object.prototype,mF=fF.hasOwnProperty;function gF(e){var t=this.__data__;return Qc?t[e]!==void 0:mF.call(t,e)}var vF="__lodash_hash_undefined__";function yF(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Qc&&t===void 0?vF:t,this}function Ga(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Ga.prototype.clear=lF;Ga.prototype.delete=cF;Ga.prototype.get=pF;Ga.prototype.has=gF;Ga.prototype.set=yF;function bF(){this.size=0,this.__data__={hash:new Ga,map:new(Jc||Wr),string:new Ga}}function xF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sf(e,t){var i=e.__data__;return xF(t)?i[typeof t=="string"?"string":"hash"]:i.map}function wF(e){var t=sf(this,e).delete(e);return this.size-=t?1:0,t}function _F(e){return sf(this,e).get(e)}function CF(e){return sf(this,e).has(e)}function SF(e,t){var i=sf(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}function Hr(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Hr.prototype.clear=bF;Hr.prototype.delete=wF;Hr.prototype.get=_F;Hr.prototype.has=CF;Hr.prototype.set=SF;var TF=200;function MF(e,t){var i=this.__data__;if(i instanceof Wr){var n=i.__data__;if(!Jc||n.length<TF-1)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Hr(n)}return i.set(e,t),this.size=i.size,this}function Lo(e){var t=this.__data__=new Wr(e);this.size=t.size}Lo.prototype.clear=Nz;Lo.prototype.delete=Dz;Lo.prototype.get=Iz;Lo.prototype.has=Rz;Lo.prototype.set=MF;function pE(e,t){for(var i=-1,n=e==null?0:e.length;++i<n&&t(e[i],i,e)!==!1;);return e}var ep=function(){try{var e=is(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function ju(e,t,i){t=="__proto__"&&ep?ep(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var kF=Object.prototype,PF=kF.hasOwnProperty;function ux(e,t,i){var n=e[t];(!(PF.call(e,t)&&Ru(n,i))||i===void 0&&!(t in e))&&ju(e,t,i)}function Cl(e,t,i,n){var o=!i;i||(i={});for(var r=-1,u=t.length;++r<u;){var _=t[r],A=void 0;A===void 0&&(A=e[_]),o?ju(i,_,A):ux(i,_,A)}return i}function AF(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}function Cn(e){return e!=null&&typeof e=="object"}var EF="[object Arguments]";function G_(e){return Cn(e)&&jo(e)==EF}var fE=Object.prototype,OF=fE.hasOwnProperty,LF=fE.propertyIsEnumerable,eu=G_(function(){return arguments}())?G_:function(e){return Cn(e)&&OF.call(e,"callee")&&!LF.call(e,"callee")},_i=Array.isArray;function NF(){return!1}var mE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Y_=mE&&typeof module=="object"&&module&&!module.nodeType&&module,DF=Y_&&Y_.exports===mE,X_=DF?mn.Buffer:void 0,IF=X_?X_.isBuffer:void 0,tu=IF||NF,RF=9007199254740991,jF=/^(?:0|[1-9]\d*)$/;function Bu(e,t){var i=typeof e;return t=t==null?RF:t,!!t&&(i=="number"||i!="symbol"&&jF.test(e))&&e>-1&&e%1==0&&e<t}var BF=9007199254740991;function dx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BF}var zF="[object Arguments]",FF="[object Array]",WF="[object Boolean]",HF="[object Date]",$F="[object Error]",UF="[object Function]",VF="[object Map]",GF="[object Number]",YF="[object Object]",XF="[object RegExp]",qF="[object Set]",ZF="[object String]",KF="[object WeakMap]",JF="[object ArrayBuffer]",QF="[object DataView]",e3="[object Float32Array]",t3="[object Float64Array]",i3="[object Int8Array]",n3="[object Int16Array]",o3="[object Int32Array]",r3="[object Uint8Array]",a3="[object Uint8ClampedArray]",s3="[object Uint16Array]",l3="[object Uint32Array]",vi={};vi[e3]=vi[t3]=vi[i3]=vi[n3]=vi[o3]=vi[r3]=vi[a3]=vi[s3]=vi[l3]=!0;vi[zF]=vi[FF]=vi[JF]=vi[WF]=vi[QF]=vi[HF]=vi[$F]=vi[UF]=vi[VF]=vi[GF]=vi[YF]=vi[XF]=vi[qF]=vi[ZF]=vi[KF]=!1;function c3(e){return Cn(e)&&dx(e.length)&&!!vi[jo(e)]}function zu(e){return function(t){return e(t)}}var gE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bc=gE&&typeof module=="object"&&module&&!module.nodeType&&module,u3=Bc&&Bc.exports===gE,ug=u3&&dE.process,la=function(){try{var e=Bc&&Bc.require&&Bc.require("util").types;return e||ug&&ug.binding&&ug.binding("util")}catch(t){}}(),q_=la&&la.isTypedArray,hx=q_?zu(q_):c3,d3=Object.prototype,h3=d3.hasOwnProperty;function vE(e,t){var i=_i(e),n=!i&&eu(e),o=!i&&!n&&tu(e),r=!i&&!n&&!o&&hx(e),u=i||n||o||r,_=u?AF(e.length,String):[],A=_.length;for(var E in e)(t||h3.call(e,E))&&!(u&&(E=="length"||o&&(E=="offset"||E=="parent")||r&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Bu(E,A)))&&_.push(E);return _}var p3=Object.prototype;function px(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||p3;return e===i}function yE(e,t){return function(i){return e(t(i))}}var f3=yE(Object.keys,Object),m3=Object.prototype,g3=m3.hasOwnProperty;function v3(e){if(!px(e))return f3(e);var t=[];for(var i in Object(e))g3.call(e,i)&&i!="constructor"&&t.push(i);return t}function Fu(e){return e!=null&&dx(e.length)&&!Va(e)}function Wu(e){return Fu(e)?vE(e):v3(e)}function y3(e,t){return e&&Cl(t,Wu(t),e)}function b3(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}var x3=Object.prototype,w3=x3.hasOwnProperty;function _3(e){if(!hn(e))return b3(e);var t=px(e),i=[];for(var n in e)n=="constructor"&&(t||!w3.call(e,n))||i.push(n);return i}function Hu(e){return Fu(e)?vE(e,!0):_3(e)}function C3(e,t){return e&&Cl(t,Hu(t),e)}var bE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Z_=bE&&typeof module=="object"&&module&&!module.nodeType&&module,S3=Z_&&Z_.exports===bE,K_=S3?mn.Buffer:void 0,J_=K_?K_.allocUnsafe:void 0;function xE(e,t){if(t)return e.slice();var i=e.length,n=J_?J_(i):new e.constructor(i);return e.copy(n),n}function lf(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function T3(e,t){for(var i=-1,n=e==null?0:e.length,o=0,r=[];++i<n;){var u=e[i];t(u,i,e)&&(r[o++]=u)}return r}function wE(){return[]}var M3=Object.prototype,k3=M3.propertyIsEnumerable,Q_=Object.getOwnPropertySymbols,fx=Q_?function(e){return e==null?[]:(e=Object(e),T3(Q_(e),function(t){return k3.call(e,t)}))}:wE;function P3(e,t){return Cl(e,fx(e),t)}function mx(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}var gx=yE(Object.getPrototypeOf,Object),A3=Object.getOwnPropertySymbols,_E=A3?function(e){for(var t=[];e;)mx(t,fx(e)),e=gx(e);return t}:wE;function E3(e,t){return Cl(e,_E(e),t)}function CE(e,t,i){var n=t(e);return _i(e)?n:mx(n,i(e))}function My(e){return CE(e,Wu,fx)}function vx(e){return CE(e,Hu,_E)}var ky=is(mn,"DataView"),Py=is(mn,"Promise"),tp=is(mn,"Set"),iu=is(mn,"WeakMap"),eC="[object Map]",O3="[object Object]",tC="[object Promise]",iC="[object Set]",nC="[object WeakMap]",oC="[object DataView]",L3=ts(ky),N3=ts(Jc),D3=ts(Py),I3=ts(tp),R3=ts(iu),Ao=jo;(ky&&Ao(new ky(new ArrayBuffer(1)))!=oC||Jc&&Ao(new Jc)!=eC||Py&&Ao(Py.resolve())!=tC||tp&&Ao(new tp)!=iC||iu&&Ao(new iu)!=nC)&&(Ao=function(e){var t=jo(e),i=t==O3?e.constructor:void 0,n=i?ts(i):"";if(n)switch(n){case L3:return oC;case N3:return eC;case D3:return tC;case I3:return iC;case R3:return nC}return t});var j3=Object.prototype,B3=j3.hasOwnProperty;function z3(e){var t=e.length,i=new e.constructor(t);return t&&typeof e[0]=="string"&&B3.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var ip=mn.Uint8Array;function yx(e){var t=new e.constructor(e.byteLength);return new ip(t).set(new ip(e)),t}function F3(e,t){var i=t?yx(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var W3=/\w*$/;function H3(e){var t=new e.constructor(e.source,W3.exec(e));return t.lastIndex=e.lastIndex,t}var rC=mo?mo.prototype:void 0,aC=rC?rC.valueOf:void 0;function $3(e){return aC?Object(aC.call(e)):{}}function SE(e,t){var i=t?yx(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var U3="[object Boolean]",V3="[object Date]",G3="[object Map]",Y3="[object Number]",X3="[object RegExp]",q3="[object Set]",Z3="[object String]",K3="[object Symbol]",J3="[object ArrayBuffer]",Q3="[object DataView]",eW="[object Float32Array]",tW="[object Float64Array]",iW="[object Int8Array]",nW="[object Int16Array]",oW="[object Int32Array]",rW="[object Uint8Array]",aW="[object Uint8ClampedArray]",sW="[object Uint16Array]",lW="[object Uint32Array]";function cW(e,t,i){var n=e.constructor;switch(t){case J3:return yx(e);case U3:case V3:return new n(+e);case Q3:return F3(e,i);case eW:case tW:case iW:case nW:case oW:case rW:case aW:case sW:case lW:return SE(e,i);case G3:return new n;case Y3:case Z3:return new n(e);case X3:return H3(e);case q3:return new n;case K3:return $3(e)}}var sC=Object.create,cf=function(){function e(){}return function(t){if(!hn(t))return{};if(sC)return sC(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function TE(e){return typeof e.constructor=="function"&&!px(e)?cf(gx(e)):{}}var uW="[object Map]";function dW(e){return Cn(e)&&Ao(e)==uW}var lC=la&&la.isMap,hW=lC?zu(lC):dW,pW="[object Set]";function fW(e){return Cn(e)&&Ao(e)==pW}var cC=la&&la.isSet,mW=cC?zu(cC):fW,gW=1,vW=2,yW=4,ME="[object Arguments]",bW="[object Array]",xW="[object Boolean]",wW="[object Date]",_W="[object Error]",kE="[object Function]",CW="[object GeneratorFunction]",SW="[object Map]",TW="[object Number]",PE="[object Object]",MW="[object RegExp]",kW="[object Set]",PW="[object String]",AW="[object Symbol]",EW="[object WeakMap]",OW="[object ArrayBuffer]",LW="[object DataView]",NW="[object Float32Array]",DW="[object Float64Array]",IW="[object Int8Array]",RW="[object Int16Array]",jW="[object Int32Array]",BW="[object Uint8Array]",zW="[object Uint8ClampedArray]",FW="[object Uint16Array]",WW="[object Uint32Array]",mi={};mi[ME]=mi[bW]=mi[OW]=mi[LW]=mi[xW]=mi[wW]=mi[NW]=mi[DW]=mi[IW]=mi[RW]=mi[jW]=mi[SW]=mi[TW]=mi[PE]=mi[MW]=mi[kW]=mi[PW]=mi[AW]=mi[BW]=mi[zW]=mi[FW]=mi[WW]=!0;mi[_W]=mi[kE]=mi[EW]=!1;function Gs(e,t,i,n,o,r){var u,_=t&gW,A=t&vW,E=t&yW;if(i&&(u=o?i(e,n,o,r):i(e)),u!==void 0)return u;if(!hn(e))return e;var H=_i(e);if(H){if(u=z3(e),!_)return lf(e,u)}else{var q=Ao(e),g=q==kE||q==CW;if(tu(e))return xE(e,_);if(q==PE||q==ME||g&&!o){if(u=A||g?{}:TE(e),!_)return A?E3(e,C3(u,e)):P3(e,y3(u,e))}else{if(!mi[q])return o?e:{};u=cW(e,q,_)}}r||(r=new Lo);var te=r.get(e);if(te)return te;r.set(e,u),mW(e)?e.forEach(function(Y){u.add(Gs(Y,t,i,Y,e,r))}):hW(e)&&e.forEach(function(Y,Z){u.set(Z,Gs(Y,t,i,Z,e,r))});var W=E?A?vx:My:A?Hu:Wu,C=H?void 0:W(e);return pE(C||e,function(Y,Z){C&&(Z=Y,Y=e[Z]),ux(u,Z,Gs(Y,t,i,Z,e,r))}),u}var HW=1,$W=4;function Ya(e){return Gs(e,HW|$W)}function UW(e){return function(t,i,n){for(var o=-1,r=Object(t),u=n(t),_=u.length;_--;){var A=u[++o];if(i(r[A],A,r)===!1)break}return t}}var AE=UW();function EE(e,t){return e&&AE(e,t,Wu)}var VW="__lodash_hash_undefined__";function GW(e){return this.__data__.set(e,VW),this}function YW(e){return this.__data__.has(e)}function nu(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new Hr;++t<i;)this.add(e[t])}nu.prototype.add=nu.prototype.push=GW;nu.prototype.has=YW;function XW(e,t){for(var i=-1,n=e==null?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function OE(e,t){return e.has(t)}var qW=1,ZW=2;function LE(e,t,i,n,o,r){var u=i&qW,_=e.length,A=t.length;if(_!=A&&!(u&&A>_))return!1;var E=r.get(e),H=r.get(t);if(E&&H)return E==t&&H==e;var q=-1,g=!0,te=i&ZW?new nu:void 0;for(r.set(e,t),r.set(t,e);++q<_;){var W=e[q],C=t[q];if(n)var Y=u?n(C,W,q,t,e,r):n(W,C,q,e,t,r);if(Y!==void 0){if(Y)continue;g=!1;break}if(te){if(!XW(t,function(Z,K){if(!OE(te,K)&&(W===Z||o(W,Z,i,n,r)))return te.push(K)})){g=!1;break}}else if(!(W===C||o(W,C,i,n,r))){g=!1;break}}return r.delete(e),r.delete(t),g}function KW(e){var t=-1,i=Array(e.size);return e.forEach(function(n,o){i[++t]=[o,n]}),i}function NE(e){var t=-1,i=Array(e.size);return e.forEach(function(n){i[++t]=n}),i}var JW=1,QW=2,eH="[object Boolean]",tH="[object Date]",iH="[object Error]",nH="[object Map]",oH="[object Number]",rH="[object RegExp]",aH="[object Set]",sH="[object String]",lH="[object Symbol]",cH="[object ArrayBuffer]",uH="[object DataView]",uC=mo?mo.prototype:void 0,dg=uC?uC.valueOf:void 0;function dH(e,t,i,n,o,r,u){switch(i){case uH:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case cH:return!(e.byteLength!=t.byteLength||!r(new ip(e),new ip(t)));case eH:case tH:case oH:return Ru(+e,+t);case iH:return e.name==t.name&&e.message==t.message;case rH:case sH:return e==t+"";case nH:var _=KW;case aH:var A=n&JW;if(_||(_=NE),e.size!=t.size&&!A)return!1;var E=u.get(e);if(E)return E==t;n|=QW,u.set(e,t);var H=LE(_(e),_(t),n,o,r,u);return u.delete(e),H;case lH:if(dg)return dg.call(e)==dg.call(t)}return!1}var hH=1,pH=Object.prototype,fH=pH.hasOwnProperty;function mH(e,t,i,n,o,r){var u=i&hH,_=My(e),A=_.length,E=My(t),H=E.length;if(A!=H&&!u)return!1;for(var q=A;q--;){var g=_[q];if(!(u?g in t:fH.call(t,g)))return!1}var te=r.get(e),W=r.get(t);if(te&&W)return te==t&&W==e;var C=!0;r.set(e,t),r.set(t,e);for(var Y=u;++q<A;){g=_[q];var Z=e[g],K=t[g];if(n)var J=u?n(K,Z,g,t,e,r):n(Z,K,g,e,t,r);if(!(J===void 0?Z===K||o(Z,K,i,n,r):J)){C=!1;break}Y||(Y=g=="constructor")}if(C&&!Y){var G=e.constructor,j=t.constructor;G!=j&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof j=="function"&&j instanceof j)&&(C=!1)}return r.delete(e),r.delete(t),C}var gH=1,dC="[object Arguments]",hC="[object Array]",Ld="[object Object]",vH=Object.prototype,pC=vH.hasOwnProperty;function yH(e,t,i,n,o,r){var u=_i(e),_=_i(t),A=u?hC:Ao(e),E=_?hC:Ao(t);A=A==dC?Ld:A,E=E==dC?Ld:E;var H=A==Ld,q=E==Ld,g=A==E;if(g&&tu(e)){if(!tu(t))return!1;u=!0,H=!1}if(g&&!H)return r||(r=new Lo),u||hx(e)?LE(e,t,i,n,o,r):dH(e,t,A,i,n,o,r);if(!(i&gH)){var te=H&&pC.call(e,"__wrapped__"),W=q&&pC.call(t,"__wrapped__");if(te||W){var C=te?e.value():e,Y=W?t.value():t;return r||(r=new Lo),o(C,Y,i,n,r)}}return g?(r||(r=new Lo),mH(e,t,i,n,o,r)):!1}function $u(e,t,i,n,o){return e===t?!0:e==null||t==null||!Cn(e)&&!Cn(t)?e!==e&&t!==t:yH(e,t,i,n,$u,o)}var bH=1,xH=2;function wH(e,t,i,n){var o=i.length,r=o;if(e==null)return!r;for(e=Object(e);o--;){var u=i[o];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<r;){u=i[o];var _=u[0],A=e[_],E=u[1];if(u[2]){if(A===void 0&&!(_ in e))return!1}else{var H=new Lo,q;if(!(q===void 0?$u(E,A,bH|xH,n,H):q))return!1}}return!0}function DE(e){return e===e&&!hn(e)}function _H(e){for(var t=Wu(e),i=t.length;i--;){var n=t[i],o=e[n];t[i]=[n,o,DE(o)]}return t}function IE(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}function CH(e){var t=_H(e);return t.length==1&&t[0][2]?IE(t[0][0],t[0][1]):function(i){return i===e||wH(i,e,t)}}var SH="[object Symbol]";function uf(e){return typeof e=="symbol"||Cn(e)&&jo(e)==SH}var TH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MH=/^\w*$/;function bx(e,t){if(_i(e))return!1;var i=typeof e;return i=="number"||i=="symbol"||i=="boolean"||e==null||uf(e)?!0:MH.test(e)||!TH.test(e)||t!=null&&e in Object(t)}var kH="Expected a function";function xx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kH);var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var u=e.apply(this,n);return i.cache=r.set(o,u)||r,u};return i.cache=new(xx.Cache||Hr),i}xx.Cache=Hr;var PH=500;function AH(e){var t=xx(e,function(n){return i.size===PH&&i.clear(),n}),i=t.cache;return t}var EH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OH=/\\(\\)?/g,LH=AH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(EH,function(i,n,o,r){t.push(o?r.replace(OH,"$1"):n||i)}),t});function Uu(e,t){for(var i=-1,n=e==null?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o}var NH=1/0,fC=mo?mo.prototype:void 0,mC=fC?fC.toString:void 0;function wx(e){if(typeof e=="string")return e;if(_i(e))return Uu(e,wx)+"";if(uf(e))return mC?mC.call(e):"";var t=e+"";return t=="0"&&1/e==-NH?"-0":t}function np(e){return e==null?"":wx(e)}function Sl(e,t){return _i(e)?e:bx(e,t)?[e]:LH(np(e))}var DH=1/0;function Tl(e){if(typeof e=="string"||uf(e))return e;var t=e+"";return t=="0"&&1/e==-DH?"-0":t}function df(e,t){t=Sl(t,e);for(var i=0,n=t.length;e!=null&&i<n;)e=e[Tl(t[i++])];return i&&i==n?e:void 0}function RE(e,t,i){var n=e==null?void 0:df(e,t);return n===void 0?i:n}function IH(e,t){return e!=null&&t in Object(e)}function RH(e,t,i){t=Sl(t,e);for(var n=-1,o=t.length,r=!1;++n<o;){var u=Tl(t[n]);if(!(r=e!=null&&i(e,u)))break;e=e[u]}return r||++n!=o?r:(o=e==null?0:e.length,!!o&&dx(o)&&Bu(u,o)&&(_i(e)||eu(e)))}function jE(e,t){return e!=null&&RH(e,t,IH)}var jH=1,BH=2;function zH(e,t){return bx(e)&&DE(t)?IE(Tl(e),t):function(i){var n=RE(i,e);return n===void 0&&n===t?jE(i,e):$u(t,n,jH|BH)}}function hf(e){return e}function FH(e){return function(t){return t==null?void 0:t[e]}}function WH(e){return function(t){return df(t,e)}}function HH(e){return bx(e)?FH(Tl(e)):WH(e)}function _x(e){return typeof e=="function"?e:e==null?hf:typeof e=="object"?_i(e)?zH(e[0],e[1]):CH(e):HH(e)}function $H(e,t){var i={};return t=_x(t),EE(e,function(n,o,r){ju(i,o,t(n,o,r))}),i}function UH(e){for(var t=e.length,i=5381,n=52711,o;t--;)o=e.charCodeAt(t),i=i*33^o,n=n*33^o;return(i>>>0)*4096+(n>>>0)}var ou="|",VH=/\[object ([HTML|SVG](.*)Element)\]/,GH={"[object Arguments]":0,"[object Array]":1,"[object ArrayBuffer]":2,"[object AsyncFunction]":3,"[object AsyncGeneratorFunction]":4,"[object BigInt]":5,"[object BigInt64Array]":6,"[object BigUint64Array]":7,"[object Boolean]":8,"[object DataView]":9,"[object Date]":10,"[object DocumentFragment]":11,"[object Error]":12,"[object Event]":13,"[object Float32Array]":14,"[object Float64Array]":15,"[object Function]":16,"[object Generator]":17,"[object GeneratorFunction]":18,"[object Int8Array]":19,"[object Int16Array]":20,"[object Map]":21,"[object Number]":22,"[object Object]":23,"[object Promise]":24,"[object RegExp]":25,"[object Set]":26,"[object SharedArrayBuffer]":27,"[object String]":28,"[object Uint8Array]":29,"[object Uint8ClampedArray]":30,"[object Uint16Array]":31,"[object Uint32Array]":32,"[object WeakMap]":33,"[object WeakRef]":34,"[object WeakSet]":35,CUSTOM:36,ELEMENT:37},YH={"[object Arguments]":1,"[object Array]":2},BE={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},XH={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},qH={"[object BigInt64Array]":1,"[object BigUint64Array]":2,"[object Float32Array]":3,"[object Float64Array]":4,"[object Int8Array]":5,"[object Int16Array]":6,"[object Uint8Array]":7,"[object Uint8ClampedArray]":8,"[object Uint16Array]":9,"[object Uint32Array]":10},ZH={"[object Arguments]":1,"[object Array]":2,"[object ArrayBuffer]":3,"[object BigInt64Array]":4,"[object BigUint64Array]":5,"[object DataView]":6,"[object Float32Array]":7,"[object Float64Array]":8,"[object Int8Array]":9,"[object Int16Array]":10,"[object Map]":11,"[object Object]":12,"[object Set]":13,"[object SharedArrayBuffer]":14,"[object Uint8Array]":15,"[object Uint8ClampedArray]":16,"[object Uint16Array]":17,"[object Uint32Array]":18,CUSTOM:19},Mc={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function KH(e,t){return e[0]>t[0]}function zE(e,t){return e>t}function Cx(e,t){for(var i,n,o=0;o<e.length;++o){for(n=e[o],i=o-1;~i&&t(e[i],n);--i)e[i+1]=e[i];e[i+1]=n}return e}function Qi(e,t){return Mc.object+ou+GH[e]+ou+t}var gC=new WeakMap,JH=0;function Ay(e,t){var i=gC.get(e);if(i)return i;var n=Qi(t,"NOT_ENUMERABLE"+ou+JH++);return gC.set(e,n),n}var QH=Object.prototype.toString;function e6(e,t,i){if(ZH[t])return vC(t,e,i);if(t==="[object Date]")return Qi(t,e.getTime());if(t==="[object RegExp]")return Qi(t,e.toString());if(t==="[object Event]")return Qi(t,[e.bubbles,e.cancelBubble,e.cancelable,e.composed,e.currentTarget,e.defaultPrevented,e.eventPhase,e.isTrusted,e.returnValue,e.target,e.type].join());if(t==="[object Error]")return Qi(t,e.message+ou+e.stack);if(t==="[object DocumentFragment]")return Qi(t,r6(e));var n=t.match(VH);return n?Qi("ELEMENT",n[1]+ou+e.outerHTML):BE[t]?Ay(e,t):XH[t]?Qi(t,e.toString()):vC("CUSTOM",e,i)}function vC(e,t,i){var n=i.cache.get(t);return n?Qi(e,"RECURSIVE~"+n):(i.cache.set(t,++i.id),e==="[object Object]"?t[Symbol.iterator]?Ay(t,e):Qi(e,bC(t,i)):YH[e]?Qi(e,t6(t,i)):e==="[object Map]"?Qi(e,a6(t,i)):e==="[object Set]"?Qi(e,s6(t,i)):qH[e]?Qi(e,t.join()):e==="[object ArrayBuffer]"?Qi(e,yC(t)):e==="[object DataView]"?Qi(e,yC(t.buffer)):BE[e]?Ay(t,e):Qi("CUSTOM",bC(t,i)))}function t6(e,t){for(var i=e.length,n=new Array(i);--i>=0;)n[i]=el(e[i],t);return n.join()}function i6(e){return Buffer.from(e).toString("utf8")}function n6(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function o6(){return"UNSUPPORTED"}function r6(e){for(var t=e.children,i=t.length,n=new Array(i);--i>=0;)n[i]=t[i].outerHTML;return n.join()}var yC=typeof Buffer!="undefined"&&typeof Buffer.from=="function"?i6:typeof Uint16Array=="function"?n6:o6;function a6(e,t){var i=new Array(e.size),n=0;for(e.forEach(function(o,r){i[n++]=[el(r,t),el(o,t)]}),Cx(i,KH);--n>=0;)i[n]="["+i[n][0]+","+i[n][1]+"]";return"["+i.join()+"]"}function bC(e,t){for(var i=Cx(Object.getOwnPropertyNames(e),zE),n=i.length,o=new Array(n),r=n;--r>=0;)o[r]=i[r]+":"+el(e[i[r]],t);return"{"+o.join()+"}"}function s6(e,t){var i=new Array(e.size),n=0;return e.forEach(function(o){i[n++]=el(o,t)}),"["+Cx(i,zE).join()+"]"}function el(e,t){var i=typeof e;return e==null||i==="undefined"?Mc.empty+e:i==="object"?e6(e,QH.call(e),t||{cache:new WeakMap,id:1}):i==="function"||i==="symbol"?Mc[i]+e.toString():i==="boolean"?Mc.boolean+ +e:Mc[i]+e}function FE(e){return UH(el(e,void 0))}function Ey(e,t,i){(i!==void 0&&!Ru(e[t],i)||i===void 0&&!(t in e))&&ju(e,t,i)}function WE(e){return Cn(e)&&Fu(e)}var l6="[object Object]",c6=Function.prototype,u6=Object.prototype,HE=c6.toString,d6=u6.hasOwnProperty,h6=HE.call(Object);function $E(e){if(!Cn(e)||jo(e)!=l6)return!1;var t=gx(e);if(t===null)return!0;var i=d6.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&HE.call(i)==h6}function Oy(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function p6(e){return Cl(e,Hu(e))}function f6(e,t,i,n,o,r,u){var _=Oy(e,i),A=Oy(t,i),E=u.get(A);if(E){Ey(e,i,E);return}var H=r?r(_,A,i+"",e,t,u):void 0,q=H===void 0;if(q){var g=_i(A),te=!g&&tu(A),W=!g&&!te&&hx(A);H=A,g||te||W?_i(_)?H=_:WE(_)?H=lf(_):te?(q=!1,H=xE(A,!0)):W?(q=!1,H=SE(A,!0)):H=[]:$E(A)||eu(A)?(H=_,eu(_)?H=p6(_):(!hn(_)||Va(_))&&(H=TE(A))):q=!1}q&&(u.set(A,H),o(H,A,n,r,u),u.delete(A)),Ey(e,i,H)}function Sx(e,t,i,n,o){e!==t&&AE(t,function(r,u){if(o||(o=new Lo),hn(r))f6(e,t,u,i,Sx,n,o);else{var _=n?n(Oy(e,u),r,u+"",e,t,o):void 0;_===void 0&&(_=r),Ey(e,u,_)}},Hu)}function pf(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var xC=Math.max;function UE(e,t,i){return t=xC(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,r=xC(n.length-t,0),u=Array(r);++o<r;)u[o]=n[t+o];o=-1;for(var _=Array(t+1);++o<t;)_[o]=n[o];return _[t]=i(u),pf(e,this,_)}}function m6(e){return function(){return e}}var g6=ep?function(e,t){return ep(e,"toString",{configurable:!0,enumerable:!1,value:m6(t),writable:!0})}:hf,v6=800,y6=16,b6=Date.now;function VE(e){var t=0,i=0;return function(){var n=b6(),o=y6-(n-i);if(i=n,o>0){if(++t>=v6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Tx=VE(g6);function Mx(e,t){return Tx(UE(e,t,hf),e+"")}function GE(e,t,i){if(!hn(i))return!1;var n=typeof t;return(n=="number"?Fu(i)&&Bu(t,i.length):n=="string"&&t in i)?Ru(i[t],e):!1}function YE(e){return Mx(function(t,i){var n=-1,o=i.length,r=o>1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(r=e.length>3&&typeof r=="function"?(o--,r):void 0,u&&GE(i[0],i[1],u)&&(r=o<3?void 0:r,o=1),t=Object(t);++n<o;){var _=i[n];_&&e(t,_,n,r)}return t})}var kx=YE(function(e,t,i){Sx(e,t,i)});function XE(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function qE(e,t,i){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),i=i>o?o:i,i<0&&(i+=o),o=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(o);++n<o;)r[n]=e[n+t];return r}function x6(e,t){return t.length<2?e:df(e,qE(t,0,-1))}function w6(e,t){return t=Sl(t,e),e=x6(e,t),e==null||delete e[Tl(XE(t))]}function _6(e){return $E(e)?void 0:e}var wC=mo?mo.isConcatSpreadable:void 0;function C6(e){return _i(e)||eu(e)||!!(wC&&e&&e[wC])}function ZE(e,t,i,n,o){var r=-1,u=e.length;for(i||(i=C6),o||(o=[]);++r<u;){var _=e[r];i(_)?mx(o,_):n||(o[o.length]=_)}return o}function S6(e){var t=e==null?0:e.length;return t?ZE(e):[]}function ff(e){return Tx(UE(e,void 0,S6),e+"")}var T6=1,M6=2,k6=4,mf=ff(function(e,t){var i={};if(e==null)return i;var n=!1;t=Uu(t,function(r){return r=Sl(r,e),n||(n=r.length>1),r}),Cl(e,vx(e),i),n&&(i=Gs(i,T6|M6|k6,_6));for(var o=t.length;o--;)w6(i,t[o]);return i});let Vu=class extends lx{constructor(t,i){super(uE,{key:t,interpolationOptions:i},Tz.t)}};class gf{constructor(t,i,n,o,r){this._name=t,this.type=i,this.description=n||"",o&&(this._dataSource=o),r&&(this.composeCode=r)}get name(){return this._name}set name(t){this._name=t}get dataSource(){return this._dataSource}serialize(){return{name:this.name,type:this.type,description:this.description,dataSource:this.dataSource,composeCode:this.composeCode,__serializable:"DimensionalElement"}}toJSON(){return this.serialize()}toString(){return this.jaql()}}function Jr(e){let t=e.replace(/[^a-zA-Z0-9_.]/g,"").replace(/\./g,"_");return t.charAt(0).match(/[0-9]/)&&(t="_"+t),t}const Px="DM",Nt={Sum:"sum",Average:"avg",Min:"min",Max:"max",Count:"count",CountDistinct:"countDistinct",Median:"median",Variance:"var",StandardDeviation:"stdev"};exports.Sort=void 0;(function(e){e[e.None=0]="None",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"})(exports.Sort=exports.Sort||(exports.Sort={}));const Lt={Measure:"measure",MeasureTemplate:"measuretemplate",BaseMeasure:"basemeasure",CalculatedMeasure:"calculatedmeasure",Dimension:"dimension",DateDimension:"datedimension",TextDimension:"textdimension",NumericDimension:"numericdimension",DateLevel:"datelevel",Attribute:"attribute",TextAttribute:"text-attribute",NumericAttribute:"numeric-attribute",Filter:"filter",DimensionFilter:"dimensionfilter",MeasureFilter:"measurefilter",isMetadata(e){return Lt.isMeasure(e)||Lt.isDimension(e)||Lt.isAttribute(e)||Lt.isFilter(e)},isMeasureTemplate(e){return e?typeof e=="string"?e.toLowerCase()===Lt.MeasureTemplate:e.agg==="*"||e.aggregation==="*"||e.type&&e.type.toLowerCase()===Lt.MeasureTemplate:!1},isBaseMeasure(e){return e?typeof e=="string"?e.toLowerCase()===Lt.BaseMeasure:(e.agg||e.aggregation)&&(e.attribute||e.jaql)&&!this.isMeasureTemplate(e):!1},isMeasure(e){if(!e)return!1;if(typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Measure||t.toLowerCase()===Lt.BaseMeasure||t.toLowerCase()===Lt.MeasureTemplate||t.toLowerCase()===Lt.CalculatedMeasure}return this.isBaseMeasure(e)||this.isCalculatedMeasure(e)||this.isMeasureTemplate(e)},isCalculatedMeasure(e){return e?typeof e=="string"?e.toLowerCase()===Lt.CalculatedMeasure:(e.expression||e.formula)&&e.context:!1},isDateDimension(e){return e?typeof e=="string"?e.toLowerCase()===Lt.DateDimension:(e.dim||e.expression)&&e.level:!1},isTextDimension(e){return e&&typeof e=="string"?e.toLowerCase()===Lt.TextDimension:!1},isNumericDimension(e){return e&&typeof e=="string"?e.toLowerCase()===Lt.NumericDimension:!1},isDimension(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===Lt.DateDimension||t.toLowerCase()===Lt.Dimension||t.toLowerCase()===Lt.TextDimension||t.toLowerCase()===Lt.NumericDimension}return!1},isAttribute(e){if(typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Attribute||t.toLowerCase()===Lt.TextAttribute||t.toLowerCase()===Lt.NumericAttribute||t.toLowerCase()===Lt.DateLevel}return e&&e.type?this.isAttribute(e.type):!1},isFilter(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Filter||t.toLowerCase()===Lt.DimensionFilter||t.toLowerCase()===Lt.MeasureFilter}return!1}},it={Years:"Years",Quarters:"Quarters",Months:"Months",Weeks:"Weeks",Days:"Days",Hours:"Hours",MinutesRoundTo30:"MinutesRoundTo30",MinutesRoundTo15:"MinutesRoundTo15",Minutes:"Minutes",Seconds:"Seconds",AggHours:"AggHours",AggMinutesRoundTo30:"AggMinutesRoundTo30",AggMinutesRoundTo15:"AggMinutesRoundTo15",AggMinutesRoundTo1:"AggMinutesRoundTo1",get all(){return[it.Years,it.Quarters,it.Months,it.Weeks,it.Days,it.Hours,it.MinutesRoundTo30,it.MinutesRoundTo15,it.Minutes,it.Seconds,it.AggHours,it.AggMinutesRoundTo30,it.AggMinutesRoundTo15,it.AggMinutesRoundTo1]}};var Th;(function(e){e.TEXT="text",e.NUMERIC="numeric",e.DATETIME="datetime"})(Th=Th||(Th={}));var zc;(function(e){e.ASC="asc",e.DESC="desc"})(zc=zc||(zc={}));var hg;(function(e){e.PRE="pre",e.POST="post"})(hg=hg||(hg={}));function Ly(e,t=[]){try{return e==null?String(e):typeof e=="string"?`'${oE(e)}'`:typeof e=="number"||typeof e=="boolean"?String(e):e instanceof Date?`new Date('${e.toISOString()}')`:Array.isArray(e)?`[${e.map(i=>Ly(i,t)).join(", ")}]`:typeof e=="object"&&e!==null?"composeCode"in e?e.composeCode:`{ ${Object.entries(e).filter(([n])=>!t.includes(n)).map(([n,o])=>`${/[^a-zA-Z0-9_$]/.test(n)?`'${n}'`:n}: ${Ly(o,t)}`).join(", ")} }`:JSON.stringify(e)}catch(i){return console.error(i,JSON.stringify(e,null,2)),JSON.stringify(e)}}function P6(e){let t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return e.slice(0,t)}function vf(e,t){return function(i){return function(...n){const o=P6(n),r=o.length,u=o.map(E=>Ly(E,["guid"])).filter((E,H)=>!(["","{ }","[]","undefined","null"].includes(E)&&H===r-1)).join(", "),_=`${e}.${t!=null?t:i.name}(${u})`,A=i(...n);return A.composeCode=_,A}}}function Wt(e,t){return vf("filterFactory",t)(e)}function _C(e,t){return vf("filterFactory.logic",t)(e)}function A6(e,t){return vf("analyticsFactory",t)(e)}function yo(e,t){return vf("measureFactory",t)(e)}function E6(e,t,i){if(typeof i=="number")e.push(i.toString());else if(i&&Lt.isMeasureTemplate(i.type)){i=i.sum();const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isMeasure(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isFilter(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isAttribute(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}}function KE(e,t,i,n){const o={},r=[i+"("];return E6(r,o,e),n&&r.push(`, ${n}`),r.push(")"),new tl(t,r.join(""),o)}const JE=yo((e,t,i)=>{const n=Object.fromEntries(Object.entries(i).map(([o,r])=>[o.startsWith("[")?o:`[${o}]`,r]));return new tl(e,t,n)},"customFormula"),lr=yo((e,t,i,n)=>new na(i!=null?i:`${t.toString()} ${e.name}`,e,t,n),"aggregate"),Ny=yo((e,t,i)=>lr(e,Nt.Sum,t,i),"sum"),O6=yo((e,t,i)=>lr(e,Nt.Average,t,i),"average"),L6=yo((e,t,i)=>lr(e,Nt.Average,t,i),"avg"),QE=yo((e,t,i)=>lr(e,Nt.Min,t,i),"min"),Ax=yo((e,t,i)=>lr(e,Nt.Max,t,i),"max"),Dy=yo((e,t,i)=>lr(e,Nt.Median,t,i),"median"),eO=yo((e,t,i)=>lr(e,Nt.Count,t,i),"count"),Ex=yo((e,t,i)=>lr(e,Nt.CountDistinct,t,i),"countDistinct"),N6=yo((e,t,i)=>{let n;const o=r=>r.replace("advancedSmoothing","smooth").replace("localEstimates","local");return i&&(n=Object.entries(i).map(r=>o(`"${r[0]}=${r[1]}"`)).join(",")),KE(e,t!=null?t:e.name+" Trend","trend",n)},"trend"),D6=yo((e,t,i)=>{let n;if(i){const o=Object.assign({forecastHorizon:3},i);if(o.startDate){const r=new Date(o.startDate);o.startDate=r.toISOString().replace(/.\d+Z$/g,"")}if(o.endDate){const r=new Date(o.endDate);o.endDate=r.toISOString().replace(/.\d+Z$/g,"")}n=Object.entries(o).map(r=>`"${r[0]}=${r[1]}"`).join(",")}else n='"forecastHorizon=3"';return KE(e,t!=null?t:e.name+" Forecast","forecast",n)},"forecast");class Ox extends gf{constructor(t,i,n,o,r,u,_){super(t,i,o,u,_),this._sort=exports.Sort.None,this._format="#,#.00",this._format=n,this._sort=r||exports.Sort.None}getSort(){return this._sort}getFormat(){return this._format}serialize(){const t=super.serialize();return this.getFormat()!==void 0&&(t.format=this.getFormat()),this.getSort()!==void 0&&(t.sort=this.getSort()),t}}class na extends Ox{constructor(t,i,n,o,r,u,_,A){super(t,Lt.BaseMeasure,o,r,u,_,A),this.attribute=i,this.aggregation=n}static aggregationFromJAQL(t){switch(t){case"sum":return Nt.Sum;case"avg":return Nt.Average;case"min":return Nt.Min;case"max":return Nt.Max;case"countduplicates":return Nt.Count;case"median":return Nt.Median;case"count":return Nt.CountDistinct;case"var":return Nt.Variance;case"stdev":return Nt.StandardDeviation}return Nt.Sum}static aggregationToJAQL(t){switch(t){case Nt.Sum:return"sum";case Nt.Average:return"avg";case Nt.Min:return"min";case Nt.Max:return"max";case Nt.Count:return"countduplicates";case Nt.CountDistinct:return"count";case Nt.Median:return"median";case Nt.Variance:return"var";case Nt.StandardDeviation:return"stdev"}return Nt.Sum}sort(t){return new na(this.name,this.attribute,this.aggregation,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new na(this.name,this.attribute,this.aggregation,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return`${this.attribute.expression}_${this.aggregation}`}serialize(){const t=super.serialize();return t.__serializable="DimensionalBaseMeasure",t.aggregation=this.aggregation,t.attribute=this.attribute.serialize(),t}jaql(t){const i=this.attribute.jaql(!0),n={jaql:Object.assign(Object.assign({},i),{title:this.name,agg:na.aggregationToJAQL(this.aggregation)})};return this._format&&(n.format={number:this._format}),this._sort!=exports.Sort.None&&(n.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?n.jaql:n}}class tl extends Ox{constructor(t,i,n,o,r,u,_,A){super(t,Lt.CalculatedMeasure,o,r,u,_,A),this.expression=i,this.context=n}sort(t){return new tl(this.name,this.expression,this.context,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new tl(this.name,this.expression,this.context,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return this.expression}serialize(){const t=super.serialize();return t.__serializable="DimensionalCalculatedMeasure",t.expression=this.expression,t.context=Object.fromEntries(Object.entries(this.context).map(([i,n])=>[i,n.serialize?n.serialize(n):n])),t}jaql(t){const i={jaql:{title:this.name,formula:this.expression}},n={};return Object.getOwnPropertyNames(this.context).forEach(r=>n[r]=this.context[r].jaql(!0)),i.jaql.context=n,this._format&&(i.format={number:this._format}),this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}}class op extends Ox{constructor(t,i,n,o,r,u,_){super(t,Lt.MeasureTemplate,n,o,r,u,_),this.attribute=i}get id(){return`${this.attribute.expression}_*`}serialize(){const t=super.serialize();return t.__serializable="DimensionalMeasureTemplate",t.attribute=this.attribute.serialize(),t}sort(t){return new op(this.name,this.attribute,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new op(this.name,this.attribute,t,this.description,this._sort,this.dataSource,this.composeCode)}jaql(t){return this.sum().sort(this._sort).jaql(t)}sum(t){return Ny(this.attribute,t).sort(this._sort)}average(t){return O6(this.attribute,t).sort(this._sort)}median(t){return Dy(this.attribute,t).sort(this._sort)}min(t){return Dy(this.attribute,t).sort(this._sort)}max(t){return Ax(this.attribute,t).sort(this._sort)}count(t){return eO(this.attribute,t).sort(this._sort)}countDistinct(t){return Ex(this.attribute,t).sort(this._sort)}}function tO(e,t){return $u(e,t)}const yf=()=>({guid:IO(13),disabled:!1,locked:!1}),iO=()=>Object.assign(Object.assign({},yf()),{excludeMembers:!1,enableMultiSelection:!0,deactivatedMembers:[]});function I6(e){return"excludeMembers"in e}const nO=e=>{const t=I6(e)?iO():yf();return Object.fromEntries(Object.entries(e).filter(([i,n])=>!tO(n,t[i])))},fr={Contains:"contains",StartsWith:"startsWith",EndsWith:"endsWith",Equals:"equals",DoesntEqual:"doesntEqual",DoesntStartWith:"doesntStartWith",DoesntContain:"doesntContain",DoesntEndWith:"doesntEndWith",Like:"like"},pn={Equals:"equals",DoesntEqual:"doesntEqual",From:"from",FromNotEqual:"fromNotEqual",To:"to",ToNotEqual:"toNotEqual"},il={From:"from",To:"to",Last:"last",Next:"next",Anchor:"Anchor"},oO={Union:"or",Intersection:"and",Exclude:"exclude"},Lx={Top:"top",Bottom:"bottom"},Di={logicalAttribute:"logicalAttribute",members:"members",exclude:"exclude",measure:"measure",ranking:"ranking",text:"text",numeric:"numeric",dateRange:"dateRange",relativeDate:"relativeDate",cascading:"cascading",advanced:"advanced"};class Xn extends gf{constructor(t,i,n,o){super("filter",Lt.Filter,void 0,void 0,o),this.filterType=i,this.isScope=!0,Xn.checkAttributeSupport(t),this.attribute=t,this.config=kx({},yf(),n!=null?n:{})}get name(){return FE(this.jaql()).toString(16)}serialize(){const t=super.serialize();return t.__serializable="AbstractFilter",t.filterType=this.filterType,t.attribute=this.attribute.serialize(),this.config&&(t.config=this.config),t.composeCode=this.composeCode,t}jaql(t){if(this.config.disabled)return Xn.disabledJaql(t);const i=this.attribute.jaql(!1),n=this.attribute;if(n.getFormat&&n.getFormat()!==void 0){const o=n.translateGranularityToJaql();i.format={mask:{[o.level]:n.getFormat()}}}return i.jaql.filter=this.filterJaql(),this.attribute.dataSource&&(i.jaql.datasource=this.attribute.dataSource),this.isScope&&(i.panel="scope"),t===!0?i.jaql:i}static checkAttributeSupport(t){const{granularity:i}=t;if(i===it.Hours||i===it.MinutesRoundTo30||i===it.MinutesRoundTo15||i===it.Minutes||i===it.Seconds)throw new Vu("errors.filter.unsupportedDatetimeLevel")}static disabledJaql(t){return t?{filter:{}}:{jaql:{filter:{}}}}}class Nx extends Xn{constructor(t,i,n,o){super(t[0].attribute,Di.logicalAttribute,n,o),this.operator=i,this.filters=t}get id(){return`${this.operator}_${this.filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="LogicalAttributeFilter",t.operator=this.operator,t.filters=this.filters.map(i=>i.serialize()),t}filterJaql(){const t={};return t[this.operator]=this.filters.map(i=>i.filterJaql()),t}}class rO extends Xn{constructor(t,i,n,o){if(super(t,Di.members,void 0,o),this.members=i!=null?i:[],this.members.filter(r=>r==null).length>0)throw new Vu("errors.filter.membersFilterNullMember",{attributeId:t.id});this.config=kx({},iO(),n!=null?n:{})}get id(){return`${this.attribute.id}_${this.members.map(t=>t.toString()).join()}`}get name(){return FE([this.jaql(),mf(this.config,["guid","originalFilterJaql"])]).toString(16)}serialize(){const t=super.serialize();return t.__serializable="MembersFilter",this.config&&(t.config=this.config.backgroundFilter?Object.assign(Object.assign({},this.config),{backgroundFilter:this.config.backgroundFilter.serialize()}):this.config),t.members=this.members,t}filterJaql(){const t={members:this.members.map(n=>n.toString())},i=this.config.excludeMembers?{exclude:t}:t;return this.config.backgroundFilter?{and:[i,this.config.backgroundFilter.filterJaql()]}:i}}class aO extends Xn{constructor(t,i,n){super(t[0].attribute,Di.cascading,i,n),this._filters=t}get filters(){const{disabled:t,locked:i}=this.config;return this._filters.map(n=>(n.config=Object.assign(Object.assign({},n.config),{disabled:t,locked:i}),n))}get id(){return`${this.filterType}_${this._filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="CascadingFilter",t._filters=this.filters.map(i=>i.serialize()),t}filterJaql(){return{}}jaql(t){return this.config.disabled?Xn.disabledJaql(t):this.filters.map(i=>(i.isScope=!0,i.jaql(t)))}}class sO extends Xn{constructor(t,i,n,o){super(t.attribute,Di.exclude,n,o),this.input=i,this.filter=t}get id(){let t=`exclude_${this.filter.id}`;return this.input&&(t+="_from_"+this.input.id),t}serialize(){const t=super.serialize();return t.__serializable="ExcludeFilter",t.filter=this.filter.serialize(),this.input&&(t.input=this.input.serialize()),t}filterJaql(){const t={},i=this.filter.filterJaql();return this.input?(t.filter=this.input.filterJaql(),t.filter.filter={exclude:i}):t.exclude=i,t}}class bf extends Xn{constructor(t,i,n,o,r,u,_,A){super(t,i,_,A),n&&o!==void 0&&(this.valueA=o,this.operatorA=n),r&&u!==void 0&&(this.operatorB=r,this.valueB=u)}get id(){let t=`${this.attribute.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}:${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="DoubleOperatorFilter",this.operatorA&&(t.operatorA=this.operatorA),this.operatorB&&(t.operatorB=this.operatorB),this.valueA!==void 0&&(t.valueA=this.valueA),this.valueB!==void 0&&(t.valueB=this.valueB),t}filterJaql(){const t={};return this.operatorA&&this.valueA!==void 0&&(t[this.operatorA]=this.valueA),this.operatorB&&this.valueB!==void 0&&(t[this.operatorB]=this.valueB),t}}class lO extends bf{constructor(t,i,n,o,r,u,_,A){super(t,Di.measure,n,o,r,u,_,A),this.measure=i}get id(){let t=`${this.attribute.id}_${this.measure.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="MeasureFilter",t.measure=this.measure.serialize(),t}jaql(t){if(this.config.disabled)return Xn.disabledJaql(t);const i=super.jaql(t);return this.measure instanceof na&&Object.entries(this.measure.jaql().jaql).forEach(([n,o])=>{i.jaql[n]=o}),i}}class Dx extends Xn{constructor(t,i,n,o,r,u){super(t,Di.ranking,r,u),this.count=o,this.operator=n,this.measure=i}get id(){return`${this.operator}_${this.count}_${this.attribute.id}_by_${this.measure.id}`}serialize(){const t=super.serialize();return t.__serializable="RankingFilter",t.count=this.count,t.operator=this.operator,t.measure=this.measure.serialize(),t}filterJaql(){const t={};return t[this.operator]=this.count,t.by=this.measure.jaql(!0),t}}class cO extends bf{constructor(t,i,n,o,r,u,_){super(t,Di.numeric,i,n,o,r,u,_)}serialize(){const t=super.serialize();return t.__serializable="NumericFilter",t}}class mr extends bf{constructor(t,i,n,o,r){super(t,Di.text,i,n,void 0,void 0,o,r)}serialize(){const t=super.serialize();return t.__serializable="TextFilter",t}}class uO extends bf{constructor(t,i,n,o,r){super(t,Di.dateRange,il.From,i,il.To,n,o,r),typeof i=="object"&&(this.valueA=i.toISOString()),typeof n=="object"&&(this.valueB=n.toISOString())}get level(){return this.attribute}get from(){return this.valueA}get to(){return this.valueB}filterJaql(){return super.filterJaql()}serialize(){const t=super.serialize();return t.__serializable="DateRangeFilter",t}}class xf extends Xn{constructor(t,i,n,o,r,u,_){super(t,Di.relativeDate,u,_),o||(o=il.Next),this.anchor=r,this.operator=o,this.offset=i,this.count=n}get level(){return this.attribute}get id(){let t=`${this.level.id}_${this.operator}_${this.offset}_${this.count}`;return this.anchor&&(typeof this.anchor=="string"?t+=`_${this.anchor}`:typeof this.anchor=="object"&&(t+=`_${this.anchor.toISOString()}`)),t}serialize(){const t=super.serialize();return t.__serializable="RelativeDateFilter",t.offset=this.offset,t.count=this.count,t.operator=this.operator,this.anchor&&(t.anchor=typeof this.anchor=="string"?this.anchor:this.anchor.toISOString()),t}filterJaql(){const t={};return t[this.operator]={offset:this.offset,count:this.count},this.anchor&&(typeof this.anchor=="string"?t[this.operator].anchor=this.anchor:typeof this.anchor=="object"&&(t[this.operator].anchor=this.anchor.toISOString())),t}}class dO extends Xn{constructor(t,i,n,o){super(t,Di.advanced,n,o),delete i.filterType,this.jaqlExpression=i}get id(){return`custom_${this.attribute.id}_${this.config.guid}`}filterJaql(){return this.jaqlExpression}serialize(){const t=super.serialize();return t.__serializable="CustomFilter",t.jaqlExpression=this.jaqlExpression,t}}function R6(e){return"filterType"in e&&e.filterType===Di.advanced}function j6(e){return"filterType"in e&&e.filterType===Di.members}function B6(e){return"filterType"in e&&e.filterType===Di.numeric}function z6(e){return"filterType"in e&&e.filterType===Di.ranking}function F6(e){return"filterType"in e&&e.filterType===Di.measure}function hO(e){return"filterType"in e&&e.filterType===Di.cascading}function W6(e){return"filterType"in e&&e.filterType===Di.relativeDate}function H6(e){return"filterType"in e&&e.filterType===Di.text}function $6(e){return"filterType"in e&&e.filterType===Di.dateRange}const U6=Wt((e,t)=>new Nx(e,oO.Union,t),"union"),V6=Wt((e,t)=>new Nx(e,oO.Intersection,t),"intersection"),Ix=Wt((e,t,i)=>new sO(e,t,i),"exclude"),pO=Wt((e,t,i)=>new mr(e,fr.DoesntContain,t,i),"doesntContain"),fO=Wt((e,t,i)=>new mr(e,fr.DoesntEndWith,t,i),"doesntEndWith"),mO=Wt((e,t,i)=>new mr(e,fr.DoesntStartWith,t,i),"doesntStartWith"),gO=Wt((e,t,i)=>new mr(e,fr.Contains,t,i),"contains"),vO=Wt((e,t,i)=>new mr(e,fr.EndsWith,t,i),"endsWith"),yO=Wt((e,t,i)=>new mr(e,fr.StartsWith,t,i),"startsWith"),G6=Wt((e,t,i)=>new mr(e,fr.Like,t,i),"like"),bO=Wt((e,t,i)=>typeof t=="string"?new mr(e,fr.DoesntEqual,t,i):ns(e,pn.DoesntEqual,t,void 0,void 0,i),"doesntEqual"),xO=Wt((e,t,i)=>typeof t=="string"?new mr(e,fr.Equals,t,i):ns(e,pn.Equals,t,void 0,void 0,i),"equals"),wO=Wt((e,t,i)=>ns(e,pn.FromNotEqual,t,void 0,void 0,i),"greaterThan"),_O=Wt((e,t,i)=>ns(e,pn.From,t,void 0,void 0,i),"greaterThanOrEqual"),CO=Wt((e,t,i)=>ns(e,pn.ToNotEqual,t,void 0,void 0,i),"lessThan"),SO=Wt((e,t,i)=>ns(e,pn.To,t,void 0,void 0,i),"lessThanOrEqual"),rp=Wt((e,t,i,n)=>ns(e,pn.From,t,pn.To,i,n),"between"),ns=Wt((e,t,i,n,o,r)=>new cO(e,t,i,n,o,r),"numeric"),wf=Wt((e,t,i)=>new rO(e,t,i),"members"),TO=Wt((e,t,i,n)=>new uO(e,t,i,n),"dateRange"),Y6=Wt((e,t,i,n,o)=>new xf(e,t,i,void 0,n,o),"dateRelative"),MO=Wt((e,t,i,n,o)=>new xf(e,t,i,il.Next,n,o),"dateRelativeFrom"),kO=Wt((e,t,i,n,o)=>new xf(e,t,i,il.Last,n,o),"dateRelativeTo");function Ml(e,t,i,n,o,r,u){return new lO(e,t,i,n,o,r,u)}const X6=Wt((e,t,i)=>Ml(e.attribute,e,pn.Equals,t,void 0,void 0,i),"measureEquals"),q6=Wt((e,t,i)=>Ml(e.attribute,e,pn.FromNotEqual,t,void 0,void 0,i),"measureGreaterThan"),Z6=Wt((e,t,i)=>Ml(e.attribute,e,pn.From,t,void 0,void 0,i),"measureGreaterThanOrEqual"),K6=Wt((e,t,i)=>Ml(e.attribute,e,pn.To,t,void 0,void 0,i),"measureLessThanOrEqual"),J6=Wt((e,t,i)=>Ml(e.attribute,e,pn.ToNotEqual,t,void 0,void 0,i),"measureLessThan"),CC=Wt((e,t,i,n)=>Ml(e.attribute,e,pn.From,t,pn.To,i,n),"measureBetween"),PO=Wt((e,t,i,n)=>new Dx(e,t,Lx.Top,i,n),"topRanking"),AO=Wt((e,t,i,n)=>new Dx(e,t,Lx.Bottom,i,n),"bottomRanking"),za=e=>{if(Array.isArray(e)){const[t,...i]=e;return i.length===0?za(t):{operator:"AND",left:za(t),right:za(i)}}return e},Q6=Wt((e,t)=>new aO(e,t),"cascading");exports.logic=void 0;(function(e){e.and=_C((t,i)=>({operator:"AND",left:za(t),right:za(i)}),"and"),e.or=_C((t,i)=>({operator:"OR",left:za(t),right:za(i)}),"or")})(exports.logic=exports.logic||(exports.logic={}));const e$=Wt((e,t,i)=>new dO(e,t,i),"customFilter"),t$=e=>{const{dim:t,datatype:i,title:n,datasource:o}=e;return Cf({expression:t,dataType:i,granularity:ru(e),title:n,dataSource:o})},i$=e=>{const{dim:t,title:i,datatype:n,agg:o,datasource:r}=e;if(o)return Sf({expression:t,dataType:n,agg:o,granularity:ru(e),format:void 0,sort:void 0,title:i,dataSource:r})},SC=(e,t)=>{if("formula"in e)return Bx(e);const{dim:i,datatype:n,agg:o}=e;return Sf({expression:i,granularity:ru(e),dataType:n,agg:o,format:void 0,sort:void 0,title:t})};var Mh;(function(e){e.INCLUDE_ALL="INCLUDE_ALL",e.ADVANCED="ADVANCED",e.INVALID="INVALID",e.CONDITION="CONDITION",e.SPECIFIC_ITEMS="SPECIFIC_ITEMS"})(Mh=Mh||(Mh={}));var kh;(function(e){e.PERIOD="PERIOD",e.DATE_RANGE="DATE_RANGE"})(kh=kh||(kh={}));var Ph;(function(e){e.NUMERIC_RANGE="NUMERIC_RANGE"})(Ph=Ph||(Ph={}));var oa;(function(e){e.YEARS="years",e.QUARTERS="quarters",e.MONTHS="months",e.WEEKS="weeks",e.DAYS="days",e.HOURS="hours",e.MINUTES="minutes"})(oa=oa||(oa={}));var Ys;(function(e){e.DATE_TIME="datetime",e.NUMERIC="numeric",e.TEXT="text"})(Ys=Ys||(Ys={}));const n$=["1","30"],Ut=Object.assign(Object.assign(Object.assign({},Mh),kh),Ph),o$={[Ut.INCLUDE_ALL]:{all:!0,filterType:Ut.INCLUDE_ALL},[Ut.PERIOD]:{last:{count:1,offset:1},isNotCurrentPeriod:!0,filterType:Ut.PERIOD},[Ut.DATE_RANGE]:{filterType:Ut.DATE_RANGE},[Ut.NUMERIC_RANGE]:{filterType:Ut.NUMERIC_RANGE},[Ut.CONDITION]:{explicit:!1,multiSelection:!0,exclude:{members:[]},filterType:Ut.CONDITION},[Ut.SPECIFIC_ITEMS]:{explicit:!0,multiSelection:!0,members:[],filterType:Ut.SPECIFIC_ITEMS}},r$={filter:o$.INCLUDE_ALL,level:oa.YEARS};exports.ConditionFilterType=void 0;(function(e){e.IS="members",e.IS_NOT="exclude",e.IS_WITHIN="isWithin",e.TOP="top",e.BOTTOM="bottom",e.AFTER="after",e.BEFORE="before",e.STARTS_WITH="startsWith",e.DOESNT_START_WITH="doesntStartWith",e.ENDS_WITH="endsWith",e.DOESNT_END_WITH="doesntEndWith",e.CONTAINS="contains",e.DOESNT_CONTAIN="doesntContain",e.EQUALS="equals",e.DOESNT_EQUAL="doesntEqual",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.GREATER_THAN="fromNotEqual",e.GREATER_THAN_OR_EQUAL="from",e.LESS_THAN="toNotEqual",e.LESS_THAN_OR_EQUAL="to",e.BETWEEN="between",e.IS_NOT_BETWEEN="isNotBetween",e.MULTIPLE_CONDITION="multipleCondition",e.NONE="none"})(exports.ConditionFilterType=exports.ConditionFilterType||(exports.ConditionFilterType={}));const a$=e=>e.top!==void 0,s$=e=>e.bottom!==void 0,l$=e=>{var t;return!!(!((t=e.exclude)===null||t===void 0)&&t.members)},c$=e=>!!e.members&&!!e.isCondition,u$=e=>{var t,i;return((t=e.last)===null||t===void 0?void 0:t.anchor)!==void 0||((i=e.next)===null||i===void 0?void 0:i.anchor)!==void 0},d$=e=>e.fromNotEqual!==void 0,h$=e=>e.from!==void 0&&!e.isBetween,p$=e=>e.toNotEqual!==void 0,f$=e=>e.to!==void 0&&!e.isBetween,m$=e=>e.equals!==void 0,g$=e=>e.doesntEqual!==void 0,v$=e=>!!(e.equals===""&&e.isEmpty),y$=e=>!!(e.doesntEqual===""&&e.isEmpty),b$=e=>e.contains!==void 0,x$=e=>e.doesntContain!==void 0,w$=e=>e.startsWith!==void 0,_$=e=>e.doesntStartWith!==void 0,C$=e=>e.endsWith!==void 0,S$=e=>e.doesntEndWith!==void 0,T$=e=>e.from!==void 0&&e.to!==void 0,M$=e=>{var t,i;return((t=e.exclude)===null||t===void 0?void 0:t.from)!==void 0&&((i=e.exclude)===null||i===void 0?void 0:i.to)!==void 0},k$=e=>!!(e.or||e.and),_f=e=>s$(e)?exports.ConditionFilterType.BOTTOM:a$(e)?exports.ConditionFilterType.TOP:l$(e)?exports.ConditionFilterType.IS_NOT:u$(e)?exports.ConditionFilterType.IS_WITHIN:d$(e)?exports.ConditionFilterType.GREATER_THAN:p$(e)?exports.ConditionFilterType.LESS_THAN:m$(e)?exports.ConditionFilterType.EQUALS:g$(e)?exports.ConditionFilterType.DOESNT_EQUAL:v$(e)?exports.ConditionFilterType.IS_EMPTY:y$(e)?exports.ConditionFilterType.IS_NOT_EMPTY:b$(e)?exports.ConditionFilterType.CONTAINS:x$(e)?exports.ConditionFilterType.DOESNT_CONTAIN:S$(e)?exports.ConditionFilterType.DOESNT_END_WITH:_$(e)?exports.ConditionFilterType.DOESNT_START_WITH:C$(e)?exports.ConditionFilterType.ENDS_WITH:w$(e)?exports.ConditionFilterType.STARTS_WITH:M$(e)?exports.ConditionFilterType.IS_NOT_BETWEEN:c$(e)?exports.ConditionFilterType.IS:k$(e)?exports.ConditionFilterType.MULTIPLE_CONDITION:T$(e)?exports.ConditionFilterType.BETWEEN:h$(e)?exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:f$(e)?exports.ConditionFilterType.LESS_THAN_OR_EQUAL:exports.ConditionFilterType.NONE,Iy=(e,t,i)=>{var n,o,r,u,_,A,E;switch(_f(t)){case exports.ConditionFilterType.BOTTOM:if(t.by)return AO(e,SC(t.by,t.rankingMessage),t[exports.ConditionFilterType.BOTTOM],{guid:i});break;case exports.ConditionFilterType.EQUALS:return xO(e,t[exports.ConditionFilterType.EQUALS],{guid:i});case exports.ConditionFilterType.DOESNT_EQUAL:return bO(e,t[exports.ConditionFilterType.DOESNT_EQUAL],{guid:i});case exports.ConditionFilterType.GREATER_THAN:return wO(e,t[exports.ConditionFilterType.GREATER_THAN],{guid:i});case exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:return _O(e,t[exports.ConditionFilterType.GREATER_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.TOP:if(t.by)return PO(e,SC(t.by,t.rankingMessage),t[exports.ConditionFilterType.TOP],{guid:i});break;case exports.ConditionFilterType.STARTS_WITH:return yO(e,t[exports.ConditionFilterType.STARTS_WITH],{guid:i});case exports.ConditionFilterType.DOESNT_START_WITH:return mO(e,t[exports.ConditionFilterType.DOESNT_START_WITH],{guid:i});case exports.ConditionFilterType.ENDS_WITH:return vO(e,t[exports.ConditionFilterType.ENDS_WITH],{guid:i});case exports.ConditionFilterType.DOESNT_END_WITH:return fO(e,t[exports.ConditionFilterType.DOESNT_END_WITH],{guid:i});case exports.ConditionFilterType.CONTAINS:return gO(e,t[exports.ConditionFilterType.CONTAINS],{guid:i});case exports.ConditionFilterType.DOESNT_CONTAIN:return pO(e,t[exports.ConditionFilterType.DOESNT_CONTAIN],{guid:i});case exports.ConditionFilterType.LESS_THAN:return CO(e,t[exports.ConditionFilterType.LESS_THAN],{guid:i});case exports.ConditionFilterType.LESS_THAN_OR_EQUAL:return SO(e,t[exports.ConditionFilterType.LESS_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.BETWEEN:return rp(e,t.from,t.to,{guid:i});case exports.ConditionFilterType.IS_NOT_BETWEEN:return Ix(rp(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(o=t.exclude)===null||o===void 0?void 0:o.to,{guid:i}),void 0,{guid:i});case exports.ConditionFilterType.MULTIPLE_CONDITION:if(t.and)return V6(t.and.map(q=>Iy(e,q,i)),{guid:i});if(t.or)return U6(t.or.map(q=>Iy(e,q,i)),{guid:i});break;case exports.ConditionFilterType.IS_NOT:{const q=((r=t.filter)===null||r===void 0?void 0:r.turnedOff)&&((u=t.filter.exclude)===null||u===void 0?void 0:u.members)||[],g=((A=(_=t.exclude)===null||_===void 0?void 0:_.members)===null||A===void 0?void 0:A.filter(W=>!q.includes(W)))||[],te=nO({guid:i,excludeMembers:!0,enableMultiSelection:(E=t.multiSelection)!==null&&E!==void 0?E:!0,deactivatedMembers:q});return wf(e,g,te)}}throw new Vu("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},P$=(e,t,i)=>{var n,o;switch(_f(t)){case exports.ConditionFilterType.EQUALS:return X6(e,t[exports.ConditionFilterType.EQUALS],{guid:i});case exports.ConditionFilterType.GREATER_THAN:return q6(e,t[exports.ConditionFilterType.GREATER_THAN],{guid:i});case exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:return Z6(e,t[exports.ConditionFilterType.GREATER_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.LESS_THAN:return J6(e,t[exports.ConditionFilterType.LESS_THAN],{guid:i});case exports.ConditionFilterType.LESS_THAN_OR_EQUAL:return K6(e,t[exports.ConditionFilterType.LESS_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.BETWEEN:return CC(e,t.from,t.to,{guid:i});case exports.ConditionFilterType.IS_NOT_BETWEEN:return Ix(CC(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(o=t.exclude)===null||o===void 0?void 0:o.to,{guid:i}),void 0,{guid:i})}throw new Vu("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},A$=(e,t)=>{let i=e?e.toLocaleLowerCase():oa.YEARS;return i===oa.MINUTES&&t==="60"&&(i=oa.HOURS),i},E$=e=>e==null?void 0:e.all,O$=e=>e.last?e.last:e.next,L$=e=>{var t;return((t=O$(e))===null||t===void 0?void 0:t.offset)<2},EO=e=>{var t;return((t=e==null?void 0:e.members)===null||t===void 0?void 0:t.length)>=0},N$=(e,t)=>e&&typeof e=="string"||t&&typeof t=="string",D$=(e,t)=>e===""&&t==="",I$=(e,t)=>{const{from:i,to:n}=e;return t!==Ys.DATE_TIME?!1:N$(i,n)?!0:D$(i,n)},R$=e=>{const{from:t,to:i}=e;return t!==void 0&&i!==void 0&&!e.isBetween},OO=e=>_f(e)!==exports.ConditionFilterType.NONE,j$=e=>Object.keys(e).includes("isAdvanced"),B$=e=>!!(e.level&&e.bucket&&e.level===oa.MINUTES&&n$.includes(e.bucket)),z$=e=>e.filterType===Ut.INVALID,TC=(e,t=Ys.DATE_TIME,i)=>i&&B$(i)||j$(e)?Ut.ADVANCED:E$(e)?Ut.INCLUDE_ALL:L$(e)?Ut.PERIOD:EO(e)?Ut.SPECIFIC_ITEMS:I$(e,t)?Ut.DATE_RANGE:R$(e)?Ut.NUMERIC_RANGE:OO(e)?Ut.CONDITION:(z$(e),Ut.INVALID),F$=(e,t)=>{const{level:i,filter:n,bucket:o}=e,r=n||r$.filter,u={filter:Object.assign(Object.assign({},r),{filterType:TC(r,t)})};if(t===Ys.DATE_TIME){const _=r,A=(_==null?void 0:_.level)||i;u.level=A$(A,o),u.filter.filterType=TC(r,t,{level:A,bucket:o})}return u},MC=(e,t)=>{const i={config:Object.assign(Object.assign({},yf()),{guid:t,originalFilterJaql:e}),jaql:n=>n?e:{jaql:e,panel:"scope"},attribute:{id:e.dim},type:"filter"};return Object.assign({},i)},W$=(e,t)=>wf(e,[],{guid:t,excludeMembers:!0}),H$=(e,t,i,n)=>{const o=$$(t),r=U$(t,o),u=nO({guid:i,excludeMembers:!1,enableMultiSelection:n!=null?n:!0,deactivatedMembers:o});return wf(e,r,u)};function $$(e){var t,i,n,o;return!((t=e.filter)===null||t===void 0)&&t.turnedOff?(o=(n=(i=e.filter)===null||i===void 0?void 0:i.exclude)===null||n===void 0?void 0:n.members)!==null&&o!==void 0?o:[]:[]}function U$(e,t){const i=e.members;return t?i.filter(n=>!t.includes(n)):i}const V$=(e,t,i)=>TO(e,t.from,t.to,{guid:i}),G$=(e,t,i)=>rp(e,t.from,t.to,{guid:i}),Y$=(e,t,i)=>t.last?kO(e,t.last.offset,t.last.count,t.last.anchor,{guid:i}):MO(e,t.next.offset,t.next.count,t.next.anchor,{guid:i}),X$=(e,t,i)=>e$(e,t,{guid:i}),kC=(e,t)=>{try{if("formula"in e)throw new Vu("errors.filter.formulaFiltersNotSupported",{filter:JSON.stringify(e)});const i=F$(e,e.datatype),{filter:n}=i,{filterType:o}=n,r=t$(e),u=i$(e);switch(o){case Ut.INCLUDE_ALL:return W$(r,t);case Ut.SPECIFIC_ITEMS:return H$(r,n,t,n.multiSelection);case Ut.CONDITION:return u?P$(u,n,t):Iy(r,n,t);case Ut.DATE_RANGE:return V$(r,n,t);case Ut.PERIOD:return Y$(r,n,t);case Ut.NUMERIC_RANGE:return G$(r,n,t);case Ut.ADVANCED:return X$(r,n,t);case Ut.INVALID:return MC(e,t)}}catch(i){console.debug("Fall back to generic pass-through JAQL filter due to filter translation error:",i)}return MC(e,t)},q$=e=>["__int4","__int8","int","tinyint","bigint","int2","int4","int8","smallint","mediumint","serial","integer","byteint","int64"].includes(e.toLowerCase()),Z$=e=>["basemeasure","calculatedmeasure","float","float4","float8","double precision","double","numeric","decimal","real","number","float64"].includes(e.toLowerCase()),fn=e=>q$(e)||Z$(e)||e==="numeric-attribute",LO=e=>["textdimension","string","varchar","text","ntext","char","character","character varying","smalltext","nchar","nvarchar","json","jsonb","object","text-attribute"].includes(e.toLowerCase()),cr=e=>["datelevel","date","time","datetime","timestamp without time zone","timestamp","timestamp with time zone","timestamp(6)","timestamp_tz","timestamp_ntz","timestamp_ltz","timestampltz","timestampntz","timestamptz","datetime64[ns]","timewithtimezone","timestampwithtimezone","timestamp_with_timezone"].includes(e.toLowerCase()),NO=e=>["bool","boolean","bit","logical"].includes(e.toLowerCase()),DO=e=>fn(e)?"number":cr(e)?"datetime":LO(e)?"text":NO(e)?"boolean":"text",IO=function(e){e||(e=20);const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(e);let n=0,o;for(let r=0;r<e;r+=1){if(r>0&&r%5==0){i[r]="-";continue}n<=2&&(n=33554432+Math.random()*16777216|0),o=n&15,n=n>>4,i[r]=t[r==19?o&3|8:o]}return i.join("")},K$=e=>{if(!e)return{filters:void 0,relations:void 0};if(Array.isArray(e))return{filters:e,relations:void 0};const t=new Set;function i(u){const[_,...A]=u;if(t.add(_),!A.length)return n({instanceid:_.config.guid});const E=n(_),H=i(A);return{left:E,right:H,operator:"AND"}}function n(u){return u&&(J$(u)?hO(u)?i(u.filters):(t.add(u),{instanceid:u.config.guid}):("left"in u&&(u.left=n(u.left)),"right"in u&&(u.right=n(u.right)),"composeCode"in u&&delete u.composeCode,u))}const o=Ya(e),r=n(o);return{filters:Array.from(t),relations:r}};function J$(e){return"config"in e&&"guid"in e.config}function RO(e){return typeof e=="string"?e:e.title}function Rx(e){return typeof e=="object"&&"type"in e&&"title"in e}function Q$(e){return{id:e.id,address:e.address,title:e.title,type:e.live?"live":"elasticube"}}function jx(e){return Rx(e)?{title:e.title,live:e.type==="live"}:{title:e,live:!1}}function e4(e){var t;return Rx(e)?{title:e.title,live:e.type==="live",id:(t=e.id)!==null&&t!==void 0?t:"",address:e.address}:{title:e,id:""}}function t4(e){return e?e==="asc"?exports.Sort.Ascending:exports.Sort.Descending:exports.Sort.None}function i4(e){switch(e){case"sortAsc":return exports.Sort.Ascending;case"sortDesc":return exports.Sort.Descending;default:return exports.Sort.None}}const jO=(e,t,i=!1,n=!1)=>{const o=e.filter.filter&&!("turnedOff"in e.filter.filter),r=t||IO(),u=kC(e,r);if(o){const _=kC(Object.assign(Object.assign({},e),{filter:e.filter.filter}),`${t}-bg`),A=u.config;return u.config=Object.assign(Object.assign({},A),{backgroundFilter:_}),u}return u.config=Object.assign(Object.assign({},u.config),{originalFilterJaql:e,disabled:i,locked:n}),u};function os(e){const[t,i]=e.slice(1,-1).split(".");return{table:t,column:i?i.replace("(Calendar)","").trim():""}}function BO(e){return os(e.expression).table}function zO(e){return os(e.expression).column}function n4(e){switch(e){case zc.ASC:return"sortAsc";case zc.DESC:return"sortDesc";default:return"sortNone"}}const Cf=({expression:e,dataType:t,granularity:i,format:n,sort:o,title:r,panel:u,dataSource:_})=>{const A=os(e).column,E=t4(o);if(t===Th.DATETIME)return new Er(r!=null?r:A,e,i||it.Years,n||Er.getDefaultFormatForGranularity(i||it.Years),void 0,E,_,void 0,u);const q=!t||fn(t)?Lt.NumericAttribute:Lt.TextAttribute;return new kl(r!=null?r:A,e,q,void 0,E,_,void 0,u)},Sf=({expression:e,dataType:t,agg:i,granularity:n,format:o,sort:r,title:u,dataSource:_})=>{const A=Cf({expression:e,dataType:t,granularity:n,format:o,sort:r,title:u,dataSource:_}),E=na.aggregationFromJAQL(i),H=os(e).column,q=u!=null?u:`${E} ${H}`;switch(E){case Nt.Sum:return Ny(A,q,o);case Nt.Average:return L6(A,q,o);case Nt.Min:return QE(A,q,o);case Nt.Max:return Ax(A,q,o);case Nt.Count:return eO(A,q,o);case Nt.CountDistinct:return Ex(A,q,o);case Nt.Median:return Dy(A,q,o);case Nt.Variance:return lr(A,Nt.Variance,q,o);case Nt.StandardDeviation:return lr(A,Nt.StandardDeviation,q,o);default:return Ny(A,q,o)}},Bx=e=>{var t;const i=$H((t=e.context)!==null&&t!==void 0?t:{},n=>typeof n=="string"?n:n&&FO(n));return JE(e.title,e.formula,i)};function FO(e,t,i){if("filter"in e)return jO(e);if("formula"in e)return Bx(e);const r="datasource"in e?e.datasource:void 0;return e.agg?Sf({expression:e.dim,dataType:e.datatype,agg:e.agg||"",granularity:ru(e),format:t,sort:e.sort,title:e.title,dataSource:r}):Cf({expression:e.dim,dataType:e.datatype,granularity:ru(e),format:t,sort:e.sort,title:e.title,panel:i,dataSource:r})}function ru(e){return e!=null&&e.datatype&&cr(e.datatype)?Er.translateJaqlToGranularity(e):void 0}const zx=e=>DO(e).replace("number","numeric");class kl extends gf{constructor(t,i,n,o,r,u,_,A){if(super(t,n||Lt.Attribute,o,u,_),this._sort=exports.Sort.None,this.expression=i,!_&&i){const{table:E,column:H}=os(i);this.composeCode=Fx(E,H,"",Px)}A==="columns"&&(this.panel=A),this._sort=r||exports.Sort.None}get id(){return this.expression}getSort(){return this._sort}sort(t){return new kl(this.name,this.expression,this.type,this.description,t,this.dataSource,this.composeCode,this.panel)}jaql(t){const i={jaql:{title:this.name,dim:this.expression,datatype:zx(this.type)}};return this.panel&&(i.panel=this.panel),this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}serialize(){const t=super.serialize();return t.__serializable="DimensionalAttribute",t.expression=this.expression,this.getSort()!==exports.Sort.None&&(t.sort=this.getSort()),t}}class Er extends kl{constructor(t,i,n,o,r,u,_,A,E){if(super(t,i,Lt.DateLevel,r,u,_,A),this._format=o,this.granularity=n,!A&&i){const{table:H,column:q}=os(i);this.composeCode=Fx(H,q,n,Px)}E==="columns"&&(this.panel=E)}get id(){let t=`${this.expression}`;const{level:i="",dateTimeLevel:n="",bucket:o}=this.translateGranularityToJaql();return t+=`_${(i||n).toLowerCase()}`,o&&(t+=`_${o}`),t}getSort(){return this._sort}sort(t){return new Er(this.name,this.expression,this.granularity,this._format,this.description,t,this.dataSource,this.composeCode)}getFormat(){return this._format}format(t){return new Er(this.name,this.expression,this.granularity,t,this.description,this._sort,this.dataSource,this.composeCode)}setGranularity(t){return new Er(this.name,this.expression,t,this._format,this.description,this._sort,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalLevelAttribute",t.granularity=this.granularity,this.getFormat()!==void 0&&(t.format=this.getFormat()),t}jaql(t){const i={jaql:Object.assign({title:this.name,dim:this.expression,datatype:zx(this.type)},this.translateGranularityToJaql())};if(this.panel&&(i.panel=this.panel),this._format!==void 0){const n=i.jaql.dateTimeLevel||i.jaql.level;i.format={mask:{}},i.format.mask[n]=this._format}return this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}translateGranularityToJaql(){const t="minutes",i="seconds";switch(this.granularity){case it.Years:case it.Quarters:case it.Months:case it.Weeks:case it.Days:return{level:this.granularity.toLowerCase()};case it.Hours:return{dateTimeLevel:t,bucket:"60"};case it.MinutesRoundTo30:return{dateTimeLevel:t,bucket:"30"};case it.MinutesRoundTo15:return{dateTimeLevel:t,bucket:"15"};case it.Minutes:return{dateTimeLevel:t,bucket:"1"};case it.Seconds:return{dateTimeLevel:i,bucket:"0"};case it.AggHours:return{level:t,bucket:"60"};case it.AggMinutesRoundTo30:return{level:t,bucket:"30"};case it.AggMinutesRoundTo15:return{level:t,bucket:"15"};case it.AggMinutesRoundTo1:return{level:t,bucket:"1"};default:return console.warn("Unsupported level"),{level:this.granularity}}}static translateJaqlToGranularity(t){const i=n=>(console.warn("Unsupported granularity",n),n);if(t.dateTimeLevel){if(t.dateTimeLevel!=="minutes"&&t.dateTimeLevel!=="seconds")return i(t.dateTimeLevel);switch(t.bucket){case"60":return it.Hours;case"30":return it.MinutesRoundTo30;case"15":return it.MinutesRoundTo15;case"1":return it.Minutes;case"0":return it.Seconds;default:return i(t.dateTimeLevel)}}switch(t.level){case"years":return it.Years;case"quarters":return it.Quarters;case"months":return it.Months;case"weeks":return it.Weeks;case"days":return it.Days;case"minutes":switch(t.bucket){case"60":return it.AggHours;case"30":return it.AggMinutesRoundTo30;case"15":return it.AggMinutesRoundTo15;case"1":return it.AggMinutesRoundTo1;default:return i(t.level)}default:return i(t.level)}}static getDefaultFormatForGranularity(t){switch(t){case it.Years:return"yyyy";case it.Quarters:return"Q yyyy";case it.Months:return"yyyy-MM";case it.Weeks:return"ww yyyy";case it.Days:return"yyyy-MM-dd";case it.Hours:return"yyyy-MM-dd HH:mm";case it.MinutesRoundTo30:return"yyyy-MM-dd HH:mm";case it.MinutesRoundTo15:return"yyyy-MM-dd HH:mm";case it.Minutes:return"yyyy-MM-dd HH:mm";case it.Seconds:return"yyyy-MM-dd HH:mm:ss";case it.AggHours:return"HH:mm";case it.AggMinutesRoundTo30:return"HH:mm";case it.AggMinutesRoundTo15:return"HH:mm";case it.AggMinutesRoundTo1:return"HH:mm";default:return""}}}function o4(e){return e.granularity?r4(e):new kl(e.name||e.title,e.attribute||e.expression||e.dim,e.type,e.desc||e.description,e.sort,e.dataSource)}function r4(e){return new Er(e.name||e.title,e.attribute||e.expression||e.dim,e.granularity,e.format,e.desc||e.description,e.sort,e.dataSource)}function Fx(e,t,i,n){return(n.length>0?n+".":"")+Jr(e)+"."+Jr(t)+(i&&i.length>0?"."+i:"")}function pg(e){return"attribute"in e}function a4(e){return"measure"in e}const s4={rows:!1,columns:!1},PC=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},nn=(...e)=>e.reduce((t,i)=>{if(Array.isArray(i))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(i).forEach(n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=nn.options.mergeArrays?Array.from(new Set(t[n].concat(i[n]))):i[n]:PC(t[n])&&PC(i[n])?t[n]=nn(t[n],i[n]):t[n]=i[n])}),t},{}),WO={mergeArrays:!0};nn.options=WO;nn.withOptions=(e,...t)=>{nn.options=Object.assign({mergeArrays:!0},e);const i=nn(...t);return nn.options=WO,i};let Nd;const l4=new Uint8Array(16);function c4(){if(!Nd&&(Nd=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nd(l4)}const Zi=[];for(let e=0;e<256;++e)Zi.push((e+256).toString(16).slice(1));function u4(e,t=0){return Zi[e[t+0]]+Zi[e[t+1]]+Zi[e[t+2]]+Zi[e[t+3]]+"-"+Zi[e[t+4]]+Zi[e[t+5]]+"-"+Zi[e[t+6]]+Zi[e[t+7]]+"-"+Zi[e[t+8]]+Zi[e[t+9]]+"-"+Zi[e[t+10]]+Zi[e[t+11]]+Zi[e[t+12]]+Zi[e[t+13]]+Zi[e[t+14]]+Zi[e[t+15]]}const d4=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),AC={randomUUID:d4};function HO(e,t,i){if(AC.randomUUID&&!t&&!e)return AC.randomUUID();e=e||{};const n=e.random||(e.rng||c4)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,u4(n)}function h4(e,t){const i=t==null?void 0:t.find(n=>$O(e)===n.attribute.id);return i&&!i.config.disabled&&(i.isScope&&(i.isScope=!1),e.jaql.in={selected:i.jaql()}),e}function p4(e,t){const i=[],n=[];return t.forEach(o=>{e.some(u=>$O(u)===o.attribute.id)?i.push(o):n.push(o)}),[i,n]}function $O(e){const{dim:t,level:i,dateTimeLevel:n,bucket:o}=e.jaql;let r=`${t}`;return(i||n)&&(r+=`_${i||n}`),o&&(r+=`_${o}`),r}var f4=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]]);return i};function m4(e,t,i){return{rowsCount:e.length,columnsCount:t.length,measuresCount:i.length}}function g4(e){switch(e){case"sortAsc":return"asc";case"sortDesc":return"desc";default:return"none"}}function v4(e,t,i){const n=g4(e.direction),o=t===i.rowsCount-1,r={dir:n,initialized:!0,field:e.by&&"valuesIndex"in e.by?i.rowsCount+i.columnsCount+e.by.valuesIndex:t};return o&&(r.sortingLastDimension=!0),e.by&&(r.measurePath=(e.by.columnsMembersPath||[]).reduce((u,_,A)=>Object.assign(Object.assign({},u),{[i.rowsCount+A]:_}),{})),{sort:n,sortDetails:r}}function y4(e,t){if(t.rowsCount===0)return;const i=t.rowsCount-1,n=e[i],o=n.jaql,{sortDetails:r,sort:u}=o,_=f4(o,["sortDetails","sort"]);if(r&&r.field!==i&&r.field<e.length){const E=e[r.field];E.jaql.sortDetails=r,E.jaql.sort=u,n.jaql=_}}const Ah="ComposeSDK";function UO(e,t){const{attributes:i,measures:n,filters:o,filterRelations:r,highlights:u,dataSource:_,count:A,offset:E,ungroup:H}=e,q=H&&n.length===0,g=Object.assign({metadata:x4({attributes:i,measures:n,filters:o,filterRelations:r,highlights:u},t)},w4(_,A,E,q));return r?Object.assign(Object.assign({},g),{filterRelations:r}):g}function VO(e,t,i,n,o){const[r,u]=p4(e,n);e.forEach(E=>h4(E,r));const _=E=>{const H=E.jaql();return i?Array.isArray(H)?H.map(q=>Object.assign(Object.assign({},q),{instanceid:E.config.guid})):Object.assign(Object.assign({},H),{instanceid:E.config.guid}):H},A=(o?t.flatMap(E=>_(E)):[...t,...u].flatMap(E=>_(E))).filter(E=>Object.keys(E.jaql.filter||{}).length!==0);return o&&u.length>0&&console.warn(`The following highlight filters were not applied due to missing attributes: [${u.map(E=>E.attribute.name).join(", ")}].`),A}function b4(e){var t,i;const n=(t=e.jaql)===null||t===void 0?void 0:t.formula;if(!n||!n.includes("trend")&&!n.includes("forecast"))return e;const o=structuredClone(e),r=(i=o.jaql)===null||i===void 0?void 0:i.context;if(r)for(const u in r){const _=r[u];_.datatype==="text"&&_.agg==="count"&&(_.datatype="numeric")}return o}function x4(e,t){const{attributes:i,measures:n,filters:o,filterRelations:r,highlights:u}=e,_=i.map(H=>H.jaql()),A=n.map(H=>b4(H.jaql())),E=VO(_,o,r,u,t);return[..._,...A,...E]}function w4(e,t,i,n){return Object.assign(Object.assign(Object.assign({datasource:jx(e),by:Ah,queryGuid:HO()},n?{ungroup:!0}:{}),t?{count:t}:{}),i?{offset:i}:{})}function _4(e,t){const{rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,filterRelations:u,grandTotals:_,highlights:A,dataSource:E,count:H,offset:q}=e,g=Object.assign({metadata:S4({rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,highlights:A,filterRelations:u},t)},T4(E,_,H,q));return u?Object.assign(Object.assign({},g),{filterRelations:u}):g}function EC(e,t,i,n){const o=t==="rows"&&pg(e)&&e.sort&&e.sort.direction!=="sortNone",r=Object.assign(Object.assign({},pg(e)?e.attribute.jaql(!0):e.jaql(!0)),o&&v4(e.sort,i,n));return Object.assign(Object.assign({jaql:r},pg(e)&&e.includeSubTotals?{format:{subtotal:!0}}:{}),{panel:t,field:{index:i,id:`${t}-${i}`}})}function C4(e,t,i){return Object.assign(Object.assign({},a4(e)?nn(e.measure.jaql(),{jaql:{subtotalAgg:e.totalsCalculation},format:Object.assign({databars:e.dataBars||!1},e.shouldRequestMinMax&&{color:{type:"range"}})}):e.jaql()),{panel:t,field:{index:i,id:`${t}-${i}`}})}function S4(e,t){const{rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,filterRelations:u,highlights:_}=e,A=m4(i,n,o);let E=0;const H=i.map((Y,Z)=>EC(Y,"rows",Z+E,A));E=E+i.length;const q=n.map((Y,Z)=>EC(Y,"columns",Z+E,A));E=E+n.length;const g=[...H,...q],te=o.map((Y,Z)=>C4(Y,"measures",Z+E)),W=VO(g,r,u,_,t),C=[...g,...te,...W];return y4(C,A),C}function T4(e,t,i,n){return Object.assign(Object.assign(Object.assign({datasource:jx(e),by:Ah,queryGuid:HO(),dashboard:Ah,widget:Ah,format:"pivot"},i?{count:i}:{}),n?{offset:n}:{}),{grandTotals:Object.assign(Object.assign({},s4),t)})}var M4=!1;function k4(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function P4(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var A4=function(){function e(i){var n=this;this._insertTag=function(o){var r;n.tags.length===0?n.insertionPoint?r=n.insertionPoint.nextSibling:n.prepend?r=n.container.firstChild:r=n.before:r=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,r),n.tags.push(o)},this.isSpeedy=i.speedy===void 0?!M4:i.speedy,this.tags=[],this.ctr=0,this.nonce=i.nonce,this.key=i.key,this.container=i.container,this.prepend=i.prepend,this.insertionPoint=i.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(P4(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var r=k4(o);try{r.insertRule(n,r.cssRules.length)}catch(u){}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}),this.tags=[],this.ctr=0},e}(),ln="-ms-",ap="-moz-",Ht="-webkit-",GO="comm",Wx="rule",Hx="decl",E4="@import",YO="@keyframes",O4="@layer",L4=Math.abs,Tf=String.fromCharCode,N4=Object.assign;function D4(e,t){return en(e,0)^45?(((t<<2^en(e,0))<<2^en(e,1))<<2^en(e,2))<<2^en(e,3):0}function XO(e){return e.trim()}function I4(e,t){return(e=t.exec(e))?e[0]:e}function $t(e,t,i){return e.replace(t,i)}function Ry(e,t){return e.indexOf(t)}function en(e,t){return e.charCodeAt(t)|0}function au(e,t,i){return e.slice(t,i)}function Xo(e){return e.length}function $x(e){return e.length}function Dd(e,t){return t.push(e),e}function R4(e,t){return e.map(t).join("")}var Mf=1,nl=1,qO=0,Bn=0,Wi=0,Pl="";function kf(e,t,i,n,o,r,u){return{value:e,root:t,parent:i,type:n,props:o,children:r,line:Mf,column:nl,length:u,return:""}}function ec(e,t){return N4(kf("",null,null,"",null,null,0),e,{length:-e.length},t)}function j4(){return Wi}function B4(){return Wi=Bn>0?en(Pl,--Bn):0,nl--,Wi===10&&(nl=1,Mf--),Wi}function Yn(){return Wi=Bn<qO?en(Pl,Bn++):0,nl++,Wi===10&&(nl=1,Mf++),Wi}function rr(){return en(Pl,Bn)}function Eh(){return Bn}function Gu(e,t){return au(Pl,e,t)}function su(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ZO(e){return Mf=nl=1,qO=Xo(Pl=e),Bn=0,[]}function KO(e){return Pl="",e}function Oh(e){return XO(Gu(Bn-1,jy(e===91?e+2:e===40?e+1:e)))}function z4(e){for(;(Wi=rr())&&Wi<33;)Yn();return su(e)>2||su(Wi)>3?"":" "}function F4(e,t){for(;--t&&Yn()&&!(Wi<48||Wi>102||Wi>57&&Wi<65||Wi>70&&Wi<97););return Gu(e,Eh()+(t<6&&rr()==32&&Yn()==32))}function jy(e){for(;Yn();)switch(Wi){case e:return Bn;case 34:case 39:e!==34&&e!==39&&jy(Wi);break;case 40:e===41&&jy(e);break;case 92:Yn();break}return Bn}function W4(e,t){for(;Yn()&&e+Wi!==57;)if(e+Wi===84&&rr()===47)break;return"/*"+Gu(t,Bn-1)+"*"+Tf(e===47?e:Yn())}function H4(e){for(;!su(rr());)Yn();return Gu(e,Bn)}function $4(e){return KO(Lh("",null,null,null,[""],e=ZO(e),0,[0],e))}function Lh(e,t,i,n,o,r,u,_,A){for(var E=0,H=0,q=u,g=0,te=0,W=0,C=1,Y=1,Z=1,K=0,J="",G=o,j=r,B=n,z=J;Y;)switch(W=K,K=Yn()){case 40:if(W!=108&&en(z,q-1)==58){Ry(z+=$t(Oh(K),"&","&\f"),"&\f")!=-1&&(Z=-1);break}case 34:case 39:case 91:z+=Oh(K);break;case 9:case 10:case 13:case 32:z+=z4(W);break;case 92:z+=F4(Eh()-1,7);continue;case 47:switch(rr()){case 42:case 47:Dd(U4(W4(Yn(),Eh()),t,i),A);break;default:z+="/"}break;case 123*C:_[E++]=Xo(z)*Z;case 125*C:case 59:case 0:switch(K){case 0:case 125:Y=0;case 59+H:Z==-1&&(z=$t(z,/\f/g,"")),te>0&&Xo(z)-q&&Dd(te>32?LC(z+";",n,i,q-1):LC($t(z," ","")+";",n,i,q-2),A);break;case 59:z+=";";default:if(Dd(B=OC(z,t,i,E,H,o,_,J,G=[],j=[],q),r),K===123)if(H===0)Lh(z,t,B,B,G,r,q,_,j);else switch(g===99&&en(z,3)===110?100:g){case 100:case 108:case 109:case 115:Lh(e,B,B,n&&Dd(OC(e,B,B,0,0,o,_,J,o,G=[],q),j),o,j,q,_,n?G:j);break;default:Lh(z,B,B,B,[""],j,0,_,j)}}E=H=te=0,C=Z=1,J=z="",q=u;break;case 58:q=1+Xo(z),te=W;default:if(C<1){if(K==123)--C;else if(K==125&&C++==0&&B4()==125)continue}switch(z+=Tf(K),K*C){case 38:Z=H>0?1:(z+="\f",-1);break;case 44:_[E++]=(Xo(z)-1)*Z,Z=1;break;case 64:rr()===45&&(z+=Oh(Yn())),g=rr(),H=q=Xo(J=z+=H4(Eh())),K++;break;case 45:W===45&&Xo(z)==2&&(C=0)}}return r}function OC(e,t,i,n,o,r,u,_,A,E,H){for(var q=o-1,g=o===0?r:[""],te=$x(g),W=0,C=0,Y=0;W<n;++W)for(var Z=0,K=au(e,q+1,q=L4(C=u[W])),J=e;Z<te;++Z)(J=XO(C>0?g[Z]+" "+K:$t(K,/&\f/g,g[Z])))&&(A[Y++]=J);return kf(e,t,i,o===0?Wx:_,A,E,H)}function U4(e,t,i){return kf(e,t,i,GO,Tf(j4()),au(e,2,-2),0)}function LC(e,t,i,n){return kf(e,t,i,Hx,au(e,0,n),au(e,n+1,-1),n)}function Xs(e,t){for(var i="",n=$x(e),o=0;o<n;o++)i+=t(e[o],o,e,t)||"";return i}function V4(e,t,i,n){switch(e.type){case O4:if(e.children.length)break;case E4:case Hx:return e.return=e.return||e.value;case GO:return"";case YO:return e.return=e.value+"{"+Xs(e.children,n)+"}";case Wx:e.value=e.props.join(",")}return Xo(i=Xs(e.children,n))?e.return=e.value+"{"+i+"}":""}function G4(e){var t=$x(e);return function(i,n,o,r){for(var u="",_=0;_<t;_++)u+=e[_](i,n,o,r)||"";return u}}function Y4(e){return function(t){t.root||(t=t.return)&&e(t)}}function JO(e){var t=Object.create(null);return function(i){return t[i]===void 0&&(t[i]=e(i)),t[i]}}var X4=function(t,i,n){for(var o=0,r=0;o=r,r=rr(),o===38&&r===12&&(i[n]=1),!su(r);)Yn();return Gu(t,Bn)},q4=function(t,i){var n=-1,o=44;do switch(su(o)){case 0:o===38&&rr()===12&&(i[n]=1),t[n]+=X4(Bn-1,i,n);break;case 2:t[n]+=Oh(o);break;case 4:if(o===44){t[++n]=rr()===58?"&\f":"",i[n]=t[n].length;break}default:t[n]+=Tf(o)}while(o=Yn());return t},Z4=function(t,i){return KO(q4(ZO(t),i))},NC=new WeakMap,K4=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var i=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&i.charCodeAt(0)!==58&&!NC.get(n))&&!o){NC.set(t,!0);for(var r=[],u=Z4(i,r),_=n.props,A=0,E=0;A<u.length;A++)for(var H=0;H<_.length;H++,E++)t.props[E]=r[A]?u[A].replace(/&\f/g,_[H]):_[H]+" "+u[A]}}},J4=function(t){if(t.type==="decl"){var i=t.value;i.charCodeAt(0)===108&&i.charCodeAt(2)===98&&(t.return="",t.value="")}};function QO(e,t){switch(D4(e,t)){case 5103:return Ht+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+e+ap+e+ln+e+e;case 6828:case 4268:return Ht+e+ln+e+e;case 6165:return Ht+e+ln+"flex-"+e+e;case 5187:return Ht+e+$t(e,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+ln+"flex-$1$2")+e;case 5443:return Ht+e+ln+"flex-item-"+$t(e,/flex-|-self/,"")+e;case 4675:return Ht+e+ln+"flex-line-pack"+$t(e,/align-content|flex-|-self/,"")+e;case 5548:return Ht+e+ln+$t(e,"shrink","negative")+e;case 5292:return Ht+e+ln+$t(e,"basis","preferred-size")+e;case 6060:return Ht+"box-"+$t(e,"-grow","")+Ht+e+ln+$t(e,"grow","positive")+e;case 4554:return Ht+$t(e,/([^-])(transform)/g,"$1"+Ht+"$2")+e;case 6187:return $t($t($t(e,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),e,"")+e;case 5495:case 3959:return $t(e,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return $t($t(e,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+e+e;case 4095:case 3583:case 4068:case 2532:return $t(e,/(.+)-inline(.+)/,Ht+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xo(e)-1-t>6)switch(en(e,t+1)){case 109:if(en(e,t+4)!==45)break;case 102:return $t(e,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+ap+(en(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ry(e,"stretch")?QO($t(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(en(e,t+1)!==115)break;case 6444:switch(en(e,Xo(e)-3-(~Ry(e,"!important")&&10))){case 107:return $t(e,":",":"+Ht)+e;case 101:return $t(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(en(e,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+ln+"$2box$3")+e}break;case 5936:switch(en(e,t+11)){case 114:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ht+e+ln+e+e}return e}var Q4=function(t,i,n,o){if(t.length>-1&&!t.return)switch(t.type){case Hx:t.return=QO(t.value,t.length);break;case YO:return Xs([ec(t,{value:$t(t.value,"@","@"+Ht)})],o);case Wx:if(t.length)return R4(t.props,function(r){switch(I4(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Xs([ec(t,{props:[$t(r,/:(read-\w+)/,":"+ap+"$1")]})],o);case"::placeholder":return Xs([ec(t,{props:[$t(r,/:(plac\w+)/,":"+Ht+"input-$1")]}),ec(t,{props:[$t(r,/:(plac\w+)/,":"+ap+"$1")]}),ec(t,{props:[$t(r,/:(plac\w+)/,ln+"input-$1")]})],o)}return""})}},eU=[Q4],Pf=function(t){var i=t.key;if(i==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(C){var Y=C.getAttribute("data-emotion");Y.indexOf(" ")!==-1&&(document.head.appendChild(C),C.setAttribute("data-s",""))})}var o=t.stylisPlugins||eU,r={},u,_=[];u=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+i+' "]'),function(C){for(var Y=C.getAttribute("data-emotion").split(" "),Z=1;Z<Y.length;Z++)r[Y[Z]]=!0;_.push(C)});var A,E=[K4,J4];{var H,q=[V4,Y4(function(C){H.insert(C)})],g=G4(E.concat(o,q)),te=function(Y){return Xs($4(Y),g)};A=function(Y,Z,K,J){H=K,te(Y?Y+"{"+Z.styles+"}":Z.styles),J&&(W.inserted[Z.name]=!0)}}var W={key:i,sheet:new A4({key:i,container:u,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:r,registered:{},insert:A};return W.sheet.hydrate(_),W},tU=!0;function eL(e,t,i){var n="";return i.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}var Ux=function(t,i,n){var o=t.key+"-"+i.name;(n===!1||tU===!1)&&t.registered[o]===void 0&&(t.registered[o]=i.styles)},Vx=function(t,i,n){Ux(t,i,n);var o=t.key+"-"+i.name;if(t.inserted[i.name]===void 0){var r=i;do t.insert(i===r?"."+o:"",r,t.sheet,!0),r=r.next;while(r!==void 0)}};function iU(e){for(var t=0,i,n=0,o=e.length;o>=4;++n,o-=4)i=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,t=(i&65535)*1540483477+((i>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var nU={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oU=!1,rU=/[A-Z]|^ms/g,aU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,tL=function(t){return t.charCodeAt(1)===45},DC=function(t){return t!=null&&typeof t!="boolean"},fg=JO(function(e){return tL(e)?e:e.replace(rU,"-$&").toLowerCase()}),IC=function(t,i){switch(t){case"animation":case"animationName":if(typeof i=="string")return i.replace(aU,function(n,o,r){return qo={name:o,styles:r,next:qo},o})}return nU[t]!==1&&!tL(t)&&typeof i=="number"&&i!==0?i+"px":i},sU="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function lu(e,t,i){if(i==null)return"";var n=i;if(n.__emotion_styles!==void 0)return n;switch(typeof i){case"boolean":return"";case"object":{var o=i;if(o.anim===1)return qo={name:o.name,styles:o.styles,next:qo},o.name;var r=i;if(r.styles!==void 0){var u=r.next;if(u!==void 0)for(;u!==void 0;)qo={name:u.name,styles:u.styles,next:qo},u=u.next;var _=r.styles+";";return _}return lU(e,t,i)}case"function":{if(e!==void 0){var A=qo,E=i(e);return qo=A,lu(e,t,E)}break}}var H=i;if(t==null)return H;var q=t[H];return q!==void 0?q:H}function lU(e,t,i){var n="";if(Array.isArray(i))for(var o=0;o<i.length;o++)n+=lu(e,t,i[o])+";";else for(var r in i){var u=i[r];if(typeof u!="object"){var _=u;t!=null&&t[_]!==void 0?n+=r+"{"+t[_]+"}":DC(_)&&(n+=fg(r)+":"+IC(r,_)+";")}else{if(r==="NO_COMPONENT_SELECTOR"&&oU)throw new Error(sU);if(Array.isArray(u)&&typeof u[0]=="string"&&(t==null||t[u[0]]===void 0))for(var A=0;A<u.length;A++)DC(u[A])&&(n+=fg(r)+":"+IC(r,u[A])+";");else{var E=lu(e,t,u);switch(r){case"animation":case"animationName":{n+=fg(r)+":"+E+";";break}default:n+=r+"{"+E+"}"}}}}return n}var RC=/label:\s*([^\s;{]+)\s*(;|$)/g,qo;function Al(e,t,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";qo=void 0;var r=e[0];if(r==null||r.raw===void 0)n=!1,o+=lu(i,t,r);else{var u=r;o+=u[0]}for(var _=1;_<e.length;_++)if(o+=lu(i,t,e[_]),n){var A=r;o+=A[_]}RC.lastIndex=0;for(var E="",H;(H=RC.exec(o))!==null;)E+="-"+H[1];var q=iU(o)+E;return{name:q,styles:o,next:qo}}var cU=function(t){return t()},iL=Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]?Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,uU=iL||cU,jC=iL||Oe.useLayoutEffect,dU=!1,nL=Oe.createContext(typeof HTMLElement!="undefined"?Pf({key:"css"}):null),Gx=nL.Provider,Yx=function(t){return Je.forwardRef(function(i,n){var o=Je.useContext(nL);return t(i,o,n)})},El=Oe.createContext({}),Yu={}.hasOwnProperty,By="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Xx=function(t,i){var n={};for(var o in i)Yu.call(i,o)&&(n[o]=i[o]);return n[By]=t,n},hU=function(t){var i=t.cache,n=t.serialized,o=t.isStringTag;return Ux(i,n,o),uU(function(){return Vx(i,n,o)}),null},pU=Yx(function(e,t,i){var n=e.css;typeof n=="string"&&t.registered[n]!==void 0&&(n=t.registered[n]);var o=e[By],r=[n],u="";typeof e.className=="string"?u=eL(t.registered,r,e.className):e.className!=null&&(u=e.className+" ");var _=Al(r,void 0,Oe.useContext(El));u+=t.key+"-"+_.name;var A={};for(var E in e)Yu.call(e,E)&&E!=="css"&&E!==By&&!dU&&(A[E]=e[E]);return A.className=u,i&&(A.ref=i),Oe.createElement(Oe.Fragment,null,Oe.createElement(hU,{cache:t,serialized:_,isStringTag:typeof o=="string"}),Oe.createElement(o,A))}),qx=pU;exports.jsx$1=function(t,i){var n=arguments;if(i==null||!Yu.call(i,"css"))return Oe.createElement.apply(void 0,n);var o=n.length,r=new Array(o);r[0]=qx,r[1]=Xx(t,i);for(var u=2;u<o;u++)r[u]=n[u];return Oe.createElement.apply(null,r)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(exports.jsx$1||(exports.jsx$1={}));var fU=Yx(function(e,t){var i=e.styles,n=Al([i],void 0,Oe.useContext(El)),o=Oe.useRef();return jC(function(){var r=t.key+"-global",u=new t.sheet.constructor({key:r,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),_=!1,A=document.querySelector('style[data-emotion="'+r+" "+n.name+'"]');return t.sheet.tags.length&&(u.before=t.sheet.tags[0]),A!==null&&(_=!0,A.setAttribute("data-emotion",r),u.hydrate([A])),o.current=[u,_],function(){u.flush()}},[t]),jC(function(){var r=o.current,u=r[0],_=r[1];if(_){r[1]=!1;return}if(n.next!==void 0&&Vx(t,n.next,!0),u.tags.length){var A=u.tags[u.tags.length-1].nextElementSibling;u.before=A,u.flush()}t.insert("",n,u,!1)},[t,n.name]),null});function Zo(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Al(t)}function Ol(){var e=Zo.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var mU=function(t){return t()},gU=Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]?Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,vU=gU||mU,yU=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bU=JO(function(e){return yU.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),xU=!1,wU=bU,_U=function(t){return t!=="theme"},BC=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?wU:_U},zC=function(t,i,n){var o;if(i){var r=i.shouldForwardProp;o=t.__emotion_forwardProp&&r?function(u){return t.__emotion_forwardProp(u)&&r(u)}:r}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},CU=function(t){var i=t.cache,n=t.serialized,o=t.isStringTag;return Ux(i,n,o),vU(function(){return Vx(i,n,o)}),null},SU=function e(t,i){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,r,u;i!==void 0&&(r=i.label,u=i.target);var _=zC(t,i,n),A=_||BC(o),E=!A("as");return function(){var H=arguments,q=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(r!==void 0&&q.push("label:"+r+";"),H[0]==null||H[0].raw===void 0)q.push.apply(q,H);else{var g=H[0];q.push(g[0]);for(var te=H.length,W=1;W<te;W++)q.push(H[W],g[W])}var C=Yx(function(Y,Z,K){var J=E&&Y.as||o,G="",j=[],B=Y;if(Y.theme==null){B={};for(var z in Y)B[z]=Y[z];B.theme=Oe.useContext(El)}typeof Y.className=="string"?G=eL(Z.registered,j,Y.className):Y.className!=null&&(G=Y.className+" ");var O=Al(q.concat(j),Z.registered,B);G+=Z.key+"-"+O.name,u!==void 0&&(G+=" "+u);var R=E&&_===void 0?BC(J):A,T={};for(var v in Y)E&&v==="as"||R(v)&&(T[v]=Y[v]);return T.className=G,K&&(T.ref=K),Oe.createElement(Oe.Fragment,null,Oe.createElement(CU,{cache:Z,serialized:O,isStringTag:typeof J=="string"}),Oe.createElement(J,T))});return C.displayName=r!==void 0?r:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",C.defaultProps=t.defaultProps,C.__emotion_real=C,C.__emotion_base=o,C.__emotion_styles=q,C.__emotion_forwardProp=_,Object.defineProperty(C,"toString",{value:function(){return u===void 0&&xU?"NO_COMPONENT_SELECTOR":"."+u}}),C.withComponent=function(Y,Z){var K=e(Y,Qh({},i,Z,{shouldForwardProp:zC(C,Z,!0)}));return K.apply(void 0,q)},C}},TU=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],cu=SU.bind(null);TU.forEach(function(e){cu[e]=cu(e)});var MU=Object.defineProperty,kU=Object.defineProperties,PU=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,oL=Object.prototype.hasOwnProperty,rL=Object.prototype.propertyIsEnumerable,Qr=Math.pow,zy=(e,t,i)=>t in e?MU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,we=(e,t)=>{for(var i in t||(t={}))oL.call(t,i)&&zy(e,i,t[i]);if(sp)for(var i of sp(t))rL.call(t,i)&&zy(e,i,t[i]);return e},ze=(e,t)=>kU(e,PU(t)),Fy=e=>typeof e=="symbol"?e:e+"",ot=(e,t)=>{var i={};for(var n in e)oL.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&rL.call(e,n)&&(i[n]=e[n]);return i},Ne=(e,t,i)=>(zy(e,typeof t!="symbol"?t+"":t,i),i),aL=(e,t,i)=>new Promise((n,o)=>{var r=A=>{try{_(i.next(A))}catch(E){o(E)}},u=A=>{try{_(i.throw(A))}catch(E){o(E)}},_=A=>A.done?n(A.value):Promise.resolve(A.value).then(r,u);_((i=i.apply(e,t)).next())});const AU={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};let EU=class Wy{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||AU,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,n,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Wy(this.logger,we({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Wy(this.logger,t)}};var nr=new EU;let Af=class{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]=this.observers[i]||[],this.observers[i].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(i=>i!==t)}}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(o=>{o(...i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[e,...i])})}};function tc(){let e,t;const i=new Promise((n,o)=>{e=n,t=o});return i.resolve=e,i.reject=t,i}function FC(e){return e==null?"":""+e}function OU(e,t,i){e.forEach(n=>{t[n]&&(i[n]=t[n])})}function Zx(e,t,i){function n(u){return u&&u.indexOf("###")>-1?u.replace(/###/g,"."):u}function o(){return!e||typeof e=="string"}const r=typeof t!="string"?[].concat(t):t.split(".");for(;r.length>1;){if(o())return{};const u=n(r.shift());!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={}}return o()?{}:{obj:e,k:n(r.shift())}}function WC(e,t,i){const{obj:n,k:o}=Zx(e,t,Object);n[o]=i}function LU(e,t,i,n){const{obj:o,k:r}=Zx(e,t,Object);o[r]=o[r]||[],o[r].push(i)}function lp(e,t){const{obj:i,k:n}=Zx(e,t);if(i)return i[n]}function NU(e,t,i){const n=lp(e,i);return n!==void 0?n:lp(t,i)}function sL(e,t,i){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?i&&(e[n]=t[n]):sL(e[n],t[n],i):e[n]=t[n]);return e}function Cs(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var DU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function IU(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>DU[t]):e}const RU=[" ",",","?","!",";"];function jU(e,t,i){t=t||"",i=i||"";const n=RU.filter(u=>t.indexOf(u)<0&&i.indexOf(u)<0);if(n.length===0)return!0;const o=new RegExp(`(${n.map(u=>u==="?"?"\\?":u).join("|")})`);let r=!o.test(e);if(!r){const u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(r=!0)}return r}function cp(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(i);let o=e;for(let r=0;r<n.length;++r){if(!o||typeof o[n[r]]=="string"&&r+1<n.length)return;if(o[n[r]]===void 0){let u=2,_=n.slice(r,r+u).join(i),A=o[_];for(;A===void 0&&n.length>r+u;)u++,_=n.slice(r,r+u).join(i),A=o[_];if(A===void 0)return;if(A===null)return null;if(t.endsWith(_)){if(typeof A=="string")return A;if(_&&typeof A[_]=="string")return A[_]}const E=n.slice(r+u).join(i);return E?cp(A,E,i):void 0}o=o[n[r]]}return o}function up(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class HC extends Af{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let _=[t,i];n&&typeof n!="string"&&(_=_.concat(n)),n&&typeof n=="string"&&(_=_.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(_=t.split("."));const A=lp(this.data,_);return A||!u||typeof n!="string"?A:cp(this.data&&this.data[t]&&this.data[t][i],n,r)}addResource(t,i,n,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const u=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let _=[t,i];n&&(_=_.concat(u?n.split(u):n)),t.indexOf(".")>-1&&(_=t.split("."),o=i,i=_[1]),this.addNamespaces(i),WC(this.data,_,o),r.silent||this.emit("added",t,i,n,o)}addResources(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in n)(typeof n[r]=="string"||Object.prototype.toString.apply(n[r])==="[object Array]")&&this.addResource(t,i,r,n[r],{silent:!0});o.silent||this.emit("added",t,i,n)}addResourceBundle(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[t,i];t.indexOf(".")>-1&&(_=t.split("."),o=n,n=i,i=_[1]),this.addNamespaces(i);let A=lp(this.data,_)||{};o?sL(A,n,r):A=we(we({},A),n),WC(this.data,_,A),u.silent||this.emit("added",t,i,n)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?we({},this.getResource(t,i)):this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(n=>i[n]&&Object.keys(i[n]).length>0)}toJSON(){return this.data}}var lL={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,n,o){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,n,o))}),t}};const $C={};class dp extends Af{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),OU(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,i);return n&&n.res!==void 0}extractFromKey(t,i){let n=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const u=n&&t.indexOf(n)>-1,_=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!jU(t,n,o);if(u&&!_){const A=t.match(this.interpolator.nestingRegexp);if(A&&A.length>0)return{key:t,namespaces:r};const E=t.split(n);(n!==o||n===o&&this.options.ns.indexOf(E[0])>-1)&&(r=E.shift()),t=E.join(o)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,n){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i=we({},i)),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:u,namespaces:_}=this.extractFromKey(t[t.length-1],i),A=_[_.length-1],E=i.lng||this.language,H=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(H){const J=i.nsSeparator||this.options.nsSeparator;return o?{res:`${A}${J}${u}`,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:`${A}${J}${u}`}return o?{res:u,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:u}const q=this.resolve(t,i);let g=q&&q.res;const te=q&&q.usedKey||u,W=q&&q.exactUsedKey||u,C=Object.prototype.toString.apply(g),Y=["[object Number]","[object Function]","[object RegExp]"],Z=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,K=!this.i18nFormat||this.i18nFormat.handleAsObject;if(K&&g&&typeof g!="string"&&typeof g!="boolean"&&typeof g!="number"&&Y.indexOf(C)<0&&!(typeof Z=="string"&&C==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(te,g,ze(we({},i),{ns:_})):`key '${u} (${this.language})' returned an object instead of string.`;return o?(q.res=J,q):J}if(r){const J=C==="[object Array]",G=J?[]:{},j=J?W:te;for(const B in g)if(Object.prototype.hasOwnProperty.call(g,B)){const z=`${j}${r}${B}`;G[B]=this.translate(z,ze(we({},i),{joinArrays:!1,ns:_})),G[B]===z&&(G[B]=g[B])}g=G}}else if(K&&typeof Z=="string"&&C==="[object Array]")g=g.join(Z),g&&(g=this.extendTranslation(g,t,i,n));else{let J=!1,G=!1;const j=i.count!==void 0&&typeof i.count!="string",B=dp.hasDefaultValue(i),z=j?this.pluralResolver.getSuffix(E,i.count,i):"",O=i.ordinal&&j?this.pluralResolver.getSuffix(E,i.count,{ordinal:!1}):"",R=i[`defaultValue${z}`]||i[`defaultValue${O}`]||i.defaultValue;!this.isValidLookup(g)&&B&&(J=!0,g=R),this.isValidLookup(g)||(G=!0,g=u);const T=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:g,v=B&&R!==g&&this.options.updateMissing;if(G||J||v){if(this.logger.log(v?"updateKey":"missingKey",E,A,u,v?R:g),r){const P=this.resolve(u,ze(we({},i),{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let m=[];const S=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&S&&S[0])for(let P=0;P<S.length;P++)m.push(S[P]);else this.options.saveMissingTo==="all"?m=this.languageUtils.toResolveHierarchy(i.lng||this.language):m.push(i.lng||this.language);const y=(P,F,U)=>{const N=B&&U!==g?U:T;this.options.missingKeyHandler?this.options.missingKeyHandler(P,A,F,N,v,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(P,A,F,N,v,i),this.emit("missingKey",P,A,F,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?m.forEach(P=>{this.pluralResolver.getSuffixes(P,i).forEach(F=>{y([P],u+F,i[`defaultValue${F}`]||R)})}):y(m,u,R))}g=this.extendTranslation(g,t,i,q,n),G&&g===u&&this.options.appendNamespaceToMissingKey&&(g=`${A}:${u}`),(G||J)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}:${u}`:u,J?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(q.res=g,q):g}extendTranslation(t,i,n,o,r){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,we(we({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(ze(we({},n),{interpolation:we(we({},this.options.interpolation),n.interpolation)}));const E=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let H;if(E){const g=t.match(this.interpolator.nestingRegexp);H=g&&g.length}let q=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(q=we(we({},this.options.interpolation.defaultVariables),q)),t=this.interpolator.interpolate(t,q,n.lng||this.language,n),E){const g=t.match(this.interpolator.nestingRegexp),te=g&&g.length;H<te&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(n.lng=o.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,te=new Array(g),W=0;W<g;W++)te[W]=arguments[W];return r&&r[0]===te[0]&&!n.context?(u.logger.warn(`It seems you are nesting recursively key: ${te[0]} in key: ${i[0]}`),null):u.translate(...te,i)},n)),n.interpolation&&this.interpolator.reset()}const _=n.postProcess||this.options.postProcess,A=typeof _=="string"?[_]:_;return t!=null&&A&&A.length&&n.applyPostProcessor!==!1&&(t=lL.handle(A,t,i,this.options&&this.options.postProcessPassResolved?we({i18nResolved:o},n):n,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,r,u,_;return typeof t=="string"&&(t=[t]),t.forEach(A=>{if(this.isValidLookup(n))return;const E=this.extractFromKey(A,i),H=E.key;o=H;let q=E.namespaces;this.options.fallbackNS&&(q=q.concat(this.options.fallbackNS));const g=i.count!==void 0&&typeof i.count!="string",te=g&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),W=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",C=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);q.forEach(Y=>{this.isValidLookup(n)||(_=Y,!$C[`${C[0]}-${Y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(_)&&($C[`${C[0]}-${Y}`]=!0,this.logger.warn(`key "${o}" for languages "${C.join(", ")}" won't get resolved as namespace "${_}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(Z=>{if(this.isValidLookup(n))return;u=Z;const K=[H];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(K,H,Z,Y,i);else{let G;g&&(G=this.pluralResolver.getSuffix(Z,i.count,i));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(K.push(H+G),i.ordinal&&G.indexOf(B)===0&&K.push(H+G.replace(B,this.options.pluralSeparator)),te&&K.push(H+j)),W){const z=`${H}${this.options.contextSeparator}${i.context}`;K.push(z),g&&(K.push(z+G),i.ordinal&&G.indexOf(B)===0&&K.push(z+G.replace(B,this.options.pluralSeparator)),te&&K.push(z+j))}}let J;for(;J=K.pop();)this.isValidLookup(n)||(r=J,n=this.getResource(Z,Y,J,i))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:u,usedNS:_}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,n,o):this.resourceStore.getResource(t,i,n,o)}static hasDefaultValue(t){const i="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i===n.substring(0,i.length)&&t[n]!==void 0)return!0;return!1}}function mg(e){return e.charAt(0).toUpperCase()+e.slice(1)}class UC{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nr.create("languageUtils")}getScriptPartFromCode(t){if(t=up(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=up(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(o=>o.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=mg(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=mg(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=mg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach(n=>{if(i)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(i=o)}),!i&&this.options.supportedLngs&&t.forEach(n=>{if(i)return;const o=this.getLanguagePartFromCode(n);if(this.isSupportedCode(o))return i=o;i=this.options.supportedLngs.find(r=>{if(r===o||!(r.indexOf("-")<0&&o.indexOf("-")<0)&&r.indexOf(o)===0)return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];let n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}toResolveHierarchy(t,i){const n=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],r=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),n.forEach(u=>{o.indexOf(u)<0&&r(this.formatLanguageCode(u))}),o}}let BU=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],zU={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const FU=["v1","v2","v3"],WU=["v4"],VC={zero:0,one:1,two:2,few:3,many:4,other:5};function HU(){const e={};return BU.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:zU[t.fc]}})}),e}class $U{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=nr.create("pluralResolver"),(!this.options.compatibilityJSON||WU.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=HU()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(up(t),{type:i.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(o=>`${i}${o}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((o,r)=>VC[o]-VC[r]).map(o=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o}`):n.numbers.map(o=>this.getSuffix(t,o,i)):[]}getSuffix(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,n);return o?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(i)}`:this.getSuffixRetroCompatible(o,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const n=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let o=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const r=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!FU.includes(this.options.compatibilityJSON)}}function GC(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=NU(e,t,i);return!r&&o&&typeof i=="string"&&(r=cp(e,i,n),r===void 0&&(r=cp(t,i,n))),r}class UU{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const i=t.interpolation;this.escape=i.escape!==void 0?i.escape:IU,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Cs(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Cs(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Cs(i.nestingPrefix):i.nestingPrefixEscaped||Cs("$t("),this.nestingSuffix=i.nestingSuffix?Cs(i.nestingSuffix):i.nestingSuffixEscaped||Cs(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const i=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(i,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,i,n,o){let r,u,_;const A=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function E(te){return te.replace(/\$/g,"$$$$")}const H=te=>{if(te.indexOf(this.formatSeparator)<0){const Z=GC(i,A,te,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Z,void 0,n,ze(we(we({},o),i),{interpolationkey:te})):Z}const W=te.split(this.formatSeparator),C=W.shift().trim(),Y=W.join(this.formatSeparator).trim();return this.format(GC(i,A,C,this.options.keySeparator,this.options.ignoreJSONStructure),Y,n,ze(we(we({},o),i),{interpolationkey:C}))};this.resetRegExp();const q=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:te=>E(te)},{regex:this.regexp,safeValue:te=>this.escapeValue?E(this.escape(te)):E(te)}].forEach(te=>{for(_=0;r=te.regex.exec(t);){const W=r[1].trim();if(u=H(W),u===void 0)if(typeof q=="function"){const Y=q(t,r,o);u=typeof Y=="string"?Y:""}else if(o&&Object.prototype.hasOwnProperty.call(o,W))u="";else if(g){u=r[0];continue}else this.logger.warn(`missed to pass in variable ${W} for interpolating ${t}`),u="";else typeof u!="string"&&!this.useRawValueToEscape&&(u=FC(u));const C=te.safeValue(u);if(t=t.replace(r[0],C),g?(te.regex.lastIndex+=u.length,te.regex.lastIndex-=r[0].length):te.regex.lastIndex=0,_++,_>=this.maxReplaces)break}}),t}nest(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,r,u;function _(A,E){const H=this.nestingOptionsSeparator;if(A.indexOf(H)<0)return A;const q=A.split(new RegExp(`${H}[ ]*{`));let g=`{${q[1]}`;A=q[0],g=this.interpolate(g,u);const te=g.match(/'/g),W=g.match(/"/g);(te&&te.length%2===0&&!W||W.length%2!==0)&&(g=g.replace(/'/g,'"'));try{u=JSON.parse(g),E&&(u=we(we({},E),u))}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${A}`,C),`${A}${H}${g}`}return delete u.defaultValue,A}for(;o=this.nestingRegexp.exec(t);){let A=[];u=we({},n),u=u.replace&&typeof u.replace!="string"?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;let E=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const H=o[1].split(this.formatSeparator).map(q=>q.trim());o[1]=H.shift(),A=H,E=!0}if(r=i(_.call(this,o[1].trim(),u),u),r&&o[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=FC(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),r=""),E&&(r=A.reduce((H,q)=>this.format(H,q,n.lng,ze(we({},n),{interpolationkey:o[1].trim()})),r.trim())),t=t.replace(o[0],r),this.regexp.lastIndex=0}return t}}function VU(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);t==="currency"&&o.indexOf(":")<0?i.currency||(i.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?i.range||(i.range=o.trim()):o.split(";").forEach(r=>{if(!r)return;const[u,..._]=r.split(":"),A=_.join(":").trim().replace(/^'+|'+$/g,"");i[u.trim()]||(i[u.trim()]=A),A==="false"&&(i[u.trim()]=!1),A==="true"&&(i[u.trim()]=!0),isNaN(A)||(i[u.trim()]=parseInt(A,10))})}return{formatName:t,formatOptions:i}}function Ss(e){const t={};return function(i,n,o){const r=n+JSON.stringify(o);let u=t[r];return u||(u=e(up(n),o),t[r]=u),u(i)}}class GU{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nr.create("formatter"),this.options=t,this.formats={number:Ss((i,n)=>{const o=new Intl.NumberFormat(i,we({},n));return r=>o.format(r)}),currency:Ss((i,n)=>{const o=new Intl.NumberFormat(i,ze(we({},n),{style:"currency"}));return r=>o.format(r)}),datetime:Ss((i,n)=>{const o=new Intl.DateTimeFormat(i,we({},n));return r=>o.format(r)}),relativetime:Ss((i,n)=>{const o=new Intl.RelativeTimeFormat(i,we({},n));return r=>o.format(r,n.range||"day")}),list:Ss((i,n)=>{const o=new Intl.ListFormat(i,we({},n));return r=>o.format(r)})},this.init(t)}init(t){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Ss(i)}format(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((r,u)=>{const{formatName:_,formatOptions:A}=VU(u);if(this.formats[_]){let E=r;try{const H=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},q=H.locale||H.lng||o.locale||o.lng||n;E=this.formats[_](r,q,we(we(we({},A),o),H))}catch(H){this.logger.warn(H)}return E}else this.logger.warn(`there was no format function for ${_}`);return r},t)}}function YU(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class XU extends Af{constructor(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=nr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,o.backend,o)}queueLoad(t,i,n,o){const r={},u={},_={},A={};return t.forEach(E=>{let H=!0;i.forEach(q=>{const g=`${E}|${q}`;!n.reload&&this.store.hasResourceBundle(E,q)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?u[g]===void 0&&(u[g]=!0):(this.state[g]=1,H=!1,u[g]===void 0&&(u[g]=!0),r[g]===void 0&&(r[g]=!0),A[q]===void 0&&(A[q]=!0)))}),H||(_[E]=!0)}),(Object.keys(r).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(u),toLoadLanguages:Object.keys(_),toLoadNamespaces:Object.keys(A)}}loaded(t,i,n){const o=t.split("|"),r=o[0],u=o[1];i&&this.emit("failedLoading",r,u,i),n&&this.store.addResourceBundle(r,u,n),this.state[t]=i?-1:2;const _={};this.queue.forEach(A=>{LU(A.loaded,[r],u),YU(A,t),i&&A.errors.push(i),A.pendingCount===0&&!A.done&&(Object.keys(A.loaded).forEach(E=>{_[E]||(_[E]={});const H=A.loaded[E];H.length&&H.forEach(q=>{_[E][q]===void 0&&(_[E][q]=!0)})}),A.done=!0,A.errors.length?A.callback(A.errors):A.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(A=>!A.done)}read(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:n,tried:o,wait:r,callback:u});return}this.readingCalls++;const _=(E,H)=>{if(this.readingCalls--,this.waitingReads.length>0){const q=this.waitingReads.shift();this.read(q.lng,q.ns,q.fcName,q.tried,q.wait,q.callback)}if(E&&H&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,n,o+1,r*2,u)},r);return}u(E,H)},A=this.backend[n].bind(this.backend);if(A.length===2){try{const E=A(t,i);E&&typeof E.then=="function"?E.then(H=>_(null,H)).catch(_):_(null,E)}catch(E){_(E)}return}return A(t,i,_)}prepareLoading(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(u=>{this.loadOne(u)})}load(t,i,n){this.prepareLoading(t,i,{},n)}reload(t,i,n){this.prepareLoading(t,i,{reload:!0},n)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,(u,_)=>{u&&this.logger.warn(`${i}loading namespace ${r} for language ${o} failed`,u),!u&&_&&this.logger.log(`${i}loaded namespace ${r} for language ${o}`,_),this.loaded(t,u,_)})}saveMissing(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},_=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${n}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const A=ze(we({},u),{isUpdate:r}),E=this.backend.create.bind(this.backend);if(E.length<6)try{let H;E.length===5?H=E(t,i,n,o,A):H=E(t,i,n,o),H&&typeof H.then=="function"?H.then(q=>_(null,q)).catch(_):_(null,H)}catch(H){_(H)}else E(t,i,n,o,_,A)}!t||!t[0]||this.store.addResource(t[0],i,n,o)}}}function YC(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(n=>{t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:(e,t,i,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function XC(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Id(){}function qU(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}class uu extends Af{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=XC(t),this.services={},this.logger=nr,this.modules={external:[]},qU(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=YC();this.options=we(we(we({},o),this.options),XC(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=we(we({},o.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(A){return A?typeof A=="function"?new A:A:null}if(!this.options.isClone){this.modules.logger?nr.init(r(this.modules.logger),this.options):nr.init(null,this.options);let A;this.modules.formatter?A=this.modules.formatter:typeof Intl!="undefined"&&(A=GU);const E=new UC(this.options);this.store=new HC(this.options.resources,this.options);const H=this.services;H.logger=nr,H.resourceStore=this.store,H.languageUtils=E,H.pluralResolver=new $U(E,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),A&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(H.formatter=r(A),H.formatter.init(H,this.options),this.options.interpolation.format=H.formatter.format.bind(H.formatter)),H.interpolator=new UU(this.options),H.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},H.backendConnector=new XU(r(this.modules.backend),H.resourceStore,H,this.options),H.backendConnector.on("*",function(q){for(var g=arguments.length,te=new Array(g>1?g-1:0),W=1;W<g;W++)te[W-1]=arguments[W];t.emit(q,...te)}),this.modules.languageDetector&&(H.languageDetector=r(this.modules.languageDetector),H.languageDetector.init&&H.languageDetector.init(H,this.options.detection,this.options)),this.modules.i18nFormat&&(H.i18nFormat=r(this.modules.i18nFormat),H.i18nFormat.init&&H.i18nFormat.init(this)),this.translator=new dp(this.services,this.options),this.translator.on("*",function(q){for(var g=arguments.length,te=new Array(g>1?g-1:0),W=1;W<g;W++)te[W-1]=arguments[W];t.emit(q,...te)}),this.modules.external.forEach(q=>{q.init&&q.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Id),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const A=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);A.length>0&&A[0]!=="dev"&&(this.options.lng=A[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(A=>{this[A]=function(){return t.store[A](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(A=>{this[A]=function(){return t.store[A](...arguments),t}});const u=tc(),_=()=>{const A=(E,H)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(H),n(E,H)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return A(null,this.t.bind(this));this.changeLanguage(this.options.lng,A)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),u}loadResources(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return i();const o=[],r=u=>{u&&this.services.languageUtils.toResolveHierarchy(u).forEach(_=>{o.indexOf(_)<0&&o.push(_)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>r(u)),this.options.preload&&this.options.preload.forEach(u=>r(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,i,n){const o=tc();return t||(t=this.languages),i||(i=this.options.ns),n||(n=Id),this.services.backendConnector.reload(t,i,r=>{o.resolve(),n(r)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&lL.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let i=0;i<this.languages.length;i++){const n=this.languages[i];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,i){var n=this;this.isLanguageChangingTo=t;const o=tc();this.emit("languageChanging",t);const r=A=>{this.language=A,this.languages=this.services.languageUtils.toResolveHierarchy(A),this.resolvedLanguage=void 0,this.setResolvedLanguage(A)},u=(A,E)=>{E?(r(E),this.translator.changeLanguage(E),this.isLanguageChangingTo=void 0,this.emit("languageChanged",E),this.logger.log("languageChanged",E)):this.isLanguageChangingTo=void 0,o.resolve(function(){return n.t(...arguments)}),i&&i(A,function(){return n.t(...arguments)})},_=A=>{!t&&!A&&this.services.languageDetector&&(A=[]);const E=typeof A=="string"?A:this.services.languageUtils.getBestMatchFromCodes(A);E&&(this.language||r(E),this.translator.language||this.translator.changeLanguage(E),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(E)),this.loadResources(E,H=>{u(H,E)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(_):this.services.languageDetector.detect(_):_(t),o}getFixedT(t,i,n){var o=this;const r=function(u,_){let A;if(typeof _!="object"){for(var E=arguments.length,H=new Array(E>2?E-2:0),q=2;q<E;q++)H[q-2]=arguments[q];A=o.options.overloadTranslationOptionHandler([u,_].concat(H))}else A=we({},_);A.lng=A.lng||r.lng,A.lngs=A.lngs||r.lngs,A.ns=A.ns||r.ns,A.keyPrefix=A.keyPrefix||n||r.keyPrefix;const g=o.options.keySeparator||".";let te;return A.keyPrefix&&Array.isArray(u)?te=u.map(W=>`${A.keyPrefix}${g}${W}`):te=A.keyPrefix?`${A.keyPrefix}${g}${u}`:u,o.t(te,A)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=n,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=i.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=this.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};if(i.precheck){const _=i.precheck(this,u);if(_!==void 0)return _}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(n,t)&&(!o||u(r,t)))}loadNamespaces(t,i){const n=tc();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),i&&i(o)}),n):(i&&i(),Promise.resolve())}loadLanguages(t,i){const n=tc();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],r=t.filter(u=>o.indexOf(u)<0);return r.length?(this.options.preload=o.concat(r),this.loadResources(u=>{n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new UC(YC());return i.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new uu(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const o=ze(we(we({},this.options),t),{isClone:!0}),r=new uu(o);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(u=>{r[u]=this[u]}),r.services=we({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n&&(r.store=new HC(this.store.data,o),r.services.resourceStore=r.store),r.translator=new dp(r.services,o),r.translator.on("*",function(u){for(var _=arguments.length,A=new Array(_>1?_-1:0),E=1;E<_;E++)A[E-1]=arguments[E];r.emit(u,...A)}),r.init(o,i),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const cL=uu.createInstance();cL.createInstance=uu.createInstance;const ZU={error:"Error"},KU={error:"Помилка"},qC="common",JU={en:ZU,uk:KU},Yo=cL.createInstance({defaultNS:qC,resources:QU(JU,qC),lng:"en",fallbackLng:"en"}),uL={i18nextInstance:Yo,initPromise:Yo.init().then(()=>Yo)},Nh=new Map;Nh.set("common",uL);const dL=e=>{if(Nh.has(e.namespace))return Nh.get(e.namespace);if(e.plugins)for(const r of e.plugins)Yo.use(r);Object.keys(e.resource).forEach(r=>{Yo.addResourceBundle(r,e.namespace,e.resource[r])});const t=Yo.cloneInstance({defaultNS:e.namespace});let i=uL.initPromise.then(()=>t);t.on("languageChanged",r=>{Yo.language!==r&&Yo.changeLanguage(r)}),Yo.on("languageChanged",r=>{t.language!==r&&t.changeLanguage(r)});const n=e.language||"en";Yo.language!==n&&(i=i.then(()=>t.changeLanguage(n)).then(()=>t));const o={initPromise:i,i18nextInstance:t};return Nh.set(e.namespace,o),o};function QU(e,t){return Object.keys(e).reduce((i,n)=>(i[n]={[t]:e[n]},i),{})}function eV(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function tV(e){return e.endsWith("/")?e:`${e}/`}var hL=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function iV(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),i}var Rd={exports:{}},ZC;function nV(){if(ZC)return Rd.exports;ZC=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(G,j,B){return Function.prototype.apply.call(G,j,B)},i;e&&typeof e.ownKeys=="function"?i=e.ownKeys:Object.getOwnPropertySymbols?i=function(G){return Object.getOwnPropertyNames(G).concat(Object.getOwnPropertySymbols(G))}:i=function(G){return Object.getOwnPropertyNames(G)};function n(G){console&&console.warn&&console.warn(G)}var o=Number.isNaN||function(G){return G!==G};function r(){r.init.call(this)}Rd.exports=r,Rd.exports.once=Z,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var u=10;function _(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(G){if(typeof G!="number"||G<0||o(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");u=G}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(G){if(typeof G!="number"||G<0||o(G))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+G+".");return this._maxListeners=G,this};function A(G){return G._maxListeners===void 0?r.defaultMaxListeners:G._maxListeners}r.prototype.getMaxListeners=function(){return A(this)},r.prototype.emit=function(G){for(var j=[],B=1;B<arguments.length;B++)j.push(arguments[B]);var z=G==="error",O=this._events;if(O!==void 0)z=z&&O.error===void 0;else if(!z)return!1;if(z){var R;if(j.length>0&&(R=j[0]),R instanceof Error)throw R;var T=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw T.context=R,T}var v=O[G];if(v===void 0)return!1;if(typeof v=="function")t(v,this,j);else for(var m=v.length,S=W(v,m),B=0;B<m;++B)t(S[B],this,j);return!0};function E(G,j,B,z){var O,R,T;if(_(B),R=G._events,R===void 0?(R=G._events=Object.create(null),G._eventsCount=0):(R.newListener!==void 0&&(G.emit("newListener",j,B.listener?B.listener:B),R=G._events),T=R[j]),T===void 0)T=R[j]=B,++G._eventsCount;else if(typeof T=="function"?T=R[j]=z?[B,T]:[T,B]:z?T.unshift(B):T.push(B),O=A(G),O>0&&T.length>O&&!T.warned){T.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=G,v.type=j,v.count=T.length,n(v)}return G}r.prototype.addListener=function(G,j){return E(this,G,j,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(G,j){return E(this,G,j,!0)};function H(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function q(G,j,B){var z={fired:!1,wrapFn:void 0,target:G,type:j,listener:B},O=H.bind(z);return O.listener=B,z.wrapFn=O,O}r.prototype.once=function(G,j){return _(j),this.on(G,q(this,G,j)),this},r.prototype.prependOnceListener=function(G,j){return _(j),this.prependListener(G,q(this,G,j)),this},r.prototype.removeListener=function(G,j){var B,z,O,R,T;if(_(j),z=this._events,z===void 0)return this;if(B=z[G],B===void 0)return this;if(B===j||B.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete z[G],z.removeListener&&this.emit("removeListener",G,B.listener||j));else if(typeof B!="function"){for(O=-1,R=B.length-1;R>=0;R--)if(B[R]===j||B[R].listener===j){T=B[R].listener,O=R;break}if(O<0)return this;O===0?B.shift():C(B,O),B.length===1&&(z[G]=B[0]),z.removeListener!==void 0&&this.emit("removeListener",G,T||j)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(G){var j,B,z;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[G]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[G]),this;if(arguments.length===0){var O=Object.keys(B),R;for(z=0;z<O.length;++z)R=O[z],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(j=B[G],typeof j=="function")this.removeListener(G,j);else if(j!==void 0)for(z=j.length-1;z>=0;z--)this.removeListener(G,j[z]);return this};function g(G,j,B){var z=G._events;if(z===void 0)return[];var O=z[j];return O===void 0?[]:typeof O=="function"?B?[O.listener||O]:[O]:B?Y(O):W(O,O.length)}r.prototype.listeners=function(G){return g(this,G,!0)},r.prototype.rawListeners=function(G){return g(this,G,!1)},r.listenerCount=function(G,j){return typeof G.listenerCount=="function"?G.listenerCount(j):te.call(G,j)},r.prototype.listenerCount=te;function te(G){var j=this._events;if(j!==void 0){var B=j[G];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function W(G,j){for(var B=new Array(j),z=0;z<j;++z)B[z]=G[z];return B}function C(G,j){for(;j+1<G.length;j++)G[j]=G[j+1];G.pop()}function Y(G){for(var j=new Array(G.length),B=0;B<j.length;++B)j[B]=G[B].listener||G[B];return j}function Z(G,j){return new Promise(function(B,z){function O(T){G.removeListener(j,R),z(T)}function R(){typeof G.removeListener=="function"&&G.removeListener("error",O),B([].slice.call(arguments))}J(G,j,R,{once:!0}),j!=="error"&&K(G,O,{once:!0})})}function K(G,j,B){typeof G.on=="function"&&J(G,"error",j,B)}function J(G,j,B,z){if(typeof G.on=="function")z.once?G.once(j,B):G.on(j,B);else if(typeof G.addEventListener=="function")G.addEventListener(j,function O(R){z.once&&G.removeEventListener(j,O),B(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}return Rd.exports}var oV=nV();const Xu=rs(oV);function rV(){this.__data__=[],this.size=0}function pL(e,t){return e===t||e!==e&&t!==t}function Ef(e,t){for(var i=e.length;i--;)if(pL(e[i][0],t))return i;return-1}var aV=Array.prototype,sV=aV.splice;function lV(e){var t=this.__data__,i=Ef(t,e);if(i<0)return!1;var n=t.length-1;return i==n?t.pop():sV.call(t,i,1),--this.size,!0}function cV(e){var t=this.__data__,i=Ef(t,e);return i<0?void 0:t[i][1]}function uV(e){return Ef(this.__data__,e)>-1}function dV(e,t){var i=this.__data__,n=Ef(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}function $r(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}$r.prototype.clear=rV;$r.prototype.delete=lV;$r.prototype.get=cV;$r.prototype.has=uV;$r.prototype.set=dV;function hV(){this.__data__=new $r,this.size=0}function pV(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function fV(e){return this.__data__.get(e)}function mV(e){return this.__data__.has(e)}var gV=typeof global=="object"&&global&&global.Object===Object&&global;const fL=gV;var vV=typeof self=="object"&&self&&self.Object===Object&&self,yV=fL||vV||Function("return this")();const gr=yV;var bV=gr.Symbol;const ol=bV;var mL=Object.prototype,xV=mL.hasOwnProperty,wV=mL.toString,ic=ol?ol.toStringTag:void 0;function _V(e){var t=xV.call(e,ic),i=e[ic];try{e[ic]=void 0;var n=!0}catch(r){}var o=wV.call(e);return n&&(t?e[ic]=i:delete e[ic]),o}var CV=Object.prototype,SV=CV.toString;function TV(e){return SV.call(e)}var MV="[object Null]",kV="[object Undefined]",KC=ol?ol.toStringTag:void 0;function Ll(e){return e==null?e===void 0?kV:MV:KC&&KC in Object(e)?_V(e):TV(e)}function du(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var PV="[object AsyncFunction]",AV="[object Function]",EV="[object GeneratorFunction]",OV="[object Proxy]";function gL(e){if(!du(e))return!1;var t=Ll(e);return t==AV||t==EV||t==PV||t==OV}var LV=gr["__core-js_shared__"];const gg=LV;var JC=function(){var e=/[^.]+$/.exec(gg&&gg.keys&&gg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function NV(e){return!!JC&&JC in e}var DV=Function.prototype,IV=DV.toString;function as(e){if(e!=null){try{return IV.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var RV=/[\\^$.*+?()[\]{}|]/g,jV=/^\[object .+?Constructor\]$/,BV=Function.prototype,zV=Object.prototype,FV=BV.toString,WV=zV.hasOwnProperty,HV=RegExp("^"+FV.call(WV).replace(RV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!du(e)||NV(e))return!1;var t=gL(e)?HV:jV;return t.test(as(e))}function UV(e,t){return e==null?void 0:e[t]}function Nl(e,t){var i=UV(e,t);return $V(i)?i:void 0}var VV=Nl(gr,"Map");const hu=VV;var GV=Nl(Object,"create");const pu=GV;function YV(){this.__data__=pu?pu(null):{},this.size=0}function XV(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var qV="__lodash_hash_undefined__",ZV=Object.prototype,KV=ZV.hasOwnProperty;function JV(e){var t=this.__data__;if(pu){var i=t[e];return i===qV?void 0:i}return KV.call(t,e)?t[e]:void 0}var QV=Object.prototype,eG=QV.hasOwnProperty;function tG(e){var t=this.__data__;return pu?t[e]!==void 0:eG.call(t,e)}var iG="__lodash_hash_undefined__";function nG(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=pu&&t===void 0?iG:t,this}function Xa(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Xa.prototype.clear=YV;Xa.prototype.delete=XV;Xa.prototype.get=JV;Xa.prototype.has=tG;Xa.prototype.set=nG;function oG(){this.size=0,this.__data__={hash:new Xa,map:new(hu||$r),string:new Xa}}function rG(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Of(e,t){var i=e.__data__;return rG(t)?i[typeof t=="string"?"string":"hash"]:i.map}function aG(e){var t=Of(this,e).delete(e);return this.size-=t?1:0,t}function sG(e){return Of(this,e).get(e)}function lG(e){return Of(this,e).has(e)}function cG(e,t){var i=Of(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}function ss(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ss.prototype.clear=oG;ss.prototype.delete=aG;ss.prototype.get=sG;ss.prototype.has=lG;ss.prototype.set=cG;var uG=200;function dG(e,t){var i=this.__data__;if(i instanceof $r){var n=i.__data__;if(!hu||n.length<uG-1)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ss(n)}return i.set(e,t),this.size=i.size,this}function ra(e){var t=this.__data__=new $r(e);this.size=t.size}ra.prototype.clear=hV;ra.prototype.delete=pV;ra.prototype.get=fV;ra.prototype.has=mV;ra.prototype.set=dG;var hG="__lodash_hash_undefined__";function pG(e){return this.__data__.set(e,hG),this}function fG(e){return this.__data__.has(e)}function hp(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new ss;++t<i;)this.add(e[t])}hp.prototype.add=hp.prototype.push=pG;hp.prototype.has=fG;function mG(e,t){for(var i=-1,n=e==null?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function gG(e,t){return e.has(t)}var vG=1,yG=2;function vL(e,t,i,n,o,r){var u=i&vG,_=e.length,A=t.length;if(_!=A&&!(u&&A>_))return!1;var E=r.get(e),H=r.get(t);if(E&&H)return E==t&&H==e;var q=-1,g=!0,te=i&yG?new hp:void 0;for(r.set(e,t),r.set(t,e);++q<_;){var W=e[q],C=t[q];if(n)var Y=u?n(C,W,q,t,e,r):n(W,C,q,e,t,r);if(Y!==void 0){if(Y)continue;g=!1;break}if(te){if(!mG(t,function(Z,K){if(!gG(te,K)&&(W===Z||o(W,Z,i,n,r)))return te.push(K)})){g=!1;break}}else if(!(W===C||o(W,C,i,n,r))){g=!1;break}}return r.delete(e),r.delete(t),g}var bG=gr.Uint8Array;const QC=bG;function xG(e){var t=-1,i=Array(e.size);return e.forEach(function(n,o){i[++t]=[o,n]}),i}function wG(e){var t=-1,i=Array(e.size);return e.forEach(function(n){i[++t]=n}),i}var _G=1,CG=2,SG="[object Boolean]",TG="[object Date]",MG="[object Error]",kG="[object Map]",PG="[object Number]",AG="[object RegExp]",EG="[object Set]",OG="[object String]",LG="[object Symbol]",NG="[object ArrayBuffer]",DG="[object DataView]",eS=ol?ol.prototype:void 0,vg=eS?eS.valueOf:void 0;function IG(e,t,i,n,o,r,u){switch(i){case DG:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case NG:return!(e.byteLength!=t.byteLength||!r(new QC(e),new QC(t)));case SG:case TG:case PG:return pL(+e,+t);case MG:return e.name==t.name&&e.message==t.message;case AG:case OG:return e==t+"";case kG:var _=xG;case EG:var A=n&_G;if(_||(_=wG),e.size!=t.size&&!A)return!1;var E=u.get(e);if(E)return E==t;n|=CG,u.set(e,t);var H=vL(_(e),_(t),n,o,r,u);return u.delete(e),H;case LG:if(vg)return vg.call(e)==vg.call(t)}return!1}function RG(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}var jG=Array.isArray;const pp=jG;function BG(e,t,i){var n=t(e);return pp(e)?n:RG(n,i(e))}function zG(e,t){for(var i=-1,n=e==null?0:e.length,o=0,r=[];++i<n;){var u=e[i];t(u,i,e)&&(r[o++]=u)}return r}function FG(){return[]}var WG=Object.prototype,HG=WG.propertyIsEnumerable,tS=Object.getOwnPropertySymbols,$G=tS?function(e){return e==null?[]:(e=Object(e),zG(tS(e),function(t){return HG.call(e,t)}))}:FG;const UG=$G;function VG(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}function rl(e){return e!=null&&typeof e=="object"}var GG="[object Arguments]";function iS(e){return rl(e)&&Ll(e)==GG}var yL=Object.prototype,YG=yL.hasOwnProperty,XG=yL.propertyIsEnumerable,qG=iS(function(){return arguments}())?iS:function(e){return rl(e)&&YG.call(e,"callee")&&!XG.call(e,"callee")};const ZG=qG;function KG(){return!1}var bL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nS=bL&&typeof module=="object"&&module&&!module.nodeType&&module,JG=nS&&nS.exports===bL,oS=JG?gr.Buffer:void 0,QG=oS?oS.isBuffer:void 0,e9=QG||KG;const Hy=e9;var t9=9007199254740991,i9=/^(?:0|[1-9]\d*)$/;function n9(e,t){var i=typeof e;return t=t==null?t9:t,!!t&&(i=="number"||i!="symbol"&&i9.test(e))&&e>-1&&e%1==0&&e<t}var o9=9007199254740991;function xL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o9}var r9="[object Arguments]",a9="[object Array]",s9="[object Boolean]",l9="[object Date]",c9="[object Error]",u9="[object Function]",d9="[object Map]",h9="[object Number]",p9="[object Object]",f9="[object RegExp]",m9="[object Set]",g9="[object String]",v9="[object WeakMap]",y9="[object ArrayBuffer]",b9="[object DataView]",x9="[object Float32Array]",w9="[object Float64Array]",_9="[object Int8Array]",C9="[object Int16Array]",S9="[object Int32Array]",T9="[object Uint8Array]",M9="[object Uint8ClampedArray]",k9="[object Uint16Array]",P9="[object Uint32Array]",yi={};yi[x9]=yi[w9]=yi[_9]=yi[C9]=yi[S9]=yi[T9]=yi[M9]=yi[k9]=yi[P9]=!0;yi[r9]=yi[a9]=yi[y9]=yi[s9]=yi[b9]=yi[l9]=yi[c9]=yi[u9]=yi[d9]=yi[h9]=yi[p9]=yi[f9]=yi[m9]=yi[g9]=yi[v9]=!1;function A9(e){return rl(e)&&xL(e.length)&&!!yi[Ll(e)]}function E9(e){return function(t){return e(t)}}var wL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fc=wL&&typeof module=="object"&&module&&!module.nodeType&&module,O9=Fc&&Fc.exports===wL,yg=O9&&fL.process,L9=function(){try{var e=Fc&&Fc.require&&Fc.require("util").types;return e||yg&&yg.binding&&yg.binding("util")}catch(t){}}();const rS=L9;var aS=rS&&rS.isTypedArray,N9=aS?E9(aS):A9;const _L=N9;var D9=Object.prototype,I9=D9.hasOwnProperty;function R9(e,t){var i=pp(e),n=!i&&ZG(e),o=!i&&!n&&Hy(e),r=!i&&!n&&!o&&_L(e),u=i||n||o||r,_=u?VG(e.length,String):[],A=_.length;for(var E in e)I9.call(e,E)&&!(u&&(E=="length"||o&&(E=="offset"||E=="parent")||r&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||n9(E,A)))&&_.push(E);return _}var j9=Object.prototype;function B9(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||j9;return e===i}function z9(e,t){return function(i){return e(t(i))}}var F9=z9(Object.keys,Object);const W9=F9;var H9=Object.prototype,$9=H9.hasOwnProperty;function U9(e){if(!B9(e))return W9(e);var t=[];for(var i in Object(e))$9.call(e,i)&&i!="constructor"&&t.push(i);return t}function V9(e){return e!=null&&xL(e.length)&&!gL(e)}function G9(e){return V9(e)?R9(e):U9(e)}function sS(e){return BG(e,G9,UG)}var Y9=1,X9=Object.prototype,q9=X9.hasOwnProperty;function Z9(e,t,i,n,o,r){var u=i&Y9,_=sS(e),A=_.length,E=sS(t),H=E.length;if(A!=H&&!u)return!1;for(var q=A;q--;){var g=_[q];if(!(u?g in t:q9.call(t,g)))return!1}var te=r.get(e),W=r.get(t);if(te&&W)return te==t&&W==e;var C=!0;r.set(e,t),r.set(t,e);for(var Y=u;++q<A;){g=_[q];var Z=e[g],K=t[g];if(n)var J=u?n(K,Z,g,t,e,r):n(Z,K,g,e,t,r);if(!(J===void 0?Z===K||o(Z,K,i,n,r):J)){C=!1;break}Y||(Y=g=="constructor")}if(C&&!Y){var G=e.constructor,j=t.constructor;G!=j&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof j=="function"&&j instanceof j)&&(C=!1)}return r.delete(e),r.delete(t),C}var K9=Nl(gr,"DataView");const $y=K9;var J9=Nl(gr,"Promise");const Uy=J9;var Q9=Nl(gr,"Set");const Vy=Q9;var eY=Nl(gr,"WeakMap");const Gy=eY;var lS="[object Map]",tY="[object Object]",cS="[object Promise]",uS="[object Set]",dS="[object WeakMap]",hS="[object DataView]",iY=as($y),nY=as(hu),oY=as(Uy),rY=as(Vy),aY=as(Gy),Na=Ll;($y&&Na(new $y(new ArrayBuffer(1)))!=hS||hu&&Na(new hu)!=lS||Uy&&Na(Uy.resolve())!=cS||Vy&&Na(new Vy)!=uS||Gy&&Na(new Gy)!=dS)&&(Na=function(e){var t=Ll(e),i=t==tY?e.constructor:void 0,n=i?as(i):"";if(n)switch(n){case iY:return hS;case nY:return lS;case oY:return cS;case rY:return uS;case aY:return dS}return t});const pS=Na;var sY=1,fS="[object Arguments]",mS="[object Array]",jd="[object Object]",lY=Object.prototype,gS=lY.hasOwnProperty;function cY(e,t,i,n,o,r){var u=pp(e),_=pp(t),A=u?mS:pS(e),E=_?mS:pS(t);A=A==fS?jd:A,E=E==fS?jd:E;var H=A==jd,q=E==jd,g=A==E;if(g&&Hy(e)){if(!Hy(t))return!1;u=!0,H=!1}if(g&&!H)return r||(r=new ra),u||_L(e)?vL(e,t,i,n,o,r):IG(e,t,A,i,n,o,r);if(!(i&sY)){var te=H&&gS.call(e,"__wrapped__"),W=q&&gS.call(t,"__wrapped__");if(te||W){var C=te?e.value():e,Y=W?t.value():t;return r||(r=new ra),o(C,Y,i,n,r)}}return g?(r||(r=new ra),Z9(e,t,i,n,o,r)):!1}function CL(e,t,i,n,o){return e===t?!0:e==null||t==null||!rl(e)&&!rl(t)?e!==e&&t!==t:cY(e,t,i,n,CL,o)}function Yy(e,t){return CL(e,t)}const Mt={HEADERS:"headers",METADATA:"metadata",DATA:"data",GRAND:"grand",FINISH:"finish",ERROR:"error",TOTAL_ROWS:"totalRows",DATA_FINISH:"dataFinish",DATABARS:"dataBars",RANGE_MIN_MAX:"rangeMinMax"},uY=[Mt.ERROR,Mt.HEADERS,Mt.GRAND,Mt.METADATA,Mt.DATA,Mt.DATA_FINISH,Mt.TOTAL_ROWS,Mt.DATABARS,Mt.RANGE_MIN_MAX,Mt.FINISH],St={ROWS:"rows",COLUMNS:"columns",MEASURES:"measures",SCOPE:"scope"},Oi={ASC:"asc",DESC:"desc"},oi={SUB_TOTAL:"subTotal",GRAND_TOTAL:"grandTotal",MEASURE_TOP:"measureTop",MEASURE_BOTTOM:"measureBottom",CORNER:"corner"},vS={COLOR:"color",CONDITION:"condition"},Pr={DATETIME:"datetime",TEXT:"text",NUMERIC:"numeric"},Ts={MEMBER:"member",VALUE:"value",SUB_TOTAL:"subtotal",GRAND_TOTAL:"grandtotal"},ea={MEMBER:"member",INDEX:"index",TITLE:"title",NAME:"name",AGG:"agg",DIM:"dim"};class dY{constructor(t,i,n,o){Ne(this,"rowIndex"),Ne(this,"colIndex"),Ne(this,"node"),Ne(this,"parent"),Ne(this,"childColCells",[]),Ne(this,"childRowCells",[]),Ne(this,"indexInParent",-1),Ne(this,"siblingCount",0),this.rowIndex=t,this.colIndex=i,this.node=n,this.parent=o}isChild(){return!this.node}hasChildren(){return!!(this.childColCells.length||this.childRowCells.length)}hasColCell(){return this.childColCells.length>0}addColCell(t){this.childColCells.push(t)}getColCell(){return this.childColCells||[]}hasRowCell(){return this.childRowCells.length>0}addRowCell(t){this.childRowCells.push(t)}getRowCell(){return this.childRowCells||[]}getStopRowIndex(){return this.hasRowCell()?this.rowIndex+this.getRowCell().length:this.rowIndex}getStopColIndex(){return this.hasColCell()?this.colIndex+this.getColCell().length:this.colIndex}setIndexInParent(t,i){this.indexInParent=t,this.siblingCount=i}getIndexInParent(){return{indexInParent:this.indexInParent,siblingCount:this.siblingCount}}getParenPosition(){if(!this.parent)return;const t=(this.parent||"").match(/\d+/g)||[];return[Number(t[0]),Number(t[1])]}}const fp=["S&PManager","Cache"],mp=["null"];class fu{constructor(t=""){Ne(this,"name"),Ne(this,"log"),Ne(this,"warn"),Ne(this,"error"),Ne(this,"console"),this.name=t,this.log=()=>{},this.warn=()=>{},this.error=()=>{},this.console=fu.createMockConsole(),this.createLogFn()}setName(t){this.name=t,this.createLogFn()}getName(){return this.name}createLogFn(){this.log=()=>{},this.warn=()=>{},this.error=()=>{}}isExcludedName(){return mp.length&&!this.hasNamePartsInList(mp)?!0:fp.length?this.hasNamePartsInList(fp):!1}hasNamePartsInList(t){const i=this.name.toLowerCase();return t.some(n=>i.includes(n.toLowerCase()))}static createMockConsole(){return{log:()=>{},warn:()=>{},error:()=>{}}}static createMock(){const t=fu.createMockConsole();return ze(we({setName:()=>{},getName:()=>""},t),{console:t})}}const hY=e=>new fu(e),pY=(e="")=>{fp.push(e.toLowerCase())},fY=(e="")=>{mp.push(e.toLowerCase())},mY=()=>{fp.length=0,mp.length=0},ba={Logger:fu,create:hY,excludeLogs:pY,includeLogs:fY,clearIncludeExclude:mY},SL=[Date,Error,RegExp,Promise];function TL(e,t=SL){return t.some(i=>e instanceof i)}function yS(e,t=[]){let i=!1;return t.forEach(n=>{e.includes(n)&&(i=!0)}),i}function ML(e=[],t,i){const n=[];return i&&e.forEach(o=>{n.push(`${o}.$`)}),e.length?e.forEach(o=>{n.push(`${o}.${t}`)}):n.push(t),n}function Wc(e){return!(e===null||typeof e=="undefined"||typeof e!="object")}function gY(e,t){return Wc(e)&&e?Array.isArray(e)?!e.length:TL(e,t)?!1:!Object.keys(e).length:e==null}function vY(e=""){const t=e.split(".");return t.length>1?(t.pop(),t.join(".")):t[0]}function bS(e,t,i){return e.length?yS(e,i):t.length?!yS(t,i):!0}function kL(e,t=[],i=[],n=[],o={},r={},u=[],_=[]){if(!Wc(e))return{commonIncludeKeys:[],commonExcludeKeys:[]};const A=u.indexOf(e);if(A!==-1)return _[A];u.push(e);const E=Object.keys(e),H=Array.isArray(e);let q=[],g=[];const te=[],W=[];if(E.forEach(C=>{const Y=e[C],Z=ML(n,C,H),K=n[0]||"&";o[K]=o[K]||[],r[K]=r[K]||[],Z.forEach(J=>{(t||[]).includes(J)&&(o[K].push(J),q.push(J)),(t||[]).forEach(G=>{const j=vY(G);(`${j}.$`===K||j===K)&&(o[K].includes(G)||o[K].push(G),q.includes(G)||q.push(G))}),(i||[]).includes(J)&&(r[K].push(J),g.push(J))}),Wc(Y)&&kL(Y,t,i,Z,o,r,u,_)}),Wc(e)){let C=n[0]||"&";Array.isArray(e)&&(C=`${C}.$`),o[C]=(o[C]||[]).concat(te),q=q.concat(te),r[C]=(r[C]||[]).concat(W),g=q.concat(W)}return _.push({commonIncludeKeys:q,commonExcludeKeys:g}),{commonIncludeKeys:q,commonExcludeKeys:g}}function PL(e,t,i=new WeakMap){const{includeKeys:n,includeKeysObj:o,excludeKeys:r,excludeKeysObj:u,parentKeys:_=[],excludeEmpty:A,referenceClone:E}=t||{};if(!Wc(e)||TL(e,E))return e;if(i.has(e))return i.get(e);const H=Object.keys(e),q=Array.isArray(e),g=q?[]:{};i.set(e,g);const te=_[0]||"&",W=(o||{})[te]||[],C=(u||{})[te]||[];return H.forEach(Y=>{const Z=e[Y];let K=[],J=!0;if(n||r?J=bS(n||[],r||[],[Y]):(o||u)&&(K=ML(_,Y,q),J=bS(W,C,K)),J){const G=PL(Z,ze(we({},t),{parentKeys:K}),i);(!A||!gY(G,E))&&(q?g.push(G):g[Y]=G)}}),g}function Ln(e,t){const i=t||{},{include:n,exclude:o}=i,r=ot(i,["include","exclude"]);let u,_;(n||o)&&(u={},_={},kL(e,n,o,[],u,_));const A=ze(we({},r),{includeKeysObj:u,excludeKeysObj:_});return PL(e,A)}Ln.REFERENCE_CLONE_TYPES=SL;const bg=e=>t=>e.replace(/{{(\w+)}}/g,(i,n)=>typeof t[n]!="undefined"?t[n]:n),AL=(e,t)=>{let i,n,o=null;const r=(...u)=>{i?o=u:(e(...u),i=!0,o=null,n=setTimeout(()=>{i=!1,o&&(e(...o),o=null)},t))};return r.cancel=()=>{clearTimeout(n),i=!1},r},EL=(e,t)=>{const i={};return Object.keys(e).forEach(n=>{e[n]!==t[n]&&(i[n]=t[n])}),Object.keys(t).forEach(n=>{typeof i[n]=="undefined"&&e[n]!==t[n]&&(i[n]=t[n])}),i};function Xy(e=!0){let t={},i=null;return({callback:n,indices:o})=>{const r=Object.keys(o),u=!e||r.every(A=>{const E=o[A];return Array.isArray(E)?E.length>0:E>=0}),_=r.length!==Object.keys(t).length||r.some(A=>{const E=t[A],H=o[A];return Array.isArray(H)?E.join(",")!==H.join(","):E!==H});return t=o,u&&_&&(i=n(o)),i}}function xS(e,t,i=0){for(let n=i;n<e.length;n+=1){const o=e[n];if(t(o,n,e))return n}return-1}const mu="$*$root$*$";function yY(e,t,i,n){const o={value:e};return t&&(o.children=t),i&&(o.data=i),typeof n!="undefined"&&(o.index=n),o}function Lf(e){return!!(e&&e.children&&e.children.length)}function No(e){return e&&e.children||[]}function qy(e,t){e&&t&&Array.isArray(t)&&(e.children=t)}function bY(e,t){e&&(e.level=t)}function xY(e){return e&&typeof e.level!="undefined"?e.level||0:-1}function Bs(e){if(!e)return;if(e&&!Array.isArray(e)&&e.value===mu)return e;const t={value:mu,children:[]};return Array.isArray(e)?t.children=e:(t.children||[])[0]=e,t}function OL(e,t,i=0){let n;if(!e||!t)return n;if(t(e,i)&&(n=e),Lf(e)){const o=No(e),r=o.length;for(let u=0;u<r;u+=1){const _=OL(o[u],t,i+1);if(_){n=_;break}}}return n}function wY(e,t){if(!e&&!t)return;if(!e&&t)return Bs(t);if(e&&!t)return Bs(e);const i=Bs(e),n=Bs(t),o=i&&i.children||[],r=n&&n.children||[],u=o.concat(r);return Bs(u)}const LL=(e,t=0)=>{if(!e||!e.isPart)return;e.level=t;const i=No(e),n=i[i.length-1];return n&&LL(n,t+1)||e},NL=(e,t,i=0)=>{if(!e||!e.isPart)return;if(e.level=i,e&&t&&e.value===t.value&&e.level===t.level)return e;const n=No(e)[0];return n&&NL(n,t,i+1)||e};function _Y(e,t){let i=LL(e),n=NL(t,i);i&&i.children&&Array.isArray(i.children)&&n&&n.children&&Array.isArray(n.children)&&n.children.length>0&&(i.children=i.children.concat(n.children),n.isHandled=!0);let o=!1;for(i=e,n=t;i&&i.children&&Array.isArray(i.children)&&n&&n.children&&Array.isArray(n.children)&&!n.isHandled;){const r=i.children;i=i.children[i.children.length-1];let u=0;for(n.children[0]&&!o&&(o=!No(n.children[0]).some(_=>_.isPart),u=1);u<n.children.length;)r.push(n.children[u]),u+=1;n=n.children[0]}return e}function DL(e,t,i){!e||!t||e.forEach(n=>{t(n,i),Lf(n)&&DL(No(n),t,n)})}function IL(e,t=[],i=0,n={maxLevel:0}){return e.forEach(o=>{n.maxLevel<i&&(n.maxLevel=i),Lf(o)?IL(No(o),t,i+1,n):t.push(o)}),t}function Nf(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let i=t.clearCache||!1;!Array.isArray(e)&&e.value===mu&&(i=!0);let n=1,o=[];return Array.isArray(e)?(n=0,o=e):e.children&&(o=No(e)),o&&o.length&&(!i&&!Array.isArray(e)&&typeof e.childCount=="number"?n=e.childCount:(n=0,o.forEach(r=>{n+=Nf(r,t)}),Array.isArray(e)||(e.childCount=n))),n}function RL(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let i=t.clearCache||!1;!Array.isArray(e)&&e.value===mu&&(i=!0);let n=0,o=[];if(e&&!Array.isArray(e)&&typeof e.value!="undefined"&&(n=1),Array.isArray(e)?(n=0,o=e):e.children&&(o=No(e)),o&&o.length)if(!i&&!Array.isArray(e)&&typeof e.childDeep=="number")n+=e.childDeep;else{let r=0;o.forEach(u=>{const _=RL(u,t);_>r&&(r=_)}),n+=r,Array.isArray(e)||(e.childDeep=r)}return n}function jL(e=[],t=0,i){const n=[];let o=0,r=-1,u=-1;const _=e.length;if(typeof t=="number"&&typeof i=="number"&&t>i)throw new Error('Wrong "getNodesByChildCount" diapason');if(typeof t=="number"&&t<0)throw new Error('Wrong "from" index for "getNodesByChildCount"');for(let A=0;A<_;A+=1){const E=e[A],H=Nf(E);if(o+H>t&&(r<0&&(r=o),n.push(E),typeof i=="number"&&o+H>=i)){u=o+H;break}u=o+H,o+=H}return{nodes:n,start:r,stop:u}}function CY(e){e.isMapped!==void 0&&(e.isMapped=void 0),e.minLevel!==void 0&&(e.minLevel=void 0),e.childCount!==void 0&&(e.childCount=void 0),e.childDeep!==void 0&&(e.childDeep=void 0)}function Zy(e=[],t=0,i,n){const{cloneFn:o=Ln}=n||{},r=[],{nodes:u,start:_,stop:A}=jL(e,t,i),E=u.length;let H,q,g=!0;if(_<t){const te=u[0]||{},W=t-_;let C;E===1&&typeof i=="number"&&(C=i-_,g=!1),H=o(te,!0);const Y=Zy(No(te),W,C,n);qy(H,Y)}if(typeof i=="number"&&A>i&&g){const te=u[E-1]||{},W=0,C=Nf(te)-(A-i);q=o(te,!0);const Y=Zy(No(te),W,C,n);qy(q,Y)}return u.forEach((te,W)=>{if(H&&W===0)r.push(H);else if(q&&W===E-1)r.push(q);else{const C=o(te);r.push(C)}}),r}const lt={ROOT:mu,create:yY,hasChildren:Lf,getChildren:No,setChildren:qy,setLevel:bY,getLevel:xY,getLastLevelNodes:IL,iterateThroughTree:DL,wrapInRootNode:Bs,findNode:OL,merge:wY,deepMerge:_Y,getChildLength:Nf,getDeepLength:RL,getNodesByChildCount:jL,getCutNodesByChildCount:Zy,clearNodeCache:CY},Ji={FIRST:"first",LAST:"last",EVEN:"even",ODD:"odd"},Ms=(e,t)=>`${e}-${t}`;class SY{constructor(t,i=!1,n){Ne(this,"tree"),Ne(this,"hasGrandTotals",!1),Ne(this,"isVertical",!1),Ne(this,"deep"),Ne(this,"columns",[]),Ne(this,"lastLevel",[]),Ne(this,"map",{}),Ne(this,"metadataCache",{}),Ne(this,"valueNode"),Ne(this,"grid"),this.isVertical=i,this.deep=n,t&&(this.tree=t,this.columns=this.cacheLevels(lt.getChildren(this.tree)))}destroy(){this.tree=void 0,this.columns=[],this.lastLevel=[],this.map={},this.metadataCache={},this.valueNode=void 0,this.grid=void 0}getMainCellWidth(t,i,n,o,r={offsetTop:-1,columnsOffset:0}){const{columnsOffset:u=0}=r,_=this.getItem(t,i),A=_&&_.hasChildren()&&_.hasColCell();let E=Number.NaN,H=!0;if(_&&A){const q=_.getColCell(),g=n({index:i+u});E=q.reduce((te,W)=>{const C=n({index:W.colIndex+u});return C||(H=!1),te+C},g),E-=o,E=Math.ceil(E)}return H?E:Number.NaN}extend(t){t&&(this.grid=void 0,this.tree=lt.merge(this.tree,t),this.columns=this.cacheLevels(lt.getChildren(t),this.columns))}getGrid(){if(this.grid)return this.grid;let t=this.getTreeDeepsLength(),i=this.getTreeChildLength();return this.isVertical?([t,i]=[i,t],this.map=this.fillMapVertical(lt.getChildren(this.tree),i,this.map)):this.map=this.fillMap(lt.getChildren(this.tree),t,this.map),this.grid=Array.from(Array(t)).map((n,o)=>Array.from(Array(i)).map((r,u)=>{const _=Ms(o,u),A=this.map[_];if(!A)throw new Error(`Key "${_}" does not found in TreeService`);return A.node?A.node:A.parent})),this.grid}getPartialGrid(t,i){if(!this.isVertical)throw new Error('"getPartialGrid" can only be used for "vertical" tree');const n=this.getTreeDeepsLength(),o=lt.getChildren(this.tree),{nodes:r,start:u,stop:_}=lt.getNodesByChildCount(o,t,i);this.fillMapVertical(r,n,this.map,{parentRowIndex:u,parentColIndex:0,prevChildren:0,parentKey:""});const A=Math.max(u,t),E=Math.min(_,i),H=Math.max(0,E-t);return Array.from(Array(H)).map((q,g)=>Array.from(Array(n)).map((te,W)=>{const C=A+g,Y=Ms(C,W),Z=this.map[Y];if(!Z)throw new Error(`Key "${Y}" does not found in TreeService`);return Z.node?Z.node:Z.parent||""}))}getPartialTree(t,i,n){const o=lt.getChildren(this.tree);return lt.getCutNodesByChildCount(o,t,i,n)}getTreeNode(t,i){const n=this.getItem(t,i);if(n&&n.node)return n.node}isChildren(t,i){const n=this.getItem(t,i);if(n)return n.isChild();if(typeof this.deep=="number"&&(this.isVertical?i:t)<this.deep)return!0;throw new Error(`Item "${t}-${i}" does not found in TreeService`)}hasChildren(t,i){const n=this.getItem(t,i);if(n)return n.hasChildren();throw new Error(`Item "${t}-${i}" does not found in TreeService`)}getMainCellSpans(t,i){const n={},o=this.getItem(t,i);return o&&o.hasColCell()&&(n.colSpan=o.getColCell().length+1),o&&o.hasRowCell()&&(n.rowSpan=o.getRowCell().length+1),n}alignStartIndex(t,i=!1){let n=0,o=t;if(i&&(n=t,o=0),this.isVertical===i){let r=this.getItem(n,o);if(r&&r.isChild()&&(r=this.getItemByKey(r.parent||"")),r)return i?r.rowIndex:r.colIndex}return t}alignStopIndex(t,i=!1){let n=0,o=t;if(i&&(n=t,o=0),this.isVertical===i){let r=this.getItem(n,o);if(r&&r.isChild()&&(r=this.getItemByKey(r.parent||"")),r)return i?r.getStopRowIndex():r.getStopColIndex()}return t}getTreeChildLength(t=lt.getChildren(this.tree),i){return lt.getChildLength(t,i)}getTreeDeepsLength(t=lt.getChildren(this.tree),i){return typeof this.deep!="undefined"&&this.deep!==void 0?this.deep:lt.getDeepLength(t,i)}getLastLevelNodes(){return this.lastLevel}extractData(t){if(!t)return[];const i=t.getLastLevelNodes().map(n=>n.index);return this.getLastLevelNodes().map(n=>typeof n.data=="undefined"?[n.data]:i?i.map(o=>{let r;return typeof o!="undefined"&&n.data&&(r=n.data[o]),r}):n.data)}getMetadata(t,i,n){const o=this.getTreeDeepsLength();t===1/0&&(t=o&&o-1),i===1/0&&(i=o&&o-1);const r=`${t}-${i}`;if(this.metadataCache[r])return this.metadataCache[r];let u=this.getItemByKey(r);if(!u)throw new Error(`Can not find metadata info for ${r} cell`);let _=u?u.node:void 0;if(_||(u=this.getItemByKey(u.parent||"")),!u)throw new Error(`Can not find metadata info for parent ${r} cell`);_=u?u.node:void 0;const A=this.getItemByKey(`${t+1}-${i}`),E=A?A.node:void 0,H=_&&_.level||0,q=this.isVertical?u.getStopColIndex():u.getStopRowIndex();let{indexInParent:g,siblingCount:te}=u.getIndexInParent(),W=g;if(H===0&&(te=this.getTreeChildLength(),g=this.isVertical?u.rowIndex:u.colIndex,W=g+(this.isVertical?u.getRowCell().length:u.getColCell().length)),n){const K=n.to-n.from;te<=K&&W>K-1&&(W=K-1)}const C={levels:[],siblings:[],root:void 0,parent:void 0,valueNode:this.valueNode,nextNode:E},{indexDivergence:Y}=_||{};if(typeof Y=="number"){const K=Y===0?Ji.EVEN:Ji.ODD;C.siblings.push(K)}if(H===0&&C.levels.push(Ji.FIRST),q===o-1&&C.levels.push(Ji.LAST),g===0&&C.siblings.push(Ji.FIRST),W===te-1&&C.siblings.push(Ji.LAST),_&&H!==0){const K=this.isVertical?t:0,J=this.isVertical?0:i;C.root=this.getMetadata(K,J,n)}const Z=this.getItemByKey(u.parent||"");if(Z&&H!==0&&(C.parent=this.getMetadata(Z.rowIndex,Z.colIndex,n)),n){const K=this.isVertical?u.rowIndex:u.colIndex,J=this.isVertical?u.getStopRowIndex():u.getStopColIndex();let G;Z&&(G=this.isVertical?Z.getStopRowIndex():Z.getStopColIndex()),G!==void 0&&G>=n.to-n.from&&J>=n.to-n.from-1&&!C.siblings.includes(Ji.LAST)&&C.siblings.push(Ji.LAST),K===0&&!C.siblings.includes(Ji.FIRST)&&C.siblings.push(Ji.FIRST)}return this.metadataCache[r]=C,C}setValueNode(t){typeof t=="object"&&(this.valueNode=t)}cacheLevels(t,i=[],n={level:0}){const{level:o}=n;return t.forEach(r=>{if(i[o]||(i[o]=[]),lt.setLevel(r,o),i[o].push(r),lt.hasChildren(r)){const u=o+1;this.cacheLevels(lt.getChildren(r),i,{level:u})}else this.lastLevel.push(r)}),i}fillMap(t,i,n={},o){const r=o||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},u=t.length;return t.forEach((_,A)=>{const{parentRowIndex:E,parentColIndex:H,prevChildren:q,parentKey:g}=r,te=lt.getLevel(_)+E,W=A+H+q,C=Ms(te,W),Y=this.createTreeCellMap({rowIndex:te,colIndex:W,node:_,parent:g});Y.setIndexInParent(A,u),n[C]=Y;let Z=0,K=0;if(lt.hasChildren(_)?(Z=this.getTreeChildLength(_),typeof _.minLevel=="number"&&(K=_.minLevel+1-te||0)):K=(i||0)-(te||0),(Z>1||K>1)&&this.fillChildMap(n,C,te,W,K,Z),lt.hasChildren(_)){const J=ze(we({},r),{parentRowIndex:K>1?K-1:0,parentColIndex:A+H,parentKey:C});this.fillMap(lt.getChildren(_),i,n,J),Z>1&&(r.prevChildren+=Z-1)}}),n}fillMapVertical(t,i,n={},o){const r=o||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},u=t.length;return t.forEach((_,A)=>{if(_.isMapped){r.parentRowIndex+=lt.getChildLength(_)-1;return}_.isMapped=!0;const{parentRowIndex:E,prevChildren:H,parentKey:q}=r,g=lt.getLevel(_),te=A+E+H,W=Ms(te,g),C=this.createTreeCellMap({rowIndex:te,colIndex:g,node:_,parent:q});C.setIndexInParent(A,u),n[W]=C;let Y=0,Z=0;if(lt.hasChildren(_)?Z=this.getTreeChildLength(_):Y=(i||0)-(g||0),(Y>1||Z>1)&&this.fillChildMap(n,W,te,g,Z,Y),lt.hasChildren(_)){const K=ze(we({},r),{parentRowIndex:A+E,parentKey:W});this.fillMapVertical(lt.getChildren(_),i,n,K),Z>1&&(r.prevChildren+=Z-1)}}),n}fillChildMap(t,i,n,o,r,u){const _=t[i],A=Math.max(1,r),E=Math.max(1,u);Array.from(Array(A)).forEach((H,q)=>{Array.from(Array(E)).forEach((g,te)=>{if(q===0&&te===0)return;const W=n+q,C=o+te,Y=Ms(W,C),Z=this.createTreeCellMap({rowIndex:W,colIndex:C,parent:i});t[Y]=Z,!(q!==0&&te!==0)&&(te===0&&_.addRowCell(Z),q===0&&_.addColCell(Z))})})}createTreeCellMap({rowIndex:t,colIndex:i,node:n,parent:o}){return new dY(t,i,n,o)}getItemByKey(t){return this.map[t]}getItem(t,i){const n=Ms(t,i);return this.getItemByKey(n)}}class Aa extends SY{}class Ws extends Error{constructor(t="Loading canceled"){super(t),this.name="LoadingCanceledError";const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i)}}class wS{constructor(t=[],i){Ne(this,"divergence",0);const n=i?i.getDivergence():0,o=lt.getLastLevelNodes(t);this.divergence=(n+o.length)%2;for(let r=0;r<o.length;r+=1)o[r].indexDivergence=(r+n)%2}getDivergence(){return this.divergence}}function Df(e=[]){const t={};return e.forEach(i=>{const{index:n=1/0}=i.field||{},o=`${n}`;t[o]=i.jaql.datatype||Pr.TEXT}),t}function Ky(e,t){if(e&&t===Pr.DATETIME)try{return new Date(e).toISOString()}catch(i){return e}return e}function _S(e){if(e!==null&&!Yy(e,{}))return e}function gp(e,t,i={}){const n=_S(e),o=_S(t);let r=!1;if(typeof n=="object"&&n!==null&&typeof o=="object"&&o!==null){r=!0;const u=Object.keys(n),_=Object.keys(o);u.length!==_.length?r=!1:u.forEach(A=>{const E=i[A]||"";let H=(n||{})[A],q=(o||{})[A];if(typeof H=="undefined"||typeof q=="undefined"){r=!1;return}E===Pr.DATETIME&&(H=Ky(H,E),q=Ky(q,E)),H!==q&&(r=!1)})}else r=n===o;return r}function BL(e,t,i=Ky){if(!e||typeof e!="object")return e;const n={};return Object.keys(e).forEach(o=>{const r=t[o],u=(e||{})[o],_=i(u,r);n[o]=_}),n}const Dr=(e,t)=>{let i=e&&e.metadata||[];return t&&(i=i.filter(n=>n.panel===t)),i.sort((n,o)=>{const r={index:1/0},u=n.field||r,_=o.field||r;return u.index-_.index}),i},qu=(e,t,i)=>typeof t=="undefined"?void 0:Dr(e,i).filter(n=>(n.field||{index:1/0}).index===t)[0],TY=(e,t)=>{const i=e.field||{index:1/0};if(e.panel===St.MEASURES)return!0;if(e.panel===St.ROWS){const n=Dr(t,St.ROWS),o=(n[n.length-1]||{}).field||{index:1/0};if(n.length&&o.index===i.index)return!0;n.length||console.error("Missing rows panel in jaql!")}return!1};function MY(e,t){return!e||typeof e.field!="number"?!1:e.field!==t}const kY=(e,t=St.ROWS)=>{const i=Dr(e,t).map((n,o)=>{const r=lt.create(n.jaql.title,void 0,void 0,o),u=on(r,t);switch(u.jaqlIndex=n.field?n.field.index:void 0,t){case St.ROWS:{u.measurePath=void 0;const _=MY(n.jaql.sortDetails,u.jaqlIndex);n.jaql.sort&&!_?u.dir=n.jaql.sort:u.dir=null;break}case St.MEASURES:u.databars=n.format?n.format.databars:!1,u.measureJaqlIndex=u.jaqlIndex,Dr(e,St.COLUMNS).length||(u.measurePath=void 0,n.jaql.sortDetails&&n.jaql.sortDetails.measurePath===null?u.dir=n.jaql.sortDetails.dir:u.dir=null);break}return u});return lt.wrapInRootNode(i)},zL=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>{t&&t.jaql&&t.jaql.sort&&t.jaql.sortDetails&&t.jaql.sortDetails.sortingLastDimension&&(t.jaql.sort=null,delete t.jaql.sortDetails)})},FL=e=>{e&&e.jaql&&(e.jaql.sort=null,delete e.jaql.sortDetails)},WL=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>FL(t))},PY=e=>(e.metadata||[]).reverse().find(t=>!!t.jaql.sortDetails),AY=e=>(e.metadata||[]).find(t=>!!(t.jaql.sortDetails&&t.jaql.sortDetails.isLastApplied)),EY=e=>{const t=AY(e)||PY(e);if(!t)return;const i=t.field&&t.field.index;(e.metadata||[]).forEach(n=>{(n.field&&n.field.index)!==i&&FL(n)})},HL=(e,t)=>{e.metadata.forEach(i=>{const n=i.field&&i.field.index;if(t.field===n){i.jaql.sortDetails=i.jaql.sortDetails||t,i.jaql.sortDetails.isLastApplied=!0;return}i.jaql.sortDetails&&i.jaql.sortDetails&&delete i.jaql.sortDetails.isLastApplied})},OY=(e,t,i)=>{const{isSingleRowTree:n=!1,formatter:o}=i||{};if(!t){console.warn("jaql is undefined or null!");return}const r=qu(t,e.field);if(r&&r.panel===St.COLUMNS){console.warn('Should not be sorted by "COLUMN" type panels!');return}if(!r)return;const u=TY(r,t);switch(n?WL(t):u&&zL(t),e.dir){case Oi.DESC:case null:r.jaql.sort=Oi.ASC;break;case Oi.ASC:r.jaql.sort=Oi.DESC;break;default:r.jaql.sort=void 0}const _=r.field||{index:1/0};if(r.jaql.sort){let{measurePath:A}=e;if(A){const E=Dr(t),H=Df(E);A=BL(A,H,o)}r.jaql.sortDetails={field:_.index,dir:r.jaql.sort,sortingLastDimension:u,measurePath:A,initialized:!0}}else r.jaql.sortDetails=void 0;t&&t.metadata&&_.index!==void 0&&(t.metadata[_.index]=r),HL(t,e)},LY=(e,t,i)=>{if(!e)return;const n=qu(e,t);n&&(n.format=n.format||{},n.format.width=i)},NY=e=>{const t={};return e&&Dr(e).forEach(i=>{const n=i.field||{index:1/0};i.format&&typeof i.format.width!="undefined"&&typeof n.index!="undefined"&&(t[n.index]=i.format.width)}),t},DY=(e,t)=>{if(typeof t.measureJaqlIndex!="undefined"){const i=Dr(e),n=Df(i),o=i.filter(u=>u.panel===St.ROWS).find(u=>{const _=u.jaql.sortDetails;return!_||_.field!==t.measureJaqlIndex?!1:!!gp(t.measurePath,_.measurePath,n)});if(o){t.dir=o.jaql.sort?o.jaql.sort:null;return}const r=qu(e,t.measureJaqlIndex);if(r&&r.jaql.sortDetails){const u=r.jaql.sortDetails.measurePath,_=t.measurePath;if(gp(u,_,n)){t.dir=r.jaql.sort||null;return}}}t.dir=null};function IY(e,t,i,n){const{isSingleRowTree:o,formatter:r}=n;o&&WL(e),e.metadata.forEach(u=>{u.jaql.sortDetails&&delete u.jaql.sortDetails.isLastApplied}),t.forEach((u,_)=>{let A;_===t.length-1?(u.selected&&zL(e),A=i.field):A=u.indexInJaql;const E=qu(e,A);if(!E){console.warn(new Error("Panel not found"));return}u.selected&&!u.direction&&console.warn(new Error("Direction should be defined and equal to 'asc' or 'desc'"));const H=Dr(e),q=Df(H);if(!u.direction||!u.selected){const{sortDetails:g}=E.jaql;g&&i.field===g.field&&gp(i.measurePath,g.measurePath,q)&&(delete E.jaql.sort,delete E.jaql.sortDetails)}if(u.selected&&u.direction){E.jaql.sort=u.direction;let{measurePath:g}=i;g&&(g=BL(g,q,r)),i.measurePath===void 0&&E.field&&E.panel==="rows"&&i.field!==E.field.index&&(g={}),E.jaql.sortDetails={field:i.field,dir:u.direction,sortingLastDimension:!1,measurePath:g,isLastApplied:!0,initialized:!0}}})}function RY(e,t,i,n){return e.jaql.sortDetails?!1:i?Li.isMeasurePathEqual(t.measurePath,i.measurePath,n):!1}function Jy(e){const t=e&&e.dir;switch(t){case"asc":case"desc":return t;default:return null}}function jY(e,t){var i,n;const o=e.metadata.filter(W=>W.panel==="rows"),r=Li.getMetadataPanelByIndex(e,t.field),u=r.jaql.datatype,_=r.jaql.sortDetails,A=Li.getDataTypes(Li.getMetadataPanels(e)),E=[];for(let W=0;W<o.length-1;W+=1){const C=o[W],Y=!!(C.jaql.sortDetails&&C.jaql.sortDetails.field===t.field&&Li.isMeasurePathEqual(t.measurePath,C.jaql.sortDetails.measurePath,A)),Z=Jy(C.jaql.sortDetails);E.push({title:C.jaql.title,datatype:u,selected:Y,direction:Z,indexInJaql:(i=C.field)==null?void 0:i.index})}const H=o[o.length-1],q=RY(H,t,_,A),g=Jy(_),te={title:H.jaql.title,datatype:u,selected:q,direction:g,indexInJaql:(n=r.field)==null?void 0:n.index};return E.push(te),E}function BY(e,t,i){return e.filter(n=>n.field&&t.field===n.field.index).map(n=>{const{sortDetails:o}=n.jaql,r=!!(o&&Li.isMeasurePathEqual(t.measurePath,o.measurePath,i)),u=r?Jy(o):null;return{title:n.jaql.title,datatype:n.jaql.datatype,selected:r,direction:u}})[0]}const Li={isMeasurePathEqual:gp,getDataTypes:Df,updatePanelsSortingMetadata:OY,getMetadataTree:kY,getMetadataPanels:Dr,getMetadataPanelByIndex:qu,setResizeWidthToJaql:LY,getResizeWidthFromJaql:NY,markSortedNode:DY,normalizeSingleBranchTreeSortDetails:EY,updateLastAppliedSortingFlag:HL,handleComplexSortingSettingsUpdate:IY,mapWidgetJaqlToSimpleSortingSettings:BY,mapWidgetJaqlToComplexSortingSettings:jY};function $L(e,t){if(!lt.hasChildren(e))return!1;let i=!1;t===St.COLUMNS&&e&&e.isPart&&(i=!0);const n=lt.getChildren(e);if(n.length>1||i)return!0;const[o]=n;return $L(o)}function zY(e){return e==null}const Kx=(e,t,i,n,o)=>{const r=[];return e.forEach(u=>{if(r.push(u),lt.hasChildren(u)){const _=lt.getChildren(u),A=Kx(_,t,i,n,o);lt.setChildren(u,A);let E=!1;if((o||$L(u,i))&&(i===St.COLUMNS?typeof u.index!="undefined"&&u.index>-1&&(E=!0):i===St.ROWS&&typeof u.data!="undefined"&&(E=!0)),E){const{value:H,index:q,data:g,jaqlIndex:te,measurePath:W}=u;let C;if(i===St.COLUMNS?C=lt.create(H,void 0,void 0,q):i===St.ROWS&&(C=lt.create(H,void 0,g)),C){const Y=on(C,i);Y.userType=oi.SUB_TOTAL,Y.jaqlIndex=te,Y.measurePath=W,Y.master=u,r.push(Y)}}}}),r},UL=(e,t)=>{e.userType===oi.SUB_TOTAL&&e.master&&(e.measurePath=e.master.measurePath)},VL=(e,t,i,n)=>{const o=e;if(i===St.COLUMNS&&t){const r=on(t);if(typeof r.index=="number"){const u=Li.getMetadataTree(n,St.MEASURES);lt.getChildren(u).forEach((_,A)=>{const E=ze(we({},_),{index:(r.index||0)+A}),H=on(E,i);H.userType=oi.GRAND_TOTAL,H.measureJaqlIndex=H.jaqlIndex,o.push(H)})}}return o},GL=(e,t)=>{e.userType===oi.GRAND_TOTAL&&(e.measurePath=void 0,e.metadataType===St.ROWS&&(e.parent=void 0,e.jaqlIndex=0))},YL=(e,t,i,n)=>{let o=e;if(i===St.COLUMNS){const r=Li.getMetadataTree(n,St.MEASURES),u=lt.getChildLength(r),_={maxLevel:0},A=lt.getLastLevelNodes(o,[],0,_);if(u>1)A.forEach(E=>{if(E.userType===oi.GRAND_TOTAL)return;const H=lt.getChildren(r),q=[];for(let g=0;g<H.length;g+=1){if(typeof E.maxChilds=="number"&&g>=E.maxChilds)continue;const te=ze(we({},H[g]),{index:(E.index||0)+g,measurePath:E.measurePath}),W=on(te,St.MEASURES);W.userType=oi.MEASURE_BOTTOM,W.measureJaqlIndex=W.jaqlIndex,q.push(W)}E.minLevel=_.maxLevel,lt.setChildren(E,q)});else if(u===1){const E=lt.getChildren(r)[0];if(E){const H=we({},E),q=on(H,St.MEASURES);q.userType=oi.MEASURE_TOP,lt.setChildren(q,o),o=[q],A.forEach(g=>{g.measureJaqlIndex=E.jaqlIndex})}}}return o},XL=(e,t)=>{!lt.hasChildren(e)&&typeof e.measureJaqlIndex!="undefined"&&Li.markSortedNode(t,e)},FY=(e,t,i,n)=>{let o={};if(t.userType===oi.SUB_TOTAL||t.userType===oi.GRAND_TOTAL||i.userType===oi.SUB_TOTAL||i.userType===oi.GRAND_TOTAL||i.parent&&i.parent.userType===oi.SUB_TOTAL||i.parent&&i.parent.userType===oi.GRAND_TOTAL)return;const r=n&&n.format&&n.format.color||null;if(!r)return;const{value:u,cf:_=-1}=e;if(r.type===vS.COLOR&&r.color&&r.color!=="transparent"&&(o.backgroundColor=r.color),r.type===vS.CONDITION&&r.conditions&&r.conditions.length)for(let A=0,E=r.conditions.length;A<E&&!zY(u);A+=1){const H=r.conditions||[],{color:q}=H[A]||{};if(q&&_===A){o.backgroundColor=q;break}}Object.keys(o).length>0&&(e.style=e.style||{},Object.assign(e.style,o)),o=void 0},qL=(e,t,i,n)=>{const o=[],{level:r=0,measurePath:u={}}=n||{};let _;Array.isArray(e)?_=e:_=lt.getChildren(e);const A=Li.getMetadataPanels(i,t)[r],E=A?(A.field||{index:1/0}).index:void 0;return _.forEach(H=>{const q=on(H,t);if(q.jaqlIndex=E,typeof E!="undefined"&&(q.measurePath=ze(we({},u),{[E]:q.value})),o.push(q),lt.hasChildren(q)){const g=lt.getChildren(q),te={level:r+1,measurePath:q.measurePath},W=qL(g,t,i,te);lt.setChildren(q,W)}}),o},ZL=(e,t,i)=>{const{skipFormatEvent:n=!1,onlyFormatEvents:o=!1,iterateFn:r,emitFn:u}=i||{};e.forEach(_=>{if(r&&r(_),(n||!o)&&(UL(_),GL(_),XL(_,t)),u&&(o||!n)){const A=Li.getMetadataPanelByIndex(t,_.jaqlIndex,_.metadataType||"");u(_,A,t)}if(lt.hasChildren(_)){const A=lt.getChildren(_);ZL(A,t,i)}})},WY=(e,t,i,n)=>{const{originalData:o,applyIndexDivergence:r,subtotalsForSingleRow:u}=n||{};r&&r(e);let _=Kx(e,o,t,i,u);return _=VL(_,o,t,i),_=YL(_,o,t,i),lt.iterateThroughTree(_,(A,E)=>{A.parent=E}),_},nc={insertSubTotals:Kx,postProcessSubTotal:UL,insertGrandTotals:VL,postProcessGrandTotal:GL,insertMeasureNodes:YL,postProcessMeasureNode:XL,applyColorFormatting:FY,preProcessTree:qL,modifyTree:WY,postProcessTree:ZL},on=(e,t)=>{const i=e;return t&&(i.metadataType=t),i};function qs(e,t,i){return!t||!t.length?!1:t.some(n=>{let o=!0;return i&&i.fields&&i.fields.length&&i.fields.forEach(r=>{e[r]!==void 0&&n[r]===void 0?o=!1:e[r]!==void 0&&n[r]!==void 0&&(Array.isArray(e[r])?o=o&&e[r].indexOf(n[r])!==-1:o=o&&e[r]===n[r])}),o})}const HY=(e,t=[])=>{let i=!1;return!t||!t.length?!1:e.length===0?!0:(e.forEach(n=>{t.includes(n)&&(i=!0)}),i)},CS=(e,t)=>{let i=!0;return!t||!t.length?i=!1:e.forEach(n=>{if(n.index){const o=t[t.length-1];i=i&&qs(n,[o],{fields:[ea.INDEX]})}if(n.dim&&(n.name=n.dim,n.members&&(n.member=n.members),i=i&&qs(n,t,{fields:[ea.NAME,ea.MEMBER]})),n.title){const o=t[t.length-1];i=i&&qs(n,[o],{fields:[ea.TITLE]})}}),i},$Y=(e,t)=>{let i=!0;return!t||!t.length?i=!1:e.forEach(n=>{n.index&&(i=i&&qs(n,t,{fields:[ea.INDEX]})),n.dim&&(n.name=n.dim,i=i&&qs(n,t,{fields:[ea.DIM,ea.AGG]})),n.title&&(i=i&&qs(n,t,{fields:[ea.TITLE]}))}),i},UY=(e,t)=>{let i=!0;if(e.type&&i&&(i=i&&HY(e.type,t.type)),e.rows&&e.rows.length&&i){const n=t.rows?t.rows:[];i=i&&CS(e.rows,n)}if(e.columns&&i){const n=t.columns?t.columns:[];i=i&&CS(e.columns,n)}if(e.values&&i){const n=t.measure?[t.measure]:[];i=i&&$Y(e.values,n)}return i},VY=(e,t)=>e.metadata.find(i=>i.field&&i.field.index===t),Dh=(e,t,i=[],n=[])=>{if(!t||!e||typeof e.jaqlIndex=="undefined")return{dimensionsMeta:i,type:n};const o=VY(t,e.jaqlIndex);if(o&&o.jaql&&e.metadataType!==St.MEASURES&&i.unshift({title:o.jaql.title,name:o.jaql.dim,member:e.value,index:e.jaqlIndex}),e&&e.userType&&(e.userType===oi.SUB_TOTAL||e.userType===oi.GRAND_TOTAL)){const r=e.userType.toLowerCase();n.push(r)}return e.parent&&e.parent.metadataType!==St.MEASURES?Dh(e.parent,t,i,n):{dimensionsMeta:i,type:n}},SS=e=>{let t={};if(e){const i=e.jaql;t=ot(i,["type","datatype","table","column"]),e.field&&(t.index=e.field.index)}return t},tn={CORNER:"corner",COLUMNS:"columns",ROWS:"rows",DATA:"data"};function xg(e,t="",i=""){let n="";return e&&(e.levels.length&&e.levels.forEach(o=>{n+=` ${t}--${i?`${i}-`:""}level-${o}`}),e.siblings.length&&e.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-`:""}sibling-${o}`}),e.root&&e.root.siblings&&e.root.siblings.length&&e.root.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-root-`:"root-"}sibling-${o}`}),e.parent&&e.parent.siblings&&e.parent.siblings.length&&e.parent.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-parent-`:"parent-"}sibling-${o}`})),n}function GY(e,t){const{metadata:i,rowMetadata:n,rowTreeNode:o,columnTreeNode:r,merge:u}=t||{},_={t:!0,r:!0,b:!0,l:!0};if(e===tn.CORNER||e===tn.COLUMNS)return _;if(e===tn.ROWS){const A=u&&u.colSpan,E=i&&i.nextNode&&i.nextNode.userType===oi.GRAND_TOTAL;i&&i.levels.includes(Ji.LAST)&&!i.siblings.includes(Ji.LAST)&&!A&&!E&&(_.b=!1),i&&i.levels.includes(Ji.FIRST)&&i.levels.includes(Ji.LAST)&&!i.siblings.includes(Ji.LAST)&&!A&&!E&&(_.b=!1)}if(e===tn.DATA){const A=o&&o.userType===oi.SUB_TOTAL,E=r&&r.userType===oi.SUB_TOTAL,H=r&&r.userType===oi.GRAND_TOTAL,q=n&&n.nextNode&&n.nextNode.userType===oi.GRAND_TOTAL;n&&n.levels.includes(Ji.LAST)&&!n.siblings.includes(Ji.LAST)&&!A&&!E&&!H&&!q&&(_.b=!1)}return _}function wg(e,t="",i=""){let n="";return e&&e.userType&&(n=`${t}--${i?`${i}-`:""}user-type-${e.userType}`),n}function _g(e,t="",i=""){let n="";return e&&e.colSpan&&(n=`${t}--${i?`${i}-`:""}merged-columns`),e&&e.rowSpan&&(n=` ${t}--${i?`${i}-`:""}merged-rows`),n}function Cg(e){return e&&e.colSpan?e.colSpan-1:0}function TS(e,t){if(e===void 0)return e;let i=typeof e=="number"?e:parseInt(e,10);return i-=t||1,i}function oc(e){const{isDataCell:t,dataNode:i,treeNode:n}=e,o=t?i:n;return o&&o.style||{}}const YY=e=>{const t={};return Object.keys(e).forEach(i=>{(!i.startsWith("border")||i==="borderColor")&&(t[i]=e[i])}),t},XY=e=>{const t={};return Object.keys(e).forEach(i=>{(!i.startsWith("color")&&!i.startsWith("padding")&&!i.startsWith("border")&&!i.startsWith("font")&&!i.startsWith("lineHeight")&&!i.startsWith("databarColor")||i==="borderColor")&&(t[i]=e[i])}),t},qY=e=>{const t={};return Object.keys(e).forEach(i=>{(i.startsWith("color")||i.startsWith("padding")||i.startsWith("font")||i.startsWith("lineHeight"))&&(t[i]=e[i])}),t},ZY=e=>{const t={};return e.databarColor&&(t.backgroundColor=e.databarColor),t},KY=(e,t,i=0)=>t&&e&&t.offsetWidth+i>=e.offsetWidth&&t.textContent||"",JY=(e,t,i)=>{if(!e||!t||!i||i.measureJaqlIndex===void 0)return;const[n,o]=e[i.measureJaqlIndex]||[];if(n==null)return;const r=t&&t.store&&t.store.compileRange,u=t&&t.store&&t.store.compileRangeContext,_=t&&t.store&&t.store.compileRangeArgs;if(!r||!_||!u||!t||!t.value)return;const A=ze(we({},_),{minvalue:n,midvalue:n+(o-n)/2,maxvalue:o});let E,H;return A.min===void 0&&(A.maxvalue<=0&&(H=!0),A.min=A.minDef),A.max===void 0&&(A.minvalue>=0&&(E=!0),A.max=A.maxDef),H&&(A.max=A.maxGray),E&&(A.min=A.minGray),r.call(u,A)(t.value)},rc="text";class Jx{constructor(t,i,n){Ne(this,"plugins",[]),Ne(this,"globalStyles"),Ne(this,"jaql"),Ne(this,"indexHelper"),Ne(this,"columnsMetadata",[]),Ne(this,"metadataCache",new Map),this.plugins=t,this.jaql=i,this.globalStyles=n,this.indexHelper={measuresLevel:this.getMeasuresLevel(),columnStartFrom:0,rowStartFrom:0},this.globalStyles&&(this.globalStyles=YY(this.globalStyles))}getJaqlPanels(t){if(!this.jaql)throw new Error("No Jaql in Plugin service!");return this.jaql.metadata.filter(i=>i.panel===t)}getMeasuresLevel(){const t=this.getJaqlPanels(St.COLUMNS);return this.getJaqlPanels(St.MEASURES).length>1?t.length:0}getRowsColumnLength(){return this.getJaqlPanels(St.ROWS).length}getTotalTypes(t){const i=t.filter(n=>n===Ts.SUB_TOTAL||n===Ts.GRAND_TOTAL);return i&&i.length?i.filter((n,o,r)=>r.indexOf(n)===o):[]}getMeasureMetaByIndex(t){const i=this.getJaqlPanels(St.MEASURES);if(i.length===1)return SS(i[0]);const n=t%i.length;return SS(i[n])}resetRowStartFrom(){this.indexHelper.rowStartFrom=1}applyToColumns(t){t.length!==0&&(this.indexHelper.columnStartFrom===0&&(this.indexHelper.columnStartFrom=this.getRowsColumnLength()),this._applyToColumns(t,{row:-1}))}_applyToColumns(t,i){t.forEach((n,o)=>{const{dimensionsMeta:r,type:u}=Dh(n,this.jaql);u.push(Ts.MEMBER);let _=i.row>=0?i.row+1:0;_>=this.indexHelper.rowStartFrom&&(this.indexHelper.rowStartFrom=_+1),n.metadataType===St.MEASURES&&(_=this.indexHelper.measuresLevel);let A=o===0?0:1;A+=this.indexHelper.columnStartFrom;const E={type:u,rowIndex:_,colIndex:A,index:n.jaqlIndex,columns:r};n.metadataType===St.MEASURES&&(E.measure=this.getMeasureMetaByIndex(n.index||0));const H={value:n.value||"",content:n.content||"",contentType:n.contentType||rc,style:n.style||{},store:n.store||{},state:n.state};if(this.applyGlobal(H),this.apply(E,H),this.addToMetadata(E,H,E.rowIndex,E.colIndex),Object.assign(n,H),this.indexHelper.columnStartFrom=A,n.children){const q={row:_,column:A};this._applyToColumns(n.children,q)}else this.columnsMetadata.push({type:u,metadata:r});return!0})}applyToHeaders(t){!t||!t.children||t.children.length===0||t.children.forEach(i=>{const{dimensionsMeta:n}=Dh(i,this.jaql),o={type:[Ts.MEMBER],rowIndex:0,colIndex:i.index||0,index:i.jaqlIndex,rows:n},r={value:i.value,content:i.content||"",contentType:i.contentType||rc,style:i.style?i.style:{},store:i.store||{},state:i.state};this.applyGlobal(r),this.apply(o,r),this.addToMetadata(o,r,o.rowIndex,o.colIndex),Object.assign(i,r)})}applyToRows(t){if(t.length===0)return;const i=this.getJaqlPanels(St.ROWS),n=this.getJaqlPanels(St.MEASURES),o=this.getJaqlPanels(St.COLUMNS);this.indexHelper.rowStartFrom=Jx.getRowStartFromForPage(i.length,n.length,o.length),this._applyToRows(t)}static getRowStartFromForPage(t,i,n){if(t===0&&n===0)return 0;const o=n+(i===0?0:1);return o===0?1:o}_applyToRows(t){t.forEach((i,n)=>{const{dimensionsMeta:o,type:r}=Dh(i,this.jaql);r.push(Ts.MEMBER);const u=i.level?i.level:0,_=n===0?this.indexHelper.rowStartFrom:this.indexHelper.rowStartFrom+1,A={type:r,rowIndex:_,colIndex:u,index:i.jaqlIndex,rows:o},E={value:i.value,content:i.content||"",contentType:i.contentType||rc,style:i.style||{},store:i.store||{},state:i.state};return this.applyGlobal(E),this.apply(A,E),this.addToMetadata(A,E,A.rowIndex,A.colIndex),this.indexHelper.rowStartFrom=_,i.children?this._applyToRows(i.children):i.data&&i.data.length&&this.applyToValues(i.data,{type:r,metadata:o},{rowIndex:_,colIndex:this.getRowsColumnLength()}),Object.assign(i,E),!0})}applyToValues(t,i,n){t.length&&t.forEach((o,r)=>{const u=[Ts.VALUE],_=this.columnsMetadata[r];if(!_)return;const A=this.getTotalTypes([...i.type,..._.type]),E=this.getMeasureMetaByIndex(r),H={type:u.concat(A),rows:i.metadata,columns:_.metadata,measure:E,colIndex:r+n.colIndex,rowIndex:n.rowIndex,index:E&&E.index?E.index:0};let q={value:o,content:o,contentType:rc,style:{},store:o&&o.store||{},state:o&&o.state||void 0};o!=null&&typeof o=="object"&&(q={value:o.value?o.value:null,content:o.content||"",contentType:o.contentType||rc,style:o.style||{},store:o.store||{},state:o.state}),this.applyGlobal(q),this.apply(H,q),this.addToMetadata(H,q,H.rowIndex,H.colIndex),t[r]=q})}addToMetadata(t,i,n,o){const r=we({cellData:{value:i.value,content:i.content}},t);this.metadataCache.set(`${n}-${o}`,r)}applyGlobal(t){const{globalStyles:i}=this;i&&(t.style=we(we({},t.style),i))}apply(t,i){this.plugins&&this.plugins.length&&this.plugins.forEach(n=>{if(UY(n.target,t)){const o=n.handler;o(t,i)}})}}const Sg=(e,t)=>{const i=e||{metadata:[],grandTotals:null};let{metadata:n}=i;return n=n.map(o=>{const r=o.field||{},u=t.find(({field:A})=>A&&A.index===r.index),_=u?u.format:null;return _?ze(we({},o),{format:_}):o}),ze(we({},i),{metadata:n})},MS=100,QY="dataLoad",Qy="dataChunkLoaded",e8="dataBarChunkLoaded",t8="rangeMinMaxChunkLoaded",eb="grandChunkLoaded",i8="dataFinishChunkLoaded",n8="finishChunkLoaded",Ih="progressError",tb="headerCellFormat",KL="dataCellFormat",ib="totalRowsCountLoaded",nb="totalColumnsCountLoaded",kS=1e3,o8=0,r8={throttle:AL,throttleTime:o8,PluginService:Jx,skipInternalColorFormatting:!1,subtotalsForSingleRow:!1};class On{constructor(t,i,n,o){Ne(this,"logger"),Ne(this,"events"),Ne(this,"loadService"),Ne(this,"options"),Ne(this,"tempDataChunks",[]),Ne(this,"lastNotHandledChunkIndex",0),Ne(this,"lastReadyNotHandledChunkIndex",0),Ne(this,"rowsGrand"),Ne(this,"rowsTreeService"),Ne(this,"columnsTreeService"),Ne(this,"cornerTreeService"),Ne(this,"pageSize",MS),Ne(this,"isPaginated",!1),Ne(this,"loadedPagesCount",0),Ne(this,"isLoadInProgress",!1),Ne(this,"loadPromiseResolve"),Ne(this,"loadPromiseReject"),Ne(this,"loadPromiseCache"),Ne(this,"loadAllPromise"),Ne(this,"loadAllPromiseResolve"),Ne(this,"loadAllPromiseReject"),Ne(this,"isWholeDataLoaded",!1),Ne(this,"hasDataFinishEvent",!1),Ne(this,"isDataHandlerThrottled",!1),Ne(this,"onDataHandlerThrottle"),Ne(this,"metadata",[]),Ne(this,"dataBars"),Ne(this,"rangeMinMax"),Ne(this,"divergenceComparator",new wS),Ne(this,"pluginService"),Ne(this,"rawJaql"),Ne(this,"triggeredEventsData",{}),Ne(this,"callPlugins",[]),Ne(this,"globalStyles"),Ne(this,"columnsCount"),Ne(this,"totalColumnsCount"),Ne(this,"rowsCount"),Ne(this,"totalRowsCount"),Ne(this,"totalRecordsCount"),Ne(this,"limitReached"),Ne(this,"onMetadataHandler",()=>{const r={metadata:this.getMetadata()};this.isSingleRowTree()&&Li.normalizeSingleBranchTreeSortDetails(r)}),Ne(this,"onHeadersHandler",r=>{const u=this.getJaql.bind(this),_=this.getRawJaql.bind(this),A=this.applyIndexDivergence.bind(this),E=(te,W,C)=>this.emit(tb,te,W,C,this.options),H=On.createColumnsTreeServiceBuilder({getJaql:u,getRawJaql:_,pluginService:this.pluginService,applyIndexDivergence:A},{emitHeaderCellFormatEvent:E})(r);this.columnsTreeService=H.columnsTreeService,this.columnsCount=H.columnsCount,this.totalColumnsCount=H.totalColumnsCount,this.emit(nb,{columnsCount:this.columnsCount||0,totalColumnsCount:this.totalColumnsCount||0});const q=On.createCornerTreeServiceBuilder({getJaql:u,getRawJaql:_,pluginService:this.pluginService,columnsTreeService:this.columnsTreeService},{emitHeaderCellFormatEvent:E}),{cornerTreeService:g}=q();this.cornerTreeService=g}),Ne(this,"onDataHandler",r=>{this.tempDataChunks=this.tempDataChunks||[],Array.isArray(r)?(r||[]).forEach(u=>{On.fillDataChunks(this.tempDataChunks,u,this.pageSize)}):On.fillDataChunks(this.tempDataChunks,r,this.pageSize),this.tempDataChunks.length&&(this.isDataHandlerThrottled=!0,this.onDataHandlerThrottle())}),Ne(this,"onGrandHandler",r=>{const u=this.preProcessTree([r],St.ROWS)[0],_="Rows grand total",A=u?u.data:[],E=lt.create(_,void 0,A),H=on(E,St.ROWS);H.userType=oi.GRAND_TOTAL,this.postProcessTree([H]),this.postProcessData([H]),this.rowsGrand=H,this.emit(eb,lt.wrapInRootNode(this.rowsGrand))}),Ne(this,"onFinishHandler",()=>{this.emit(n8,{totalRows:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalColumns:typeof this.totalColumnsCount=="number"?this.totalColumnsCount:this.getLoadedColumnsCount()})}),Ne(this,"onTotalRowsHandler",r=>{const{rowsCount:u,queryRowsCount:_,limitReached:A}=r||{};this.totalRowsCount=u,this.totalRecordsCount=_,this.limitReached=A,this.emit(ib,r)}),Ne(this,"onDataBarsHandler",r=>{const{data:u=[]}=r;let _=0;this.cornerTreeService&&(_=this.cornerTreeService.getTreeChildLength()),this.dataBars=[...Array(_),...u],this.emit(e8,this.dataBars)}),Ne(this,"onRangeMinMaxHandler",r=>{const{data:u=[]}=r,_=this.getJaql(),A=Li.getMetadataTree(_,St.MEASURES),E=lt.getChildren(A),H=[];E.forEach((q,g)=>{H[q.measureJaqlIndex||0]=u[g]}),this.rangeMinMax=H,this.emit(t8,this.rangeMinMax)}),Ne(this,"onDataFinishHandler",({rowsCount:r}={})=>{if(this.finishRequest(),this.rowsCount=r,this.tempDataChunks.length){const u=this.tempDataChunks[this.tempDataChunks.length-1];u.ready=!0}this.onDataHandlerThrottle(),this.checkLoadPromise(),this.emit(i8,{limitedRows:this.rowsCount,limitedColumns:this.columnsCount})}),Ne(this,"onErrorHandler",r=>{process.env.NODE_ENV!=="production"&&this.logger.console.warn(`${this.logger.getName()} data loading error "${JSON.stringify(r)}"`),!this.isLoadInProgress&&!this.isWholeDataLoaded&&!(r instanceof Ws)&&this.emit(Ih,r)}),this.loadService=t,this.events=i||new Xu,this.logger=o||ba.create("DataService"),this.options=we(we({},r8),n),this.attachEvent(),this.onDataHandlerThrottle=this.options.throttle(()=>{const r=xS(this.tempDataChunks,q=>q.ready&&!q.handled,this.lastReadyNotHandledChunkIndex);if(r===-1)return;this.lastReadyNotHandledChunkIndex=r;const u=this.tempDataChunks[r],_=this.preProcessTree(u.list,St.ROWS),A=this.modifyTree(_,St.ROWS);this.postProcessTree(A,{skipFormatEvent:!0}),this.postProcessData(A,{skipFormatEvent:!0});const E=lt.wrapInRootNode(A);this.rowsTreeService?this.rowsTreeService.extend(E):this.rowsTreeService=new Aa(E,!0),this.emit(Qy,this.getLoadedElementsCount()),u.handled=!0;const H=xS(this.tempDataChunks,q=>!q.handled,this.lastNotHandledChunkIndex);if(H!==-1?(this.lastNotHandledChunkIndex=H,this.onDataHandlerThrottle()):this.isDataHandlerThrottled=!1,this.hasDataFinishEvent&&this.tempDataChunks.length){const q=this.tempDataChunks[this.tempDataChunks.length-1];q.ready=!0}this.hasDataFinishEvent&&H===-1?(this.finishRequest(),this.checkLoadPromise()):this.checkLoadPromise()},this.options.throttleTime)}destroy(){this.detachEvent(),this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.cornerTreeService=void 0,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.events.removeAllListeners()}on(t,i){this.events.on(t,i),this.triggeredEventsData[t]&&(this.triggeredEventsData[t].forEach(n=>{this.events.emit(t,...n)}),delete this.triggeredEventsData[t])}emit(t,...i){this.events.listeners(t).length===0?(this.triggeredEventsData[t]=this.triggeredEventsData[t]||[],this.triggeredEventsData[t].push(i)):this.events.emit(t,...i)}off(t,i){this.events.removeListener(t,i),this.triggeredEventsData[t]&&delete this.triggeredEventsData[t]}loadData(t,i){const{pageSize:n=MS,isPaginated:o=!1,cacheResult:r=!1,metadata:u}=i||{},_=this.pageSize===n;if(this.clearLoadAllPromise(),t&&this.clearCache(),this.pageSize=n,this.isPaginated=o,this.emit(QY),this.loadPromiseCache&&_){const E=Promise.resolve(this.loadPromiseCache);return this.loadPromiseCache=void 0,E}this.isLoadInProgress=!0,t&&(this.metadata=u||[],this.rawJaql=Sg(t,this.metadata),this.initPluginService(this.rawJaql),this.loadService.load(t).then(E=>{if(E==null)return;const H=!("data"in E);if(E.dataFinish[0]&&H)throw{error:{error:!0,details:"metadata undefined."}}}).catch(E=>{this.loadPromiseReject&&this.loadPromiseReject(E.error)}));const A=new Promise((E,H)=>{this.loadPromiseResolve=E,this.loadPromiseReject=H}).then(E=>this.sendInitPage(E)).then(E=>(r&&(this.loadPromiseCache=E),this.loadedPagesCount=1,E)).catch(E=>{throw E instanceof Ws&&this.clearLoadPromise(),E});return this.checkLoadPromise(),A}loadAllData(){if(this.isWholeDataLoaded){const t={loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax};return this.columnsCount!==0&&this.totalColumnsCount!==0&&(t.columnsCount=this.columnsCount,t.totalColumnsCount=this.totalColumnsCount),Promise.resolve(t)}return this.loadAllPromise||(this.loadAllPromise=new Promise((t,i)=>{this.loadAllPromiseResolve=t,this.loadAllPromiseReject=i}).then(()=>({loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax})).catch(t=>{throw t instanceof Ws&&this.clearLoadAllPromise(),t})),this.loadAllPromise}getSelectedPageData(t,i){return Promise.resolve(this.sendPaginatedPage(t,i))}getIndexedPageData(t,i,n=!1){return Promise.resolve(this.sendPartialPage(t,i,n))}getJaql(){return this.loadService.getJaql()||{metadata:[],grandTotals:null}}isSingleRowTree(){return this.loadService.isSingleRowTree()}setPluginHandlers(t){this.callPlugins=t}setGlobalStyles(t){this.globalStyles=t}getRawJaql(){return this.rawJaql||this.getJaql()}getMetadata(){return this.metadata.length>0?this.metadata:this.getJaql().metadata}preProcessTree(t,i,n){return nc.preProcessTree(t,i,this.getJaql(),n)}postProcessTree(t,i){const n=(r,u,_)=>this.emit(tb,r,u,_,this.options),o=ze(we({},i||{}),{emitFn:n});return nc.postProcessTree(t,this.getRawJaql(),o)}postProcessData(t,i){const{skipFormatEvent:n=!1,onlyFormatEvents:o=!1}=i||{},r=this.columnsTreeService?this.columnsTreeService.getLastLevelNodes():[],u=lt.getLastLevelNodes(t),_=this.getRawJaql();n||u.forEach(A=>{const E=on(A);r.forEach(H=>{const q=on(H),g=Li.getMetadataPanelByIndex(_,q.measureJaqlIndex,St.MEASURES);if(typeof E.data!="undefined"&&typeof q.index!="undefined"){const{data:te=[]}=E,{index:W}=q,C=te[W],Y=typeof C=="object"&&C!==null&&C!==void 0?C:{value:C};if(te[W]=Y,o||!n){const{skipInternalColorFormatting:Z=!1}=this.options;Z||nc.applyColorFormatting(Y,E,q,g),this.emit(KL,Y,E,q,g,_,this.options)}}})})}modifyTree(t,i,n){const o=this.getJaql();return nc.modifyTree(t,i,o,{originalData:n,applyIndexDivergence:this.applyIndexDivergence.bind(this),subtotalsForSingleRow:this.options.subtotalsForSingleRow})}applyIndexDivergence(t){this.divergenceComparator=new wS(t,this.divergenceComparator)}initPluginService(t){this.pluginService=new this.options.PluginService(this.callPlugins,t,this.globalStyles)}cancelLoading(){const t=new Ws;this.loadPromiseReject&&typeof this.loadPromiseReject=="function"&&this.loadPromiseReject(t),this.loadAllPromiseReject&&typeof this.loadAllPromiseReject=="function"&&this.loadAllPromiseReject(t),this.detachEvent()}getPageSize(){return this.pageSize}sendInitPage(t){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();let i,n;const o=this.getPageSize();if(this.rowsTreeService){const u=o>t?t:o,_=On.cloneTreeNode,A=this.rowsTreeService.getPartialTree(0,u,{cloneFn:_});this.rowsGrand&&A.push(Ln(this.rowsGrand)),this.postProcessTree(A,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(A,{onlyFormatEvents:!0});const E=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,H=lt.wrapInRootNode(A);this.pluginService&&H&&H.children&&(this.pluginService.applyToRows(H.children),n=this.pluginService.metadataCache),i=new Aa(H,!0,E),i.hasGrandTotals=!!this.rowsGrand}const r=this.isWholeDataLoaded&&o>=t;return{rowsTreeService:i,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:r,cellsMetadata:n}}sendPaginatedPage(t,i){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();i&&(this.pageSize=i);const n=this.getPageSize(),o=this.getLoadedElementsCount();if(t*n>=o)throw new Error("Selected page is out of elements range!");if(t<0)throw new Error("Selected page must be >= 0");let r,u;if(this.rowsTreeService){const _=t>=0?t*n:0,A=(t+1)*n>o?o:(t+1)*n,E=On.cloneTreeNode,H=this.rowsTreeService.getPartialTree(_,A,{cloneFn:E});this.rowsGrand&&H.push(Ln(this.rowsGrand)),this.postProcessTree(H,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(H,{onlyFormatEvents:!0});const q=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,g=lt.wrapInRootNode(H);this.pluginService&&g&&g.children&&(this.pluginService.applyToRows(g.children),u=this.pluginService.metadataCache),r=new Aa(g,!0,q),r.hasGrandTotals=!!this.rowsGrand}return{rowsTreeService:r,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:u}}sendPartialPage(t,i,n){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();const o=this.getLoadedElementsCount();let[r,u]=[Math.min(t,i),Math.max(t,i)];r=r>=0?r:0,u=u>=0?u:0,u=u<o?u:o;let _,A;if(r>o)_=void 0;else{let E;if(this.rowsTreeService){const g=On.cloneTreeNode;E=this.rowsTreeService.getPartialTree(r,u,{cloneFn:g}),n&&this.rowsGrand&&E.push(Ln(this.rowsGrand)),this.postProcessTree(E,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(E,{onlyFormatEvents:!0})}const H=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,q=lt.wrapInRootNode(E);this.pluginService&&q&&q.children&&(this.pluginService.applyToRows(q.children),A=this.pluginService.metadataCache),_=new Aa(q,!0,H),_.hasGrandTotals=!!(n&&this.rowsGrand)}return{rowsTreeService:_,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:A}}getLoadedElementsCount(){return this.rowsTreeService?this.rowsTreeService.getTreeChildLength():0}getTotalItemsCount(){return this.loadService.getTotalItemsCount()}getLoadedColumnsCount(){return this.columnsTreeService?this.columnsTreeService.getTreeChildLength():0}attachEvent(){this.loadService.listenerCount(Mt.HEADERS)&&this.loadService.offAll(Mt.HEADERS),this.loadService.on(Mt.HEADERS,this.onHeadersHandler),this.loadService.on(Mt.METADATA,this.onMetadataHandler),this.loadService.on(Mt.DATA,this.onDataHandler),this.loadService.on(Mt.GRAND,this.onGrandHandler),this.loadService.on(Mt.DATA_FINISH,this.onDataFinishHandler),this.loadService.on(Mt.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.on(Mt.DATABARS,this.onDataBarsHandler),this.loadService.on(Mt.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.on(Mt.FINISH,this.onFinishHandler),this.loadService.on(Mt.ERROR,this.onErrorHandler)}detachEvent(){this.loadService.off(Mt.HEADERS,this.onHeadersHandler),this.loadService.off(Mt.METADATA,this.onMetadataHandler),this.loadService.off(Mt.DATA,this.onDataHandler),this.loadService.off(Mt.GRAND,this.onGrandHandler),this.loadService.off(Mt.DATA_FINISH,this.onDataFinishHandler),this.loadService.off(Mt.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.off(Mt.DATABARS,this.onDataBarsHandler),this.loadService.off(Mt.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.off(Mt.FINISH,this.onFinishHandler),this.loadService.off(Mt.ERROR,this.onErrorHandler)}checkLoadPromise(){if(!this.isLoadInProgress)return;const t=this.getLoadedElementsCount();(t>=this.getPageSize()||this.isWholeDataLoaded)&&(this.isLoadInProgress=!1,typeof this.loadPromiseResolve=="function"&&(this.loadPromiseResolve(t),this.clearLoadPromise()))}clearLoadAllPromise(){this.loadAllPromise=void 0,this.loadAllPromiseReject=void 0,this.loadAllPromiseResolve=void 0}clearLoadPromise(){this.loadPromiseReject=void 0,this.loadPromiseResolve=void 0}finishRequest(){this.logger.log("finishRequest"),this.hasDataFinishEvent=!0,!this.isDataHandlerThrottled&&(this.isWholeDataLoaded=!0,this.loadAllPromiseResolve&&typeof this.loadAllPromiseResolve=="function"&&(this.loadAllPromiseResolve(),this.clearLoadAllPromise()))}clearCache(){this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.loadedPagesCount=0,this.hasDataFinishEvent=!1,this.isWholeDataLoaded=!1,this.isLoadInProgress=!1,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.isDataHandlerThrottled=!1}static getEmptyPage(){return{isLastPage:!0}}static fillDataChunks(t,i,n=kS,o=kS){const r=t.length<2?n:o;let u=t[Math.max(0,t.length-1)],_,A=!u;if(!i||typeof i.children=="undefined"&&typeof i.value=="undefined"&&i.data&&!i.data.length){u&&(u.ready=!0);return}if(u){const E=Math.max(0,u.list.length-1);_=u.list[E];const H=u.size?`${u.size}`:"0",q=parseInt(H,10)+(i.size||1);(u.handled||q>r&&!(_.isPart&&_.value===i.value))&&(A=!0)}i&&i.isPart&&_&&(!_.isPart||_.value!==i.value)&&(A=!0,_.value!==i.value&&(_=void 0)),A&&(u&&(u.ready=!0),u={list:[],size:0,ready:!1,handled:!1},t.push(u)),u&&(_&&_.isPart&&i&&i.isPart?(lt.deepMerge(_,i),u.size+=i.size||1):(u.list.push(i),u.size+=i.size||1))}static cloneTreeNode(t,i){const n=t,{children:o,isMapped:r,minLevel:u,childCount:_,childDeep:A,parent:E,master:H,data:q,state:g,style:te,store:W}=n,C=ot(n,["children","isMapped","minLevel","childCount","childDeep","parent","master","data","state","style","store"]),Y=Ln(C);return E&&(Y.parent=E),H&&(Y.master=H),q&&(Y.data=Ln(q)),g&&(Y.state=Ln(g)),te&&(Y.style=Ln(te)),W&&(Y.store=Ln(W)),!i&&o&&(Y.children=o.map(Z=>{const K=On.cloneTreeNode(Z);return K.parent=Y,K})),Y}static createColumnsTreeServiceBuilder(t,i){return n=>{const o=t.getJaql(),r=t.getRawJaql?t.getRawJaql():Sg(o,o.metadata||[]),u=Li.getMetadataTree(o,St.MEASURES),_=lt.getChildren(u),{preProcessTree:A,modifyTree:E,postProcessTree:H}=nc;let q,g,te=0,W=0;if(lt.hasChildren(n)){n.columnsCount&&n.totalColumnsCount&&(te=n.columnsCount,W=n.totalColumnsCount);const C=A(n,St.COLUMNS,o),Y=E(C,St.COLUMNS,o,{originalData:n,applyIndexDivergence:t.applyIndexDivergence});H(Y,r,{emitFn:i&&i.emitHeaderCellFormatEvent});const Z=lt.wrapInRootNode(Y);t.pluginService&&Z&&Z.children&&t.pluginService.applyToColumns(Z.children),q=Z,g=new Aa(Z),_.length===1&&g.setValueNode(_[0])}else lt.hasChildren(u)?(n.columnsCount&&n.totalColumnsCount&&(te=n.columnsCount,W=n.totalColumnsCount),typeof n.maxChilds=="number"&&(te=n.maxChilds,u.children=lt.getChildren(u).filter((C,Y)=>Y<n.maxChilds)),t.pluginService&&u.children&&t.pluginService.applyToColumns(u.children),H(lt.getChildren(u),r,{emitFn:i&&i.emitHeaderCellFormatEvent}),q=u,g=new Aa(u)):(t.pluginService&&t.pluginService.resetRowStartFrom(),q=void 0,g=void 0,te=0,W=0);return{columnsTree:q,columnsTreeService:g,columnsCount:te,totalColumnsCount:W}}}static createCornerTreeServiceBuilder(t,i){return()=>{const n=t.getJaql(),o=t.getRawJaql?t.getRawJaql():Sg(n,n.metadata||[]),r=Li.getMetadataTree(n,St.ROWS);let u;if(lt.hasChildren(r)){lt.iterateThroughTree(lt.getChildren(r),A=>{A.userType=oi.CORNER;const E=Li.getMetadataPanelByIndex(o,A.jaqlIndex,A.metadataType||"");i&&i.emitHeaderCellFormatEvent&&i.emitHeaderCellFormatEvent(A,E,o)});let _;t.columnsTreeService&&(_=t.columnsTreeService.getTreeDeepsLength()),t.pluginService&&t.pluginService.applyToHeaders(r),u=new Aa(r,!1,_)}return{cornerTree:r,cornerTreeService:u}}}}var PS={exports:{}};/*!
1
+ "use strict";var A5=Object.defineProperty,E5=Object.defineProperties;var O5=Object.getOwnPropertyDescriptors;var Ed=Object.getOwnPropertySymbols;var A_=Object.prototype.hasOwnProperty,E_=Object.prototype.propertyIsEnumerable;var at=Math.pow,ag=(e,t,i)=>t in e?A5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ie=(e,t)=>{for(var i in t||(t={}))A_.call(t,i)&&ag(e,i,t[i]);if(Ed)for(var i of Ed(t))E_.call(t,i)&&ag(e,i,t[i]);return e},Ue=(e,t)=>E5(e,O5(t));var ro=(e,t)=>{var i={};for(var n in e)A_.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&Ed)for(var n of Ed(e))t.indexOf(n)<0&&E_.call(e,n)&&(i[n]=e[n]);return i};var sg=(e,t,i)=>(ag(e,typeof t!="symbol"?t+"":t,i),i);var Pa=(e,t,i)=>new Promise((n,o)=>{var r=A=>{try{_(i.next(A))}catch(E){o(E)}},u=A=>{try{_(i.throw(A))}catch(E){o(E)}},_=A=>A.done?n(A.value):Promise.resolve(A.value).then(r,u);_((i=i.apply(e,t)).next())});const Ae=require("react/jsx-runtime"),Je=require("react"),ja=require("react-dom"),eE=require("react-dom/server");function ox(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const Zc=ox(Ae),Oe=ox(Je),L5=ox(ja),N5={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class Xh{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||N5,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,n,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Xh(this.logger,Ie({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xh(this.logger,t)}}var ir=new Xh;class of{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(i)}),this}off(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==i)}}emit(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];this.observers[t]&&[].concat(this.observers[t]).forEach(u=>{u(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(u=>{u.apply(u,[t,...n])})}}function Jl(){let e,t;const i=new Promise((n,o)=>{e=n,t=o});return i.resolve=e,i.reject=t,i}function O_(e){return e==null?"":""+e}function D5(e,t,i){e.forEach(n=>{t[n]&&(i[n]=t[n])})}function rx(e,t,i){function n(u){return u&&u.indexOf("###")>-1?u.replace(/###/g,"."):u}function o(){return!e||typeof e=="string"}const r=typeof t!="string"?[].concat(t):t.split(".");for(;r.length>1;){if(o())return{};const u=n(r.shift());!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={}}return o()?{}:{obj:e,k:n(r.shift())}}function L_(e,t,i){const{obj:n,k:o}=rx(e,t,Object);n[o]=i}function I5(e,t,i,n){const{obj:o,k:r}=rx(e,t,Object);o[r]=o[r]||[],o[r].push(i)}function qh(e,t){const{obj:i,k:n}=rx(e,t);if(i)return i[n]}function R5(e,t,i){const n=qh(e,i);return n!==void 0?n:qh(t,i)}function tE(e,t,i){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?i&&(e[n]=t[n]):tE(e[n],t[n],i):e[n]=t[n]);return e}function ws(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var j5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function B5(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>j5[t]):e}const z5=[" ",",","?","!",";"];function F5(e,t,i){t=t||"",i=i||"";const n=z5.filter(u=>t.indexOf(u)<0&&i.indexOf(u)<0);if(n.length===0)return!0;const o=new RegExp(`(${n.map(u=>u==="?"?"\\?":u).join("|")})`);let r=!o.test(e);if(!r){const u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(r=!0)}return r}function Zh(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(i);let o=e;for(let r=0;r<n.length;++r){if(!o||typeof o[n[r]]=="string"&&r+1<n.length)return;if(o[n[r]]===void 0){let u=2,_=n.slice(r,r+u).join(i),A=o[_];for(;A===void 0&&n.length>r+u;)u++,_=n.slice(r,r+u).join(i),A=o[_];if(A===void 0)return;if(A===null)return null;if(t.endsWith(_)){if(typeof A=="string")return A;if(_&&typeof A[_]=="string")return A[_]}const E=n.slice(r+u).join(i);return E?Zh(A,E,i):void 0}o=o[n[r]]}return o}function Kh(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class N_ extends of{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let _=[t,i];n&&typeof n!="string"&&(_=_.concat(n)),n&&typeof n=="string"&&(_=_.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(_=t.split("."));const A=qh(this.data,_);return A||!u||typeof n!="string"?A:Zh(this.data&&this.data[t]&&this.data[t][i],n,r)}addResource(t,i,n,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const u=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let _=[t,i];n&&(_=_.concat(u?n.split(u):n)),t.indexOf(".")>-1&&(_=t.split("."),o=i,i=_[1]),this.addNamespaces(i),L_(this.data,_,o),r.silent||this.emit("added",t,i,n,o)}addResources(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in n)(typeof n[r]=="string"||Object.prototype.toString.apply(n[r])==="[object Array]")&&this.addResource(t,i,r,n[r],{silent:!0});o.silent||this.emit("added",t,i,n)}addResourceBundle(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[t,i];t.indexOf(".")>-1&&(_=t.split("."),o=n,n=i,i=_[1]),this.addNamespaces(i);let A=qh(this.data,_)||{};o?tE(A,n,r):A=Ie(Ie({},A),n),L_(this.data,_,A),u.silent||this.emit("added",t,i,n)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ie({},this.getResource(t,i)):this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(o=>i[o]&&Object.keys(i[o]).length>0)}toJSON(){return this.data}}var iE={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,n,o){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,n,o))}),t}};const D_={};class Jh extends of{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),D5(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ir.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,i);return n&&n.res!==void 0}extractFromKey(t,i){let n=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const u=n&&t.indexOf(n)>-1,_=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!F5(t,n,o);if(u&&!_){const A=t.match(this.interpolator.nestingRegexp);if(A&&A.length>0)return{key:t,namespaces:r};const E=t.split(n);(n!==o||n===o&&this.options.ns.indexOf(E[0])>-1)&&(r=E.shift()),t=E.join(o)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,n){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i=Ie({},i)),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:u,namespaces:_}=this.extractFromKey(t[t.length-1],i),A=_[_.length-1],E=i.lng||this.language,H=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(H){const G=i.nsSeparator||this.options.nsSeparator;return o?{res:`${A}${G}${u}`,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:`${A}${G}${u}`}return o?{res:u,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:u}const q=this.resolve(t,i);let g=q&&q.res;const te=q&&q.usedKey||u,W=q&&q.exactUsedKey||u,C=Object.prototype.toString.apply(g),Y=["[object Number]","[object Function]","[object RegExp]"],Z=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,K=!this.i18nFormat||this.i18nFormat.handleAsObject;if(K&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&Y.indexOf(C)<0&&!(typeof Z=="string"&&C==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const G=this.options.returnedObjectHandler?this.options.returnedObjectHandler(te,g,Ue(Ie({},i),{ns:_})):`key '${u} (${this.language})' returned an object instead of string.`;return o?(q.res=G,q):G}if(r){const G=C==="[object Array]",j=G?[]:{},B=G?W:te;for(const z in g)if(Object.prototype.hasOwnProperty.call(g,z)){const O=`${B}${r}${z}`;j[z]=this.translate(O,Ue(Ie({},i),{joinArrays:!1,ns:_})),j[z]===O&&(j[z]=g[z])}g=j}}else if(K&&typeof Z=="string"&&C==="[object Array]")g=g.join(Z),g&&(g=this.extendTranslation(g,t,i,n));else{let G=!1,j=!1;const B=i.count!==void 0&&typeof i.count!="string",z=Jh.hasDefaultValue(i),O=B?this.pluralResolver.getSuffix(E,i.count,i):"",R=i.ordinal&&B?this.pluralResolver.getSuffix(E,i.count,{ordinal:!1}):"",T=i[`defaultValue${O}`]||i[`defaultValue${R}`]||i.defaultValue;!this.isValidLookup(g)&&z&&(G=!0,g=T),this.isValidLookup(g)||(j=!0,g=u);const m=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:g,S=z&&T!==g&&this.options.updateMissing;if(j||G||S){if(this.logger.log(S?"updateKey":"missingKey",E,A,u,S?T:g),r){const U=this.resolve(u,Ue(Ie({},i),{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let y=[];const P=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&P&&P[0])for(let U=0;U<P.length;U++)y.push(P[U]);else this.options.saveMissingTo==="all"?y=this.languageUtils.toResolveHierarchy(i.lng||this.language):y.push(i.lng||this.language);const F=(U,N,b)=>{const x=z&&b!==g?b:m;this.options.missingKeyHandler?this.options.missingKeyHandler(U,A,N,x,S,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(U,A,N,x,S,i),this.emit("missingKey",U,A,N,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?y.forEach(U=>{this.pluralResolver.getSuffixes(U,i).forEach(N=>{F([U],u+N,i[`defaultValue${N}`]||T)})}):F(y,u,T))}g=this.extendTranslation(g,t,i,q,n),j&&g===u&&this.options.appendNamespaceToMissingKey&&(g=`${A}:${u}`),(j||G)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}:${u}`:u,G?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(q.res=g,q):g}extendTranslation(t,i,n,o,r){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,Ie(Ie({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Ue(Ie({},n),{interpolation:Ie(Ie({},this.options.interpolation),n.interpolation)}));const E=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let H;if(E){const g=t.match(this.interpolator.nestingRegexp);H=g&&g.length}let q=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(q=Ie(Ie({},this.options.interpolation.defaultVariables),q)),t=this.interpolator.interpolate(t,q,n.lng||this.language,n),E){const g=t.match(this.interpolator.nestingRegexp),te=g&&g.length;H<te&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(n.lng=o.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,te=new Array(g),W=0;W<g;W++)te[W]=arguments[W];return r&&r[0]===te[0]&&!n.context?(u.logger.warn(`It seems you are nesting recursively key: ${te[0]} in key: ${i[0]}`),null):u.translate(...te,i)},n)),n.interpolation&&this.interpolator.reset()}const _=n.postProcess||this.options.postProcess,A=typeof _=="string"?[_]:_;return t!=null&&A&&A.length&&n.applyPostProcessor!==!1&&(t=iE.handle(A,t,i,this.options&&this.options.postProcessPassResolved?Ie({i18nResolved:o},n):n,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,r,u,_;return typeof t=="string"&&(t=[t]),t.forEach(A=>{if(this.isValidLookup(n))return;const E=this.extractFromKey(A,i),H=E.key;o=H;let q=E.namespaces;this.options.fallbackNS&&(q=q.concat(this.options.fallbackNS));const g=i.count!==void 0&&typeof i.count!="string",te=g&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),W=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",C=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);q.forEach(Y=>{this.isValidLookup(n)||(_=Y,!D_[`${C[0]}-${Y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(_)&&(D_[`${C[0]}-${Y}`]=!0,this.logger.warn(`key "${o}" for languages "${C.join(", ")}" won't get resolved as namespace "${_}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(Z=>{if(this.isValidLookup(n))return;u=Z;const K=[H];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(K,H,Z,Y,i);else{let G;g&&(G=this.pluralResolver.getSuffix(Z,i.count,i));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(K.push(H+G),i.ordinal&&G.indexOf(B)===0&&K.push(H+G.replace(B,this.options.pluralSeparator)),te&&K.push(H+j)),W){const z=`${H}${this.options.contextSeparator}${i.context}`;K.push(z),g&&(K.push(z+G),i.ordinal&&G.indexOf(B)===0&&K.push(z+G.replace(B,this.options.pluralSeparator)),te&&K.push(z+j))}}let J;for(;J=K.pop();)this.isValidLookup(n)||(r=J,n=this.getResource(Z,Y,J,i))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:u,usedNS:_}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,n,o):this.resourceStore.getResource(t,i,n,o)}static hasDefaultValue(t){const i="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i===n.substring(0,i.length)&&t[n]!==void 0)return!0;return!1}}function lg(e){return e.charAt(0).toUpperCase()+e.slice(1)}class I_{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ir.create("languageUtils")}getScriptPartFromCode(t){if(t=Kh(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=Kh(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(o=>o.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=lg(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=lg(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=lg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach(n=>{if(i)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(i=o)}),!i&&this.options.supportedLngs&&t.forEach(n=>{if(i)return;const o=this.getLanguagePartFromCode(n);if(this.isSupportedCode(o))return i=o;i=this.options.supportedLngs.find(r=>{if(r===o)return r;if(!(r.indexOf("-")<0&&o.indexOf("-")<0)&&r.indexOf(o)===0)return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];let n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}toResolveHierarchy(t,i){const n=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],r=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),n.forEach(u=>{o.indexOf(u)<0&&r(this.formatLanguageCode(u))}),o}}let W5=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],H5={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const $5=["v1","v2","v3"],U5=["v4"],R_={zero:0,one:1,two:2,few:3,many:4,other:5};function V5(){const e={};return W5.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:H5[t.fc]}})}),e}class G5{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=ir.create("pluralResolver"),(!this.options.compatibilityJSON||U5.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=V5()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Kh(t),{type:i.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(o=>`${i}${o}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((o,r)=>R_[o]-R_[r]).map(o=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o}`):n.numbers.map(o=>this.getSuffix(t,o,i)):[]}getSuffix(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,n);return o?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(i)}`:this.getSuffixRetroCompatible(o,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const n=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let o=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const r=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!$5.includes(this.options.compatibilityJSON)}}function j_(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=R5(e,t,i);return!r&&o&&typeof i=="string"&&(r=Zh(e,i,n),r===void 0&&(r=Zh(t,i,n))),r}class Y5{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const i=t.interpolation;this.escape=i.escape!==void 0?i.escape:B5,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?ws(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?ws(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?ws(i.nestingPrefix):i.nestingPrefixEscaped||ws("$t("),this.nestingSuffix=i.nestingSuffix?ws(i.nestingSuffix):i.nestingSuffixEscaped||ws(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const i=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(i,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,i,n,o){let r,u,_;const A=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function E(W){return W.replace(/\$/g,"$$$$")}const H=W=>{if(W.indexOf(this.formatSeparator)<0){const K=j_(i,A,W,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(K,void 0,n,Ue(Ie(Ie({},o),i),{interpolationkey:W})):K}const C=W.split(this.formatSeparator),Y=C.shift().trim(),Z=C.join(this.formatSeparator).trim();return this.format(j_(i,A,Y,this.options.keySeparator,this.options.ignoreJSONStructure),Z,n,Ue(Ie(Ie({},o),i),{interpolationkey:Y}))};this.resetRegExp();const q=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:W=>E(W)},{regex:this.regexp,safeValue:W=>this.escapeValue?E(this.escape(W)):E(W)}].forEach(W=>{for(_=0;r=W.regex.exec(t);){const C=r[1].trim();if(u=H(C),u===void 0)if(typeof q=="function"){const Z=q(t,r,o);u=typeof Z=="string"?Z:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))u="";else if(g){u=r[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),u="";else typeof u!="string"&&!this.useRawValueToEscape&&(u=O_(u));const Y=W.safeValue(u);if(t=t.replace(r[0],Y),g?(W.regex.lastIndex+=u.length,W.regex.lastIndex-=r[0].length):W.regex.lastIndex=0,_++,_>=this.maxReplaces)break}}),t}nest(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,r,u;function _(A,E){const H=this.nestingOptionsSeparator;if(A.indexOf(H)<0)return A;const q=A.split(new RegExp(`${H}[ ]*{`));let g=`{${q[1]}`;A=q[0],g=this.interpolate(g,u);const te=g.match(/'/g),W=g.match(/"/g);(te&&te.length%2===0&&!W||W.length%2!==0)&&(g=g.replace(/'/g,'"'));try{u=JSON.parse(g),E&&(u=Ie(Ie({},E),u))}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${A}`,C),`${A}${H}${g}`}return delete u.defaultValue,A}for(;o=this.nestingRegexp.exec(t);){let A=[];u=Ie({},n),u=u.replace&&typeof u.replace!="string"?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;let E=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const H=o[1].split(this.formatSeparator).map(q=>q.trim());o[1]=H.shift(),A=H,E=!0}if(r=i(_.call(this,o[1].trim(),u),u),r&&o[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=O_(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),r=""),E&&(r=A.reduce((H,q)=>this.format(H,q,n.lng,Ue(Ie({},n),{interpolationkey:o[1].trim()})),r.trim())),t=t.replace(o[0],r),this.regexp.lastIndex=0}return t}}function X5(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);t==="currency"&&o.indexOf(":")<0?i.currency||(i.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?i.range||(i.range=o.trim()):o.split(";").forEach(u=>{if(!u)return;const[_,...A]=u.split(":"),E=A.join(":").trim().replace(/^'+|'+$/g,"");i[_.trim()]||(i[_.trim()]=E),E==="false"&&(i[_.trim()]=!1),E==="true"&&(i[_.trim()]=!0),isNaN(E)||(i[_.trim()]=parseInt(E,10))})}return{formatName:t,formatOptions:i}}function _s(e){const t={};return function(n,o,r){const u=o+JSON.stringify(r);let _=t[u];return _||(_=e(Kh(o),r),t[u]=_),_(n)}}class q5{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ir.create("formatter"),this.options=t,this.formats={number:_s((i,n)=>{const o=new Intl.NumberFormat(i,Ie({},n));return r=>o.format(r)}),currency:_s((i,n)=>{const o=new Intl.NumberFormat(i,Ue(Ie({},n),{style:"currency"}));return r=>o.format(r)}),datetime:_s((i,n)=>{const o=new Intl.DateTimeFormat(i,Ie({},n));return r=>o.format(r)}),relativetime:_s((i,n)=>{const o=new Intl.RelativeTimeFormat(i,Ie({},n));return r=>o.format(r,n.range||"day")}),list:_s((i,n)=>{const o=new Intl.ListFormat(i,Ie({},n));return r=>o.format(r)})},this.init(t)}init(t){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=_s(i)}format(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((_,A)=>{const{formatName:E,formatOptions:H}=X5(A);if(this.formats[E]){let q=_;try{const g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},te=g.locale||g.lng||o.locale||o.lng||n;q=this.formats[E](_,te,Ie(Ie(Ie({},H),o),g))}catch(g){this.logger.warn(g)}return q}else this.logger.warn(`there was no format function for ${E}`);return _},t)}}function Z5(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class K5 extends of{constructor(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=ir.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,o.backend,o)}queueLoad(t,i,n,o){const r={},u={},_={},A={};return t.forEach(E=>{let H=!0;i.forEach(q=>{const g=`${E}|${q}`;!n.reload&&this.store.hasResourceBundle(E,q)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?u[g]===void 0&&(u[g]=!0):(this.state[g]=1,H=!1,u[g]===void 0&&(u[g]=!0),r[g]===void 0&&(r[g]=!0),A[q]===void 0&&(A[q]=!0)))}),H||(_[E]=!0)}),(Object.keys(r).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(u),toLoadLanguages:Object.keys(_),toLoadNamespaces:Object.keys(A)}}loaded(t,i,n){const o=t.split("|"),r=o[0],u=o[1];i&&this.emit("failedLoading",r,u,i),n&&this.store.addResourceBundle(r,u,n),this.state[t]=i?-1:2;const _={};this.queue.forEach(A=>{I5(A.loaded,[r],u),Z5(A,t),i&&A.errors.push(i),A.pendingCount===0&&!A.done&&(Object.keys(A.loaded).forEach(E=>{_[E]||(_[E]={});const H=A.loaded[E];H.length&&H.forEach(q=>{_[E][q]===void 0&&(_[E][q]=!0)})}),A.done=!0,A.errors.length?A.callback(A.errors):A.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(A=>!A.done)}read(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:n,tried:o,wait:r,callback:u});return}this.readingCalls++;const _=(E,H)=>{if(this.readingCalls--,this.waitingReads.length>0){const q=this.waitingReads.shift();this.read(q.lng,q.ns,q.fcName,q.tried,q.wait,q.callback)}if(E&&H&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,n,o+1,r*2,u)},r);return}u(E,H)},A=this.backend[n].bind(this.backend);if(A.length===2){try{const E=A(t,i);E&&typeof E.then=="function"?E.then(H=>_(null,H)).catch(_):_(null,E)}catch(E){_(E)}return}return A(t,i,_)}prepareLoading(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(u=>{this.loadOne(u)})}load(t,i,n){this.prepareLoading(t,i,{},n)}reload(t,i,n){this.prepareLoading(t,i,{reload:!0},n)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,(u,_)=>{u&&this.logger.warn(`${i}loading namespace ${r} for language ${o} failed`,u),!u&&_&&this.logger.log(`${i}loaded namespace ${r} for language ${o}`,_),this.loaded(t,u,_)})}saveMissing(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},_=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${n}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const A=Ue(Ie({},u),{isUpdate:r}),E=this.backend.create.bind(this.backend);if(E.length<6)try{let H;E.length===5?H=E(t,i,n,o,A):H=E(t,i,n,o),H&&typeof H.then=="function"?H.then(q=>_(null,q)).catch(_):_(null,H)}catch(H){_(H)}else E(t,i,n,o,_,A)}!t||!t[0]||this.store.addResource(t[0],i,n,o)}}}function B_(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let i={};if(typeof t[1]=="object"&&(i=t[1]),typeof t[1]=="string"&&(i.defaultValue=t[1]),typeof t[2]=="string"&&(i.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(o=>{i[o]=n[o]})}return i},interpolation:{escapeValue:!0,format:(e,t,i,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function z_(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Od(){}function J5(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(i=>{typeof e[i]=="function"&&(e[i]=e[i].bind(e))})}class Kc extends of{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=z_(t),this.services={},this.logger=ir,this.modules={external:[]},J5(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=B_();this.options=Ie(Ie(Ie({},o),this.options),z_(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ie(Ie({},o.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(H){return H?typeof H=="function"?new H:H:null}if(!this.options.isClone){this.modules.logger?ir.init(r(this.modules.logger),this.options):ir.init(null,this.options);let H;this.modules.formatter?H=this.modules.formatter:typeof Intl!="undefined"&&(H=q5);const q=new I_(this.options);this.store=new N_(this.options.resources,this.options);const g=this.services;g.logger=ir,g.resourceStore=this.store,g.languageUtils=q,g.pluralResolver=new G5(q,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),H&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(g.formatter=r(H),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Y5(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new K5(r(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(te){for(var W=arguments.length,C=new Array(W>1?W-1:0),Y=1;Y<W;Y++)C[Y-1]=arguments[Y];t.emit(te,...C)}),this.modules.languageDetector&&(g.languageDetector=r(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=r(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new Jh(this.services,this.options),this.translator.on("*",function(te){for(var W=arguments.length,C=new Array(W>1?W-1:0),Y=1;Y<W;Y++)C[Y-1]=arguments[Y];t.emit(te,...C)}),this.modules.external.forEach(te=>{te.init&&te.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Od),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const H=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);H.length>0&&H[0]!=="dev"&&(this.options.lng=H[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(H=>{this[H]=function(){return t.store[H](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(H=>{this[H]=function(){return t.store[H](...arguments),t}});const A=Jl(),E=()=>{const H=(q,g)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),A.resolve(g),n(q,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return H(null,this.t.bind(this));this.changeLanguage(this.options.lng,H)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),A}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Od;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode")return n();const r=[],u=_=>{if(!_)return;this.services.languageUtils.toResolveHierarchy(_).forEach(E=>{r.indexOf(E)<0&&r.push(E)})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(A=>u(A)),this.options.preload&&this.options.preload.forEach(_=>u(_)),this.services.backendConnector.load(r,this.options.ns,_=>{!_&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(_)})}else n(null)}reloadResources(t,i,n){const o=Jl();return t||(t=this.languages),i||(i=this.options.ns),n||(n=Od),this.services.backendConnector.reload(t,i,r=>{o.resolve(),n(r)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&iE.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let i=0;i<this.languages.length;i++){const n=this.languages[i];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,i){var n=this;this.isLanguageChangingTo=t;const o=Jl();this.emit("languageChanging",t);const r=A=>{this.language=A,this.languages=this.services.languageUtils.toResolveHierarchy(A),this.resolvedLanguage=void 0,this.setResolvedLanguage(A)},u=(A,E)=>{E?(r(E),this.translator.changeLanguage(E),this.isLanguageChangingTo=void 0,this.emit("languageChanged",E),this.logger.log("languageChanged",E)):this.isLanguageChangingTo=void 0,o.resolve(function(){return n.t(...arguments)}),i&&i(A,function(){return n.t(...arguments)})},_=A=>{!t&&!A&&this.services.languageDetector&&(A=[]);const E=typeof A=="string"?A:this.services.languageUtils.getBestMatchFromCodes(A);E&&(this.language||r(E),this.translator.language||this.translator.changeLanguage(E),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(E)),this.loadResources(E,H=>{u(H,E)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(_):this.services.languageDetector.detect(_):_(t),o}getFixedT(t,i,n){var o=this;const r=function(u,_){let A;if(typeof _!="object"){for(var E=arguments.length,H=new Array(E>2?E-2:0),q=2;q<E;q++)H[q-2]=arguments[q];A=o.options.overloadTranslationOptionHandler([u,_].concat(H))}else A=Ie({},_);A.lng=A.lng||r.lng,A.lngs=A.lngs||r.lngs,A.ns=A.ns||r.ns,A.keyPrefix=A.keyPrefix||n||r.keyPrefix;const g=o.options.keySeparator||".";let te;return A.keyPrefix&&Array.isArray(u)?te=u.map(W=>`${A.keyPrefix}${g}${W}`):te=A.keyPrefix?`${A.keyPrefix}${g}${u}`:u,o.t(te,A)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=n,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=i.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=this.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};if(i.precheck){const _=i.precheck(this,u);if(_!==void 0)return _}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(n,t)&&(!o||u(r,t)))}loadNamespaces(t,i){const n=Jl();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),i&&i(o)}),n):(i&&i(),Promise.resolve())}loadLanguages(t,i){const n=Jl();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],r=t.filter(u=>o.indexOf(u)<0);return r.length?(this.options.preload=o.concat(r),this.loadResources(u=>{n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new I_(B_());return i.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new Kc(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Od;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const o=Ue(Ie(Ie({},this.options),t),{isClone:!0}),r=new Kc(o);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(_=>{r[_]=this[_]}),r.services=Ie({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n&&(r.store=new N_(this.store.data,o),r.services.resourceStore=r.store),r.translator=new Jh(r.services,o),r.translator.on("*",function(_){for(var A=arguments.length,E=new Array(A>1?A-1:0),H=1;H<A;H++)E[H-1]=arguments[H];r.emit(_,...E)}),r.init(o,i),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const nE=Kc.createInstance();nE.createInstance=Kc.createInstance;const Q5={error:"Error"},ez={error:"Помилка"},F_="common",tz={en:Q5,uk:ez},Go=nE.createInstance({defaultNS:F_,resources:iz(tz,F_),lng:"en",fallbackLng:"en"}),ax={i18nextInstance:Go,initPromise:Go.init().then(()=>Go)},Sh=new Map;Sh.set("common",ax);const sx=e=>{if(Sh.has(e.namespace))return Sh.get(e.namespace);if(e.plugins)for(const r of e.plugins)Go.use(r);Object.keys(e.resource).forEach(r=>{Go.addResourceBundle(r,e.namespace,e.resource[r])});const t=Go.cloneInstance({defaultNS:e.namespace});let i=ax.initPromise.then(()=>t);t.on("languageChanged",r=>{Go.language!==r&&Go.changeLanguage(r)}),Go.on("languageChanged",r=>{t.language!==r&&t.changeLanguage(r)});const n=e.language||"en";Go.language!==n&&(i=i.then(()=>t.changeLanguage(n)).then(()=>t));const o={initPromise:i,i18nextInstance:t};return Sh.set(e.namespace,o),o};function iz(e,t){return Object.keys(e).reduce((i,n)=>(i[n]={[t]:e[n]},i),{})}class lx extends Error{constructor(t,i,n){const{key:o,interpolationOptions:r}=i,u=n||ax.i18nextInstance.t,_=Object.assign(Object.assign({},r),{ns:t}),A=u(o,Object.assign(Object.assign({},_),{lng:"en"}));super(A),this.key=o,this.namespace=t,this.interpolationOptions=_}}function oE(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Qh.apply(this,arguments)}var Ba=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nz(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),i}function oz(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const W_={};function Sy(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&W_[t[0]]||(typeof t[0]=="string"&&(W_[t[0]]=new Date),oz(...t))}const rE=(e,t)=>()=>{if(e.isInitialized)t();else{const i=()=>{setTimeout(()=>{e.off("initialized",i)},0),t()};e.on("initialized",i)}};function H_(e,t,i){e.loadNamespaces(t,rE(e,i))}function $_(e,t,i,n){typeof i=="string"&&(i=[i]),i.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,rE(e,n))}function rz(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=t.languages[0],o=t.options?t.options.fallbackLng:!1,r=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=t.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};return i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!u(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||u(n,e)&&(!o||u(r,e)))}function az(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Sy("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:i.lng,precheck:(o,r)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!r(o.isLanguageChangingTo,e))return!1}}):rz(e,t,i)}const sz=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,lz={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},cz=e=>lz[e],uz=e=>e.replace(sz,cz);let Ty={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uz};function dz(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ty=Ie(Ie({},Ty),e)}function hz(){return Ty}let aE;function pz(e){aE=e}function fz(){return aE}const mz={type:"3rdParty",init(e){dz(e.options.react),pz(e)}},sE=Je.createContext();class gz{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const vz=(e,t)=>{const i=Je.useRef();return Je.useEffect(()=>{i.current=e},[e,t]),i.current};function rf(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:i}=t,{i18n:n,defaultNS:o}=Je.useContext(sE)||{},r=i||n||fz();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new gz),!r){Sy("You will need to pass in an i18next instance by using initReactI18next");const J=(j,B)=>typeof B=="string"?B:B&&typeof B=="object"&&typeof B.defaultValue=="string"?B.defaultValue:Array.isArray(j)?j[j.length-1]:j,G=[J,{},!1];return G.t=J,G.i18n={},G.ready=!1,G}r.options.react&&r.options.react.wait!==void 0&&Sy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const u=Ie(Ie(Ie({},hz()),r.options.react),t),{useSuspense:_,keyPrefix:A}=u;let E=o||r.options&&r.options.defaultNS;E=typeof E=="string"?[E]:E||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(E);const H=(r.isInitialized||r.initializedStoreOnce)&&E.every(J=>az(J,r,u));function q(){return r.getFixedT(t.lng||null,u.nsMode==="fallback"?E:E[0],A)}const[g,te]=Je.useState(q);let W=E.join();t.lng&&(W=`${t.lng}${W}`);const C=vz(W),Y=Je.useRef(!0);Je.useEffect(()=>{const{bindI18n:J,bindI18nStore:G}=u;Y.current=!0,!H&&!_&&(t.lng?$_(r,t.lng,E,()=>{Y.current&&te(q)}):H_(r,E,()=>{Y.current&&te(q)})),H&&C&&C!==W&&Y.current&&te(q);function j(){Y.current&&te(q)}return J&&r&&r.on(J,j),G&&r&&r.store.on(G,j),()=>{Y.current=!1,J&&r&&J.split(" ").forEach(B=>r.off(B,j)),G&&r&&G.split(" ").forEach(B=>r.store.off(B,j))}},[r,W]);const Z=Je.useRef(!0);Je.useEffect(()=>{Y.current&&!Z.current&&te(q),Z.current=!1},[r,A]);const K=[g,r,H];if(K.t=g,K.i18n=r,K.ready=H,H||!H&&!_)return K;throw new Promise(J=>{t.lng?$_(r,t.lng,E,()=>J()):H_(r,E,()=>J())})}const yz={errors:{noSisenseContext:"Sisense context is not initialized",restApiNotReady:"Rest API is not initialized",componentRenderError:"Unable to render the component",sisenseContextNoAuthentication:"Authentication method is not specified",chartNoSisenseContext:"Sisense Context for Chart not found. To fix, add a dataSet to the Chart or wrap the component inside a Sisense context provider.",widgetByIdNoSisenseContext:"Sisense Context for Dashboard Widget not found. To fix, wrap the component inside a Sisense context provider.",widgetByIdInvalidIdentifier:"Failed to retrieve widget. Please make sure the dashboard widget exists and is accessible.",dashboardWidgetsInvalidIdentifiers:"Failed to retrieve dashboard widgets. Please make sure the dashboard exists and is accessible.",executeQueryNoSisenseContext:"Sisense Context for query execution not found. To fix, wrap the component inside a Sisense context provider.",executeQueryNoDataSource:"No dataSource provided to execute query",dataOptions:{noDimensionsAndMeasures:"Neither dimensions nor measures found. Data options should have at least one dimension or measure.",attributeNotFound:'Attribute "{{attributeName}}" not found in the data',measureNotFound:'Measure "{{measureName}}" not found in the data',filterAttributeNotFound:'Filter attribute "{{attributeName}}" not found in the data',highlightAttributeNotFound:'Highlight attribute "{{attributeName}}" not found in the data'},optionsTranslation:{invalidStyleOptions:"Invalid style options for '{{chartType}}' chart",invalidInternalDataOptions:"Data options are not correctly converted for '{{chartType}}' chart"},themeNotFound:"Theme with oid {{themeOid}} not found in the Sisense instance",paletteNotFound:"Palette '{{paletteName}}' not found in the Sisense instance",chartTypeNotSupported:"Chart type {{chartType}} is not supported",chartInvalidProps:"Invalid chart props",unsupportedWidgetType:"Can't extract props for unsupported widget type - {{widgetType}}",sisenseContextNotFound:"Sisense Context not found. Please ensure it is provided.",dashboardInvalidIdentifier:"Failed to retrieve dashboard. Please make sure the dashboard exists and is accessible.",sharedFormula:{identifierExpected:"Failed to identify shared formula. Please provide oid or both name and datasource",failedToFetch:"Failed to fetch shared formula"},widgetModel:{incomleteWidget:"Widget can not be transformed to DTO because of incomplete property ({{prop}})",unsupportedWidgetTypeDto:"Saving the widget of type {{chartType}} is not supported",pivotWidgetNotSupported:"Pivot widget is not supported for method {{methodName}}",textWidgetNotSupported:"Text widget is not supported for method {{methodName}}",onlyTableWidgetSupported:"Only table widget is supported for method {{methodName}}",onlyPivotWidgetSupported:"Only pivot widget is supported for method {{methodName}}",onlyTextWidgetSupported:"Only text widget is supported for method {{methodName}}",onlyPluginWidgetSupported:"Only plugin widget is supported for method {{methodName}}",unsupportedWidgetType:"Unsupported widget type: {{widgetType}}",unsupportedFusionWidgetType:"Unsupported Fusion widget type: {{widgetType}}"},unknownFilterInFilterRelations:"Filter relations contain unknown filter",filterRelationsNotSupported:"Filter relations not supported yet",invalidFilterType:"Invalid filter type",secondsDateTimeLevelSupportedOnlyForLive:"Seconds datetime level is supported only for the 'live' datasource",missingMenuRoot:"Missing initialized menu root",missingModalRoot:"Missing initialized modal root",missingDataSource:"The 'dataSource' value is missing. It must be provided explicitly, or a 'defaultDataSource' should be specified in the Sisense context provider.",incorrectOnDataReadyHandler:"'onDataReady' handler must return a valid data object",undefinedDataSource:"Data source is not defined",emptyModel:"Empty model",missingMetadata:"Missing metadata",missingModelTitle:"Missing model title",httpClientNotFound:"HttpClient not found.",serverSettingsNotLoaded:"Failed to load server settings",requiredColumnMissing:"Missing required column",unexpectedChartType:"Unexpected chart type: {{chartType}}",noRowNumColumn:"Data has no row num column",ticIntervalCalculationFailed:"Unable to calculate tic interval. Try specifying datetime granularity.",polarChartDesignOptionsExpected:"Polar chart design options expected for polar chart",polarChartDesignOptionsNotExpected:"Polar chart design options not expected for non-polar chart",indicatorInvalidRelativeSize:"Invalid relative size options",unsupportedMapType:"Unsupported map type: {{mapType}}",mapLoadingFailed:"Failed loading map",cascadingFilterOriginalNotFound:"Error in cascading filters reassembling. Original cascading filter not found",dashboardLoadFailed:"Failed to load Dashboard. {{error}}",widgetLoadFailed:"Failed to load Widget. {{error}}",dashboardWithOidNotFound:"Dashboard with oid {{dashboardOid}} not found",failedToAddWidget:"Failed to add widget to dashboard",widgetWithOidNotFound:"Widget with oid {{widgetOid}} not found",widgetWithOidNotFoundInDashboard:"Widget with oid {{widgetOid}} not found in dashboard with oid {{dashboardOid}}",widgetEmptyResponse:"Empty response for widget with oid {{widgetOid}}",dateFilterIncorrectOperator:"Incorrect operator: {{operator}}",synchronizedFilterInvalidProps:"`useSynchronizedFilter` hook must take at least one of [non-null `filterFromProps`] or [`createEmptyFilter` function]",methodNotImplemented:"Method not implemented.",noPivotClient:"Pivot client not initialized",unexpectedCacheValue:"Unexpected cache value",notAMembersFilter:"Filter is not a MembersFilter",drilldownNoInitialDimension:"Initial dimension has to be specified to use drilldown with custom components",otherWidgetTypesNotSupported:"Other widget types are not supported yet",dataBrowser:{dimensionNotFound:"Dimension with id {{dimensionId}} not found",attributeNotFound:"Attribute with id {{attributeId}} not found"},addFilterPopover:{noDataSources:"No data sources available. Try to define `dataSource` in widgets or `defaultDataSource` on the dashboard level."},tabberInvalidConfiguration:"Tabber widget configuration is invalid"},errorBoxText:"$t(common:error): {{errorMessage}}",chartNoData:"No Results",filters:"Filters",widgetDetails:"Widget Details",cancel:"Cancel",includeAll:"Include all",formatting:{number:{abbreviations:{thousand:"K",million:"M",billion:"B",trillion:"T"}}},criteriaFilter:{displayModePrefix:"All items",equals:"Equals {{val}}",notEquals:"Does not equal {{val}}",lessThan:"Less than {{val}}",lessThanOrEqual:"Less than or equal to {{val}}",greaterThan:"Greater than {{val}}",greaterThanOrEqual:"Greater than or equal to {{val}}",between:"Between {{valA}} and {{valB}}",notBetween:"Not between {{valA}} and {{valB}}",top:"Top {{valA}} by {{valB}}",bottom:"Last {{valA}} by {{valB}}",is:"Is {{val}}",isNot:"Is not {{val}}",contains:"Contains {{val}}",notContains:"Doesn't contain {{val}}",startsWith:"Starts with {{val}}",notStartsWith:"Doesn't start with {{val}}",endsWith:"Ends with {{val}}",notEndsWith:"Doesn't end with {{val}}",like:"Is like {{val}}",byMeasure:"By measure",by:"by"},dateFilter:{last:"Last",next:"Next",from:"From",to:"To",count:"Count",select:"Select",today:"Today",days:"Days",weeks:"Weeks",months:"Months",quarters:"Quarters",years:"Years",earliestDate:"Earliest Date",latestDate:"Latest Date",todayOutOfRange:"Today is out of available date range",dateRange:{fromTo:"{{from}} to {{to}}",from:"From {{val}}",to:"To {{val}}"}},boxplot:{tooltip:{whiskers:"Whiskers",box:"Box",min:"Min",median:"Median",max:"Max"}},treemap:{tooltip:{ofTotal:"of total",of:"of"}},advanced:{tooltip:{min:"Lower Bound",max:"Upper Bound",forecastValue:"Forecast Value",forecast:"Forecast",trend:"Trend",trendLocalValue:"Local Value",confidenceInterval:"Confidence Interval",trendType:"Type",trendDataKey:"Trend Data",trendData:{min:"Min",max:"Max",median:"Median",average:"Average"}}},arearange:{tooltip:{min:"Min",max:"Max"}},unsupportedFilterMessage:"Unsupported Filter (applied to the data query)",unsupportedFilter:"Unsupported filter {{filter}}",commonFilter:{clearSelectionButton:"Clear Selection",selectMenuItem:"Select",unselectMenuItem:"Un-Select"},customFilterTileMessage:"filtered with custom filter",filterRelations:{and:"AND",or:"OR",andOrFormulaApplied:"AND/OR Formula applied"},drilldown:{drillMenuItem:"Drill",breadcrumbsAllSuffix:"All",breadcrumbsPrev:"Prev",breadcrumbsNext:"Next",popover:{members:"Members",table:"Table",column:"Column"}},widgetHeader:{info:{details:"Widget Details",tooltip:"Click to view full details"}},plugins:{registerPrompt:"Unknown plugin type: {{pluginType}}. Please register this plugin so it can be rendered."},ai:{analyticsChatbot:"Analytics Chatbot",dataTopics:"Data Topics",chatbotDescription:"Analytics Chatbot is designed to help you interact with your data using natural language.",topicSelectPrompt:"Pick a topic you would like to explore:",preview:"Preview",clearHistoryPrompt:"Do you want to clear this chat?",config:{inputPromptText:'Ask a question or type "/" for ideas',welcomeText:"Welcome to the Analytics Assistant! I can help you explore and gain insights from your data.",suggestionsWelcomeText:"Some questions you may have:"},buttons:{insights:"Insights",correctResponse:"Correct response",incorrectResponse:"Incorrect response",clearChat:"Clear chat",refresh:"Refresh",readMore:"Read more",collapse:"Collapse",yes:"Yes",no:"No",seeMore:"See more"},disclaimer:{poweredByAi:"Content is powered by AI, so surprises and mistakes are possible.",rateRequest:"Please rate responses so we can improve!"},errors:{chatUnavailable:"Chat unavailable. Please try again later.",fetchHistory:"Something went wrong and we were unable to retrieve the chat thread. Let's start over!",recommendationsNotAvailable:"Recommendations aren't available right now. Try again in a few minutes.",insightsNotAvailable:"No insights available.",VectorDBEmptyResponseError:"The AI configuration is not ready, please wait a few minutes and try again.",LlmBadConfigurationError:"The LLM configuration is wrong. Reach out to your Admin to update the LLM provider configuration.",ChartTypeUnsupportedError:"Requested chart type is not supported.",BlockedByLlmContentFiltering:"This question is blocked by our content management policy. Please try asking a different question.",LlmContextLengthExceedsLimitError:"Looks like you've reached the message length limit, please clear this conversation.",UserPromptExeedsLimitError:"The prompt exceeds the limit. Rephrase your question and use shorter prompt.",unexpectedChatResponse:"Oh snap, something went wrong. Please try again later or try asking a different question.",unexpected:"Oh snap, something went wrong. Please try again later.",unknownResponse:"Received unknown responseType, raw response=",invalidInput:"Invalid input",noAvailableDataTopics:"None of the provided data models or perspectives are available"}},attribute:{datetimeName:{years:"Years in {{columnName}}",quarters:"Quarters in {{columnName}}",months:"Months in {{columnName}}",weeks:"Weeks in {{columnName}}",days:"Days in {{columnName}}",hours:"Hours in {{columnName}}",minutes:"Minutes in {{columnName}}"}},filterEditor:{buttons:{apply:"Apply",cancel:"Cancel",selectAll:"Select All",clearAll:"Clear All"},labels:{includeAll:"Include all (no filter applied)",allowMultiSelection:"Allow multiselect for lists",from:"From",to:"To",includeCurrent:"Including current"},placeholders:{selectFromList:"Select from list",enterEntry:"Type your entry...",enterValue:"Enter value...",select:"Select"},conditions:{exclude:"Is not",contains:"Contains",notContain:"Does not contain",startsWith:"Starts with",notStartsWith:"Does not start with",endsWith:"Ends with",notEndsWith:"Does not end with",equals:"Equals",notEquals:"Does not equal",isEmpty:"Is empty",isNotEmpty:"Is not empty",lessThan:"Smaller than",lessThanOrEqual:"Equals or smaller than",greaterThan:"Greater than",greaterThanOrEqual:"Equals or greater than",isWithin:"Is within"},validationErrors:{invalidNumber:"Numbers only",invalidNumericRange:'"To" must be greater than "From"'},datetimeLevels:{year:"Year",quarter:"Quarter",month:"Month",week:"Week",day:"Day",aggrigatedHour:"Hour (aggregated)",aggrigatedMinutesRoundTo15:"15-min (aggregated)"},relativeTypes:{last:"Last",this:"This",next:"Next"},datetimePositions:{before:"Before",after:"After"}},dataBrowser:{addFilter:"Add Filter",selectField:"Select Field",configureFilter:"Configure Filter",noResults:"No results",searchPlaceholder:"Search"},pivotTable:{grandTotal:"Grand Total",subTotal:"{{value}} Total"},dashboard:{toolbar:{undo:"Undo",redo:"Redo",cancel:"Cancel",apply:"Apply",editLayout:"Edit Layout"}},jumpToDashboard:{defaultCaption:"Jump to"}},bz={errors:{noSisenseContext:"Контекст Sisense не ініціалізовано",restApiNotReady:"Rest API не ініціалізовано",componentRenderError:"Не вдалося відобразити компонент",sisenseContextNoAuthentication:"Не вказано метод аутентифікації",chartNoSisenseContext:"Контекст Sisense для діаграми не знайдено. Щоб виправити, додайте набір даних до Chart або оберніть компонент у SisenseContextProvider.",widgetByIdNoSisenseContext:"Контекст Sisense для віджета дашборди не знайдено. Щоб виправити, оберніть компонент у SisenseContextProvider.",widgetByIdInvalidIdentifier:"Не вдалося отримати віджет. Переконайтеся, що віджет дашборди існує і доступний.",dashboardWidgetsInvalidIdentifiers:"Не вдалося отримати віджети дашборди. Переконайтеся, що дашборда існує і доступна.",executeQueryNoSisenseContext:"Контекст Sisense для виконання запиту не знайдено. Щоб виправити, оберніть компонент у SisenseContextProvider.",executeQueryNoDataSource:"Не надано dataSource для виконання запиту",dataOptions:{noDimensionsAndMeasures:"Не знайдено ні dimension-ів, ні measure-ів. Параметри даних повинні мати щонайменше один dimension або measure.",attributeNotFound:'Атрибут "{{attributeName}}" не знайдено в даних',measureNotFound:'Measure "{{measureName}}" не знайдено в даних',filterAttributeNotFound:'Атрибут фільтра "{{attributeName}}" не знайдено в даних',highlightAttributeNotFound:'Атрибут виділення "{{attributeName}}" не знайдено в даних'},optionsTranslation:{invalidStyleOptions:"Недійсні параметри `styleOptions` для діаграми '{{chartType}}'",invalidInternalDataOptions:"Параметри `dataOptions` некоректно перетворені для діаграми '{{chartType}}'"},themeNotFound:"Тему з oid {{themeOid}} не знайдено на Sisense-сервері",paletteNotFound:'Палітру "{{paletteName}}" не знайдено на Sisense-сервері',chartTypeNotSupported:"Тип діаграми {{chartType}} не підтримується",chartInvalidProps:"Недійсні параметри діаграми",unsupportedWidgetType:"Неможливо отримати властивості для непідтримуваного типу віджета - {{widgetType}}",sisenseContextNotFound:"Контекст Sisense не знайдено. Переконайтеся, що він наданий.",dashboardInvalidIdentifier:"Не вдалося отримати дашборд. Переконайтеся, що дашборд існує і доступний.",sharedFormula:{identifierExpected:"Не вдалося ідентифікувати загальну формулу. Будь ласка, надайте oid або пару name та datasource",failedToFetch:"Не вдалося отримати спільну формулу"},widgetModel:{incomleteWidget:"Неможливо створити DTO віджету через неповноту властивості ({{prop}})",unsupportedWidgetTypeDto:"Сберігання віджету типу {{chartType}} не підтримується",pivotWidgetNotSupported:"Метод {{methodName}} не підтримується для півот віджету",textWidgetNotSupported:"Метод {{methodName}} не підтримується для текстового віджету",onlyTableWidgetSupported:"Метод {{methodName}} підтримується тільки для табличних віджетів",onlyPivotWidgetSupported:"Метод {{methodName}} підтримується тільки для півот віджетів",onlyTextWidgetSupported:"Метод {{methodName}} підтримується тільки для текстових віджетів",onlyPluginWidgetSupported:"Метод {{methodName}} підтримується тільки для плагінних віджетів",unsupportedWidgetType:"Тип віджету {{widgetType}} не підтримується",unsupportedFusionWidgetType:"Тип Fusion віджету {{widgetType}} не підтримується"},unknownFilterInFilterRelations:"Логічні відношення фільтрів містять невідомий фільтр",filterRelationsNotSupported:"Відносини фільтрів ще не підтримуються",invalidFilterType:"Недійсний тип фільтра",secondsDateTimeLevelSupportedOnlyForLive:"Рівень часу в секундах підтримується лише для 'live' джерела даних",missingMenuRoot:"Відсутній ініціалізований корінь меню",missingModalRoot:"Відсутній ініціалізований корінь модального вікна",missingDataSource:"Значення 'dataSource' відсутнє. Воно має бути передано явно, або 'defaultDataSource' має бути вказано в SisenseContextProvider.",incorrectOnDataReadyHandler:"'onDataReady' має повертати дійсний об'єкт даних",undefinedDataSource:"Не задане джерело даних",emptyModel:"Пуста модель",missingMetadata:"Поле metadata відсутнє",missingModelTitle:"Не знайдено заголовоку моделі",httpClientNotFound:"HttpClient не знайдено",serverSettingsNotLoaded:"Failed to load server settings",requiredColumnMissing:"Відсутній обов’язковий стовпець",unexpectedChartType:"Невідомий тип графіка: {{chartType}}",noRowNumColumn:"Дані не містять row num column",ticIntervalCalculationFailed:"Неможливо обрахувати tic interval. Спробуйте задати datetime granularity.",polarChartDesignOptionsExpected:"Polar chart design options очікуються для polar chart",polarChartDesignOptionsNotExpected:"Polar chart design options не очікуються для non-polar chart",indicatorInvalidRelativeSize:"Невірні опції relative size",unsupportedMapType:"Непідтримуваний тип мапи: {{mapType}}",mapLoadingFailed:"Не вдалося завантажити мапу",cascadingFilterOriginalNotFound:"Помилка при реструктуризації каскадних фільтрів. Оригінальний фільтр не знайдено",dashboardLoadFailed:"Не вдалося завантажити Dashboard. {{error}}",widgetLoadFailed:"Не вдалося завантажити віджет. {{error}}",dashboardWithOidNotFound:"Dashboard з oid {{dashboardOid}} не знайдено",failedToAddWidget:"Не вдалося додати віджет",widgetWithOidNotFound:"Віджет з oid {{widgetOid}} не знайдено",widgetWithOidNotFoundInDashboard:"Віджет з oid {{widgetOid}} не знайдено в Dashboard з oid {{dashboardOid}}",widgetEmptyResponse:"Пуста відповідь для віджета з oid {{widgetOid}}",dateFilterIncorrectOperator:"Некорректний оператор: {{operator}}",synchronizedFilterInvalidProps:"`useSynchronizedFilter` хук потребує одне з [non-null `filterFromProps`] чи [`createEmptyFilter` function]",methodNotImplemented:"Метод не реалізовано.",noPivotClient:"Pivot client не ініціалізовано",unexpectedCacheValue:"Неочікуване значення кешу",notAMembersFilter:"Фільтр не є MembersFilter",drilldownNoInitialDimension:"Initial dimension має бути задано щоб використовувати drilldown з користувацькими компонентами",otherWidgetTypesNotSupported:"Інші типи віджетів поки що не підтримуються",dataBrowser:{dimensionNotFound:"Dimension з id {{dimensionId}} не знайдено",attributeNotFound:"Attribute з id {{attributeId}} не знайдено"},addFilterPopover:{noDataSources:"Не знайдено жодного джерела даних. Спробуйте задати `dataSource` у віджетах або `defaultDataSource` на рівні дашборди."},tabberInvalidConfiguration:"Конфігурація Tabber віджета невірна"},errorBoxText:"$t(common:error): {{errorMessage}}",chartNoData:"Результатів немає",filters:"Фільтри",widgetDetails:"Деталі віджета",cancel:"Відміна",includeAll:"Всі елементи",formatting:{number:{abbreviations:{thousand:"Тис.",million:"Млн",billion:"Млрд",trillion:"Трлн"}}},criteriaFilter:{displayModePrefix:"Всі елементи",equals:"Дорівнює {{val}}",notEquals:"Не дорівнює {{val}}",lessThan:"Менше ніж {{val}}",lessThanOrEqual:"Менше або дорівнює {{val}}",greaterThan:"Більше ніж {{val}}",greaterThanOrEqual:"Більше або дорівнює {{val}}",between:"Між {{valA}} та {{valB}}",notBetween:"Не між {{valA}} та {{valB}}",top:"Перші {{valA}} за {{valB}}",bottom:"Останні {{valA}} за {{valB}}",is:"Є {{val}}",isNot:"Не є {{val}}",contains:"Містить {{val}}",notContains:"Не містить {{val}}",startsWith:"Починається з {{val}}",notStartsWith:"Не починається з {{val}}",endsWith:"Закінчується на {{val}}",notEndsWith:"Не закінчується на {{val}}",like:"Схоже на {{val}}",byMeasure:"By measure",by:"by"},dateFilter:{last:"Останній",next:"Наступний",from:"Від",to:"До",count:"Кількість",select:"Вибрати",today:"Сьогодні",days:"Дні",weeks:"Тижні",months:"Місяці",quarters:"Квартали",years:"Роки",earliestDate:"Найбільш Рання Дата",latestDate:"Найбільш Пізня Дата",todayOutOfRange:"Сьогоднішній день поза доступним діапазоном дат",dateRange:{fromTo:"{{from}} до {{to}}",from:"Від {{val}}",to:"До {{val}}"}},boxplot:{tooltip:{whiskers:"Вуса",box:"Коробка",min:"Мінімум",median:"Медіана",max:"Максимум"}},treemap:{tooltip:{ofTotal:"загальної кількості",of:"з"}},advanced:{tooltip:{min:"Lower Bound",max:"Upper Bound",forecastValue:"Forecast Value",forecast:"Forecast",trend:"Trend",trendLocalValue:"Local Value",confidenceInterval:"Confidence Interval",trendType:"Type",trendDataKey:"Trend Data",trendData:{min:"Min",max:"Max",median:"Median",average:"Average"}}},arearange:{tooltip:{min:"Мінімум",max:"Максимум"}},dashboard:{toolbar:{undo:"Скасувати",redo:"Повторити",cancel:"Відмінити",apply:"Застосувати",editLayout:"Редагувати макет"}},unsupportedFilterMessage:"Непідтримуваний Фільтр (застосовано до запиту даних)",unsupportedFilter:"Непідтримуваний фільтр {{filter}}",commonFilter:{clearSelectionButton:"Очистити виділення",selectMenuItem:"Вибрати",unselectMenuItem:"Cкасувати вибір"},customFilterTileMessage:"застосовано користувацький фільтр",drilldown:{drillMenuItem:"Деталізація",breadcrumbsAllSuffix:"Все",breadcrumbsPrev:"Попередній",breadcrumbsNext:"Наступний",popover:{members:"Учасники",table:"Таблиця",column:"Колонка"}},widgetHeader:{info:{details:"Деталі віджета",tooltip:"Натисніть щоб побачити повну інформацію"}},plugins:{registerPrompt:"Невідомий плагін: {{pluginType}}. Будь ласка зареєструйте цей плагін щоб він міг бути відображений."},ai:{analyticsChatbot:"Аналітичний чат-бот",dataTopics:"Теми Даних",chatbotDescription:"Аналітичний чат-бот розроблено, щоб допомогти вам взаємодіяти з вашими даними за допомогою розмовної мови.",topicSelectPrompt:"Виберіть тему, яку б ви хотіли дослідити:",preview:"Попередній перегляд",clearHistoryPrompt:"Ви дійсно хочете очистити чат?",config:{inputPromptText:"Поставте запитання або введіть «/» для отримання ідей",welcomeText:"Вітаємо в Аналітичному помічнику! Я можу допомогти вам досліджувати та зрозуміти ваші дані.",suggestionsWelcomeText:"Деякі запитання, які у вас можуть виникнути:"},buttons:{insights:"Інсайти",correctResponse:"Коректна відповідь",incorrectResponse:"Некоректна відповідь",clearChat:"Очистити чат",refresh:"Оновити",readMore:"Читати ще",collapse:"Згорнути",yes:"Так",no:"Ні",seeMore:"Більше"},disclaimer:{poweredByAi:"Вміст створено за допомогою ШІ, тому можливі несподіванки та помилки.",rateRequest:" Будь ласка, оцінюйте відповіді, щоб ми могли покращити продукт!"},errors:{chatUnavailable:"Чат недоступний. Спробуйте пізніше.",fetchHistory:"Щось пішло не так, і ми не змогли відновити історію чату. Почнімо спочатку!",recommendationsNotAvailable:"Наразі рекомендації недоступні. Спробуйте ще раз через кілька хвилин.",insightsNotAvailable:"Немає доступних інсайтів.",VectorDBEmptyResponseError:"AI ще конфігурується, будь ласка зачекайте та спробуйте ще раз за хвилинку чи дві.",LlmBadConfigurationError:"Схоже що LLM невірно сконфігурований. Зверніться до вашого Адміністратора щоб він оновив конфігурацію LLM провайдера.",ChartTypeUnsupportedError:"Графік такого типу покищо не підтримується.",BlockedByLlmContentFiltering:"Це питання заблоковано нашою політикою керування вмістом. Будь ласка спробуйте поставити інше запитання.",LlmContextLengthExceedsLimitError:"Схоже ви досягли ліміту кількості сповіщеннь, будь ласка очистіть поточний чат аби розпочати новий.",UserPromptExeedsLimitError:"Цей запит перевищює максимально дозволений ліміт. Будь ласка перефразуйте та зробіть запит коротше.",unexpectedChatResponse:"Ой, щось пішло не так. Повторіть спробу пізніше або спробуйте поставити інше запитання.",unexpected:"Ой, лихо! Шось йому стало. Спробуйте трохи пізніше.",unknownResponse:"Отримано невідомий тип відповіді, необроблена відповідь=",invalidInput:"Недійсне введення",noAvailableDataTopics:"Жодне з наданих моделей даних або перспектив доступне"}},filterRelations:{and:"І",or:"АБО",andOrFormulaApplied:"Застосовано формулу І/АБО"},attribute:{datetimeName:{years:"Роки в {{columnName}}",quarters:"Квартали в {{columnName}}",months:"Місяці в {{columnName}}",weeks:"Тижні в {{columnName}}",days:"Дні в {{columnName}}",hours:"Години в {{columnName}}",minutes:"Хвилини в {{columnName}}"}},filterEditor:{buttons:{apply:"Застосувати",cancel:"Відміна",selectAll:"Обрати всі",clearAll:"Очистити всі"},labels:{includeAll:"Обрати всі (фільтр не використовується)",allowMultiSelection:"Дозволити вибір кількох значень для списків",from:"Від",to:"До",includeCurrent:"Включаючи поточний"},placeholders:{selectFromList:"Виберіть зі списку",enterEntry:"Введіть значення...",enterValue:"Введіть значення...",select:"Вибрати"},conditions:{exclude:"Не є",contains:"Mістить",notContain:"Не містить",startsWith:"Починається з",notStartsWith:"Не починається з",endsWith:"Закінчується на",notEndsWith:"Не закінчується на",equals:"Дорівнює",notEquals:"Не дорівнює",isEmpty:"Порожній",isNotEmpty:"Не порожній",lessThan:"Менше ніж",lessThanOrEqual:"Менше або дорівнює",greaterThan:"Більше ніж",greaterThanOrEqual:"Більше або дорівнює",isWithin:"В межах"},validationErrors:{invalidNumber:"Тільки цифри",invalidNumericRange:'"До" має бути більше, ніж "Від"'},datetimeLevels:{year:"Year",quarter:"Quarter",month:"Month",week:"Week",day:"Day",aggrigatedHour:"Hour (aggregated)",aggrigatedMinutesRoundTo15:"15-min (aggregated)"},relativeTypes:{last:"Останній",this:"Поточний",next:"Наступний"},datetimePositions:{before:"Перед",after:"Після"}},pivotTable:{grandTotal:"Загальний підсумок",subTotal:"Усього {{value}}"},dataBrowser:{addFilter:"Додати фільтр",selectField:"Вибрати поле",configureFilter:"Налаштувати фільтр",noResults:"Немає результатів",searchPlaceholder:"Пошук"},jumpToDashboard:{defaultCaption:"Перейти до"}},cx="sdkUi",xz={en:yz,uk:bz};function lE(){return sx({resource:xz,plugins:[mz],language:"en",namespace:cx})}const{i18nextInstance:cE}=lE(),wz={errors:{measure:{unsupportedType:"Unsupported measure type",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure must have 'context' property"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",noAggAggregation:"DimensionalBaseMeasure must have 'agg' or 'aggregation' property"},notAFormula:"Jaql is not a formula"},dataModelConfig:{noName:"'name' must be specified in config for DataModel",noMetadata:"'metadata' must be specified in config for DataModel"},filter:{unsupportedType:"Unsupported filter type: {{filterType}}",unsupportedDatetimeLevel:'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter of {{attributeId}} - member cannot be null",unsupportedConditionFilter:"Jaql contains unsupported condition filter: {{filter}}",formulaFiltersNotSupported:"Formula-based filter not supported yet: {{filter}}"},unsupportedDimensionalElement:"Unsupported dimensional element type"}},_z={errors:{measure:{unsupportedType:"Непідтримуваний тип measure",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure має мати властивість 'context'"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",noAggAggregation:"DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'"},notAFormula:"Jaql не формула"},dataModelConfig:{noName:"'name' має бути вказано в конфігурації для DataModel",noMetadata:"'metadata' має бути вказано в конфігурації для DataModel"},filter:{unsupportedType:"Непідтримуваний тип фільтра: {{filterType}}",unsupportedDatetimeLevel:'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter у {{attributeId}} - member не може бути нульовим",unsupportedConditionFilter:"Jaql містить непідтримуваний condition фільтр: {{filter}}",formulaFiltersNotSupported:"Фільтри, що містять формули наразі не підтримуються: {{filter}}"},unsupportedDimensionalElement:"Непідтримуваний тип елемента"}},uE="sdkData",Cz={en:wz,uk:_z};function Sz(){return sx({resource:Cz,language:"en",namespace:uE})}const{i18nextInstance:Tz}=Sz();function Mz(){this.__data__=[],this.size=0}function Ru(e,t){return e===t||e!==e&&t!==t}function af(e,t){for(var i=e.length;i--;)if(Ru(e[i][0],t))return i;return-1}var kz=Array.prototype,Pz=kz.splice;function Az(e){var t=this.__data__,i=af(t,e);if(i<0)return!1;var n=t.length-1;return i==n?t.pop():Pz.call(t,i,1),--this.size,!0}function Ez(e){var t=this.__data__,i=af(t,e);return i<0?void 0:t[i][1]}function Oz(e){return af(this.__data__,e)>-1}function Lz(e,t){var i=this.__data__,n=af(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}function Wr(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Wr.prototype.clear=Mz;Wr.prototype.delete=Az;Wr.prototype.get=Ez;Wr.prototype.has=Oz;Wr.prototype.set=Lz;function Nz(){this.__data__=new Wr,this.size=0}function Dz(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function Iz(e){return this.__data__.get(e)}function Rz(e){return this.__data__.has(e)}var dE=typeof global=="object"&&global&&global.Object===Object&&global,jz=typeof self=="object"&&self&&self.Object===Object&&self,mn=dE||jz||Function("return this")(),mo=mn.Symbol,hE=Object.prototype,Bz=hE.hasOwnProperty,zz=hE.toString,Ql=mo?mo.toStringTag:void 0;function Fz(e){var t=Bz.call(e,Ql),i=e[Ql];try{e[Ql]=void 0;var n=!0}catch(r){}var o=zz.call(e);return n&&(t?e[Ql]=i:delete e[Ql]),o}var Wz=Object.prototype,Hz=Wz.toString;function $z(e){return Hz.call(e)}var Uz="[object Null]",Vz="[object Undefined]",U_=mo?mo.toStringTag:void 0;function jo(e){return e==null?e===void 0?Vz:Uz:U_&&U_ in Object(e)?Fz(e):$z(e)}function hn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Gz="[object AsyncFunction]",Yz="[object Function]",Xz="[object GeneratorFunction]",qz="[object Proxy]";function Va(e){if(!hn(e))return!1;var t=jo(e);return t==Yz||t==Xz||t==Gz||t==qz}var cg=mn["__core-js_shared__"],V_=function(){var e=/[^.]+$/.exec(cg&&cg.keys&&cg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Zz(e){return!!V_&&V_ in e}var Kz=Function.prototype,Jz=Kz.toString;function ts(e){if(e!=null){try{return Jz.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Qz=/[\\^$.*+?()[\]{}|]/g,eF=/^\[object .+?Constructor\]$/,tF=Function.prototype,iF=Object.prototype,nF=tF.toString,oF=iF.hasOwnProperty,rF=RegExp("^"+nF.call(oF).replace(Qz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function aF(e){if(!hn(e)||Zz(e))return!1;var t=Va(e)?rF:eF;return t.test(ts(e))}function sF(e,t){return e==null?void 0:e[t]}function is(e,t){var i=sF(e,t);return aF(i)?i:void 0}var Jc=is(mn,"Map"),Qc=is(Object,"create");function lF(){this.__data__=Qc?Qc(null):{},this.size=0}function cF(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uF="__lodash_hash_undefined__",dF=Object.prototype,hF=dF.hasOwnProperty;function pF(e){var t=this.__data__;if(Qc){var i=t[e];return i===uF?void 0:i}return hF.call(t,e)?t[e]:void 0}var fF=Object.prototype,mF=fF.hasOwnProperty;function gF(e){var t=this.__data__;return Qc?t[e]!==void 0:mF.call(t,e)}var vF="__lodash_hash_undefined__";function yF(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Qc&&t===void 0?vF:t,this}function Ga(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Ga.prototype.clear=lF;Ga.prototype.delete=cF;Ga.prototype.get=pF;Ga.prototype.has=gF;Ga.prototype.set=yF;function bF(){this.size=0,this.__data__={hash:new Ga,map:new(Jc||Wr),string:new Ga}}function xF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sf(e,t){var i=e.__data__;return xF(t)?i[typeof t=="string"?"string":"hash"]:i.map}function wF(e){var t=sf(this,e).delete(e);return this.size-=t?1:0,t}function _F(e){return sf(this,e).get(e)}function CF(e){return sf(this,e).has(e)}function SF(e,t){var i=sf(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}function Hr(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Hr.prototype.clear=bF;Hr.prototype.delete=wF;Hr.prototype.get=_F;Hr.prototype.has=CF;Hr.prototype.set=SF;var TF=200;function MF(e,t){var i=this.__data__;if(i instanceof Wr){var n=i.__data__;if(!Jc||n.length<TF-1)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new Hr(n)}return i.set(e,t),this.size=i.size,this}function Lo(e){var t=this.__data__=new Wr(e);this.size=t.size}Lo.prototype.clear=Nz;Lo.prototype.delete=Dz;Lo.prototype.get=Iz;Lo.prototype.has=Rz;Lo.prototype.set=MF;function pE(e,t){for(var i=-1,n=e==null?0:e.length;++i<n&&t(e[i],i,e)!==!1;);return e}var ep=function(){try{var e=is(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function ju(e,t,i){t=="__proto__"&&ep?ep(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var kF=Object.prototype,PF=kF.hasOwnProperty;function ux(e,t,i){var n=e[t];(!(PF.call(e,t)&&Ru(n,i))||i===void 0&&!(t in e))&&ju(e,t,i)}function Cl(e,t,i,n){var o=!i;i||(i={});for(var r=-1,u=t.length;++r<u;){var _=t[r],A=void 0;A===void 0&&(A=e[_]),o?ju(i,_,A):ux(i,_,A)}return i}function AF(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}function Cn(e){return e!=null&&typeof e=="object"}var EF="[object Arguments]";function G_(e){return Cn(e)&&jo(e)==EF}var fE=Object.prototype,OF=fE.hasOwnProperty,LF=fE.propertyIsEnumerable,eu=G_(function(){return arguments}())?G_:function(e){return Cn(e)&&OF.call(e,"callee")&&!LF.call(e,"callee")},_i=Array.isArray;function NF(){return!1}var mE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Y_=mE&&typeof module=="object"&&module&&!module.nodeType&&module,DF=Y_&&Y_.exports===mE,X_=DF?mn.Buffer:void 0,IF=X_?X_.isBuffer:void 0,tu=IF||NF,RF=9007199254740991,jF=/^(?:0|[1-9]\d*)$/;function Bu(e,t){var i=typeof e;return t=t==null?RF:t,!!t&&(i=="number"||i!="symbol"&&jF.test(e))&&e>-1&&e%1==0&&e<t}var BF=9007199254740991;function dx(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BF}var zF="[object Arguments]",FF="[object Array]",WF="[object Boolean]",HF="[object Date]",$F="[object Error]",UF="[object Function]",VF="[object Map]",GF="[object Number]",YF="[object Object]",XF="[object RegExp]",qF="[object Set]",ZF="[object String]",KF="[object WeakMap]",JF="[object ArrayBuffer]",QF="[object DataView]",e3="[object Float32Array]",t3="[object Float64Array]",i3="[object Int8Array]",n3="[object Int16Array]",o3="[object Int32Array]",r3="[object Uint8Array]",a3="[object Uint8ClampedArray]",s3="[object Uint16Array]",l3="[object Uint32Array]",vi={};vi[e3]=vi[t3]=vi[i3]=vi[n3]=vi[o3]=vi[r3]=vi[a3]=vi[s3]=vi[l3]=!0;vi[zF]=vi[FF]=vi[JF]=vi[WF]=vi[QF]=vi[HF]=vi[$F]=vi[UF]=vi[VF]=vi[GF]=vi[YF]=vi[XF]=vi[qF]=vi[ZF]=vi[KF]=!1;function c3(e){return Cn(e)&&dx(e.length)&&!!vi[jo(e)]}function zu(e){return function(t){return e(t)}}var gE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bc=gE&&typeof module=="object"&&module&&!module.nodeType&&module,u3=Bc&&Bc.exports===gE,ug=u3&&dE.process,la=function(){try{var e=Bc&&Bc.require&&Bc.require("util").types;return e||ug&&ug.binding&&ug.binding("util")}catch(t){}}(),q_=la&&la.isTypedArray,hx=q_?zu(q_):c3,d3=Object.prototype,h3=d3.hasOwnProperty;function vE(e,t){var i=_i(e),n=!i&&eu(e),o=!i&&!n&&tu(e),r=!i&&!n&&!o&&hx(e),u=i||n||o||r,_=u?AF(e.length,String):[],A=_.length;for(var E in e)(t||h3.call(e,E))&&!(u&&(E=="length"||o&&(E=="offset"||E=="parent")||r&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Bu(E,A)))&&_.push(E);return _}var p3=Object.prototype;function px(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||p3;return e===i}function yE(e,t){return function(i){return e(t(i))}}var f3=yE(Object.keys,Object),m3=Object.prototype,g3=m3.hasOwnProperty;function v3(e){if(!px(e))return f3(e);var t=[];for(var i in Object(e))g3.call(e,i)&&i!="constructor"&&t.push(i);return t}function Fu(e){return e!=null&&dx(e.length)&&!Va(e)}function Wu(e){return Fu(e)?vE(e):v3(e)}function y3(e,t){return e&&Cl(t,Wu(t),e)}function b3(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}var x3=Object.prototype,w3=x3.hasOwnProperty;function _3(e){if(!hn(e))return b3(e);var t=px(e),i=[];for(var n in e)n=="constructor"&&(t||!w3.call(e,n))||i.push(n);return i}function Hu(e){return Fu(e)?vE(e,!0):_3(e)}function C3(e,t){return e&&Cl(t,Hu(t),e)}var bE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Z_=bE&&typeof module=="object"&&module&&!module.nodeType&&module,S3=Z_&&Z_.exports===bE,K_=S3?mn.Buffer:void 0,J_=K_?K_.allocUnsafe:void 0;function xE(e,t){if(t)return e.slice();var i=e.length,n=J_?J_(i):new e.constructor(i);return e.copy(n),n}function lf(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function T3(e,t){for(var i=-1,n=e==null?0:e.length,o=0,r=[];++i<n;){var u=e[i];t(u,i,e)&&(r[o++]=u)}return r}function wE(){return[]}var M3=Object.prototype,k3=M3.propertyIsEnumerable,Q_=Object.getOwnPropertySymbols,fx=Q_?function(e){return e==null?[]:(e=Object(e),T3(Q_(e),function(t){return k3.call(e,t)}))}:wE;function P3(e,t){return Cl(e,fx(e),t)}function mx(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}var gx=yE(Object.getPrototypeOf,Object),A3=Object.getOwnPropertySymbols,_E=A3?function(e){for(var t=[];e;)mx(t,fx(e)),e=gx(e);return t}:wE;function E3(e,t){return Cl(e,_E(e),t)}function CE(e,t,i){var n=t(e);return _i(e)?n:mx(n,i(e))}function My(e){return CE(e,Wu,fx)}function vx(e){return CE(e,Hu,_E)}var ky=is(mn,"DataView"),Py=is(mn,"Promise"),tp=is(mn,"Set"),iu=is(mn,"WeakMap"),eC="[object Map]",O3="[object Object]",tC="[object Promise]",iC="[object Set]",nC="[object WeakMap]",oC="[object DataView]",L3=ts(ky),N3=ts(Jc),D3=ts(Py),I3=ts(tp),R3=ts(iu),Ao=jo;(ky&&Ao(new ky(new ArrayBuffer(1)))!=oC||Jc&&Ao(new Jc)!=eC||Py&&Ao(Py.resolve())!=tC||tp&&Ao(new tp)!=iC||iu&&Ao(new iu)!=nC)&&(Ao=function(e){var t=jo(e),i=t==O3?e.constructor:void 0,n=i?ts(i):"";if(n)switch(n){case L3:return oC;case N3:return eC;case D3:return tC;case I3:return iC;case R3:return nC}return t});var j3=Object.prototype,B3=j3.hasOwnProperty;function z3(e){var t=e.length,i=new e.constructor(t);return t&&typeof e[0]=="string"&&B3.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var ip=mn.Uint8Array;function yx(e){var t=new e.constructor(e.byteLength);return new ip(t).set(new ip(e)),t}function F3(e,t){var i=t?yx(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var W3=/\w*$/;function H3(e){var t=new e.constructor(e.source,W3.exec(e));return t.lastIndex=e.lastIndex,t}var rC=mo?mo.prototype:void 0,aC=rC?rC.valueOf:void 0;function $3(e){return aC?Object(aC.call(e)):{}}function SE(e,t){var i=t?yx(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var U3="[object Boolean]",V3="[object Date]",G3="[object Map]",Y3="[object Number]",X3="[object RegExp]",q3="[object Set]",Z3="[object String]",K3="[object Symbol]",J3="[object ArrayBuffer]",Q3="[object DataView]",eW="[object Float32Array]",tW="[object Float64Array]",iW="[object Int8Array]",nW="[object Int16Array]",oW="[object Int32Array]",rW="[object Uint8Array]",aW="[object Uint8ClampedArray]",sW="[object Uint16Array]",lW="[object Uint32Array]";function cW(e,t,i){var n=e.constructor;switch(t){case J3:return yx(e);case U3:case V3:return new n(+e);case Q3:return F3(e,i);case eW:case tW:case iW:case nW:case oW:case rW:case aW:case sW:case lW:return SE(e,i);case G3:return new n;case Y3:case Z3:return new n(e);case X3:return H3(e);case q3:return new n;case K3:return $3(e)}}var sC=Object.create,cf=function(){function e(){}return function(t){if(!hn(t))return{};if(sC)return sC(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function TE(e){return typeof e.constructor=="function"&&!px(e)?cf(gx(e)):{}}var uW="[object Map]";function dW(e){return Cn(e)&&Ao(e)==uW}var lC=la&&la.isMap,hW=lC?zu(lC):dW,pW="[object Set]";function fW(e){return Cn(e)&&Ao(e)==pW}var cC=la&&la.isSet,mW=cC?zu(cC):fW,gW=1,vW=2,yW=4,ME="[object Arguments]",bW="[object Array]",xW="[object Boolean]",wW="[object Date]",_W="[object Error]",kE="[object Function]",CW="[object GeneratorFunction]",SW="[object Map]",TW="[object Number]",PE="[object Object]",MW="[object RegExp]",kW="[object Set]",PW="[object String]",AW="[object Symbol]",EW="[object WeakMap]",OW="[object ArrayBuffer]",LW="[object DataView]",NW="[object Float32Array]",DW="[object Float64Array]",IW="[object Int8Array]",RW="[object Int16Array]",jW="[object Int32Array]",BW="[object Uint8Array]",zW="[object Uint8ClampedArray]",FW="[object Uint16Array]",WW="[object Uint32Array]",mi={};mi[ME]=mi[bW]=mi[OW]=mi[LW]=mi[xW]=mi[wW]=mi[NW]=mi[DW]=mi[IW]=mi[RW]=mi[jW]=mi[SW]=mi[TW]=mi[PE]=mi[MW]=mi[kW]=mi[PW]=mi[AW]=mi[BW]=mi[zW]=mi[FW]=mi[WW]=!0;mi[_W]=mi[kE]=mi[EW]=!1;function Gs(e,t,i,n,o,r){var u,_=t&gW,A=t&vW,E=t&yW;if(i&&(u=o?i(e,n,o,r):i(e)),u!==void 0)return u;if(!hn(e))return e;var H=_i(e);if(H){if(u=z3(e),!_)return lf(e,u)}else{var q=Ao(e),g=q==kE||q==CW;if(tu(e))return xE(e,_);if(q==PE||q==ME||g&&!o){if(u=A||g?{}:TE(e),!_)return A?E3(e,C3(u,e)):P3(e,y3(u,e))}else{if(!mi[q])return o?e:{};u=cW(e,q,_)}}r||(r=new Lo);var te=r.get(e);if(te)return te;r.set(e,u),mW(e)?e.forEach(function(Y){u.add(Gs(Y,t,i,Y,e,r))}):hW(e)&&e.forEach(function(Y,Z){u.set(Z,Gs(Y,t,i,Z,e,r))});var W=E?A?vx:My:A?Hu:Wu,C=H?void 0:W(e);return pE(C||e,function(Y,Z){C&&(Z=Y,Y=e[Z]),ux(u,Z,Gs(Y,t,i,Z,e,r))}),u}var HW=1,$W=4;function Ya(e){return Gs(e,HW|$W)}function UW(e){return function(t,i,n){for(var o=-1,r=Object(t),u=n(t),_=u.length;_--;){var A=u[++o];if(i(r[A],A,r)===!1)break}return t}}var AE=UW();function EE(e,t){return e&&AE(e,t,Wu)}var VW="__lodash_hash_undefined__";function GW(e){return this.__data__.set(e,VW),this}function YW(e){return this.__data__.has(e)}function nu(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new Hr;++t<i;)this.add(e[t])}nu.prototype.add=nu.prototype.push=GW;nu.prototype.has=YW;function XW(e,t){for(var i=-1,n=e==null?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function OE(e,t){return e.has(t)}var qW=1,ZW=2;function LE(e,t,i,n,o,r){var u=i&qW,_=e.length,A=t.length;if(_!=A&&!(u&&A>_))return!1;var E=r.get(e),H=r.get(t);if(E&&H)return E==t&&H==e;var q=-1,g=!0,te=i&ZW?new nu:void 0;for(r.set(e,t),r.set(t,e);++q<_;){var W=e[q],C=t[q];if(n)var Y=u?n(C,W,q,t,e,r):n(W,C,q,e,t,r);if(Y!==void 0){if(Y)continue;g=!1;break}if(te){if(!XW(t,function(Z,K){if(!OE(te,K)&&(W===Z||o(W,Z,i,n,r)))return te.push(K)})){g=!1;break}}else if(!(W===C||o(W,C,i,n,r))){g=!1;break}}return r.delete(e),r.delete(t),g}function KW(e){var t=-1,i=Array(e.size);return e.forEach(function(n,o){i[++t]=[o,n]}),i}function NE(e){var t=-1,i=Array(e.size);return e.forEach(function(n){i[++t]=n}),i}var JW=1,QW=2,eH="[object Boolean]",tH="[object Date]",iH="[object Error]",nH="[object Map]",oH="[object Number]",rH="[object RegExp]",aH="[object Set]",sH="[object String]",lH="[object Symbol]",cH="[object ArrayBuffer]",uH="[object DataView]",uC=mo?mo.prototype:void 0,dg=uC?uC.valueOf:void 0;function dH(e,t,i,n,o,r,u){switch(i){case uH:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case cH:return!(e.byteLength!=t.byteLength||!r(new ip(e),new ip(t)));case eH:case tH:case oH:return Ru(+e,+t);case iH:return e.name==t.name&&e.message==t.message;case rH:case sH:return e==t+"";case nH:var _=KW;case aH:var A=n&JW;if(_||(_=NE),e.size!=t.size&&!A)return!1;var E=u.get(e);if(E)return E==t;n|=QW,u.set(e,t);var H=LE(_(e),_(t),n,o,r,u);return u.delete(e),H;case lH:if(dg)return dg.call(e)==dg.call(t)}return!1}var hH=1,pH=Object.prototype,fH=pH.hasOwnProperty;function mH(e,t,i,n,o,r){var u=i&hH,_=My(e),A=_.length,E=My(t),H=E.length;if(A!=H&&!u)return!1;for(var q=A;q--;){var g=_[q];if(!(u?g in t:fH.call(t,g)))return!1}var te=r.get(e),W=r.get(t);if(te&&W)return te==t&&W==e;var C=!0;r.set(e,t),r.set(t,e);for(var Y=u;++q<A;){g=_[q];var Z=e[g],K=t[g];if(n)var J=u?n(K,Z,g,t,e,r):n(Z,K,g,e,t,r);if(!(J===void 0?Z===K||o(Z,K,i,n,r):J)){C=!1;break}Y||(Y=g=="constructor")}if(C&&!Y){var G=e.constructor,j=t.constructor;G!=j&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof j=="function"&&j instanceof j)&&(C=!1)}return r.delete(e),r.delete(t),C}var gH=1,dC="[object Arguments]",hC="[object Array]",Ld="[object Object]",vH=Object.prototype,pC=vH.hasOwnProperty;function yH(e,t,i,n,o,r){var u=_i(e),_=_i(t),A=u?hC:Ao(e),E=_?hC:Ao(t);A=A==dC?Ld:A,E=E==dC?Ld:E;var H=A==Ld,q=E==Ld,g=A==E;if(g&&tu(e)){if(!tu(t))return!1;u=!0,H=!1}if(g&&!H)return r||(r=new Lo),u||hx(e)?LE(e,t,i,n,o,r):dH(e,t,A,i,n,o,r);if(!(i&gH)){var te=H&&pC.call(e,"__wrapped__"),W=q&&pC.call(t,"__wrapped__");if(te||W){var C=te?e.value():e,Y=W?t.value():t;return r||(r=new Lo),o(C,Y,i,n,r)}}return g?(r||(r=new Lo),mH(e,t,i,n,o,r)):!1}function $u(e,t,i,n,o){return e===t?!0:e==null||t==null||!Cn(e)&&!Cn(t)?e!==e&&t!==t:yH(e,t,i,n,$u,o)}var bH=1,xH=2;function wH(e,t,i,n){var o=i.length,r=o;if(e==null)return!r;for(e=Object(e);o--;){var u=i[o];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<r;){u=i[o];var _=u[0],A=e[_],E=u[1];if(u[2]){if(A===void 0&&!(_ in e))return!1}else{var H=new Lo,q;if(!(q===void 0?$u(E,A,bH|xH,n,H):q))return!1}}return!0}function DE(e){return e===e&&!hn(e)}function _H(e){for(var t=Wu(e),i=t.length;i--;){var n=t[i],o=e[n];t[i]=[n,o,DE(o)]}return t}function IE(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}function CH(e){var t=_H(e);return t.length==1&&t[0][2]?IE(t[0][0],t[0][1]):function(i){return i===e||wH(i,e,t)}}var SH="[object Symbol]";function uf(e){return typeof e=="symbol"||Cn(e)&&jo(e)==SH}var TH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MH=/^\w*$/;function bx(e,t){if(_i(e))return!1;var i=typeof e;return i=="number"||i=="symbol"||i=="boolean"||e==null||uf(e)?!0:MH.test(e)||!TH.test(e)||t!=null&&e in Object(t)}var kH="Expected a function";function xx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kH);var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var u=e.apply(this,n);return i.cache=r.set(o,u)||r,u};return i.cache=new(xx.Cache||Hr),i}xx.Cache=Hr;var PH=500;function AH(e){var t=xx(e,function(n){return i.size===PH&&i.clear(),n}),i=t.cache;return t}var EH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OH=/\\(\\)?/g,LH=AH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(EH,function(i,n,o,r){t.push(o?r.replace(OH,"$1"):n||i)}),t});function Uu(e,t){for(var i=-1,n=e==null?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o}var NH=1/0,fC=mo?mo.prototype:void 0,mC=fC?fC.toString:void 0;function wx(e){if(typeof e=="string")return e;if(_i(e))return Uu(e,wx)+"";if(uf(e))return mC?mC.call(e):"";var t=e+"";return t=="0"&&1/e==-NH?"-0":t}function np(e){return e==null?"":wx(e)}function Sl(e,t){return _i(e)?e:bx(e,t)?[e]:LH(np(e))}var DH=1/0;function Tl(e){if(typeof e=="string"||uf(e))return e;var t=e+"";return t=="0"&&1/e==-DH?"-0":t}function df(e,t){t=Sl(t,e);for(var i=0,n=t.length;e!=null&&i<n;)e=e[Tl(t[i++])];return i&&i==n?e:void 0}function RE(e,t,i){var n=e==null?void 0:df(e,t);return n===void 0?i:n}function IH(e,t){return e!=null&&t in Object(e)}function RH(e,t,i){t=Sl(t,e);for(var n=-1,o=t.length,r=!1;++n<o;){var u=Tl(t[n]);if(!(r=e!=null&&i(e,u)))break;e=e[u]}return r||++n!=o?r:(o=e==null?0:e.length,!!o&&dx(o)&&Bu(u,o)&&(_i(e)||eu(e)))}function jE(e,t){return e!=null&&RH(e,t,IH)}var jH=1,BH=2;function zH(e,t){return bx(e)&&DE(t)?IE(Tl(e),t):function(i){var n=RE(i,e);return n===void 0&&n===t?jE(i,e):$u(t,n,jH|BH)}}function hf(e){return e}function FH(e){return function(t){return t==null?void 0:t[e]}}function WH(e){return function(t){return df(t,e)}}function HH(e){return bx(e)?FH(Tl(e)):WH(e)}function _x(e){return typeof e=="function"?e:e==null?hf:typeof e=="object"?_i(e)?zH(e[0],e[1]):CH(e):HH(e)}function $H(e,t){var i={};return t=_x(t),EE(e,function(n,o,r){ju(i,o,t(n,o,r))}),i}function UH(e){for(var t=e.length,i=5381,n=52711,o;t--;)o=e.charCodeAt(t),i=i*33^o,n=n*33^o;return(i>>>0)*4096+(n>>>0)}var ou="|",VH=/\[object ([HTML|SVG](.*)Element)\]/,GH={"[object Arguments]":0,"[object Array]":1,"[object ArrayBuffer]":2,"[object AsyncFunction]":3,"[object AsyncGeneratorFunction]":4,"[object BigInt]":5,"[object BigInt64Array]":6,"[object BigUint64Array]":7,"[object Boolean]":8,"[object DataView]":9,"[object Date]":10,"[object DocumentFragment]":11,"[object Error]":12,"[object Event]":13,"[object Float32Array]":14,"[object Float64Array]":15,"[object Function]":16,"[object Generator]":17,"[object GeneratorFunction]":18,"[object Int8Array]":19,"[object Int16Array]":20,"[object Map]":21,"[object Number]":22,"[object Object]":23,"[object Promise]":24,"[object RegExp]":25,"[object Set]":26,"[object SharedArrayBuffer]":27,"[object String]":28,"[object Uint8Array]":29,"[object Uint8ClampedArray]":30,"[object Uint16Array]":31,"[object Uint32Array]":32,"[object WeakMap]":33,"[object WeakRef]":34,"[object WeakSet]":35,CUSTOM:36,ELEMENT:37},YH={"[object Arguments]":1,"[object Array]":2},BE={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},XH={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},qH={"[object BigInt64Array]":1,"[object BigUint64Array]":2,"[object Float32Array]":3,"[object Float64Array]":4,"[object Int8Array]":5,"[object Int16Array]":6,"[object Uint8Array]":7,"[object Uint8ClampedArray]":8,"[object Uint16Array]":9,"[object Uint32Array]":10},ZH={"[object Arguments]":1,"[object Array]":2,"[object ArrayBuffer]":3,"[object BigInt64Array]":4,"[object BigUint64Array]":5,"[object DataView]":6,"[object Float32Array]":7,"[object Float64Array]":8,"[object Int8Array]":9,"[object Int16Array]":10,"[object Map]":11,"[object Object]":12,"[object Set]":13,"[object SharedArrayBuffer]":14,"[object Uint8Array]":15,"[object Uint8ClampedArray]":16,"[object Uint16Array]":17,"[object Uint32Array]":18,CUSTOM:19},Mc={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function KH(e,t){return e[0]>t[0]}function zE(e,t){return e>t}function Cx(e,t){for(var i,n,o=0;o<e.length;++o){for(n=e[o],i=o-1;~i&&t(e[i],n);--i)e[i+1]=e[i];e[i+1]=n}return e}function Qi(e,t){return Mc.object+ou+GH[e]+ou+t}var gC=new WeakMap,JH=0;function Ay(e,t){var i=gC.get(e);if(i)return i;var n=Qi(t,"NOT_ENUMERABLE"+ou+JH++);return gC.set(e,n),n}var QH=Object.prototype.toString;function e6(e,t,i){if(ZH[t])return vC(t,e,i);if(t==="[object Date]")return Qi(t,e.getTime());if(t==="[object RegExp]")return Qi(t,e.toString());if(t==="[object Event]")return Qi(t,[e.bubbles,e.cancelBubble,e.cancelable,e.composed,e.currentTarget,e.defaultPrevented,e.eventPhase,e.isTrusted,e.returnValue,e.target,e.type].join());if(t==="[object Error]")return Qi(t,e.message+ou+e.stack);if(t==="[object DocumentFragment]")return Qi(t,r6(e));var n=t.match(VH);return n?Qi("ELEMENT",n[1]+ou+e.outerHTML):BE[t]?Ay(e,t):XH[t]?Qi(t,e.toString()):vC("CUSTOM",e,i)}function vC(e,t,i){var n=i.cache.get(t);return n?Qi(e,"RECURSIVE~"+n):(i.cache.set(t,++i.id),e==="[object Object]"?t[Symbol.iterator]?Ay(t,e):Qi(e,bC(t,i)):YH[e]?Qi(e,t6(t,i)):e==="[object Map]"?Qi(e,a6(t,i)):e==="[object Set]"?Qi(e,s6(t,i)):qH[e]?Qi(e,t.join()):e==="[object ArrayBuffer]"?Qi(e,yC(t)):e==="[object DataView]"?Qi(e,yC(t.buffer)):BE[e]?Ay(t,e):Qi("CUSTOM",bC(t,i)))}function t6(e,t){for(var i=e.length,n=new Array(i);--i>=0;)n[i]=el(e[i],t);return n.join()}function i6(e){return Buffer.from(e).toString("utf8")}function n6(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function o6(){return"UNSUPPORTED"}function r6(e){for(var t=e.children,i=t.length,n=new Array(i);--i>=0;)n[i]=t[i].outerHTML;return n.join()}var yC=typeof Buffer!="undefined"&&typeof Buffer.from=="function"?i6:typeof Uint16Array=="function"?n6:o6;function a6(e,t){var i=new Array(e.size),n=0;for(e.forEach(function(o,r){i[n++]=[el(r,t),el(o,t)]}),Cx(i,KH);--n>=0;)i[n]="["+i[n][0]+","+i[n][1]+"]";return"["+i.join()+"]"}function bC(e,t){for(var i=Cx(Object.getOwnPropertyNames(e),zE),n=i.length,o=new Array(n),r=n;--r>=0;)o[r]=i[r]+":"+el(e[i[r]],t);return"{"+o.join()+"}"}function s6(e,t){var i=new Array(e.size),n=0;return e.forEach(function(o){i[n++]=el(o,t)}),"["+Cx(i,zE).join()+"]"}function el(e,t){var i=typeof e;return e==null||i==="undefined"?Mc.empty+e:i==="object"?e6(e,QH.call(e),t||{cache:new WeakMap,id:1}):i==="function"||i==="symbol"?Mc[i]+e.toString():i==="boolean"?Mc.boolean+ +e:Mc[i]+e}function FE(e){return UH(el(e,void 0))}function Ey(e,t,i){(i!==void 0&&!Ru(e[t],i)||i===void 0&&!(t in e))&&ju(e,t,i)}function WE(e){return Cn(e)&&Fu(e)}var l6="[object Object]",c6=Function.prototype,u6=Object.prototype,HE=c6.toString,d6=u6.hasOwnProperty,h6=HE.call(Object);function $E(e){if(!Cn(e)||jo(e)!=l6)return!1;var t=gx(e);if(t===null)return!0;var i=d6.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&HE.call(i)==h6}function Oy(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function p6(e){return Cl(e,Hu(e))}function f6(e,t,i,n,o,r,u){var _=Oy(e,i),A=Oy(t,i),E=u.get(A);if(E){Ey(e,i,E);return}var H=r?r(_,A,i+"",e,t,u):void 0,q=H===void 0;if(q){var g=_i(A),te=!g&&tu(A),W=!g&&!te&&hx(A);H=A,g||te||W?_i(_)?H=_:WE(_)?H=lf(_):te?(q=!1,H=xE(A,!0)):W?(q=!1,H=SE(A,!0)):H=[]:$E(A)||eu(A)?(H=_,eu(_)?H=p6(_):(!hn(_)||Va(_))&&(H=TE(A))):q=!1}q&&(u.set(A,H),o(H,A,n,r,u),u.delete(A)),Ey(e,i,H)}function Sx(e,t,i,n,o){e!==t&&AE(t,function(r,u){if(o||(o=new Lo),hn(r))f6(e,t,u,i,Sx,n,o);else{var _=n?n(Oy(e,u),r,u+"",e,t,o):void 0;_===void 0&&(_=r),Ey(e,u,_)}},Hu)}function pf(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var xC=Math.max;function UE(e,t,i){return t=xC(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,r=xC(n.length-t,0),u=Array(r);++o<r;)u[o]=n[t+o];o=-1;for(var _=Array(t+1);++o<t;)_[o]=n[o];return _[t]=i(u),pf(e,this,_)}}function m6(e){return function(){return e}}var g6=ep?function(e,t){return ep(e,"toString",{configurable:!0,enumerable:!1,value:m6(t),writable:!0})}:hf,v6=800,y6=16,b6=Date.now;function VE(e){var t=0,i=0;return function(){var n=b6(),o=y6-(n-i);if(i=n,o>0){if(++t>=v6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Tx=VE(g6);function Mx(e,t){return Tx(UE(e,t,hf),e+"")}function GE(e,t,i){if(!hn(i))return!1;var n=typeof t;return(n=="number"?Fu(i)&&Bu(t,i.length):n=="string"&&t in i)?Ru(i[t],e):!1}function YE(e){return Mx(function(t,i){var n=-1,o=i.length,r=o>1?i[o-1]:void 0,u=o>2?i[2]:void 0;for(r=e.length>3&&typeof r=="function"?(o--,r):void 0,u&&GE(i[0],i[1],u)&&(r=o<3?void 0:r,o=1),t=Object(t);++n<o;){var _=i[n];_&&e(t,_,n,r)}return t})}var kx=YE(function(e,t,i){Sx(e,t,i)});function XE(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function qE(e,t,i){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),i=i>o?o:i,i<0&&(i+=o),o=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(o);++n<o;)r[n]=e[n+t];return r}function x6(e,t){return t.length<2?e:df(e,qE(t,0,-1))}function w6(e,t){return t=Sl(t,e),e=x6(e,t),e==null||delete e[Tl(XE(t))]}function _6(e){return $E(e)?void 0:e}var wC=mo?mo.isConcatSpreadable:void 0;function C6(e){return _i(e)||eu(e)||!!(wC&&e&&e[wC])}function ZE(e,t,i,n,o){var r=-1,u=e.length;for(i||(i=C6),o||(o=[]);++r<u;){var _=e[r];i(_)?mx(o,_):n||(o[o.length]=_)}return o}function S6(e){var t=e==null?0:e.length;return t?ZE(e):[]}function ff(e){return Tx(UE(e,void 0,S6),e+"")}var T6=1,M6=2,k6=4,mf=ff(function(e,t){var i={};if(e==null)return i;var n=!1;t=Uu(t,function(r){return r=Sl(r,e),n||(n=r.length>1),r}),Cl(e,vx(e),i),n&&(i=Gs(i,T6|M6|k6,_6));for(var o=t.length;o--;)w6(i,t[o]);return i});let Vu=class extends lx{constructor(t,i){super(uE,{key:t,interpolationOptions:i},Tz.t)}};class gf{constructor(t,i,n,o,r){this._name=t,this.type=i,this.description=n||"",o&&(this._dataSource=o),r&&(this.composeCode=r)}get name(){return this._name}set name(t){this._name=t}get dataSource(){return this._dataSource}serialize(){return{name:this.name,type:this.type,description:this.description,dataSource:this.dataSource,composeCode:this.composeCode,__serializable:"DimensionalElement"}}toJSON(){return this.serialize()}toString(){return this.jaql()}}function Jr(e){let t=e.replace(/[^a-zA-Z0-9_.]/g,"").replace(/\./g,"_");return t.charAt(0).match(/[0-9]/)&&(t="_"+t),t}const Px="DM",Nt={Sum:"sum",Average:"avg",Min:"min",Max:"max",Count:"count",CountDistinct:"countDistinct",Median:"median",Variance:"var",StandardDeviation:"stdev"};exports.Sort=void 0;(function(e){e[e.None=0]="None",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"})(exports.Sort=exports.Sort||(exports.Sort={}));const Lt={Measure:"measure",MeasureTemplate:"measuretemplate",BaseMeasure:"basemeasure",CalculatedMeasure:"calculatedmeasure",Dimension:"dimension",DateDimension:"datedimension",TextDimension:"textdimension",NumericDimension:"numericdimension",DateLevel:"datelevel",Attribute:"attribute",TextAttribute:"text-attribute",NumericAttribute:"numeric-attribute",Filter:"filter",DimensionFilter:"dimensionfilter",MeasureFilter:"measurefilter",isMetadata(e){return Lt.isMeasure(e)||Lt.isDimension(e)||Lt.isAttribute(e)||Lt.isFilter(e)},isMeasureTemplate(e){return e?typeof e=="string"?e.toLowerCase()===Lt.MeasureTemplate:e.agg==="*"||e.aggregation==="*"||e.type&&e.type.toLowerCase()===Lt.MeasureTemplate:!1},isBaseMeasure(e){return e?typeof e=="string"?e.toLowerCase()===Lt.BaseMeasure:(e.agg||e.aggregation)&&(e.attribute||e.jaql)&&!this.isMeasureTemplate(e):!1},isMeasure(e){if(!e)return!1;if(typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Measure||t.toLowerCase()===Lt.BaseMeasure||t.toLowerCase()===Lt.MeasureTemplate||t.toLowerCase()===Lt.CalculatedMeasure}return this.isBaseMeasure(e)||this.isCalculatedMeasure(e)||this.isMeasureTemplate(e)},isCalculatedMeasure(e){return e?typeof e=="string"?e.toLowerCase()===Lt.CalculatedMeasure:(e.expression||e.formula)&&e.context:!1},isDateDimension(e){return e?typeof e=="string"?e.toLowerCase()===Lt.DateDimension:(e.dim||e.expression)&&e.level:!1},isTextDimension(e){return e&&typeof e=="string"?e.toLowerCase()===Lt.TextDimension:!1},isNumericDimension(e){return e&&typeof e=="string"?e.toLowerCase()===Lt.NumericDimension:!1},isDimension(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===Lt.DateDimension||t.toLowerCase()===Lt.Dimension||t.toLowerCase()===Lt.TextDimension||t.toLowerCase()===Lt.NumericDimension}return!1},isAttribute(e){if(typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Attribute||t.toLowerCase()===Lt.TextAttribute||t.toLowerCase()===Lt.NumericAttribute||t.toLowerCase()===Lt.DateLevel}return e&&e.type?this.isAttribute(e.type):!1},isFilter(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===Lt.Filter||t.toLowerCase()===Lt.DimensionFilter||t.toLowerCase()===Lt.MeasureFilter}return!1}},it={Years:"Years",Quarters:"Quarters",Months:"Months",Weeks:"Weeks",Days:"Days",Hours:"Hours",MinutesRoundTo30:"MinutesRoundTo30",MinutesRoundTo15:"MinutesRoundTo15",Minutes:"Minutes",Seconds:"Seconds",AggHours:"AggHours",AggMinutesRoundTo30:"AggMinutesRoundTo30",AggMinutesRoundTo15:"AggMinutesRoundTo15",AggMinutesRoundTo1:"AggMinutesRoundTo1",get all(){return[it.Years,it.Quarters,it.Months,it.Weeks,it.Days,it.Hours,it.MinutesRoundTo30,it.MinutesRoundTo15,it.Minutes,it.Seconds,it.AggHours,it.AggMinutesRoundTo30,it.AggMinutesRoundTo15,it.AggMinutesRoundTo1]}};var Th;(function(e){e.TEXT="text",e.NUMERIC="numeric",e.DATETIME="datetime"})(Th=Th||(Th={}));var zc;(function(e){e.ASC="asc",e.DESC="desc"})(zc=zc||(zc={}));var hg;(function(e){e.PRE="pre",e.POST="post"})(hg=hg||(hg={}));function Ly(e,t=[]){try{return e==null?String(e):typeof e=="string"?`'${oE(e)}'`:typeof e=="number"||typeof e=="boolean"?String(e):e instanceof Date?`new Date('${e.toISOString()}')`:Array.isArray(e)?`[${e.map(i=>Ly(i,t)).join(", ")}]`:typeof e=="object"&&e!==null?"composeCode"in e?e.composeCode:`{ ${Object.entries(e).filter(([n])=>!t.includes(n)).map(([n,o])=>`${/[^a-zA-Z0-9_$]/.test(n)?`'${n}'`:n}: ${Ly(o,t)}`).join(", ")} }`:JSON.stringify(e)}catch(i){return console.error(i,JSON.stringify(e,null,2)),JSON.stringify(e)}}function P6(e){let t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return e.slice(0,t)}function vf(e,t){return function(i){return function(...n){const o=P6(n),r=o.length,u=o.map(E=>Ly(E,["guid"])).filter((E,H)=>!(["","{ }","[]","undefined","null"].includes(E)&&H===r-1)).join(", "),_=`${e}.${t!=null?t:i.name}(${u})`,A=i(...n);return A.composeCode=_,A}}}function Wt(e,t){return vf("filterFactory",t)(e)}function _C(e,t){return vf("filterFactory.logic",t)(e)}function A6(e,t){return vf("analyticsFactory",t)(e)}function yo(e,t){return vf("measureFactory",t)(e)}function E6(e,t,i){if(typeof i=="number")e.push(i.toString());else if(i&&Lt.isMeasureTemplate(i.type)){i=i.sum();const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isMeasure(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isFilter(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}else if(i&&Lt.isAttribute(i.type)){const n=`[${Jr(i.name)}]`;e.push(n),t[n]=i}}function KE(e,t,i,n){const o={},r=[i+"("];return E6(r,o,e),n&&r.push(`, ${n}`),r.push(")"),new tl(t,r.join(""),o)}const JE=yo((e,t,i)=>{const n=Object.fromEntries(Object.entries(i).map(([o,r])=>[o.startsWith("[")?o:`[${o}]`,r]));return new tl(e,t,n)},"customFormula"),lr=yo((e,t,i,n)=>new na(i!=null?i:`${t.toString()} ${e.name}`,e,t,n),"aggregate"),Ny=yo((e,t,i)=>lr(e,Nt.Sum,t,i),"sum"),O6=yo((e,t,i)=>lr(e,Nt.Average,t,i),"average"),L6=yo((e,t,i)=>lr(e,Nt.Average,t,i),"avg"),QE=yo((e,t,i)=>lr(e,Nt.Min,t,i),"min"),Ax=yo((e,t,i)=>lr(e,Nt.Max,t,i),"max"),Dy=yo((e,t,i)=>lr(e,Nt.Median,t,i),"median"),eO=yo((e,t,i)=>lr(e,Nt.Count,t,i),"count"),Ex=yo((e,t,i)=>lr(e,Nt.CountDistinct,t,i),"countDistinct"),N6=yo((e,t,i)=>{let n;const o=r=>r.replace("advancedSmoothing","smooth").replace("localEstimates","local");return i&&(n=Object.entries(i).map(r=>o(`"${r[0]}=${r[1]}"`)).join(",")),KE(e,t!=null?t:e.name+" Trend","trend",n)},"trend"),D6=yo((e,t,i)=>{let n;if(i){const o=Object.assign({forecastHorizon:3},i);if(o.startDate){const r=new Date(o.startDate);o.startDate=r.toISOString().replace(/.\d+Z$/g,"")}if(o.endDate){const r=new Date(o.endDate);o.endDate=r.toISOString().replace(/.\d+Z$/g,"")}n=Object.entries(o).map(r=>`"${r[0]}=${r[1]}"`).join(",")}else n='"forecastHorizon=3"';return KE(e,t!=null?t:e.name+" Forecast","forecast",n)},"forecast");class Ox extends gf{constructor(t,i,n,o,r,u,_){super(t,i,o,u,_),this._sort=exports.Sort.None,this._format="#,#.00",this._format=n,this._sort=r||exports.Sort.None}getSort(){return this._sort}getFormat(){return this._format}serialize(){const t=super.serialize();return this.getFormat()!==void 0&&(t.format=this.getFormat()),this.getSort()!==void 0&&(t.sort=this.getSort()),t}}class na extends Ox{constructor(t,i,n,o,r,u,_,A){super(t,Lt.BaseMeasure,o,r,u,_,A),this.attribute=i,this.aggregation=n}static aggregationFromJAQL(t){switch(t){case"sum":return Nt.Sum;case"avg":return Nt.Average;case"min":return Nt.Min;case"max":return Nt.Max;case"countduplicates":return Nt.Count;case"median":return Nt.Median;case"count":return Nt.CountDistinct;case"var":return Nt.Variance;case"stdev":return Nt.StandardDeviation}return Nt.Sum}static aggregationToJAQL(t){switch(t){case Nt.Sum:return"sum";case Nt.Average:return"avg";case Nt.Min:return"min";case Nt.Max:return"max";case Nt.Count:return"countduplicates";case Nt.CountDistinct:return"count";case Nt.Median:return"median";case Nt.Variance:return"var";case Nt.StandardDeviation:return"stdev"}return Nt.Sum}sort(t){return new na(this.name,this.attribute,this.aggregation,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new na(this.name,this.attribute,this.aggregation,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return`${this.attribute.expression}_${this.aggregation}`}serialize(){const t=super.serialize();return t.__serializable="DimensionalBaseMeasure",t.aggregation=this.aggregation,t.attribute=this.attribute.serialize(),t}jaql(t){const i=this.attribute.jaql(!0),n={jaql:Object.assign(Object.assign({},i),{title:this.name,agg:na.aggregationToJAQL(this.aggregation)})};return this._format&&(n.format={number:this._format}),this._sort!=exports.Sort.None&&(n.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?n.jaql:n}}class tl extends Ox{constructor(t,i,n,o,r,u,_,A){super(t,Lt.CalculatedMeasure,o,r,u,_,A),this.expression=i,this.context=n}sort(t){return new tl(this.name,this.expression,this.context,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new tl(this.name,this.expression,this.context,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return this.expression}serialize(){const t=super.serialize();return t.__serializable="DimensionalCalculatedMeasure",t.expression=this.expression,t.context=Object.fromEntries(Object.entries(this.context).map(([i,n])=>[i,n.serialize?n.serialize(n):n])),t}jaql(t){const i={jaql:{title:this.name,formula:this.expression}},n={};return Object.getOwnPropertyNames(this.context).forEach(r=>n[r]=this.context[r].jaql(!0)),i.jaql.context=n,this._format&&(i.format={number:this._format}),this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}}class op extends Ox{constructor(t,i,n,o,r,u,_){super(t,Lt.MeasureTemplate,n,o,r,u,_),this.attribute=i}get id(){return`${this.attribute.expression}_*`}serialize(){const t=super.serialize();return t.__serializable="DimensionalMeasureTemplate",t.attribute=this.attribute.serialize(),t}sort(t){return new op(this.name,this.attribute,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new op(this.name,this.attribute,t,this.description,this._sort,this.dataSource,this.composeCode)}jaql(t){return this.sum().sort(this._sort).jaql(t)}sum(t){return Ny(this.attribute,t).sort(this._sort)}average(t){return O6(this.attribute,t).sort(this._sort)}median(t){return Dy(this.attribute,t).sort(this._sort)}min(t){return Dy(this.attribute,t).sort(this._sort)}max(t){return Ax(this.attribute,t).sort(this._sort)}count(t){return eO(this.attribute,t).sort(this._sort)}countDistinct(t){return Ex(this.attribute,t).sort(this._sort)}}function tO(e,t){return $u(e,t)}const yf=()=>({guid:IO(13),disabled:!1,locked:!1}),iO=()=>Object.assign(Object.assign({},yf()),{excludeMembers:!1,enableMultiSelection:!0,deactivatedMembers:[]});function I6(e){return"excludeMembers"in e}const nO=e=>{const t=I6(e)?iO():yf();return Object.fromEntries(Object.entries(e).filter(([i,n])=>!tO(n,t[i])))},fr={Contains:"contains",StartsWith:"startsWith",EndsWith:"endsWith",Equals:"equals",DoesntEqual:"doesntEqual",DoesntStartWith:"doesntStartWith",DoesntContain:"doesntContain",DoesntEndWith:"doesntEndWith",Like:"like"},pn={Equals:"equals",DoesntEqual:"doesntEqual",From:"from",FromNotEqual:"fromNotEqual",To:"to",ToNotEqual:"toNotEqual"},il={From:"from",To:"to",Last:"last",Next:"next",Anchor:"Anchor"},oO={Union:"or",Intersection:"and",Exclude:"exclude"},Lx={Top:"top",Bottom:"bottom"},Di={logicalAttribute:"logicalAttribute",members:"members",exclude:"exclude",measure:"measure",ranking:"ranking",text:"text",numeric:"numeric",dateRange:"dateRange",relativeDate:"relativeDate",cascading:"cascading",advanced:"advanced"};class Xn extends gf{constructor(t,i,n,o){super("filter",Lt.Filter,void 0,void 0,o),this.filterType=i,this.isScope=!0,Xn.checkAttributeSupport(t),this.attribute=t,this.config=kx({},yf(),n!=null?n:{})}get name(){return FE(this.jaql()).toString(16)}serialize(){const t=super.serialize();return t.__serializable="AbstractFilter",t.filterType=this.filterType,t.attribute=this.attribute.serialize(),this.config&&(t.config=this.config),t.composeCode=this.composeCode,t}jaql(t){if(this.config.disabled)return Xn.disabledJaql(t);const i=this.attribute.jaql(!1),n=this.attribute;if(n.getFormat&&n.getFormat()!==void 0){const o=n.translateGranularityToJaql();i.format={mask:{[o.level]:n.getFormat()}}}return i.jaql.filter=this.filterJaql(),this.attribute.dataSource&&(i.jaql.datasource=this.attribute.dataSource),this.isScope&&(i.panel="scope"),t===!0?i.jaql:i}static checkAttributeSupport(t){const{granularity:i}=t;if(i===it.Hours||i===it.MinutesRoundTo30||i===it.MinutesRoundTo15||i===it.Minutes||i===it.Seconds)throw new Vu("errors.filter.unsupportedDatetimeLevel")}static disabledJaql(t){return t?{filter:{}}:{jaql:{filter:{}}}}}class Nx extends Xn{constructor(t,i,n,o){super(t[0].attribute,Di.logicalAttribute,n,o),this.operator=i,this.filters=t}get id(){return`${this.operator}_${this.filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="LogicalAttributeFilter",t.operator=this.operator,t.filters=this.filters.map(i=>i.serialize()),t}filterJaql(){const t={};return t[this.operator]=this.filters.map(i=>i.filterJaql()),t}}class rO extends Xn{constructor(t,i,n,o){if(super(t,Di.members,void 0,o),this.members=i!=null?i:[],this.members.filter(r=>r==null).length>0)throw new Vu("errors.filter.membersFilterNullMember",{attributeId:t.id});this.config=kx({},iO(),n!=null?n:{})}get id(){return`${this.attribute.id}_${this.members.map(t=>t.toString()).join()}`}get name(){return FE([this.jaql(),mf(this.config,["guid","originalFilterJaql"])]).toString(16)}serialize(){const t=super.serialize();return t.__serializable="MembersFilter",this.config&&(t.config=this.config.backgroundFilter?Object.assign(Object.assign({},this.config),{backgroundFilter:this.config.backgroundFilter.serialize()}):this.config),t.members=this.members,t}filterJaql(){const t={members:this.members.map(n=>n.toString())},i=this.config.excludeMembers?{exclude:t}:t;return this.config.backgroundFilter?{and:[i,this.config.backgroundFilter.filterJaql()]}:i}}class aO extends Xn{constructor(t,i,n){super(t[0].attribute,Di.cascading,i,n),this._filters=t}get filters(){const{disabled:t,locked:i}=this.config;return this._filters.map(n=>(n.config=Object.assign(Object.assign({},n.config),{disabled:t,locked:i}),n))}get id(){return`${this.filterType}_${this._filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="CascadingFilter",t._filters=this.filters.map(i=>i.serialize()),t}filterJaql(){return{}}jaql(t){return this.config.disabled?Xn.disabledJaql(t):this.filters.map(i=>(i.isScope=!0,i.jaql(t)))}}class sO extends Xn{constructor(t,i,n,o){super(t.attribute,Di.exclude,n,o),this.input=i,this.filter=t}get id(){let t=`exclude_${this.filter.id}`;return this.input&&(t+="_from_"+this.input.id),t}serialize(){const t=super.serialize();return t.__serializable="ExcludeFilter",t.filter=this.filter.serialize(),this.input&&(t.input=this.input.serialize()),t}filterJaql(){const t={},i=this.filter.filterJaql();return this.input?(t.filter=this.input.filterJaql(),t.filter.filter={exclude:i}):t.exclude=i,t}}class bf extends Xn{constructor(t,i,n,o,r,u,_,A){super(t,i,_,A),n&&o!==void 0&&(this.valueA=o,this.operatorA=n),r&&u!==void 0&&(this.operatorB=r,this.valueB=u)}get id(){let t=`${this.attribute.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}:${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="DoubleOperatorFilter",this.operatorA&&(t.operatorA=this.operatorA),this.operatorB&&(t.operatorB=this.operatorB),this.valueA!==void 0&&(t.valueA=this.valueA),this.valueB!==void 0&&(t.valueB=this.valueB),t}filterJaql(){const t={};return this.operatorA&&this.valueA!==void 0&&(t[this.operatorA]=this.valueA),this.operatorB&&this.valueB!==void 0&&(t[this.operatorB]=this.valueB),t}}class lO extends bf{constructor(t,i,n,o,r,u,_,A){super(t,Di.measure,n,o,r,u,_,A),this.measure=i}get id(){let t=`${this.attribute.id}_${this.measure.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="MeasureFilter",t.measure=this.measure.serialize(),t}jaql(t){if(this.config.disabled)return Xn.disabledJaql(t);const i=super.jaql(t);return this.measure instanceof na&&Object.entries(this.measure.jaql().jaql).forEach(([n,o])=>{i.jaql[n]=o}),i}}class Dx extends Xn{constructor(t,i,n,o,r,u){super(t,Di.ranking,r,u),this.count=o,this.operator=n,this.measure=i}get id(){return`${this.operator}_${this.count}_${this.attribute.id}_by_${this.measure.id}`}serialize(){const t=super.serialize();return t.__serializable="RankingFilter",t.count=this.count,t.operator=this.operator,t.measure=this.measure.serialize(),t}filterJaql(){const t={};return t[this.operator]=this.count,t.by=this.measure.jaql(!0),t}}class cO extends bf{constructor(t,i,n,o,r,u,_){super(t,Di.numeric,i,n,o,r,u,_)}serialize(){const t=super.serialize();return t.__serializable="NumericFilter",t}}class mr extends bf{constructor(t,i,n,o,r){super(t,Di.text,i,n,void 0,void 0,o,r)}serialize(){const t=super.serialize();return t.__serializable="TextFilter",t}}class uO extends bf{constructor(t,i,n,o,r){super(t,Di.dateRange,il.From,i,il.To,n,o,r),typeof i=="object"&&(this.valueA=i.toISOString()),typeof n=="object"&&(this.valueB=n.toISOString())}get level(){return this.attribute}get from(){return this.valueA}get to(){return this.valueB}filterJaql(){return super.filterJaql()}serialize(){const t=super.serialize();return t.__serializable="DateRangeFilter",t}}class xf extends Xn{constructor(t,i,n,o,r,u,_){super(t,Di.relativeDate,u,_),o||(o=il.Next),this.anchor=r,this.operator=o,this.offset=i,this.count=n}get level(){return this.attribute}get id(){let t=`${this.level.id}_${this.operator}_${this.offset}_${this.count}`;return this.anchor&&(typeof this.anchor=="string"?t+=`_${this.anchor}`:typeof this.anchor=="object"&&(t+=`_${this.anchor.toISOString()}`)),t}serialize(){const t=super.serialize();return t.__serializable="RelativeDateFilter",t.offset=this.offset,t.count=this.count,t.operator=this.operator,this.anchor&&(t.anchor=typeof this.anchor=="string"?this.anchor:this.anchor.toISOString()),t}filterJaql(){const t={};return t[this.operator]={offset:this.offset,count:this.count},this.anchor&&(typeof this.anchor=="string"?t[this.operator].anchor=this.anchor:typeof this.anchor=="object"&&(t[this.operator].anchor=this.anchor.toISOString())),t}}class dO extends Xn{constructor(t,i,n,o){super(t,Di.advanced,n,o),delete i.filterType,this.jaqlExpression=i}get id(){return`custom_${this.attribute.id}_${this.config.guid}`}filterJaql(){return this.jaqlExpression}serialize(){const t=super.serialize();return t.__serializable="CustomFilter",t.jaqlExpression=this.jaqlExpression,t}}function R6(e){return"filterType"in e&&e.filterType===Di.advanced}function j6(e){return"filterType"in e&&e.filterType===Di.members}function B6(e){return"filterType"in e&&e.filterType===Di.numeric}function z6(e){return"filterType"in e&&e.filterType===Di.ranking}function F6(e){return"filterType"in e&&e.filterType===Di.measure}function hO(e){return"filterType"in e&&e.filterType===Di.cascading}function W6(e){return"filterType"in e&&e.filterType===Di.relativeDate}function H6(e){return"filterType"in e&&e.filterType===Di.text}function $6(e){return"filterType"in e&&e.filterType===Di.dateRange}const U6=Wt((e,t)=>new Nx(e,oO.Union,t),"union"),V6=Wt((e,t)=>new Nx(e,oO.Intersection,t),"intersection"),Ix=Wt((e,t,i)=>new sO(e,t,i),"exclude"),pO=Wt((e,t,i)=>new mr(e,fr.DoesntContain,t,i),"doesntContain"),fO=Wt((e,t,i)=>new mr(e,fr.DoesntEndWith,t,i),"doesntEndWith"),mO=Wt((e,t,i)=>new mr(e,fr.DoesntStartWith,t,i),"doesntStartWith"),gO=Wt((e,t,i)=>new mr(e,fr.Contains,t,i),"contains"),vO=Wt((e,t,i)=>new mr(e,fr.EndsWith,t,i),"endsWith"),yO=Wt((e,t,i)=>new mr(e,fr.StartsWith,t,i),"startsWith"),G6=Wt((e,t,i)=>new mr(e,fr.Like,t,i),"like"),bO=Wt((e,t,i)=>typeof t=="string"?new mr(e,fr.DoesntEqual,t,i):ns(e,pn.DoesntEqual,t,void 0,void 0,i),"doesntEqual"),xO=Wt((e,t,i)=>typeof t=="string"?new mr(e,fr.Equals,t,i):ns(e,pn.Equals,t,void 0,void 0,i),"equals"),wO=Wt((e,t,i)=>ns(e,pn.FromNotEqual,t,void 0,void 0,i),"greaterThan"),_O=Wt((e,t,i)=>ns(e,pn.From,t,void 0,void 0,i),"greaterThanOrEqual"),CO=Wt((e,t,i)=>ns(e,pn.ToNotEqual,t,void 0,void 0,i),"lessThan"),SO=Wt((e,t,i)=>ns(e,pn.To,t,void 0,void 0,i),"lessThanOrEqual"),rp=Wt((e,t,i,n)=>ns(e,pn.From,t,pn.To,i,n),"between"),ns=Wt((e,t,i,n,o,r)=>new cO(e,t,i,n,o,r),"numeric"),wf=Wt((e,t,i)=>new rO(e,t,i),"members"),TO=Wt((e,t,i,n)=>new uO(e,t,i,n),"dateRange"),Y6=Wt((e,t,i,n,o)=>new xf(e,t,i,void 0,n,o),"dateRelative"),MO=Wt((e,t,i,n,o)=>new xf(e,t,i,il.Next,n,o),"dateRelativeFrom"),kO=Wt((e,t,i,n,o)=>new xf(e,t,i,il.Last,n,o),"dateRelativeTo");function Ml(e,t,i,n,o,r,u){return new lO(e,t,i,n,o,r,u)}const X6=Wt((e,t,i)=>Ml(e.attribute,e,pn.Equals,t,void 0,void 0,i),"measureEquals"),q6=Wt((e,t,i)=>Ml(e.attribute,e,pn.FromNotEqual,t,void 0,void 0,i),"measureGreaterThan"),Z6=Wt((e,t,i)=>Ml(e.attribute,e,pn.From,t,void 0,void 0,i),"measureGreaterThanOrEqual"),K6=Wt((e,t,i)=>Ml(e.attribute,e,pn.To,t,void 0,void 0,i),"measureLessThanOrEqual"),J6=Wt((e,t,i)=>Ml(e.attribute,e,pn.ToNotEqual,t,void 0,void 0,i),"measureLessThan"),CC=Wt((e,t,i,n)=>Ml(e.attribute,e,pn.From,t,pn.To,i,n),"measureBetween"),PO=Wt((e,t,i,n)=>new Dx(e,t,Lx.Top,i,n),"topRanking"),AO=Wt((e,t,i,n)=>new Dx(e,t,Lx.Bottom,i,n),"bottomRanking"),za=e=>{if(Array.isArray(e)){const[t,...i]=e;return i.length===0?za(t):{operator:"AND",left:za(t),right:za(i)}}return e},Q6=Wt((e,t)=>new aO(e,t),"cascading");exports.logic=void 0;(function(e){e.and=_C((t,i)=>({operator:"AND",left:za(t),right:za(i)}),"and"),e.or=_C((t,i)=>({operator:"OR",left:za(t),right:za(i)}),"or")})(exports.logic=exports.logic||(exports.logic={}));const e$=Wt((e,t,i)=>new dO(e,t,i),"customFilter"),t$=e=>{const{dim:t,datatype:i,title:n,datasource:o}=e;return Cf({expression:t,dataType:i,granularity:ru(e),title:n,dataSource:o})},i$=e=>{const{dim:t,title:i,datatype:n,agg:o,datasource:r}=e;if(o)return Sf({expression:t,dataType:n,agg:o,granularity:ru(e),format:void 0,sort:void 0,title:i,dataSource:r})},SC=(e,t)=>{if("formula"in e)return Bx(e);const{dim:i,datatype:n,agg:o}=e;return Sf({expression:i,granularity:ru(e),dataType:n,agg:o,format:void 0,sort:void 0,title:t})};var Mh;(function(e){e.INCLUDE_ALL="INCLUDE_ALL",e.ADVANCED="ADVANCED",e.INVALID="INVALID",e.CONDITION="CONDITION",e.SPECIFIC_ITEMS="SPECIFIC_ITEMS"})(Mh=Mh||(Mh={}));var kh;(function(e){e.PERIOD="PERIOD",e.DATE_RANGE="DATE_RANGE"})(kh=kh||(kh={}));var Ph;(function(e){e.NUMERIC_RANGE="NUMERIC_RANGE"})(Ph=Ph||(Ph={}));var oa;(function(e){e.YEARS="years",e.QUARTERS="quarters",e.MONTHS="months",e.WEEKS="weeks",e.DAYS="days",e.HOURS="hours",e.MINUTES="minutes"})(oa=oa||(oa={}));var Ys;(function(e){e.DATE_TIME="datetime",e.NUMERIC="numeric",e.TEXT="text"})(Ys=Ys||(Ys={}));const n$=["1","30"],Ut=Object.assign(Object.assign(Object.assign({},Mh),kh),Ph),o$={[Ut.INCLUDE_ALL]:{all:!0,filterType:Ut.INCLUDE_ALL},[Ut.PERIOD]:{last:{count:1,offset:1},isNotCurrentPeriod:!0,filterType:Ut.PERIOD},[Ut.DATE_RANGE]:{filterType:Ut.DATE_RANGE},[Ut.NUMERIC_RANGE]:{filterType:Ut.NUMERIC_RANGE},[Ut.CONDITION]:{explicit:!1,multiSelection:!0,exclude:{members:[]},filterType:Ut.CONDITION},[Ut.SPECIFIC_ITEMS]:{explicit:!0,multiSelection:!0,members:[],filterType:Ut.SPECIFIC_ITEMS}},r$={filter:o$.INCLUDE_ALL,level:oa.YEARS};exports.ConditionFilterType=void 0;(function(e){e.IS="members",e.IS_NOT="exclude",e.IS_WITHIN="isWithin",e.TOP="top",e.BOTTOM="bottom",e.AFTER="after",e.BEFORE="before",e.STARTS_WITH="startsWith",e.DOESNT_START_WITH="doesntStartWith",e.ENDS_WITH="endsWith",e.DOESNT_END_WITH="doesntEndWith",e.CONTAINS="contains",e.DOESNT_CONTAIN="doesntContain",e.EQUALS="equals",e.DOESNT_EQUAL="doesntEqual",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.GREATER_THAN="fromNotEqual",e.GREATER_THAN_OR_EQUAL="from",e.LESS_THAN="toNotEqual",e.LESS_THAN_OR_EQUAL="to",e.BETWEEN="between",e.IS_NOT_BETWEEN="isNotBetween",e.MULTIPLE_CONDITION="multipleCondition",e.NONE="none"})(exports.ConditionFilterType=exports.ConditionFilterType||(exports.ConditionFilterType={}));const a$=e=>e.top!==void 0,s$=e=>e.bottom!==void 0,l$=e=>{var t;return!!(!((t=e.exclude)===null||t===void 0)&&t.members)},c$=e=>!!e.members&&!!e.isCondition,u$=e=>{var t,i;return((t=e.last)===null||t===void 0?void 0:t.anchor)!==void 0||((i=e.next)===null||i===void 0?void 0:i.anchor)!==void 0},d$=e=>e.fromNotEqual!==void 0,h$=e=>e.from!==void 0&&!e.isBetween,p$=e=>e.toNotEqual!==void 0,f$=e=>e.to!==void 0&&!e.isBetween,m$=e=>e.equals!==void 0,g$=e=>e.doesntEqual!==void 0,v$=e=>!!(e.equals===""&&e.isEmpty),y$=e=>!!(e.doesntEqual===""&&e.isEmpty),b$=e=>e.contains!==void 0,x$=e=>e.doesntContain!==void 0,w$=e=>e.startsWith!==void 0,_$=e=>e.doesntStartWith!==void 0,C$=e=>e.endsWith!==void 0,S$=e=>e.doesntEndWith!==void 0,T$=e=>e.from!==void 0&&e.to!==void 0,M$=e=>{var t,i;return((t=e.exclude)===null||t===void 0?void 0:t.from)!==void 0&&((i=e.exclude)===null||i===void 0?void 0:i.to)!==void 0},k$=e=>!!(e.or||e.and),_f=e=>s$(e)?exports.ConditionFilterType.BOTTOM:a$(e)?exports.ConditionFilterType.TOP:l$(e)?exports.ConditionFilterType.IS_NOT:u$(e)?exports.ConditionFilterType.IS_WITHIN:d$(e)?exports.ConditionFilterType.GREATER_THAN:p$(e)?exports.ConditionFilterType.LESS_THAN:m$(e)?exports.ConditionFilterType.EQUALS:g$(e)?exports.ConditionFilterType.DOESNT_EQUAL:v$(e)?exports.ConditionFilterType.IS_EMPTY:y$(e)?exports.ConditionFilterType.IS_NOT_EMPTY:b$(e)?exports.ConditionFilterType.CONTAINS:x$(e)?exports.ConditionFilterType.DOESNT_CONTAIN:S$(e)?exports.ConditionFilterType.DOESNT_END_WITH:_$(e)?exports.ConditionFilterType.DOESNT_START_WITH:C$(e)?exports.ConditionFilterType.ENDS_WITH:w$(e)?exports.ConditionFilterType.STARTS_WITH:M$(e)?exports.ConditionFilterType.IS_NOT_BETWEEN:c$(e)?exports.ConditionFilterType.IS:k$(e)?exports.ConditionFilterType.MULTIPLE_CONDITION:T$(e)?exports.ConditionFilterType.BETWEEN:h$(e)?exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:f$(e)?exports.ConditionFilterType.LESS_THAN_OR_EQUAL:exports.ConditionFilterType.NONE,Iy=(e,t,i)=>{var n,o,r,u,_,A,E;switch(_f(t)){case exports.ConditionFilterType.BOTTOM:if(t.by)return AO(e,SC(t.by,t.rankingMessage),t[exports.ConditionFilterType.BOTTOM],{guid:i});break;case exports.ConditionFilterType.EQUALS:return xO(e,t[exports.ConditionFilterType.EQUALS],{guid:i});case exports.ConditionFilterType.DOESNT_EQUAL:return bO(e,t[exports.ConditionFilterType.DOESNT_EQUAL],{guid:i});case exports.ConditionFilterType.GREATER_THAN:return wO(e,t[exports.ConditionFilterType.GREATER_THAN],{guid:i});case exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:return _O(e,t[exports.ConditionFilterType.GREATER_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.TOP:if(t.by)return PO(e,SC(t.by,t.rankingMessage),t[exports.ConditionFilterType.TOP],{guid:i});break;case exports.ConditionFilterType.STARTS_WITH:return yO(e,t[exports.ConditionFilterType.STARTS_WITH],{guid:i});case exports.ConditionFilterType.DOESNT_START_WITH:return mO(e,t[exports.ConditionFilterType.DOESNT_START_WITH],{guid:i});case exports.ConditionFilterType.ENDS_WITH:return vO(e,t[exports.ConditionFilterType.ENDS_WITH],{guid:i});case exports.ConditionFilterType.DOESNT_END_WITH:return fO(e,t[exports.ConditionFilterType.DOESNT_END_WITH],{guid:i});case exports.ConditionFilterType.CONTAINS:return gO(e,t[exports.ConditionFilterType.CONTAINS],{guid:i});case exports.ConditionFilterType.DOESNT_CONTAIN:return pO(e,t[exports.ConditionFilterType.DOESNT_CONTAIN],{guid:i});case exports.ConditionFilterType.LESS_THAN:return CO(e,t[exports.ConditionFilterType.LESS_THAN],{guid:i});case exports.ConditionFilterType.LESS_THAN_OR_EQUAL:return SO(e,t[exports.ConditionFilterType.LESS_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.BETWEEN:return rp(e,t.from,t.to,{guid:i});case exports.ConditionFilterType.IS_NOT_BETWEEN:return Ix(rp(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(o=t.exclude)===null||o===void 0?void 0:o.to,{guid:i}),void 0,{guid:i});case exports.ConditionFilterType.MULTIPLE_CONDITION:if(t.and)return V6(t.and.map(q=>Iy(e,q,i)),{guid:i});if(t.or)return U6(t.or.map(q=>Iy(e,q,i)),{guid:i});break;case exports.ConditionFilterType.IS_NOT:{const q=((r=t.filter)===null||r===void 0?void 0:r.turnedOff)&&((u=t.filter.exclude)===null||u===void 0?void 0:u.members)||[],g=((A=(_=t.exclude)===null||_===void 0?void 0:_.members)===null||A===void 0?void 0:A.filter(W=>!q.includes(W)))||[],te=nO({guid:i,excludeMembers:!0,enableMultiSelection:(E=t.multiSelection)!==null&&E!==void 0?E:!0,deactivatedMembers:q});return wf(e,g,te)}}throw new Vu("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},P$=(e,t,i)=>{var n,o;switch(_f(t)){case exports.ConditionFilterType.EQUALS:return X6(e,t[exports.ConditionFilterType.EQUALS],{guid:i});case exports.ConditionFilterType.GREATER_THAN:return q6(e,t[exports.ConditionFilterType.GREATER_THAN],{guid:i});case exports.ConditionFilterType.GREATER_THAN_OR_EQUAL:return Z6(e,t[exports.ConditionFilterType.GREATER_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.LESS_THAN:return J6(e,t[exports.ConditionFilterType.LESS_THAN],{guid:i});case exports.ConditionFilterType.LESS_THAN_OR_EQUAL:return K6(e,t[exports.ConditionFilterType.LESS_THAN_OR_EQUAL],{guid:i});case exports.ConditionFilterType.BETWEEN:return CC(e,t.from,t.to,{guid:i});case exports.ConditionFilterType.IS_NOT_BETWEEN:return Ix(CC(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(o=t.exclude)===null||o===void 0?void 0:o.to,{guid:i}),void 0,{guid:i})}throw new Vu("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},A$=(e,t)=>{let i=e?e.toLocaleLowerCase():oa.YEARS;return i===oa.MINUTES&&t==="60"&&(i=oa.HOURS),i},E$=e=>e==null?void 0:e.all,O$=e=>e.last?e.last:e.next,L$=e=>{var t;return((t=O$(e))===null||t===void 0?void 0:t.offset)<2},EO=e=>{var t;return((t=e==null?void 0:e.members)===null||t===void 0?void 0:t.length)>=0},N$=(e,t)=>e&&typeof e=="string"||t&&typeof t=="string",D$=(e,t)=>e===""&&t==="",I$=(e,t)=>{const{from:i,to:n}=e;return t!==Ys.DATE_TIME?!1:N$(i,n)?!0:D$(i,n)},R$=e=>{const{from:t,to:i}=e;return t!==void 0&&i!==void 0&&!e.isBetween},OO=e=>_f(e)!==exports.ConditionFilterType.NONE,j$=e=>Object.keys(e).includes("isAdvanced"),B$=e=>!!(e.level&&e.bucket&&e.level===oa.MINUTES&&n$.includes(e.bucket)),z$=e=>e.filterType===Ut.INVALID,TC=(e,t=Ys.DATE_TIME,i)=>i&&B$(i)||j$(e)?Ut.ADVANCED:E$(e)?Ut.INCLUDE_ALL:L$(e)?Ut.PERIOD:EO(e)?Ut.SPECIFIC_ITEMS:I$(e,t)?Ut.DATE_RANGE:R$(e)?Ut.NUMERIC_RANGE:OO(e)?Ut.CONDITION:(z$(e),Ut.INVALID),F$=(e,t)=>{const{level:i,filter:n,bucket:o}=e,r=n||r$.filter,u={filter:Object.assign(Object.assign({},r),{filterType:TC(r,t)})};if(t===Ys.DATE_TIME){const _=r,A=(_==null?void 0:_.level)||i;u.level=A$(A,o),u.filter.filterType=TC(r,t,{level:A,bucket:o})}return u},MC=(e,t)=>{const i={config:Object.assign(Object.assign({},yf()),{guid:t,originalFilterJaql:e}),jaql:n=>n?e:{jaql:e,panel:"scope"},attribute:{id:e.dim},type:"filter"};return Object.assign({},i)},W$=(e,t)=>wf(e,[],{guid:t,excludeMembers:!0}),H$=(e,t,i,n)=>{const o=$$(t),r=U$(t,o),u=nO({guid:i,excludeMembers:!1,enableMultiSelection:n!=null?n:!0,deactivatedMembers:o});return wf(e,r,u)};function $$(e){var t,i,n,o;return!((t=e.filter)===null||t===void 0)&&t.turnedOff?(o=(n=(i=e.filter)===null||i===void 0?void 0:i.exclude)===null||n===void 0?void 0:n.members)!==null&&o!==void 0?o:[]:[]}function U$(e,t){const i=e.members;return t?i.filter(n=>!t.includes(n)):i}const V$=(e,t,i)=>TO(e,t.from,t.to,{guid:i}),G$=(e,t,i)=>rp(e,t.from,t.to,{guid:i}),Y$=(e,t,i)=>t.last?kO(e,t.last.offset,t.last.count,t.last.anchor,{guid:i}):MO(e,t.next.offset,t.next.count,t.next.anchor,{guid:i}),X$=(e,t,i)=>e$(e,t,{guid:i}),kC=(e,t)=>{try{if("formula"in e)throw new Vu("errors.filter.formulaFiltersNotSupported",{filter:JSON.stringify(e)});const i=F$(e,e.datatype),{filter:n}=i,{filterType:o}=n,r=t$(e),u=i$(e);switch(o){case Ut.INCLUDE_ALL:return W$(r,t);case Ut.SPECIFIC_ITEMS:return H$(r,n,t,n.multiSelection);case Ut.CONDITION:return u?P$(u,n,t):Iy(r,n,t);case Ut.DATE_RANGE:return V$(r,n,t);case Ut.PERIOD:return Y$(r,n,t);case Ut.NUMERIC_RANGE:return G$(r,n,t);case Ut.ADVANCED:return X$(r,n,t);case Ut.INVALID:return MC(e,t)}}catch(i){console.debug("Fall back to generic pass-through JAQL filter due to filter translation error:",i)}return MC(e,t)},q$=e=>["__int4","__int8","int","tinyint","bigint","int2","int4","int8","smallint","mediumint","serial","integer","byteint","int64"].includes(e.toLowerCase()),Z$=e=>["basemeasure","calculatedmeasure","float","float4","float8","double precision","double","numeric","decimal","real","number","float64"].includes(e.toLowerCase()),fn=e=>q$(e)||Z$(e)||e==="numeric-attribute",LO=e=>["textdimension","string","varchar","text","ntext","char","character","character varying","smalltext","nchar","nvarchar","json","jsonb","object","text-attribute"].includes(e.toLowerCase()),cr=e=>["datelevel","date","time","datetime","timestamp without time zone","timestamp","timestamp with time zone","timestamp(6)","timestamp_tz","timestamp_ntz","timestamp_ltz","timestampltz","timestampntz","timestamptz","datetime64[ns]","timewithtimezone","timestampwithtimezone","timestamp_with_timezone"].includes(e.toLowerCase()),NO=e=>["bool","boolean","bit","logical"].includes(e.toLowerCase()),DO=e=>fn(e)?"number":cr(e)?"datetime":LO(e)?"text":NO(e)?"boolean":"text",IO=function(e){e||(e=20);const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(e);let n=0,o;for(let r=0;r<e;r+=1){if(r>0&&r%5==0){i[r]="-";continue}n<=2&&(n=33554432+Math.random()*16777216|0),o=n&15,n=n>>4,i[r]=t[r==19?o&3|8:o]}return i.join("")},K$=e=>{if(!e)return{filters:void 0,relations:void 0};if(Array.isArray(e))return{filters:e,relations:void 0};const t=new Set;function i(u){const[_,...A]=u;if(t.add(_),!A.length)return n({instanceid:_.config.guid});const E=n(_),H=i(A);return{left:E,right:H,operator:"AND"}}function n(u){return u&&(J$(u)?hO(u)?i(u.filters):(t.add(u),{instanceid:u.config.guid}):("left"in u&&(u.left=n(u.left)),"right"in u&&(u.right=n(u.right)),"composeCode"in u&&delete u.composeCode,u))}const o=Ya(e),r=n(o);return{filters:Array.from(t),relations:r}};function J$(e){return"config"in e&&"guid"in e.config}function RO(e){return typeof e=="string"?e:e.title}function Rx(e){return typeof e=="object"&&"type"in e&&"title"in e}function Q$(e){return{id:e.id,address:e.address,title:e.title,type:e.live?"live":"elasticube"}}function jx(e){return Rx(e)?{title:e.title,live:e.type==="live"}:{title:e,live:!1}}function e4(e){var t;return Rx(e)?{title:e.title,live:e.type==="live",id:(t=e.id)!==null&&t!==void 0?t:"",address:e.address}:{title:e,id:""}}function t4(e){return e?e==="asc"?exports.Sort.Ascending:exports.Sort.Descending:exports.Sort.None}function i4(e){switch(e){case"sortAsc":return exports.Sort.Ascending;case"sortDesc":return exports.Sort.Descending;default:return exports.Sort.None}}const jO=(e,t,i=!1,n=!1)=>{const o=e.filter.filter&&!("turnedOff"in e.filter.filter),r=t||IO(),u=kC(e,r);if(o){const _=kC(Object.assign(Object.assign({},e),{filter:e.filter.filter}),`${t}-bg`),A=u.config;return u.config=Object.assign(Object.assign({},A),{backgroundFilter:_}),u}return u.config=Object.assign(Object.assign({},u.config),{originalFilterJaql:e,disabled:i,locked:n}),u};function os(e){const[t,i]=e.slice(1,-1).split(".");return{table:t,column:i?i.replace("(Calendar)","").trim():""}}function BO(e){return os(e.expression).table}function zO(e){return os(e.expression).column}function n4(e){switch(e){case zc.ASC:return"sortAsc";case zc.DESC:return"sortDesc";default:return"sortNone"}}const Cf=({expression:e,dataType:t,granularity:i,format:n,sort:o,title:r,panel:u,dataSource:_})=>{const A=os(e).column,E=t4(o);if(t===Th.DATETIME)return new Er(r!=null?r:A,e,i||it.Years,n||Er.getDefaultFormatForGranularity(i||it.Years),void 0,E,_,void 0,u);const q=!t||fn(t)?Lt.NumericAttribute:Lt.TextAttribute;return new kl(r!=null?r:A,e,q,void 0,E,_,void 0,u)},Sf=({expression:e,dataType:t,agg:i,granularity:n,format:o,sort:r,title:u,dataSource:_})=>{const A=Cf({expression:e,dataType:t,granularity:n,format:o,sort:r,title:u,dataSource:_}),E=na.aggregationFromJAQL(i),H=os(e).column,q=u!=null?u:`${E} ${H}`;switch(E){case Nt.Sum:return Ny(A,q,o);case Nt.Average:return L6(A,q,o);case Nt.Min:return QE(A,q,o);case Nt.Max:return Ax(A,q,o);case Nt.Count:return eO(A,q,o);case Nt.CountDistinct:return Ex(A,q,o);case Nt.Median:return Dy(A,q,o);case Nt.Variance:return lr(A,Nt.Variance,q,o);case Nt.StandardDeviation:return lr(A,Nt.StandardDeviation,q,o);default:return Ny(A,q,o)}},Bx=e=>{var t;const i=$H((t=e.context)!==null&&t!==void 0?t:{},n=>typeof n=="string"?n:n&&FO(n));return JE(e.title,e.formula,i)};function FO(e,t,i){if("filter"in e)return jO(e);if("formula"in e)return Bx(e);const r="datasource"in e?e.datasource:void 0;return e.agg?Sf({expression:e.dim,dataType:e.datatype,agg:e.agg||"",granularity:ru(e),format:t,sort:e.sort,title:e.title,dataSource:r}):Cf({expression:e.dim,dataType:e.datatype,granularity:ru(e),format:t,sort:e.sort,title:e.title,panel:i,dataSource:r})}function ru(e){return e!=null&&e.datatype&&cr(e.datatype)?Er.translateJaqlToGranularity(e):void 0}const zx=e=>DO(e).replace("number","numeric");class kl extends gf{constructor(t,i,n,o,r,u,_,A){if(super(t,n||Lt.Attribute,o,u,_),this._sort=exports.Sort.None,this.expression=i,!_&&i){const{table:E,column:H}=os(i);this.composeCode=Fx(E,H,"",Px)}A==="columns"&&(this.panel=A),this._sort=r||exports.Sort.None}get id(){return this.expression}getSort(){return this._sort}sort(t){return new kl(this.name,this.expression,this.type,this.description,t,this.dataSource,this.composeCode,this.panel)}jaql(t){const i={jaql:{title:this.name,dim:this.expression,datatype:zx(this.type)}};return this.panel&&(i.panel=this.panel),this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}serialize(){const t=super.serialize();return t.__serializable="DimensionalAttribute",t.expression=this.expression,this.getSort()!==exports.Sort.None&&(t.sort=this.getSort()),t}}class Er extends kl{constructor(t,i,n,o,r,u,_,A,E){if(super(t,i,Lt.DateLevel,r,u,_,A),this._format=o,this.granularity=n,!A&&i){const{table:H,column:q}=os(i);this.composeCode=Fx(H,q,n,Px)}E==="columns"&&(this.panel=E)}get id(){let t=`${this.expression}`;const{level:i="",dateTimeLevel:n="",bucket:o}=this.translateGranularityToJaql();return t+=`_${(i||n).toLowerCase()}`,o&&(t+=`_${o}`),t}getSort(){return this._sort}sort(t){return new Er(this.name,this.expression,this.granularity,this._format,this.description,t,this.dataSource,this.composeCode)}getFormat(){return this._format}format(t){return new Er(this.name,this.expression,this.granularity,t,this.description,this._sort,this.dataSource,this.composeCode)}setGranularity(t){return new Er(this.name,this.expression,t,this._format,this.description,this._sort,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalLevelAttribute",t.granularity=this.granularity,this.getFormat()!==void 0&&(t.format=this.getFormat()),t}jaql(t){const i={jaql:Object.assign({title:this.name,dim:this.expression,datatype:zx(this.type)},this.translateGranularityToJaql())};if(this.panel&&(i.panel=this.panel),this._format!==void 0){const n=i.jaql.dateTimeLevel||i.jaql.level;i.format={mask:{}},i.format.mask[n]=this._format}return this._sort!=exports.Sort.None&&(i.jaql.sort=this._sort==exports.Sort.Ascending?"asc":"desc"),t===!0?i.jaql:i}translateGranularityToJaql(){const t="minutes",i="seconds";switch(this.granularity){case it.Years:case it.Quarters:case it.Months:case it.Weeks:case it.Days:return{level:this.granularity.toLowerCase()};case it.Hours:return{dateTimeLevel:t,bucket:"60"};case it.MinutesRoundTo30:return{dateTimeLevel:t,bucket:"30"};case it.MinutesRoundTo15:return{dateTimeLevel:t,bucket:"15"};case it.Minutes:return{dateTimeLevel:t,bucket:"1"};case it.Seconds:return{dateTimeLevel:i,bucket:"0"};case it.AggHours:return{level:t,bucket:"60"};case it.AggMinutesRoundTo30:return{level:t,bucket:"30"};case it.AggMinutesRoundTo15:return{level:t,bucket:"15"};case it.AggMinutesRoundTo1:return{level:t,bucket:"1"};default:return console.warn("Unsupported level"),{level:this.granularity}}}static translateJaqlToGranularity(t){const i=n=>(console.warn("Unsupported granularity",n),n);if(t.dateTimeLevel){if(t.dateTimeLevel!=="minutes"&&t.dateTimeLevel!=="seconds")return i(t.dateTimeLevel);switch(t.bucket){case"60":return it.Hours;case"30":return it.MinutesRoundTo30;case"15":return it.MinutesRoundTo15;case"1":return it.Minutes;case"0":return it.Seconds;default:return i(t.dateTimeLevel)}}switch(t.level){case"years":return it.Years;case"quarters":return it.Quarters;case"months":return it.Months;case"weeks":return it.Weeks;case"days":return it.Days;case"minutes":switch(t.bucket){case"60":return it.AggHours;case"30":return it.AggMinutesRoundTo30;case"15":return it.AggMinutesRoundTo15;case"1":return it.AggMinutesRoundTo1;default:return i(t.level)}default:return i(t.level)}}static getDefaultFormatForGranularity(t){switch(t){case it.Years:return"yyyy";case it.Quarters:return"Q yyyy";case it.Months:return"yyyy-MM";case it.Weeks:return"ww yyyy";case it.Days:return"yyyy-MM-dd";case it.Hours:return"yyyy-MM-dd HH:mm";case it.MinutesRoundTo30:return"yyyy-MM-dd HH:mm";case it.MinutesRoundTo15:return"yyyy-MM-dd HH:mm";case it.Minutes:return"yyyy-MM-dd HH:mm";case it.Seconds:return"yyyy-MM-dd HH:mm:ss";case it.AggHours:return"HH:mm";case it.AggMinutesRoundTo30:return"HH:mm";case it.AggMinutesRoundTo15:return"HH:mm";case it.AggMinutesRoundTo1:return"HH:mm";default:return""}}}function o4(e){return e.granularity?r4(e):new kl(e.name||e.title,e.attribute||e.expression||e.dim,e.type,e.desc||e.description,e.sort,e.dataSource)}function r4(e){return new Er(e.name||e.title,e.attribute||e.expression||e.dim,e.granularity,e.format,e.desc||e.description,e.sort,e.dataSource)}function Fx(e,t,i,n){return(n.length>0?n+".":"")+Jr(e)+"."+Jr(t)+(i&&i.length>0?"."+i:"")}function pg(e){return"attribute"in e}function a4(e){return"measure"in e}const s4={rows:!1,columns:!1},PC=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},nn=(...e)=>e.reduce((t,i)=>{if(Array.isArray(i))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(i).forEach(n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=nn.options.mergeArrays?Array.from(new Set(t[n].concat(i[n]))):i[n]:PC(t[n])&&PC(i[n])?t[n]=nn(t[n],i[n]):t[n]=i[n])}),t},{}),WO={mergeArrays:!0};nn.options=WO;nn.withOptions=(e,...t)=>{nn.options=Object.assign({mergeArrays:!0},e);const i=nn(...t);return nn.options=WO,i};let Nd;const l4=new Uint8Array(16);function c4(){if(!Nd&&(Nd=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nd(l4)}const Zi=[];for(let e=0;e<256;++e)Zi.push((e+256).toString(16).slice(1));function u4(e,t=0){return Zi[e[t+0]]+Zi[e[t+1]]+Zi[e[t+2]]+Zi[e[t+3]]+"-"+Zi[e[t+4]]+Zi[e[t+5]]+"-"+Zi[e[t+6]]+Zi[e[t+7]]+"-"+Zi[e[t+8]]+Zi[e[t+9]]+"-"+Zi[e[t+10]]+Zi[e[t+11]]+Zi[e[t+12]]+Zi[e[t+13]]+Zi[e[t+14]]+Zi[e[t+15]]}const d4=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),AC={randomUUID:d4};function HO(e,t,i){if(AC.randomUUID&&!t&&!e)return AC.randomUUID();e=e||{};const n=e.random||(e.rng||c4)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,u4(n)}function h4(e,t){const i=t==null?void 0:t.find(n=>$O(e)===n.attribute.id);return i&&!i.config.disabled&&(i.isScope&&(i.isScope=!1),e.jaql.in={selected:i.jaql()}),e}function p4(e,t){const i=[],n=[];return t.forEach(o=>{e.some(u=>$O(u)===o.attribute.id)?i.push(o):n.push(o)}),[i,n]}function $O(e){const{dim:t,level:i,dateTimeLevel:n,bucket:o}=e.jaql;let r=`${t}`;return(i||n)&&(r+=`_${i||n}`),o&&(r+=`_${o}`),r}var f4=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]]);return i};function m4(e,t,i){return{rowsCount:e.length,columnsCount:t.length,measuresCount:i.length}}function g4(e){switch(e){case"sortAsc":return"asc";case"sortDesc":return"desc";default:return"none"}}function v4(e,t,i){const n=g4(e.direction),o=t===i.rowsCount-1,r={dir:n,initialized:!0,field:e.by&&"valuesIndex"in e.by?i.rowsCount+i.columnsCount+e.by.valuesIndex:t};return o&&(r.sortingLastDimension=!0),e.by&&(r.measurePath=(e.by.columnsMembersPath||[]).reduce((u,_,A)=>Object.assign(Object.assign({},u),{[i.rowsCount+A]:_}),{})),{sort:n,sortDetails:r}}function y4(e,t){if(t.rowsCount===0)return;const i=t.rowsCount-1,n=e[i],o=n.jaql,{sortDetails:r,sort:u}=o,_=f4(o,["sortDetails","sort"]);if(r&&r.field!==i&&r.field<e.length){const E=e[r.field];E.jaql.sortDetails=r,E.jaql.sort=u,n.jaql=_}}const Ah="ComposeSDK";function UO(e,t){const{attributes:i,measures:n,filters:o,filterRelations:r,highlights:u,dataSource:_,count:A,offset:E,ungroup:H}=e,q=H&&n.length===0,g=Object.assign({metadata:x4({attributes:i,measures:n,filters:o,filterRelations:r,highlights:u},t)},w4(_,A,E,q));return r?Object.assign(Object.assign({},g),{filterRelations:r}):g}function VO(e,t,i,n,o){const[r,u]=p4(e,n);e.forEach(E=>h4(E,r));const _=E=>{const H=E.jaql();return i?Array.isArray(H)?H.map(q=>Object.assign(Object.assign({},q),{instanceid:E.config.guid})):Object.assign(Object.assign({},H),{instanceid:E.config.guid}):H},A=(o?t.flatMap(E=>_(E)):[...t,...u].flatMap(E=>_(E))).filter(E=>Object.keys(E.jaql.filter||{}).length!==0);return o&&u.length>0&&console.warn(`The following highlight filters were not applied due to missing attributes: [${u.map(E=>E.attribute.name).join(", ")}].`),A}function b4(e){var t,i;const n=(t=e.jaql)===null||t===void 0?void 0:t.formula;if(!n||!n.includes("trend")&&!n.includes("forecast"))return e;const o=structuredClone(e),r=(i=o.jaql)===null||i===void 0?void 0:i.context;if(r)for(const u in r){const _=r[u];_.datatype==="text"&&_.agg==="count"&&(_.datatype="numeric")}return o}function x4(e,t){const{attributes:i,measures:n,filters:o,filterRelations:r,highlights:u}=e,_=i.map(H=>H.jaql()),A=n.map(H=>b4(H.jaql())),E=VO(_,o,r,u,t);return[..._,...A,...E]}function w4(e,t,i,n){return Object.assign(Object.assign(Object.assign({datasource:jx(e),by:Ah,queryGuid:HO()},n?{ungroup:!0}:{}),t?{count:t}:{}),i?{offset:i}:{})}function _4(e,t){const{rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,filterRelations:u,grandTotals:_,highlights:A,dataSource:E,count:H,offset:q}=e,g=Object.assign({metadata:S4({rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,highlights:A,filterRelations:u},t)},T4(E,_,H,q));return u?Object.assign(Object.assign({},g),{filterRelations:u}):g}function EC(e,t,i,n){const o=t==="rows"&&pg(e)&&e.sort&&e.sort.direction!=="sortNone",r=Object.assign(Object.assign({},pg(e)?e.attribute.jaql(!0):e.jaql(!0)),o&&v4(e.sort,i,n));return Object.assign(Object.assign({jaql:r},pg(e)&&e.includeSubTotals?{format:{subtotal:!0}}:{}),{panel:t,field:{index:i,id:`${t}-${i}`}})}function C4(e,t,i){return Object.assign(Object.assign({},a4(e)?nn(e.measure.jaql(),{jaql:{subtotalAgg:e.totalsCalculation},format:Object.assign({databars:e.dataBars||!1},e.shouldRequestMinMax&&{color:{type:"range"}})}):e.jaql()),{panel:t,field:{index:i,id:`${t}-${i}`}})}function S4(e,t){const{rowsAttributes:i,columnsAttributes:n,measures:o,filters:r,filterRelations:u,highlights:_}=e,A=m4(i,n,o);let E=0;const H=i.map((Y,Z)=>EC(Y,"rows",Z+E,A));E=E+i.length;const q=n.map((Y,Z)=>EC(Y,"columns",Z+E,A));E=E+n.length;const g=[...H,...q],te=o.map((Y,Z)=>C4(Y,"measures",Z+E)),W=VO(g,r,u,_,t),C=[...g,...te,...W];return y4(C,A),C}function T4(e,t,i,n){return Object.assign(Object.assign(Object.assign({datasource:jx(e),by:Ah,queryGuid:HO(),dashboard:Ah,widget:Ah,format:"pivot"},i?{count:i}:{}),n?{offset:n}:{}),{grandTotals:Object.assign(Object.assign({},s4),t)})}var M4=!1;function k4(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function P4(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var A4=function(){function e(i){var n=this;this._insertTag=function(o){var r;n.tags.length===0?n.insertionPoint?r=n.insertionPoint.nextSibling:n.prepend?r=n.container.firstChild:r=n.before:r=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,r),n.tags.push(o)},this.isSpeedy=i.speedy===void 0?!M4:i.speedy,this.tags=[],this.ctr=0,this.nonce=i.nonce,this.key=i.key,this.container=i.container,this.prepend=i.prepend,this.insertionPoint=i.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(P4(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var r=k4(o);try{r.insertRule(n,r.cssRules.length)}catch(u){}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}),this.tags=[],this.ctr=0},e}(),ln="-ms-",ap="-moz-",Ht="-webkit-",GO="comm",Wx="rule",Hx="decl",E4="@import",YO="@keyframes",O4="@layer",L4=Math.abs,Tf=String.fromCharCode,N4=Object.assign;function D4(e,t){return en(e,0)^45?(((t<<2^en(e,0))<<2^en(e,1))<<2^en(e,2))<<2^en(e,3):0}function XO(e){return e.trim()}function I4(e,t){return(e=t.exec(e))?e[0]:e}function $t(e,t,i){return e.replace(t,i)}function Ry(e,t){return e.indexOf(t)}function en(e,t){return e.charCodeAt(t)|0}function au(e,t,i){return e.slice(t,i)}function Xo(e){return e.length}function $x(e){return e.length}function Dd(e,t){return t.push(e),e}function R4(e,t){return e.map(t).join("")}var Mf=1,nl=1,qO=0,Bn=0,Wi=0,Pl="";function kf(e,t,i,n,o,r,u){return{value:e,root:t,parent:i,type:n,props:o,children:r,line:Mf,column:nl,length:u,return:""}}function ec(e,t){return N4(kf("",null,null,"",null,null,0),e,{length:-e.length},t)}function j4(){return Wi}function B4(){return Wi=Bn>0?en(Pl,--Bn):0,nl--,Wi===10&&(nl=1,Mf--),Wi}function Yn(){return Wi=Bn<qO?en(Pl,Bn++):0,nl++,Wi===10&&(nl=1,Mf++),Wi}function rr(){return en(Pl,Bn)}function Eh(){return Bn}function Gu(e,t){return au(Pl,e,t)}function su(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ZO(e){return Mf=nl=1,qO=Xo(Pl=e),Bn=0,[]}function KO(e){return Pl="",e}function Oh(e){return XO(Gu(Bn-1,jy(e===91?e+2:e===40?e+1:e)))}function z4(e){for(;(Wi=rr())&&Wi<33;)Yn();return su(e)>2||su(Wi)>3?"":" "}function F4(e,t){for(;--t&&Yn()&&!(Wi<48||Wi>102||Wi>57&&Wi<65||Wi>70&&Wi<97););return Gu(e,Eh()+(t<6&&rr()==32&&Yn()==32))}function jy(e){for(;Yn();)switch(Wi){case e:return Bn;case 34:case 39:e!==34&&e!==39&&jy(Wi);break;case 40:e===41&&jy(e);break;case 92:Yn();break}return Bn}function W4(e,t){for(;Yn()&&e+Wi!==57;)if(e+Wi===84&&rr()===47)break;return"/*"+Gu(t,Bn-1)+"*"+Tf(e===47?e:Yn())}function H4(e){for(;!su(rr());)Yn();return Gu(e,Bn)}function $4(e){return KO(Lh("",null,null,null,[""],e=ZO(e),0,[0],e))}function Lh(e,t,i,n,o,r,u,_,A){for(var E=0,H=0,q=u,g=0,te=0,W=0,C=1,Y=1,Z=1,K=0,J="",G=o,j=r,B=n,z=J;Y;)switch(W=K,K=Yn()){case 40:if(W!=108&&en(z,q-1)==58){Ry(z+=$t(Oh(K),"&","&\f"),"&\f")!=-1&&(Z=-1);break}case 34:case 39:case 91:z+=Oh(K);break;case 9:case 10:case 13:case 32:z+=z4(W);break;case 92:z+=F4(Eh()-1,7);continue;case 47:switch(rr()){case 42:case 47:Dd(U4(W4(Yn(),Eh()),t,i),A);break;default:z+="/"}break;case 123*C:_[E++]=Xo(z)*Z;case 125*C:case 59:case 0:switch(K){case 0:case 125:Y=0;case 59+H:Z==-1&&(z=$t(z,/\f/g,"")),te>0&&Xo(z)-q&&Dd(te>32?LC(z+";",n,i,q-1):LC($t(z," ","")+";",n,i,q-2),A);break;case 59:z+=";";default:if(Dd(B=OC(z,t,i,E,H,o,_,J,G=[],j=[],q),r),K===123)if(H===0)Lh(z,t,B,B,G,r,q,_,j);else switch(g===99&&en(z,3)===110?100:g){case 100:case 108:case 109:case 115:Lh(e,B,B,n&&Dd(OC(e,B,B,0,0,o,_,J,o,G=[],q),j),o,j,q,_,n?G:j);break;default:Lh(z,B,B,B,[""],j,0,_,j)}}E=H=te=0,C=Z=1,J=z="",q=u;break;case 58:q=1+Xo(z),te=W;default:if(C<1){if(K==123)--C;else if(K==125&&C++==0&&B4()==125)continue}switch(z+=Tf(K),K*C){case 38:Z=H>0?1:(z+="\f",-1);break;case 44:_[E++]=(Xo(z)-1)*Z,Z=1;break;case 64:rr()===45&&(z+=Oh(Yn())),g=rr(),H=q=Xo(J=z+=H4(Eh())),K++;break;case 45:W===45&&Xo(z)==2&&(C=0)}}return r}function OC(e,t,i,n,o,r,u,_,A,E,H){for(var q=o-1,g=o===0?r:[""],te=$x(g),W=0,C=0,Y=0;W<n;++W)for(var Z=0,K=au(e,q+1,q=L4(C=u[W])),J=e;Z<te;++Z)(J=XO(C>0?g[Z]+" "+K:$t(K,/&\f/g,g[Z])))&&(A[Y++]=J);return kf(e,t,i,o===0?Wx:_,A,E,H)}function U4(e,t,i){return kf(e,t,i,GO,Tf(j4()),au(e,2,-2),0)}function LC(e,t,i,n){return kf(e,t,i,Hx,au(e,0,n),au(e,n+1,-1),n)}function Xs(e,t){for(var i="",n=$x(e),o=0;o<n;o++)i+=t(e[o],o,e,t)||"";return i}function V4(e,t,i,n){switch(e.type){case O4:if(e.children.length)break;case E4:case Hx:return e.return=e.return||e.value;case GO:return"";case YO:return e.return=e.value+"{"+Xs(e.children,n)+"}";case Wx:e.value=e.props.join(",")}return Xo(i=Xs(e.children,n))?e.return=e.value+"{"+i+"}":""}function G4(e){var t=$x(e);return function(i,n,o,r){for(var u="",_=0;_<t;_++)u+=e[_](i,n,o,r)||"";return u}}function Y4(e){return function(t){t.root||(t=t.return)&&e(t)}}function JO(e){var t=Object.create(null);return function(i){return t[i]===void 0&&(t[i]=e(i)),t[i]}}var X4=function(t,i,n){for(var o=0,r=0;o=r,r=rr(),o===38&&r===12&&(i[n]=1),!su(r);)Yn();return Gu(t,Bn)},q4=function(t,i){var n=-1,o=44;do switch(su(o)){case 0:o===38&&rr()===12&&(i[n]=1),t[n]+=X4(Bn-1,i,n);break;case 2:t[n]+=Oh(o);break;case 4:if(o===44){t[++n]=rr()===58?"&\f":"",i[n]=t[n].length;break}default:t[n]+=Tf(o)}while(o=Yn());return t},Z4=function(t,i){return KO(q4(ZO(t),i))},NC=new WeakMap,K4=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var i=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&i.charCodeAt(0)!==58&&!NC.get(n))&&!o){NC.set(t,!0);for(var r=[],u=Z4(i,r),_=n.props,A=0,E=0;A<u.length;A++)for(var H=0;H<_.length;H++,E++)t.props[E]=r[A]?u[A].replace(/&\f/g,_[H]):_[H]+" "+u[A]}}},J4=function(t){if(t.type==="decl"){var i=t.value;i.charCodeAt(0)===108&&i.charCodeAt(2)===98&&(t.return="",t.value="")}};function QO(e,t){switch(D4(e,t)){case 5103:return Ht+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+e+ap+e+ln+e+e;case 6828:case 4268:return Ht+e+ln+e+e;case 6165:return Ht+e+ln+"flex-"+e+e;case 5187:return Ht+e+$t(e,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+ln+"flex-$1$2")+e;case 5443:return Ht+e+ln+"flex-item-"+$t(e,/flex-|-self/,"")+e;case 4675:return Ht+e+ln+"flex-line-pack"+$t(e,/align-content|flex-|-self/,"")+e;case 5548:return Ht+e+ln+$t(e,"shrink","negative")+e;case 5292:return Ht+e+ln+$t(e,"basis","preferred-size")+e;case 6060:return Ht+"box-"+$t(e,"-grow","")+Ht+e+ln+$t(e,"grow","positive")+e;case 4554:return Ht+$t(e,/([^-])(transform)/g,"$1"+Ht+"$2")+e;case 6187:return $t($t($t(e,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),e,"")+e;case 5495:case 3959:return $t(e,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return $t($t(e,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+e+e;case 4095:case 3583:case 4068:case 2532:return $t(e,/(.+)-inline(.+)/,Ht+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xo(e)-1-t>6)switch(en(e,t+1)){case 109:if(en(e,t+4)!==45)break;case 102:return $t(e,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+ap+(en(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ry(e,"stretch")?QO($t(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(en(e,t+1)!==115)break;case 6444:switch(en(e,Xo(e)-3-(~Ry(e,"!important")&&10))){case 107:return $t(e,":",":"+Ht)+e;case 101:return $t(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ht+(en(e,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+ln+"$2box$3")+e}break;case 5936:switch(en(e,t+11)){case 114:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ht+e+ln+$t(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ht+e+ln+e+e}return e}var Q4=function(t,i,n,o){if(t.length>-1&&!t.return)switch(t.type){case Hx:t.return=QO(t.value,t.length);break;case YO:return Xs([ec(t,{value:$t(t.value,"@","@"+Ht)})],o);case Wx:if(t.length)return R4(t.props,function(r){switch(I4(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Xs([ec(t,{props:[$t(r,/:(read-\w+)/,":"+ap+"$1")]})],o);case"::placeholder":return Xs([ec(t,{props:[$t(r,/:(plac\w+)/,":"+Ht+"input-$1")]}),ec(t,{props:[$t(r,/:(plac\w+)/,":"+ap+"$1")]}),ec(t,{props:[$t(r,/:(plac\w+)/,ln+"input-$1")]})],o)}return""})}},eU=[Q4],Pf=function(t){var i=t.key;if(i==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(C){var Y=C.getAttribute("data-emotion");Y.indexOf(" ")!==-1&&(document.head.appendChild(C),C.setAttribute("data-s",""))})}var o=t.stylisPlugins||eU,r={},u,_=[];u=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+i+' "]'),function(C){for(var Y=C.getAttribute("data-emotion").split(" "),Z=1;Z<Y.length;Z++)r[Y[Z]]=!0;_.push(C)});var A,E=[K4,J4];{var H,q=[V4,Y4(function(C){H.insert(C)})],g=G4(E.concat(o,q)),te=function(Y){return Xs($4(Y),g)};A=function(Y,Z,K,J){H=K,te(Y?Y+"{"+Z.styles+"}":Z.styles),J&&(W.inserted[Z.name]=!0)}}var W={key:i,sheet:new A4({key:i,container:u,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:r,registered:{},insert:A};return W.sheet.hydrate(_),W},tU=!0;function eL(e,t,i){var n="";return i.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}var Ux=function(t,i,n){var o=t.key+"-"+i.name;(n===!1||tU===!1)&&t.registered[o]===void 0&&(t.registered[o]=i.styles)},Vx=function(t,i,n){Ux(t,i,n);var o=t.key+"-"+i.name;if(t.inserted[i.name]===void 0){var r=i;do t.insert(i===r?"."+o:"",r,t.sheet,!0),r=r.next;while(r!==void 0)}};function iU(e){for(var t=0,i,n=0,o=e.length;o>=4;++n,o-=4)i=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,t=(i&65535)*1540483477+((i>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var nU={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oU=!1,rU=/[A-Z]|^ms/g,aU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,tL=function(t){return t.charCodeAt(1)===45},DC=function(t){return t!=null&&typeof t!="boolean"},fg=JO(function(e){return tL(e)?e:e.replace(rU,"-$&").toLowerCase()}),IC=function(t,i){switch(t){case"animation":case"animationName":if(typeof i=="string")return i.replace(aU,function(n,o,r){return qo={name:o,styles:r,next:qo},o})}return nU[t]!==1&&!tL(t)&&typeof i=="number"&&i!==0?i+"px":i},sU="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function lu(e,t,i){if(i==null)return"";var n=i;if(n.__emotion_styles!==void 0)return n;switch(typeof i){case"boolean":return"";case"object":{var o=i;if(o.anim===1)return qo={name:o.name,styles:o.styles,next:qo},o.name;var r=i;if(r.styles!==void 0){var u=r.next;if(u!==void 0)for(;u!==void 0;)qo={name:u.name,styles:u.styles,next:qo},u=u.next;var _=r.styles+";";return _}return lU(e,t,i)}case"function":{if(e!==void 0){var A=qo,E=i(e);return qo=A,lu(e,t,E)}break}}var H=i;if(t==null)return H;var q=t[H];return q!==void 0?q:H}function lU(e,t,i){var n="";if(Array.isArray(i))for(var o=0;o<i.length;o++)n+=lu(e,t,i[o])+";";else for(var r in i){var u=i[r];if(typeof u!="object"){var _=u;t!=null&&t[_]!==void 0?n+=r+"{"+t[_]+"}":DC(_)&&(n+=fg(r)+":"+IC(r,_)+";")}else{if(r==="NO_COMPONENT_SELECTOR"&&oU)throw new Error(sU);if(Array.isArray(u)&&typeof u[0]=="string"&&(t==null||t[u[0]]===void 0))for(var A=0;A<u.length;A++)DC(u[A])&&(n+=fg(r)+":"+IC(r,u[A])+";");else{var E=lu(e,t,u);switch(r){case"animation":case"animationName":{n+=fg(r)+":"+E+";";break}default:n+=r+"{"+E+"}"}}}}return n}var RC=/label:\s*([^\s;{]+)\s*(;|$)/g,qo;function Al(e,t,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";qo=void 0;var r=e[0];if(r==null||r.raw===void 0)n=!1,o+=lu(i,t,r);else{var u=r;o+=u[0]}for(var _=1;_<e.length;_++)if(o+=lu(i,t,e[_]),n){var A=r;o+=A[_]}RC.lastIndex=0;for(var E="",H;(H=RC.exec(o))!==null;)E+="-"+H[1];var q=iU(o)+E;return{name:q,styles:o,next:qo}}var cU=function(t){return t()},iL=Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]?Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,uU=iL||cU,jC=iL||Oe.useLayoutEffect,dU=!1,nL=Oe.createContext(typeof HTMLElement!="undefined"?Pf({key:"css"}):null),Gx=nL.Provider,Yx=function(t){return Je.forwardRef(function(i,n){var o=Je.useContext(nL);return t(i,o,n)})},El=Oe.createContext({}),Yu={}.hasOwnProperty,By="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Xx=function(t,i){var n={};for(var o in i)Yu.call(i,o)&&(n[o]=i[o]);return n[By]=t,n},hU=function(t){var i=t.cache,n=t.serialized,o=t.isStringTag;return Ux(i,n,o),uU(function(){return Vx(i,n,o)}),null},pU=Yx(function(e,t,i){var n=e.css;typeof n=="string"&&t.registered[n]!==void 0&&(n=t.registered[n]);var o=e[By],r=[n],u="";typeof e.className=="string"?u=eL(t.registered,r,e.className):e.className!=null&&(u=e.className+" ");var _=Al(r,void 0,Oe.useContext(El));u+=t.key+"-"+_.name;var A={};for(var E in e)Yu.call(e,E)&&E!=="css"&&E!==By&&!dU&&(A[E]=e[E]);return A.className=u,i&&(A.ref=i),Oe.createElement(Oe.Fragment,null,Oe.createElement(hU,{cache:t,serialized:_,isStringTag:typeof o=="string"}),Oe.createElement(o,A))}),qx=pU;exports.jsx$1=function(t,i){var n=arguments;if(i==null||!Yu.call(i,"css"))return Oe.createElement.apply(void 0,n);var o=n.length,r=new Array(o);r[0]=qx,r[1]=Xx(t,i);for(var u=2;u<o;u++)r[u]=n[u];return Oe.createElement.apply(null,r)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(exports.jsx$1||(exports.jsx$1={}));var fU=Yx(function(e,t){var i=e.styles,n=Al([i],void 0,Oe.useContext(El)),o=Oe.useRef();return jC(function(){var r=t.key+"-global",u=new t.sheet.constructor({key:r,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),_=!1,A=document.querySelector('style[data-emotion="'+r+" "+n.name+'"]');return t.sheet.tags.length&&(u.before=t.sheet.tags[0]),A!==null&&(_=!0,A.setAttribute("data-emotion",r),u.hydrate([A])),o.current=[u,_],function(){u.flush()}},[t]),jC(function(){var r=o.current,u=r[0],_=r[1];if(_){r[1]=!1;return}if(n.next!==void 0&&Vx(t,n.next,!0),u.tags.length){var A=u.tags[u.tags.length-1].nextElementSibling;u.before=A,u.flush()}t.insert("",n,u,!1)},[t,n.name]),null});function Zo(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Al(t)}function Ol(){var e=Zo.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var mU=function(t){return t()},gU=Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]?Oe[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,vU=gU||mU,yU=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,bU=JO(function(e){return yU.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),xU=!1,wU=bU,_U=function(t){return t!=="theme"},BC=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?wU:_U},zC=function(t,i,n){var o;if(i){var r=i.shouldForwardProp;o=t.__emotion_forwardProp&&r?function(u){return t.__emotion_forwardProp(u)&&r(u)}:r}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},CU=function(t){var i=t.cache,n=t.serialized,o=t.isStringTag;return Ux(i,n,o),vU(function(){return Vx(i,n,o)}),null},SU=function e(t,i){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,r,u;i!==void 0&&(r=i.label,u=i.target);var _=zC(t,i,n),A=_||BC(o),E=!A("as");return function(){var H=arguments,q=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(r!==void 0&&q.push("label:"+r+";"),H[0]==null||H[0].raw===void 0)q.push.apply(q,H);else{var g=H[0];q.push(g[0]);for(var te=H.length,W=1;W<te;W++)q.push(H[W],g[W])}var C=Yx(function(Y,Z,K){var J=E&&Y.as||o,G="",j=[],B=Y;if(Y.theme==null){B={};for(var z in Y)B[z]=Y[z];B.theme=Oe.useContext(El)}typeof Y.className=="string"?G=eL(Z.registered,j,Y.className):Y.className!=null&&(G=Y.className+" ");var O=Al(q.concat(j),Z.registered,B);G+=Z.key+"-"+O.name,u!==void 0&&(G+=" "+u);var R=E&&_===void 0?BC(J):A,T={};for(var v in Y)E&&v==="as"||R(v)&&(T[v]=Y[v]);return T.className=G,K&&(T.ref=K),Oe.createElement(Oe.Fragment,null,Oe.createElement(CU,{cache:Z,serialized:O,isStringTag:typeof J=="string"}),Oe.createElement(J,T))});return C.displayName=r!==void 0?r:"Styled("+(typeof o=="string"?o:o.displayName||o.name||"Component")+")",C.defaultProps=t.defaultProps,C.__emotion_real=C,C.__emotion_base=o,C.__emotion_styles=q,C.__emotion_forwardProp=_,Object.defineProperty(C,"toString",{value:function(){return u===void 0&&xU?"NO_COMPONENT_SELECTOR":"."+u}}),C.withComponent=function(Y,Z){var K=e(Y,Qh({},i,Z,{shouldForwardProp:zC(C,Z,!0)}));return K.apply(void 0,q)},C}},TU=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],cu=SU.bind(null);TU.forEach(function(e){cu[e]=cu(e)});var MU=Object.defineProperty,kU=Object.defineProperties,PU=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,oL=Object.prototype.hasOwnProperty,rL=Object.prototype.propertyIsEnumerable,Qr=Math.pow,zy=(e,t,i)=>t in e?MU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,we=(e,t)=>{for(var i in t||(t={}))oL.call(t,i)&&zy(e,i,t[i]);if(sp)for(var i of sp(t))rL.call(t,i)&&zy(e,i,t[i]);return e},ze=(e,t)=>kU(e,PU(t)),Fy=e=>typeof e=="symbol"?e:e+"",ot=(e,t)=>{var i={};for(var n in e)oL.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&rL.call(e,n)&&(i[n]=e[n]);return i},Ne=(e,t,i)=>(zy(e,typeof t!="symbol"?t+"":t,i),i),aL=(e,t,i)=>new Promise((n,o)=>{var r=A=>{try{_(i.next(A))}catch(E){o(E)}},u=A=>{try{_(i.throw(A))}catch(E){o(E)}},_=A=>A.done?n(A.value):Promise.resolve(A.value).then(r,u);_((i=i.apply(e,t)).next())});const AU={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};let EU=class Wy{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||AU,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,n,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Wy(this.logger,we({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Wy(this.logger,t)}};var nr=new EU;let Af=class{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]=this.observers[i]||[],this.observers[i].push(t)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(i=>i!==t)}}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.observers[e]&&[].concat(this.observers[e]).forEach(o=>{o(...i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[e,...i])})}};function tc(){let e,t;const i=new Promise((n,o)=>{e=n,t=o});return i.resolve=e,i.reject=t,i}function FC(e){return e==null?"":""+e}function OU(e,t,i){e.forEach(n=>{t[n]&&(i[n]=t[n])})}function Zx(e,t,i){function n(u){return u&&u.indexOf("###")>-1?u.replace(/###/g,"."):u}function o(){return!e||typeof e=="string"}const r=typeof t!="string"?[].concat(t):t.split(".");for(;r.length>1;){if(o())return{};const u=n(r.shift());!e[u]&&i&&(e[u]=new i),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={}}return o()?{}:{obj:e,k:n(r.shift())}}function WC(e,t,i){const{obj:n,k:o}=Zx(e,t,Object);n[o]=i}function LU(e,t,i,n){const{obj:o,k:r}=Zx(e,t,Object);o[r]=o[r]||[],o[r].push(i)}function lp(e,t){const{obj:i,k:n}=Zx(e,t);if(i)return i[n]}function NU(e,t,i){const n=lp(e,i);return n!==void 0?n:lp(t,i)}function sL(e,t,i){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?i&&(e[n]=t[n]):sL(e[n],t[n],i):e[n]=t[n]);return e}function Cs(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var DU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function IU(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>DU[t]):e}const RU=[" ",",","?","!",";"];function jU(e,t,i){t=t||"",i=i||"";const n=RU.filter(u=>t.indexOf(u)<0&&i.indexOf(u)<0);if(n.length===0)return!0;const o=new RegExp(`(${n.map(u=>u==="?"?"\\?":u).join("|")})`);let r=!o.test(e);if(!r){const u=e.indexOf(i);u>0&&!o.test(e.substring(0,u))&&(r=!0)}return r}function cp(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(i);let o=e;for(let r=0;r<n.length;++r){if(!o||typeof o[n[r]]=="string"&&r+1<n.length)return;if(o[n[r]]===void 0){let u=2,_=n.slice(r,r+u).join(i),A=o[_];for(;A===void 0&&n.length>r+u;)u++,_=n.slice(r,r+u).join(i),A=o[_];if(A===void 0)return;if(A===null)return null;if(t.endsWith(_)){if(typeof A=="string")return A;if(_&&typeof A[_]=="string")return A[_]}const E=n.slice(r+u).join(i);return E?cp(A,E,i):void 0}o=o[n[r]]}return o}function up(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class HC extends Af{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let _=[t,i];n&&typeof n!="string"&&(_=_.concat(n)),n&&typeof n=="string"&&(_=_.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(_=t.split("."));const A=lp(this.data,_);return A||!u||typeof n!="string"?A:cp(this.data&&this.data[t]&&this.data[t][i],n,r)}addResource(t,i,n,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const u=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let _=[t,i];n&&(_=_.concat(u?n.split(u):n)),t.indexOf(".")>-1&&(_=t.split("."),o=i,i=_[1]),this.addNamespaces(i),WC(this.data,_,o),r.silent||this.emit("added",t,i,n,o)}addResources(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in n)(typeof n[r]=="string"||Object.prototype.toString.apply(n[r])==="[object Array]")&&this.addResource(t,i,r,n[r],{silent:!0});o.silent||this.emit("added",t,i,n)}addResourceBundle(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[t,i];t.indexOf(".")>-1&&(_=t.split("."),o=n,n=i,i=_[1]),this.addNamespaces(i);let A=lp(this.data,_)||{};o?sL(A,n,r):A=we(we({},A),n),WC(this.data,_,A),u.silent||this.emit("added",t,i,n)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?we({},this.getResource(t,i)):this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(n=>i[n]&&Object.keys(i[n]).length>0)}toJSON(){return this.data}}var lL={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,n,o){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,n,o))}),t}};const $C={};class dp extends Af{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),OU(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,i);return n&&n.res!==void 0}extractFromKey(t,i){let n=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const u=n&&t.indexOf(n)>-1,_=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!jU(t,n,o);if(u&&!_){const A=t.match(this.interpolator.nestingRegexp);if(A&&A.length>0)return{key:t,namespaces:r};const E=t.split(n);(n!==o||n===o&&this.options.ns.indexOf(E[0])>-1)&&(r=E.shift()),t=E.join(o)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,n){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i=we({},i)),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:u,namespaces:_}=this.extractFromKey(t[t.length-1],i),A=_[_.length-1],E=i.lng||this.language,H=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(H){const J=i.nsSeparator||this.options.nsSeparator;return o?{res:`${A}${J}${u}`,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:`${A}${J}${u}`}return o?{res:u,usedKey:u,exactUsedKey:u,usedLng:E,usedNS:A}:u}const q=this.resolve(t,i);let g=q&&q.res;const te=q&&q.usedKey||u,W=q&&q.exactUsedKey||u,C=Object.prototype.toString.apply(g),Y=["[object Number]","[object Function]","[object RegExp]"],Z=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,K=!this.i18nFormat||this.i18nFormat.handleAsObject;if(K&&g&&typeof g!="string"&&typeof g!="boolean"&&typeof g!="number"&&Y.indexOf(C)<0&&!(typeof Z=="string"&&C==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(te,g,ze(we({},i),{ns:_})):`key '${u} (${this.language})' returned an object instead of string.`;return o?(q.res=J,q):J}if(r){const J=C==="[object Array]",G=J?[]:{},j=J?W:te;for(const B in g)if(Object.prototype.hasOwnProperty.call(g,B)){const z=`${j}${r}${B}`;G[B]=this.translate(z,ze(we({},i),{joinArrays:!1,ns:_})),G[B]===z&&(G[B]=g[B])}g=G}}else if(K&&typeof Z=="string"&&C==="[object Array]")g=g.join(Z),g&&(g=this.extendTranslation(g,t,i,n));else{let J=!1,G=!1;const j=i.count!==void 0&&typeof i.count!="string",B=dp.hasDefaultValue(i),z=j?this.pluralResolver.getSuffix(E,i.count,i):"",O=i.ordinal&&j?this.pluralResolver.getSuffix(E,i.count,{ordinal:!1}):"",R=i[`defaultValue${z}`]||i[`defaultValue${O}`]||i.defaultValue;!this.isValidLookup(g)&&B&&(J=!0,g=R),this.isValidLookup(g)||(G=!0,g=u);const T=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:g,v=B&&R!==g&&this.options.updateMissing;if(G||J||v){if(this.logger.log(v?"updateKey":"missingKey",E,A,u,v?R:g),r){const P=this.resolve(u,ze(we({},i),{keySeparator:!1}));P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let m=[];const S=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&S&&S[0])for(let P=0;P<S.length;P++)m.push(S[P]);else this.options.saveMissingTo==="all"?m=this.languageUtils.toResolveHierarchy(i.lng||this.language):m.push(i.lng||this.language);const y=(P,F,U)=>{const N=B&&U!==g?U:T;this.options.missingKeyHandler?this.options.missingKeyHandler(P,A,F,N,v,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(P,A,F,N,v,i),this.emit("missingKey",P,A,F,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?m.forEach(P=>{this.pluralResolver.getSuffixes(P,i).forEach(F=>{y([P],u+F,i[`defaultValue${F}`]||R)})}):y(m,u,R))}g=this.extendTranslation(g,t,i,q,n),G&&g===u&&this.options.appendNamespaceToMissingKey&&(g=`${A}:${u}`),(G||J)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${A}:${u}`:u,J?g:void 0):g=this.options.parseMissingKeyHandler(g))}return o?(q.res=g,q):g}extendTranslation(t,i,n,o,r){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,we(we({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(ze(we({},n),{interpolation:we(we({},this.options.interpolation),n.interpolation)}));const E=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let H;if(E){const g=t.match(this.interpolator.nestingRegexp);H=g&&g.length}let q=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(q=we(we({},this.options.interpolation.defaultVariables),q)),t=this.interpolator.interpolate(t,q,n.lng||this.language,n),E){const g=t.match(this.interpolator.nestingRegexp),te=g&&g.length;H<te&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(n.lng=o.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var g=arguments.length,te=new Array(g),W=0;W<g;W++)te[W]=arguments[W];return r&&r[0]===te[0]&&!n.context?(u.logger.warn(`It seems you are nesting recursively key: ${te[0]} in key: ${i[0]}`),null):u.translate(...te,i)},n)),n.interpolation&&this.interpolator.reset()}const _=n.postProcess||this.options.postProcess,A=typeof _=="string"?[_]:_;return t!=null&&A&&A.length&&n.applyPostProcessor!==!1&&(t=lL.handle(A,t,i,this.options&&this.options.postProcessPassResolved?we({i18nResolved:o},n):n,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,r,u,_;return typeof t=="string"&&(t=[t]),t.forEach(A=>{if(this.isValidLookup(n))return;const E=this.extractFromKey(A,i),H=E.key;o=H;let q=E.namespaces;this.options.fallbackNS&&(q=q.concat(this.options.fallbackNS));const g=i.count!==void 0&&typeof i.count!="string",te=g&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),W=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",C=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);q.forEach(Y=>{this.isValidLookup(n)||(_=Y,!$C[`${C[0]}-${Y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(_)&&($C[`${C[0]}-${Y}`]=!0,this.logger.warn(`key "${o}" for languages "${C.join(", ")}" won't get resolved as namespace "${_}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(Z=>{if(this.isValidLookup(n))return;u=Z;const K=[H];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(K,H,Z,Y,i);else{let G;g&&(G=this.pluralResolver.getSuffix(Z,i.count,i));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(K.push(H+G),i.ordinal&&G.indexOf(B)===0&&K.push(H+G.replace(B,this.options.pluralSeparator)),te&&K.push(H+j)),W){const z=`${H}${this.options.contextSeparator}${i.context}`;K.push(z),g&&(K.push(z+G),i.ordinal&&G.indexOf(B)===0&&K.push(z+G.replace(B,this.options.pluralSeparator)),te&&K.push(z+j))}}let J;for(;J=K.pop();)this.isValidLookup(n)||(r=J,n=this.getResource(Z,Y,J,i))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:u,usedNS:_}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,n,o):this.resourceStore.getResource(t,i,n,o)}static hasDefaultValue(t){const i="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i===n.substring(0,i.length)&&t[n]!==void 0)return!0;return!1}}function mg(e){return e.charAt(0).toUpperCase()+e.slice(1)}class UC{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nr.create("languageUtils")}getScriptPartFromCode(t){if(t=up(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=up(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(o=>o.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=mg(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=mg(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=mg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach(n=>{if(i)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(i=o)}),!i&&this.options.supportedLngs&&t.forEach(n=>{if(i)return;const o=this.getLanguagePartFromCode(n);if(this.isSupportedCode(o))return i=o;i=this.options.supportedLngs.find(r=>{if(r===o||!(r.indexOf("-")<0&&o.indexOf("-")<0)&&r.indexOf(o)===0)return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];let n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}toResolveHierarchy(t,i){const n=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],r=u=>{u&&(this.isSupportedCode(u)?o.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),n.forEach(u=>{o.indexOf(u)<0&&r(this.formatLanguageCode(u))}),o}}let BU=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],zU={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const FU=["v1","v2","v3"],WU=["v4"],VC={zero:0,one:1,two:2,few:3,many:4,other:5};function HU(){const e={};return BU.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:zU[t.fc]}})}),e}class $U{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=nr.create("pluralResolver"),(!this.options.compatibilityJSON||WU.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=HU()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(up(t),{type:i.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(o=>`${i}${o}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,i);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((o,r)=>VC[o]-VC[r]).map(o=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o}`):n.numbers.map(o=>this.getSuffix(t,o,i)):[]}getSuffix(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,n);return o?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(i)}`:this.getSuffixRetroCompatible(o,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const n=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let o=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const r=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!FU.includes(this.options.compatibilityJSON)}}function GC(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=NU(e,t,i);return!r&&o&&typeof i=="string"&&(r=cp(e,i,n),r===void 0&&(r=cp(t,i,n))),r}class UU{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nr.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const i=t.interpolation;this.escape=i.escape!==void 0?i.escape:IU,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Cs(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Cs(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Cs(i.nestingPrefix):i.nestingPrefixEscaped||Cs("$t("),this.nestingSuffix=i.nestingSuffix?Cs(i.nestingSuffix):i.nestingSuffixEscaped||Cs(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const i=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(i,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,i,n,o){let r,u,_;const A=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function E(te){return te.replace(/\$/g,"$$$$")}const H=te=>{if(te.indexOf(this.formatSeparator)<0){const Z=GC(i,A,te,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Z,void 0,n,ze(we(we({},o),i),{interpolationkey:te})):Z}const W=te.split(this.formatSeparator),C=W.shift().trim(),Y=W.join(this.formatSeparator).trim();return this.format(GC(i,A,C,this.options.keySeparator,this.options.ignoreJSONStructure),Y,n,ze(we(we({},o),i),{interpolationkey:C}))};this.resetRegExp();const q=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:te=>E(te)},{regex:this.regexp,safeValue:te=>this.escapeValue?E(this.escape(te)):E(te)}].forEach(te=>{for(_=0;r=te.regex.exec(t);){const W=r[1].trim();if(u=H(W),u===void 0)if(typeof q=="function"){const Y=q(t,r,o);u=typeof Y=="string"?Y:""}else if(o&&Object.prototype.hasOwnProperty.call(o,W))u="";else if(g){u=r[0];continue}else this.logger.warn(`missed to pass in variable ${W} for interpolating ${t}`),u="";else typeof u!="string"&&!this.useRawValueToEscape&&(u=FC(u));const C=te.safeValue(u);if(t=t.replace(r[0],C),g?(te.regex.lastIndex+=u.length,te.regex.lastIndex-=r[0].length):te.regex.lastIndex=0,_++,_>=this.maxReplaces)break}}),t}nest(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,r,u;function _(A,E){const H=this.nestingOptionsSeparator;if(A.indexOf(H)<0)return A;const q=A.split(new RegExp(`${H}[ ]*{`));let g=`{${q[1]}`;A=q[0],g=this.interpolate(g,u);const te=g.match(/'/g),W=g.match(/"/g);(te&&te.length%2===0&&!W||W.length%2!==0)&&(g=g.replace(/'/g,'"'));try{u=JSON.parse(g),E&&(u=we(we({},E),u))}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${A}`,C),`${A}${H}${g}`}return delete u.defaultValue,A}for(;o=this.nestingRegexp.exec(t);){let A=[];u=we({},n),u=u.replace&&typeof u.replace!="string"?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;let E=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const H=o[1].split(this.formatSeparator).map(q=>q.trim());o[1]=H.shift(),A=H,E=!0}if(r=i(_.call(this,o[1].trim(),u),u),r&&o[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=FC(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),r=""),E&&(r=A.reduce((H,q)=>this.format(H,q,n.lng,ze(we({},n),{interpolationkey:o[1].trim()})),r.trim())),t=t.replace(o[0],r),this.regexp.lastIndex=0}return t}}function VU(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);t==="currency"&&o.indexOf(":")<0?i.currency||(i.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?i.range||(i.range=o.trim()):o.split(";").forEach(r=>{if(!r)return;const[u,..._]=r.split(":"),A=_.join(":").trim().replace(/^'+|'+$/g,"");i[u.trim()]||(i[u.trim()]=A),A==="false"&&(i[u.trim()]=!1),A==="true"&&(i[u.trim()]=!0),isNaN(A)||(i[u.trim()]=parseInt(A,10))})}return{formatName:t,formatOptions:i}}function Ss(e){const t={};return function(i,n,o){const r=n+JSON.stringify(o);let u=t[r];return u||(u=e(up(n),o),t[r]=u),u(i)}}class GU{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=nr.create("formatter"),this.options=t,this.formats={number:Ss((i,n)=>{const o=new Intl.NumberFormat(i,we({},n));return r=>o.format(r)}),currency:Ss((i,n)=>{const o=new Intl.NumberFormat(i,ze(we({},n),{style:"currency"}));return r=>o.format(r)}),datetime:Ss((i,n)=>{const o=new Intl.DateTimeFormat(i,we({},n));return r=>o.format(r)}),relativetime:Ss((i,n)=>{const o=new Intl.RelativeTimeFormat(i,we({},n));return r=>o.format(r,n.range||"day")}),list:Ss((i,n)=>{const o=new Intl.ListFormat(i,we({},n));return r=>o.format(r)})},this.init(t)}init(t){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Ss(i)}format(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((r,u)=>{const{formatName:_,formatOptions:A}=VU(u);if(this.formats[_]){let E=r;try{const H=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},q=H.locale||H.lng||o.locale||o.lng||n;E=this.formats[_](r,q,we(we(we({},A),o),H))}catch(H){this.logger.warn(H)}return E}else this.logger.warn(`there was no format function for ${_}`);return r},t)}}function YU(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class XU extends Af{constructor(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=nr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,o.backend,o)}queueLoad(t,i,n,o){const r={},u={},_={},A={};return t.forEach(E=>{let H=!0;i.forEach(q=>{const g=`${E}|${q}`;!n.reload&&this.store.hasResourceBundle(E,q)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?u[g]===void 0&&(u[g]=!0):(this.state[g]=1,H=!1,u[g]===void 0&&(u[g]=!0),r[g]===void 0&&(r[g]=!0),A[q]===void 0&&(A[q]=!0)))}),H||(_[E]=!0)}),(Object.keys(r).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(u),toLoadLanguages:Object.keys(_),toLoadNamespaces:Object.keys(A)}}loaded(t,i,n){const o=t.split("|"),r=o[0],u=o[1];i&&this.emit("failedLoading",r,u,i),n&&this.store.addResourceBundle(r,u,n),this.state[t]=i?-1:2;const _={};this.queue.forEach(A=>{LU(A.loaded,[r],u),YU(A,t),i&&A.errors.push(i),A.pendingCount===0&&!A.done&&(Object.keys(A.loaded).forEach(E=>{_[E]||(_[E]={});const H=A.loaded[E];H.length&&H.forEach(q=>{_[E][q]===void 0&&(_[E][q]=!0)})}),A.done=!0,A.errors.length?A.callback(A.errors):A.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(A=>!A.done)}read(t,i,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:n,tried:o,wait:r,callback:u});return}this.readingCalls++;const _=(E,H)=>{if(this.readingCalls--,this.waitingReads.length>0){const q=this.waitingReads.shift();this.read(q.lng,q.ns,q.fcName,q.tried,q.wait,q.callback)}if(E&&H&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,n,o+1,r*2,u)},r);return}u(E,H)},A=this.backend[n].bind(this.backend);if(A.length===2){try{const E=A(t,i);E&&typeof E.then=="function"?E.then(H=>_(null,H)).catch(_):_(null,E)}catch(E){_(E)}return}return A(t,i,_)}prepareLoading(t,i){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(u=>{this.loadOne(u)})}load(t,i,n){this.prepareLoading(t,i,{},n)}reload(t,i,n){this.prepareLoading(t,i,{reload:!0},n)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,(u,_)=>{u&&this.logger.warn(`${i}loading namespace ${r} for language ${o} failed`,u),!u&&_&&this.logger.log(`${i}loaded namespace ${r} for language ${o}`,_),this.loaded(t,u,_)})}saveMissing(t,i,n,o,r){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},_=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${n}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const A=ze(we({},u),{isUpdate:r}),E=this.backend.create.bind(this.backend);if(E.length<6)try{let H;E.length===5?H=E(t,i,n,o,A):H=E(t,i,n,o),H&&typeof H.then=="function"?H.then(q=>_(null,q)).catch(_):_(null,H)}catch(H){_(H)}else E(t,i,n,o,_,A)}!t||!t[0]||this.store.addResource(t[0],i,n,o)}}}function YC(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(n=>{t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:(e,t,i,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function XC(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Id(){}function qU(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}class uu extends Af{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=XC(t),this.services={},this.logger=nr,this.modules={external:[]},qU(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(n=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const o=YC();this.options=we(we(we({},o),this.options),XC(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=we(we({},o.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(A){return A?typeof A=="function"?new A:A:null}if(!this.options.isClone){this.modules.logger?nr.init(r(this.modules.logger),this.options):nr.init(null,this.options);let A;this.modules.formatter?A=this.modules.formatter:typeof Intl!="undefined"&&(A=GU);const E=new UC(this.options);this.store=new HC(this.options.resources,this.options);const H=this.services;H.logger=nr,H.resourceStore=this.store,H.languageUtils=E,H.pluralResolver=new $U(E,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),A&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(H.formatter=r(A),H.formatter.init(H,this.options),this.options.interpolation.format=H.formatter.format.bind(H.formatter)),H.interpolator=new UU(this.options),H.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},H.backendConnector=new XU(r(this.modules.backend),H.resourceStore,H,this.options),H.backendConnector.on("*",function(q){for(var g=arguments.length,te=new Array(g>1?g-1:0),W=1;W<g;W++)te[W-1]=arguments[W];t.emit(q,...te)}),this.modules.languageDetector&&(H.languageDetector=r(this.modules.languageDetector),H.languageDetector.init&&H.languageDetector.init(H,this.options.detection,this.options)),this.modules.i18nFormat&&(H.i18nFormat=r(this.modules.i18nFormat),H.i18nFormat.init&&H.i18nFormat.init(this)),this.translator=new dp(this.services,this.options),this.translator.on("*",function(q){for(var g=arguments.length,te=new Array(g>1?g-1:0),W=1;W<g;W++)te[W-1]=arguments[W];t.emit(q,...te)}),this.modules.external.forEach(q=>{q.init&&q.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Id),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const A=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);A.length>0&&A[0]!=="dev"&&(this.options.lng=A[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(A=>{this[A]=function(){return t.store[A](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(A=>{this[A]=function(){return t.store[A](...arguments),t}});const u=tc(),_=()=>{const A=(E,H)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(H),n(E,H)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return A(null,this.t.bind(this));this.changeLanguage(this.options.lng,A)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),u}loadResources(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return i();const o=[],r=u=>{u&&this.services.languageUtils.toResolveHierarchy(u).forEach(_=>{o.indexOf(_)<0&&o.push(_)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>r(u)),this.options.preload&&this.options.preload.forEach(u=>r(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,i,n){const o=tc();return t||(t=this.languages),i||(i=this.options.ns),n||(n=Id),this.services.backendConnector.reload(t,i,r=>{o.resolve(),n(r)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&lL.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let i=0;i<this.languages.length;i++){const n=this.languages[i];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,i){var n=this;this.isLanguageChangingTo=t;const o=tc();this.emit("languageChanging",t);const r=A=>{this.language=A,this.languages=this.services.languageUtils.toResolveHierarchy(A),this.resolvedLanguage=void 0,this.setResolvedLanguage(A)},u=(A,E)=>{E?(r(E),this.translator.changeLanguage(E),this.isLanguageChangingTo=void 0,this.emit("languageChanged",E),this.logger.log("languageChanged",E)):this.isLanguageChangingTo=void 0,o.resolve(function(){return n.t(...arguments)}),i&&i(A,function(){return n.t(...arguments)})},_=A=>{!t&&!A&&this.services.languageDetector&&(A=[]);const E=typeof A=="string"?A:this.services.languageUtils.getBestMatchFromCodes(A);E&&(this.language||r(E),this.translator.language||this.translator.changeLanguage(E),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(E)),this.loadResources(E,H=>{u(H,E)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(_):this.services.languageDetector.detect(_):_(t),o}getFixedT(t,i,n){var o=this;const r=function(u,_){let A;if(typeof _!="object"){for(var E=arguments.length,H=new Array(E>2?E-2:0),q=2;q<E;q++)H[q-2]=arguments[q];A=o.options.overloadTranslationOptionHandler([u,_].concat(H))}else A=we({},_);A.lng=A.lng||r.lng,A.lngs=A.lngs||r.lngs,A.ns=A.ns||r.ns,A.keyPrefix=A.keyPrefix||n||r.keyPrefix;const g=o.options.keySeparator||".";let te;return A.keyPrefix&&Array.isArray(u)?te=u.map(W=>`${A.keyPrefix}${g}${W}`):te=A.keyPrefix?`${A.keyPrefix}${g}${u}`:u,o.t(te,A)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=n,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=i.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const u=(_,A)=>{const E=this.services.backendConnector.state[`${_}|${A}`];return E===-1||E===2};if(i.precheck){const _=i.precheck(this,u);if(_!==void 0)return _}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(n,t)&&(!o||u(r,t)))}loadNamespaces(t,i){const n=tc();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),i&&i(o)}),n):(i&&i(),Promise.resolve())}loadLanguages(t,i){const n=tc();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],r=t.filter(u=>o.indexOf(u)<0);return r.length?(this.options.preload=o.concat(r),this.loadResources(u=>{n.resolve(),i&&i(u)}),n):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new UC(YC());return i.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new uu(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Id;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const o=ze(we(we({},this.options),t),{isClone:!0}),r=new uu(o);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(u=>{r[u]=this[u]}),r.services=we({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n&&(r.store=new HC(this.store.data,o),r.services.resourceStore=r.store),r.translator=new dp(r.services,o),r.translator.on("*",function(u){for(var _=arguments.length,A=new Array(_>1?_-1:0),E=1;E<_;E++)A[E-1]=arguments[E];r.emit(u,...A)}),r.init(o,i),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const cL=uu.createInstance();cL.createInstance=uu.createInstance;const ZU={error:"Error"},KU={error:"Помилка"},qC="common",JU={en:ZU,uk:KU},Yo=cL.createInstance({defaultNS:qC,resources:QU(JU,qC),lng:"en",fallbackLng:"en"}),uL={i18nextInstance:Yo,initPromise:Yo.init().then(()=>Yo)},Nh=new Map;Nh.set("common",uL);const dL=e=>{if(Nh.has(e.namespace))return Nh.get(e.namespace);if(e.plugins)for(const r of e.plugins)Yo.use(r);Object.keys(e.resource).forEach(r=>{Yo.addResourceBundle(r,e.namespace,e.resource[r])});const t=Yo.cloneInstance({defaultNS:e.namespace});let i=uL.initPromise.then(()=>t);t.on("languageChanged",r=>{Yo.language!==r&&Yo.changeLanguage(r)}),Yo.on("languageChanged",r=>{t.language!==r&&t.changeLanguage(r)});const n=e.language||"en";Yo.language!==n&&(i=i.then(()=>t.changeLanguage(n)).then(()=>t));const o={initPromise:i,i18nextInstance:t};return Nh.set(e.namespace,o),o};function QU(e,t){return Object.keys(e).reduce((i,n)=>(i[n]={[t]:e[n]},i),{})}function eV(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function tV(e,t){if(!e||typeof e!="string")return e;const i=new URL(e);return i.origin+(i.pathname.endsWith("/")?i.pathname:i.pathname+"/")+""}var hL=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function iV(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),i}var Rd={exports:{}},ZC;function nV(){if(ZC)return Rd.exports;ZC=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(G,j,B){return Function.prototype.apply.call(G,j,B)},i;e&&typeof e.ownKeys=="function"?i=e.ownKeys:Object.getOwnPropertySymbols?i=function(G){return Object.getOwnPropertyNames(G).concat(Object.getOwnPropertySymbols(G))}:i=function(G){return Object.getOwnPropertyNames(G)};function n(G){console&&console.warn&&console.warn(G)}var o=Number.isNaN||function(G){return G!==G};function r(){r.init.call(this)}Rd.exports=r,Rd.exports.once=Z,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var u=10;function _(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(G){if(typeof G!="number"||G<0||o(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");u=G}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(G){if(typeof G!="number"||G<0||o(G))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+G+".");return this._maxListeners=G,this};function A(G){return G._maxListeners===void 0?r.defaultMaxListeners:G._maxListeners}r.prototype.getMaxListeners=function(){return A(this)},r.prototype.emit=function(G){for(var j=[],B=1;B<arguments.length;B++)j.push(arguments[B]);var z=G==="error",O=this._events;if(O!==void 0)z=z&&O.error===void 0;else if(!z)return!1;if(z){var R;if(j.length>0&&(R=j[0]),R instanceof Error)throw R;var T=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw T.context=R,T}var v=O[G];if(v===void 0)return!1;if(typeof v=="function")t(v,this,j);else for(var m=v.length,S=W(v,m),B=0;B<m;++B)t(S[B],this,j);return!0};function E(G,j,B,z){var O,R,T;if(_(B),R=G._events,R===void 0?(R=G._events=Object.create(null),G._eventsCount=0):(R.newListener!==void 0&&(G.emit("newListener",j,B.listener?B.listener:B),R=G._events),T=R[j]),T===void 0)T=R[j]=B,++G._eventsCount;else if(typeof T=="function"?T=R[j]=z?[B,T]:[T,B]:z?T.unshift(B):T.push(B),O=A(G),O>0&&T.length>O&&!T.warned){T.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=G,v.type=j,v.count=T.length,n(v)}return G}r.prototype.addListener=function(G,j){return E(this,G,j,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(G,j){return E(this,G,j,!0)};function H(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function q(G,j,B){var z={fired:!1,wrapFn:void 0,target:G,type:j,listener:B},O=H.bind(z);return O.listener=B,z.wrapFn=O,O}r.prototype.once=function(G,j){return _(j),this.on(G,q(this,G,j)),this},r.prototype.prependOnceListener=function(G,j){return _(j),this.prependListener(G,q(this,G,j)),this},r.prototype.removeListener=function(G,j){var B,z,O,R,T;if(_(j),z=this._events,z===void 0)return this;if(B=z[G],B===void 0)return this;if(B===j||B.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete z[G],z.removeListener&&this.emit("removeListener",G,B.listener||j));else if(typeof B!="function"){for(O=-1,R=B.length-1;R>=0;R--)if(B[R]===j||B[R].listener===j){T=B[R].listener,O=R;break}if(O<0)return this;O===0?B.shift():C(B,O),B.length===1&&(z[G]=B[0]),z.removeListener!==void 0&&this.emit("removeListener",G,T||j)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(G){var j,B,z;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[G]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[G]),this;if(arguments.length===0){var O=Object.keys(B),R;for(z=0;z<O.length;++z)R=O[z],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(j=B[G],typeof j=="function")this.removeListener(G,j);else if(j!==void 0)for(z=j.length-1;z>=0;z--)this.removeListener(G,j[z]);return this};function g(G,j,B){var z=G._events;if(z===void 0)return[];var O=z[j];return O===void 0?[]:typeof O=="function"?B?[O.listener||O]:[O]:B?Y(O):W(O,O.length)}r.prototype.listeners=function(G){return g(this,G,!0)},r.prototype.rawListeners=function(G){return g(this,G,!1)},r.listenerCount=function(G,j){return typeof G.listenerCount=="function"?G.listenerCount(j):te.call(G,j)},r.prototype.listenerCount=te;function te(G){var j=this._events;if(j!==void 0){var B=j[G];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function W(G,j){for(var B=new Array(j),z=0;z<j;++z)B[z]=G[z];return B}function C(G,j){for(;j+1<G.length;j++)G[j]=G[j+1];G.pop()}function Y(G){for(var j=new Array(G.length),B=0;B<j.length;++B)j[B]=G[B].listener||G[B];return j}function Z(G,j){return new Promise(function(B,z){function O(T){G.removeListener(j,R),z(T)}function R(){typeof G.removeListener=="function"&&G.removeListener("error",O),B([].slice.call(arguments))}J(G,j,R,{once:!0}),j!=="error"&&K(G,O,{once:!0})})}function K(G,j,B){typeof G.on=="function"&&J(G,"error",j,B)}function J(G,j,B,z){if(typeof G.on=="function")z.once?G.once(j,B):G.on(j,B);else if(typeof G.addEventListener=="function")G.addEventListener(j,function O(R){z.once&&G.removeEventListener(j,O),B(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}return Rd.exports}var oV=nV();const Xu=rs(oV);function rV(){this.__data__=[],this.size=0}function pL(e,t){return e===t||e!==e&&t!==t}function Ef(e,t){for(var i=e.length;i--;)if(pL(e[i][0],t))return i;return-1}var aV=Array.prototype,sV=aV.splice;function lV(e){var t=this.__data__,i=Ef(t,e);if(i<0)return!1;var n=t.length-1;return i==n?t.pop():sV.call(t,i,1),--this.size,!0}function cV(e){var t=this.__data__,i=Ef(t,e);return i<0?void 0:t[i][1]}function uV(e){return Ef(this.__data__,e)>-1}function dV(e,t){var i=this.__data__,n=Ef(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}function $r(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}$r.prototype.clear=rV;$r.prototype.delete=lV;$r.prototype.get=cV;$r.prototype.has=uV;$r.prototype.set=dV;function hV(){this.__data__=new $r,this.size=0}function pV(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}function fV(e){return this.__data__.get(e)}function mV(e){return this.__data__.has(e)}var gV=typeof global=="object"&&global&&global.Object===Object&&global;const fL=gV;var vV=typeof self=="object"&&self&&self.Object===Object&&self,yV=fL||vV||Function("return this")();const gr=yV;var bV=gr.Symbol;const ol=bV;var mL=Object.prototype,xV=mL.hasOwnProperty,wV=mL.toString,ic=ol?ol.toStringTag:void 0;function _V(e){var t=xV.call(e,ic),i=e[ic];try{e[ic]=void 0;var n=!0}catch(r){}var o=wV.call(e);return n&&(t?e[ic]=i:delete e[ic]),o}var CV=Object.prototype,SV=CV.toString;function TV(e){return SV.call(e)}var MV="[object Null]",kV="[object Undefined]",KC=ol?ol.toStringTag:void 0;function Ll(e){return e==null?e===void 0?kV:MV:KC&&KC in Object(e)?_V(e):TV(e)}function du(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var PV="[object AsyncFunction]",AV="[object Function]",EV="[object GeneratorFunction]",OV="[object Proxy]";function gL(e){if(!du(e))return!1;var t=Ll(e);return t==AV||t==EV||t==PV||t==OV}var LV=gr["__core-js_shared__"];const gg=LV;var JC=function(){var e=/[^.]+$/.exec(gg&&gg.keys&&gg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function NV(e){return!!JC&&JC in e}var DV=Function.prototype,IV=DV.toString;function as(e){if(e!=null){try{return IV.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var RV=/[\\^$.*+?()[\]{}|]/g,jV=/^\[object .+?Constructor\]$/,BV=Function.prototype,zV=Object.prototype,FV=BV.toString,WV=zV.hasOwnProperty,HV=RegExp("^"+FV.call(WV).replace(RV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!du(e)||NV(e))return!1;var t=gL(e)?HV:jV;return t.test(as(e))}function UV(e,t){return e==null?void 0:e[t]}function Nl(e,t){var i=UV(e,t);return $V(i)?i:void 0}var VV=Nl(gr,"Map");const hu=VV;var GV=Nl(Object,"create");const pu=GV;function YV(){this.__data__=pu?pu(null):{},this.size=0}function XV(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var qV="__lodash_hash_undefined__",ZV=Object.prototype,KV=ZV.hasOwnProperty;function JV(e){var t=this.__data__;if(pu){var i=t[e];return i===qV?void 0:i}return KV.call(t,e)?t[e]:void 0}var QV=Object.prototype,eG=QV.hasOwnProperty;function tG(e){var t=this.__data__;return pu?t[e]!==void 0:eG.call(t,e)}var iG="__lodash_hash_undefined__";function nG(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=pu&&t===void 0?iG:t,this}function Xa(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Xa.prototype.clear=YV;Xa.prototype.delete=XV;Xa.prototype.get=JV;Xa.prototype.has=tG;Xa.prototype.set=nG;function oG(){this.size=0,this.__data__={hash:new Xa,map:new(hu||$r),string:new Xa}}function rG(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Of(e,t){var i=e.__data__;return rG(t)?i[typeof t=="string"?"string":"hash"]:i.map}function aG(e){var t=Of(this,e).delete(e);return this.size-=t?1:0,t}function sG(e){return Of(this,e).get(e)}function lG(e){return Of(this,e).has(e)}function cG(e,t){var i=Of(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}function ss(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ss.prototype.clear=oG;ss.prototype.delete=aG;ss.prototype.get=sG;ss.prototype.has=lG;ss.prototype.set=cG;var uG=200;function dG(e,t){var i=this.__data__;if(i instanceof $r){var n=i.__data__;if(!hu||n.length<uG-1)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ss(n)}return i.set(e,t),this.size=i.size,this}function ra(e){var t=this.__data__=new $r(e);this.size=t.size}ra.prototype.clear=hV;ra.prototype.delete=pV;ra.prototype.get=fV;ra.prototype.has=mV;ra.prototype.set=dG;var hG="__lodash_hash_undefined__";function pG(e){return this.__data__.set(e,hG),this}function fG(e){return this.__data__.has(e)}function hp(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new ss;++t<i;)this.add(e[t])}hp.prototype.add=hp.prototype.push=pG;hp.prototype.has=fG;function mG(e,t){for(var i=-1,n=e==null?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function gG(e,t){return e.has(t)}var vG=1,yG=2;function vL(e,t,i,n,o,r){var u=i&vG,_=e.length,A=t.length;if(_!=A&&!(u&&A>_))return!1;var E=r.get(e),H=r.get(t);if(E&&H)return E==t&&H==e;var q=-1,g=!0,te=i&yG?new hp:void 0;for(r.set(e,t),r.set(t,e);++q<_;){var W=e[q],C=t[q];if(n)var Y=u?n(C,W,q,t,e,r):n(W,C,q,e,t,r);if(Y!==void 0){if(Y)continue;g=!1;break}if(te){if(!mG(t,function(Z,K){if(!gG(te,K)&&(W===Z||o(W,Z,i,n,r)))return te.push(K)})){g=!1;break}}else if(!(W===C||o(W,C,i,n,r))){g=!1;break}}return r.delete(e),r.delete(t),g}var bG=gr.Uint8Array;const QC=bG;function xG(e){var t=-1,i=Array(e.size);return e.forEach(function(n,o){i[++t]=[o,n]}),i}function wG(e){var t=-1,i=Array(e.size);return e.forEach(function(n){i[++t]=n}),i}var _G=1,CG=2,SG="[object Boolean]",TG="[object Date]",MG="[object Error]",kG="[object Map]",PG="[object Number]",AG="[object RegExp]",EG="[object Set]",OG="[object String]",LG="[object Symbol]",NG="[object ArrayBuffer]",DG="[object DataView]",eS=ol?ol.prototype:void 0,vg=eS?eS.valueOf:void 0;function IG(e,t,i,n,o,r,u){switch(i){case DG:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case NG:return!(e.byteLength!=t.byteLength||!r(new QC(e),new QC(t)));case SG:case TG:case PG:return pL(+e,+t);case MG:return e.name==t.name&&e.message==t.message;case AG:case OG:return e==t+"";case kG:var _=xG;case EG:var A=n&_G;if(_||(_=wG),e.size!=t.size&&!A)return!1;var E=u.get(e);if(E)return E==t;n|=CG,u.set(e,t);var H=vL(_(e),_(t),n,o,r,u);return u.delete(e),H;case LG:if(vg)return vg.call(e)==vg.call(t)}return!1}function RG(e,t){for(var i=-1,n=t.length,o=e.length;++i<n;)e[o+i]=t[i];return e}var jG=Array.isArray;const pp=jG;function BG(e,t,i){var n=t(e);return pp(e)?n:RG(n,i(e))}function zG(e,t){for(var i=-1,n=e==null?0:e.length,o=0,r=[];++i<n;){var u=e[i];t(u,i,e)&&(r[o++]=u)}return r}function FG(){return[]}var WG=Object.prototype,HG=WG.propertyIsEnumerable,tS=Object.getOwnPropertySymbols,$G=tS?function(e){return e==null?[]:(e=Object(e),zG(tS(e),function(t){return HG.call(e,t)}))}:FG;const UG=$G;function VG(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}function rl(e){return e!=null&&typeof e=="object"}var GG="[object Arguments]";function iS(e){return rl(e)&&Ll(e)==GG}var yL=Object.prototype,YG=yL.hasOwnProperty,XG=yL.propertyIsEnumerable,qG=iS(function(){return arguments}())?iS:function(e){return rl(e)&&YG.call(e,"callee")&&!XG.call(e,"callee")};const ZG=qG;function KG(){return!1}var bL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nS=bL&&typeof module=="object"&&module&&!module.nodeType&&module,JG=nS&&nS.exports===bL,oS=JG?gr.Buffer:void 0,QG=oS?oS.isBuffer:void 0,e9=QG||KG;const Hy=e9;var t9=9007199254740991,i9=/^(?:0|[1-9]\d*)$/;function n9(e,t){var i=typeof e;return t=t==null?t9:t,!!t&&(i=="number"||i!="symbol"&&i9.test(e))&&e>-1&&e%1==0&&e<t}var o9=9007199254740991;function xL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=o9}var r9="[object Arguments]",a9="[object Array]",s9="[object Boolean]",l9="[object Date]",c9="[object Error]",u9="[object Function]",d9="[object Map]",h9="[object Number]",p9="[object Object]",f9="[object RegExp]",m9="[object Set]",g9="[object String]",v9="[object WeakMap]",y9="[object ArrayBuffer]",b9="[object DataView]",x9="[object Float32Array]",w9="[object Float64Array]",_9="[object Int8Array]",C9="[object Int16Array]",S9="[object Int32Array]",T9="[object Uint8Array]",M9="[object Uint8ClampedArray]",k9="[object Uint16Array]",P9="[object Uint32Array]",yi={};yi[x9]=yi[w9]=yi[_9]=yi[C9]=yi[S9]=yi[T9]=yi[M9]=yi[k9]=yi[P9]=!0;yi[r9]=yi[a9]=yi[y9]=yi[s9]=yi[b9]=yi[l9]=yi[c9]=yi[u9]=yi[d9]=yi[h9]=yi[p9]=yi[f9]=yi[m9]=yi[g9]=yi[v9]=!1;function A9(e){return rl(e)&&xL(e.length)&&!!yi[Ll(e)]}function E9(e){return function(t){return e(t)}}var wL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fc=wL&&typeof module=="object"&&module&&!module.nodeType&&module,O9=Fc&&Fc.exports===wL,yg=O9&&fL.process,L9=function(){try{var e=Fc&&Fc.require&&Fc.require("util").types;return e||yg&&yg.binding&&yg.binding("util")}catch(t){}}();const rS=L9;var aS=rS&&rS.isTypedArray,N9=aS?E9(aS):A9;const _L=N9;var D9=Object.prototype,I9=D9.hasOwnProperty;function R9(e,t){var i=pp(e),n=!i&&ZG(e),o=!i&&!n&&Hy(e),r=!i&&!n&&!o&&_L(e),u=i||n||o||r,_=u?VG(e.length,String):[],A=_.length;for(var E in e)I9.call(e,E)&&!(u&&(E=="length"||o&&(E=="offset"||E=="parent")||r&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||n9(E,A)))&&_.push(E);return _}var j9=Object.prototype;function B9(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||j9;return e===i}function z9(e,t){return function(i){return e(t(i))}}var F9=z9(Object.keys,Object);const W9=F9;var H9=Object.prototype,$9=H9.hasOwnProperty;function U9(e){if(!B9(e))return W9(e);var t=[];for(var i in Object(e))$9.call(e,i)&&i!="constructor"&&t.push(i);return t}function V9(e){return e!=null&&xL(e.length)&&!gL(e)}function G9(e){return V9(e)?R9(e):U9(e)}function sS(e){return BG(e,G9,UG)}var Y9=1,X9=Object.prototype,q9=X9.hasOwnProperty;function Z9(e,t,i,n,o,r){var u=i&Y9,_=sS(e),A=_.length,E=sS(t),H=E.length;if(A!=H&&!u)return!1;for(var q=A;q--;){var g=_[q];if(!(u?g in t:q9.call(t,g)))return!1}var te=r.get(e),W=r.get(t);if(te&&W)return te==t&&W==e;var C=!0;r.set(e,t),r.set(t,e);for(var Y=u;++q<A;){g=_[q];var Z=e[g],K=t[g];if(n)var J=u?n(K,Z,g,t,e,r):n(Z,K,g,e,t,r);if(!(J===void 0?Z===K||o(Z,K,i,n,r):J)){C=!1;break}Y||(Y=g=="constructor")}if(C&&!Y){var G=e.constructor,j=t.constructor;G!=j&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof j=="function"&&j instanceof j)&&(C=!1)}return r.delete(e),r.delete(t),C}var K9=Nl(gr,"DataView");const $y=K9;var J9=Nl(gr,"Promise");const Uy=J9;var Q9=Nl(gr,"Set");const Vy=Q9;var eY=Nl(gr,"WeakMap");const Gy=eY;var lS="[object Map]",tY="[object Object]",cS="[object Promise]",uS="[object Set]",dS="[object WeakMap]",hS="[object DataView]",iY=as($y),nY=as(hu),oY=as(Uy),rY=as(Vy),aY=as(Gy),Na=Ll;($y&&Na(new $y(new ArrayBuffer(1)))!=hS||hu&&Na(new hu)!=lS||Uy&&Na(Uy.resolve())!=cS||Vy&&Na(new Vy)!=uS||Gy&&Na(new Gy)!=dS)&&(Na=function(e){var t=Ll(e),i=t==tY?e.constructor:void 0,n=i?as(i):"";if(n)switch(n){case iY:return hS;case nY:return lS;case oY:return cS;case rY:return uS;case aY:return dS}return t});const pS=Na;var sY=1,fS="[object Arguments]",mS="[object Array]",jd="[object Object]",lY=Object.prototype,gS=lY.hasOwnProperty;function cY(e,t,i,n,o,r){var u=pp(e),_=pp(t),A=u?mS:pS(e),E=_?mS:pS(t);A=A==fS?jd:A,E=E==fS?jd:E;var H=A==jd,q=E==jd,g=A==E;if(g&&Hy(e)){if(!Hy(t))return!1;u=!0,H=!1}if(g&&!H)return r||(r=new ra),u||_L(e)?vL(e,t,i,n,o,r):IG(e,t,A,i,n,o,r);if(!(i&sY)){var te=H&&gS.call(e,"__wrapped__"),W=q&&gS.call(t,"__wrapped__");if(te||W){var C=te?e.value():e,Y=W?t.value():t;return r||(r=new ra),o(C,Y,i,n,r)}}return g?(r||(r=new ra),Z9(e,t,i,n,o,r)):!1}function CL(e,t,i,n,o){return e===t?!0:e==null||t==null||!rl(e)&&!rl(t)?e!==e&&t!==t:cY(e,t,i,n,CL,o)}function Yy(e,t){return CL(e,t)}const Mt={HEADERS:"headers",METADATA:"metadata",DATA:"data",GRAND:"grand",FINISH:"finish",ERROR:"error",TOTAL_ROWS:"totalRows",DATA_FINISH:"dataFinish",DATABARS:"dataBars",RANGE_MIN_MAX:"rangeMinMax"},uY=[Mt.ERROR,Mt.HEADERS,Mt.GRAND,Mt.METADATA,Mt.DATA,Mt.DATA_FINISH,Mt.TOTAL_ROWS,Mt.DATABARS,Mt.RANGE_MIN_MAX,Mt.FINISH],St={ROWS:"rows",COLUMNS:"columns",MEASURES:"measures",SCOPE:"scope"},Oi={ASC:"asc",DESC:"desc"},oi={SUB_TOTAL:"subTotal",GRAND_TOTAL:"grandTotal",MEASURE_TOP:"measureTop",MEASURE_BOTTOM:"measureBottom",CORNER:"corner"},vS={COLOR:"color",CONDITION:"condition"},Pr={DATETIME:"datetime",TEXT:"text",NUMERIC:"numeric"},Ts={MEMBER:"member",VALUE:"value",SUB_TOTAL:"subtotal",GRAND_TOTAL:"grandtotal"},ea={MEMBER:"member",INDEX:"index",TITLE:"title",NAME:"name",AGG:"agg",DIM:"dim"};class dY{constructor(t,i,n,o){Ne(this,"rowIndex"),Ne(this,"colIndex"),Ne(this,"node"),Ne(this,"parent"),Ne(this,"childColCells",[]),Ne(this,"childRowCells",[]),Ne(this,"indexInParent",-1),Ne(this,"siblingCount",0),this.rowIndex=t,this.colIndex=i,this.node=n,this.parent=o}isChild(){return!this.node}hasChildren(){return!!(this.childColCells.length||this.childRowCells.length)}hasColCell(){return this.childColCells.length>0}addColCell(t){this.childColCells.push(t)}getColCell(){return this.childColCells||[]}hasRowCell(){return this.childRowCells.length>0}addRowCell(t){this.childRowCells.push(t)}getRowCell(){return this.childRowCells||[]}getStopRowIndex(){return this.hasRowCell()?this.rowIndex+this.getRowCell().length:this.rowIndex}getStopColIndex(){return this.hasColCell()?this.colIndex+this.getColCell().length:this.colIndex}setIndexInParent(t,i){this.indexInParent=t,this.siblingCount=i}getIndexInParent(){return{indexInParent:this.indexInParent,siblingCount:this.siblingCount}}getParenPosition(){if(!this.parent)return;const t=(this.parent||"").match(/\d+/g)||[];return[Number(t[0]),Number(t[1])]}}const fp=["S&PManager","Cache"],mp=["null"];class fu{constructor(t=""){Ne(this,"name"),Ne(this,"log"),Ne(this,"warn"),Ne(this,"error"),Ne(this,"console"),this.name=t,this.log=()=>{},this.warn=()=>{},this.error=()=>{},this.console=fu.createMockConsole(),this.createLogFn()}setName(t){this.name=t,this.createLogFn()}getName(){return this.name}createLogFn(){this.log=()=>{},this.warn=()=>{},this.error=()=>{}}isExcludedName(){return mp.length&&!this.hasNamePartsInList(mp)?!0:fp.length?this.hasNamePartsInList(fp):!1}hasNamePartsInList(t){const i=this.name.toLowerCase();return t.some(n=>i.includes(n.toLowerCase()))}static createMockConsole(){return{log:()=>{},warn:()=>{},error:()=>{}}}static createMock(){const t=fu.createMockConsole();return ze(we({setName:()=>{},getName:()=>""},t),{console:t})}}const hY=e=>new fu(e),pY=(e="")=>{fp.push(e.toLowerCase())},fY=(e="")=>{mp.push(e.toLowerCase())},mY=()=>{fp.length=0,mp.length=0},ba={Logger:fu,create:hY,excludeLogs:pY,includeLogs:fY,clearIncludeExclude:mY},SL=[Date,Error,RegExp,Promise];function TL(e,t=SL){return t.some(i=>e instanceof i)}function yS(e,t=[]){let i=!1;return t.forEach(n=>{e.includes(n)&&(i=!0)}),i}function ML(e=[],t,i){const n=[];return i&&e.forEach(o=>{n.push(`${o}.$`)}),e.length?e.forEach(o=>{n.push(`${o}.${t}`)}):n.push(t),n}function Wc(e){return!(e===null||typeof e=="undefined"||typeof e!="object")}function gY(e,t){return Wc(e)&&e?Array.isArray(e)?!e.length:TL(e,t)?!1:!Object.keys(e).length:e==null}function vY(e=""){const t=e.split(".");return t.length>1?(t.pop(),t.join(".")):t[0]}function bS(e,t,i){return e.length?yS(e,i):t.length?!yS(t,i):!0}function kL(e,t=[],i=[],n=[],o={},r={},u=[],_=[]){if(!Wc(e))return{commonIncludeKeys:[],commonExcludeKeys:[]};const A=u.indexOf(e);if(A!==-1)return _[A];u.push(e);const E=Object.keys(e),H=Array.isArray(e);let q=[],g=[];const te=[],W=[];if(E.forEach(C=>{const Y=e[C],Z=ML(n,C,H),K=n[0]||"&";o[K]=o[K]||[],r[K]=r[K]||[],Z.forEach(J=>{(t||[]).includes(J)&&(o[K].push(J),q.push(J)),(t||[]).forEach(G=>{const j=vY(G);(`${j}.$`===K||j===K)&&(o[K].includes(G)||o[K].push(G),q.includes(G)||q.push(G))}),(i||[]).includes(J)&&(r[K].push(J),g.push(J))}),Wc(Y)&&kL(Y,t,i,Z,o,r,u,_)}),Wc(e)){let C=n[0]||"&";Array.isArray(e)&&(C=`${C}.$`),o[C]=(o[C]||[]).concat(te),q=q.concat(te),r[C]=(r[C]||[]).concat(W),g=q.concat(W)}return _.push({commonIncludeKeys:q,commonExcludeKeys:g}),{commonIncludeKeys:q,commonExcludeKeys:g}}function PL(e,t,i=new WeakMap){const{includeKeys:n,includeKeysObj:o,excludeKeys:r,excludeKeysObj:u,parentKeys:_=[],excludeEmpty:A,referenceClone:E}=t||{};if(!Wc(e)||TL(e,E))return e;if(i.has(e))return i.get(e);const H=Object.keys(e),q=Array.isArray(e),g=q?[]:{};i.set(e,g);const te=_[0]||"&",W=(o||{})[te]||[],C=(u||{})[te]||[];return H.forEach(Y=>{const Z=e[Y];let K=[],J=!0;if(n||r?J=bS(n||[],r||[],[Y]):(o||u)&&(K=ML(_,Y,q),J=bS(W,C,K)),J){const G=PL(Z,ze(we({},t),{parentKeys:K}),i);(!A||!gY(G,E))&&(q?g.push(G):g[Y]=G)}}),g}function Ln(e,t){const i=t||{},{include:n,exclude:o}=i,r=ot(i,["include","exclude"]);let u,_;(n||o)&&(u={},_={},kL(e,n,o,[],u,_));const A=ze(we({},r),{includeKeysObj:u,excludeKeysObj:_});return PL(e,A)}Ln.REFERENCE_CLONE_TYPES=SL;const bg=e=>t=>e.replace(/{{(\w+)}}/g,(i,n)=>typeof t[n]!="undefined"?t[n]:n),AL=(e,t)=>{let i,n,o=null;const r=(...u)=>{i?o=u:(e(...u),i=!0,o=null,n=setTimeout(()=>{i=!1,o&&(e(...o),o=null)},t))};return r.cancel=()=>{clearTimeout(n),i=!1},r},EL=(e,t)=>{const i={};return Object.keys(e).forEach(n=>{e[n]!==t[n]&&(i[n]=t[n])}),Object.keys(t).forEach(n=>{typeof i[n]=="undefined"&&e[n]!==t[n]&&(i[n]=t[n])}),i};function Xy(e=!0){let t={},i=null;return({callback:n,indices:o})=>{const r=Object.keys(o),u=!e||r.every(A=>{const E=o[A];return Array.isArray(E)?E.length>0:E>=0}),_=r.length!==Object.keys(t).length||r.some(A=>{const E=t[A],H=o[A];return Array.isArray(H)?E.join(",")!==H.join(","):E!==H});return t=o,u&&_&&(i=n(o)),i}}function xS(e,t,i=0){for(let n=i;n<e.length;n+=1){const o=e[n];if(t(o,n,e))return n}return-1}const mu="$*$root$*$";function yY(e,t,i,n){const o={value:e};return t&&(o.children=t),i&&(o.data=i),typeof n!="undefined"&&(o.index=n),o}function Lf(e){return!!(e&&e.children&&e.children.length)}function No(e){return e&&e.children||[]}function qy(e,t){e&&t&&Array.isArray(t)&&(e.children=t)}function bY(e,t){e&&(e.level=t)}function xY(e){return e&&typeof e.level!="undefined"?e.level||0:-1}function Bs(e){if(!e)return;if(e&&!Array.isArray(e)&&e.value===mu)return e;const t={value:mu,children:[]};return Array.isArray(e)?t.children=e:(t.children||[])[0]=e,t}function OL(e,t,i=0){let n;if(!e||!t)return n;if(t(e,i)&&(n=e),Lf(e)){const o=No(e),r=o.length;for(let u=0;u<r;u+=1){const _=OL(o[u],t,i+1);if(_){n=_;break}}}return n}function wY(e,t){if(!e&&!t)return;if(!e&&t)return Bs(t);if(e&&!t)return Bs(e);const i=Bs(e),n=Bs(t),o=i&&i.children||[],r=n&&n.children||[],u=o.concat(r);return Bs(u)}const LL=(e,t=0)=>{if(!e||!e.isPart)return;e.level=t;const i=No(e),n=i[i.length-1];return n&&LL(n,t+1)||e},NL=(e,t,i=0)=>{if(!e||!e.isPart)return;if(e.level=i,e&&t&&e.value===t.value&&e.level===t.level)return e;const n=No(e)[0];return n&&NL(n,t,i+1)||e};function _Y(e,t){let i=LL(e),n=NL(t,i);i&&i.children&&Array.isArray(i.children)&&n&&n.children&&Array.isArray(n.children)&&n.children.length>0&&(i.children=i.children.concat(n.children),n.isHandled=!0);let o=!1;for(i=e,n=t;i&&i.children&&Array.isArray(i.children)&&n&&n.children&&Array.isArray(n.children)&&!n.isHandled;){const r=i.children;i=i.children[i.children.length-1];let u=0;for(n.children[0]&&!o&&(o=!No(n.children[0]).some(_=>_.isPart),u=1);u<n.children.length;)r.push(n.children[u]),u+=1;n=n.children[0]}return e}function DL(e,t,i){!e||!t||e.forEach(n=>{t(n,i),Lf(n)&&DL(No(n),t,n)})}function IL(e,t=[],i=0,n={maxLevel:0}){return e.forEach(o=>{n.maxLevel<i&&(n.maxLevel=i),Lf(o)?IL(No(o),t,i+1,n):t.push(o)}),t}function Nf(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let i=t.clearCache||!1;!Array.isArray(e)&&e.value===mu&&(i=!0);let n=1,o=[];return Array.isArray(e)?(n=0,o=e):e.children&&(o=No(e)),o&&o.length&&(!i&&!Array.isArray(e)&&typeof e.childCount=="number"?n=e.childCount:(n=0,o.forEach(r=>{n+=Nf(r,t)}),Array.isArray(e)||(e.childCount=n))),n}function RL(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let i=t.clearCache||!1;!Array.isArray(e)&&e.value===mu&&(i=!0);let n=0,o=[];if(e&&!Array.isArray(e)&&typeof e.value!="undefined"&&(n=1),Array.isArray(e)?(n=0,o=e):e.children&&(o=No(e)),o&&o.length)if(!i&&!Array.isArray(e)&&typeof e.childDeep=="number")n+=e.childDeep;else{let r=0;o.forEach(u=>{const _=RL(u,t);_>r&&(r=_)}),n+=r,Array.isArray(e)||(e.childDeep=r)}return n}function jL(e=[],t=0,i){const n=[];let o=0,r=-1,u=-1;const _=e.length;if(typeof t=="number"&&typeof i=="number"&&t>i)throw new Error('Wrong "getNodesByChildCount" diapason');if(typeof t=="number"&&t<0)throw new Error('Wrong "from" index for "getNodesByChildCount"');for(let A=0;A<_;A+=1){const E=e[A],H=Nf(E);if(o+H>t&&(r<0&&(r=o),n.push(E),typeof i=="number"&&o+H>=i)){u=o+H;break}u=o+H,o+=H}return{nodes:n,start:r,stop:u}}function CY(e){e.isMapped!==void 0&&(e.isMapped=void 0),e.minLevel!==void 0&&(e.minLevel=void 0),e.childCount!==void 0&&(e.childCount=void 0),e.childDeep!==void 0&&(e.childDeep=void 0)}function Zy(e=[],t=0,i,n){const{cloneFn:o=Ln}=n||{},r=[],{nodes:u,start:_,stop:A}=jL(e,t,i),E=u.length;let H,q,g=!0;if(_<t){const te=u[0]||{},W=t-_;let C;E===1&&typeof i=="number"&&(C=i-_,g=!1),H=o(te,!0);const Y=Zy(No(te),W,C,n);qy(H,Y)}if(typeof i=="number"&&A>i&&g){const te=u[E-1]||{},W=0,C=Nf(te)-(A-i);q=o(te,!0);const Y=Zy(No(te),W,C,n);qy(q,Y)}return u.forEach((te,W)=>{if(H&&W===0)r.push(H);else if(q&&W===E-1)r.push(q);else{const C=o(te);r.push(C)}}),r}const lt={ROOT:mu,create:yY,hasChildren:Lf,getChildren:No,setChildren:qy,setLevel:bY,getLevel:xY,getLastLevelNodes:IL,iterateThroughTree:DL,wrapInRootNode:Bs,findNode:OL,merge:wY,deepMerge:_Y,getChildLength:Nf,getDeepLength:RL,getNodesByChildCount:jL,getCutNodesByChildCount:Zy,clearNodeCache:CY},Ji={FIRST:"first",LAST:"last",EVEN:"even",ODD:"odd"},Ms=(e,t)=>`${e}-${t}`;class SY{constructor(t,i=!1,n){Ne(this,"tree"),Ne(this,"hasGrandTotals",!1),Ne(this,"isVertical",!1),Ne(this,"deep"),Ne(this,"columns",[]),Ne(this,"lastLevel",[]),Ne(this,"map",{}),Ne(this,"metadataCache",{}),Ne(this,"valueNode"),Ne(this,"grid"),this.isVertical=i,this.deep=n,t&&(this.tree=t,this.columns=this.cacheLevels(lt.getChildren(this.tree)))}destroy(){this.tree=void 0,this.columns=[],this.lastLevel=[],this.map={},this.metadataCache={},this.valueNode=void 0,this.grid=void 0}getMainCellWidth(t,i,n,o,r={offsetTop:-1,columnsOffset:0}){const{columnsOffset:u=0}=r,_=this.getItem(t,i),A=_&&_.hasChildren()&&_.hasColCell();let E=Number.NaN,H=!0;if(_&&A){const q=_.getColCell(),g=n({index:i+u});E=q.reduce((te,W)=>{const C=n({index:W.colIndex+u});return C||(H=!1),te+C},g),E-=o,E=Math.ceil(E)}return H?E:Number.NaN}extend(t){t&&(this.grid=void 0,this.tree=lt.merge(this.tree,t),this.columns=this.cacheLevels(lt.getChildren(t),this.columns))}getGrid(){if(this.grid)return this.grid;let t=this.getTreeDeepsLength(),i=this.getTreeChildLength();return this.isVertical?([t,i]=[i,t],this.map=this.fillMapVertical(lt.getChildren(this.tree),i,this.map)):this.map=this.fillMap(lt.getChildren(this.tree),t,this.map),this.grid=Array.from(Array(t)).map((n,o)=>Array.from(Array(i)).map((r,u)=>{const _=Ms(o,u),A=this.map[_];if(!A)throw new Error(`Key "${_}" does not found in TreeService`);return A.node?A.node:A.parent})),this.grid}getPartialGrid(t,i){if(!this.isVertical)throw new Error('"getPartialGrid" can only be used for "vertical" tree');const n=this.getTreeDeepsLength(),o=lt.getChildren(this.tree),{nodes:r,start:u,stop:_}=lt.getNodesByChildCount(o,t,i);this.fillMapVertical(r,n,this.map,{parentRowIndex:u,parentColIndex:0,prevChildren:0,parentKey:""});const A=Math.max(u,t),E=Math.min(_,i),H=Math.max(0,E-t);return Array.from(Array(H)).map((q,g)=>Array.from(Array(n)).map((te,W)=>{const C=A+g,Y=Ms(C,W),Z=this.map[Y];if(!Z)throw new Error(`Key "${Y}" does not found in TreeService`);return Z.node?Z.node:Z.parent||""}))}getPartialTree(t,i,n){const o=lt.getChildren(this.tree);return lt.getCutNodesByChildCount(o,t,i,n)}getTreeNode(t,i){const n=this.getItem(t,i);if(n&&n.node)return n.node}isChildren(t,i){const n=this.getItem(t,i);if(n)return n.isChild();if(typeof this.deep=="number"&&(this.isVertical?i:t)<this.deep)return!0;throw new Error(`Item "${t}-${i}" does not found in TreeService`)}hasChildren(t,i){const n=this.getItem(t,i);if(n)return n.hasChildren();throw new Error(`Item "${t}-${i}" does not found in TreeService`)}getMainCellSpans(t,i){const n={},o=this.getItem(t,i);return o&&o.hasColCell()&&(n.colSpan=o.getColCell().length+1),o&&o.hasRowCell()&&(n.rowSpan=o.getRowCell().length+1),n}alignStartIndex(t,i=!1){let n=0,o=t;if(i&&(n=t,o=0),this.isVertical===i){let r=this.getItem(n,o);if(r&&r.isChild()&&(r=this.getItemByKey(r.parent||"")),r)return i?r.rowIndex:r.colIndex}return t}alignStopIndex(t,i=!1){let n=0,o=t;if(i&&(n=t,o=0),this.isVertical===i){let r=this.getItem(n,o);if(r&&r.isChild()&&(r=this.getItemByKey(r.parent||"")),r)return i?r.getStopRowIndex():r.getStopColIndex()}return t}getTreeChildLength(t=lt.getChildren(this.tree),i){return lt.getChildLength(t,i)}getTreeDeepsLength(t=lt.getChildren(this.tree),i){return typeof this.deep!="undefined"&&this.deep!==void 0?this.deep:lt.getDeepLength(t,i)}getLastLevelNodes(){return this.lastLevel}extractData(t){if(!t)return[];const i=t.getLastLevelNodes().map(n=>n.index);return this.getLastLevelNodes().map(n=>typeof n.data=="undefined"?[n.data]:i?i.map(o=>{let r;return typeof o!="undefined"&&n.data&&(r=n.data[o]),r}):n.data)}getMetadata(t,i,n){const o=this.getTreeDeepsLength();t===1/0&&(t=o&&o-1),i===1/0&&(i=o&&o-1);const r=`${t}-${i}`;if(this.metadataCache[r])return this.metadataCache[r];let u=this.getItemByKey(r);if(!u)throw new Error(`Can not find metadata info for ${r} cell`);let _=u?u.node:void 0;if(_||(u=this.getItemByKey(u.parent||"")),!u)throw new Error(`Can not find metadata info for parent ${r} cell`);_=u?u.node:void 0;const A=this.getItemByKey(`${t+1}-${i}`),E=A?A.node:void 0,H=_&&_.level||0,q=this.isVertical?u.getStopColIndex():u.getStopRowIndex();let{indexInParent:g,siblingCount:te}=u.getIndexInParent(),W=g;if(H===0&&(te=this.getTreeChildLength(),g=this.isVertical?u.rowIndex:u.colIndex,W=g+(this.isVertical?u.getRowCell().length:u.getColCell().length)),n){const K=n.to-n.from;te<=K&&W>K-1&&(W=K-1)}const C={levels:[],siblings:[],root:void 0,parent:void 0,valueNode:this.valueNode,nextNode:E},{indexDivergence:Y}=_||{};if(typeof Y=="number"){const K=Y===0?Ji.EVEN:Ji.ODD;C.siblings.push(K)}if(H===0&&C.levels.push(Ji.FIRST),q===o-1&&C.levels.push(Ji.LAST),g===0&&C.siblings.push(Ji.FIRST),W===te-1&&C.siblings.push(Ji.LAST),_&&H!==0){const K=this.isVertical?t:0,J=this.isVertical?0:i;C.root=this.getMetadata(K,J,n)}const Z=this.getItemByKey(u.parent||"");if(Z&&H!==0&&(C.parent=this.getMetadata(Z.rowIndex,Z.colIndex,n)),n){const K=this.isVertical?u.rowIndex:u.colIndex,J=this.isVertical?u.getStopRowIndex():u.getStopColIndex();let G;Z&&(G=this.isVertical?Z.getStopRowIndex():Z.getStopColIndex()),G!==void 0&&G>=n.to-n.from&&J>=n.to-n.from-1&&!C.siblings.includes(Ji.LAST)&&C.siblings.push(Ji.LAST),K===0&&!C.siblings.includes(Ji.FIRST)&&C.siblings.push(Ji.FIRST)}return this.metadataCache[r]=C,C}setValueNode(t){typeof t=="object"&&(this.valueNode=t)}cacheLevels(t,i=[],n={level:0}){const{level:o}=n;return t.forEach(r=>{if(i[o]||(i[o]=[]),lt.setLevel(r,o),i[o].push(r),lt.hasChildren(r)){const u=o+1;this.cacheLevels(lt.getChildren(r),i,{level:u})}else this.lastLevel.push(r)}),i}fillMap(t,i,n={},o){const r=o||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},u=t.length;return t.forEach((_,A)=>{const{parentRowIndex:E,parentColIndex:H,prevChildren:q,parentKey:g}=r,te=lt.getLevel(_)+E,W=A+H+q,C=Ms(te,W),Y=this.createTreeCellMap({rowIndex:te,colIndex:W,node:_,parent:g});Y.setIndexInParent(A,u),n[C]=Y;let Z=0,K=0;if(lt.hasChildren(_)?(Z=this.getTreeChildLength(_),typeof _.minLevel=="number"&&(K=_.minLevel+1-te||0)):K=(i||0)-(te||0),(Z>1||K>1)&&this.fillChildMap(n,C,te,W,K,Z),lt.hasChildren(_)){const J=ze(we({},r),{parentRowIndex:K>1?K-1:0,parentColIndex:A+H,parentKey:C});this.fillMap(lt.getChildren(_),i,n,J),Z>1&&(r.prevChildren+=Z-1)}}),n}fillMapVertical(t,i,n={},o){const r=o||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},u=t.length;return t.forEach((_,A)=>{if(_.isMapped){r.parentRowIndex+=lt.getChildLength(_)-1;return}_.isMapped=!0;const{parentRowIndex:E,prevChildren:H,parentKey:q}=r,g=lt.getLevel(_),te=A+E+H,W=Ms(te,g),C=this.createTreeCellMap({rowIndex:te,colIndex:g,node:_,parent:q});C.setIndexInParent(A,u),n[W]=C;let Y=0,Z=0;if(lt.hasChildren(_)?Z=this.getTreeChildLength(_):Y=(i||0)-(g||0),(Y>1||Z>1)&&this.fillChildMap(n,W,te,g,Z,Y),lt.hasChildren(_)){const K=ze(we({},r),{parentRowIndex:A+E,parentKey:W});this.fillMapVertical(lt.getChildren(_),i,n,K),Z>1&&(r.prevChildren+=Z-1)}}),n}fillChildMap(t,i,n,o,r,u){const _=t[i],A=Math.max(1,r),E=Math.max(1,u);Array.from(Array(A)).forEach((H,q)=>{Array.from(Array(E)).forEach((g,te)=>{if(q===0&&te===0)return;const W=n+q,C=o+te,Y=Ms(W,C),Z=this.createTreeCellMap({rowIndex:W,colIndex:C,parent:i});t[Y]=Z,!(q!==0&&te!==0)&&(te===0&&_.addRowCell(Z),q===0&&_.addColCell(Z))})})}createTreeCellMap({rowIndex:t,colIndex:i,node:n,parent:o}){return new dY(t,i,n,o)}getItemByKey(t){return this.map[t]}getItem(t,i){const n=Ms(t,i);return this.getItemByKey(n)}}class Aa extends SY{}class Ws extends Error{constructor(t="Loading canceled"){super(t),this.name="LoadingCanceledError";const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i)}}class wS{constructor(t=[],i){Ne(this,"divergence",0);const n=i?i.getDivergence():0,o=lt.getLastLevelNodes(t);this.divergence=(n+o.length)%2;for(let r=0;r<o.length;r+=1)o[r].indexDivergence=(r+n)%2}getDivergence(){return this.divergence}}function Df(e=[]){const t={};return e.forEach(i=>{const{index:n=1/0}=i.field||{},o=`${n}`;t[o]=i.jaql.datatype||Pr.TEXT}),t}function Ky(e,t){if(e&&t===Pr.DATETIME)try{return new Date(e).toISOString()}catch(i){return e}return e}function _S(e){if(e!==null&&!Yy(e,{}))return e}function gp(e,t,i={}){const n=_S(e),o=_S(t);let r=!1;if(typeof n=="object"&&n!==null&&typeof o=="object"&&o!==null){r=!0;const u=Object.keys(n),_=Object.keys(o);u.length!==_.length?r=!1:u.forEach(A=>{const E=i[A]||"";let H=(n||{})[A],q=(o||{})[A];if(typeof H=="undefined"||typeof q=="undefined"){r=!1;return}E===Pr.DATETIME&&(H=Ky(H,E),q=Ky(q,E)),H!==q&&(r=!1)})}else r=n===o;return r}function BL(e,t,i=Ky){if(!e||typeof e!="object")return e;const n={};return Object.keys(e).forEach(o=>{const r=t[o],u=(e||{})[o],_=i(u,r);n[o]=_}),n}const Dr=(e,t)=>{let i=e&&e.metadata||[];return t&&(i=i.filter(n=>n.panel===t)),i.sort((n,o)=>{const r={index:1/0},u=n.field||r,_=o.field||r;return u.index-_.index}),i},qu=(e,t,i)=>typeof t=="undefined"?void 0:Dr(e,i).filter(n=>(n.field||{index:1/0}).index===t)[0],TY=(e,t)=>{const i=e.field||{index:1/0};if(e.panel===St.MEASURES)return!0;if(e.panel===St.ROWS){const n=Dr(t,St.ROWS),o=(n[n.length-1]||{}).field||{index:1/0};if(n.length&&o.index===i.index)return!0;n.length||console.error("Missing rows panel in jaql!")}return!1};function MY(e,t){return!e||typeof e.field!="number"?!1:e.field!==t}const kY=(e,t=St.ROWS)=>{const i=Dr(e,t).map((n,o)=>{const r=lt.create(n.jaql.title,void 0,void 0,o),u=on(r,t);switch(u.jaqlIndex=n.field?n.field.index:void 0,t){case St.ROWS:{u.measurePath=void 0;const _=MY(n.jaql.sortDetails,u.jaqlIndex);n.jaql.sort&&!_?u.dir=n.jaql.sort:u.dir=null;break}case St.MEASURES:u.databars=n.format?n.format.databars:!1,u.measureJaqlIndex=u.jaqlIndex,Dr(e,St.COLUMNS).length||(u.measurePath=void 0,n.jaql.sortDetails&&n.jaql.sortDetails.measurePath===null?u.dir=n.jaql.sortDetails.dir:u.dir=null);break}return u});return lt.wrapInRootNode(i)},zL=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>{t&&t.jaql&&t.jaql.sort&&t.jaql.sortDetails&&t.jaql.sortDetails.sortingLastDimension&&(t.jaql.sort=null,delete t.jaql.sortDetails)})},FL=e=>{e&&e.jaql&&(e.jaql.sort=null,delete e.jaql.sortDetails)},WL=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>FL(t))},PY=e=>(e.metadata||[]).reverse().find(t=>!!t.jaql.sortDetails),AY=e=>(e.metadata||[]).find(t=>!!(t.jaql.sortDetails&&t.jaql.sortDetails.isLastApplied)),EY=e=>{const t=AY(e)||PY(e);if(!t)return;const i=t.field&&t.field.index;(e.metadata||[]).forEach(n=>{(n.field&&n.field.index)!==i&&FL(n)})},HL=(e,t)=>{e.metadata.forEach(i=>{const n=i.field&&i.field.index;if(t.field===n){i.jaql.sortDetails=i.jaql.sortDetails||t,i.jaql.sortDetails.isLastApplied=!0;return}i.jaql.sortDetails&&i.jaql.sortDetails&&delete i.jaql.sortDetails.isLastApplied})},OY=(e,t,i)=>{const{isSingleRowTree:n=!1,formatter:o}=i||{};if(!t){console.warn("jaql is undefined or null!");return}const r=qu(t,e.field);if(r&&r.panel===St.COLUMNS){console.warn('Should not be sorted by "COLUMN" type panels!');return}if(!r)return;const u=TY(r,t);switch(n?WL(t):u&&zL(t),e.dir){case Oi.DESC:case null:r.jaql.sort=Oi.ASC;break;case Oi.ASC:r.jaql.sort=Oi.DESC;break;default:r.jaql.sort=void 0}const _=r.field||{index:1/0};if(r.jaql.sort){let{measurePath:A}=e;if(A){const E=Dr(t),H=Df(E);A=BL(A,H,o)}r.jaql.sortDetails={field:_.index,dir:r.jaql.sort,sortingLastDimension:u,measurePath:A,initialized:!0}}else r.jaql.sortDetails=void 0;t&&t.metadata&&_.index!==void 0&&(t.metadata[_.index]=r),HL(t,e)},LY=(e,t,i)=>{if(!e)return;const n=qu(e,t);n&&(n.format=n.format||{},n.format.width=i)},NY=e=>{const t={};return e&&Dr(e).forEach(i=>{const n=i.field||{index:1/0};i.format&&typeof i.format.width!="undefined"&&typeof n.index!="undefined"&&(t[n.index]=i.format.width)}),t},DY=(e,t)=>{if(typeof t.measureJaqlIndex!="undefined"){const i=Dr(e),n=Df(i),o=i.filter(u=>u.panel===St.ROWS).find(u=>{const _=u.jaql.sortDetails;return!_||_.field!==t.measureJaqlIndex?!1:!!gp(t.measurePath,_.measurePath,n)});if(o){t.dir=o.jaql.sort?o.jaql.sort:null;return}const r=qu(e,t.measureJaqlIndex);if(r&&r.jaql.sortDetails){const u=r.jaql.sortDetails.measurePath,_=t.measurePath;if(gp(u,_,n)){t.dir=r.jaql.sort||null;return}}}t.dir=null};function IY(e,t,i,n){const{isSingleRowTree:o,formatter:r}=n;o&&WL(e),e.metadata.forEach(u=>{u.jaql.sortDetails&&delete u.jaql.sortDetails.isLastApplied}),t.forEach((u,_)=>{let A;_===t.length-1?(u.selected&&zL(e),A=i.field):A=u.indexInJaql;const E=qu(e,A);if(!E){console.warn(new Error("Panel not found"));return}u.selected&&!u.direction&&console.warn(new Error("Direction should be defined and equal to 'asc' or 'desc'"));const H=Dr(e),q=Df(H);if(!u.direction||!u.selected){const{sortDetails:g}=E.jaql;g&&i.field===g.field&&gp(i.measurePath,g.measurePath,q)&&(delete E.jaql.sort,delete E.jaql.sortDetails)}if(u.selected&&u.direction){E.jaql.sort=u.direction;let{measurePath:g}=i;g&&(g=BL(g,q,r)),i.measurePath===void 0&&E.field&&E.panel==="rows"&&i.field!==E.field.index&&(g={}),E.jaql.sortDetails={field:i.field,dir:u.direction,sortingLastDimension:!1,measurePath:g,isLastApplied:!0,initialized:!0}}})}function RY(e,t,i,n){return e.jaql.sortDetails?!1:i?Li.isMeasurePathEqual(t.measurePath,i.measurePath,n):!1}function Jy(e){const t=e&&e.dir;switch(t){case"asc":case"desc":return t;default:return null}}function jY(e,t){var i,n;const o=e.metadata.filter(W=>W.panel==="rows"),r=Li.getMetadataPanelByIndex(e,t.field),u=r.jaql.datatype,_=r.jaql.sortDetails,A=Li.getDataTypes(Li.getMetadataPanels(e)),E=[];for(let W=0;W<o.length-1;W+=1){const C=o[W],Y=!!(C.jaql.sortDetails&&C.jaql.sortDetails.field===t.field&&Li.isMeasurePathEqual(t.measurePath,C.jaql.sortDetails.measurePath,A)),Z=Jy(C.jaql.sortDetails);E.push({title:C.jaql.title,datatype:u,selected:Y,direction:Z,indexInJaql:(i=C.field)==null?void 0:i.index})}const H=o[o.length-1],q=RY(H,t,_,A),g=Jy(_),te={title:H.jaql.title,datatype:u,selected:q,direction:g,indexInJaql:(n=r.field)==null?void 0:n.index};return E.push(te),E}function BY(e,t,i){return e.filter(n=>n.field&&t.field===n.field.index).map(n=>{const{sortDetails:o}=n.jaql,r=!!(o&&Li.isMeasurePathEqual(t.measurePath,o.measurePath,i)),u=r?Jy(o):null;return{title:n.jaql.title,datatype:n.jaql.datatype,selected:r,direction:u}})[0]}const Li={isMeasurePathEqual:gp,getDataTypes:Df,updatePanelsSortingMetadata:OY,getMetadataTree:kY,getMetadataPanels:Dr,getMetadataPanelByIndex:qu,setResizeWidthToJaql:LY,getResizeWidthFromJaql:NY,markSortedNode:DY,normalizeSingleBranchTreeSortDetails:EY,updateLastAppliedSortingFlag:HL,handleComplexSortingSettingsUpdate:IY,mapWidgetJaqlToSimpleSortingSettings:BY,mapWidgetJaqlToComplexSortingSettings:jY};function $L(e,t){if(!lt.hasChildren(e))return!1;let i=!1;t===St.COLUMNS&&e&&e.isPart&&(i=!0);const n=lt.getChildren(e);if(n.length>1||i)return!0;const[o]=n;return $L(o)}function zY(e){return e==null}const Kx=(e,t,i,n,o)=>{const r=[];return e.forEach(u=>{if(r.push(u),lt.hasChildren(u)){const _=lt.getChildren(u),A=Kx(_,t,i,n,o);lt.setChildren(u,A);let E=!1;if((o||$L(u,i))&&(i===St.COLUMNS?typeof u.index!="undefined"&&u.index>-1&&(E=!0):i===St.ROWS&&typeof u.data!="undefined"&&(E=!0)),E){const{value:H,index:q,data:g,jaqlIndex:te,measurePath:W}=u;let C;if(i===St.COLUMNS?C=lt.create(H,void 0,void 0,q):i===St.ROWS&&(C=lt.create(H,void 0,g)),C){const Y=on(C,i);Y.userType=oi.SUB_TOTAL,Y.jaqlIndex=te,Y.measurePath=W,Y.master=u,r.push(Y)}}}}),r},UL=(e,t)=>{e.userType===oi.SUB_TOTAL&&e.master&&(e.measurePath=e.master.measurePath)},VL=(e,t,i,n)=>{const o=e;if(i===St.COLUMNS&&t){const r=on(t);if(typeof r.index=="number"){const u=Li.getMetadataTree(n,St.MEASURES);lt.getChildren(u).forEach((_,A)=>{const E=ze(we({},_),{index:(r.index||0)+A}),H=on(E,i);H.userType=oi.GRAND_TOTAL,H.measureJaqlIndex=H.jaqlIndex,o.push(H)})}}return o},GL=(e,t)=>{e.userType===oi.GRAND_TOTAL&&(e.measurePath=void 0,e.metadataType===St.ROWS&&(e.parent=void 0,e.jaqlIndex=0))},YL=(e,t,i,n)=>{let o=e;if(i===St.COLUMNS){const r=Li.getMetadataTree(n,St.MEASURES),u=lt.getChildLength(r),_={maxLevel:0},A=lt.getLastLevelNodes(o,[],0,_);if(u>1)A.forEach(E=>{if(E.userType===oi.GRAND_TOTAL)return;const H=lt.getChildren(r),q=[];for(let g=0;g<H.length;g+=1){if(typeof E.maxChilds=="number"&&g>=E.maxChilds)continue;const te=ze(we({},H[g]),{index:(E.index||0)+g,measurePath:E.measurePath}),W=on(te,St.MEASURES);W.userType=oi.MEASURE_BOTTOM,W.measureJaqlIndex=W.jaqlIndex,q.push(W)}E.minLevel=_.maxLevel,lt.setChildren(E,q)});else if(u===1){const E=lt.getChildren(r)[0];if(E){const H=we({},E),q=on(H,St.MEASURES);q.userType=oi.MEASURE_TOP,lt.setChildren(q,o),o=[q],A.forEach(g=>{g.measureJaqlIndex=E.jaqlIndex})}}}return o},XL=(e,t)=>{!lt.hasChildren(e)&&typeof e.measureJaqlIndex!="undefined"&&Li.markSortedNode(t,e)},FY=(e,t,i,n)=>{let o={};if(t.userType===oi.SUB_TOTAL||t.userType===oi.GRAND_TOTAL||i.userType===oi.SUB_TOTAL||i.userType===oi.GRAND_TOTAL||i.parent&&i.parent.userType===oi.SUB_TOTAL||i.parent&&i.parent.userType===oi.GRAND_TOTAL)return;const r=n&&n.format&&n.format.color||null;if(!r)return;const{value:u,cf:_=-1}=e;if(r.type===vS.COLOR&&r.color&&r.color!=="transparent"&&(o.backgroundColor=r.color),r.type===vS.CONDITION&&r.conditions&&r.conditions.length)for(let A=0,E=r.conditions.length;A<E&&!zY(u);A+=1){const H=r.conditions||[],{color:q}=H[A]||{};if(q&&_===A){o.backgroundColor=q;break}}Object.keys(o).length>0&&(e.style=e.style||{},Object.assign(e.style,o)),o=void 0},qL=(e,t,i,n)=>{const o=[],{level:r=0,measurePath:u={}}=n||{};let _;Array.isArray(e)?_=e:_=lt.getChildren(e);const A=Li.getMetadataPanels(i,t)[r],E=A?(A.field||{index:1/0}).index:void 0;return _.forEach(H=>{const q=on(H,t);if(q.jaqlIndex=E,typeof E!="undefined"&&(q.measurePath=ze(we({},u),{[E]:q.value})),o.push(q),lt.hasChildren(q)){const g=lt.getChildren(q),te={level:r+1,measurePath:q.measurePath},W=qL(g,t,i,te);lt.setChildren(q,W)}}),o},ZL=(e,t,i)=>{const{skipFormatEvent:n=!1,onlyFormatEvents:o=!1,iterateFn:r,emitFn:u}=i||{};e.forEach(_=>{if(r&&r(_),(n||!o)&&(UL(_),GL(_),XL(_,t)),u&&(o||!n)){const A=Li.getMetadataPanelByIndex(t,_.jaqlIndex,_.metadataType||"");u(_,A,t)}if(lt.hasChildren(_)){const A=lt.getChildren(_);ZL(A,t,i)}})},WY=(e,t,i,n)=>{const{originalData:o,applyIndexDivergence:r,subtotalsForSingleRow:u}=n||{};r&&r(e);let _=Kx(e,o,t,i,u);return _=VL(_,o,t,i),_=YL(_,o,t,i),lt.iterateThroughTree(_,(A,E)=>{A.parent=E}),_},nc={insertSubTotals:Kx,postProcessSubTotal:UL,insertGrandTotals:VL,postProcessGrandTotal:GL,insertMeasureNodes:YL,postProcessMeasureNode:XL,applyColorFormatting:FY,preProcessTree:qL,modifyTree:WY,postProcessTree:ZL},on=(e,t)=>{const i=e;return t&&(i.metadataType=t),i};function qs(e,t,i){return!t||!t.length?!1:t.some(n=>{let o=!0;return i&&i.fields&&i.fields.length&&i.fields.forEach(r=>{e[r]!==void 0&&n[r]===void 0?o=!1:e[r]!==void 0&&n[r]!==void 0&&(Array.isArray(e[r])?o=o&&e[r].indexOf(n[r])!==-1:o=o&&e[r]===n[r])}),o})}const HY=(e,t=[])=>{let i=!1;return!t||!t.length?!1:e.length===0?!0:(e.forEach(n=>{t.includes(n)&&(i=!0)}),i)},CS=(e,t)=>{let i=!0;return!t||!t.length?i=!1:e.forEach(n=>{if(n.index){const o=t[t.length-1];i=i&&qs(n,[o],{fields:[ea.INDEX]})}if(n.dim&&(n.name=n.dim,n.members&&(n.member=n.members),i=i&&qs(n,t,{fields:[ea.NAME,ea.MEMBER]})),n.title){const o=t[t.length-1];i=i&&qs(n,[o],{fields:[ea.TITLE]})}}),i},$Y=(e,t)=>{let i=!0;return!t||!t.length?i=!1:e.forEach(n=>{n.index&&(i=i&&qs(n,t,{fields:[ea.INDEX]})),n.dim&&(n.name=n.dim,i=i&&qs(n,t,{fields:[ea.DIM,ea.AGG]})),n.title&&(i=i&&qs(n,t,{fields:[ea.TITLE]}))}),i},UY=(e,t)=>{let i=!0;if(e.type&&i&&(i=i&&HY(e.type,t.type)),e.rows&&e.rows.length&&i){const n=t.rows?t.rows:[];i=i&&CS(e.rows,n)}if(e.columns&&i){const n=t.columns?t.columns:[];i=i&&CS(e.columns,n)}if(e.values&&i){const n=t.measure?[t.measure]:[];i=i&&$Y(e.values,n)}return i},VY=(e,t)=>e.metadata.find(i=>i.field&&i.field.index===t),Dh=(e,t,i=[],n=[])=>{if(!t||!e||typeof e.jaqlIndex=="undefined")return{dimensionsMeta:i,type:n};const o=VY(t,e.jaqlIndex);if(o&&o.jaql&&e.metadataType!==St.MEASURES&&i.unshift({title:o.jaql.title,name:o.jaql.dim,member:e.value,index:e.jaqlIndex}),e&&e.userType&&(e.userType===oi.SUB_TOTAL||e.userType===oi.GRAND_TOTAL)){const r=e.userType.toLowerCase();n.push(r)}return e.parent&&e.parent.metadataType!==St.MEASURES?Dh(e.parent,t,i,n):{dimensionsMeta:i,type:n}},SS=e=>{let t={};if(e){const i=e.jaql;t=ot(i,["type","datatype","table","column"]),e.field&&(t.index=e.field.index)}return t},tn={CORNER:"corner",COLUMNS:"columns",ROWS:"rows",DATA:"data"};function xg(e,t="",i=""){let n="";return e&&(e.levels.length&&e.levels.forEach(o=>{n+=` ${t}--${i?`${i}-`:""}level-${o}`}),e.siblings.length&&e.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-`:""}sibling-${o}`}),e.root&&e.root.siblings&&e.root.siblings.length&&e.root.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-root-`:"root-"}sibling-${o}`}),e.parent&&e.parent.siblings&&e.parent.siblings.length&&e.parent.siblings.forEach(o=>{n+=` ${t}--${i?`${i}-parent-`:"parent-"}sibling-${o}`})),n}function GY(e,t){const{metadata:i,rowMetadata:n,rowTreeNode:o,columnTreeNode:r,merge:u}=t||{},_={t:!0,r:!0,b:!0,l:!0};if(e===tn.CORNER||e===tn.COLUMNS)return _;if(e===tn.ROWS){const A=u&&u.colSpan,E=i&&i.nextNode&&i.nextNode.userType===oi.GRAND_TOTAL;i&&i.levels.includes(Ji.LAST)&&!i.siblings.includes(Ji.LAST)&&!A&&!E&&(_.b=!1),i&&i.levels.includes(Ji.FIRST)&&i.levels.includes(Ji.LAST)&&!i.siblings.includes(Ji.LAST)&&!A&&!E&&(_.b=!1)}if(e===tn.DATA){const A=o&&o.userType===oi.SUB_TOTAL,E=r&&r.userType===oi.SUB_TOTAL,H=r&&r.userType===oi.GRAND_TOTAL,q=n&&n.nextNode&&n.nextNode.userType===oi.GRAND_TOTAL;n&&n.levels.includes(Ji.LAST)&&!n.siblings.includes(Ji.LAST)&&!A&&!E&&!H&&!q&&(_.b=!1)}return _}function wg(e,t="",i=""){let n="";return e&&e.userType&&(n=`${t}--${i?`${i}-`:""}user-type-${e.userType}`),n}function _g(e,t="",i=""){let n="";return e&&e.colSpan&&(n=`${t}--${i?`${i}-`:""}merged-columns`),e&&e.rowSpan&&(n=` ${t}--${i?`${i}-`:""}merged-rows`),n}function Cg(e){return e&&e.colSpan?e.colSpan-1:0}function TS(e,t){if(e===void 0)return e;let i=typeof e=="number"?e:parseInt(e,10);return i-=t||1,i}function oc(e){const{isDataCell:t,dataNode:i,treeNode:n}=e,o=t?i:n;return o&&o.style||{}}const YY=e=>{const t={};return Object.keys(e).forEach(i=>{(!i.startsWith("border")||i==="borderColor")&&(t[i]=e[i])}),t},XY=e=>{const t={};return Object.keys(e).forEach(i=>{(!i.startsWith("color")&&!i.startsWith("padding")&&!i.startsWith("border")&&!i.startsWith("font")&&!i.startsWith("lineHeight")&&!i.startsWith("databarColor")||i==="borderColor")&&(t[i]=e[i])}),t},qY=e=>{const t={};return Object.keys(e).forEach(i=>{(i.startsWith("color")||i.startsWith("padding")||i.startsWith("font")||i.startsWith("lineHeight"))&&(t[i]=e[i])}),t},ZY=e=>{const t={};return e.databarColor&&(t.backgroundColor=e.databarColor),t},KY=(e,t,i=0)=>t&&e&&t.offsetWidth+i>=e.offsetWidth&&t.textContent||"",JY=(e,t,i)=>{if(!e||!t||!i||i.measureJaqlIndex===void 0)return;const[n,o]=e[i.measureJaqlIndex]||[];if(n==null)return;const r=t&&t.store&&t.store.compileRange,u=t&&t.store&&t.store.compileRangeContext,_=t&&t.store&&t.store.compileRangeArgs;if(!r||!_||!u||!t||!t.value)return;const A=ze(we({},_),{minvalue:n,midvalue:n+(o-n)/2,maxvalue:o});let E,H;return A.min===void 0&&(A.maxvalue<=0&&(H=!0),A.min=A.minDef),A.max===void 0&&(A.minvalue>=0&&(E=!0),A.max=A.maxDef),H&&(A.max=A.maxGray),E&&(A.min=A.minGray),r.call(u,A)(t.value)},rc="text";class Jx{constructor(t,i,n){Ne(this,"plugins",[]),Ne(this,"globalStyles"),Ne(this,"jaql"),Ne(this,"indexHelper"),Ne(this,"columnsMetadata",[]),Ne(this,"metadataCache",new Map),this.plugins=t,this.jaql=i,this.globalStyles=n,this.indexHelper={measuresLevel:this.getMeasuresLevel(),columnStartFrom:0,rowStartFrom:0},this.globalStyles&&(this.globalStyles=YY(this.globalStyles))}getJaqlPanels(t){if(!this.jaql)throw new Error("No Jaql in Plugin service!");return this.jaql.metadata.filter(i=>i.panel===t)}getMeasuresLevel(){const t=this.getJaqlPanels(St.COLUMNS);return this.getJaqlPanels(St.MEASURES).length>1?t.length:0}getRowsColumnLength(){return this.getJaqlPanels(St.ROWS).length}getTotalTypes(t){const i=t.filter(n=>n===Ts.SUB_TOTAL||n===Ts.GRAND_TOTAL);return i&&i.length?i.filter((n,o,r)=>r.indexOf(n)===o):[]}getMeasureMetaByIndex(t){const i=this.getJaqlPanels(St.MEASURES);if(i.length===1)return SS(i[0]);const n=t%i.length;return SS(i[n])}resetRowStartFrom(){this.indexHelper.rowStartFrom=1}applyToColumns(t){t.length!==0&&(this.indexHelper.columnStartFrom===0&&(this.indexHelper.columnStartFrom=this.getRowsColumnLength()),this._applyToColumns(t,{row:-1}))}_applyToColumns(t,i){t.forEach((n,o)=>{const{dimensionsMeta:r,type:u}=Dh(n,this.jaql);u.push(Ts.MEMBER);let _=i.row>=0?i.row+1:0;_>=this.indexHelper.rowStartFrom&&(this.indexHelper.rowStartFrom=_+1),n.metadataType===St.MEASURES&&(_=this.indexHelper.measuresLevel);let A=o===0?0:1;A+=this.indexHelper.columnStartFrom;const E={type:u,rowIndex:_,colIndex:A,index:n.jaqlIndex,columns:r};n.metadataType===St.MEASURES&&(E.measure=this.getMeasureMetaByIndex(n.index||0));const H={value:n.value||"",content:n.content||"",contentType:n.contentType||rc,style:n.style||{},store:n.store||{},state:n.state};if(this.applyGlobal(H),this.apply(E,H),this.addToMetadata(E,H,E.rowIndex,E.colIndex),Object.assign(n,H),this.indexHelper.columnStartFrom=A,n.children){const q={row:_,column:A};this._applyToColumns(n.children,q)}else this.columnsMetadata.push({type:u,metadata:r});return!0})}applyToHeaders(t){!t||!t.children||t.children.length===0||t.children.forEach(i=>{const{dimensionsMeta:n}=Dh(i,this.jaql),o={type:[Ts.MEMBER],rowIndex:0,colIndex:i.index||0,index:i.jaqlIndex,rows:n},r={value:i.value,content:i.content||"",contentType:i.contentType||rc,style:i.style?i.style:{},store:i.store||{},state:i.state};this.applyGlobal(r),this.apply(o,r),this.addToMetadata(o,r,o.rowIndex,o.colIndex),Object.assign(i,r)})}applyToRows(t){if(t.length===0)return;const i=this.getJaqlPanels(St.ROWS),n=this.getJaqlPanels(St.MEASURES),o=this.getJaqlPanels(St.COLUMNS);this.indexHelper.rowStartFrom=Jx.getRowStartFromForPage(i.length,n.length,o.length),this._applyToRows(t)}static getRowStartFromForPage(t,i,n){if(t===0&&n===0)return 0;const o=n+(i===0?0:1);return o===0?1:o}_applyToRows(t){t.forEach((i,n)=>{const{dimensionsMeta:o,type:r}=Dh(i,this.jaql);r.push(Ts.MEMBER);const u=i.level?i.level:0,_=n===0?this.indexHelper.rowStartFrom:this.indexHelper.rowStartFrom+1,A={type:r,rowIndex:_,colIndex:u,index:i.jaqlIndex,rows:o},E={value:i.value,content:i.content||"",contentType:i.contentType||rc,style:i.style||{},store:i.store||{},state:i.state};return this.applyGlobal(E),this.apply(A,E),this.addToMetadata(A,E,A.rowIndex,A.colIndex),this.indexHelper.rowStartFrom=_,i.children?this._applyToRows(i.children):i.data&&i.data.length&&this.applyToValues(i.data,{type:r,metadata:o},{rowIndex:_,colIndex:this.getRowsColumnLength()}),Object.assign(i,E),!0})}applyToValues(t,i,n){t.length&&t.forEach((o,r)=>{const u=[Ts.VALUE],_=this.columnsMetadata[r];if(!_)return;const A=this.getTotalTypes([...i.type,..._.type]),E=this.getMeasureMetaByIndex(r),H={type:u.concat(A),rows:i.metadata,columns:_.metadata,measure:E,colIndex:r+n.colIndex,rowIndex:n.rowIndex,index:E&&E.index?E.index:0};let q={value:o,content:o,contentType:rc,style:{},store:o&&o.store||{},state:o&&o.state||void 0};o!=null&&typeof o=="object"&&(q={value:o.value?o.value:null,content:o.content||"",contentType:o.contentType||rc,style:o.style||{},store:o.store||{},state:o.state}),this.applyGlobal(q),this.apply(H,q),this.addToMetadata(H,q,H.rowIndex,H.colIndex),t[r]=q})}addToMetadata(t,i,n,o){const r=we({cellData:{value:i.value,content:i.content}},t);this.metadataCache.set(`${n}-${o}`,r)}applyGlobal(t){const{globalStyles:i}=this;i&&(t.style=we(we({},t.style),i))}apply(t,i){this.plugins&&this.plugins.length&&this.plugins.forEach(n=>{if(UY(n.target,t)){const o=n.handler;o(t,i)}})}}const Sg=(e,t)=>{const i=e||{metadata:[],grandTotals:null};let{metadata:n}=i;return n=n.map(o=>{const r=o.field||{},u=t.find(({field:A})=>A&&A.index===r.index),_=u?u.format:null;return _?ze(we({},o),{format:_}):o}),ze(we({},i),{metadata:n})},MS=100,QY="dataLoad",Qy="dataChunkLoaded",e8="dataBarChunkLoaded",t8="rangeMinMaxChunkLoaded",eb="grandChunkLoaded",i8="dataFinishChunkLoaded",n8="finishChunkLoaded",Ih="progressError",tb="headerCellFormat",KL="dataCellFormat",ib="totalRowsCountLoaded",nb="totalColumnsCountLoaded",kS=1e3,o8=0,r8={throttle:AL,throttleTime:o8,PluginService:Jx,skipInternalColorFormatting:!1,subtotalsForSingleRow:!1};class On{constructor(t,i,n,o){Ne(this,"logger"),Ne(this,"events"),Ne(this,"loadService"),Ne(this,"options"),Ne(this,"tempDataChunks",[]),Ne(this,"lastNotHandledChunkIndex",0),Ne(this,"lastReadyNotHandledChunkIndex",0),Ne(this,"rowsGrand"),Ne(this,"rowsTreeService"),Ne(this,"columnsTreeService"),Ne(this,"cornerTreeService"),Ne(this,"pageSize",MS),Ne(this,"isPaginated",!1),Ne(this,"loadedPagesCount",0),Ne(this,"isLoadInProgress",!1),Ne(this,"loadPromiseResolve"),Ne(this,"loadPromiseReject"),Ne(this,"loadPromiseCache"),Ne(this,"loadAllPromise"),Ne(this,"loadAllPromiseResolve"),Ne(this,"loadAllPromiseReject"),Ne(this,"isWholeDataLoaded",!1),Ne(this,"hasDataFinishEvent",!1),Ne(this,"isDataHandlerThrottled",!1),Ne(this,"onDataHandlerThrottle"),Ne(this,"metadata",[]),Ne(this,"dataBars"),Ne(this,"rangeMinMax"),Ne(this,"divergenceComparator",new wS),Ne(this,"pluginService"),Ne(this,"rawJaql"),Ne(this,"triggeredEventsData",{}),Ne(this,"callPlugins",[]),Ne(this,"globalStyles"),Ne(this,"columnsCount"),Ne(this,"totalColumnsCount"),Ne(this,"rowsCount"),Ne(this,"totalRowsCount"),Ne(this,"totalRecordsCount"),Ne(this,"limitReached"),Ne(this,"onMetadataHandler",()=>{const r={metadata:this.getMetadata()};this.isSingleRowTree()&&Li.normalizeSingleBranchTreeSortDetails(r)}),Ne(this,"onHeadersHandler",r=>{const u=this.getJaql.bind(this),_=this.getRawJaql.bind(this),A=this.applyIndexDivergence.bind(this),E=(te,W,C)=>this.emit(tb,te,W,C,this.options),H=On.createColumnsTreeServiceBuilder({getJaql:u,getRawJaql:_,pluginService:this.pluginService,applyIndexDivergence:A},{emitHeaderCellFormatEvent:E})(r);this.columnsTreeService=H.columnsTreeService,this.columnsCount=H.columnsCount,this.totalColumnsCount=H.totalColumnsCount,this.emit(nb,{columnsCount:this.columnsCount||0,totalColumnsCount:this.totalColumnsCount||0});const q=On.createCornerTreeServiceBuilder({getJaql:u,getRawJaql:_,pluginService:this.pluginService,columnsTreeService:this.columnsTreeService},{emitHeaderCellFormatEvent:E}),{cornerTreeService:g}=q();this.cornerTreeService=g}),Ne(this,"onDataHandler",r=>{this.tempDataChunks=this.tempDataChunks||[],Array.isArray(r)?(r||[]).forEach(u=>{On.fillDataChunks(this.tempDataChunks,u,this.pageSize)}):On.fillDataChunks(this.tempDataChunks,r,this.pageSize),this.tempDataChunks.length&&(this.isDataHandlerThrottled=!0,this.onDataHandlerThrottle())}),Ne(this,"onGrandHandler",r=>{const u=this.preProcessTree([r],St.ROWS)[0],_="Rows grand total",A=u?u.data:[],E=lt.create(_,void 0,A),H=on(E,St.ROWS);H.userType=oi.GRAND_TOTAL,this.postProcessTree([H]),this.postProcessData([H]),this.rowsGrand=H,this.emit(eb,lt.wrapInRootNode(this.rowsGrand))}),Ne(this,"onFinishHandler",()=>{this.emit(n8,{totalRows:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalColumns:typeof this.totalColumnsCount=="number"?this.totalColumnsCount:this.getLoadedColumnsCount()})}),Ne(this,"onTotalRowsHandler",r=>{const{rowsCount:u,queryRowsCount:_,limitReached:A}=r||{};this.totalRowsCount=u,this.totalRecordsCount=_,this.limitReached=A,this.emit(ib,r)}),Ne(this,"onDataBarsHandler",r=>{const{data:u=[]}=r;let _=0;this.cornerTreeService&&(_=this.cornerTreeService.getTreeChildLength()),this.dataBars=[...Array(_),...u],this.emit(e8,this.dataBars)}),Ne(this,"onRangeMinMaxHandler",r=>{const{data:u=[]}=r,_=this.getJaql(),A=Li.getMetadataTree(_,St.MEASURES),E=lt.getChildren(A),H=[];E.forEach((q,g)=>{H[q.measureJaqlIndex||0]=u[g]}),this.rangeMinMax=H,this.emit(t8,this.rangeMinMax)}),Ne(this,"onDataFinishHandler",({rowsCount:r}={})=>{if(this.finishRequest(),this.rowsCount=r,this.tempDataChunks.length){const u=this.tempDataChunks[this.tempDataChunks.length-1];u.ready=!0}this.onDataHandlerThrottle(),this.checkLoadPromise(),this.emit(i8,{limitedRows:this.rowsCount,limitedColumns:this.columnsCount})}),Ne(this,"onErrorHandler",r=>{process.env.NODE_ENV!=="production"&&this.logger.console.warn(`${this.logger.getName()} data loading error "${JSON.stringify(r)}"`),!this.isLoadInProgress&&!this.isWholeDataLoaded&&!(r instanceof Ws)&&this.emit(Ih,r)}),this.loadService=t,this.events=i||new Xu,this.logger=o||ba.create("DataService"),this.options=we(we({},r8),n),this.attachEvent(),this.onDataHandlerThrottle=this.options.throttle(()=>{const r=xS(this.tempDataChunks,q=>q.ready&&!q.handled,this.lastReadyNotHandledChunkIndex);if(r===-1)return;this.lastReadyNotHandledChunkIndex=r;const u=this.tempDataChunks[r],_=this.preProcessTree(u.list,St.ROWS),A=this.modifyTree(_,St.ROWS);this.postProcessTree(A,{skipFormatEvent:!0}),this.postProcessData(A,{skipFormatEvent:!0});const E=lt.wrapInRootNode(A);this.rowsTreeService?this.rowsTreeService.extend(E):this.rowsTreeService=new Aa(E,!0),this.emit(Qy,this.getLoadedElementsCount()),u.handled=!0;const H=xS(this.tempDataChunks,q=>!q.handled,this.lastNotHandledChunkIndex);if(H!==-1?(this.lastNotHandledChunkIndex=H,this.onDataHandlerThrottle()):this.isDataHandlerThrottled=!1,this.hasDataFinishEvent&&this.tempDataChunks.length){const q=this.tempDataChunks[this.tempDataChunks.length-1];q.ready=!0}this.hasDataFinishEvent&&H===-1?(this.finishRequest(),this.checkLoadPromise()):this.checkLoadPromise()},this.options.throttleTime)}destroy(){this.detachEvent(),this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.cornerTreeService=void 0,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.events.removeAllListeners()}on(t,i){this.events.on(t,i),this.triggeredEventsData[t]&&(this.triggeredEventsData[t].forEach(n=>{this.events.emit(t,...n)}),delete this.triggeredEventsData[t])}emit(t,...i){this.events.listeners(t).length===0?(this.triggeredEventsData[t]=this.triggeredEventsData[t]||[],this.triggeredEventsData[t].push(i)):this.events.emit(t,...i)}off(t,i){this.events.removeListener(t,i),this.triggeredEventsData[t]&&delete this.triggeredEventsData[t]}loadData(t,i){const{pageSize:n=MS,isPaginated:o=!1,cacheResult:r=!1,metadata:u}=i||{},_=this.pageSize===n;if(this.clearLoadAllPromise(),t&&this.clearCache(),this.pageSize=n,this.isPaginated=o,this.emit(QY),this.loadPromiseCache&&_){const E=Promise.resolve(this.loadPromiseCache);return this.loadPromiseCache=void 0,E}this.isLoadInProgress=!0,t&&(this.metadata=u||[],this.rawJaql=Sg(t,this.metadata),this.initPluginService(this.rawJaql),this.loadService.load(t).then(E=>{if(E==null)return;const H=!("data"in E);if(E.dataFinish[0]&&H)throw{error:{error:!0,details:"metadata undefined."}}}).catch(E=>{this.loadPromiseReject&&this.loadPromiseReject(E.error)}));const A=new Promise((E,H)=>{this.loadPromiseResolve=E,this.loadPromiseReject=H}).then(E=>this.sendInitPage(E)).then(E=>(r&&(this.loadPromiseCache=E),this.loadedPagesCount=1,E)).catch(E=>{throw E instanceof Ws&&this.clearLoadPromise(),E});return this.checkLoadPromise(),A}loadAllData(){if(this.isWholeDataLoaded){const t={loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax};return this.columnsCount!==0&&this.totalColumnsCount!==0&&(t.columnsCount=this.columnsCount,t.totalColumnsCount=this.totalColumnsCount),Promise.resolve(t)}return this.loadAllPromise||(this.loadAllPromise=new Promise((t,i)=>{this.loadAllPromiseResolve=t,this.loadAllPromiseReject=i}).then(()=>({loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax})).catch(t=>{throw t instanceof Ws&&this.clearLoadAllPromise(),t})),this.loadAllPromise}getSelectedPageData(t,i){return Promise.resolve(this.sendPaginatedPage(t,i))}getIndexedPageData(t,i,n=!1){return Promise.resolve(this.sendPartialPage(t,i,n))}getJaql(){return this.loadService.getJaql()||{metadata:[],grandTotals:null}}isSingleRowTree(){return this.loadService.isSingleRowTree()}setPluginHandlers(t){this.callPlugins=t}setGlobalStyles(t){this.globalStyles=t}getRawJaql(){return this.rawJaql||this.getJaql()}getMetadata(){return this.metadata.length>0?this.metadata:this.getJaql().metadata}preProcessTree(t,i,n){return nc.preProcessTree(t,i,this.getJaql(),n)}postProcessTree(t,i){const n=(r,u,_)=>this.emit(tb,r,u,_,this.options),o=ze(we({},i||{}),{emitFn:n});return nc.postProcessTree(t,this.getRawJaql(),o)}postProcessData(t,i){const{skipFormatEvent:n=!1,onlyFormatEvents:o=!1}=i||{},r=this.columnsTreeService?this.columnsTreeService.getLastLevelNodes():[],u=lt.getLastLevelNodes(t),_=this.getRawJaql();n||u.forEach(A=>{const E=on(A);r.forEach(H=>{const q=on(H),g=Li.getMetadataPanelByIndex(_,q.measureJaqlIndex,St.MEASURES);if(typeof E.data!="undefined"&&typeof q.index!="undefined"){const{data:te=[]}=E,{index:W}=q,C=te[W],Y=typeof C=="object"&&C!==null&&C!==void 0?C:{value:C};if(te[W]=Y,o||!n){const{skipInternalColorFormatting:Z=!1}=this.options;Z||nc.applyColorFormatting(Y,E,q,g),this.emit(KL,Y,E,q,g,_,this.options)}}})})}modifyTree(t,i,n){const o=this.getJaql();return nc.modifyTree(t,i,o,{originalData:n,applyIndexDivergence:this.applyIndexDivergence.bind(this),subtotalsForSingleRow:this.options.subtotalsForSingleRow})}applyIndexDivergence(t){this.divergenceComparator=new wS(t,this.divergenceComparator)}initPluginService(t){this.pluginService=new this.options.PluginService(this.callPlugins,t,this.globalStyles)}cancelLoading(){const t=new Ws;this.loadPromiseReject&&typeof this.loadPromiseReject=="function"&&this.loadPromiseReject(t),this.loadAllPromiseReject&&typeof this.loadAllPromiseReject=="function"&&this.loadAllPromiseReject(t),this.detachEvent()}getPageSize(){return this.pageSize}sendInitPage(t){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();let i,n;const o=this.getPageSize();if(this.rowsTreeService){const u=o>t?t:o,_=On.cloneTreeNode,A=this.rowsTreeService.getPartialTree(0,u,{cloneFn:_});this.rowsGrand&&A.push(Ln(this.rowsGrand)),this.postProcessTree(A,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(A,{onlyFormatEvents:!0});const E=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,H=lt.wrapInRootNode(A);this.pluginService&&H&&H.children&&(this.pluginService.applyToRows(H.children),n=this.pluginService.metadataCache),i=new Aa(H,!0,E),i.hasGrandTotals=!!this.rowsGrand}const r=this.isWholeDataLoaded&&o>=t;return{rowsTreeService:i,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:r,cellsMetadata:n}}sendPaginatedPage(t,i){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();i&&(this.pageSize=i);const n=this.getPageSize(),o=this.getLoadedElementsCount();if(t*n>=o)throw new Error("Selected page is out of elements range!");if(t<0)throw new Error("Selected page must be >= 0");let r,u;if(this.rowsTreeService){const _=t>=0?t*n:0,A=(t+1)*n>o?o:(t+1)*n,E=On.cloneTreeNode,H=this.rowsTreeService.getPartialTree(_,A,{cloneFn:E});this.rowsGrand&&H.push(Ln(this.rowsGrand)),this.postProcessTree(H,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(H,{onlyFormatEvents:!0});const q=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,g=lt.wrapInRootNode(H);this.pluginService&&g&&g.children&&(this.pluginService.applyToRows(g.children),u=this.pluginService.metadataCache),r=new Aa(g,!0,q),r.hasGrandTotals=!!this.rowsGrand}return{rowsTreeService:r,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:u}}sendPartialPage(t,i,n){if(this.loadService.hasError()||!this.loadService.hasData())return On.getEmptyPage();const o=this.getLoadedElementsCount();let[r,u]=[Math.min(t,i),Math.max(t,i)];r=r>=0?r:0,u=u>=0?u:0,u=u<o?u:o;let _,A;if(r>o)_=void 0;else{let E;if(this.rowsTreeService){const g=On.cloneTreeNode;E=this.rowsTreeService.getPartialTree(r,u,{cloneFn:g}),n&&this.rowsGrand&&E.push(Ln(this.rowsGrand)),this.postProcessTree(E,{onlyFormatEvents:!0,iterateFn:lt.clearNodeCache}),this.postProcessData(E,{onlyFormatEvents:!0})}const H=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,q=lt.wrapInRootNode(E);this.pluginService&&q&&q.children&&(this.pluginService.applyToRows(q.children),A=this.pluginService.metadataCache),_=new Aa(q,!0,H),_.hasGrandTotals=!!(n&&this.rowsGrand)}return{rowsTreeService:_,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:A}}getLoadedElementsCount(){return this.rowsTreeService?this.rowsTreeService.getTreeChildLength():0}getTotalItemsCount(){return this.loadService.getTotalItemsCount()}getLoadedColumnsCount(){return this.columnsTreeService?this.columnsTreeService.getTreeChildLength():0}attachEvent(){this.loadService.listenerCount(Mt.HEADERS)&&this.loadService.offAll(Mt.HEADERS),this.loadService.on(Mt.HEADERS,this.onHeadersHandler),this.loadService.on(Mt.METADATA,this.onMetadataHandler),this.loadService.on(Mt.DATA,this.onDataHandler),this.loadService.on(Mt.GRAND,this.onGrandHandler),this.loadService.on(Mt.DATA_FINISH,this.onDataFinishHandler),this.loadService.on(Mt.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.on(Mt.DATABARS,this.onDataBarsHandler),this.loadService.on(Mt.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.on(Mt.FINISH,this.onFinishHandler),this.loadService.on(Mt.ERROR,this.onErrorHandler)}detachEvent(){this.loadService.off(Mt.HEADERS,this.onHeadersHandler),this.loadService.off(Mt.METADATA,this.onMetadataHandler),this.loadService.off(Mt.DATA,this.onDataHandler),this.loadService.off(Mt.GRAND,this.onGrandHandler),this.loadService.off(Mt.DATA_FINISH,this.onDataFinishHandler),this.loadService.off(Mt.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.off(Mt.DATABARS,this.onDataBarsHandler),this.loadService.off(Mt.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.off(Mt.FINISH,this.onFinishHandler),this.loadService.off(Mt.ERROR,this.onErrorHandler)}checkLoadPromise(){if(!this.isLoadInProgress)return;const t=this.getLoadedElementsCount();(t>=this.getPageSize()||this.isWholeDataLoaded)&&(this.isLoadInProgress=!1,typeof this.loadPromiseResolve=="function"&&(this.loadPromiseResolve(t),this.clearLoadPromise()))}clearLoadAllPromise(){this.loadAllPromise=void 0,this.loadAllPromiseReject=void 0,this.loadAllPromiseResolve=void 0}clearLoadPromise(){this.loadPromiseReject=void 0,this.loadPromiseResolve=void 0}finishRequest(){this.logger.log("finishRequest"),this.hasDataFinishEvent=!0,!this.isDataHandlerThrottled&&(this.isWholeDataLoaded=!0,this.loadAllPromiseResolve&&typeof this.loadAllPromiseResolve=="function"&&(this.loadAllPromiseResolve(),this.clearLoadAllPromise()))}clearCache(){this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.loadedPagesCount=0,this.hasDataFinishEvent=!1,this.isWholeDataLoaded=!1,this.isLoadInProgress=!1,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.isDataHandlerThrottled=!1}static getEmptyPage(){return{isLastPage:!0}}static fillDataChunks(t,i,n=kS,o=kS){const r=t.length<2?n:o;let u=t[Math.max(0,t.length-1)],_,A=!u;if(!i||typeof i.children=="undefined"&&typeof i.value=="undefined"&&i.data&&!i.data.length){u&&(u.ready=!0);return}if(u){const E=Math.max(0,u.list.length-1);_=u.list[E];const H=u.size?`${u.size}`:"0",q=parseInt(H,10)+(i.size||1);(u.handled||q>r&&!(_.isPart&&_.value===i.value))&&(A=!0)}i&&i.isPart&&_&&(!_.isPart||_.value!==i.value)&&(A=!0,_.value!==i.value&&(_=void 0)),A&&(u&&(u.ready=!0),u={list:[],size:0,ready:!1,handled:!1},t.push(u)),u&&(_&&_.isPart&&i&&i.isPart?(lt.deepMerge(_,i),u.size+=i.size||1):(u.list.push(i),u.size+=i.size||1))}static cloneTreeNode(t,i){const n=t,{children:o,isMapped:r,minLevel:u,childCount:_,childDeep:A,parent:E,master:H,data:q,state:g,style:te,store:W}=n,C=ot(n,["children","isMapped","minLevel","childCount","childDeep","parent","master","data","state","style","store"]),Y=Ln(C);return E&&(Y.parent=E),H&&(Y.master=H),q&&(Y.data=Ln(q)),g&&(Y.state=Ln(g)),te&&(Y.style=Ln(te)),W&&(Y.store=Ln(W)),!i&&o&&(Y.children=o.map(Z=>{const K=On.cloneTreeNode(Z);return K.parent=Y,K})),Y}static createColumnsTreeServiceBuilder(t,i){return n=>{const o=t.getJaql(),r=t.getRawJaql?t.getRawJaql():Sg(o,o.metadata||[]),u=Li.getMetadataTree(o,St.MEASURES),_=lt.getChildren(u),{preProcessTree:A,modifyTree:E,postProcessTree:H}=nc;let q,g,te=0,W=0;if(lt.hasChildren(n)){n.columnsCount&&n.totalColumnsCount&&(te=n.columnsCount,W=n.totalColumnsCount);const C=A(n,St.COLUMNS,o),Y=E(C,St.COLUMNS,o,{originalData:n,applyIndexDivergence:t.applyIndexDivergence});H(Y,r,{emitFn:i&&i.emitHeaderCellFormatEvent});const Z=lt.wrapInRootNode(Y);t.pluginService&&Z&&Z.children&&t.pluginService.applyToColumns(Z.children),q=Z,g=new Aa(Z),_.length===1&&g.setValueNode(_[0])}else lt.hasChildren(u)?(n.columnsCount&&n.totalColumnsCount&&(te=n.columnsCount,W=n.totalColumnsCount),typeof n.maxChilds=="number"&&(te=n.maxChilds,u.children=lt.getChildren(u).filter((C,Y)=>Y<n.maxChilds)),t.pluginService&&u.children&&t.pluginService.applyToColumns(u.children),H(lt.getChildren(u),r,{emitFn:i&&i.emitHeaderCellFormatEvent}),q=u,g=new Aa(u)):(t.pluginService&&t.pluginService.resetRowStartFrom(),q=void 0,g=void 0,te=0,W=0);return{columnsTree:q,columnsTreeService:g,columnsCount:te,totalColumnsCount:W}}}static createCornerTreeServiceBuilder(t,i){return()=>{const n=t.getJaql(),o=t.getRawJaql?t.getRawJaql():Sg(n,n.metadata||[]),r=Li.getMetadataTree(n,St.ROWS);let u;if(lt.hasChildren(r)){lt.iterateThroughTree(lt.getChildren(r),A=>{A.userType=oi.CORNER;const E=Li.getMetadataPanelByIndex(o,A.jaqlIndex,A.metadataType||"");i&&i.emitHeaderCellFormatEvent&&i.emitHeaderCellFormatEvent(A,E,o)});let _;t.columnsTreeService&&(_=t.columnsTreeService.getTreeDeepsLength()),t.pluginService&&t.pluginService.applyToHeaders(r),u=new Aa(r,!1,_)}return{cornerTree:r,cornerTreeService:u}}}}var PS={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames