reslib 1.0.0 → 1.0.3

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 (42) hide show
  1. package/build/auth/index.d.ts +495 -83
  2. package/build/auth/index.js +2 -2
  3. package/build/auth/types.d.ts +88 -16
  4. package/build/countries/index.js +1 -1
  5. package/build/currency/index.d.ts +1 -1
  6. package/build/currency/index.js +1 -1
  7. package/build/currency/session.d.ts +1 -1
  8. package/build/currency/session.js +2 -2
  9. package/build/i18n/index.js +1 -1
  10. package/build/inputFormatter/index.js +1 -1
  11. package/build/logger/index.js +1 -1
  12. package/build/resources/index.js +3 -3
  13. package/build/resources/types/index.d.ts +11 -11
  14. package/build/session/index.d.ts +6 -6
  15. package/build/session/index.js +1 -1
  16. package/build/utils/date/dateHelper.js +1 -1
  17. package/build/utils/date/index.js +1 -1
  18. package/build/utils/index.d.ts +2 -0
  19. package/build/utils/index.js +2 -2
  20. package/build/utils/isHexadecimal.d.ts +23 -0
  21. package/build/utils/isHexadecimal.js +1 -0
  22. package/build/utils/isMongoId.d.ts +25 -0
  23. package/build/utils/isMongoId.js +1 -0
  24. package/build/utils/numbers.js +1 -1
  25. package/build/validator/index.js +3 -3
  26. package/build/validator/rules/array.d.ts +1 -1
  27. package/build/validator/rules/array.js +1 -1
  28. package/build/validator/rules/boolean.js +1 -1
  29. package/build/validator/rules/date.js +1 -1
  30. package/build/validator/rules/default.js +1 -1
  31. package/build/validator/rules/enum.js +1 -1
  32. package/build/validator/rules/file.js +1 -1
  33. package/build/validator/rules/format.js +2 -2
  34. package/build/validator/rules/index.js +3 -3
  35. package/build/validator/rules/multiRules.js +1 -1
  36. package/build/validator/rules/numeric.js +1 -1
  37. package/build/validator/rules/string.js +1 -1
  38. package/build/validator/rules/target.js +1 -1
  39. package/build/validator/types.d.ts +8 -13
  40. package/build/validator/validator.d.ts +8 -19
  41. package/build/validator/validator.js +1 -1
  42. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { Dictionary } from '../types/dictionary';
6
6
  *
7
7
  * The `AuthUser` interface defines the structure for an authenticated
8
8
  * user object, which includes core user identification, optional session
9
- * tracking, permissions mapping, authentication token, and role assignments.
9
+ * tracking, permissions mapping, and role assignments.
10
10
  * This interface extends `Dictionary` to allow for additional custom properties.
11
11
  *
12
12
  * ### Properties
@@ -14,7 +14,7 @@ import { Dictionary } from '../types/dictionary';
14
14
  * - `id` (string | number): A unique identifier for the user. This
15
15
  * can be either a string or a number, depending on the implementation.
16
16
  *
17
- * - `authSessionCreatedAt` (number, optional): An optional property
17
+ * - `sessionCreatedAt` (number, optional): An optional property
18
18
  * that stores the timestamp (in milliseconds) of when the
19
19
  * authentication session was created. This can be useful for
20
20
  * tracking session duration or expiration.
@@ -24,10 +24,6 @@ import { Dictionary } from '../types/dictionary';
24
24
  * to perform on those resources. This allows for fine-grained control
25
25
  * over user permissions within the application.
26
26
  *
27
- * - `token` (string, optional): An optional authentication token
28
- * associated with the user, typically used for API authentication
29
- * or session management.
30
- *
31
27
  * - `roles` (AuthRole[], optional): An optional array of roles assigned
32
28
  * to the user, defining their authorization level and capabilities.
33
29
  *
@@ -38,8 +34,7 @@ import { Dictionary } from '../types/dictionary';
38
34
  * ```typescript
39
35
  * const user: AuthUser = {
40
36
  * id: "user123",
41
- * authSessionCreatedAt: Date.now(),
42
- * token: "jwt-token-here",
37
+ * sessionCreatedAt: Date.now(),
43
38
  * perms: {
44
39
  * documents: ["read", "create", "update"],
45
40
  * users: ["read", "delete"]
@@ -60,7 +55,7 @@ import { Dictionary } from '../types/dictionary';
60
55
  * ```
61
56
  *
62
57
  * In this example, the `AuthUser` interface is used to define a user
63
- * object with an ID, session creation timestamp, authentication token,
58
+ * object with an ID, session creation timestamp,
64
59
  * permissions map, and roles. The `hasPermission` function checks if
65
60
  * the user has the specified permission for a given resource.
66
61
  *
@@ -69,14 +64,9 @@ import { Dictionary } from '../types/dictionary';
69
64
  * @see {@link AuthPerms} for the `AuthPerms` type.
70
65
  * @see {@link AuthRole} for the `AuthRole` interface.
71
66
  */
72
- export interface AuthUser extends Dictionary {
73
- id: string | number;
74
- authSessionCreatedAt?: number;
67
+ export interface AuthUser {
68
+ sessionCreatedAt?: number;
75
69
  perms?: AuthPerms;
76
- /**
77
- * The authentication token associated with the user.
78
- */
79
- token?: string;
80
70
  roles?: AuthRole[];
81
71
  }
82
72
  /**
@@ -463,3 +453,85 @@ export interface AuthEventMap {
463
453
  * }
464
454
  */
465
455
  export type AuthEvent = keyof AuthEventMap;
456
+ /**
457
+ * @interface AuthSecureStorage
458
+ * Interface for secure, cross-platform storage of authentication data.
459
+ *
460
+ * The `AuthSecureStorage` interface abstracts storage operations to enable secure,
461
+ * platform-specific implementations for storing sensitive data like user sessions
462
+ * and tokens. This allows the library to work across web, React Native, Node.js,
463
+ * and other environments by injecting appropriate storage adapters.
464
+ *
465
+ * ### Security Features:
466
+ * - **Async Operations**: All methods are asynchronous to support secure storage APIs
467
+ * - **Encryption Ready**: Implementations should handle encryption internally
468
+ * - **Platform Agnostic**: No assumptions about underlying storage mechanism
469
+ * - **Error Handling**: Methods should handle storage failures gracefully
470
+ *
471
+ * ### Methods
472
+ *
473
+ * - `get(key: string): Promise<string | null>`: Retrieves the value associated with the key
474
+ * - `set(key: string, value: string): Promise<void>`: Stores a value under the specified key
475
+ * - `remove(key: string): Promise<void>`: Removes the value associated with the key
476
+ *
477
+ * ### Example Usage
478
+ *
479
+ * ```typescript
480
+ * // Web implementation using HttpOnly cookies
481
+ * class WebSecureStorage implements AuthSecureStorage {
482
+ * async get(key: string): Promise<string | null> {
483
+ * return Cookies.get(key) || null;
484
+ * }
485
+ * async set(key: string, value: string): Promise<void> {
486
+ * Cookies.set(key, value, { httpOnly: true, secure: true });
487
+ * }
488
+ * async remove(key: string): Promise<void> {
489
+ * Cookies.remove(key);
490
+ * }
491
+ * }
492
+ *
493
+ * // React Native implementation using expo-secure-store
494
+ * class ReactNativeSecureStorage implements AuthSecureStorage {
495
+ * async get(key: string): Promise<string | null> {
496
+ * return await SecureStore.getItemAsync(key);
497
+ * }
498
+ * async set(key: string, value: string): Promise<void> {
499
+ * await SecureStore.setItemAsync(key, value);
500
+ * }
501
+ * async remove(key: string): Promise<void> {
502
+ * await SecureStore.deleteItemAsync(key);
503
+ * }
504
+ * }
505
+ *
506
+ * // Configure Auth to use platform-specific storage
507
+ * Auth.secureStorage = new ReactNativeSecureStorage();
508
+ * ```
509
+ *
510
+ * @see {@link Auth.configure} - Method to inject storage implementation
511
+ * @see {@link Auth.getToken} - Uses this interface for token storage
512
+ * @see {@link Auth.setToken} - Uses this interface for token storage
513
+ */
514
+ export interface AuthSecureStorage {
515
+ /**
516
+ * Retrieves the value associated with the specified key.
517
+ *
518
+ * @param key - The unique key for the stored value
519
+ * @returns Promise resolving to the stored string value, or null if not found
520
+ */
521
+ get(key: string): Promise<string | null>;
522
+ /**
523
+ * Stores a value under the specified key.
524
+ *
525
+ * @param key - The unique key for storing the value
526
+ * @param value - The string value to store
527
+ * @returns Promise that resolves when storage is complete
528
+ */
529
+ set(key: string, value: string): Promise<void>;
530
+ /**
531
+ * Removes the value associated with the specified key.
532
+ *
533
+ * @param key - The unique key for the value to remove
534
+ * @returns Promise that resolves when removal is complete
535
+ */
536
+ remove(key: string): Promise<void>;
537
+ }
@@ -2,4 +2,4 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ie={auth:se,currencies:de,countries:A,dates:le,resources:ce,validator:ue};function c(e){return !!(e&&typeof e=="string")}function f(...e){for(var r in e){let t=e[r];if(c(t))return t}return ""}function U(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}function b(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function w(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}var s=class s{static parseString(r,t){if(c(r)&&c(t))try{let i=v__default.default(r,t,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:t,isValid:!0}}catch(i){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let i of t){let a=me(r,i);if(a)return a}for(let i of s.DATE_FORMATS){let a=me(r,i);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(r){let t=r?s.parseDate(r):new Date;return t?t.toISOString():""}static isoStringToDate(r){return new Date(r)}static parseDate(r,t){if(s.isDateObj(r))return r;if(!c(t)){let i=s.parseString(r);return i!=null&&i.isValid?i.date:null}if(U(r))return null;try{let i=v__default.default(r,t,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",r," format is : ",t);}return null}static toSQLDateTimeFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0"),n=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0"),d=String(r.getSeconds()).padStart(2,"0");return `${t}-${i}-${a} ${n}:${o}:${d}`}static getI18n(r){return O.isI18nInstance(r)?r:O.getInstance()}static getDefaultDateTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0");return `${t}-${i}-${a}`}static toSQLTimeFormat(r){if(!s.isDateObj(r))return "";let t=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");return `${t}:${i}:${a}`}static getDefaultTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(r,t){if(r==null||typeof r=="boolean")return false;if(s.isDateObj(r))return true;if(b(r)){let a=new Date(r);return a&&!isNaN(a.getTime())}if(c(r))return !!s.parseDate(r,t);if(r!=null&&r.toString&&(r==null?void 0:r.toString())==parseInt(r).toString())return false;let i=new Date(r);return s.isDateObj(i)}static addToDate(r,t,i){if(b(r)||(r=0),U(t)&&(t=new Date),s.isValidDate(t)&&c(t)&&(t=new Date(t)),s.isValidDate(t)||(t=c(t)?new Date(t):new Date),c(i)&&typeof t["set"+i]=="function"&&typeof t["get"+i]=="function"){let a="set"+i,n="get"+i;t=new Date(t[a](t[n]()+r));}return t}static addDays(r,t){return s.addToDate(r,t,"Date")}static addMilliseconds(r,t){return b(r)||(r=0),s.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+r)}static addSeconds(r,t){return b(r)||(r=0),s.addMilliseconds(r*1e3,t)}static addMinutes(r,t){return b(r)||(r=0),s.addMilliseconds(r*6e4,t)}static addHours(r,t){return b(r)||(r=0),s.addMilliseconds(r*36e5,t)}static addMonths(r,t,i){return s.addToDate(r,t,"Month")}static addWeeks(r,t){return r=(b(r)?r:0)*7,s.addToDate(r,t,"Date")}static addYears(r,t){b(r)||(r=0);let i=new Date(s.addToDate(0,t)),a=i.getFullYear();return a+r<0?r=0:r+=a,i.setFullYear(r),new Date(i)}static formatDate(r,t){try{let i=v__default.default(r);if(i.isValid())return i.format(f(t,s.getDefaultDateTimeFormat()))}catch(i){}return f(s.isValidDate(r)?r==null?void 0:r.toString():"")}static getUTCDateTimeDetails(r){let t=r?v__default.default.utc(r):v__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};s.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],s.SQL_DATE_FORMAT="YYYY-MM-DD",s.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",s.SQL_TIME_FORMAT="HH:mm:ss",s.getCurrentMonthDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:i,last:a}},s.getPreviousWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=new Date(t.getTime()-3600*24*7*1e3),a=new Date(i),n=i.getDay(),o=i.getDate()-n+(n===0?-6:1),d=new Date(i.setDate(o)),u=new Date(a.setDate(o+6));return {first:d,last:u}},s.getCurrentWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=t.getDay(),a=t.getDate()-i+(i==0?-6:1),n=new Date(t),o=new Date(t.setDate(a));return n.setDate(n.getDate()+6),{first:o,last:n}},s.isDateObj=w;var g=s,me=(e,r)=>{let t=v__default.default(e,r,true);try{if(t.isValid()&&t.format(r)===e||v__default.default.utc(t,!0).format(r)===e)return {date:t.toDate(),matchedFormat:r,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return g.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return g.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return g.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(e){return g.formatDate(this,e)};Date.prototype.addYears=function(e){return g.addYears(e,this)};Date.prototype.addMonths=function(e){return g.addMonths(e,this)};Date.prototype.addMinutes=function(e){return g.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return g.addSeconds(e,this)};Date.prototype.addDays=function(e){return g.addDays(e,this)};Date.prototype.addWeeks=function(e){return g.addWeeks(e,this)};Date.prototype.addHours=function(e){return g.addHours(e,this)};var C=class C{static get logger(){let r=Reflect.getMetadata(C.loggerMetaData,C);return fe(r)&&(this._logger=r),this._logger?this._logger:console}static set logger(r){fe(r)&&Reflect.defineMetadata(C.loggerMetaData,r,C);}static _log(r,...t){let i=C.logger;r=f(r),r&&typeof i[r]=="function"?i[r](C.getDateTimeString(),...t):console.log("Logger level not found : [",r,"]",...t);}static getDateTimeString(){let{day:r,year:t,hours:i,minutes:a,seconds:n,dayNameShort:o,monthName:d}=g.getUTCDateTimeDetails(),u=r<10?"0"+r:r,l=i<10?"0"+i:i,y=a<10?"0"+a:a,h=n<10?"0"+n:n;return "["+[o,u,d,t].join(" ")+" "+[l,y,h].join(":")+"]"}static log(...r){this._log("log",...r);}static info(...r){this._log("info",...r);}static debug(...r){this._log("debug",...r);}static warn(...r){this._log("warn",...r);}static error(...r){this._log("error",...r);}};C.loggerMetaData=Symbol("logger-meta-data");var I=C,fe=e=>{if(!e)return false;try{return ["warn","info","error"].every(r=>typeof e[r]=="function")}catch(r){return false}};function Le(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ye(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:Le(e)}function pe(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var F=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(r){}return false},Pe=()=>{var e,r;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((r=process.versions)!=null&&r.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Re=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(r){}}return false},xe=()=>typeof window=="undefined"&&typeof process!="undefined",ge=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),He=()=>{if(!pe()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},Fe=()=>{var e;return !ge()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},ke=()=>F()&&process.platform==="darwin",Be=()=>F()&&process.platform==="win32",Ge=()=>F()&&process.platform==="linux",he={isWeb:pe,isLinux:Ge,isDarwin:ke,isWin32:Be,isNode:F,isElectron:Pe,isTouchDevice:Re,isServerSide:xe,isClientSide:ge,isAndroidMobileBrowser:He,isReactNativeWebview:Fe};var N=class e{static decycle(r,t=[]){if(typeof r=="function")return;if(!r||typeof r!="object")return r;if(t.includes(r))return null;let i=t.concat([r]);return Array.isArray(r)?r.map(a=>e.decycle(a,i)):Object.fromEntries(Object.entries(r).map(([a,n])=>[a,e.decycle(n,i)]))}static stringify(r,t=false){return typeof r=="string"?r:JSON.stringify(t!==false?e.decycle(r):r)}static isJSON(r){if(typeof r!="string")return false;let t=r.trim();if(t.length===0)return false;let i=t[0];if(i!=="{"&&i!=="[")return false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(r,t){if(typeof r=="string")try{r=JSON.parse(r,t);}catch(i){return r}if(r&&typeof r=="object")for(let i in r){let a=r[i];e.isJSON(a)&&(r[i]=e.parse(a,t));}return r}};var S=class S{static get storage(){var t;let r=Reflect.getMetadata(S.sessionStorageMetaData,S);if(Z(r)&&(this._storage=r),this._storage)return this._storage;if(he.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,a)=>window.localStorage.setItem(i,a),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:a=>i[a],set:(a,n)=>i[a]=n,remove:a=>delete i[a],removeAll:()=>i={}};}return this._storage}static set storage(r){Z(r)&&Reflect.defineMetadata(S.sessionStorageMetaData,r,S);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(r){c(r)&&(this._keyNamespace=r.trim().replace(/\s+/g,"-"));}static sanitizeKey(r){if(!r||!c(r))return "";r=r.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${r}`:r}};S.sessionStorageMetaData=Symbol("sessionStorage"),S._keyNamespace=void 0;var T=S;function k(e){return T.sanitizeKey(e)}var be=(e,r)=>(e=e&&N.stringify(e,r),e==null&&(e=""),e),Te=e=>{if(ye(e))return new Promise((r,t)=>{e.then(i=>{r(N.parse(i));}).catch(i=>{t(i);});});if(e!=null)return N.parse(e)},Ke=e=>{if(e=k(e),T.storage&&e&&typeof e=="string"){let r=T.storage.get(e);return Te(r)}},Ve=e=>{if(e=k(e),T.storage&&e&&typeof e=="string")return T.storage.remove(e)},We=()=>{if(T.storage)return T.storage.removeAll()},Z=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(r=>typeof e[r]=="function")}catch(r){return false}},z={get:Ke,set:(e,r,t=true)=>(e=k(e),T.storage.set(e,be(r,t))),remove:Ve,handleGetValue:Te,sanitizeKey:k,handleSetValue:be,isValidStorage:Z,Manager:T,removeAll:We};function Y(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function L(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(r){return false}}function J(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function m(e){if(e===null||typeof e!="object"||J(e)||w(e)||L(e)||Y(e))return false;let r=Object.getPrototypeOf(e);if(r===null)return true;let t=r.constructor;if(typeof t!="function")return false;if(t===Object)return true;let i=t.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof r.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")&&typeof r.isPrototypeOf=="function"}function $(e){if(Array.isArray(e)){let i=[];for(var r=0;r<e.length;r++)i[r]=$(e[r]);return i}else if(m(e)&&e){let i={};for(var t in e)e.hasOwnProperty(t)&&(i[t]=$(e[t]));return i}else return e}Object.getSize=function(e,r=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof r!="boolean"&&(r=false);let t=0;for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&(t++,r===true))return t;return t};function M(e,...r){let t=Array.isArray(e),i=m(e);(e==null||!t&&!i)&&(e={});for(let a=0;a<r.length;a++){let n=r[a];if(n==null)continue;let o=m(n),d=Array.isArray(n);if(!(!o&&!d)){if(t){d&&Ce(e,n);continue}else if(d)continue;for(let u in n){let l=n[u];if(l==null)continue;if(l===n){e[u]=e;continue}let y=e[u],h=Array.isArray(y),D=Array.isArray(l);if(h){D?Ce(e[u],l):e[u]=l;continue}else if(!m(y)){e[u]=l;continue}if(D||!m(l)){e[u]=l;continue}e[u]=M({},y,l);}}}return e}var Ce=(e,r)=>{let t=r.length,i=0;for(let a=0;a<e.length;a++){let n=e[a],o=r[a];if(a<t){let d=Array.isArray(n),u=Array.isArray(o),l=m(n),y=m(o);d&&u||l&&y?(e[i]=M(d?[]:{},n,o),i++):o!=null?(e[i]=o,i++):n!=null&&(e[i]=n,i++);}}for(let a=e.length;a<t;a++)r[a]!==void 0&&r[a]!==null&&e.push(r[a]);return e};function Ue(e,r){return B(e,"",{},r)}function B(e,r="",t={},i){if(t=m(t)?t:{},Y(e)||w(e)||L(e)||Array.isArray(e)&&(i!=null&&i.skipArrays))return r&&(t[r]=e),t;if(typeof e=="function"||typeof e=="object"&&!m(e)&&!Ze(e))return t;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([a,n])=>{let o=r?`${r}[${String(a)}]`:String(a);B(n,o,t,i);}),t;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((n,o)=>{let d=r?`${r}[${o}]`:String(o);B(n,d,t,i);}),t;if(m(e))for(let a in e){if(!Object.prototype.hasOwnProperty.call(e,a))continue;let n=e[a],o=r?r.endsWith("]")?`${r}.${a}`:`${r}.${a}`:a;B(n,o,t,i);}return t}function Ze(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function ze(e){return Object.entries(e)}Object.typedEntries=ze;Object.flatten=Ue;Object.clone=$;function P(e,r){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(L(e))return e.toString();if(Y(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let t=e.toString();if(t!=="[object Object]")return t}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function Me(e,r,t){let i=P,a=f(e);if(!m(r)||!r)return a;let n=/%\{([^}]+)\}/g,o=new Set,d,u=f(e);for(;(d=n.exec(u))!==null;){let l=d[1];l!==void 0&&o.add(l);}return o.forEach(l=>{let y;y=`%{${l}}`;let h=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,D=h===void 0?"":(()=>{try{return i(h,l,P)}catch(_){return P(h)}})(),Ye=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(Ye,"g"),D);}),a}function Q(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function Je(e){return f(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function G(e,r){var t=Object.prototype.toString.call(e);return t==="[object "+r+"]"}function E(e,r){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(b(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();r=Object.assign({},r);let{parenthesis:t}=r,i=t?"(":"",a=t?")":"";return typeof e=="string"?(r==null?void 0:r.escapeString)!==false?"'"+Je(e)+"'":e:G(e,"RegExp")||G(e,"Number")||G(e,"Boolean")?e.toString():G(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(n=>E(n,r)).join(",")+"]":typeof e=="object"?i+"{"+Object.keys(e).map(n=>{var o=e[n];return E(n,r)+":"+E(o,r)}).join(",")+"}"+a:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Se=Symbol("TRANSLATION_KEY");var p=class p extends i18nJs.I18n{constructor(t={},i={}){super({},i);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ne();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(W),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(i){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,i){return this.isPluralizeOptions(i)&&this.canPluralize(t)?(typeof i.count=="number"&&(i.countStr=i.count.formatNumber()),this.pluralize(i.count,t,i)):super.translate(t,i)}translateTarget(t,i){let a=p.getTargetTanslationKeys(t);for(let n in a)c(a[n])&&(a[n]=this.translate(a[n],i));return a}translateObject(t,i){if(!m(t))return {};let a={};for(let n in t){let o=t[n];c(o)&&(a[n]=R.translate(o,i));}return a}static getTargetTanslationKeys(t){return oe(t,Se)}on(t,i){return this._observableFactory.on.call(this,t,i)}finally(t,i){return this._observableFactory.finally.call(this,t,i)}off(t,i){var a;return (a=this._observableFactory)==null?void 0:a.off.call(this,t,i)}trigger(t,...i){var a;return (a=this._observableFactory)==null?void 0:a.trigger.call(this,t,...i)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,i){var a;return (a=this._observableFactory)==null?void 0:a.once.call(this,t,i)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(p.instance)){let i=p.getLocaleFromSession();p.instance=this.createInstance({},Object.assign({},i?{locale:i}:{},t));}return p.instance}isDefaultInstance(){return this===p.instance}static setLocaleToSession(t){z.set("i18n.locale",t);}static getLocaleFromSession(){let t=z.get("i18n.locale");return c(t)?t:""}canPluralize(t,i){i=f(i,this.getLocale());let a=this.getNestedTranslation(t,i);return !m(a)||!a?false:c(a==null?void 0:a.one)&&c(a==null?void 0:a.other)}getNestedTranslation(t,i){i=f(i,this.getLocale());let a=(c(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(c);if(!a.length)return;let n=this.getTranslations(i);for(let o of a)if(m(n))n=n[o];else return;return n}isPluralizeOptions(t){return !!(m(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return p.getInstance().registerTranslations(t)}static createInstance(t={},i={}){let d=Object.assign({},i),{interpolate:a}=d,n=ae(d,["interpolate"]),o=new p(t,n);return o.interpolate=(u,l,y)=>{let h=p.flattenObject(y),D=this.defaultInterpolator(u,l,h);return c(D)&&D!==l&&(l=D),typeof a=="function"?a(u,l,y):Me(l,y)},o}getTranslations(t){let i=m(this.translations)?this.translations:{};return c(t)?m(i[t])?i[t]:{}:i}static registerMomentLocale(t,i){return c(t)&&m(i)&&Array.isArray(i.months)&&(this.momentLocales[t]=M({},this.momentLocales[t],i)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return v__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(i){console.error(i," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let i=Object.getOwnPropertyNames(t);for(let a of i){let n=Reflect.getMetadata(Se,t,a);if(n)try{t[a]=this.translate(n);}catch(o){I.error(o," resolving translation for key : ",n);}}}catch(i){I.error(i," resolving translations for target : ",t);}}getMissingPlaceholderString(t,i,a){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,f(i),Object.assign({},a)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return c(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),i=Array.isArray(this._locales)?this._locales:["en"],a=[...t,...i.filter(n=>!t.includes(n))];return a.includes("en")||a.push("en"),a}isLocaleSupported(t){return c(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,i=false){return super.locale===t&&i!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((a,n)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(p.instance=this,this.isLocaleSupported(t)&&p.setLocaleToSession(t)),super.locale=t,p.setMomentLocale(t),this.trigger("locale-changed",t,o),a(t);}).catch(n).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,i){if(!c(t)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,i);return}this.namespaceResolvers[t]=i;}static RegisterNamespaceResolver(t,i){return p.getInstance().registerNamespaceResolver(t,i)}loadNamespace(t,i,a=true){return !c(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(i=f(i,this.getLocale()),c(i)?this.namespaceResolvers[t](i).then(n=>{let o={};return o[i]=Object.assign({},n),m(n)&&(a!==false&&this.store(o),this.trigger("namespace-loaded",t,i,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,i,a=true){return p.getInstance().loadNamespace(t,i,a)}loadNamespaces(t,i=true){let a=[],n={};t=f(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&a.push(new Promise(d=>{this.namespaceResolvers[o](t).then(u=>{M(n,u);}).finally(()=>{d(true);});}));return Promise.all(a).then(()=>{let o={};return o[t]=n,i!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,i=true){return p.getInstance().loadNamespaces(t,i)}static flattenObject(t){return m(t)?Object.flatten(t):t}static defaultInterpolator(t,i,a){return Q(i)?"":Y(i)?(i=String(i),!m(a)||!a||!m(a)||!a?i:i.replace(/%{(.*?)}/g,(n,o)=>Q(a[o])?"":Y(a[o])?String(a[o]):E(a[o],{escapeString:false}))):E(i,{escapeString:false})}};p.momentLocales={};var O=p,R=O.getInstance();try{Object.setPrototypeOf(R,O.prototype);}catch(e){}var Qe={};Object.keys(A).map(e=>{let r=A[e];Qe[r.dialCode]=r.code;});var q=class{static isValid(r){return m(r)&&c(r.code)}static getPhoneNumberExample(r){var t;return f((t=this.getCountry(r))==null?void 0:t.phoneNumberExample)}static getFlag(r){var t;return f((t=this.getCountry(r))==null?void 0:t.flag)}static getCurrency(r){var t;return (t=this.getCountry(r))==null?void 0:t.currency}static setCountry(r){this.isValid(r)&&(this.countries[r.code]=r);}static getCountry(r){if(c(r))return M({},R.t(`countries.${r}`),this.countries[r])}static getCountries(){let r=R.t("countries");return m(r)?M({},r,this.countries):this.countries}static setCountries(r){if(!m(r))return this.countries;for(let t in r){let i=r[t];this.isValid(i)&&(this.countries[t]=M({},this.countries[t],i));}return this.countries}};q.countries=A;exports.CountriesManager=q;
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ie={auth:se,currencies:de,countries:A,dates:le,resources:ce,validator:ue};function c(e){return !!(e&&typeof e=="string")}function f(...e){for(var r in e){let t=e[r];if(c(t))return t}return ""}function U(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}function b(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function w(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}var s=class s{static parseString(r,t){if(c(r)&&c(t))try{let i=v__default.default(r,t,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:t,isValid:!0}}catch(i){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let i of t){let a=me(r,i);if(a)return a}for(let i of s.DATE_FORMATS){let a=me(r,i);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(r){let t=r?s.parseDate(r):new Date;return t?t.toISOString():""}static isoStringToDate(r){return new Date(r)}static parseDate(r,t){if(s.isDateObj(r))return r;if(!c(t)){let i=s.parseString(r);return i!=null&&i.isValid?i.date:null}if(U(r))return null;try{let i=v__default.default(r,t,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",r," format is : ",t);}return null}static toSQLDateTimeFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0"),n=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0"),d=String(r.getSeconds()).padStart(2,"0");return `${t}-${i}-${a} ${n}:${o}:${d}`}static getI18n(r){return O.isI18nInstance(r)?r:O.getInstance()}static getDefaultDateTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(r){if(!s.isDateObj(r))return "";let t=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0");return `${t}-${i}-${a}`}static toSQLTimeFormat(r){if(!s.isDateObj(r))return "";let t=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0"),a=String(r.getSeconds()).padStart(2,"0");return `${t}:${i}:${a}`}static getDefaultTimeFormat(r){return f(this.getI18n(r).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(r,t){if(r==null||typeof r=="boolean")return false;if(s.isDateObj(r))return true;if(b(r)){let a=new Date(r);return a&&!isNaN(a.getTime())}if(c(r))return !!s.parseDate(r,t);if(r!=null&&r.toString&&(r==null?void 0:r.toString())==parseInt(r).toString())return false;let i=new Date(r);return s.isDateObj(i)}static addToDate(r,t,i){if(b(r)||(r=0),U(t)&&(t=new Date),s.isValidDate(t)&&c(t)&&(t=new Date(t)),s.isValidDate(t)||(t=c(t)?new Date(t):new Date),c(i)&&typeof t["set"+i]=="function"&&typeof t["get"+i]=="function"){let a="set"+i,n="get"+i;t=new Date(t[a](t[n]()+r));}return t}static addDays(r,t){return s.addToDate(r,t,"Date")}static addMilliseconds(r,t){return b(r)||(r=0),s.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+r)}static addSeconds(r,t){return b(r)||(r=0),s.addMilliseconds(r*1e3,t)}static addMinutes(r,t){return b(r)||(r=0),s.addMilliseconds(r*6e4,t)}static addHours(r,t){return b(r)||(r=0),s.addMilliseconds(r*36e5,t)}static addMonths(r,t,i){return s.addToDate(r,t,"Month")}static addWeeks(r,t){return r=(b(r)?r:0)*7,s.addToDate(r,t,"Date")}static addYears(r,t){b(r)||(r=0);let i=new Date(s.addToDate(0,t)),a=i.getFullYear();return a+r<0?r=0:r+=a,i.setFullYear(r),new Date(i)}static formatDate(r,t){try{let i=v__default.default(r);if(i.isValid())return i.format(f(t,s.getDefaultDateTimeFormat()))}catch(i){}return f(s.isValidDate(r)?r==null?void 0:r.toString():"")}static getUTCDateTimeDetails(r){let t=r?v__default.default.utc(r):v__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};s.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],s.SQL_DATE_FORMAT="YYYY-MM-DD",s.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",s.SQL_TIME_FORMAT="HH:mm:ss",s.getCurrentMonthDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:i,last:a}},s.getPreviousWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=new Date(t.getTime()-3600*24*7*1e3),a=new Date(i),n=i.getDay(),o=i.getDate()-n+(n===0?-6:1),d=new Date(i.setDate(o)),u=new Date(a.setDate(o+6));return {first:d,last:u}},s.getCurrentWeekDaysRange=r=>{let t=s.isValidDate(r)?new Date(r):new Date().resetHours2Minutes2Seconds(),i=t.getDay(),a=t.getDate()-i+(i==0?-6:1),n=new Date(t),o=new Date(t.setDate(a));return n.setDate(n.getDate()+6),{first:o,last:n}},s.isDateObj=w;var g=s,me=(e,r)=>{let t=v__default.default(e,r,true);try{if(t.isValid()&&t.format(r)===e||v__default.default.utc(t,!0).format(r)===e)return {date:t.toDate(),matchedFormat:r,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return g.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return g.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return g.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(e){return g.formatDate(this,e)};Date.prototype.addYears=function(e){return g.addYears(e,this)};Date.prototype.addMonths=function(e){return g.addMonths(e,this)};Date.prototype.addMinutes=function(e){return g.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return g.addSeconds(e,this)};Date.prototype.addDays=function(e){return g.addDays(e,this)};Date.prototype.addWeeks=function(e){return g.addWeeks(e,this)};Date.prototype.addHours=function(e){return g.addHours(e,this)};var C=class C{static get logger(){let r=Reflect.getMetadata(C.loggerMetaData,C);return fe(r)&&(this._logger=r),this._logger?this._logger:console}static set logger(r){fe(r)&&Reflect.defineMetadata(C.loggerMetaData,r,C);}static _log(r,...t){let i=C.logger;r=f(r),r&&typeof i[r]=="function"?i[r](C.getDateTimeString(),...t):console.log("Logger level not found : [",r,"]",...t);}static getDateTimeString(){let{day:r,year:t,hours:i,minutes:a,seconds:n,dayNameShort:o,monthName:d}=g.getUTCDateTimeDetails(),u=r<10?"0"+r:r,l=i<10?"0"+i:i,y=a<10?"0"+a:a,h=n<10?"0"+n:n;return "["+[o,u,d,t].join(" ")+" "+[l,y,h].join(":")+"]"}static log(...r){this._log("log",...r);}static info(...r){this._log("info",...r);}static debug(...r){this._log("debug",...r);}static warn(...r){this._log("warn",...r);}static error(...r){this._log("error",...r);}};C.loggerMetaData=Symbol("logger-meta-data");var I=C,fe=e=>{if(!e)return false;try{return ["warn","info","error"].every(r=>typeof e[r]=="function")}catch(r){return false}};function Le(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ye(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:Le(e)}function pe(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var F=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(r){}return false},Pe=()=>{var e,r;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((r=process.versions)!=null&&r.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Re=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(r){}}return false},xe=()=>typeof window=="undefined"&&typeof process!="undefined",ge=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),He=()=>{if(!pe()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},Fe=()=>{var e;return !ge()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},ke=()=>F()&&process.platform==="darwin",Be=()=>F()&&process.platform==="win32",Ge=()=>F()&&process.platform==="linux",he={isWeb:pe,isLinux:Ge,isDarwin:ke,isWin32:Be,isNode:F,isElectron:Pe,isTouchDevice:Re,isServerSide:xe,isClientSide:ge,isAndroidMobileBrowser:He,isReactNativeWebview:Fe};var N=class e{static decycle(r,t=[]){if(typeof r=="function")return;if(!r||typeof r!="object")return r;if(t.includes(r))return null;let i=t.concat([r]);return Array.isArray(r)?r.map(a=>e.decycle(a,i)):Object.fromEntries(Object.entries(r).map(([a,n])=>[a,e.decycle(n,i)]))}static stringify(r,t=false){return typeof r=="string"?r:JSON.stringify(t!==false?e.decycle(r):r)}static isJSON(r){if(typeof r!="string")return false;let t=r.trim();if(t.length===0)return false;let i=t[0];if(i!=="{"&&i!=="[")return false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(r,t){if(typeof r=="string")try{r=JSON.parse(r,t);}catch(i){return r}if(r&&typeof r=="object")for(let i in r){let a=r[i];e.isJSON(a)&&(r[i]=e.parse(a,t));}return r}};var S=class S{static get storage(){var t;let r=Reflect.getMetadata(S.sessionStorageMetaData,S);if(Z(r)&&(this._storage=r),this._storage)return this._storage;if(he.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,a)=>window.localStorage.setItem(i,a),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:a=>i[a],set:(a,n)=>i[a]=n,remove:a=>{delete i[a];},removeAll:()=>i={}};}return this._storage}static set storage(r){Z(r)&&Reflect.defineMetadata(S.sessionStorageMetaData,r,S);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(r){c(r)&&(this._keyNamespace=r.trim().replace(/\s+/g,"-"));}static sanitizeKey(r){if(!r||!c(r))return "";r=r.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${r}`:r}};S.sessionStorageMetaData=Symbol("sessionStorage"),S._keyNamespace=void 0;var T=S;function k(e){return T.sanitizeKey(e)}var be=(e,r)=>(e=e&&N.stringify(e,r),e==null&&(e=""),e),Te=e=>{if(ye(e))return new Promise((r,t)=>{e.then(i=>{r(N.parse(i));}).catch(i=>{t(i);});});if(e!=null)return N.parse(e)},Ke=e=>{if(e=k(e),T.storage&&e&&typeof e=="string"){let r=T.storage.get(e);return Te(r)}},Ve=e=>{if(e=k(e),T.storage&&e&&typeof e=="string")return T.storage.remove(e)},We=()=>{if(T.storage)return T.storage.removeAll()},Z=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(r=>typeof e[r]=="function")}catch(r){return false}},z={get:Ke,set:(e,r,t=true)=>(e=k(e),T.storage.set(e,be(r,t))),remove:Ve,handleGetValue:Te,sanitizeKey:k,handleSetValue:be,isValidStorage:Z,Manager:T,removeAll:We};function Y(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function L(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(r){return false}}function J(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function m(e){if(e===null||typeof e!="object"||J(e)||w(e)||L(e)||Y(e))return false;let r=Object.getPrototypeOf(e);if(r===null)return true;let t=r.constructor;if(typeof t!="function")return false;if(t===Object)return true;let i=t.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof r.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")&&typeof r.isPrototypeOf=="function"}function $(e){if(Array.isArray(e)){let i=[];for(var r=0;r<e.length;r++)i[r]=$(e[r]);return i}else if(m(e)&&e){let i={};for(var t in e)e.hasOwnProperty(t)&&(i[t]=$(e[t]));return i}else return e}Object.getSize=function(e,r=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof r!="boolean"&&(r=false);let t=0;for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&(t++,r===true))return t;return t};function M(e,...r){let t=Array.isArray(e),i=m(e);(e==null||!t&&!i)&&(e={});for(let a=0;a<r.length;a++){let n=r[a];if(n==null)continue;let o=m(n),d=Array.isArray(n);if(!(!o&&!d)){if(t){d&&Ce(e,n);continue}else if(d)continue;for(let u in n){let l=n[u];if(l==null)continue;if(l===n){e[u]=e;continue}let y=e[u],h=Array.isArray(y),D=Array.isArray(l);if(h){D?Ce(e[u],l):e[u]=l;continue}else if(!m(y)){e[u]=l;continue}if(D||!m(l)){e[u]=l;continue}e[u]=M({},y,l);}}}return e}var Ce=(e,r)=>{let t=r.length,i=0;for(let a=0;a<e.length;a++){let n=e[a],o=r[a];if(a<t){let d=Array.isArray(n),u=Array.isArray(o),l=m(n),y=m(o);d&&u||l&&y?(e[i]=M(d?[]:{},n,o),i++):o!=null?(e[i]=o,i++):n!=null&&(e[i]=n,i++);}}for(let a=e.length;a<t;a++)r[a]!==void 0&&r[a]!==null&&e.push(r[a]);return e};function Ue(e,r){return B(e,"",{},r)}function B(e,r="",t={},i){if(t=m(t)?t:{},Y(e)||w(e)||L(e)||Array.isArray(e)&&(i!=null&&i.skipArrays))return r&&(t[r]=e),t;if(typeof e=="function"||typeof e=="object"&&!m(e)&&!Ze(e))return t;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([a,n])=>{let o=r?`${r}[${String(a)}]`:String(a);B(n,o,t,i);}),t;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((n,o)=>{let d=r?`${r}[${o}]`:String(o);B(n,d,t,i);}),t;if(m(e))for(let a in e){if(!Object.prototype.hasOwnProperty.call(e,a))continue;let n=e[a],o=r?r.endsWith("]")?`${r}.${a}`:`${r}.${a}`:a;B(n,o,t,i);}return t}function Ze(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function ze(e){return Object.entries(e)}Object.typedEntries=ze;Object.flatten=Ue;Object.clone=$;function P(e,r){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(L(e))return e.toString();if(Y(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let t=e.toString();if(t!=="[object Object]")return t}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function Me(e,r,t){let i=P,a=f(e);if(!m(r)||!r)return a;let n=/%\{([^}]+)\}/g,o=new Set,d,u=f(e);for(;(d=n.exec(u))!==null;){let l=d[1];l!==void 0&&o.add(l);}return o.forEach(l=>{let y;y=`%{${l}}`;let h=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,D=h===void 0?"":(()=>{try{return i(h,l,P)}catch(_){return P(h)}})(),Ye=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(Ye,"g"),D);}),a}function Q(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function Je(e){return f(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function G(e,r){var t=Object.prototype.toString.call(e);return t==="[object "+r+"]"}function E(e,r){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(b(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();r=Object.assign({},r);let{parenthesis:t}=r,i=t?"(":"",a=t?")":"";return typeof e=="string"?(r==null?void 0:r.escapeString)!==false?"'"+Je(e)+"'":e:G(e,"RegExp")||G(e,"Number")||G(e,"Boolean")?e.toString():G(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(n=>E(n,r)).join(",")+"]":typeof e=="object"?i+"{"+Object.keys(e).map(n=>{var o=e[n];return E(n,r)+":"+E(o,r)}).join(",")+"}"+a:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Se=Symbol("TRANSLATION_KEY");var p=class p extends i18nJs.I18n{constructor(t={},i={}){super({},i);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ne();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(W),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(t),this.loadNamespaces();}static[Symbol.hasInstance](t){return this.isI18nInstance(t)}static isI18nInstance(t){if(!t||typeof t!="object")return false;try{if(t instanceof i18nJs.I18n)return !0}catch(i){}return typeof t.getLocale=="function"&&typeof t.translate=="function"&&typeof t.translateTarget=="function"}translate(t,i){return this.isPluralizeOptions(i)&&this.canPluralize(t)?(typeof i.count=="number"&&(i.countStr=i.count.formatNumber()),this.pluralize(i.count,t,i)):super.translate(t,i)}translateTarget(t,i){let a=p.getTargetTanslationKeys(t);for(let n in a)c(a[n])&&(a[n]=this.translate(a[n],i));return a}translateObject(t,i){if(!m(t))return {};let a={};for(let n in t){let o=t[n];c(o)&&(a[n]=R.translate(o,i));}return a}static getTargetTanslationKeys(t){return oe(t,Se)}on(t,i){return this._observableFactory.on.call(this,t,i)}finally(t,i){return this._observableFactory.finally.call(this,t,i)}off(t,i){var a;return (a=this._observableFactory)==null?void 0:a.off.call(this,t,i)}trigger(t,...i){var a;return (a=this._observableFactory)==null?void 0:a.trigger.call(this,t,...i)}offAll(){var t;return (t=this._observableFactory)==null?void 0:t.offAll.call(this)}once(t,i){var a;return (a=this._observableFactory)==null?void 0:a.once.call(this,t,i)}getEventCallBacks(){var t;return (t=this._observableFactory)==null?void 0:t.getEventCallBacks.call(this)}static getInstance(t){if(!this.isI18nInstance(p.instance)){let i=p.getLocaleFromSession();p.instance=this.createInstance({},Object.assign({},i?{locale:i}:{},t));}return p.instance}isDefaultInstance(){return this===p.instance}static setLocaleToSession(t){z.set("i18n.locale",t);}static getLocaleFromSession(){let t=z.get("i18n.locale");return c(t)?t:""}canPluralize(t,i){i=f(i,this.getLocale());let a=this.getNestedTranslation(t,i);return !m(a)||!a?false:c(a==null?void 0:a.one)&&c(a==null?void 0:a.other)}getNestedTranslation(t,i){i=f(i,this.getLocale());let a=(c(t)?t.trim().split("."):Array.isArray(t)?t:[]).filter(c);if(!a.length)return;let n=this.getTranslations(i);for(let o of a)if(m(n))n=n[o];else return;return n}isPluralizeOptions(t){return !!(m(t)&&t&&typeof t.count=="number")}static RegisterTranslations(t){return p.getInstance().registerTranslations(t)}static createInstance(t={},i={}){let d=Object.assign({},i),{interpolate:a}=d,n=ae(d,["interpolate"]),o=new p(t,n);return o.interpolate=(u,l,y)=>{let h=p.flattenObject(y),D=this.defaultInterpolator(u,l,h);return c(D)&&D!==l&&(l=D),typeof a=="function"?a(u,l,y):Me(l,y)},o}getTranslations(t){let i=m(this.translations)?this.translations:{};return c(t)?m(i[t])?i[t]:{}:i}static registerMomentLocale(t,i){return c(t)&&m(i)&&Array.isArray(i.months)&&(this.momentLocales[t]=M({},this.momentLocales[t],i)),this.momentLocales}static getMomentLocale(t){return this.momentLocales[t]}static setMomentLocale(t){try{return v__default.default.updateLocale(t,this.getMomentLocale(t)),!0}catch(i){console.error(i," setting moment locale : ",t);}return false}registerTranslations(t){return this.store(t),this.getTranslations()}store(t){super.store(t),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(t){try{let i=Object.getOwnPropertyNames(t);for(let a of i){let n=Reflect.getMetadata(Se,t,a);if(n)try{t[a]=this.translate(n);}catch(o){I.error(o," resolving translation for key : ",n);}}}catch(i){I.error(i," resolving translations for target : ",t);}}getMissingPlaceholderString(t,i,a){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,t,f(i),Object.assign({},a)):t}getLocale(){return super.locale}setLocales(t){return this._locales=Array.isArray(t)?t:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(t){return c(t)&&this.getLocales().includes(t)}getLocales(){let t=Object.keys(this.getTranslations()),i=Array.isArray(this._locales)?this._locales:["en"],a=[...t,...i.filter(n=>!t.includes(n))];return a.includes("en")||a.push("en"),a}isLocaleSupported(t){return c(t)?this.getLocales().includes(t):false}isLoading(){return this._isLoading}setLocale(t,i=false){return super.locale===t&&i!==true&&this._namespacesLoaded[t]?Promise.resolve(this.getLocale()):new Promise((a,n)=>(this._isLoading=true,this.trigger("namespaces-before-load",t),this.loadNamespaces(t).then(o=>{this.isDefaultInstance()&&(p.instance=this,this.isLocaleSupported(t)&&p.setLocaleToSession(t)),super.locale=t,p.setMomentLocale(t),this.trigger("locale-changed",t,o),a(t);}).catch(n).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(t,i){if(!c(t)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",t,i);return}this.namespaceResolvers[t]=i;}static RegisterNamespaceResolver(t,i){return p.getInstance().registerNamespaceResolver(t,i)}loadNamespace(t,i,a=true){return !c(t)||!this.namespaceResolvers[t]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${t}".`)):(i=f(i,this.getLocale()),c(i)?this.namespaceResolvers[t](i).then(n=>{let o={};return o[i]=Object.assign({},n),m(n)&&(a!==false&&this.store(o),this.trigger("namespace-loaded",t,i,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${t}".`)))}static LoadNamespace(t,i,a=true){return p.getInstance().loadNamespace(t,i,a)}loadNamespaces(t,i=true){let a=[],n={};t=f(t,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&a.push(new Promise(d=>{this.namespaceResolvers[o](t).then(u=>{M(n,u);}).finally(()=>{d(true);});}));return Promise.all(a).then(()=>{let o={};return o[t]=n,i!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",t,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(t,i=true){return p.getInstance().loadNamespaces(t,i)}static flattenObject(t){return m(t)?Object.flatten(t):t}static defaultInterpolator(t,i,a){return Q(i)?"":Y(i)?(i=String(i),!m(a)||!a||!m(a)||!a?i:i.replace(/%{(.*?)}/g,(n,o)=>Q(a[o])?"":Y(a[o])?String(a[o]):E(a[o],{escapeString:false}))):E(i,{escapeString:false})}};p.momentLocales={};var O=p,R=O.getInstance();try{Object.setPrototypeOf(R,O.prototype);}catch(e){}var Qe={};Object.keys(A).map(e=>{let r=A[e];Qe[r.dialCode]=r.code;});var q=class{static isValid(r){return m(r)&&c(r.code)}static getPhoneNumberExample(r){var t;return f((t=this.getCountry(r))==null?void 0:t.phoneNumberExample)}static getFlag(r){var t;return f((t=this.getCountry(r))==null?void 0:t.flag)}static getCurrency(r){var t;return (t=this.getCountry(r))==null?void 0:t.currency}static setCountry(r){this.isValid(r)&&(this.countries[r.code]=r);}static getCountry(r){if(c(r))return M({},R.t(`countries.${r}`),this.countries[r])}static getCountries(){let r=R.t("countries");return m(r)?M({},r,this.countries):this.countries}static setCountries(r){if(!m(r))return this.countries;for(let t in r){let i=r[t];this.isValid(i)&&(this.countries[t]=M({},this.countries[t],i));}return this.countries}};q.countries=A;exports.CountriesManager=q;
@@ -28,7 +28,7 @@ export declare const CurrencyUtils: {
28
28
  parse: (value: any, decimalSeparator?: string) => number;
29
29
  session: {
30
30
  getFormat: (force?: boolean) => string;
31
- setFormat: (format: string) => any;
31
+ setFormat: (format: string) => void | Promise<void>;
32
32
  setCurrency: (currency: Currency | import("./types").CurrencyCode) => Currency;
33
33
  getCurrency: () => Currency;
34
34
  defaultCurrencyFormat: string;
@@ -2,4 +2,4 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ve={auth:ge,currencies:pe,countries:fe,dates:be,resources:De,validator:he};function _(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}function h(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function w(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}var m=class m{static parseString(t,a){if(c(t)&&c(a))try{let i=R__default.default(t,a,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:a,isValid:!0}}catch(i){}try{if(Array.isArray(a)&&(a!=null&&a.length))for(let i of a){let n=Ce(t,i);if(n)return n}for(let i of m.DATE_FORMATS){let n=Ce(t,i);if(n)return n}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(t){let a=t?m.parseDate(t):new Date;return a?a.toISOString():""}static isoStringToDate(t){return new Date(t)}static parseDate(t,a){if(m.isDateObj(t))return t;if(!c(a)){let i=m.parseString(t);return i!=null&&i.isValid?i.date:null}if(_(t))return null;try{let i=R__default.default(t,a,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",t," format is : ",a);}return null}static toSQLDateTimeFormat(t){if(!m.isDateObj(t))return "";let a=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return `${a}-${i}-${n} ${r}:${o}:${s}`}static getI18n(t){return O.isI18nInstance(t)?t:O.getInstance()}static getDefaultDateTimeFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(t){if(!m.isDateObj(t))return "";let a=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return `${a}-${i}-${n}`}static toSQLTimeFormat(t){if(!m.isDateObj(t))return "";let a=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return `${a}:${i}:${n}`}static getDefaultTimeFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(t,a){if(t==null||typeof t=="boolean")return false;if(m.isDateObj(t))return true;if(h(t)){let n=new Date(t);return n&&!isNaN(n.getTime())}if(c(t))return !!m.parseDate(t,a);if(t!=null&&t.toString&&(t==null?void 0:t.toString())==parseInt(t).toString())return false;let i=new Date(t);return m.isDateObj(i)}static addToDate(t,a,i){if(h(t)||(t=0),_(a)&&(a=new Date),m.isValidDate(a)&&c(a)&&(a=new Date(a)),m.isValidDate(a)||(a=c(a)?new Date(a):new Date),c(i)&&typeof a["set"+i]=="function"&&typeof a["get"+i]=="function"){let n="set"+i,r="get"+i;a=new Date(a[n](a[r]()+t));}return a}static addDays(t,a){return m.addToDate(t,a,"Date")}static addMilliseconds(t,a){return h(t)||(t=0),m.isDateObj(a)||(a=new Date),a=a||new Date,new Date(a.getTime()+t)}static addSeconds(t,a){return h(t)||(t=0),m.addMilliseconds(t*1e3,a)}static addMinutes(t,a){return h(t)||(t=0),m.addMilliseconds(t*6e4,a)}static addHours(t,a){return h(t)||(t=0),m.addMilliseconds(t*36e5,a)}static addMonths(t,a,i){return m.addToDate(t,a,"Month")}static addWeeks(t,a){return t=(h(t)?t:0)*7,m.addToDate(t,a,"Date")}static addYears(t,a){h(t)||(t=0);let i=new Date(m.addToDate(0,a)),n=i.getFullYear();return n+t<0?t=0:t+=n,i.setFullYear(t),new Date(i)}static formatDate(t,a){try{let i=R__default.default(t);if(i.isValid())return i.format(u(a,m.getDefaultDateTimeFormat()))}catch(i){}return u(m.isValidDate(t)?t==null?void 0:t.toString():"")}static getUTCDateTimeDetails(t){let a=t?R__default.default.utc(t):R__default.default.utc();return {year:a.year(),day:a.day(),month:a.month(),monthString:a.format("MM"),hours:a.hours(),date:a.date(),minutes:a.minutes(),seconds:a.seconds(),monthName:a.format("MMMM"),dayName:a.format("dddd"),dayNameShort:a.format("ddd")}}};m.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],m.SQL_DATE_FORMAT="YYYY-MM-DD",m.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",m.SQL_TIME_FORMAT="HH:mm:ss",m.getCurrentMonthDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=new Date(a.getFullYear(),a.getMonth(),1),n=new Date(a.getFullYear(),a.getMonth()+1,0);return {first:i,last:n}},m.getPreviousWeekDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=new Date(a.getTime()-3600*24*7*1e3),n=new Date(i),r=i.getDay(),o=i.getDate()-r+(r===0?-6:1),s=new Date(i.setDate(o)),l=new Date(n.setDate(o+6));return {first:s,last:l}},m.getCurrentWeekDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=a.getDay(),n=a.getDate()-i+(i==0?-6:1),r=new Date(a),o=new Date(a.setDate(n));return r.setDate(r.getDate()+6),{first:o,last:r}},m.isDateObj=w;var b=m,Ce=(e,t)=>{let a=R__default.default(e,t,true);try{if(a.isValid()&&a.format(t)===e||R__default.default.utc(a,!0).format(t)===e)return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return b.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return b.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return b.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(e){return b.formatDate(this,e)};Date.prototype.addYears=function(e){return b.addYears(e,this)};Date.prototype.addMonths=function(e){return b.addMonths(e,this)};Date.prototype.addMinutes=function(e){return b.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return b.addSeconds(e,this)};Date.prototype.addDays=function(e){return b.addDays(e,this)};Date.prototype.addWeeks=function(e){return b.addWeeks(e,this)};Date.prototype.addHours=function(e){return b.addHours(e,this)};var S=class S{static get logger(){let t=Reflect.getMetadata(S.loggerMetaData,S);return Te(t)&&(this._logger=t),this._logger?this._logger:console}static set logger(t){Te(t)&&Reflect.defineMetadata(S.loggerMetaData,t,S);}static _log(t,...a){let i=S.logger;t=u(t),t&&typeof i[t]=="function"?i[t](S.getDateTimeString(),...a):console.log("Logger level not found : [",t,"]",...a);}static getDateTimeString(){let{day:t,year:a,hours:i,minutes:n,seconds:r,dayNameShort:o,monthName:s}=b.getUTCDateTimeDetails(),l=t<10?"0"+t:t,d=i<10?"0"+i:i,y=n<10?"0"+n:n,p=r<10?"0"+r:r;return "["+[o,l,s,a].join(" ")+" "+[d,y,p].join(":")+"]"}static log(...t){this._log("log",...t);}static info(...t){this._log("info",...t);}static debug(...t){this._log("debug",...t);}static warn(...t){this._log("warn",...t);}static error(...t){this._log("error",...t);}};S.loggerMetaData=Symbol("logger-meta-data");var I=S,Te=e=>{if(!e)return false;try{return ["warn","info","error"].every(t=>typeof e[t]=="function")}catch(t){return false}};function $e(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function Me(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:$e(e)}function Se(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var G=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(t){}return false},Ze=()=>{var e,t;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((t=process.versions)!=null&&t.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},We=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(t){}}return false},ze=()=>typeof window=="undefined"&&typeof process!="undefined",ve=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Je=()=>{if(!Se()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},Qe=()=>{var e;return !ve()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},qe=()=>G()&&process.platform==="darwin",_e=()=>G()&&process.platform==="win32",Xe=()=>G()&&process.platform==="linux",Ne={isWeb:Se,isLinux:Xe,isDarwin:qe,isWin32:_e,isNode:G,isElectron:Ze,isTouchDevice:We,isServerSide:ze,isClientSide:ve,isAndroidMobileBrowser:Je,isReactNativeWebview:Qe};var L=class e{static decycle(t,a=[]){if(typeof t=="function")return;if(!t||typeof t!="object")return t;if(a.includes(t))return null;let i=a.concat([t]);return Array.isArray(t)?t.map(n=>e.decycle(n,i)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e.decycle(r,i)]))}static stringify(t,a=false){return typeof t=="string"?t:JSON.stringify(a!==false?e.decycle(t):t)}static isJSON(t){if(typeof t!="string")return false;let a=t.trim();if(a.length===0)return false;let i=a[0];if(i!=="{"&&i!=="[")return false;try{let n=JSON.parse(a);return n!==null&&typeof n=="object"}catch(n){return false}}static parse(t,a){if(typeof t=="string")try{t=JSON.parse(t,a);}catch(i){return t}if(t&&typeof t=="object")for(let i in t){let n=t[i];e.isJSON(n)&&(t[i]=e.parse(n,a));}return t}};var P=class P{static get storage(){var a;let t=Reflect.getMetadata(P.sessionStorageMetaData,P);if(X(t)&&(this._storage=t),this._storage)return this._storage;if(Ne.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((a=window.localStorage)!=null&&a.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,n)=>window.localStorage.setItem(i,n),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:n=>i[n],set:(n,r)=>i[n]=r,remove:n=>delete i[n],removeAll:()=>i={}};}return this._storage}static set storage(t){X(t)&&Reflect.defineMetadata(P.sessionStorageMetaData,t,P);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(t){c(t)&&(this._keyNamespace=t.trim().replace(/\s+/g,"-"));}static sanitizeKey(t){if(!t||!c(t))return "";t=t.trim().replace(/\s+/g,"-");let a=this.keyNamespace;return a?`${a}-${t}`:t}};P.sessionStorageMetaData=Symbol("sessionStorage"),P._keyNamespace=void 0;var C=P;function U(e){return C.sanitizeKey(e)}var Pe=(e,t)=>(e=e&&L.stringify(e,t),e==null&&(e=""),e),Ye=e=>{if(Me(e))return new Promise((t,a)=>{e.then(i=>{t(L.parse(i));}).catch(i=>{a(i);});});if(e!=null)return L.parse(e)},je=e=>{if(e=U(e),C.storage&&e&&typeof e=="string"){let t=C.storage.get(e);return Ye(t)}},ea=e=>{if(e=U(e),C.storage&&e&&typeof e=="string")return C.storage.remove(e)},aa=()=>{if(C.storage)return C.storage.removeAll()},X=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(t=>typeof e[t]=="function")}catch(t){return false}},v={get:je,set:(e,t,a=true)=>(e=U(e),C.storage.set(e,Pe(t,a))),remove:ea,handleGetValue:Ye,sanitizeKey:U,handleSetValue:Pe,isValidStorage:X,Manager:C,removeAll:aa};function Y(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function F(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(t){return false}}function j(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function f(e){if(e===null||typeof e!="object"||j(e)||w(e)||F(e)||Y(e))return false;let t=Object.getPrototypeOf(e);if(t===null)return true;let a=t.constructor;if(typeof a!="function")return false;if(a===Object)return true;let i=a.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof t.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")&&typeof t.isPrototypeOf=="function"}function ee(e){if(Array.isArray(e)){let i=[];for(var t=0;t<e.length;t++)i[t]=ee(e[t]);return i}else if(f(e)&&e){let i={};for(var a in e)e.hasOwnProperty(a)&&(i[a]=ee(e[a]));return i}else return e}Object.getSize=function(e,t=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof t!="boolean"&&(t=false);let a=0;for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&(a++,t===true))return a;return a};function B(e,...t){let a=Array.isArray(e),i=f(e);(e==null||!a&&!i)&&(e={});for(let n=0;n<t.length;n++){let r=t[n];if(r==null)continue;let o=f(r),s=Array.isArray(r);if(!(!o&&!s)){if(a){s&&Ae(e,r);continue}else if(s)continue;for(let l in r){let d=r[l];if(d==null)continue;if(d===r){e[l]=e;continue}let y=e[l],p=Array.isArray(y),D=Array.isArray(d);if(p){D?Ae(e[l],d):e[l]=d;continue}else if(!f(y)){e[l]=d;continue}if(D||!f(d)){e[l]=d;continue}e[l]=B({},y,d);}}}return e}var Ae=(e,t)=>{let a=t.length,i=0;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(n<a){let s=Array.isArray(r),l=Array.isArray(o),d=f(r),y=f(o);s&&l||d&&y?(e[i]=B(s?[]:{},r,o),i++):o!=null?(e[i]=o,i++):r!=null&&(e[i]=r,i++);}}for(let n=e.length;n<a;n++)t[n]!==void 0&&t[n]!==null&&e.push(t[n]);return e};function ta(e,t){return V(e,"",{},t)}function V(e,t="",a={},i){if(a=f(a)?a:{},Y(e)||w(e)||F(e)||Array.isArray(e)&&(i!=null&&i.skipArrays))return t&&(a[t]=e),a;if(typeof e=="function"||typeof e=="object"&&!f(e)&&!ia(e))return a;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([n,r])=>{let o=t?`${t}[${String(n)}]`:String(n);V(r,o,a,i);}),a;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((r,o)=>{let s=t?`${t}[${o}]`:String(o);V(r,s,a,i);}),a;if(f(e))for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n],o=t?t.endsWith("]")?`${t}.${n}`:`${t}.${n}`:n;V(r,o,a,i);}return a}function ia(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function na(e){return Object.entries(e)}Object.typedEntries=na;Object.flatten=ta;Object.clone=ee;function K(e,t){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(F(e))return e.toString();if(Y(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let a=e.toString();if(a!=="[object Object]")return a}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function Re(e,t,a){let i=K,n=u(e);if(!f(t)||!t)return n;let r=/%\{([^}]+)\}/g,o=new Set,s,l=u(e);for(;(s=r.exec(l))!==null;){let d=s[1];d!==void 0&&o.add(d);}return o.forEach(d=>{let y;y=`%{${d}}`;let p=Object.prototype.hasOwnProperty.call(t,d)?t[d]:void 0,D=p===void 0?"":(()=>{try{return i(p,d,K)}catch(oe){return K(p)}})(),z=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(z,"g"),D);}),n}function ae(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function ra(e){return u(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function $(e,t){var a=Object.prototype.toString.call(e);return a==="[object "+t+"]"}function E(e,t){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(h(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();t=Object.assign({},t);let{parenthesis:a}=t,i=a?"(":"",n=a?")":"";return typeof e=="string"?(t==null?void 0:t.escapeString)!==false?"'"+ra(e)+"'":e:$(e,"RegExp")||$(e,"Number")||$(e,"Boolean")?e.toString():$(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(r=>E(r,t)).join(",")+"]":typeof e=="object"?i+"{"+Object.keys(e).map(r=>{var o=e[r];return E(r,t)+":"+E(o,t)}).join(",")+"}"+n:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Le=Symbol("TRANSLATION_KEY");var g=class g extends i18nJs.I18n{constructor(a={},i={}){super({},i);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ue();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(q),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(a),this.loadNamespaces();}static[Symbol.hasInstance](a){return this.isI18nInstance(a)}static isI18nInstance(a){if(!a||typeof a!="object")return false;try{if(a instanceof i18nJs.I18n)return !0}catch(i){}return typeof a.getLocale=="function"&&typeof a.translate=="function"&&typeof a.translateTarget=="function"}translate(a,i){return this.isPluralizeOptions(i)&&this.canPluralize(a)?(typeof i.count=="number"&&(i.countStr=i.count.formatNumber()),this.pluralize(i.count,a,i)):super.translate(a,i)}translateTarget(a,i){let n=g.getTargetTanslationKeys(a);for(let r in n)c(n[r])&&(n[r]=this.translate(n[r],i));return n}translateObject(a,i){if(!f(a))return {};let n={};for(let r in a){let o=a[r];c(o)&&(n[r]=Z.translate(o,i));}return n}static getTargetTanslationKeys(a){return ye(a,Le)}on(a,i){return this._observableFactory.on.call(this,a,i)}finally(a,i){return this._observableFactory.finally.call(this,a,i)}off(a,i){var n;return (n=this._observableFactory)==null?void 0:n.off.call(this,a,i)}trigger(a,...i){var n;return (n=this._observableFactory)==null?void 0:n.trigger.call(this,a,...i)}offAll(){var a;return (a=this._observableFactory)==null?void 0:a.offAll.call(this)}once(a,i){var n;return (n=this._observableFactory)==null?void 0:n.once.call(this,a,i)}getEventCallBacks(){var a;return (a=this._observableFactory)==null?void 0:a.getEventCallBacks.call(this)}static getInstance(a){if(!this.isI18nInstance(g.instance)){let i=g.getLocaleFromSession();g.instance=this.createInstance({},Object.assign({},i?{locale:i}:{},a));}return g.instance}isDefaultInstance(){return this===g.instance}static setLocaleToSession(a){v.set("i18n.locale",a);}static getLocaleFromSession(){let a=v.get("i18n.locale");return c(a)?a:""}canPluralize(a,i){i=u(i,this.getLocale());let n=this.getNestedTranslation(a,i);return !f(n)||!n?false:c(n==null?void 0:n.one)&&c(n==null?void 0:n.other)}getNestedTranslation(a,i){i=u(i,this.getLocale());let n=(c(a)?a.trim().split("."):Array.isArray(a)?a:[]).filter(c);if(!n.length)return;let r=this.getTranslations(i);for(let o of n)if(f(r))r=r[o];else return;return r}isPluralizeOptions(a){return !!(f(a)&&a&&typeof a.count=="number")}static RegisterTranslations(a){return g.getInstance().registerTranslations(a)}static createInstance(a={},i={}){let s=Object.assign({},i),{interpolate:n}=s,r=me(s,["interpolate"]),o=new g(a,r);return o.interpolate=(l,d,y)=>{let p=g.flattenObject(y),D=this.defaultInterpolator(l,d,p);return c(D)&&D!==d&&(d=D),typeof n=="function"?n(l,d,y):Re(d,y)},o}getTranslations(a){let i=f(this.translations)?this.translations:{};return c(a)?f(i[a])?i[a]:{}:i}static registerMomentLocale(a,i){return c(a)&&f(i)&&Array.isArray(i.months)&&(this.momentLocales[a]=B({},this.momentLocales[a],i)),this.momentLocales}static getMomentLocale(a){return this.momentLocales[a]}static setMomentLocale(a){try{return R__default.default.updateLocale(a,this.getMomentLocale(a)),!0}catch(i){console.error(i," setting moment locale : ",a);}return false}registerTranslations(a){return this.store(a),this.getTranslations()}store(a){super.store(a),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(a){try{let i=Object.getOwnPropertyNames(a);for(let n of i){let r=Reflect.getMetadata(Le,a,n);if(r)try{a[n]=this.translate(r);}catch(o){I.error(o," resolving translation for key : ",r);}}}catch(i){I.error(i," resolving translations for target : ",a);}}getMissingPlaceholderString(a,i,n){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,u(i),Object.assign({},n)):a}getLocale(){return super.locale}setLocales(a){return this._locales=Array.isArray(a)?a:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(a){return c(a)&&this.getLocales().includes(a)}getLocales(){let a=Object.keys(this.getTranslations()),i=Array.isArray(this._locales)?this._locales:["en"],n=[...a,...i.filter(r=>!a.includes(r))];return n.includes("en")||n.push("en"),n}isLocaleSupported(a){return c(a)?this.getLocales().includes(a):false}isLoading(){return this._isLoading}setLocale(a,i=false){return super.locale===a&&i!==true&&this._namespacesLoaded[a]?Promise.resolve(this.getLocale()):new Promise((n,r)=>(this._isLoading=true,this.trigger("namespaces-before-load",a),this.loadNamespaces(a).then(o=>{this.isDefaultInstance()&&(g.instance=this,this.isLocaleSupported(a)&&g.setLocaleToSession(a)),super.locale=a,g.setMomentLocale(a),this.trigger("locale-changed",a,o),n(a);}).catch(r).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(a,i){if(!c(a)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",a,i);return}this.namespaceResolvers[a]=i;}static RegisterNamespaceResolver(a,i){return g.getInstance().registerNamespaceResolver(a,i)}loadNamespace(a,i,n=true){return !c(a)||!this.namespaceResolvers[a]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${a}".`)):(i=u(i,this.getLocale()),c(i)?this.namespaceResolvers[a](i).then(r=>{let o={};return o[i]=Object.assign({},r),f(r)&&(n!==false&&this.store(o),this.trigger("namespace-loaded",a,i,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${a}".`)))}static LoadNamespace(a,i,n=true){return g.getInstance().loadNamespace(a,i,n)}loadNamespaces(a,i=true){let n=[],r={};a=u(a,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&n.push(new Promise(s=>{this.namespaceResolvers[o](a).then(l=>{B(r,l);}).finally(()=>{s(true);});}));return Promise.all(n).then(()=>{let o={};return o[a]=r,i!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",a,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(a,i=true){return g.getInstance().loadNamespaces(a,i)}static flattenObject(a){return f(a)?Object.flatten(a):a}static defaultInterpolator(a,i,n){return ae(i)?"":Y(i)?(i=String(i),!f(n)||!n||!f(n)||!n?i:i.replace(/%{(.*?)}/g,(r,o)=>ae(n[o])?"":Y(n[o])?String(n[o]):E(n[o],{escapeString:false}))):E(i,{escapeString:false})}};g.momentLocales={};var O=g,Z=O.getInstance();try{Object.setPrototypeOf(Z,O.prototype);}catch(e){}var N=e=>e&&typeof e=="object"&&!Array.isArray(e)&&e.name&&typeof e.name=="string"&&e.symbol&&typeof e.symbol=="string";var Ee="%v %s",te=e=>{let t=v.get("currencyFormat");return t&&typeof t=="string"&&t.includes("%v")?t:e!==false?Ee:""};function we(e){return e=e&&typeof e=="string"?e.trim():"",v.set("currencyFormat",e)}var sa=e=>{if(!N(e)){let a=typeof e=="object"&&e&&!Array.isArray(e)?u(e.code,e.name):typeof e=="string"?e:void 0;a&&(a=a.trim().toUpperCase()),a&&N(T[a])?e=T[a]:typeof e=="string"&&(a=e.trim().toUpperCase(),N(T[a])&&(e=T[a]));}let t=Object.assign({},e);if(!t.format){let a=te();a&&(t.format=a);}return t.format&&we(t.format),v.set("appConfigCurrency",t),t},la=()=>{var n,r,o,s;let e=Object.assign({},v.get("appConfigCurrency")),t=v.get("currencyCode");if(c(t)&&N(T[t.trim().toUpperCase()])&&(e=M(M({},T[t.trim().toUpperCase()]),e)),!c(e==null?void 0:e.format)){let l=te(false);c(l)&&l.includes("%v")&&(e.format=l);}let i=T["USD"];return M(M({symbol:i.symbol,format:(n=i.format)!=null?n:"%v %s",decimalSeparator:(r=i.decimalSeparator)!=null?r:".",thousandSeparator:(o=i.thousandSeparator)!=null?o:",",decimalDigits:(s=i.decimalDigits)!=null?s:0},Object.assign({},Z.getNestedTranslation("currencies"))),e)},A={getFormat:te,setFormat:we,setCurrency:sa,getCurrency:la,defaultCurrencyFormat:Ee};var da=e=>e&&typeof e=="object";function ne(e){let t=Object.assign({},A.getCurrency());if(e&&da(e))for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==void 0&&(t[a]=e[a]);if(c(t.format)){let a=Be(t.format);a.format&&(t.format=a.format),typeof a.decimalDigits=="number"&&(t.decimalDigits=a.decimalDigits);}return t}function re(e,t){return e=typeof e=="number"?e:0,t=typeof t=="number"?t:0,e=Math.round(Math.abs(e)),isNaN(e)?t:e}function ca(e){let t=A.getCurrency(),a=(t==null?void 0:t.format).toLowerCase();return typeof e=="string"&&(e=e.toLowerCase()),(typeof e!="string"||!e.match("%v"))&&(e=a),{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}}var W=(e,t)=>{let a=A.getCurrency();if(e=e||0,typeof e=="number")return e;t=t||a.decimalSeparator;let i=new RegExp("[^0-9-"+t+"]","g"),n=parseFloat((""+e).replace(/\((?=\d+)(.*)\)/,"-$1").replace(i,"").replace(t,"."));return isNaN(n)?0:n},ie=(e,t)=>{let a=A.getCurrency();t=re(t,a.decimalDigits);let n=String(e).replace(/[^\d.-]/g,"");if(n.length>15&&!n.includes("."))return n+"."+"0".repeat(t);try{let r=Number(n);if(isNaN(r))return "NaN";let o=+(r+"e"+t);return (+(Math.round(o)+"e-"+t)).toFixed(t)}catch(r){return "NaN"}},Ie=(e,t,a,i)=>{var p;e=W(e);let n=N(t)?t:A.getCurrency();typeof t=="number"&&(n.decimalDigits=t),typeof n.decimalDigits!="number"&&(n.decimalDigits=(p=String(e).split(".")[1])==null?void 0:p.length),a!==void 0&&(n.thousandSeparator=a),i!==void 0&&(n.decimalSeparator=i);let r=ne(n),o=re(r.decimalDigits),s=e<0?"-":"",l=parseInt(ie(Math.abs(e||0),o),10)+"",d=l.length>3?l.length%3:0,y="";if(o){let D=String(parseFloat(ie(Math.abs(e),o))||0);D.includes(".")&&(y=u(D.split(".")[1]).trim());}return s+(d?l.substring(0,d)+r.thousandSeparator:"")+l.substring(d).replace(/(\d{3})(?=\d)/g,"$1"+r.thousandSeparator)+(o&&y?r.decimalSeparator+y:"")},Fe=(e,t,a,i,n,r)=>{e=W(e);let o=N(t)?t:A.getCurrency();t!==void 0&&typeof t=="string"&&(o.symbol=t),a!==void 0&&(o.decimalDigits=a),i!==void 0&&(o.thousandSeparator=i),n!==void 0&&(o.decimalSeparator=n),c(r)&&(o.format=r);let s=ne(o),l=ca(s.format),d=u(e>0?l.pos:e<0?l.neg:l.zero),y=u(s.symbol),p=d.replace(y&&"%s",y),D=Ie(Math.abs(e),re(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),z=p.replace("%v",D);return x(M({},s),{formattedValue:p,formattedNumber:D,symbol:s.symbol,usedFormat:d,result:z})},ma=(e,t,a,i,n,r)=>Fe(e,t,a,i,n,r).result,Be=e=>{e=u(e).trim();let t={};if(e){let a=/(\.)(\#{0,9}\s*$)/,i=e.match(a);Array.isArray(i)&&i.length===3&&(t.decimalDigits=u(i[2]).trim().length),e=e.replace(a,"");}return t.format=e,t},fi={parse:W,session:A,formatMoney:ma,currencies:T,isCurrency:N,formatNumber:Ie,formatMoneyAsObject:Fe,unformat:W,toFixed:ie,prepareOptions:ne,parseFormat:Be};exports.CurrencyUtils=fi;
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var Ve={auth:ge,currencies:pe,countries:fe,dates:be,resources:De,validator:he};function _(e){return !!(e==null||typeof e=="undefined"||typeof e=="string"&&e===""||Array.isArray(e)&&!e.length)}function h(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function w(e){return !e||typeof e!="object"?false:e instanceof Date?true:typeof e.getTime!="function"?false:!(Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))}var m=class m{static parseString(t,a){if(c(t)&&c(a))try{let i=R__default.default(t,a,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:a,isValid:!0}}catch(i){}try{if(Array.isArray(a)&&(a!=null&&a.length))for(let i of a){let n=Ce(t,i);if(n)return n}for(let i of m.DATE_FORMATS){let n=Ce(t,i);if(n)return n}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(t){let a=t?m.parseDate(t):new Date;return a?a.toISOString():""}static isoStringToDate(t){return new Date(t)}static parseDate(t,a){if(m.isDateObj(t))return t;if(!c(a)){let i=m.parseString(t);return i!=null&&i.isValid?i.date:null}if(_(t))return null;try{let i=R__default.default(t,a,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",t," format is : ",a);}return null}static toSQLDateTimeFormat(t){if(!m.isDateObj(t))return "";let a=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return `${a}-${i}-${n} ${r}:${o}:${s}`}static getI18n(t){return O.isI18nInstance(t)?t:O.getInstance()}static getDefaultDateTimeFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(t){if(!m.isDateObj(t))return "";let a=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return `${a}-${i}-${n}`}static toSQLTimeFormat(t){if(!m.isDateObj(t))return "";let a=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return `${a}:${i}:${n}`}static getDefaultTimeFormat(t){return u(this.getI18n(t).getNestedTranslation("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(t,a){if(t==null||typeof t=="boolean")return false;if(m.isDateObj(t))return true;if(h(t)){let n=new Date(t);return n&&!isNaN(n.getTime())}if(c(t))return !!m.parseDate(t,a);if(t!=null&&t.toString&&(t==null?void 0:t.toString())==parseInt(t).toString())return false;let i=new Date(t);return m.isDateObj(i)}static addToDate(t,a,i){if(h(t)||(t=0),_(a)&&(a=new Date),m.isValidDate(a)&&c(a)&&(a=new Date(a)),m.isValidDate(a)||(a=c(a)?new Date(a):new Date),c(i)&&typeof a["set"+i]=="function"&&typeof a["get"+i]=="function"){let n="set"+i,r="get"+i;a=new Date(a[n](a[r]()+t));}return a}static addDays(t,a){return m.addToDate(t,a,"Date")}static addMilliseconds(t,a){return h(t)||(t=0),m.isDateObj(a)||(a=new Date),a=a||new Date,new Date(a.getTime()+t)}static addSeconds(t,a){return h(t)||(t=0),m.addMilliseconds(t*1e3,a)}static addMinutes(t,a){return h(t)||(t=0),m.addMilliseconds(t*6e4,a)}static addHours(t,a){return h(t)||(t=0),m.addMilliseconds(t*36e5,a)}static addMonths(t,a,i){return m.addToDate(t,a,"Month")}static addWeeks(t,a){return t=(h(t)?t:0)*7,m.addToDate(t,a,"Date")}static addYears(t,a){h(t)||(t=0);let i=new Date(m.addToDate(0,a)),n=i.getFullYear();return n+t<0?t=0:t+=n,i.setFullYear(t),new Date(i)}static formatDate(t,a){try{let i=R__default.default(t);if(i.isValid())return i.format(u(a,m.getDefaultDateTimeFormat()))}catch(i){}return u(m.isValidDate(t)?t==null?void 0:t.toString():"")}static getUTCDateTimeDetails(t){let a=t?R__default.default.utc(t):R__default.default.utc();return {year:a.year(),day:a.day(),month:a.month(),monthString:a.format("MM"),hours:a.hours(),date:a.date(),minutes:a.minutes(),seconds:a.seconds(),monthName:a.format("MMMM"),dayName:a.format("dddd"),dayNameShort:a.format("ddd")}}};m.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],m.SQL_DATE_FORMAT="YYYY-MM-DD",m.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",m.SQL_TIME_FORMAT="HH:mm:ss",m.getCurrentMonthDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=new Date(a.getFullYear(),a.getMonth(),1),n=new Date(a.getFullYear(),a.getMonth()+1,0);return {first:i,last:n}},m.getPreviousWeekDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=new Date(a.getTime()-3600*24*7*1e3),n=new Date(i),r=i.getDay(),o=i.getDate()-r+(r===0?-6:1),s=new Date(i.setDate(o)),l=new Date(n.setDate(o+6));return {first:s,last:l}},m.getCurrentWeekDaysRange=t=>{let a=m.isValidDate(t)?new Date(t):new Date().resetHours2Minutes2Seconds(),i=a.getDay(),n=a.getDate()-i+(i==0?-6:1),r=new Date(a),o=new Date(a.setDate(n));return r.setDate(r.getDate()+6),{first:o,last:r}},m.isDateObj=w;var b=m,Ce=(e,t)=>{let a=R__default.default(e,t,true);try{if(a.isValid()&&a.format(t)===e||R__default.default.utc(a,!0).format(t)===e)return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return b.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return b.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return b.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(e){return b.formatDate(this,e)};Date.prototype.addYears=function(e){return b.addYears(e,this)};Date.prototype.addMonths=function(e){return b.addMonths(e,this)};Date.prototype.addMinutes=function(e){return b.addMinutes(e,this)};Date.prototype.addSeconds=function(e){return b.addSeconds(e,this)};Date.prototype.addDays=function(e){return b.addDays(e,this)};Date.prototype.addWeeks=function(e){return b.addWeeks(e,this)};Date.prototype.addHours=function(e){return b.addHours(e,this)};var S=class S{static get logger(){let t=Reflect.getMetadata(S.loggerMetaData,S);return Te(t)&&(this._logger=t),this._logger?this._logger:console}static set logger(t){Te(t)&&Reflect.defineMetadata(S.loggerMetaData,t,S);}static _log(t,...a){let i=S.logger;t=u(t),t&&typeof i[t]=="function"?i[t](S.getDateTimeString(),...a):console.log("Logger level not found : [",t,"]",...a);}static getDateTimeString(){let{day:t,year:a,hours:i,minutes:n,seconds:r,dayNameShort:o,monthName:s}=b.getUTCDateTimeDetails(),l=t<10?"0"+t:t,d=i<10?"0"+i:i,y=n<10?"0"+n:n,p=r<10?"0"+r:r;return "["+[o,l,s,a].join(" ")+" "+[d,y,p].join(":")+"]"}static log(...t){this._log("log",...t);}static info(...t){this._log("info",...t);}static debug(...t){this._log("debug",...t);}static warn(...t){this._log("warn",...t);}static error(...t){this._log("error",...t);}};S.loggerMetaData=Symbol("logger-meta-data");var I=S,Te=e=>{if(!e)return false;try{return ["warn","info","error"].every(t=>typeof e[t]=="function")}catch(t){return false}};function $e(e){return typeof e=="boolean"||!e||typeof e=="number"||typeof e=="string"||typeof e=="symbol"?false:Object(e).constructor===Promise||e.constructor&&(e.constructor.name==="Promise"||e.constructor.name==="AsyncFunction")||e instanceof Promise||typeof(e==null?void 0:e.then)=="function"&&typeof(e==null?void 0:e.catch)=="function"&&typeof(e==null?void 0:e.finally)=="function"?true:e&&typeof e.constructor=="function"&&Function.prototype.toString.call(e.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function Me(e){return e&&Object.prototype.toString.call(e)==="[object Promise]"?true:$e(e)}function Se(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var G=()=>{var e;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((e=process==null?void 0:process.versions)!=null&&e.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(t){}return false},Ze=()=>{var e,t;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((e=window==null?void 0:window.process)==null?void 0:e.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((t=process.versions)!=null&&t.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},We=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(e){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(t){}}return false},ze=()=>typeof window=="undefined"&&typeof process!="undefined",ve=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Je=()=>{if(!Se()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let e=navigator.userAgent.toLowerCase();return /android/i.test(e)},Qe=()=>{var e;return !ve()||!(window!=null&&window.ReactNativeWebView)?false:typeof((e=window==null?void 0:window.ReactNativeWebView)==null?void 0:e.postMessage)=="function"},qe=()=>G()&&process.platform==="darwin",_e=()=>G()&&process.platform==="win32",Xe=()=>G()&&process.platform==="linux",Ne={isWeb:Se,isLinux:Xe,isDarwin:qe,isWin32:_e,isNode:G,isElectron:Ze,isTouchDevice:We,isServerSide:ze,isClientSide:ve,isAndroidMobileBrowser:Je,isReactNativeWebview:Qe};var L=class e{static decycle(t,a=[]){if(typeof t=="function")return;if(!t||typeof t!="object")return t;if(a.includes(t))return null;let i=a.concat([t]);return Array.isArray(t)?t.map(n=>e.decycle(n,i)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e.decycle(r,i)]))}static stringify(t,a=false){return typeof t=="string"?t:JSON.stringify(a!==false?e.decycle(t):t)}static isJSON(t){if(typeof t!="string")return false;let a=t.trim();if(a.length===0)return false;let i=a[0];if(i!=="{"&&i!=="[")return false;try{let n=JSON.parse(a);return n!==null&&typeof n=="object"}catch(n){return false}}static parse(t,a){if(typeof t=="string")try{t=JSON.parse(t,a);}catch(i){return t}if(t&&typeof t=="object")for(let i in t){let n=t[i];e.isJSON(n)&&(t[i]=e.parse(n,a));}return t}};var P=class P{static get storage(){var a;let t=Reflect.getMetadata(P.sessionStorageMetaData,P);if(X(t)&&(this._storage=t),this._storage)return this._storage;if(Ne.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((a=window.localStorage)!=null&&a.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,n)=>window.localStorage.setItem(i,n),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:n=>i[n],set:(n,r)=>i[n]=r,remove:n=>{delete i[n];},removeAll:()=>i={}};}return this._storage}static set storage(t){X(t)&&Reflect.defineMetadata(P.sessionStorageMetaData,t,P);}static get keyNamespace(){return c(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(t){c(t)&&(this._keyNamespace=t.trim().replace(/\s+/g,"-"));}static sanitizeKey(t){if(!t||!c(t))return "";t=t.trim().replace(/\s+/g,"-");let a=this.keyNamespace;return a?`${a}-${t}`:t}};P.sessionStorageMetaData=Symbol("sessionStorage"),P._keyNamespace=void 0;var C=P;function U(e){return C.sanitizeKey(e)}var Pe=(e,t)=>(e=e&&L.stringify(e,t),e==null&&(e=""),e),Ye=e=>{if(Me(e))return new Promise((t,a)=>{e.then(i=>{t(L.parse(i));}).catch(i=>{a(i);});});if(e!=null)return L.parse(e)},je=e=>{if(e=U(e),C.storage&&e&&typeof e=="string"){let t=C.storage.get(e);return Ye(t)}},ea=e=>{if(e=U(e),C.storage&&e&&typeof e=="string")return C.storage.remove(e)},aa=()=>{if(C.storage)return C.storage.removeAll()},X=e=>{if(!e)return false;try{return ["get","set","remove","removeAll"].every(t=>typeof e[t]=="function")}catch(t){return false}},v={get:je,set:(e,t,a=true)=>(e=U(e),C.storage.set(e,Pe(t,a))),remove:ea,handleGetValue:Ye,sanitizeKey:U,handleSetValue:Pe,isValidStorage:X,Manager:C,removeAll:aa};function Y(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function F(e){if(e instanceof RegExp)return true;if(!e||typeof e!="object"||!Object.prototype.toString.call(e).includes("RegExp"))return false;try{return new RegExp(e),!0}catch(t){return false}}function j(e){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:e===document?true:"HTMLElement"in window?!!e&&e instanceof HTMLElement:!!e&&typeof e=="object"&&e.nodeType===1&&!!e.nodeName}function f(e){if(e===null||typeof e!="object"||j(e)||w(e)||F(e)||Y(e))return false;let t=Object.getPrototypeOf(e);if(t===null)return true;let a=t.constructor;if(typeof a!="function")return false;if(a===Object)return true;let i=a.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof t.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")&&typeof t.isPrototypeOf=="function"}function ee(e){if(Array.isArray(e)){let i=[];for(var t=0;t<e.length;t++)i[t]=ee(e[t]);return i}else if(f(e)&&e){let i={};for(var a in e)e.hasOwnProperty(a)&&(i[a]=ee(e[a]));return i}else return e}Object.getSize=function(e,t=false){if(!e||typeof e!="object")return 0;if(Array.isArray(e))return e.length;typeof t!="boolean"&&(t=false);let a=0;for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&(a++,t===true))return a;return a};function B(e,...t){let a=Array.isArray(e),i=f(e);(e==null||!a&&!i)&&(e={});for(let n=0;n<t.length;n++){let r=t[n];if(r==null)continue;let o=f(r),s=Array.isArray(r);if(!(!o&&!s)){if(a){s&&Ae(e,r);continue}else if(s)continue;for(let l in r){let d=r[l];if(d==null)continue;if(d===r){e[l]=e;continue}let y=e[l],p=Array.isArray(y),D=Array.isArray(d);if(p){D?Ae(e[l],d):e[l]=d;continue}else if(!f(y)){e[l]=d;continue}if(D||!f(d)){e[l]=d;continue}e[l]=B({},y,d);}}}return e}var Ae=(e,t)=>{let a=t.length,i=0;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(n<a){let s=Array.isArray(r),l=Array.isArray(o),d=f(r),y=f(o);s&&l||d&&y?(e[i]=B(s?[]:{},r,o),i++):o!=null?(e[i]=o,i++):r!=null&&(e[i]=r,i++);}}for(let n=e.length;n<a;n++)t[n]!==void 0&&t[n]!==null&&e.push(t[n]);return e};function ta(e,t){return V(e,"",{},t)}function V(e,t="",a={},i){if(a=f(a)?a:{},Y(e)||w(e)||F(e)||Array.isArray(e)&&(i!=null&&i.skipArrays))return t&&(a[t]=e),a;if(typeof e=="function"||typeof e=="object"&&!f(e)&&!ia(e))return a;if(e instanceof Map||e instanceof WeakMap)return Array.from(e.entries()).forEach(([n,r])=>{let o=t?`${t}[${String(n)}]`:String(n);V(r,o,a,i);}),a;if(Array.isArray(e)||e instanceof Set||e instanceof WeakSet)return (Array.isArray(e)?e:Array.from(e)).forEach((r,o)=>{let s=t?`${t}[${o}]`:String(o);V(r,s,a,i);}),a;if(f(e))for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n],o=t?t.endsWith("]")?`${t}.${n}`:`${t}.${n}`:n;V(r,o,a,i);}return a}function ia(e){return Array.isArray(e)||e instanceof Set||e instanceof Map||e instanceof WeakMap||e instanceof WeakSet}function na(e){return Object.entries(e)}Object.typedEntries=na;Object.flatten=ta;Object.clone=ee;function K(e,t){if(e==null)return "";if(typeof e=="string")return e;if((typeof e=="number"||typeof e=="object"&&e instanceof Number)&&typeof e.formatNumber=="function")return e.formatNumber();if(e instanceof Date||typeof e=="object"&&e!==null&&e.constructor===Date)return typeof e.toFormat=="function"?e.toFormat():e.toISOString();if(e instanceof Error)return `Error: ${e.message}`;if(F(e))return e.toString();if(Y(e))return String(e);if(Array.isArray(e))return JSON.stringify(e);if(typeof e=="object"&&e!==null){if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString)return e.toString();if(typeof e.toString=="function"){let a=e.toString();if(a!=="[object Object]")return a}return JSON.stringify(e)}return typeof(e==null?void 0:e.toString)=="function"?e.toString():String(e)}function Re(e,t,a){let i=K,n=u(e);if(!f(t)||!t)return n;let r=/%\{([^}]+)\}/g,o=new Set,s,l=u(e);for(;(s=r.exec(l))!==null;){let d=s[1];d!==void 0&&o.add(d);}return o.forEach(d=>{let y;y=`%{${d}}`;let p=Object.prototype.hasOwnProperty.call(t,d)?t[d]:void 0,D=p===void 0?"":(()=>{try{return i(p,d,K)}catch(oe){return K(p)}})(),z=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(z,"g"),D);}),n}function ae(e){return !!(e==null||typeof e=="number"&&isNaN(e)||typeof e=="string"&&e.trim()==="")}function ra(e){return u(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function $(e,t){var a=Object.prototype.toString.call(e);return a==="[object "+t+"]"}function E(e,t){if(["boolean","undefined"].includes(typeof e)||e===null)return String(e);if(h(e))return e.formatNumber();if(e instanceof Date)return e.toFormat();if(e instanceof Error)return e==null?void 0:e.toString();t=Object.assign({},t);let{parenthesis:a}=t,i=a?"(":"",n=a?")":"";return typeof e=="string"?(t==null?void 0:t.escapeString)!==false?"'"+ra(e)+"'":e:$(e,"RegExp")||$(e,"Number")||$(e,"Boolean")?e.toString():$(e,"Date")?"new Date("+e.getTime()+")":Array.isArray(e)?"["+e.map(r=>E(r,t)).join(",")+"]":typeof e=="object"?i+"{"+Object.keys(e).map(r=>{var o=e[r];return E(r,t)+":"+E(o,t)}).join(",")+"}"+n:e&&typeof(e==null?void 0:e.toString)=="function"?e==null?void 0:e.toString():String(e)}var Le=Symbol("TRANSLATION_KEY");var g=class g extends i18nJs.I18n{constructor(a={},i={}){super({},i);this._isLoading=false;this._locales=[];this.namespaceResolvers={};this._observableFactory=ue();this._____isObservable=true;this.hasRegisteredDefaultTranslations=false;this._namespacesLoaded={};this.hasRegisteredDefaultTranslations||(this.registerTranslations(q),this.hasRegisteredDefaultTranslations=true),this.registerTranslations(a),this.loadNamespaces();}static[Symbol.hasInstance](a){return this.isI18nInstance(a)}static isI18nInstance(a){if(!a||typeof a!="object")return false;try{if(a instanceof i18nJs.I18n)return !0}catch(i){}return typeof a.getLocale=="function"&&typeof a.translate=="function"&&typeof a.translateTarget=="function"}translate(a,i){return this.isPluralizeOptions(i)&&this.canPluralize(a)?(typeof i.count=="number"&&(i.countStr=i.count.formatNumber()),this.pluralize(i.count,a,i)):super.translate(a,i)}translateTarget(a,i){let n=g.getTargetTanslationKeys(a);for(let r in n)c(n[r])&&(n[r]=this.translate(n[r],i));return n}translateObject(a,i){if(!f(a))return {};let n={};for(let r in a){let o=a[r];c(o)&&(n[r]=Z.translate(o,i));}return n}static getTargetTanslationKeys(a){return ye(a,Le)}on(a,i){return this._observableFactory.on.call(this,a,i)}finally(a,i){return this._observableFactory.finally.call(this,a,i)}off(a,i){var n;return (n=this._observableFactory)==null?void 0:n.off.call(this,a,i)}trigger(a,...i){var n;return (n=this._observableFactory)==null?void 0:n.trigger.call(this,a,...i)}offAll(){var a;return (a=this._observableFactory)==null?void 0:a.offAll.call(this)}once(a,i){var n;return (n=this._observableFactory)==null?void 0:n.once.call(this,a,i)}getEventCallBacks(){var a;return (a=this._observableFactory)==null?void 0:a.getEventCallBacks.call(this)}static getInstance(a){if(!this.isI18nInstance(g.instance)){let i=g.getLocaleFromSession();g.instance=this.createInstance({},Object.assign({},i?{locale:i}:{},a));}return g.instance}isDefaultInstance(){return this===g.instance}static setLocaleToSession(a){v.set("i18n.locale",a);}static getLocaleFromSession(){let a=v.get("i18n.locale");return c(a)?a:""}canPluralize(a,i){i=u(i,this.getLocale());let n=this.getNestedTranslation(a,i);return !f(n)||!n?false:c(n==null?void 0:n.one)&&c(n==null?void 0:n.other)}getNestedTranslation(a,i){i=u(i,this.getLocale());let n=(c(a)?a.trim().split("."):Array.isArray(a)?a:[]).filter(c);if(!n.length)return;let r=this.getTranslations(i);for(let o of n)if(f(r))r=r[o];else return;return r}isPluralizeOptions(a){return !!(f(a)&&a&&typeof a.count=="number")}static RegisterTranslations(a){return g.getInstance().registerTranslations(a)}static createInstance(a={},i={}){let s=Object.assign({},i),{interpolate:n}=s,r=me(s,["interpolate"]),o=new g(a,r);return o.interpolate=(l,d,y)=>{let p=g.flattenObject(y),D=this.defaultInterpolator(l,d,p);return c(D)&&D!==d&&(d=D),typeof n=="function"?n(l,d,y):Re(d,y)},o}getTranslations(a){let i=f(this.translations)?this.translations:{};return c(a)?f(i[a])?i[a]:{}:i}static registerMomentLocale(a,i){return c(a)&&f(i)&&Array.isArray(i.months)&&(this.momentLocales[a]=B({},this.momentLocales[a],i)),this.momentLocales}static getMomentLocale(a){return this.momentLocales[a]}static setMomentLocale(a){try{return R__default.default.updateLocale(a,this.getMomentLocale(a)),!0}catch(i){console.error(i," setting moment locale : ",a);}return false}registerTranslations(a){return this.store(a),this.getTranslations()}store(a){super.store(a),this.trigger("translations-changed",this.getLocale(),this.getTranslations());}resolveTranslations(a){try{let i=Object.getOwnPropertyNames(a);for(let n of i){let r=Reflect.getMetadata(Le,a,n);if(r)try{a[n]=this.translate(r);}catch(o){I.error(o," resolving translation for key : ",r);}}}catch(i){I.error(i," resolving translations for target : ",a);}}getMissingPlaceholderString(a,i,n){return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,u(i),Object.assign({},n)):a}getLocale(){return super.locale}setLocales(a){return this._locales=Array.isArray(a)?a:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}hasLocale(a){return c(a)&&this.getLocales().includes(a)}getLocales(){let a=Object.keys(this.getTranslations()),i=Array.isArray(this._locales)?this._locales:["en"],n=[...a,...i.filter(r=>!a.includes(r))];return n.includes("en")||n.push("en"),n}isLocaleSupported(a){return c(a)?this.getLocales().includes(a):false}isLoading(){return this._isLoading}setLocale(a,i=false){return super.locale===a&&i!==true&&this._namespacesLoaded[a]?Promise.resolve(this.getLocale()):new Promise((n,r)=>(this._isLoading=true,this.trigger("namespaces-before-load",a),this.loadNamespaces(a).then(o=>{this.isDefaultInstance()&&(g.instance=this,this.isLocaleSupported(a)&&g.setLocaleToSession(a)),super.locale=a,g.setMomentLocale(a),this.trigger("locale-changed",a,o),n(a);}).catch(r).finally(()=>{this._isLoading=false;})))}registerNamespaceResolver(a,i){if(!c(a)||typeof i!="function"){console.warn("Invalid arguments for registerNamespaceResolver.",a,i);return}this.namespaceResolvers[a]=i;}static RegisterNamespaceResolver(a,i){return g.getInstance().registerNamespaceResolver(a,i)}loadNamespace(a,i,n=true){return !c(a)||!this.namespaceResolvers[a]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${a}".`)):(i=u(i,this.getLocale()),c(i)?this.namespaceResolvers[a](i).then(r=>{let o={};return o[i]=Object.assign({},r),f(r)&&(n!==false&&this.store(o),this.trigger("namespace-loaded",a,i,o)),o}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${a}".`)))}static LoadNamespace(a,i,n=true){return g.getInstance().loadNamespace(a,i,n)}loadNamespaces(a,i=true){let n=[],r={};a=u(a,this.getLocale()),this._isLoading=true;for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&typeof this.namespaceResolvers[o]=="function"&&n.push(new Promise(s=>{this.namespaceResolvers[o](a).then(l=>{B(r,l);}).finally(()=>{s(true);});}));return Promise.all(n).then(()=>{let o={};return o[a]=r,i!==false&&this.store(o),setTimeout(()=>{this.trigger("namespaces-loaded",a,o);},100),o}).finally(()=>{this._isLoading=false;})}static LoadNamespaces(a,i=true){return g.getInstance().loadNamespaces(a,i)}static flattenObject(a){return f(a)?Object.flatten(a):a}static defaultInterpolator(a,i,n){return ae(i)?"":Y(i)?(i=String(i),!f(n)||!n||!f(n)||!n?i:i.replace(/%{(.*?)}/g,(r,o)=>ae(n[o])?"":Y(n[o])?String(n[o]):E(n[o],{escapeString:false}))):E(i,{escapeString:false})}};g.momentLocales={};var O=g,Z=O.getInstance();try{Object.setPrototypeOf(Z,O.prototype);}catch(e){}var N=e=>e&&typeof e=="object"&&!Array.isArray(e)&&e.name&&typeof e.name=="string"&&e.symbol&&typeof e.symbol=="string";var Ee="%v %s",te=e=>{let t=v.get("currencyFormat");return t&&typeof t=="string"&&t.includes("%v")?t:e!==false?Ee:""};function we(e){return e=e&&typeof e=="string"?e.trim():"",v.set("currencyFormat",e)}var sa=e=>{if(!N(e)){let a=typeof e=="object"&&e&&!Array.isArray(e)?u(e.code,e.name):typeof e=="string"?e:void 0;a&&(a=a.trim().toUpperCase()),a&&N(T[a])?e=T[a]:typeof e=="string"&&(a=e.trim().toUpperCase(),N(T[a])&&(e=T[a]));}let t=Object.assign({},e);if(!t.format){let a=te();a&&(t.format=a);}return t.format&&we(t.format),v.set("appConfigCurrency",t),t},la=()=>{var n,r,o,s;let e=Object.assign({},v.get("appConfigCurrency")),t=v.get("currencyCode");if(c(t)&&N(T[t.trim().toUpperCase()])&&(e=M(M({},T[t.trim().toUpperCase()]),e)),!c(e==null?void 0:e.format)){let l=te(false);c(l)&&l.includes("%v")&&(e.format=l);}let i=T["USD"];return M(M({symbol:i.symbol,format:(n=i.format)!=null?n:"%v %s",decimalSeparator:(r=i.decimalSeparator)!=null?r:".",thousandSeparator:(o=i.thousandSeparator)!=null?o:",",decimalDigits:(s=i.decimalDigits)!=null?s:0},Object.assign({},Z.getNestedTranslation("currencies"))),e)},A={getFormat:te,setFormat:we,setCurrency:sa,getCurrency:la,defaultCurrencyFormat:Ee};var da=e=>e&&typeof e=="object";function ne(e){let t=Object.assign({},A.getCurrency());if(e&&da(e))for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==void 0&&(t[a]=e[a]);if(c(t.format)){let a=Be(t.format);a.format&&(t.format=a.format),typeof a.decimalDigits=="number"&&(t.decimalDigits=a.decimalDigits);}return t}function re(e,t){return e=typeof e=="number"?e:0,t=typeof t=="number"?t:0,e=Math.round(Math.abs(e)),isNaN(e)?t:e}function ca(e){let t=A.getCurrency(),a=(t==null?void 0:t.format).toLowerCase();return typeof e=="string"&&(e=e.toLowerCase()),(typeof e!="string"||!e.match("%v"))&&(e=a),{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}}var W=(e,t)=>{let a=A.getCurrency();if(e=e||0,typeof e=="number")return e;t=t||a.decimalSeparator;let i=new RegExp("[^0-9-"+t+"]","g"),n=parseFloat((""+e).replace(/\((?=\d+)(.*)\)/,"-$1").replace(i,"").replace(t,"."));return isNaN(n)?0:n},ie=(e,t)=>{let a=A.getCurrency();t=re(t,a.decimalDigits);let n=String(e).replace(/[^\d.-]/g,"");if(n.length>15&&!n.includes("."))return n+"."+"0".repeat(t);try{let r=Number(n);if(isNaN(r))return "NaN";let o=+(r+"e"+t);return (+(Math.round(o)+"e-"+t)).toFixed(t)}catch(r){return "NaN"}},Ie=(e,t,a,i)=>{var p;e=W(e);let n=N(t)?t:A.getCurrency();typeof t=="number"&&(n.decimalDigits=t),typeof n.decimalDigits!="number"&&(n.decimalDigits=(p=String(e).split(".")[1])==null?void 0:p.length),a!==void 0&&(n.thousandSeparator=a),i!==void 0&&(n.decimalSeparator=i);let r=ne(n),o=re(r.decimalDigits),s=e<0?"-":"",l=parseInt(ie(Math.abs(e||0),o),10)+"",d=l.length>3?l.length%3:0,y="";if(o){let D=String(parseFloat(ie(Math.abs(e),o))||0);D.includes(".")&&(y=u(D.split(".")[1]).trim());}return s+(d?l.substring(0,d)+r.thousandSeparator:"")+l.substring(d).replace(/(\d{3})(?=\d)/g,"$1"+r.thousandSeparator)+(o&&y?r.decimalSeparator+y:"")},Fe=(e,t,a,i,n,r)=>{e=W(e);let o=N(t)?t:A.getCurrency();t!==void 0&&typeof t=="string"&&(o.symbol=t),a!==void 0&&(o.decimalDigits=a),i!==void 0&&(o.thousandSeparator=i),n!==void 0&&(o.decimalSeparator=n),c(r)&&(o.format=r);let s=ne(o),l=ca(s.format),d=u(e>0?l.pos:e<0?l.neg:l.zero),y=u(s.symbol),p=d.replace(y&&"%s",y),D=Ie(Math.abs(e),re(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),z=p.replace("%v",D);return x(M({},s),{formattedValue:p,formattedNumber:D,symbol:s.symbol,usedFormat:d,result:z})},ma=(e,t,a,i,n,r)=>Fe(e,t,a,i,n,r).result,Be=e=>{e=u(e).trim();let t={};if(e){let a=/(\.)(\#{0,9}\s*$)/,i=e.match(a);Array.isArray(i)&&i.length===3&&(t.decimalDigits=u(i[2]).trim().length),e=e.replace(a,"");}return t.format=e,t},fi={parse:W,session:A,formatMoney:ma,currencies:T,isCurrency:N,formatNumber:Ie,formatMoneyAsObject:Fe,unformat:W,toFixed:ie,prepareOptions:ne,parseFormat:Be};exports.CurrencyUtils=fi;
@@ -12,7 +12,7 @@ import { Currency, CurrencyCode } from './types';
12
12
  * setCurrencyFormat(null); // Sets an empty string as the currency format in the Session storage
13
13
  * ```
14
14
  */
15
- declare function setCurrencyFormat(format: string): any;
15
+ declare function setCurrencyFormat(format: string): void | Promise<void>;
16
16
  export declare const session: {
17
17
  getFormat: (force?: boolean) => string;
18
18
  setFormat: typeof setCurrencyFormat;