@aidc-toolkit/utility 1.0.49-beta → 1.0.49

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.
Files changed (57) hide show
  1. package/dist/index.cjs +17 -0
  2. package/dist/index.d.cts +699 -0
  3. package/dist/index.d.ts +699 -26
  4. package/dist/index.js +1 -9
  5. package/package.json +3 -3
  6. package/src/version.ts +1 -1
  7. package/tsconfig-src.tsbuildinfo +1 -1
  8. package/dist/character-set.d.ts +0 -242
  9. package/dist/character-set.d.ts.map +0 -1
  10. package/dist/character-set.js +0 -542
  11. package/dist/character-set.js.map +0 -1
  12. package/dist/exclusion.d.ts +0 -26
  13. package/dist/exclusion.d.ts.map +0 -1
  14. package/dist/exclusion.js +0 -18
  15. package/dist/exclusion.js.map +0 -1
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/index.js.map +0 -1
  18. package/dist/iterable-utility.d.ts +0 -39
  19. package/dist/iterable-utility.d.ts.map +0 -1
  20. package/dist/iterable-utility.js +0 -35
  21. package/dist/iterable-utility.js.map +0 -1
  22. package/dist/locale/en/locale-resources.d.ts +0 -33
  23. package/dist/locale/en/locale-resources.d.ts.map +0 -1
  24. package/dist/locale/en/locale-resources.js +0 -32
  25. package/dist/locale/en/locale-resources.js.map +0 -1
  26. package/dist/locale/fr/locale-resources.d.ts +0 -33
  27. package/dist/locale/fr/locale-resources.d.ts.map +0 -1
  28. package/dist/locale/fr/locale-resources.js +0 -32
  29. package/dist/locale/fr/locale-resources.js.map +0 -1
  30. package/dist/locale/i18n.d.ts +0 -27
  31. package/dist/locale/i18n.d.ts.map +0 -1
  32. package/dist/locale/i18n.js +0 -34
  33. package/dist/locale/i18n.js.map +0 -1
  34. package/dist/record.d.ts +0 -37
  35. package/dist/record.d.ts.map +0 -1
  36. package/dist/record.js +0 -58
  37. package/dist/record.js.map +0 -1
  38. package/dist/reg-exp.d.ts +0 -40
  39. package/dist/reg-exp.d.ts.map +0 -1
  40. package/dist/reg-exp.js +0 -55
  41. package/dist/reg-exp.js.map +0 -1
  42. package/dist/sequence.d.ts +0 -45
  43. package/dist/sequence.d.ts.map +0 -1
  44. package/dist/sequence.js +0 -96
  45. package/dist/sequence.js.map +0 -1
  46. package/dist/string.d.ts +0 -25
  47. package/dist/string.d.ts.map +0 -1
  48. package/dist/string.js +0 -2
  49. package/dist/string.js.map +0 -1
  50. package/dist/transformer.d.ts +0 -191
  51. package/dist/transformer.d.ts.map +0 -1
  52. package/dist/transformer.js +0 -459
  53. package/dist/transformer.js.map +0 -1
  54. package/dist/version.d.ts +0 -5
  55. package/dist/version.d.ts.map +0 -1
  56. package/dist/version.js +0 -5
  57. package/dist/version.js.map +0 -1
package/dist/index.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";var oe=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var Je=(o,e)=>{for(var t in e)oe(o,t,{get:e[t],enumerable:!0})},_e=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ze(e))!Ze.call(o,n)&&n!==t&&oe(o,n,{get:()=>e[n],enumerable:!(i=Ge(e,n))||i.enumerable});return o};var We=o=>_e(oe({},"__esModule",{value:!0}),o);var bt={};Je(bt,{ALPHABETIC_CREATOR:()=>Ue,ALPHABETIC_VALIDATOR:()=>pt,ALPHANUMERIC_CREATOR:()=>Ke,ALPHANUMERIC_VALIDATOR:()=>mt,CharacterSetCreator:()=>k,CharacterSetValidator:()=>ae,EncryptionTransformer:()=>se,Exclusions:()=>b,HEXADECIMAL_CREATOR:()=>De,HEXADECIMAL_VALIDATOR:()=>gt,IdentityTransformer:()=>re,NUMERIC_CREATOR:()=>je,NUMERIC_VALIDATOR:()=>ft,RecordValidator:()=>xe,RegExpValidator:()=>_,Sequence:()=>J,Transformer:()=>P,i18nUtilityInit:()=>dt,i18nextUtility:()=>m,mapIterable:()=>K,utilityNS:()=>ke,utilityResourceBundle:()=>Be});module.exports=We(bt);var ie=require("@aidc-toolkit/core");var p=o=>typeof o=="string",G=()=>{let o,e,t=new Promise((i,n)=>{o=i,e=n});return t.resolve=o,t.reject=e,t},Te=o=>o==null?"":String(o),Xe=(o,e,t)=>{o.forEach(i=>{e[i]&&(t[i]=e[i])})},Ye=/###/g,Oe=o=>o&&o.includes("###")?o.replace(Ye,"."):o,Ce=o=>!o||p(o),z=(o,e,t)=>{let i=p(e)?e.split("."):e,n=0;for(;n<i.length-1;){if(Ce(o))return{};let r=Oe(i[n]);!o[r]&&t&&(o[r]=new t),Object.prototype.hasOwnProperty.call(o,r)?o=o[r]:o={},++n}return Ce(o)?{}:{obj:o,k:Oe(i[n])}},Ne=(o,e,t)=>{let{obj:i,k:n}=z(o,e,Object);if(i!==void 0||e.length===1){i[n]=t;return}let r=e[e.length-1],s=e.slice(0,e.length-1),a=z(o,s,Object);for(;a.obj===void 0&&s.length;)r=`${s[s.length-1]}.${r}`,s=s.slice(0,s.length-1),a=z(o,s,Object),a?.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=t},Qe=(o,e,t,i)=>{let{obj:n,k:r}=z(o,e,Object);n[r]=n[r]||[],n[r].push(t)},Y=(o,e)=>{let{obj:t,k:i}=z(o,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},et=(o,e,t)=>{let i=Y(o,t);return i!==void 0?i:Y(e,t)},Me=(o,e,t)=>{for(let i in e)i!=="__proto__"&&i!=="constructor"&&(i in o?p(o[i])||o[i]instanceof String||p(e[i])||e[i]instanceof String?t&&(o[i]=e[i]):Me(o[i],e[i],t):o[i]=e[i]);return o},A=o=>o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},nt=o=>p(o)?o.replace(/[&<>"'\/]/g,e=>tt[e]):o,he=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}},it=[" ",",","?","!",";"],rt=new he(20),st=(o,e,t)=>{e=e||"",t=t||"";let i=it.filter(s=>!e.includes(s)&&!t.includes(s));if(i.length===0)return!0;let n=rt.getRegExp(`(${i.map(s=>s==="?"?"\\?":s).join("|")})`),r=!n.test(o);if(!r){let s=o.indexOf(t);s>0&&!n.test(o.substring(0,s))&&(r=!0)}return r},de=(o,e,t=".")=>{if(!o)return;if(o[e])return Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0;let i=e.split(t),n=o;for(let r=0;r<i.length;){if(!n||typeof n!="object")return;let s,a="";for(let l=r;l<i.length;++l)if(l!==r&&(a+=t),a+=i[l],s=n[a],s!==void 0){if(["string","number","boolean"].includes(typeof s)&&l<i.length-1)continue;r+=l-r+1;break}n=s}return n},Z=o=>o?.replace(/_/g,"-"),at={type:"logger",log(o){this.output("log",o)},warn(o){this.output("warn",o)},error(o){this.output("error",o)},output(o,e){console?.[o]?.apply?.(console,e)}},fe=class o{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||at,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,n){return n&&!this.debug?null:(e=e.map(r=>p(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),p(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new o(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new o(this.logger,e)}},v=new fe,U=class{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);let n=this.observers[i].get(t)||0;this.observers[i].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let i=(...n)=>{t(...n),this.off(e,i)};return this.on(e,i),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let s=0;s<r;s++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let s=0;s<r;s++)n(e,...t)})}},Q=class extends U{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i,n={}){let r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure,a;e.includes(".")?a=e.split("."):(a=[e,t],i&&(Array.isArray(i)?a.push(...i):p(i)&&r?a.push(...i.split(r)):a.push(i)));let l=Y(this.data,a);return!l&&!t&&!i&&e.includes(".")&&(e=a[0],t=a[1],i=a.slice(2).join(".")),l||!s||!p(i)?l:de(this.data?.[e]?.[t],i,r)}addResource(e,t,i,n,r={silent:!1}){let s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=[e,t];i&&(a=a.concat(s?i.split(s):i)),e.includes(".")&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),Ne(this.data,a,n),r.silent||this.emit("added",e,t,i,n)}addResources(e,t,i,n={silent:!1}){for(let r in i)(p(i[r])||Array.isArray(i[r]))&&this.addResource(e,t,r,i[r],{silent:!0});n.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,n,r,s={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),n=i,i=t,t=a[1]),this.addNamespaces(t);let l=Y(this.data,a)||{};s.skipCopy||(i=JSON.parse(JSON.stringify(i))),n?Me(l,i,r):l={...l,...i},Ne(this.data,a,l),s.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}},Ve={processors:{},addPostProcessor(o){this.processors[o.name]=o},handle(o,e,t,i,n){return o.forEach(r=>{e=this.processors[r]?.process(e,t,i,n)??e}),e}},Pe=Symbol("i18next/PATH_KEY");function ot(){let o=[],e=Object.create(null),t;return e.get=(i,n)=>(t?.revoke?.(),n===Pe?o:(o.push(n),t=Proxy.revocable(i,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function D(o,e){let{[Pe]:t}=o(ot()),i=e?.keySeparator??".",n=e?.nsSeparator??":",r=e?.enableSelector==="strict";if(t.length>1&&n){let s=e?.ns,a=r?Array.isArray(s)?s:s?[s]:null:Array.isArray(s)?s:null;if(a&&(r?a:a.length>1?a.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(i)}`}return t.join(i)}var le=o=>!p(o)&&typeof o!="boolean"&&typeof o!="number",ee=class o extends U{constructor(e,t={}){super(),Xe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=v.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let i={...t};if(e==null)return!1;let n=this.resolve(e,i);if(n?.res===void 0)return!1;let r=le(n.res);return!(i.returnObjects===!1&&r)}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");let n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],s=i&&e.includes(i),a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!st(e,i,n);if(s&&!a){let l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:p(r)?[r]:r};let u=e.split(i);(i!==n||i===n&&this.options.ns.includes(u[0]))&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:p(r)?[r]:r}}translate(e,t,i){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=D(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(w=>typeof w=="function"?D(w,{...this.options,...n}):String(w));let r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1],c=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");let h=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return d?r?{res:`${u}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a;let f=this.resolve(e,n),g=f?.res,x=f?.usedKey||a,L=f?.exactUsedKey||a,C=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,F=!this.i18nFormat||this.i18nFormat.handleAsObject,T=n.count!==void 0&&!p(n.count),M=o.hasDefaultValue(n),B=T?this.pluralResolver.getSuffix(h,n.count,n):"",j=n.ordinal&&T?this.pluralResolver.getSuffix(h,n.count,{ordinal:!1}):"",ye=T&&!n.ordinal&&n.count===0,V=ye&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${B}`]||n[`defaultValue${j}`]||n.defaultValue,R=g;F&&!g&&M&&(R=V);let He=le(R),qe=Object.prototype.toString.apply(R);if(F&&R&&He&&!C.includes(qe)&&!(p(y)&&Array.isArray(R))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,R,{...n,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(f.res=w,f.usedParams=this.getUsedParamsDetails(n),f):w}if(s){let w=Array.isArray(R),N=w?[]:{},Se=w?L:x;for(let E in R)if(Object.prototype.hasOwnProperty.call(R,E)){let I=`${Se}${s}${E}`;M&&!g?N[E]=this.translate(I,{...n,defaultValue:le(V)?V[E]:void 0,joinArrays:!1,ns:l}):N[E]=this.translate(I,{...n,joinArrays:!1,ns:l}),N[E]===I&&(N[E]=R[E])}g=N}}else if(F&&p(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,n,i));else{let w=!1,N=!1;!this.isValidLookup(g)&&M&&(w=!0,g=V),this.isValidLookup(g)||(N=!0,g=a);let E=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:g,I=M&&V!==g&&this.options.updateMissing;if(N||w||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,T&&!I?`${a}${this.pluralResolver.getSuffix(h,n.count,n)}`:a,I?V:g),s){let O=this.resolve(a,{...n,keySeparator:!1});O&&O.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 H=[],W=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&W&&W[0])for(let O=0;O<W.length;O++)H.push(W[O]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);let Le=(O,$,q)=>{let we=M&&q!==g?q:E;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,$,we,I,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(O,u,$,we,I,n),this.emit("missingKey",O,u,$,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?H.forEach(O=>{let $=this.pluralResolver.getSuffixes(O,n);ye&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!$.includes(`${this.options.pluralSeparator}zero`)&&$.push(`${this.options.pluralSeparator}zero`),$.forEach(q=>{Le([O],a+q,n[`defaultValue${q}`]||V)})}):Le(H,a,V))}g=this.extendTranslation(g,e,n,f,i),N&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${u}${c}${a}`),(N||w)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${a}`:a,w?g:void 0,n))}return r?(f.res=g,f.usedParams=this.getUsedParamsDetails(n),f):g}extendTranslation(e,t,i,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});let l=p(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),u;if(l){let h=e.match(this.interpolator.nestingRegexp);u=h&&h.length}let c=i.replace&&!p(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,i.lng||this.language||n.usedLng,i),l){let h=e.match(this.interpolator.nestingRegexp),d=h&&h.length;u<d&&(i.nest=!1)}!i.lng&&n&&n.res&&(i.lng=this.language||n.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>r?.[0]===h[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`),null):this.translate(...h,t),i)),i.interpolation&&this.interpolator.reset()}let s=i.postProcess||this.options.postProcess,a=p(s)?[s]:s;return e!=null&&a?.length&&i.applyPostProcessor!==!1&&(e=Ve.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,t={}){let i,n,r,s,a;return p(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?D(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(i))return;let u=this.extractFromKey(l,t),c=u.key;n=c;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));let d=t.count!==void 0&&!p(t.count),f=d&&!t.ordinal&&t.count===0,g=t.context!==void 0&&(p(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(L=>{this.isValidLookup(i)||(a=L,!this.checkedLoadedFor[`${x[0]}-${L}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(this.checkedLoadedFor[`${x[0]}-${L}`]=!0,this.logger.warn(`key "${n}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(C=>{if(this.isValidLookup(i))return;s=C;let y=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,C,L,t);else{let T;d&&(T=this.pluralResolver.getSuffix(C,t.count,t));let M=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&T.startsWith(B)&&y.push(c+T.replace(B,this.options.pluralSeparator)),y.push(c+T),f&&y.push(c+M)),g){let j=`${c}${this.options.contextSeparator||"_"}${t.context}`;y.push(j),d&&(t.ordinal&&T.startsWith(B)&&y.push(j+T.replace(B,this.options.pluralSeparator)),y.push(j+T),f&&y.push(j+M))}}let F;for(;F=y.pop();)this.isValidLookup(i)||(r=F,i=this.getResource(C,L,F,t))}))})}),{res:i,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}getUsedParamsDetails(e={}){let t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!p(e.replace),n=i?e.replace:e;if(i&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(let r of t)delete n[r]}return n}static hasDefaultValue(e){let t="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&i.startsWith(t)&&e[i]!==void 0)return!0;return!1}},te=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=v.create("languageUtils")}getScriptPartFromCode(e){if(e=Z(e),!e||!e.includes("-"))return null;let t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Z(e),!e||!e.includes("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(p(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;let n=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;let n=this.getScriptPartFromCode(i);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(i);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(s=>s===r?!0:!s.includes("-")&&!r.includes("-")?!1:!!(s.includes("-")&&!r.includes("-")&&s.slice(0,s.indexOf("-"))===r||s.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),p(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){let i=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=s=>{s&&(this.isSupportedCode(s)?n.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return p(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):p(e)&&r(this.formatLanguageCode(e)),i.forEach(s=>{n.includes(s)||r(this.formatLanguageCode(s))}),n}},Re={zero:0,one:1,two:2,few:3,many:4,other:5},Ee={select:o=>o===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})},ge=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=v.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let i=Z(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let s;try{s=new Intl.PluralRules(i,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Ee;if(!e.match(/-|_/))return Ee;let l=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(l,t)}return this.pluralRulesCache[r]=s,s}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((n,r)=>Re[n]-Re[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,i={}){let n=this.getRule(e,i);return n?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}},Ie=(o,e,t,i=".",n=!0)=>{let r=et(o,e,t);return!r&&n&&p(t)&&(r=de(o,t,i),r===void 0&&(r=de(e,t,i))),r},ue=o=>o.replace(/\$/g,"$$$$"),ne=class{constructor(e={}){this.logger=v.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:i,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:h,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:g,nestingSuffixEscaped:x,nestingOptionsSeparator:L,maxReplaces:C,alwaysFormat:y}=e.interpolation;this.escape=t!==void 0?t:nt,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?A(r):s||"{{",this.suffix=a?A(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":h?A(h):"-",this.unescapeSuffix=this.unescapePrefix?"":c?A(c):"",this.nestingPrefix=d?A(d):f||A("$t("),this.nestingSuffix=g?A(g):x||A(")"),this.nestingOptionsSeparator=L||",",this.maxReplaces=C||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,i,n){let r,s,a,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=f=>{if(!f.includes(this.formatSeparator)){let C=Ie(t,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,i,{...n,...t,interpolationkey:f}):C}let g=f.split(this.formatSeparator),x=g.shift().trim(),L=g.join(this.formatSeparator).trim();return this.format(Ie(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),L,i,{...n,...t,interpolationkey:x})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false \u2014 if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let c=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>ue(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?ue(this.escape(f)):ue(f)}].forEach(f=>{for(a=0;r=f.regex.exec(e);){let g=r[1].trim();if(s=u(g),s===void 0)if(typeof c=="function"){let L=c(e,r,n);s=p(L)?L:""}else if(n&&Object.prototype.hasOwnProperty.call(n,g))s="";else if(h){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),s="";else!p(s)&&!this.useRawValueToEscape&&(s=Te(s));let x=f.safeValue(s);if(e=e.replace(r[0],x),h?(f.regex.lastIndex+=s.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,i={}){let n,r,s,a=(l,u)=>{let c=this.nestingOptionsSeparator;if(!l.includes(c))return l;let h=l.split(new RegExp(`${A(c)}[ ]*{`)),d=`{${h[1]}`;l=h[0],d=this.interpolate(d,s);let f=d.match(/'/g),g=d.match(/"/g);((f?.length??0)%2===0&&!g||(g?.length??0)%2!==0)&&(d=d.replace(/'/g,'"'));try{s=JSON.parse(d),u&&(s={...u,...s})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,x),`${l}${c}${d}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];s={...i},s=s.replace&&!p(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(a.call(this,n[1].trim(),s),s),r&&n[0]===e&&!p(r))return r;p(r)||(r=Te(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((c,h)=>this.format(c,h,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}},lt=o=>{let e=o.toLowerCase().trim(),t={};if(o.includes("(")){let i=o.split("(");e=i[0].toLowerCase().trim();let n=i[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(s=>{if(s){let[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=a.trim();t[c]||(t[c]=u),u==="false"&&(t[c]=!1),u==="true"&&(t[c]=!0),isNaN(u)||(t[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},ve=o=>{let e={};return(t,i,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});let s=i+JSON.stringify(r),a=e[s];return a||(a=o(Z(i),n),e[s]=a),a(t)}},ut=o=>(e,t,i)=>o(Z(t),i)(e),pe=class{constructor(e={}){this.logger=v.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let i=t.cacheInBuiltFormats?ve:ut;this.formats={number:i((n,r)=>{let s=new Intl.NumberFormat(n,{...r});return a=>s.format(a)}),currency:i((n,r)=>{let s=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>s.format(a)}),datetime:i((n,r)=>{let s=new Intl.DateTimeFormat(n,{...r});return a=>s.format(a)}),relativetime:i((n,r)=>{let s=new Intl.RelativeTimeFormat(n,{...r});return a=>s.format(a,r.range||"day")}),list:i((n,r)=>{let s=new Intl.ListFormat(n,{...r});return a=>s.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ve(t)}format(e,t,i,n={}){if(!t||e==null)return e;let r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(a=>a.includes(")"))){let a=r.findIndex(l=>l.includes(")"));r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,l)=>{let{formatName:u,formatOptions:c}=lt(l);if(this.formats[u]){let h=a;try{let d=n?.formatParams?.[n.interpolationkey]||{},f=d.locale||d.lng||n.locale||n.lng||i;h=this.formats[u](a,f,{...c,...n,...d})}catch(d){this.logger.warn(d)}return h}else this.logger.warn(`there was no format function for ${u}`);return a},e)}},ct=(o,e)=>{o.pending[e]!==void 0&&(delete o.pending[e],o.pendingCount--)},me=class extends U{constructor(e,t,i,n={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=n,this.logger=v.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,n.backend,n)}queueLoad(e,t,i,n){let r={},s={},a={},l={};return e.forEach(u=>{let c=!0;t.forEach(h=>{let d=`${u}|${h}`;!i.reload&&this.store.hasResourceBundle(u,h)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?s[d]===void 0&&(s[d]=!0):(this.state[d]=1,c=!1,s[d]===void 0&&(s[d]=!0),r[d]===void 0&&(r[d]=!0),l[h]===void 0&&(l[h]=!0)))}),c||(a[u]=!0)}),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,i){let n=e.split("|"),r=n[0],s=n[1];t&&this.emit("failedLoading",r,s,t),!t&&i&&this.store.addResourceBundle(r,s,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);let a={};this.queue.forEach(l=>{Qe(l.loaded,[r],s),ct(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});let c=l.loaded[u];c.length&&c.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,i,n=0,r=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:r,callback:s});return}this.readingCalls++;let a=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){let h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&c&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,i,n+1,r*2,s)},r);return}s(u,c)},l=this.backend[i].bind(this.backend);if(l.length===2){try{let u=l(e,t);u&&typeof u.then=="function"?u.then(c=>a(null,c)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,t,a)}prepareLoading(e,t,i={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();p(e)&&(e=this.languageUtils.toResolveHierarchy(e)),p(t)&&(t=[t]);let r=this.queueLoad(e,t,i,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(s=>{this.loadOne(s)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){let i=e.split("|"),n=i[0],r=i[1];this.read(n,r,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,s),!s&&a&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,a),this.loaded(e,s,a)})}saveMissing(e,t,i,n,r,s={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){let l={...s,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,t,i,n,l):c=u(e,t,i,n),c&&typeof c.then=="function"?c.then(h=>a(null,h)).catch(a):a(null,c)}catch(c){a(c)}else u(e,t,i,n,a,l)}!e||!e[0]||this.store.addResource(e[0],t,i,n)}}},ce=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:o=>{let e={};if(typeof o[1]=="object"&&(e=o[1]),p(o[1])&&(e.defaultValue=o[1]),p(o[2])&&(e.tDescription=o[2]),typeof o[2]=="object"||typeof o[3]=="object"){let t=o[3]||o[2];Object.keys(t).forEach(i=>{e[i]=t[i]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ae=o=>(p(o.ns)&&(o.ns=[o.ns]),p(o.fallbackLng)&&(o.fallbackLng=[o.fallbackLng]),p(o.fallbackNS)&&(o.fallbackNS=[o.fallbackNS]),o.supportedLngs&&!o.supportedLngs.includes("cimode")&&(o.supportedLngs=o.supportedLngs.concat(["cimode"])),o),X=()=>{},ht=o=>{Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(t=>{typeof o[t]=="function"&&(o[t]=o[t].bind(o))})},be=class o extends U{constructor(e={},t){if(super(),this.options=Ae(e),this.services={},this.logger=v,this.modules={external:[]},ht(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(p(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));let i=ce();this.options={...i,...this.options,...Ae(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);let n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?v.init(n(this.modules.logger),this.options):v.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pe;let c=new te(this.options);this.store=new Q(this.options.resources,this.options);let h=this.services;h.logger=v,h.resourceStore=this.store,h.languageUtils=c,h.pluralResolver=new ge(c,{prepend:this.options.pluralSeparator}),u&&(h.formatter=n(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new ne(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new me(n(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(d,...f)=>{this.emit(d,...f)}),this.modules.languageDetector&&(h.languageDetector=n(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=n(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new ee(this.services,this.options),this.translator.on("*",(d,...f)=>{this.emit(d,...f)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});let a=G(),l=()=>{let u=(c,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(h),t(c,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,t=X){let i=t,n=p(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();let r=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{u!=="cimode"&&(r.includes(u)||r.push(u))})};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload?.forEach?.(a=>s(a)),this.services.backendConnector.load(r,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(a)})}else i(null)}reloadResources(e,t,i){let n=G();return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=X),this.services.backendConnector.reload(e,t,r=>{n.resolve(),i(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Ve.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let t=0;t<this.languages.length;t++){let i=this.languages[t];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let i=G();this.emit("languageChanging",e);let n=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},r=(a,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),t&&t(a,(...u)=>this.t(...u))},s=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);let l=p(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(p(a)?[a]:a);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,c=>{r(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,t,i,n){let r=n?.scopeNs,s=(a,l,...u)=>{let c;typeof l!="object"?c=this.options.overloadTranslationOptionHandler([a,l].concat(u)):c={...l},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs;let h=c.ns!==void 0&&c.ns!==null;c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||i||s.keyPrefix);let d={...this.options,...c};Array.isArray(r)&&!h&&(d.ns=r),typeof c.keyPrefix=="function"&&(c.keyPrefix=D(c.keyPrefix,d));let f=this.options.keySeparator||".",g;return c.keyPrefix&&Array.isArray(a)?g=a.map(x=>(typeof x=="function"&&(x=D(x,d)),`${c.keyPrefix}${f}${x}`)):(typeof a=="function"&&(a=D(a,d)),g=c.keyPrefix?`${c.keyPrefix}${f}${a}`:a),this.t(g,c)};return p(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=i,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let i=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;let s=(a,l)=>{let u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(t.precheck){let a=t.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(i,e)&&(!n||s(r,e)))}loadNamespaces(e,t){let i=G();return this.options.ns?(p(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{i.resolve(),t&&t(n)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){let i=G();p(e)&&(e=[e]);let n=this.options.preload||[],r=e.filter(s=>!n.includes(s)&&this.services.languageUtils.isSupportedCode(s));return r.length?(this.options.preload=n.concat(r),this.loadResources(s=>{i.resolve(),t&&t(s)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let n=new Intl.Locale(e);if(n&&n.getTextInfo){let r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}let t=["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"],i=this.services?.languageUtils||new te(ce());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(i.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let i=new o(e,t);return i.createInstance=o.createInstance,i}cloneInstance(e={},t=X){let i=e.forkResourceStore;i&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},r=new o(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i){let a=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,h)=>(c[h]={...l[u][h]},c),l[u]),l),{});r.store=new Q(a,n),r.services.resourceStore=r.store}if(e.interpolation){let l={...ce().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new ne(u)}return r.translator=new ee(r.services,n),r.translator.on("*",(a,...l)=>{r.emit(a,...l)}),r.init(n,t),r.translator.options=n,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}}},S=be.createInstance(),yt=S.createInstance,St=S.dir,Lt=S.init,wt=S.loadResources,Tt=S.reloadResources,Ot=S.use,Ct=S.changeLanguage,Nt=S.getFixedT,Rt=S.t,Et=S.exists,It=S.setDefaultNamespace,vt=S.hasLoadedNamespace,At=S.loadNamespaces,Mt=S.loadLanguages;var Fe={Transformer:{domainMustBeGreaterThanZero:"Domain {{domain, number}} must be greater than 0",tweakMustBeGreaterThanOrEqualToZero:"Tweak {{tweak, number}} must be greater than or equal to 0",valueMustBeGreaterThanOrEqualToZero:"Value {{value, number}} must be greater than or equal to 0",valueMustBeLessThan:"Value {{value, number}} must be less than {{domain, number}}",minimumValueMustBeGreaterThanOrEqualToZero:"Minimum value {{minimumValue, number}} must be greater than or equal to 0",maximumValueMustBeLessThan:"Maximum value {{maximumValue, number}} must be less than {{domain, number}}"},RegExpValidator:{stringDoesNotMatchPattern:"String {{s}} does not match pattern"},CharacterSetValidator:{firstZeroFirstCharacter:"Character set must support zero as first character",allNumericAllNumericCharacters:"Character set must support all numeric characters in sequence",stringMustNotBeAllNumeric:"String must not be all numeric",lengthMustBeGreaterThanOrEqualTo:"Length {{length, number}} must be greater than or equal to {{minimumLength, number}}",lengthMustBeLessThanOrEqualTo:"Length {{length, number}} must be less than or equal to {{maximumLength, number}}",lengthMustBeEqualTo:"Length {{length, number}} must be equal to {{exactLength, number}}",lengthOfComponentMustBeGreaterThanOrEqualTo:"Length {{length, number}} of {{component}} must be greater than or equal to {{minimumLength, number}}",lengthOfComponentMustBeLessThanOrEqualTo:"Length {{length, number}} of {{component}} must be less than or equal to {{maximumLength, number}}",lengthOfComponentMustBeEqualTo:"Length {{length, number}} of {{component}} must be equal to {{exactLength, number}}",invalidCharacterAtPosition:"Invalid character '{{c}}' at position {{position, number}}",invalidCharacterAtPositionOfComponent:"Invalid character '{{c}}' at position {{position, number}} of {{component}}",exclusionNotSupported:"Exclusion value of {{exclusion, number}} is not supported",endSequenceValueMustBeLessThanOrEqualTo:"End sequence value (start sequence value + count - 1) must be less than {{domain, number}}"},RecordValidator:{typeNameKeyNotFound:'{{typeName}} "{{key}}" not found'}};var $e={Transformer:{domainMustBeGreaterThanZero:"Le domaine {{domain, number}} doit \xEAtre sup\xE9rieur \xE0 0",tweakMustBeGreaterThanOrEqualToZero:"Le r\xE9glage {{tweak, number}} doit \xEAtre sup\xE9rieur ou \xE9gal \xE0 0",valueMustBeGreaterThanOrEqualToZero:"La valeur {{value, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 0",valueMustBeLessThan:"La valeur {{value, number}} doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}",minimumValueMustBeGreaterThanOrEqualToZero:"La valeur minimale {{minimumValue, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 0",maximumValueMustBeLessThan:"La valeur maximale {{maximumValue, number}} doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}"},RegExpValidator:{stringDoesNotMatchPattern:"La cha\xEEne {{s}} ne correspond pas au mod\xE8le"},CharacterSetValidator:{firstZeroFirstCharacter:"Le jeu de caract\xE8res doit prendre en charge z\xE9ro comme premier caract\xE8re",allNumericAllNumericCharacters:"Le jeu de caract\xE8res doit prendre en charge tous les caract\xE8res num\xE9riques en s\xE9quence",stringMustNotBeAllNumeric:"La cha\xEEne ne doit pas \xEAtre enti\xE8rement num\xE9rique",lengthMustBeGreaterThanOrEqualTo:"La longueur {{length, number}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 {{minimumLength, number}}",lengthMustBeLessThanOrEqualTo:"La longueur {{length, number}} doit \xEAtre inf\xE9rieure ou \xE9gale \xE0 {{maximumLength, number}}",lengthMustBeEqualTo:"La longueur {{length, number}} doit \xEAtre \xE9gale \xE0 {{exactLength, number}}",lengthOfComponentMustBeGreaterThanOrEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre sup\xE9rieure ou \xE9gale \xE0 {{minimumLength, number}}",lengthOfComponentMustBeLessThanOrEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre inf\xE9rieure ou \xE9gale \xE0 {{maximumLength, number}}",lengthOfComponentMustBeEqualTo:"La longueur {{length, number}} de {{component}} doit \xEAtre \xE9gale \xE0 {{exactLength, number}}",invalidCharacterAtPosition:"Caract\xE8re non valide '{{c}}' \xE0 la position {{position, number}}",invalidCharacterAtPositionOfComponent:"Caract\xE8re non valide '{{c}}' \xE0 la position {{position, number}} de {{component}}",exclusionNotSupported:"La valeur d'exclusion de {{exclusion, number}} n'est pas prise en charge",endSequenceValueMustBeLessThanOrEqualTo:"La valeur de la s\xE9quence de fin (valeur de la s\xE9quence de d\xE9but + nombre - 1) doit \xEAtre inf\xE9rieure \xE0 {{domain, number}}"},RecordValidator:{typeNameKeyNotFound:"{{typeName}} \xAB\xA0{{key}}\xA0\xBB introuvable"}};var ke="aidct_utility",Be={en:{aidct_utility:Fe},fr:{aidct_utility:$e}},m=S.createInstance();async function dt(o,e=!1){return(0,ie.i18nInit)(m,o,e,ke,Be,ie.i18nCoreInit)}var J=class{#t;#e;#r;#i;#n;#s;constructor(e,t){this.#t=BigInt(e),this.#e=this.#t+BigInt(t),this.#r=t,t>=0?(this.#i=1n,this.#n=this.#t,this.#s=this.#e-1n):(this.#i=-1n,this.#n=this.#e+1n,this.#s=this.#t)}get startValue(){return this.#t}get endValue(){return this.#e}get count(){return this.#r}get minimumValue(){return this.#n}get maximumValue(){return this.#s}*[Symbol.iterator](){for(let e=this.#t;e!==this.#e;e+=this.#i)yield e}};function K(o,e){return{*[Symbol.iterator](){let t=0;for(let i of o)yield e(i,t++)}}}var P=class o{static#t=new Map;#e;constructor(e){if(this.#e=BigInt(e),this.#e<=0n)throw new RangeError(m.t("Transformer.domainMustBeGreaterThanZero",{domain:e}))}static get(e,t){let i=BigInt(e),n=o.#t.get(i);n===void 0&&(n=new Map,o.#t.set(i,n));let r=t===void 0?void 0:BigInt(t),s=n.get(r);return s===void 0&&(s=r===void 0?new re(i):new se(i,r),n.set(r,s)),s}get domain(){return this.#e}#r(e){if(e<0n)throw new RangeError(m.t("Transformer.valueMustBeGreaterThanOrEqualToZero",{value:e}));if(e>=this.domain)throw new RangeError(m.t("Transformer.valueMustBeLessThan",{value:e,domain:this.domain}))}#i(e){let t=BigInt(e);return this.#r(t),this.doForward(t)}#n(e,t,i){return e(this.#i(t),i)}forward(e,t){let i;if(typeof e!="object")i=t===void 0?this.#i(e):this.#n(t,e);else if(e instanceof J){if(e.minimumValue<0n)throw new RangeError(m.t("Transformer.minimumValueMustBeGreaterThanOrEqualToZero",{minimumValue:e.minimumValue}));if(e.maximumValue>=this.domain)throw new RangeError(m.t("Transformer.maximumValueMustBeLessThan",{maximumValue:e.maximumValue,domain:this.domain}));i=t===void 0?K(e,n=>this.doForward(n)):K(e,(n,r)=>t(this.doForward(n),r))}else i=t===void 0?K(e,n=>this.#i(n)):K(e,(n,r)=>this.#n(t,n,r));return i}reverse(e){let t=BigInt(e);return this.#r(t),this.doReverse(t)}},re=class extends P{doForward(e){return e}doReverse(e){return e}},se=class o extends P{static#t=603868999n;static#e=new Uint8Array([1,2,4,8,16,32,64,128]);static#r=new Uint8Array([254,253,251,247,239,223,191,127]);#i;#n;#s;#o;#a;constructor(e,t){if(super(e),t<0n)throw new RangeError(m.t("Transformer.tweakMustBeGreaterThanOrEqualToZero",{tweak:t}));let i=0;for(let a=this.domain-1n;a!==0n;a>>=8n)i++;this.#i=i;let n=[],r=[],s=[];for(let a=this.domain*BigInt(t)*o.#t;a!==0n;a>>=8n){n.unshift(Number(BigInt.asUintN(8,a)));let l=Number(BigInt.asUintN(3,a));r.push(o.#e[l]),s.push(o.#r[l])}if(i===1){let a=o.#e.filter(l=>l<e).reduce((l,u)=>l|u,0);this.#n=new Uint8Array([n.reduce((l,u)=>l^u,0)&a]),this.#s=new Uint8Array([o.#e[0]]),this.#o=new Uint8Array([o.#r[0]]),this.#a=1}else this.#n=new Uint8Array(n),this.#s=new Uint8Array(r),this.#o=new Uint8Array(s),this.#a=n.length}#l(e){let t=new Uint8Array(this.#i);for(let i=this.#i-1,n=e;i>=0&&n!==0n;i--,n>>=8n)t[i]=Number(BigInt.asUintN(8,n));return t}static#u(e){return e.reduce((t,i)=>t<<8n|BigInt(i),0n)}#c(e,t,i){let n=e.length,r=new Uint8Array(n),s=[],a=[],l=this.#s[t];for(let[h,d]of e.entries()){let f=d&l;r[h]=f,(f!==0?s:a).push(h)}let u=this.#o[t],c=new Uint8Array(n);for(let[h,d]of[...s,...a].entries())i?c[h]=e[d]&u|r[h]:c[d]=e[h]&u|r[d];return c}#h(e,t,i){let n=this.#n[t];return e.map(r=>{let s=r^n;return n=i?s:r,s})}doForward(e){let t=this.#l(e),i;do{for(let n=0;n<this.#a;n++)t=this.#h(this.#c(t,n,!0),n,!0);i=o.#u(t)}while(i>=this.domain);return i}doReverse(e){let t=this.#l(e),i;do{for(let n=this.#a-1;n>=0;n--)t=this.#c(this.#h(t,n,!1),n,!1);i=o.#u(t)}while(i>=this.domain);return i}};var _=class{#t;constructor(e){this.#t=e}get regExp(){return this.#t}createErrorMessage(e){return m.t("RegExpValidator.stringDoesNotMatchPattern",{s:e})}validate(e){if(!this.#t.test(e))throw new RangeError(this.createErrorMessage(e))}};var xe=class{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get typeName(){return this.#t}get record(){return this.#e}validate(e){if(!(e in this.record))throw new RangeError(m.t("RecordValidator.typeNameKeyNotFound",{typeName:this.typeName,key:e}))}};var b={None:0,FirstZero:1,AllNumeric:2};var ae=class o{static#t=new class extends _{createErrorMessage(e){return m.t("CharacterSetValidator.stringMustNotBeAllNumeric")}}(/\D/u);#e;#r;#i;constructor(e,...t){this.#e=e;let i=new Map;for(let[n,r]of e.entries())i.set(r,n);this.#r=i,this.#i=t}get characterSet(){return this.#e}get characterSetSize(){return this.#e.length}get exclusionSupport(){return this.#i}character(e){return this.#e[e]}characterIndex(e){return this.#r.get(e)}characterIndexes(e){return Array.from(e).map(t=>this.#r.get(t))}static#n(e){return typeof e=="function"?e():e}validateExclusion(e){if(e!==void 0&&e!==b.None&&!this.#i.includes(e))throw new RangeError(m.t("CharacterSetValidator.exclusionNotSupported",{exclusion:e}))}validate(e,t){let i=e.length,n=t?.minimumLength,r=t?.maximumLength;if(n!==void 0&&i<n){let a;throw r!==void 0&&r===n?a=m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeEqualTo":"CharacterSetValidator.lengthOfComponentMustBeEqualTo",{component:o.#n(t?.component),length:i,exactLength:n}):a=m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeGreaterThanOrEqualTo":"CharacterSetValidator.lengthOfComponentMustBeGreaterThanOrEqualTo",{component:o.#n(t?.component),length:i,minimumLength:n}),new RangeError(a)}if(r!==void 0&&i>r)throw new RangeError(m.t(t?.component===void 0?"CharacterSetValidator.lengthMustBeLessThanOrEqualTo":"CharacterSetValidator.lengthOfComponentMustBeLessThanOrEqualTo",{component:o.#n(t?.component),length:i,maximumLength:r}));let s=this.characterIndexes(e).findIndex(a=>a===void 0);if(s!==-1)throw new RangeError(m.t(t?.component===void 0?"CharacterSetValidator.invalidCharacterAtPosition":"CharacterSetValidator.invalidCharacterAtPositionOfComponent",{component:o.#n(t?.component),c:e.charAt(s),position:s+(t?.positionOffset??0)+1}));if(t?.exclusion!==void 0)switch(this.validateExclusion(t.exclusion),t.exclusion){case b.None:break;case b.FirstZero:if(e.startsWith("0"))throw new RangeError(m.t(t.component===void 0?"CharacterSetValidator.invalidCharacterAtPosition":"CharacterSetValidator.invalidCharacterAtPositionOfComponent",{component:o.#n(t.component),c:"0",position:(t.positionOffset??0)+1}));break;case b.AllNumeric:o.#t.validate(e);break}}},k=class o extends ae{static MAXIMUM_STRING_LENGTH=40;static#t;static#e(e){let t=new Array(this.MAXIMUM_STRING_LENGTH+1),i=BigInt(e);for(let n=0,r=1n;n<=this.MAXIMUM_STRING_LENGTH;n++,r*=i)t[n]=r;return t}static powerOf10(e){return o.#t??=o.#e(10),o.#t[e]}#r;#i;#n;#s;constructor(e,...t){super(e,...t),this.#r=BigInt(this.characterSetSize),this.#i=BigInt(this.characterSetSize-1);let i=[],n=o.#e(this.characterSetSize);if(i[b.None]=n,t.includes(b.FirstZero)){if(e[0]!=="0")throw new RangeError(m.t("CharacterSetValidator.firstZeroFirstCharacter"));let s=new Array(o.MAXIMUM_STRING_LENGTH+1);s[0]=0n;for(let a=1;a<=o.MAXIMUM_STRING_LENGTH;a++)s[a]=this.#i*n[a-1];i[b.FirstZero]=s}if(t.includes(b.AllNumeric)){let a=function(d){let f=d[0];for(let g of d){if(g===void 0||g!==f)throw new RangeError(m.t("CharacterSetValidator.allNumericAllNumericCharacters"));f=g+1}};var r=a;let s=new Array(o.MAXIMUM_STRING_LENGTH+1),l=this.characterIndexes("0123456789");a(l);let u=BigInt(l[0]),c=new Array(o.MAXIMUM_STRING_LENGTH+1),h=0n;for(let d=0;d<=o.MAXIMUM_STRING_LENGTH;d++)s[d]=n[d]-o.powerOf10(d),c[d]=h,h=h*this.#r+u;this.#s=c,i[b.AllNumeric]=s}else this.#s=[];this.#n=i}#o(e){return this.#n[b.None][e]}#a(e,t,i){let n;if(t===0){if(!e&&i<10n)throw new RangeError(m.t("CharacterSetValidator.stringMustNotBeAllNumeric"));n=10n}else{let r=this.#o(t),s=o.powerOf10(t),a=e?r-s:r,l=i/a;l>=10n?n=o.powerOf10(t+1):n=l*s+this.#a(e,t-1,i-l*a)}return n}#l(e){if(e<0)throw new RangeError(m.t("CharacterSetValidator.lengthMustBeGreaterThanOrEqualTo",{length:e,minimumLength:0}));if(e>o.MAXIMUM_STRING_LENGTH)throw new RangeError(m.t("CharacterSetValidator.lengthMustBeLessThanOrEqualTo",{length:e,maximumLength:o.MAXIMUM_STRING_LENGTH}))}create(e,t,i,n,r){this.#l(e),this.validateExclusion(i);let s=i===b.AllNumeric?this.#s[e]:0n;return P.get(this.#n[i??b.None][e],n).forward(t,(l,u)=>{let c="";if(e!==0){let h=l;i===b.AllNumeric&&h>=s&&(h+=this.#a(!0,e,h-s));for(let d=e-1;d>0;d--){let f=h/this.#r;c=this.character(Number(h-f*this.#r))+c,h=f}c=this.character(i===b.FirstZero?Number(h%this.#i)+1:Number(h%this.#r))+c}return r===void 0?c:r(c,u)})}valueFor(e,t,i){let n=e.length;this.#l(n),this.validateExclusion(t);let r=BigInt(this.characterSetSize),s=this.characterIndexes(e).reduce((a,l,u)=>{if(l===void 0)throw new RangeError(m.t("CharacterSetValidator.invalidCharacterAtPosition",{c:e.charAt(u),position:u+1}));let c;if(u===0&&t===b.FirstZero){if(l===0)throw new RangeError(m.t("CharacterSetValidator.invalidCharacterAtPosition",{c:"0",position:1}));c=BigInt(l-1)}else c=a*r+BigInt(l);return c},0n);if(t===b.AllNumeric){let a=this.#s[n];s>=a&&(s-=this.#a(!1,n,s-a))}return P.get(this.#n[t??b.None][n],i).reverse(s)}},je=new k(["0","1","2","3","4","5","6","7","8","9"],b.FirstZero),ft=je,De=new k(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],b.FirstZero,b.AllNumeric),gt=De,Ue=new k(["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]),pt=Ue,Ke=new k(["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],b.FirstZero,b.AllNumeric),mt=Ke;0&&(module.exports={ALPHABETIC_CREATOR,ALPHABETIC_VALIDATOR,ALPHANUMERIC_CREATOR,ALPHANUMERIC_VALIDATOR,CharacterSetCreator,CharacterSetValidator,EncryptionTransformer,Exclusions,HEXADECIMAL_CREATOR,HEXADECIMAL_VALIDATOR,IdentityTransformer,NUMERIC_CREATOR,NUMERIC_VALIDATOR,RecordValidator,RegExpValidator,Sequence,Transformer,i18nUtilityInit,i18nextUtility,mapIterable,utilityNS,utilityResourceBundle});
2
+ /*!
3
+ * Copyright © 2024-2026 Dolphin Data Development Ltd. and AIDC Toolkit
4
+ * contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */