@wix/cli-app 1.1.58 → 1.1.59

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 (91) hide show
  1. package/build/{CreateVersionCommand-NNN5WEDG.js → CreateVersionCommand-6HJGN4WS.js} +16 -16
  2. package/build/{DevCommand-DTV4QLZX.js → DevCommand-U7PV4HW6.js} +15 -15
  3. package/build/DevCommand-U7PV4HW6.js.map +1 -0
  4. package/build/{GenerateCommand-3EILY6GU.js → GenerateCommand-M3T6OD4B.js} +295 -181
  5. package/build/GenerateCommand-M3T6OD4B.js.map +1 -0
  6. package/build/{LogsCommand-GBLWWXA4.js → LogsCommand-ECPZQ3LE.js} +4 -4
  7. package/build/PreviewCommand-ZQ3OUOKW.js +23 -0
  8. package/build/ReleaseCommand-KLZWNOVY.js +91 -0
  9. package/build/ReleaseCommand-KLZWNOVY.js.map +1 -0
  10. package/build/{ServeCommand-HBKGVBCD.js → ServeCommand-I65XXTLM.js} +13 -13
  11. package/build/{build-NYCCEFPM.js → build-HZ5LVFAS.js} +10 -9
  12. package/build/build-HZ5LVFAS.js.map +1 -0
  13. package/build/{chunk-XRPBC4UX.js → chunk-4JDHJDA5.js} +3 -3
  14. package/build/{chunk-NTTJJSCK.js → chunk-ACN6EZGH.js} +3 -3
  15. package/build/{chunk-IWJPJJEU.js → chunk-AQKGIDJO.js} +1969 -342
  16. package/build/chunk-AQKGIDJO.js.map +1 -0
  17. package/build/{chunk-RFDDKVTR.js → chunk-BNROT2BN.js} +5 -5
  18. package/build/{chunk-2ROHQF53.js → chunk-DXNFLVQP.js} +477 -484
  19. package/build/chunk-DXNFLVQP.js.map +1 -0
  20. package/build/{chunk-PUIMS4NQ.js → chunk-EZLVJJON.js} +3 -3
  21. package/build/{chunk-DKKXEKW7.js → chunk-FHMCCDCY.js} +3 -3
  22. package/build/{chunk-P5P6YINI.js → chunk-FMM24YL4.js} +2018 -886
  23. package/build/chunk-FMM24YL4.js.map +1 -0
  24. package/build/{chunk-CDB46GX7.js → chunk-IDWDZWLM.js} +2 -2
  25. package/build/{chunk-MVNY3M6D.js → chunk-OCC6MO6R.js} +5 -5
  26. package/build/{chunk-UGZFZOEU.js → chunk-PAWIUC26.js} +8 -8
  27. package/build/{chunk-SE6QML7T.js → chunk-QVGYU6D4.js} +17 -7
  28. package/build/chunk-QVGYU6D4.js.map +1 -0
  29. package/build/{chunk-FQ554CIC.js → chunk-QW4WBWJK.js} +3 -3
  30. package/build/{chunk-ZDKKDXHS.js → chunk-U72IPCQR.js} +3 -3
  31. package/build/{chunk-TQB6XTPS.js → chunk-UQBZVJDQ.js} +6 -3
  32. package/build/chunk-UQBZVJDQ.js.map +1 -0
  33. package/build/{chunk-JSDDG7MC.js → chunk-W4HI7DI3.js} +2 -2
  34. package/build/{chunk-QVLKHYBX.js → chunk-ZJYRE4BT.js} +3 -3
  35. package/build/{chunk-XIKZ45R2.js → chunk-ZXHKA32C.js} +56 -12
  36. package/build/chunk-ZXHKA32C.js.map +1 -0
  37. package/build/cloudflare-runtime/entry.js +306 -252
  38. package/build/cloudflare-runtime/getRegisteredExtensions.js +21 -273
  39. package/build/index.js +444 -134
  40. package/build/index.js.map +1 -1
  41. package/build/platform-sdk/chunk-7EYXEF6M.js +2 -0
  42. package/build/platform-sdk/chunk-7EYXEF6M.js.map +1 -0
  43. package/build/platform-sdk/chunk-EVF6HSFE.js +2 -0
  44. package/build/platform-sdk/chunk-EVF6HSFE.js.map +1 -0
  45. package/build/platform-sdk/chunk-LO6MZPZE.js +2 -0
  46. package/build/platform-sdk/chunk-LO6MZPZE.js.map +1 -0
  47. package/build/platform-sdk/dashboard.js +1 -1
  48. package/build/platform-sdk/dashboard.js.map +1 -1
  49. package/build/platform-sdk/editor.js +4 -4
  50. package/build/platform-sdk/editor.js.map +1 -1
  51. package/build/platform-sdk/site.js +1 -1
  52. package/build/platform-sdk/site.js.map +1 -1
  53. package/build/platform-sdk/web-methods.js +2 -0
  54. package/build/platform-sdk/web-methods.js.map +1 -0
  55. package/build/{preview-CCEFGOHW.js → preview-FI6WYZUP.js} +13 -13
  56. package/build/preview-FI6WYZUP.js.map +1 -0
  57. package/build/{render-command-T2HCJX3F.js → render-command-UKYXN7C7.js} +6 -6
  58. package/package.json +13 -10
  59. package/templates/web-method/files/placeholder.ts.ejs +17 -0
  60. package/build/DevCommand-DTV4QLZX.js.map +0 -1
  61. package/build/GenerateCommand-3EILY6GU.js.map +0 -1
  62. package/build/PreviewCommand-A2C52TVM.js +0 -23
  63. package/build/build-NYCCEFPM.js.map +0 -1
  64. package/build/chunk-2ROHQF53.js.map +0 -1
  65. package/build/chunk-IWJPJJEU.js.map +0 -1
  66. package/build/chunk-P5P6YINI.js.map +0 -1
  67. package/build/chunk-SE6QML7T.js.map +0 -1
  68. package/build/chunk-TQB6XTPS.js.map +0 -1
  69. package/build/chunk-XIKZ45R2.js.map +0 -1
  70. package/build/platform-sdk/chunk-DGX4CFXG.js +0 -2
  71. package/build/platform-sdk/chunk-DGX4CFXG.js.map +0 -1
  72. package/build/platform-sdk/chunk-TN6HYRXL.js +0 -2
  73. package/build/platform-sdk/chunk-TN6HYRXL.js.map +0 -1
  74. package/build/preview-CCEFGOHW.js.map +0 -1
  75. /package/build/{CreateVersionCommand-NNN5WEDG.js.map → CreateVersionCommand-6HJGN4WS.js.map} +0 -0
  76. /package/build/{LogsCommand-GBLWWXA4.js.map → LogsCommand-ECPZQ3LE.js.map} +0 -0
  77. /package/build/{PreviewCommand-A2C52TVM.js.map → PreviewCommand-ZQ3OUOKW.js.map} +0 -0
  78. /package/build/{ServeCommand-HBKGVBCD.js.map → ServeCommand-I65XXTLM.js.map} +0 -0
  79. /package/build/{chunk-XRPBC4UX.js.map → chunk-4JDHJDA5.js.map} +0 -0
  80. /package/build/{chunk-NTTJJSCK.js.map → chunk-ACN6EZGH.js.map} +0 -0
  81. /package/build/{chunk-RFDDKVTR.js.map → chunk-BNROT2BN.js.map} +0 -0
  82. /package/build/{chunk-PUIMS4NQ.js.map → chunk-EZLVJJON.js.map} +0 -0
  83. /package/build/{chunk-DKKXEKW7.js.map → chunk-FHMCCDCY.js.map} +0 -0
  84. /package/build/{chunk-CDB46GX7.js.map → chunk-IDWDZWLM.js.map} +0 -0
  85. /package/build/{chunk-MVNY3M6D.js.map → chunk-OCC6MO6R.js.map} +0 -0
  86. /package/build/{chunk-UGZFZOEU.js.map → chunk-PAWIUC26.js.map} +0 -0
  87. /package/build/{chunk-FQ554CIC.js.map → chunk-QW4WBWJK.js.map} +0 -0
  88. /package/build/{chunk-ZDKKDXHS.js.map → chunk-U72IPCQR.js.map} +0 -0
  89. /package/build/{chunk-JSDDG7MC.js.map → chunk-W4HI7DI3.js.map} +0 -0
  90. /package/build/{chunk-QVLKHYBX.js.map → chunk-ZJYRE4BT.js.map} +0 -0
  91. /package/build/{render-command-T2HCJX3F.js.map → render-command-UKYXN7C7.js.map} +0 -0
@@ -11518,7 +11518,7 @@ var init_tslib_es6 = __esm({
11518
11518
  });
11519
11519
 
11520
11520
  // package.json
11521
- var version = "1.1.58";
11521
+ var version = "1.1.59";
11522
11522
 
11523
11523
  // ../cli-error/src/cli-error.ts
11524
11524
  init_esm_shims();
@@ -11608,6 +11608,7 @@ var CliSystemErrorCode = (0, import_variant.variant)({
11608
11608
  TypeErrorInvalidUrl: {},
11609
11609
  FailedToGenerateSelfsignedCertificate: {},
11610
11610
  FailedToResolveViteOrigin: {},
11611
+ AppReleaseConfigViolations: (0, import_variant.fields)(),
11611
11612
  FailedToCreateAppRelease: {},
11612
11613
  FailedToUpdateAppRelease: {},
11613
11614
  FailedToCreateComponents: {},
@@ -11722,7 +11723,12 @@ var CliUserErrorCode = (0, import_variant.variant)({
11722
11723
  FailedToGetSiteFsManagerCode: {},
11723
11724
  FailedToGetSiteFsManagerDocument: {},
11724
11725
  FailedToApplySiteFsManagerFsUpdates: {},
11725
- FailedToApplySiteFsManagerExternalUpdates: {}
11726
+ FailedToApplySiteFsManagerExternalUpdates: {},
11727
+ CannotReleaseApplicationInReview: {},
11728
+ FailedToCreateIntellisenseAdapter: {},
11729
+ FailedToInitIntellisenseAdapterTypes: {},
11730
+ FailedToUpdateIntellisenseAdapterTypes: {},
11731
+ WebMethodOutsideOfProjectDirectory: (0, import_variant.fields)()
11726
11732
  });
11727
11733
  var CliErrorCode = (0, import_variant.variant)({
11728
11734
  ...CliSystemErrorCode,
@@ -16739,6 +16745,9 @@ var quotelessJson = (obj) => {
16739
16745
  return json.replace(/"([^"]+)":/g, "$1:");
16740
16746
  };
16741
16747
  var ZodError = class _ZodError extends Error {
16748
+ get errors() {
16749
+ return this.issues;
16750
+ }
16742
16751
  constructor(issues) {
16743
16752
  super();
16744
16753
  this.issues = [];
@@ -16757,9 +16766,6 @@ var ZodError = class _ZodError extends Error {
16757
16766
  this.name = "ZodError";
16758
16767
  this.issues = issues;
16759
16768
  }
16760
- get errors() {
16761
- return this.issues;
16762
- }
16763
16769
  format(_mapper) {
16764
16770
  const mapper = _mapper || function(issue) {
16765
16771
  return issue.message;
@@ -16970,8 +16976,11 @@ function addIssueToContext(ctx, issueData) {
16970
16976
  path: ctx.path,
16971
16977
  errorMaps: [
16972
16978
  ctx.common.contextualErrorMap,
16979
+ // contextual error map is first priority
16973
16980
  ctx.schemaErrorMap,
16981
+ // then schema-bound map if available
16974
16982
  overrideMap,
16983
+ // then global override map
16975
16984
  overrideMap === errorMap ? void 0 : errorMap
16976
16985
  // then global default map
16977
16986
  ].filter((x) => !!x)
@@ -17122,34 +17131,6 @@ function processCreateParams(params) {
17122
17131
  return { errorMap: customMap, description };
17123
17132
  }
17124
17133
  var ZodType = class {
17125
- constructor(def) {
17126
- this.spa = this.safeParseAsync;
17127
- this._def = def;
17128
- this.parse = this.parse.bind(this);
17129
- this.safeParse = this.safeParse.bind(this);
17130
- this.parseAsync = this.parseAsync.bind(this);
17131
- this.safeParseAsync = this.safeParseAsync.bind(this);
17132
- this.spa = this.spa.bind(this);
17133
- this.refine = this.refine.bind(this);
17134
- this.refinement = this.refinement.bind(this);
17135
- this.superRefine = this.superRefine.bind(this);
17136
- this.optional = this.optional.bind(this);
17137
- this.nullable = this.nullable.bind(this);
17138
- this.nullish = this.nullish.bind(this);
17139
- this.array = this.array.bind(this);
17140
- this.promise = this.promise.bind(this);
17141
- this.or = this.or.bind(this);
17142
- this.and = this.and.bind(this);
17143
- this.transform = this.transform.bind(this);
17144
- this.brand = this.brand.bind(this);
17145
- this.default = this.default.bind(this);
17146
- this.catch = this.catch.bind(this);
17147
- this.describe = this.describe.bind(this);
17148
- this.pipe = this.pipe.bind(this);
17149
- this.readonly = this.readonly.bind(this);
17150
- this.isNullable = this.isNullable.bind(this);
17151
- this.isOptional = this.isOptional.bind(this);
17152
- }
17153
17134
  get description() {
17154
17135
  return this._def.description;
17155
17136
  }
@@ -17213,6 +17194,43 @@ var ZodType = class {
17213
17194
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
17214
17195
  return handleResult(ctx, result);
17215
17196
  }
17197
+ "~validate"(data) {
17198
+ var _a2, _b;
17199
+ const ctx = {
17200
+ common: {
17201
+ issues: [],
17202
+ async: !!this["~standard"].async
17203
+ },
17204
+ path: [],
17205
+ schemaErrorMap: this._def.errorMap,
17206
+ parent: null,
17207
+ data,
17208
+ parsedType: getParsedType(data)
17209
+ };
17210
+ if (!this["~standard"].async) {
17211
+ try {
17212
+ const result = this._parseSync({ data, path: [], parent: ctx });
17213
+ return isValid(result) ? {
17214
+ value: result.value
17215
+ } : {
17216
+ issues: ctx.common.issues
17217
+ };
17218
+ } catch (err) {
17219
+ if ((_b = (_a2 = err === null || err === void 0 ? void 0 : err.message) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
17220
+ this["~standard"].async = true;
17221
+ }
17222
+ ctx.common = {
17223
+ issues: [],
17224
+ async: true
17225
+ };
17226
+ }
17227
+ }
17228
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
17229
+ value: result.value
17230
+ } : {
17231
+ issues: ctx.common.issues
17232
+ });
17233
+ }
17216
17234
  async parseAsync(data, params) {
17217
17235
  const result = await this.safeParseAsync(data, params);
17218
17236
  if (result.success)
@@ -17290,6 +17308,39 @@ var ZodType = class {
17290
17308
  superRefine(refinement) {
17291
17309
  return this._refinement(refinement);
17292
17310
  }
17311
+ constructor(def) {
17312
+ this.spa = this.safeParseAsync;
17313
+ this._def = def;
17314
+ this.parse = this.parse.bind(this);
17315
+ this.safeParse = this.safeParse.bind(this);
17316
+ this.parseAsync = this.parseAsync.bind(this);
17317
+ this.safeParseAsync = this.safeParseAsync.bind(this);
17318
+ this.spa = this.spa.bind(this);
17319
+ this.refine = this.refine.bind(this);
17320
+ this.refinement = this.refinement.bind(this);
17321
+ this.superRefine = this.superRefine.bind(this);
17322
+ this.optional = this.optional.bind(this);
17323
+ this.nullable = this.nullable.bind(this);
17324
+ this.nullish = this.nullish.bind(this);
17325
+ this.array = this.array.bind(this);
17326
+ this.promise = this.promise.bind(this);
17327
+ this.or = this.or.bind(this);
17328
+ this.and = this.and.bind(this);
17329
+ this.transform = this.transform.bind(this);
17330
+ this.brand = this.brand.bind(this);
17331
+ this.default = this.default.bind(this);
17332
+ this.catch = this.catch.bind(this);
17333
+ this.describe = this.describe.bind(this);
17334
+ this.pipe = this.pipe.bind(this);
17335
+ this.readonly = this.readonly.bind(this);
17336
+ this.isNullable = this.isNullable.bind(this);
17337
+ this.isOptional = this.isOptional.bind(this);
17338
+ this["~standard"] = {
17339
+ version: 1,
17340
+ vendor: "zod",
17341
+ validate: (data) => this["~validate"](data)
17342
+ };
17343
+ }
17293
17344
  optional() {
17294
17345
  return ZodOptional.create(this, this._def);
17295
17346
  }
@@ -17300,7 +17351,7 @@ var ZodType = class {
17300
17351
  return this.nullable().optional();
17301
17352
  }
17302
17353
  array() {
17303
- return ZodArray.create(this, this._def);
17354
+ return ZodArray.create(this);
17304
17355
  }
17305
17356
  promise() {
17306
17357
  return ZodPromise.create(this, this._def);
@@ -17366,16 +17417,20 @@ var ZodType = class {
17366
17417
  };
17367
17418
  var cuidRegex = /^c[^\s-]{8,}$/i;
17368
17419
  var cuid2Regex = /^[0-9a-z]+$/;
17369
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
17420
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
17370
17421
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
17371
17422
  var nanoidRegex = /^[a-z0-9_-]{21}$/i;
17423
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
17372
17424
  var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
17373
17425
  var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
17374
17426
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
17375
17427
  var emojiRegex3;
17376
17428
  var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
17377
- var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
17429
+ var ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
17430
+ var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
17431
+ var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
17378
17432
  var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
17433
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
17379
17434
  var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
17380
17435
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
17381
17436
  function timeRegexSource(args) {
@@ -17408,6 +17463,33 @@ function isValidIP(ip, version2) {
17408
17463
  }
17409
17464
  return false;
17410
17465
  }
17466
+ function isValidJWT(jwt, alg) {
17467
+ if (!jwtRegex.test(jwt))
17468
+ return false;
17469
+ try {
17470
+ const [header] = jwt.split(".");
17471
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
17472
+ const decoded = JSON.parse(atob(base64));
17473
+ if (typeof decoded !== "object" || decoded === null)
17474
+ return false;
17475
+ if (!decoded.typ || !decoded.alg)
17476
+ return false;
17477
+ if (alg && decoded.alg !== alg)
17478
+ return false;
17479
+ return true;
17480
+ } catch (_a2) {
17481
+ return false;
17482
+ }
17483
+ }
17484
+ function isValidCidr(ip, version2) {
17485
+ if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
17486
+ return true;
17487
+ }
17488
+ if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
17489
+ return true;
17490
+ }
17491
+ return false;
17492
+ }
17411
17493
  var ZodString = class _ZodString extends ZodType {
17412
17494
  _parse(input) {
17413
17495
  if (this._def.coerce) {
@@ -17664,6 +17746,26 @@ var ZodString = class _ZodString extends ZodType {
17664
17746
  });
17665
17747
  status.dirty();
17666
17748
  }
17749
+ } else if (check.kind === "jwt") {
17750
+ if (!isValidJWT(input.data, check.alg)) {
17751
+ ctx = this._getOrReturnCtx(input, ctx);
17752
+ addIssueToContext(ctx, {
17753
+ validation: "jwt",
17754
+ code: ZodIssueCode.invalid_string,
17755
+ message: check.message
17756
+ });
17757
+ status.dirty();
17758
+ }
17759
+ } else if (check.kind === "cidr") {
17760
+ if (!isValidCidr(input.data, check.version)) {
17761
+ ctx = this._getOrReturnCtx(input, ctx);
17762
+ addIssueToContext(ctx, {
17763
+ validation: "cidr",
17764
+ code: ZodIssueCode.invalid_string,
17765
+ message: check.message
17766
+ });
17767
+ status.dirty();
17768
+ }
17667
17769
  } else if (check.kind === "base64") {
17668
17770
  if (!base64Regex.test(input.data)) {
17669
17771
  ctx = this._getOrReturnCtx(input, ctx);
@@ -17674,6 +17776,16 @@ var ZodString = class _ZodString extends ZodType {
17674
17776
  });
17675
17777
  status.dirty();
17676
17778
  }
17779
+ } else if (check.kind === "base64url") {
17780
+ if (!base64urlRegex.test(input.data)) {
17781
+ ctx = this._getOrReturnCtx(input, ctx);
17782
+ addIssueToContext(ctx, {
17783
+ validation: "base64url",
17784
+ code: ZodIssueCode.invalid_string,
17785
+ message: check.message
17786
+ });
17787
+ status.dirty();
17788
+ }
17677
17789
  } else {
17678
17790
  util.assertNever(check);
17679
17791
  }
@@ -17720,9 +17832,21 @@ var ZodString = class _ZodString extends ZodType {
17720
17832
  base64(message) {
17721
17833
  return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
17722
17834
  }
17835
+ base64url(message) {
17836
+ return this._addCheck({
17837
+ kind: "base64url",
17838
+ ...errorUtil.errToObj(message)
17839
+ });
17840
+ }
17841
+ jwt(options) {
17842
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
17843
+ }
17723
17844
  ip(options) {
17724
17845
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
17725
17846
  }
17847
+ cidr(options) {
17848
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
17849
+ }
17726
17850
  datetime(options) {
17727
17851
  var _a2, _b;
17728
17852
  if (typeof options === "string") {
@@ -17813,8 +17937,7 @@ var ZodString = class _ZodString extends ZodType {
17813
17937
  });
17814
17938
  }
17815
17939
  /**
17816
- * @deprecated Use z.string().min(1) instead.
17817
- * @see {@link ZodString.min}
17940
+ * Equivalent to `.min(1)`
17818
17941
  */
17819
17942
  nonempty(message) {
17820
17943
  return this.min(1, errorUtil.errToObj(message));
@@ -17876,9 +17999,15 @@ var ZodString = class _ZodString extends ZodType {
17876
17999
  get isIP() {
17877
18000
  return !!this._def.checks.find((ch) => ch.kind === "ip");
17878
18001
  }
18002
+ get isCIDR() {
18003
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
18004
+ }
17879
18005
  get isBase64() {
17880
18006
  return !!this._def.checks.find((ch) => ch.kind === "base64");
17881
18007
  }
18008
+ get isBase64url() {
18009
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
18010
+ }
17882
18011
  get minLength() {
17883
18012
  let min = null;
17884
18013
  for (const ch of this._def.checks) {
@@ -18156,17 +18285,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
18156
18285
  }
18157
18286
  _parse(input) {
18158
18287
  if (this._def.coerce) {
18159
- input.data = BigInt(input.data);
18288
+ try {
18289
+ input.data = BigInt(input.data);
18290
+ } catch (_a2) {
18291
+ return this._getInvalidInput(input);
18292
+ }
18160
18293
  }
18161
18294
  const parsedType = this._getType(input);
18162
18295
  if (parsedType !== ZodParsedType.bigint) {
18163
- const ctx2 = this._getOrReturnCtx(input);
18164
- addIssueToContext(ctx2, {
18165
- code: ZodIssueCode.invalid_type,
18166
- expected: ZodParsedType.bigint,
18167
- received: ctx2.parsedType
18168
- });
18169
- return INVALID;
18296
+ return this._getInvalidInput(input);
18170
18297
  }
18171
18298
  let ctx = void 0;
18172
18299
  const status = new ParseStatus();
@@ -18213,6 +18340,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
18213
18340
  }
18214
18341
  return { status: status.value, value: input.data };
18215
18342
  }
18343
+ _getInvalidInput(input) {
18344
+ const ctx = this._getOrReturnCtx(input);
18345
+ addIssueToContext(ctx, {
18346
+ code: ZodIssueCode.invalid_type,
18347
+ expected: ZodParsedType.bigint,
18348
+ received: ctx.parsedType
18349
+ });
18350
+ return INVALID;
18351
+ }
18216
18352
  gte(value2, message) {
18217
18353
  return this.setLimit("min", value2, true, errorUtil.toString(message));
18218
18354
  }
@@ -22147,20 +22283,18 @@ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, { tar
22147
22283
  terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
22148
22284
 
22149
22285
  // ../cli-ui-kit/src/components/Link.tsx
22150
- var Link = ({
22151
- skin,
22152
- children,
22153
- url,
22154
- transform = (v) => v
22155
- }) => {
22286
+ var Link = ({ skin, children, url }) => {
22156
22287
  if (children) {
22157
- return /* @__PURE__ */ import_react55.default.createElement(
22158
- Transform,
22159
- {
22160
- transform: (children2) => transform(terminalLink(children2, url, { fallback: true }))
22161
- },
22162
- /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children)
22163
- );
22288
+ if (terminalLink.isSupported) {
22289
+ return /* @__PURE__ */ import_react55.default.createElement(
22290
+ Transform,
22291
+ {
22292
+ transform: (childrenAsString) => terminalLink(childrenAsString, url, { fallback: false })
22293
+ },
22294
+ /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children)
22295
+ );
22296
+ }
22297
+ return /* @__PURE__ */ import_react55.default.createElement(Text2, null, /* @__PURE__ */ import_react55.default.createElement(Text2, { skin }, children), " (", url, ")");
22164
22298
  }
22165
22299
  return /* @__PURE__ */ import_react55.default.createElement(Text2, { skin: "info" }, url);
22166
22300
  };
@@ -22608,24 +22742,27 @@ var html_parse_stringify_module_default = c;
22608
22742
 
22609
22743
  // ../../node_modules/react-i18next/dist/es/utils.js
22610
22744
  init_esm_shims();
22611
- function warn() {
22612
- if (console && console.warn) {
22613
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22614
- args[_key] = arguments[_key];
22615
- }
22616
- if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
22745
+ var warn = (i18n, code, msg, rest) => {
22746
+ const args = [msg, {
22747
+ code,
22748
+ ...rest || {}
22749
+ }];
22750
+ if (i18n?.services?.logger?.forward) {
22751
+ return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
22752
+ }
22753
+ if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
22754
+ if (i18n?.services?.logger?.warn) {
22755
+ i18n.services.logger.warn(...args);
22756
+ } else if (console?.warn) {
22617
22757
  console.warn(...args);
22618
22758
  }
22619
- }
22759
+ };
22620
22760
  var alreadyWarned = {};
22621
- function warnOnce() {
22622
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
22623
- args[_key2] = arguments[_key2];
22624
- }
22625
- if (isString(args[0]) && alreadyWarned[args[0]]) return;
22626
- if (isString(args[0])) alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
22627
- warn(...args);
22628
- }
22761
+ var warnOnce = (i18n, code, msg, rest) => {
22762
+ if (isString(msg) && alreadyWarned[msg]) return;
22763
+ if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
22764
+ warn(i18n, code, msg, rest);
22765
+ };
22629
22766
  var loadedClb = (i18n, cb) => () => {
22630
22767
  if (i18n.isInitialized) {
22631
22768
  cb();
@@ -22644,41 +22781,23 @@ var loadNamespaces = (i18n, ns, cb) => {
22644
22781
  };
22645
22782
  var loadLanguages = (i18n, lng, ns, cb) => {
22646
22783
  if (isString(ns)) ns = [ns];
22784
+ if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
22647
22785
  ns.forEach((n2) => {
22648
22786
  if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2);
22649
22787
  });
22650
22788
  i18n.loadLanguages(lng, loadedClb(i18n, cb));
22651
22789
  };
22652
- var oldI18nextHasLoadedNamespace = function(ns, i18n) {
22653
- let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
22654
- const lng = i18n.languages[0];
22655
- const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
22656
- const lastLng = i18n.languages[i18n.languages.length - 1];
22657
- if (lng.toLowerCase() === "cimode") return true;
22658
- const loadNotPending = (l, n2) => {
22659
- const loadState = i18n.services.backendConnector.state[`${l}|${n2}`];
22660
- return loadState === -1 || loadState === 2;
22661
- };
22662
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
22663
- if (i18n.hasResourceBundle(lng, ns)) return true;
22664
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
22665
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
22666
- return false;
22667
- };
22668
- var hasLoadedNamespace = function(ns, i18n) {
22669
- let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
22790
+ var hasLoadedNamespace = (ns, i18n, options = {}) => {
22670
22791
  if (!i18n.languages || !i18n.languages.length) {
22671
- warnOnce("i18n.languages were undefined or empty", i18n.languages);
22792
+ warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
22793
+ languages: i18n.languages
22794
+ });
22672
22795
  return true;
22673
22796
  }
22674
- const isNewerI18next = i18n.options.ignoreJSONStructure !== void 0;
22675
- if (!isNewerI18next) {
22676
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
22677
- }
22678
22797
  return i18n.hasLoadedNamespace(ns, {
22679
22798
  lng: options.lng,
22680
22799
  precheck: (i18nInstance2, loadNotPending) => {
22681
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
22800
+ if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
22682
22801
  }
22683
22802
  });
22684
22803
  };
@@ -22727,8 +22846,7 @@ var defaultOptions = {
22727
22846
  useSuspense: true,
22728
22847
  unescape
22729
22848
  };
22730
- var setDefaults = function() {
22731
- let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
22849
+ var setDefaults = (options = {}) => {
22732
22850
  defaultOptions = {
22733
22851
  ...defaultOptions,
22734
22852
  ...options
@@ -22747,14 +22865,14 @@ var getI18n = () => i18nInstance;
22747
22865
  // ../../node_modules/react-i18next/dist/es/TransWithoutContext.js
22748
22866
  var hasChildren = (node, checkLength) => {
22749
22867
  if (!node) return false;
22750
- const base = node.props ? node.props.children : node.children;
22868
+ const base = node.props?.children ?? node.children;
22751
22869
  if (checkLength) return base.length > 0;
22752
22870
  return !!base;
22753
22871
  };
22754
22872
  var getChildren = (node) => {
22755
22873
  if (!node) return [];
22756
- const children = node.props ? node.props.children : node.children;
22757
- return node.props && node.props.i18nIsDynamicList ? getAsArray(children) : children;
22874
+ const children = node.props?.children ?? node.children;
22875
+ return node.props?.i18nIsDynamicList ? getAsArray(children) : children;
22758
22876
  };
22759
22877
  var hasValidReactChildren = (children) => Array.isArray(children) && children.every(import_react62.isValidElement);
22760
22878
  var getAsArray = (data) => Array.isArray(data) ? data : [data];
@@ -22765,15 +22883,17 @@ var mergeProps = (source, target) => {
22765
22883
  newTarget.props = Object.assign(source.props, target.props);
22766
22884
  return newTarget;
22767
22885
  };
22768
- var nodesToString = (children, i18nOptions) => {
22886
+ var nodesToString = (children, i18nOptions, i18n, i18nKey) => {
22769
22887
  if (!children) return "";
22770
22888
  let stringNode = "";
22771
22889
  const childrenArray = getAsArray(children);
22772
- const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
22890
+ const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];
22773
22891
  childrenArray.forEach((child, childIndex) => {
22774
22892
  if (isString(child)) {
22775
22893
  stringNode += `${child}`;
22776
- } else if ((0, import_react62.isValidElement)(child)) {
22894
+ return;
22895
+ }
22896
+ if ((0, import_react62.isValidElement)(child)) {
22777
22897
  const {
22778
22898
  props,
22779
22899
  type
@@ -22783,17 +22903,27 @@ var nodesToString = (children, i18nOptions) => {
22783
22903
  const childChildren = props.children;
22784
22904
  if (!childChildren && shouldKeepChild && !childPropsCount) {
22785
22905
  stringNode += `<${type}/>`;
22786
- } else if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
22906
+ return;
22907
+ }
22908
+ if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
22787
22909
  stringNode += `<${childIndex}></${childIndex}>`;
22788
- } else if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {
22910
+ return;
22911
+ }
22912
+ if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {
22789
22913
  stringNode += `<${type}>${childChildren}</${type}>`;
22790
- } else {
22791
- const content = nodesToString(childChildren, i18nOptions);
22792
- stringNode += `<${childIndex}>${content}</${childIndex}>`;
22914
+ return;
22793
22915
  }
22794
- } else if (child === null) {
22795
- warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);
22796
- } else if (isObject(child)) {
22916
+ const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);
22917
+ stringNode += `<${childIndex}>${content}</${childIndex}>`;
22918
+ return;
22919
+ }
22920
+ if (child === null) {
22921
+ warn(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, {
22922
+ i18nKey
22923
+ });
22924
+ return;
22925
+ }
22926
+ if (isObject(child)) {
22797
22927
  const {
22798
22928
  format,
22799
22929
  ...clone
@@ -22802,12 +22932,18 @@ var nodesToString = (children, i18nOptions) => {
22802
22932
  if (keys.length === 1) {
22803
22933
  const value2 = format ? `${keys[0]}, ${format}` : keys[0];
22804
22934
  stringNode += `{{${value2}}}`;
22805
- } else {
22806
- warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);
22935
+ return;
22807
22936
  }
22808
- } else {
22809
- warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child);
22937
+ warn(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {
22938
+ i18nKey,
22939
+ child
22940
+ });
22941
+ return;
22810
22942
  }
22943
+ warn(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {
22944
+ i18nKey,
22945
+ child
22946
+ });
22811
22947
  });
22812
22948
  return stringNode;
22813
22949
  };
@@ -22834,7 +22970,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22834
22970
  const renderInner = (child, node, rootReactNode) => {
22835
22971
  const childs = getChildren(child);
22836
22972
  const mappedChildren = mapAST(childs, node.children, rootReactNode);
22837
- return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props && child.props.i18nIsDynamicList ? childs : mappedChildren;
22973
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren;
22838
22974
  };
22839
22975
  const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => {
22840
22976
  if (child.dummy) {
@@ -22860,7 +22996,7 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22860
22996
  const reactNodes = getAsArray(reactNode);
22861
22997
  const astNodes = getAsArray(astNode);
22862
22998
  return astNodes.reduce((mem, node, i2) => {
22863
- const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
22999
+ const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
22864
23000
  if (node.type === "tag") {
22865
23001
  let tmp = reactNodes[parseInt(node.name, 10)];
22866
23002
  if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];
@@ -22928,42 +23064,79 @@ var renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, sho
22928
23064
  }], ast, getAsArray(children || []));
22929
23065
  return getChildren(result[0]);
22930
23066
  };
22931
- function Trans(_ref) {
22932
- let {
22933
- children,
22934
- count,
22935
- parent,
22936
- i18nKey,
22937
- context,
22938
- tOptions = {},
22939
- values,
22940
- defaults: defaults2,
22941
- components,
22942
- ns,
22943
- i18n: i18nFromProps,
22944
- t: tFromProps,
22945
- shouldUnescape,
22946
- ...additionalProps
22947
- } = _ref;
23067
+ var fixComponentProps = (component, index, translation) => {
23068
+ const componentKey = component.key || index;
23069
+ const comp = (0, import_react62.cloneElement)(component, {
23070
+ key: componentKey
23071
+ });
23072
+ if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {
23073
+ return comp;
23074
+ }
23075
+ function Componentized() {
23076
+ return (0, import_react62.createElement)(import_react62.Fragment, null, comp);
23077
+ }
23078
+ return (0, import_react62.createElement)(Componentized);
23079
+ };
23080
+ var generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
23081
+ var generateObjectComponents = (components, translation) => {
23082
+ const componentMap = {};
23083
+ Object.keys(components).forEach((c2) => {
23084
+ Object.assign(componentMap, {
23085
+ [c2]: fixComponentProps(components[c2], c2, translation)
23086
+ });
23087
+ });
23088
+ return componentMap;
23089
+ };
23090
+ var generateComponents = (components, translation, i18n, i18nKey) => {
23091
+ if (!components) return null;
23092
+ if (Array.isArray(components)) {
23093
+ return generateArrayComponents(components, translation);
23094
+ }
23095
+ if (isObject(components)) {
23096
+ return generateObjectComponents(components, translation);
23097
+ }
23098
+ warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, {
23099
+ i18nKey
23100
+ });
23101
+ return null;
23102
+ };
23103
+ function Trans({
23104
+ children,
23105
+ count,
23106
+ parent,
23107
+ i18nKey,
23108
+ context,
23109
+ tOptions = {},
23110
+ values,
23111
+ defaults: defaults2,
23112
+ components,
23113
+ ns,
23114
+ i18n: i18nFromProps,
23115
+ t: tFromProps,
23116
+ shouldUnescape,
23117
+ ...additionalProps
23118
+ }) {
22948
23119
  const i18n = i18nFromProps || getI18n();
22949
23120
  if (!i18n) {
22950
- warnOnce("You will need to pass in an i18next instance by using i18nextReactModule");
23121
+ warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, {
23122
+ i18nKey
23123
+ });
22951
23124
  return children;
22952
23125
  }
22953
23126
  const t3 = tFromProps || i18n.t.bind(i18n) || ((k) => k);
22954
23127
  const reactI18nextOptions = {
22955
23128
  ...getDefaults(),
22956
- ...i18n.options && i18n.options.react
23129
+ ...i18n.options?.react
22957
23130
  };
22958
- let namespaces = ns || t3.ns || i18n.options && i18n.options.defaultNS;
23131
+ let namespaces = ns || t3.ns || i18n.options?.defaultNS;
22959
23132
  namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
22960
- const nodeAsString = nodesToString(children, reactI18nextOptions);
23133
+ const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);
22961
23134
  const defaultValue = defaults2 || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;
22962
23135
  const {
22963
23136
  hashTransKey
22964
23137
  } = reactI18nextOptions;
22965
23138
  const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);
22966
- if (i18n.options && i18n.options.interpolation && i18n.options.interpolation.defaultVariables) {
23139
+ if (i18n.options?.interpolation?.defaultVariables) {
22967
23140
  values = values && Object.keys(values).length > 0 ? {
22968
23141
  ...values,
22969
23142
  ...i18n.options.interpolation.defaultVariables
@@ -22971,7 +23144,7 @@ function Trans(_ref) {
22971
23144
  ...i18n.options.interpolation.defaultVariables
22972
23145
  };
22973
23146
  }
22974
- const interpolationOverride = values || count !== void 0 || !children ? tOptions.interpolation : {
23147
+ const interpolationOverride = values || count !== void 0 && !i18n.options?.interpolation?.alwaysFormat || !children ? tOptions.interpolation : {
22975
23148
  interpolation: {
22976
23149
  ...tOptions.interpolation,
22977
23150
  prefix: "#$?",
@@ -22988,18 +23161,9 @@ function Trans(_ref) {
22988
23161
  ns: namespaces
22989
23162
  };
22990
23163
  const translation = key ? t3(key, combinedTOpts) : defaultValue;
22991
- if (components) {
22992
- Object.keys(components).forEach((c2) => {
22993
- const comp = components[c2];
22994
- if (typeof comp.type === "function" || !comp.props || !comp.props.children || translation.indexOf(`${c2}/>`) < 0 && translation.indexOf(`${c2} />`) < 0) return;
22995
- function Componentized() {
22996
- return (0, import_react62.createElement)(import_react62.Fragment, null, comp);
22997
- }
22998
- components[c2] = (0, import_react62.createElement)(Componentized);
22999
- });
23000
- }
23001
- const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
23002
- const useAsParent = parent !== void 0 ? parent : reactI18nextOptions.defaultTransParent;
23164
+ const generatedComponents = generateComponents(components, translation, i18n, i18nKey);
23165
+ const content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
23166
+ const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;
23003
23167
  return useAsParent ? (0, import_react62.createElement)(useAsParent, additionalProps, content) : content;
23004
23168
  }
23005
23169
 
@@ -23028,33 +23192,34 @@ var ReportNamespaces = class {
23028
23192
  if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
23029
23193
  });
23030
23194
  }
23031
- getUsedNamespaces = () => Object.keys(this.usedNamespaces);
23195
+ getUsedNamespaces() {
23196
+ return Object.keys(this.usedNamespaces);
23197
+ }
23032
23198
  };
23033
23199
 
23034
23200
  // ../../node_modules/react-i18next/dist/es/Trans.js
23035
- function Trans2(_ref) {
23036
- let {
23037
- children,
23038
- count,
23039
- parent,
23040
- i18nKey,
23041
- context,
23042
- tOptions = {},
23043
- values,
23044
- defaults: defaults2,
23045
- components,
23046
- ns,
23047
- i18n: i18nFromProps,
23048
- t: tFromProps,
23049
- shouldUnescape,
23050
- ...additionalProps
23051
- } = _ref;
23201
+ function Trans2({
23202
+ children,
23203
+ count,
23204
+ parent,
23205
+ i18nKey,
23206
+ context,
23207
+ tOptions = {},
23208
+ values,
23209
+ defaults: defaults2,
23210
+ components,
23211
+ ns,
23212
+ i18n: i18nFromProps,
23213
+ t: tFromProps,
23214
+ shouldUnescape,
23215
+ ...additionalProps
23216
+ }) {
23052
23217
  const {
23053
23218
  i18n: i18nFromContext,
23054
23219
  defaultNS: defaultNSFromContext
23055
23220
  } = (0, import_react64.useContext)(I18nContext) || {};
23056
23221
  const i18n = i18nFromProps || i18nFromContext || getI18n();
23057
- const t3 = tFromProps || i18n && i18n.t.bind(i18n);
23222
+ const t3 = tFromProps || i18n?.t.bind(i18n);
23058
23223
  return Trans({
23059
23224
  children,
23060
23225
  count,
@@ -23065,7 +23230,7 @@ function Trans2(_ref) {
23065
23230
  values,
23066
23231
  defaults: defaults2,
23067
23232
  components,
23068
- ns: ns || t3 && t3.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
23233
+ ns: ns || t3?.ns || defaultNSFromContext || i18n?.options?.defaultNS,
23069
23234
  i18n,
23070
23235
  t: tFromProps,
23071
23236
  shouldUnescape,
@@ -23085,8 +23250,7 @@ var usePrevious = (value2, ignore) => {
23085
23250
  };
23086
23251
  var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
23087
23252
  var useMemoizedT = (i18n, language, namespace, keyPrefix) => (0, import_react65.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
23088
- var useTranslation = function(ns) {
23089
- let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23253
+ var useTranslation = (ns, props = {}) => {
23090
23254
  const {
23091
23255
  i18n: i18nFromProps
23092
23256
  } = props;
@@ -23097,7 +23261,7 @@ var useTranslation = function(ns) {
23097
23261
  const i18n = i18nFromProps || i18nFromContext || getI18n();
23098
23262
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
23099
23263
  if (!i18n) {
23100
- warnOnce("You will need to pass in an i18next instance by using initReactI18next");
23264
+ warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
23101
23265
  const notReadyT = (k, optsOrDefaultValue) => {
23102
23266
  if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
23103
23267
  if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
@@ -23109,7 +23273,7 @@ var useTranslation = function(ns) {
23109
23273
  retNotReady.ready = false;
23110
23274
  return retNotReady;
23111
23275
  }
23112
- if (i18n.options.react && i18n.options.react.wait !== void 0) warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
23276
+ if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
23113
23277
  const i18nOptions = {
23114
23278
  ...getDefaults(),
23115
23279
  ...i18n.options.react,
@@ -23119,9 +23283,9 @@ var useTranslation = function(ns) {
23119
23283
  useSuspense,
23120
23284
  keyPrefix
23121
23285
  } = i18nOptions;
23122
- let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
23286
+ let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
23123
23287
  namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
23124
- if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
23288
+ i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
23125
23289
  const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions));
23126
23290
  const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
23127
23291
  const getT = () => memoGetT;
@@ -23154,11 +23318,11 @@ var useTranslation = function(ns) {
23154
23318
  const boundReset = () => {
23155
23319
  if (isMounted.current) setT(getNewT);
23156
23320
  };
23157
- if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
23158
- if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
23321
+ if (bindI18n) i18n?.on(bindI18n, boundReset);
23322
+ if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
23159
23323
  return () => {
23160
23324
  isMounted.current = false;
23161
- if (bindI18n && i18n) bindI18n.split(" ").forEach((e2) => i18n.off(e2, boundReset));
23325
+ if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
23162
23326
  if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
23163
23327
  };
23164
23328
  }, [i18n, joinedNS]);
@@ -23192,12 +23356,11 @@ init_esm_shims();
23192
23356
  // ../../node_modules/react-i18next/dist/es/I18nextProvider.js
23193
23357
  init_esm_shims();
23194
23358
  var import_react67 = __toESM(require_react(), 1);
23195
- function I18nextProvider(_ref) {
23196
- let {
23197
- i18n,
23198
- defaultNS,
23199
- children
23200
- } = _ref;
23359
+ function I18nextProvider({
23360
+ i18n,
23361
+ defaultNS,
23362
+ children
23363
+ }) {
23201
23364
  const value2 = (0, import_react67.useMemo)(() => ({
23202
23365
  i18n,
23203
23366
  defaultNS
@@ -26800,7 +26963,7 @@ var setPath2 = (object, path, newValue) => {
26800
26963
  e2 = `${p[p.length - 1]}.${e2}`;
26801
26964
  p = p.slice(0, p.length - 1);
26802
26965
  last = getLastOfPath2(object, p, Object);
26803
- if (last && last.obj && typeof last.obj[`${last.k}.${e2}`] !== "undefined") {
26966
+ if (last?.obj && typeof last.obj[`${last.k}.${e2}`] !== "undefined") {
26804
26967
  last.obj = void 0;
26805
26968
  }
26806
26969
  }
@@ -26820,6 +26983,7 @@ var getPath2 = (object, path) => {
26820
26983
  k
26821
26984
  } = getLastOfPath2(object, path);
26822
26985
  if (!obj) return void 0;
26986
+ if (!Object.prototype.hasOwnProperty.call(obj, k)) return void 0;
26823
26987
  return obj[k];
26824
26988
  };
26825
26989
  var getPathWithDefaults = (data, defaultData, key) => {
@@ -26900,7 +27064,10 @@ var looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
26900
27064
  var deepFind = function(obj, path) {
26901
27065
  let keySeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
26902
27066
  if (!obj) return void 0;
26903
- if (obj[path]) return obj[path];
27067
+ if (obj[path]) {
27068
+ if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0;
27069
+ return obj[path];
27070
+ }
26904
27071
  const tokens = path.split(keySeparator);
26905
27072
  let current = obj;
26906
27073
  for (let i2 = 0; i2 < tokens.length; ) {
@@ -26927,7 +27094,7 @@ var deepFind = function(obj, path) {
26927
27094
  }
26928
27095
  return current;
26929
27096
  };
26930
- var getCleanedCode = (code) => code && code.replace("_", "-");
27097
+ var getCleanedCode = (code) => code?.replace("_", "-");
26931
27098
  var consoleLogger = {
26932
27099
  type: "logger",
26933
27100
  log(args) {
@@ -26940,7 +27107,7 @@ var consoleLogger = {
26940
27107
  this.output("error", args);
26941
27108
  },
26942
27109
  output(type, args) {
26943
- if (console && console[type]) console[type].apply(console, args);
27110
+ console?.[type]?.apply?.(console, args);
26944
27111
  }
26945
27112
  };
26946
27113
  var Logger = class _Logger {
@@ -27096,7 +27263,7 @@ var ResourceStore = class extends EventEmitter2 {
27096
27263
  key = path.slice(2).join(".");
27097
27264
  }
27098
27265
  if (result || !ignoreJSONStructure || !isString2(key)) return result;
27099
- return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
27266
+ return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
27100
27267
  }
27101
27268
  addResource(lng, ns, key, value2) {
27102
27269
  let options = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
@@ -27163,10 +27330,6 @@ var ResourceStore = class extends EventEmitter2 {
27163
27330
  }
27164
27331
  getResourceBundle(lng, ns) {
27165
27332
  if (!ns) ns = this.options.defaultNS;
27166
- if (this.options.compatibilityAPI === "v1") return {
27167
- ...{},
27168
- ...this.getResource(lng, ns)
27169
- };
27170
27333
  return this.getResource(lng, ns);
27171
27334
  }
27172
27335
  getDataByLanguage(lng) {
@@ -27188,7 +27351,7 @@ var postProcessor = {
27188
27351
  },
27189
27352
  handle(processors, value2, key, options, translator) {
27190
27353
  processors.forEach((processor) => {
27191
- if (this.processors[processor]) value2 = this.processors[processor].process(value2, key, options, translator);
27354
+ value2 = this.processors[processor]?.process(value2, key, options, translator) ?? value2;
27192
27355
  });
27193
27356
  return value2;
27194
27357
  }
@@ -27212,11 +27375,11 @@ var Translator = class _Translator extends EventEmitter2 {
27212
27375
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
27213
27376
  interpolation: {}
27214
27377
  };
27215
- if (key === void 0 || key === null) {
27378
+ if (key == null) {
27216
27379
  return false;
27217
27380
  }
27218
27381
  const resolved = this.resolve(key, options);
27219
- return resolved && resolved.res !== void 0;
27382
+ return resolved?.res !== void 0;
27220
27383
  }
27221
27384
  extractFromKey(key, options) {
27222
27385
  let nsSeparator = options.nsSeparator !== void 0 ? options.nsSeparator : this.options.nsSeparator;
@@ -27250,7 +27413,7 @@ var Translator = class _Translator extends EventEmitter2 {
27250
27413
  ...options
27251
27414
  };
27252
27415
  if (!options) options = {};
27253
- if (keys === void 0 || keys === null) return "";
27416
+ if (keys == null) return "";
27254
27417
  if (!Array.isArray(keys)) keys = [String(keys)];
27255
27418
  const returnDetails = options.returnDetails !== void 0 ? options.returnDetails : this.options.returnDetails;
27256
27419
  const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
@@ -27261,7 +27424,7 @@ var Translator = class _Translator extends EventEmitter2 {
27261
27424
  const namespace = namespaces[namespaces.length - 1];
27262
27425
  const lng = options.lng || this.language;
27263
27426
  const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
27264
- if (lng && lng.toLowerCase() === "cimode") {
27427
+ if (lng?.toLowerCase() === "cimode") {
27265
27428
  if (appendNamespaceToCIMode) {
27266
27429
  const nsSeparator = options.nsSeparator || this.options.nsSeparator;
27267
27430
  if (returnDetails) {
@@ -27289,9 +27452,9 @@ var Translator = class _Translator extends EventEmitter2 {
27289
27452
  return key;
27290
27453
  }
27291
27454
  const resolved = this.resolve(keys, options);
27292
- let res = resolved && resolved.res;
27293
- const resUsedKey = resolved && resolved.usedKey || key;
27294
- const resExactUsedKey = resolved && resolved.exactUsedKey || key;
27455
+ let res = resolved?.res;
27456
+ const resUsedKey = resolved?.usedKey || key;
27457
+ const resExactUsedKey = resolved?.exactUsedKey || key;
27295
27458
  const resType = Object.prototype.toString.apply(res);
27296
27459
  const noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
27297
27460
  const joinArrays = options.joinArrays !== void 0 ? options.joinArrays : this.options.joinArrays;
@@ -27344,7 +27507,7 @@ var Translator = class _Translator extends EventEmitter2 {
27344
27507
  const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
27345
27508
  ordinal: false
27346
27509
  }) : "";
27347
- const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
27510
+ const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
27348
27511
  const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;
27349
27512
  if (!this.isValidLookup(res) && hasDefaultValue) {
27350
27513
  usedDefault = true;
@@ -27381,7 +27544,7 @@ var Translator = class _Translator extends EventEmitter2 {
27381
27544
  const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
27382
27545
  if (this.options.missingKeyHandler) {
27383
27546
  this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
27384
- } else if (this.backendConnector && this.backendConnector.saveMissing) {
27547
+ } else if (this.backendConnector?.saveMissing) {
27385
27548
  this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
27386
27549
  }
27387
27550
  this.emit("missingKey", l, namespace, k, res);
@@ -27405,11 +27568,7 @@ var Translator = class _Translator extends EventEmitter2 {
27405
27568
  res = this.extendTranslation(res, keys, options, resolved, lastKey);
27406
27569
  if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
27407
27570
  if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
27408
- if (this.options.compatibilityAPI !== "v1") {
27409
- res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : void 0);
27410
- } else {
27411
- res = this.options.parseMissingKeyHandler(res);
27412
- }
27571
+ res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : void 0);
27413
27572
  }
27414
27573
  }
27415
27574
  if (returnDetails) {
@@ -27421,7 +27580,7 @@ var Translator = class _Translator extends EventEmitter2 {
27421
27580
  }
27422
27581
  extendTranslation(res, key, options, resolved, lastKey) {
27423
27582
  var _this = this;
27424
- if (this.i18nFormat && this.i18nFormat.parse) {
27583
+ if (this.i18nFormat?.parse) {
27425
27584
  res = this.i18nFormat.parse(res, {
27426
27585
  ...this.options.interpolation.defaultVariables,
27427
27586
  ...options
@@ -27438,7 +27597,7 @@ var Translator = class _Translator extends EventEmitter2 {
27438
27597
  }
27439
27598
  }
27440
27599
  });
27441
- const skipOnVariables = isString2(res) && (options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
27600
+ const skipOnVariables = isString2(res) && (options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
27442
27601
  let nestBef;
27443
27602
  if (skipOnVariables) {
27444
27603
  const nb = res.match(this.interpolator.nestingRegexp);
@@ -27455,12 +27614,12 @@ var Translator = class _Translator extends EventEmitter2 {
27455
27614
  const nestAft = na && na.length;
27456
27615
  if (nestBef < nestAft) options.nest = false;
27457
27616
  }
27458
- if (!options.lng && this.options.compatibilityAPI !== "v1" && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
27617
+ if (!options.lng && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
27459
27618
  if (options.nest !== false) res = this.interpolator.nest(res, function() {
27460
27619
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27461
27620
  args[_key] = arguments[_key];
27462
27621
  }
27463
- if (lastKey && lastKey[0] === args[0] && !options.context) {
27622
+ if (lastKey?.[0] === args[0] && !options.context) {
27464
27623
  _this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
27465
27624
  return null;
27466
27625
  }
@@ -27470,7 +27629,7 @@ var Translator = class _Translator extends EventEmitter2 {
27470
27629
  }
27471
27630
  const postProcess = options.postProcess || this.options.postProcess;
27472
27631
  const postProcessorNames = isString2(postProcess) ? [postProcess] : postProcess;
27473
- if (res !== void 0 && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
27632
+ if (res != null && postProcessorNames?.length && options.applyPostProcessor !== false) {
27474
27633
  res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
27475
27634
  i18nResolved: {
27476
27635
  ...resolved,
@@ -27497,13 +27656,13 @@ var Translator = class _Translator extends EventEmitter2 {
27497
27656
  let namespaces = extracted.namespaces;
27498
27657
  if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
27499
27658
  const needsPluralHandling = options.count !== void 0 && !isString2(options.count);
27500
- const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();
27659
+ const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
27501
27660
  const needsContextHandling = options.context !== void 0 && (isString2(options.context) || typeof options.context === "number") && options.context !== "";
27502
27661
  const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
27503
27662
  namespaces.forEach((ns) => {
27504
27663
  if (this.isValidLookup(found)) return;
27505
27664
  usedNS = ns;
27506
- if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(usedNS)) {
27665
+ if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
27507
27666
  checkedLoadedFor[`${codes[0]}-${ns}`] = true;
27508
27667
  this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
27509
27668
  }
@@ -27511,7 +27670,7 @@ var Translator = class _Translator extends EventEmitter2 {
27511
27670
  if (this.isValidLookup(found)) return;
27512
27671
  usedLng = code;
27513
27672
  const finalKeys = [key];
27514
- if (this.i18nFormat && this.i18nFormat.addLookupKeys) {
27673
+ if (this.i18nFormat?.addLookupKeys) {
27515
27674
  this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
27516
27675
  } else {
27517
27676
  let pluralSuffix;
@@ -27564,7 +27723,7 @@ var Translator = class _Translator extends EventEmitter2 {
27564
27723
  }
27565
27724
  getResource(code, ns, key) {
27566
27725
  let options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
27567
- if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);
27726
+ if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
27568
27727
  return this.resourceStore.getResource(code, ns, key, options);
27569
27728
  }
27570
27729
  getUsedParamsDetails() {
@@ -27601,7 +27760,6 @@ var Translator = class _Translator extends EventEmitter2 {
27601
27760
  return false;
27602
27761
  }
27603
27762
  };
27604
- var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
27605
27763
  var LanguageUtil = class {
27606
27764
  constructor(options) {
27607
27765
  this.options = options;
@@ -27625,32 +27783,19 @@ var LanguageUtil = class {
27625
27783
  }
27626
27784
  formatLanguageCode(code) {
27627
27785
  if (isString2(code) && code.indexOf("-") > -1) {
27628
- if (typeof Intl !== "undefined" && typeof Intl.getCanonicalLocales !== "undefined") {
27629
- try {
27630
- let formattedCode = Intl.getCanonicalLocales(code)[0];
27631
- if (formattedCode && this.options.lowerCaseLng) {
27632
- formattedCode = formattedCode.toLowerCase();
27633
- }
27634
- if (formattedCode) return formattedCode;
27635
- } catch (e2) {
27636
- }
27786
+ let formattedCode;
27787
+ try {
27788
+ formattedCode = Intl.getCanonicalLocales(code)[0];
27789
+ } catch (e2) {
27790
+ }
27791
+ if (formattedCode && this.options.lowerCaseLng) {
27792
+ formattedCode = formattedCode.toLowerCase();
27637
27793
  }
27638
- const specialCases = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
27639
- let p = code.split("-");
27794
+ if (formattedCode) return formattedCode;
27640
27795
  if (this.options.lowerCaseLng) {
27641
- p = p.map((part) => part.toLowerCase());
27642
- } else if (p.length === 2) {
27643
- p[0] = p[0].toLowerCase();
27644
- p[1] = p[1].toUpperCase();
27645
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
27646
- } else if (p.length === 3) {
27647
- p[0] = p[0].toLowerCase();
27648
- if (p[1].length === 2) p[1] = p[1].toUpperCase();
27649
- if (p[0] !== "sgn" && p[2].length === 2) p[2] = p[2].toUpperCase();
27650
- if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
27651
- if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
27652
- }
27653
- return p.join("-");
27796
+ return code.toLowerCase();
27797
+ }
27798
+ return code;
27654
27799
  }
27655
27800
  return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
27656
27801
  }
@@ -27721,125 +27866,6 @@ var LanguageUtil = class {
27721
27866
  return codes;
27722
27867
  }
27723
27868
  };
27724
- var sets = [{
27725
- lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
27726
- nr: [1, 2],
27727
- fc: 1
27728
- }, {
27729
- lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
27730
- nr: [1, 2],
27731
- fc: 2
27732
- }, {
27733
- lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
27734
- nr: [1],
27735
- fc: 3
27736
- }, {
27737
- lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
27738
- nr: [1, 2, 5],
27739
- fc: 4
27740
- }, {
27741
- lngs: ["ar"],
27742
- nr: [0, 1, 2, 3, 11, 100],
27743
- fc: 5
27744
- }, {
27745
- lngs: ["cs", "sk"],
27746
- nr: [1, 2, 5],
27747
- fc: 6
27748
- }, {
27749
- lngs: ["csb", "pl"],
27750
- nr: [1, 2, 5],
27751
- fc: 7
27752
- }, {
27753
- lngs: ["cy"],
27754
- nr: [1, 2, 3, 8],
27755
- fc: 8
27756
- }, {
27757
- lngs: ["fr"],
27758
- nr: [1, 2],
27759
- fc: 9
27760
- }, {
27761
- lngs: ["ga"],
27762
- nr: [1, 2, 3, 7, 11],
27763
- fc: 10
27764
- }, {
27765
- lngs: ["gd"],
27766
- nr: [1, 2, 3, 20],
27767
- fc: 11
27768
- }, {
27769
- lngs: ["is"],
27770
- nr: [1, 2],
27771
- fc: 12
27772
- }, {
27773
- lngs: ["jv"],
27774
- nr: [0, 1],
27775
- fc: 13
27776
- }, {
27777
- lngs: ["kw"],
27778
- nr: [1, 2, 3, 4],
27779
- fc: 14
27780
- }, {
27781
- lngs: ["lt"],
27782
- nr: [1, 2, 10],
27783
- fc: 15
27784
- }, {
27785
- lngs: ["lv"],
27786
- nr: [1, 2, 0],
27787
- fc: 16
27788
- }, {
27789
- lngs: ["mk"],
27790
- nr: [1, 2],
27791
- fc: 17
27792
- }, {
27793
- lngs: ["mnk"],
27794
- nr: [0, 1, 2],
27795
- fc: 18
27796
- }, {
27797
- lngs: ["mt"],
27798
- nr: [1, 2, 11, 20],
27799
- fc: 19
27800
- }, {
27801
- lngs: ["or"],
27802
- nr: [2, 1],
27803
- fc: 2
27804
- }, {
27805
- lngs: ["ro"],
27806
- nr: [1, 2, 20],
27807
- fc: 20
27808
- }, {
27809
- lngs: ["sl"],
27810
- nr: [5, 1, 2, 3],
27811
- fc: 21
27812
- }, {
27813
- lngs: ["he", "iw"],
27814
- nr: [1, 2, 20, 21],
27815
- fc: 22
27816
- }];
27817
- var _rulesPluralsTypes = {
27818
- 1: (n2) => Number(n2 > 1),
27819
- 2: (n2) => Number(n2 != 1),
27820
- 3: (n2) => 0,
27821
- 4: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27822
- 5: (n2) => Number(n2 == 0 ? 0 : n2 == 1 ? 1 : n2 == 2 ? 2 : n2 % 100 >= 3 && n2 % 100 <= 10 ? 3 : n2 % 100 >= 11 ? 4 : 5),
27823
- 6: (n2) => Number(n2 == 1 ? 0 : n2 >= 2 && n2 <= 4 ? 1 : 2),
27824
- 7: (n2) => Number(n2 == 1 ? 0 : n2 % 10 >= 2 && n2 % 10 <= 4 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27825
- 8: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 != 8 && n2 != 11 ? 2 : 3),
27826
- 9: (n2) => Number(n2 >= 2),
27827
- 10: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 < 7 ? 2 : n2 < 11 ? 3 : 4),
27828
- 11: (n2) => Number(n2 == 1 || n2 == 11 ? 0 : n2 == 2 || n2 == 12 ? 1 : n2 > 2 && n2 < 20 ? 2 : 3),
27829
- 12: (n2) => Number(n2 % 10 != 1 || n2 % 100 == 11),
27830
- 13: (n2) => Number(n2 !== 0),
27831
- 14: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : n2 == 3 ? 2 : 3),
27832
- 15: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 % 10 >= 2 && (n2 % 100 < 10 || n2 % 100 >= 20) ? 1 : 2),
27833
- 16: (n2) => Number(n2 % 10 == 1 && n2 % 100 != 11 ? 0 : n2 !== 0 ? 1 : 2),
27834
- 17: (n2) => Number(n2 == 1 || n2 % 10 == 1 && n2 % 100 != 11 ? 0 : 1),
27835
- 18: (n2) => Number(n2 == 0 ? 0 : n2 == 1 ? 1 : 2),
27836
- 19: (n2) => Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 1 && n2 % 100 < 11 ? 1 : n2 % 100 > 10 && n2 % 100 < 20 ? 2 : 3),
27837
- 20: (n2) => Number(n2 == 1 ? 0 : n2 == 0 || n2 % 100 > 0 && n2 % 100 < 20 ? 1 : 2),
27838
- 21: (n2) => Number(n2 % 100 == 1 ? 1 : n2 % 100 == 2 ? 2 : n2 % 100 == 3 || n2 % 100 == 4 ? 3 : 0),
27839
- 22: (n2) => Number(n2 == 1 ? 0 : n2 == 2 ? 1 : (n2 < 0 || n2 > 10) && n2 % 10 == 0 ? 2 : 3)
27840
- };
27841
- var nonIntlVersions = ["v1", "v2", "v3"];
27842
- var intlVersions = ["v4"];
27843
27869
  var suffixesOrder = {
27844
27870
  zero: 0,
27845
27871
  one: 1,
@@ -27848,17 +27874,11 @@ var suffixesOrder = {
27848
27874
  many: 4,
27849
27875
  other: 5
27850
27876
  };
27851
- var createRules = () => {
27852
- const rules = {};
27853
- sets.forEach((set) => {
27854
- set.lngs.forEach((l) => {
27855
- rules[l] = {
27856
- numbers: set.nr,
27857
- plurals: _rulesPluralsTypes[set.fc]
27858
- };
27859
- });
27860
- });
27861
- return rules;
27877
+ var dummyRule = {
27878
+ select: (count) => count === 1 ? "one" : "other",
27879
+ resolvedOptions: () => ({
27880
+ pluralCategories: ["one", "other"]
27881
+ })
27862
27882
  };
27863
27883
  var PluralResolver = class {
27864
27884
  constructor(languageUtils) {
@@ -27866,11 +27886,6 @@ var PluralResolver = class {
27866
27886
  this.languageUtils = languageUtils;
27867
27887
  this.options = options;
27868
27888
  this.logger = baseLogger.create("pluralResolver");
27869
- if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === "undefined" || !Intl.PluralRules)) {
27870
- this.options.compatibilityJSON = "v3";
27871
- this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.");
27872
- }
27873
- this.rules = createRules();
27874
27889
  this.pluralRulesCache = {};
27875
27890
  }
27876
27891
  addRule(lng, obj) {
@@ -27881,38 +27896,37 @@ var PluralResolver = class {
27881
27896
  }
27882
27897
  getRule(code) {
27883
27898
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27884
- if (this.shouldUseIntlApi()) {
27885
- const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
27886
- const type = options.ordinal ? "ordinal" : "cardinal";
27887
- const cacheKey = JSON.stringify({
27888
- cleanedCode,
27899
+ const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
27900
+ const type = options.ordinal ? "ordinal" : "cardinal";
27901
+ const cacheKey = JSON.stringify({
27902
+ cleanedCode,
27903
+ type
27904
+ });
27905
+ if (cacheKey in this.pluralRulesCache) {
27906
+ return this.pluralRulesCache[cacheKey];
27907
+ }
27908
+ let rule;
27909
+ try {
27910
+ rule = new Intl.PluralRules(cleanedCode, {
27889
27911
  type
27890
27912
  });
27891
- if (cacheKey in this.pluralRulesCache) {
27892
- return this.pluralRulesCache[cacheKey];
27893
- }
27894
- let rule;
27895
- try {
27896
- rule = new Intl.PluralRules(cleanedCode, {
27897
- type
27898
- });
27899
- } catch (err) {
27900
- if (!code.match(/-|_/)) return;
27901
- const lngPart = this.languageUtils.getLanguagePartFromCode(code);
27902
- rule = this.getRule(lngPart, options);
27913
+ } catch (err) {
27914
+ if (!Intl) {
27915
+ this.logger.error("No Intl support, please use an Intl polyfill!");
27916
+ return dummyRule;
27903
27917
  }
27904
- this.pluralRulesCache[cacheKey] = rule;
27905
- return rule;
27918
+ if (!code.match(/-|_/)) return dummyRule;
27919
+ const lngPart = this.languageUtils.getLanguagePartFromCode(code);
27920
+ rule = this.getRule(lngPart, options);
27906
27921
  }
27907
- return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
27922
+ this.pluralRulesCache[cacheKey] = rule;
27923
+ return rule;
27908
27924
  }
27909
27925
  needsPlural(code) {
27910
27926
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27911
- const rule = this.getRule(code, options);
27912
- if (this.shouldUseIntlApi()) {
27913
- return rule && rule.resolvedOptions().pluralCategories.length > 1;
27914
- }
27915
- return rule && rule.numbers.length > 1;
27927
+ let rule = this.getRule(code, options);
27928
+ if (!rule) rule = this.getRule("dev", options);
27929
+ return rule?.resolvedOptions().pluralCategories.length > 1;
27916
27930
  }
27917
27931
  getPluralFormsOfKey(code, key) {
27918
27932
  let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -27920,51 +27934,19 @@ var PluralResolver = class {
27920
27934
  }
27921
27935
  getSuffixes(code) {
27922
27936
  let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27923
- const rule = this.getRule(code, options);
27924
- if (!rule) {
27925
- return [];
27926
- }
27927
- if (this.shouldUseIntlApi()) {
27928
- return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
27929
- }
27930
- return rule.numbers.map((number) => this.getSuffix(code, number, options));
27937
+ let rule = this.getRule(code, options);
27938
+ if (!rule) rule = this.getRule("dev", options);
27939
+ if (!rule) return [];
27940
+ return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
27931
27941
  }
27932
27942
  getSuffix(code, count) {
27933
27943
  let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
27934
27944
  const rule = this.getRule(code, options);
27935
27945
  if (rule) {
27936
- if (this.shouldUseIntlApi()) {
27937
- return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
27938
- }
27939
- return this.getSuffixRetroCompatible(rule, count);
27946
+ return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
27940
27947
  }
27941
27948
  this.logger.warn(`no plural rule found for: ${code}`);
27942
- return "";
27943
- }
27944
- getSuffixRetroCompatible(rule, count) {
27945
- const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
27946
- let suffix = rule.numbers[idx];
27947
- if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
27948
- if (suffix === 2) {
27949
- suffix = "plural";
27950
- } else if (suffix === 1) {
27951
- suffix = "";
27952
- }
27953
- }
27954
- const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();
27955
- if (this.options.compatibilityJSON === "v1") {
27956
- if (suffix === 1) return "";
27957
- if (typeof suffix === "number") return `_plural_${suffix.toString()}`;
27958
- return returnSuffix();
27959
- } else if (this.options.compatibilityJSON === "v2") {
27960
- return returnSuffix();
27961
- } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
27962
- return returnSuffix();
27963
- }
27964
- return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
27965
- }
27966
- shouldUseIntlApi() {
27967
- return !nonIntlVersions.includes(this.options.compatibilityJSON);
27949
+ return this.getSuffix("dev", count, options);
27968
27950
  }
27969
27951
  };
27970
27952
  var deepFindWithDefaults = function(data, defaultData, key) {
@@ -27983,7 +27965,7 @@ var Interpolator = class {
27983
27965
  let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
27984
27966
  this.logger = baseLogger.create("interpolator");
27985
27967
  this.options = options;
27986
- this.format = options.interpolation && options.interpolation.format || ((value2) => value2);
27968
+ this.format = options?.interpolation?.format || ((value2) => value2);
27987
27969
  this.init(options);
27988
27970
  }
27989
27971
  init() {
@@ -28030,7 +28012,7 @@ var Interpolator = class {
28030
28012
  }
28031
28013
  resetRegExp() {
28032
28014
  const getOrResetRegExp = (existingRegExp, pattern) => {
28033
- if (existingRegExp && existingRegExp.source === pattern) {
28015
+ if (existingRegExp?.source === pattern) {
28034
28016
  existingRegExp.lastIndex = 0;
28035
28017
  return existingRegExp;
28036
28018
  }
@@ -28064,8 +28046,8 @@ var Interpolator = class {
28064
28046
  });
28065
28047
  };
28066
28048
  this.resetRegExp();
28067
- const missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
28068
- const skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
28049
+ const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
28050
+ const skipOnVariables = options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
28069
28051
  const todos = [{
28070
28052
  regex: this.regexpUnescape,
28071
28053
  safeValue: (val) => regexSafe(val)
@@ -28124,7 +28106,7 @@ var Interpolator = class {
28124
28106
  optionsString = this.interpolate(optionsString, clonedOptions);
28125
28107
  const matchedSingleQuotes = optionsString.match(/'/g);
28126
28108
  const matchedDoubleQuotes = optionsString.match(/"/g);
28127
- if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
28109
+ if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
28128
28110
  optionsString = optionsString.replace(/'/g, '"');
28129
28111
  }
28130
28112
  try {
@@ -28291,7 +28273,7 @@ var Formatter = class {
28291
28273
  if (this.formats[formatName]) {
28292
28274
  let formatted = mem;
28293
28275
  try {
28294
- const valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
28276
+ const valOptions = options?.formatParams?.[options.interpolationkey] || {};
28295
28277
  const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
28296
28278
  formatted = this.formats[formatName](mem, l, {
28297
28279
  ...formatOptions,
@@ -28333,9 +28315,7 @@ var Connector = class extends EventEmitter2 {
28333
28315
  this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
28334
28316
  this.state = {};
28335
28317
  this.queue = [];
28336
- if (this.backend && this.backend.init) {
28337
- this.backend.init(services, options.backend, options);
28338
- }
28318
+ this.backend?.init?.(services, options.backend, options);
28339
28319
  }
28340
28320
  queueLoad(languages, namespaces, options, callback) {
28341
28321
  const toLoad = {};
@@ -28503,12 +28483,12 @@ var Connector = class extends EventEmitter2 {
28503
28483
  let options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
28504
28484
  let clb = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
28505
28485
  };
28506
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
28486
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
28507
28487
  this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
28508
28488
  return;
28509
28489
  }
28510
28490
  if (key === void 0 || key === null || key === "") return;
28511
- if (this.backend && this.backend.create) {
28491
+ if (this.backend?.create) {
28512
28492
  const opts = {
28513
28493
  ...options,
28514
28494
  isUpdate
@@ -28540,7 +28520,7 @@ var Connector = class extends EventEmitter2 {
28540
28520
  };
28541
28521
  var get = () => ({
28542
28522
  debug: false,
28543
- initImmediate: true,
28523
+ initAsync: true,
28544
28524
  ns: ["translation"],
28545
28525
  defaultNS: ["translation"],
28546
28526
  fallbackLng: ["dev"],
@@ -28602,9 +28582,10 @@ var transformOptions = (options) => {
28602
28582
  if (isString2(options.ns)) options.ns = [options.ns];
28603
28583
  if (isString2(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
28604
28584
  if (isString2(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
28605
- if (options.supportedLngs && options.supportedLngs.indexOf("cimode") < 0) {
28585
+ if (options.supportedLngs?.indexOf?.("cimode") < 0) {
28606
28586
  options.supportedLngs = options.supportedLngs.concat(["cimode"]);
28607
28587
  }
28588
+ if (typeof options.initImmediate === "boolean") options.initAsync = options.initImmediate;
28608
28589
  return options;
28609
28590
  };
28610
28591
  var noop4 = () => {
@@ -28630,7 +28611,7 @@ var I18n = class _I18n extends EventEmitter2 {
28630
28611
  };
28631
28612
  bindMemberFunctions(this);
28632
28613
  if (callback && !this.isInitialized && !options.isClone) {
28633
- if (!this.options.initImmediate) {
28614
+ if (!this.options.initAsync) {
28634
28615
  this.init(options, callback);
28635
28616
  return this;
28636
28617
  }
@@ -28648,7 +28629,7 @@ var I18n = class _I18n extends EventEmitter2 {
28648
28629
  callback = options;
28649
28630
  options = {};
28650
28631
  }
28651
- if (!options.defaultNS && options.defaultNS !== false && options.ns) {
28632
+ if (options.defaultNS == null && options.ns) {
28652
28633
  if (isString2(options.ns)) {
28653
28634
  options.defaultNS = options.ns;
28654
28635
  } else if (options.ns.indexOf("translation") < 0) {
@@ -28661,12 +28642,10 @@ var I18n = class _I18n extends EventEmitter2 {
28661
28642
  ...this.options,
28662
28643
  ...transformOptions(options)
28663
28644
  };
28664
- if (this.options.compatibilityAPI !== "v1") {
28665
- this.options.interpolation = {
28666
- ...defOpts.interpolation,
28667
- ...this.options.interpolation
28668
- };
28669
- }
28645
+ this.options.interpolation = {
28646
+ ...defOpts.interpolation,
28647
+ ...this.options.interpolation
28648
+ };
28670
28649
  if (options.keySeparator !== void 0) {
28671
28650
  this.options.userDefinedKeySeparator = options.keySeparator;
28672
28651
  }
@@ -28687,7 +28666,7 @@ var I18n = class _I18n extends EventEmitter2 {
28687
28666
  let formatter;
28688
28667
  if (this.modules.formatter) {
28689
28668
  formatter = this.modules.formatter;
28690
- } else if (typeof Intl !== "undefined") {
28669
+ } else {
28691
28670
  formatter = Formatter;
28692
28671
  }
28693
28672
  const lu = new LanguageUtil(this.options);
@@ -28698,7 +28677,6 @@ var I18n = class _I18n extends EventEmitter2 {
28698
28677
  s2.languageUtils = lu;
28699
28678
  s2.pluralResolver = new PluralResolver(lu, {
28700
28679
  prepend: this.options.pluralSeparator,
28701
- compatibilityJSON: this.options.compatibilityJSON,
28702
28680
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
28703
28681
  });
28704
28682
  if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
@@ -28769,10 +28747,10 @@ var I18n = class _I18n extends EventEmitter2 {
28769
28747
  deferred.resolve(t3);
28770
28748
  callback(err, t3);
28771
28749
  };
28772
- if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return finish(null, this.t.bind(this));
28750
+ if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
28773
28751
  this.changeLanguage(this.options.lng, finish);
28774
28752
  };
28775
- if (this.options.resources || !this.options.initImmediate) {
28753
+ if (this.options.resources || !this.options.initAsync) {
28776
28754
  load();
28777
28755
  } else {
28778
28756
  setTimeout(load, 0);
@@ -28785,7 +28763,7 @@ var I18n = class _I18n extends EventEmitter2 {
28785
28763
  const usedLng = isString2(language) ? language : this.language;
28786
28764
  if (typeof language === "function") usedCallback = language;
28787
28765
  if (!this.options.resources || this.options.partialBundledLanguages) {
28788
- if (usedLng && usedLng.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
28766
+ if (usedLng?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
28789
28767
  const toLoad = [];
28790
28768
  const append = (lng) => {
28791
28769
  if (!lng) return;
@@ -28802,9 +28780,7 @@ var I18n = class _I18n extends EventEmitter2 {
28802
28780
  } else {
28803
28781
  append(usedLng);
28804
28782
  }
28805
- if (this.options.preload) {
28806
- this.options.preload.forEach((l) => append(l));
28807
- }
28783
+ this.options.preload?.forEach?.((l) => append(l));
28808
28784
  this.services.backendConnector.load(toLoad, this.options.ns, (e2) => {
28809
28785
  if (!e2 && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
28810
28786
  usedCallback(e2);
@@ -28906,7 +28882,7 @@ var I18n = class _I18n extends EventEmitter2 {
28906
28882
  setLngProps(l);
28907
28883
  }
28908
28884
  if (!this.translator.language) this.translator.changeLanguage(l);
28909
- if (this.services.languageDetector && this.services.languageDetector.cacheUserLanguage) this.services.languageDetector.cacheUserLanguage(l);
28885
+ this.services.languageDetector?.cacheUserLanguage?.(l);
28910
28886
  }
28911
28887
  this.loadResources(l, (err) => {
28912
28888
  done(err, l);
@@ -28962,10 +28938,16 @@ var I18n = class _I18n extends EventEmitter2 {
28962
28938
  return fixedT;
28963
28939
  }
28964
28940
  t() {
28965
- return this.translator && this.translator.translate(...arguments);
28941
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
28942
+ args[_key4] = arguments[_key4];
28943
+ }
28944
+ return this.translator?.translate(...args);
28966
28945
  }
28967
28946
  exists() {
28968
- return this.translator && this.translator.exists(...arguments);
28947
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
28948
+ args[_key5] = arguments[_key5];
28949
+ }
28950
+ return this.translator?.exists(...args);
28969
28951
  }
28970
28952
  setDefaultNamespace(ns) {
28971
28953
  this.options.defaultNS = ns;
@@ -29030,10 +29012,10 @@ var I18n = class _I18n extends EventEmitter2 {
29030
29012
  return deferred;
29031
29013
  }
29032
29014
  dir(lng) {
29033
- if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
29015
+ if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
29034
29016
  if (!lng) return "rtl";
29035
29017
  const rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
29036
- const languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());
29018
+ const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
29037
29019
  return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
29038
29020
  }
29039
29021
  static createInstance() {
@@ -29068,13 +29050,24 @@ var I18n = class _I18n extends EventEmitter2 {
29068
29050
  hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
29069
29051
  };
29070
29052
  if (forkResourceStore) {
29071
- clone.store = new ResourceStore(this.store.data, mergedOptions);
29053
+ const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
29054
+ prev[l] = {
29055
+ ...this.store.data[l]
29056
+ };
29057
+ return Object.keys(prev[l]).reduce((acc, n2) => {
29058
+ acc[n2] = {
29059
+ ...prev[l][n2]
29060
+ };
29061
+ return acc;
29062
+ }, {});
29063
+ }, {});
29064
+ clone.store = new ResourceStore(clonedData, mergedOptions);
29072
29065
  clone.services.resourceStore = clone.store;
29073
29066
  }
29074
29067
  clone.translator = new Translator(clone.services, mergedOptions);
29075
29068
  clone.translator.on("*", function(event) {
29076
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
29077
- args[_key4 - 1] = arguments[_key4];
29069
+ for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
29070
+ args[_key6 - 1] = arguments[_key6];
29078
29071
  }
29079
29072
  clone.emit(event, ...args);
29080
29073
  });
@@ -29246,4 +29239,4 @@ react-reconciler/cjs/react-reconciler-constants.production.min.js:
29246
29239
  * LICENSE file in the root directory of this source tree.
29247
29240
  *)
29248
29241
  */
29249
- //# sourceMappingURL=chunk-2ROHQF53.js.map
29242
+ //# sourceMappingURL=chunk-DXNFLVQP.js.map