@react-querybuilder/core 8.11.1 → 8.12.0

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 (103) hide show
  1. package/dist/{basic-BeKPP0_1.d.ts → basic-DbvrfPNz.d.mts} +39 -4
  2. package/dist/{basic-B4vXboTG.d.mts → basic-o1-sYjK6.d.ts} +39 -4
  3. package/dist/chunk-BxBTb9qk.js +39 -0
  4. package/dist/chunk-DrjzjjTJ.mjs +23 -0
  5. package/dist/chunk-Dv2ph0Ay.js +23 -0
  6. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +131 -53
  7. package/dist/cjs/react-querybuilder_core.cjs.development.js +36 -39
  8. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  9. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +131 -53
  10. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  11. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  12. package/dist/{convertQuery-CqX3rPvj.mjs → convertQuery-Cj4t-LT4.mjs} +2 -2
  13. package/dist/{convertQuery-CqX3rPvj.mjs.map → convertQuery-Cj4t-LT4.mjs.map} +1 -1
  14. package/dist/{convertQuery-DAqoID3O.js → convertQuery-DuY_BJHy.js} +3 -3
  15. package/dist/{convertQuery-DAqoID3O.js.map → convertQuery-DuY_BJHy.js.map} +1 -1
  16. package/dist/{export-BjRt-qrK.d.mts → export-CCULKoP4.d.mts} +2 -2
  17. package/dist/{export-CQB0nuvW.d.ts → export-WDHFbiPz.d.ts} +2 -2
  18. package/dist/formatQuery.d.mts +15 -3
  19. package/dist/formatQuery.d.ts +15 -3
  20. package/dist/formatQuery.js +172 -425
  21. package/dist/formatQuery.js.map +1 -1
  22. package/dist/formatQuery.mjs +4 -257
  23. package/dist/formatQuery.mjs.map +1 -1
  24. package/dist/{import-Dvayhrgj.d.ts → import-BSWb9Vgd.d.ts} +2 -2
  25. package/dist/{import-Bc_p8ls9.d.mts → import-CLyHpgk8.d.mts} +2 -2
  26. package/dist/{isRuleGroup-CYcfPgbg.mjs → isRuleGroup-BcfwGaIN.mjs} +1 -1
  27. package/dist/{isRuleGroup-CYcfPgbg.mjs.map → isRuleGroup-BcfwGaIN.mjs.map} +1 -1
  28. package/dist/{isRuleGroup-DqAs2x4E.js → isRuleGroup-Do9KKsmt.js} +2 -40
  29. package/dist/{isRuleGroup-DqAs2x4E.js.map → isRuleGroup-Do9KKsmt.js.map} +1 -1
  30. package/dist/parseCEL.d.mts +32 -7
  31. package/dist/parseCEL.d.ts +32 -7
  32. package/dist/parseCEL.js +181 -12
  33. package/dist/parseCEL.js.map +1 -1
  34. package/dist/parseCEL.mjs +174 -8
  35. package/dist/parseCEL.mjs.map +1 -1
  36. package/dist/parseJSONata.d.mts +2 -2
  37. package/dist/parseJSONata.d.ts +2 -2
  38. package/dist/parseJSONata.js +6 -5
  39. package/dist/parseJSONata.js.map +1 -1
  40. package/dist/parseJSONata.mjs +3 -3
  41. package/dist/parseJsonLogic.d.mts +3 -3
  42. package/dist/parseJsonLogic.d.ts +3 -3
  43. package/dist/parseJsonLogic.js +10 -11
  44. package/dist/parseJsonLogic.js.map +1 -1
  45. package/dist/parseJsonLogic.mjs +4 -5
  46. package/dist/parseJsonLogic.mjs.map +1 -1
  47. package/dist/parseMongoDB.d.mts +2 -2
  48. package/dist/parseMongoDB.d.ts +2 -2
  49. package/dist/parseMongoDB.js +20 -21
  50. package/dist/parseMongoDB.js.map +1 -1
  51. package/dist/parseMongoDB.mjs +4 -5
  52. package/dist/parseMongoDB.mjs.map +1 -1
  53. package/dist/parseSQL.d.mts +2 -2
  54. package/dist/parseSQL.d.ts +2 -2
  55. package/dist/parseSQL.js +10 -13
  56. package/dist/parseSQL.js.map +1 -1
  57. package/dist/parseSQL.mjs +3 -5
  58. package/dist/parseSQL.mjs.map +1 -1
  59. package/dist/parseSpEL.d.mts +2 -2
  60. package/dist/parseSpEL.d.ts +2 -2
  61. package/dist/parseSpEL.js +7 -7
  62. package/dist/parseSpEL.js.map +1 -1
  63. package/dist/parseSpEL.mjs +3 -4
  64. package/dist/parseSpEL.mjs.map +1 -1
  65. package/dist/{prepareQueryObjects-DPCC-iHp.mjs → prepareQueryObjects-BfnyRV5t.mjs} +4 -3
  66. package/dist/{prepareQueryObjects-DPCC-iHp.mjs.map → prepareQueryObjects-BfnyRV5t.mjs.map} +1 -1
  67. package/dist/{prepareQueryObjects-BOUWfel5.js → prepareQueryObjects-DCtJJrF5.js} +14 -13
  68. package/dist/prepareQueryObjects-DCtJJrF5.js.map +1 -0
  69. package/dist/react-querybuilder_core.d.mts +131 -53
  70. package/dist/react-querybuilder_core.legacy-esm.d.ts +131 -53
  71. package/dist/react-querybuilder_core.legacy-esm.js +43 -21
  72. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  73. package/dist/react-querybuilder_core.mjs +36 -14
  74. package/dist/react-querybuilder_core.mjs.map +1 -1
  75. package/dist/react-querybuilder_core.production.d.mts +131 -53
  76. package/dist/react-querybuilder_core.production.mjs +1 -1
  77. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  78. package/dist/{transformQuery-DCCpjtyq.mjs → transformQuery-Bq4iyYsE.mjs} +9 -2
  79. package/dist/{transformQuery-DCCpjtyq.mjs.map → transformQuery-Bq4iyYsE.mjs.map} +1 -1
  80. package/dist/{transformQuery-CWDPogO5.js → transformQuery-DvJTAvkh.js} +10 -3
  81. package/dist/{transformQuery-CWDPogO5.js.map → transformQuery-DvJTAvkh.js.map} +1 -1
  82. package/dist/transformQuery.d.mts +1 -1
  83. package/dist/transformQuery.d.ts +1 -1
  84. package/dist/transformQuery.js +2 -2
  85. package/dist/transformQuery.mjs +2 -2
  86. package/dist/utils-CoYbYnVo.js +706 -0
  87. package/dist/utils-CoYbYnVo.js.map +1 -0
  88. package/dist/utils-DxH23QtE.mjs +514 -0
  89. package/dist/utils-DxH23QtE.mjs.map +1 -0
  90. package/package.json +15 -15
  91. package/dist/arrayUtils-A_OXU9W1.mjs +0 -50
  92. package/dist/arrayUtils-A_OXU9W1.mjs.map +0 -1
  93. package/dist/arrayUtils-QxZOZTf6.js +0 -73
  94. package/dist/arrayUtils-QxZOZTf6.js.map +0 -1
  95. package/dist/optGroupUtils-B0hTpodo.js +0 -251
  96. package/dist/optGroupUtils-B0hTpodo.js.map +0 -1
  97. package/dist/optGroupUtils-VeZ3k7-1.mjs +0 -185
  98. package/dist/optGroupUtils-VeZ3k7-1.mjs.map +0 -1
  99. package/dist/parseNumber-CXdMVNFx.mjs +0 -24
  100. package/dist/parseNumber-CXdMVNFx.mjs.map +0 -1
  101. package/dist/parseNumber-D4iQDxK-.js +0 -31
  102. package/dist/parseNumber-D4iQDxK-.js.map +0 -1
  103. package/dist/prepareQueryObjects-BOUWfel5.js.map +0 -1
@@ -143,7 +143,7 @@ const anyA = get(anyObject, 'a');
143
143
  @category Type Guard
144
144
  @category Utilities
145
145
  */
146
- type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false;
146
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
147
147
  //#endregion
148
148
  //#region ../../node_modules/type-fest/source/is-optional-key-of.d.ts
149
149
  /**
@@ -186,7 +186,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
186
186
  @category Type Guard
187
187
  @category Utilities
188
188
  */
189
- type IsOptionalKeyOf<Type$1 extends object, Key$1 extends keyof Type$1> = IsAny<Type$1 | Key$1> extends true ? never : Key$1 extends keyof Type$1 ? Type$1 extends Record<Key$1, Type$1[Key$1]> ? false : true : false;
189
+ type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false;
190
190
  //#endregion
191
191
  //#region ../../node_modules/type-fest/source/optional-keys-of.d.ts
192
192
  /**
@@ -222,8 +222,8 @@ const update2: UpdateOperation<User> = {
222
222
 
223
223
  @category Utilities
224
224
  */
225
- type OptionalKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
226
- ? (keyof { [Key in keyof Type$1 as IsOptionalKeyOf<Type$1, Key> extends false ? never : Key]: never }) & keyof Type$1 // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
225
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
226
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
227
227
  : never;
228
228
  //#endregion
229
229
  //#region ../../node_modules/type-fest/source/required-keys-of.d.ts
@@ -251,8 +251,8 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
251
251
 
252
252
  @category Utilities
253
253
  */
254
- type RequiredKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
255
- ? Exclude<keyof Type$1, OptionalKeysOf<Type$1>> : never;
254
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
255
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
256
256
  //#endregion
257
257
  //#region ../../node_modules/type-fest/source/is-never.d.ts
258
258
  /**
@@ -296,7 +296,7 @@ endIfEqual('abc', '123');
296
296
  @category Type Guard
297
297
  @category Utilities
298
298
  */
299
- type IsNever<T$1> = [T$1] extends [never] ? true : false;
299
+ type IsNever<T> = [T] extends [never] ? true : false;
300
300
  //#endregion
301
301
  //#region ../../node_modules/type-fest/source/if.d.ts
302
302
  /**
@@ -353,10 +353,45 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
353
353
  //=> 'not equal'
354
354
  ```
355
355
 
356
+ Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
357
+
358
+ @example
359
+ ```
360
+ import type {If, IsEqual, StringRepeat} from 'type-fest';
361
+
362
+ type HundredZeroes = StringRepeat<'0', 100>;
363
+
364
+ // The following implementation is not tail recursive
365
+ type Includes<S extends string, Char extends string> =
366
+ S extends `${infer First}${infer Rest}`
367
+ ? If<IsEqual<First, Char>,
368
+ 'found',
369
+ Includes<Rest, Char>>
370
+ : 'not found';
371
+
372
+ // Hence, instantiations with long strings will fail
373
+ // @ts-expect-error
374
+ type Fails = Includes<HundredZeroes, '1'>;
375
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376
+ // Error: Type instantiation is excessively deep and possibly infinite.
377
+
378
+ // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
379
+ type IncludesWithoutIf<S extends string, Char extends string> =
380
+ S extends `${infer First}${infer Rest}`
381
+ ? IsEqual<First, Char> extends true
382
+ ? 'found'
383
+ : IncludesWithoutIf<Rest, Char>
384
+ : 'not found';
385
+
386
+ // Now, instantiations with long strings will work
387
+ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
388
+ //=> 'not found'
389
+ ```
390
+
356
391
  @category Type Guard
357
392
  @category Utilities
358
393
  */
359
- type If<Type$1 extends boolean, IfBranch, ElseBranch> = IsNever<Type$1> extends true ? ElseBranch : Type$1 extends true ? IfBranch : ElseBranch;
394
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
360
395
  //#endregion
361
396
  //#region ../../node_modules/type-fest/source/unknown-array.d.ts
362
397
  /**
@@ -398,7 +433,7 @@ Needed to handle the case of a single call signature with properties.
398
433
  Multiple call signatures cannot currently be supported due to a TypeScript limitation.
399
434
  @see https://github.com/microsoft/TypeScript/issues/29732
400
435
  */
401
- type HasMultipleCallSignatures<T$1 extends (...arguments_: any[]) => unknown> = T$1 extends {
436
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
402
437
  (...arguments_: infer A): unknown;
403
438
  (...arguments_: infer B): unknown;
404
439
  } ? B extends A ? A extends B ? false : true : true : false;
@@ -419,14 +454,40 @@ type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
419
454
  type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
420
455
  //=> 'IS_NEVER'
421
456
  ```
457
+
458
+ Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:
459
+
460
+ @example
461
+ ```ts
462
+ import type {StringRepeat} from 'type-fest';
463
+
464
+ type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
465
+
466
+ // The following implementation is not tail recursive
467
+ type TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;
468
+
469
+ // Hence, instantiations with long strings will fail
470
+ // @ts-expect-error
471
+ type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
472
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473
+ // Error: Type instantiation is excessively deep and possibly infinite.
474
+
475
+ // To fix this, move the recursion into a helper type
476
+ type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S>>;
477
+
478
+ type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
479
+
480
+ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
481
+ //=> ''
482
+ ```
422
483
  */
423
- type IfNotAnyOrNever<T$1, IfNotAnyOrNever$1, IfAny = any, IfNever = never> = If<IsAny<T$1>, IfAny, If<IsNever<T$1>, IfNever, IfNotAnyOrNever$1>>;
484
+ type IfNotAnyOrNever<T, IfNotAnyOrNever$1, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever$1>>;
424
485
  //#endregion
425
486
  //#region ../../node_modules/type-fest/source/internal/array.d.ts
426
487
  /**
427
488
  Returns whether the given array `T` is readonly.
428
489
  */
429
- type IsArrayReadonly<T$1 extends UnknownArray> = If<IsNever<T$1>, false, T$1 extends unknown[] ? false : true>;
490
+ type IsArrayReadonly<T extends UnknownArray> = If<IsNever<T>, false, T extends unknown[] ? false : true>;
430
491
  //#endregion
431
492
  //#region ../../node_modules/type-fest/source/simplify.d.ts
432
493
  /**
@@ -483,10 +544,10 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
483
544
  ```
484
545
 
485
546
  @link https://github.com/microsoft/TypeScript/issues/15300
486
- @see SimplifyDeep
547
+ @see {@link SimplifyDeep}
487
548
  @category Object
488
549
  */
489
- type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
550
+ type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
490
551
  //#endregion
491
552
  //#region ../../node_modules/type-fest/source/is-equal.d.ts
492
553
  /**
@@ -607,7 +668,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
607
668
  // => { foo: 'bar'; qux?: 'baz' | undefined; }
608
669
  ```
609
670
 
610
- @see PickIndexSignature
671
+ @see {@link PickIndexSignature}
611
672
  @category Object
612
673
  */
613
674
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
@@ -655,7 +716,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
655
716
  // }
656
717
  ```
657
718
 
658
- @see OmitIndexSignature
719
+ @see {@link OmitIndexSignature}
659
720
  @category Object
660
721
  */
661
722
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
@@ -738,7 +799,7 @@ type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
738
799
  type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
739
800
  //=> {}
740
801
  */
741
- type HomomorphicPick<T$1, Keys extends KeysOfUnion<T$1>> = { [P in keyof T$1 as Extract<P, Keys>]: T$1[P] };
802
+ type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
742
803
  /**
743
804
  Merges user specified options with default options.
744
805
 
@@ -964,7 +1025,7 @@ Note that types containing overloaded functions are not made deeply required due
964
1025
  @category Set
965
1026
  @category Map
966
1027
  */
967
- type RequiredDeep<T$1> = T$1 extends BuiltIns ? T$1 : T$1 extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T$1 extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T$1 extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T$1 extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T$1 extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T$1> extends true ? T$1 : HasMultipleCallSignatures<T$1> extends true ? T$1 : ((...arguments_: Parameters<T$1>) => ReturnType<T$1>) & RequiredObjectDeep<T$1> : T$1 extends object ? RequiredObjectDeep<T$1> : unknown;
1028
+ type RequiredDeep<T> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & RequiredObjectDeep<T> : T extends object ? RequiredObjectDeep<T> : unknown;
968
1029
  type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
969
1030
  //#endregion
970
1031
  //#region ../../node_modules/type-fest/source/set-optional.d.ts
@@ -1062,7 +1123,7 @@ type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown
1062
1123
  *
1063
1124
  * @group Option Lists
1064
1125
  */
1065
- type GetOptionType<OL$1 extends FlexibleOptionList<FullOption>> = OL$1 extends FlexibleOptionList<infer Opt> ? Opt : never;
1126
+ type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends FlexibleOptionList<infer Opt> ? Opt : never;
1066
1127
  /**
1067
1128
  * Extracts the type of the identifying property from a {@link Option},
1068
1129
  * {@link ValueOption}, or {@link FullOption}.
@@ -1073,7 +1134,7 @@ type GetOptionIdentifierType<Opt$1 extends BaseOption> = Opt$1 extends Option<in
1073
1134
  /**
1074
1135
  * Adds an `unknown` index property to an interface.
1075
1136
  */
1076
- type WithUnknownIndex<T$1> = T$1 & {
1137
+ type WithUnknownIndex<T> = T & {
1077
1138
  [key: string]: unknown;
1078
1139
  };
1079
1140
  /**
@@ -1238,9 +1299,9 @@ interface CommonRuleAndGroupProperties {
1238
1299
  * The main rule type. The `field`, `operator`, and `value` properties
1239
1300
  * can be narrowed with generics.
1240
1301
  */
1241
- interface RuleType<F$1 extends string = string, O$1 extends string = string, V$1 = any, C extends string = string> extends CommonRuleAndGroupProperties {
1242
- field: F$1;
1243
- operator: O$1;
1302
+ interface RuleType<F extends string = string, O extends string = string, V$1 = any, C extends string = string> extends CommonRuleAndGroupProperties {
1303
+ field: F;
1304
+ operator: O;
1244
1305
  value: V$1;
1245
1306
  valueSource?: ValueSource;
1246
1307
  match?: MatchConfig;
@@ -1253,15 +1314,15 @@ interface RuleType<F$1 extends string = string, O$1 extends string = string, V$1
1253
1314
  * The main rule group type. This type is used for query definitions as well as
1254
1315
  * all sub-groups of queries.
1255
1316
  */
1256
- interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
1317
+ interface RuleGroupType<R extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
1257
1318
  combinator: C;
1258
- rules: RuleGroupArray<RuleGroupType<R$1, C>, R$1>;
1319
+ rules: RuleGroupArray<RuleGroupType<R, C>, R>;
1259
1320
  not?: boolean;
1260
1321
  }
1261
1322
  /**
1262
1323
  * The type of the `rules` array in a {@link RuleGroupType}.
1263
1324
  */
1264
- type RuleGroupArray<RG$1 extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG$1)[];
1325
+ type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
1265
1326
  /**
1266
1327
  * All updateable properties of rules and groups (everything except
1267
1328
  * `id`, `path`, and `rules`).
@@ -1270,18 +1331,18 @@ type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "pa
1270
1331
  /**
1271
1332
  * The type of the `rules` array in a {@link DefaultRuleGroupType}.
1272
1333
  */
1273
- type DefaultRuleGroupArray<F$1 extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F$1>>;
1334
+ type DefaultRuleGroupArray<F extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F>>;
1274
1335
  /**
1275
1336
  * {@link RuleGroupType} with the `combinator` property limited to
1276
1337
  * {@link DefaultCombinatorNameExtended} and `rules` limited to {@link DefaultRuleType}.
1277
1338
  */
1278
- type DefaultRuleGroupType<F$1 extends string = string> = RuleGroupType<DefaultRuleType<F$1>, DefaultCombinatorNameExtended> & {
1279
- rules: DefaultRuleGroupArray<F$1>;
1339
+ type DefaultRuleGroupType<F extends string = string> = RuleGroupType<DefaultRuleType<F>, DefaultCombinatorNameExtended> & {
1340
+ rules: DefaultRuleGroupArray<F>;
1280
1341
  };
1281
1342
  /**
1282
1343
  * {@link RuleType} with the `operator` property limited to {@link DefaultOperatorName}.
1283
1344
  */
1284
- type DefaultRuleType<F$1 extends string = string> = RuleType<F$1, DefaultOperatorName>;
1345
+ type DefaultRuleType<F extends string = string> = RuleType<F, DefaultOperatorName>;
1285
1346
  /**
1286
1347
  * Default allowed values for the `combinator` property.
1287
1348
  *
@@ -1328,9 +1389,9 @@ type MappedTuple<Tuple extends Array<unknown>, Result extends Array<unknown> = [
1328
1389
  * The main rule group interface when using independent combinators. This type is used
1329
1390
  * for query definitions as well as all sub-groups of queries.
1330
1391
  */
1331
- interface RuleGroupTypeIC<R$1 extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R$1, C>, "combinator" | "rules"> {
1392
+ interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R, C>, "combinator" | "rules"> {
1332
1393
  combinator?: undefined;
1333
- rules: RuleGroupICArray<RuleGroupTypeIC<R$1, C>, R$1, C>;
1394
+ rules: RuleGroupICArray<RuleGroupTypeIC<R, C>, R, C>;
1334
1395
  /**
1335
1396
  * Only used when adding a rule to a query that uses independent combinators
1336
1397
  */
@@ -1339,11 +1400,11 @@ interface RuleGroupTypeIC<R$1 extends RuleType = RuleType, C extends string = st
1339
1400
  /**
1340
1401
  * Shorthand for "either {@link RuleGroupType} or {@link RuleGroupTypeIC}".
1341
1402
  */
1342
- type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string> = RuleGroupType<R$1, C> | RuleGroupTypeIC<R$1, C>;
1403
+ type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string> = RuleGroupType<R, C> | RuleGroupTypeIC<R, C>;
1343
1404
  /**
1344
1405
  * The type of the `rules` array in a {@link RuleGroupTypeIC}.
1345
1406
  */
1346
- type RuleGroupICArray<RG$1 extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG$1] | [R$1 | RG$1, ...MappedTuple<[C, R$1 | RG$1]>] | ((R$1 | RG$1)[] & {
1407
+ type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
1347
1408
  length: 0;
1348
1409
  });
1349
1410
  /**
@@ -1353,27 +1414,27 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
1353
1414
  /**
1354
1415
  * The type of the `rules` array in a {@link DefaultRuleGroupTypeIC}.
1355
1416
  */
1356
- type DefaultRuleGroupICArray<F$1 extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F$1>, DefaultRuleType<F$1>, DefaultCombinatorName>;
1417
+ type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F>, DefaultRuleType<F>, DefaultCombinatorName>;
1357
1418
  /**
1358
1419
  * Shorthand for "either {@link DefaultRuleGroupArray} or {@link DefaultRuleGroupICArray}".
1359
1420
  */
1360
- type DefaultRuleOrGroupArray<F$1 extends string = string> = DefaultRuleGroupArray<F$1> | DefaultRuleGroupICArray<F$1>;
1421
+ type DefaultRuleOrGroupArray<F extends string = string> = DefaultRuleGroupArray<F> | DefaultRuleGroupICArray<F>;
1361
1422
  /**
1362
1423
  * {@link RuleGroupTypeIC} with combinators limited to
1363
1424
  * {@link DefaultCombinatorName} and rules limited to {@link DefaultRuleType}.
1364
1425
  */
1365
- interface DefaultRuleGroupTypeIC<F$1 extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F$1>> {
1366
- rules: DefaultRuleGroupICArray<F$1>;
1426
+ interface DefaultRuleGroupTypeIC<F extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F>> {
1427
+ rules: DefaultRuleGroupICArray<F>;
1367
1428
  }
1368
1429
  /**
1369
1430
  * Shorthand for "either {@link DefaultRuleGroupType} or {@link DefaultRuleGroupTypeIC}".
1370
1431
  */
1371
- type DefaultRuleGroupTypeAny<F$1 extends string = string> = DefaultRuleGroupType<F$1> | DefaultRuleGroupTypeIC<F$1>;
1432
+ type DefaultRuleGroupTypeAny<F extends string = string> = DefaultRuleGroupType<F> | DefaultRuleGroupTypeIC<F>;
1372
1433
  /**
1373
1434
  * Determines if a type extending {@link RuleGroupTypeAny} is actually
1374
1435
  * {@link RuleGroupType} or {@link RuleGroupTypeIC}.
1375
1436
  */
1376
- type GetRuleGroupType<RG$1> = RG$1 extends {
1437
+ type GetRuleGroupType<RG> = RG extends {
1377
1438
  combinator: string;
1378
1439
  } ? RuleGroupType : RuleGroupTypeIC;
1379
1440
  /**
@@ -1384,11 +1445,11 @@ type GetRuleGroupType<RG$1> = RG$1 extends {
1384
1445
  * the rule type has its field and operator types narrowed to the
1385
1446
  * identifier types of the provided Field and Operator types.
1386
1447
  */
1387
- type GetRuleTypeFromGroupWithFieldAndOperator<RG$1 extends RuleGroupTypeAny, F$1 extends BaseOption, O$1 extends BaseOption> = RG$1 extends RuleGroupType<infer RT> | RuleGroupTypeIC<infer RT> ? RT extends RuleType<infer RuleFieldName, infer RuleOperatorName, infer RuleValueName, infer RuleCombinatorName> ? RuleFieldName extends GetOptionIdentifierType<F$1> ? RuleOperatorName extends GetOptionIdentifierType<O$1> ? RuleType<RuleFieldName, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<RuleFieldName, GetOptionIdentifierType<O$1>, RuleValueName, RuleCombinatorName> : RuleOperatorName extends GetOptionIdentifierType<O$1> ? RuleType<GetOptionIdentifierType<F$1>, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<GetOptionIdentifierType<F$1>, GetOptionIdentifierType<O$1>, RuleValueName, RuleCombinatorName> : never : never;
1448
+ type GetRuleTypeFromGroupWithFieldAndOperator<RG extends RuleGroupTypeAny, F extends BaseOption, O extends BaseOption> = RG extends RuleGroupType<infer RT> | RuleGroupTypeIC<infer RT> ? RT extends RuleType<infer RuleFieldName, infer RuleOperatorName, infer RuleValueName, infer RuleCombinatorName> ? RuleFieldName extends GetOptionIdentifierType<F> ? RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<RuleFieldName, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<RuleFieldName, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<GetOptionIdentifierType<F>, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<GetOptionIdentifierType<F>, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : never : never;
1388
1449
  /**
1389
1450
  * Converts a narrowed rule group type to its most generic form.
1390
1451
  */
1391
- type GenericizeRuleGroupType<RG$1> = RG$1 extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
1452
+ type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
1392
1453
  //#endregion
1393
1454
  //#region src/types/validation.d.ts
1394
1455
  /**
@@ -1444,7 +1505,7 @@ type ToOptionArrays<Sources extends readonly string[]> = Sources extends unknown
1444
1505
  label: string;
1445
1506
  } } : never;
1446
1507
  type ToFlexibleOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: FlexibleOption<Sources[K]> } : never;
1447
- type WithOptionalClassName<T$1> = T$1 & {
1508
+ type WithOptionalClassName<T> = T & {
1448
1509
  className?: Classname;
1449
1510
  };
1450
1511
  /**
@@ -1528,11 +1589,11 @@ type FieldByValue<FieldName extends string = string, OperatorName extends string
1528
1589
  /**
1529
1590
  * Utility type to make one or more properties required.
1530
1591
  */
1531
- type WithRequired<T$1, K$1 extends keyof T$1> = T$1 & { [P in K$1]-?: T$1[P] };
1592
+ type WithRequired<T, K$1 extends keyof T> = T & { [P in K$1]-?: T[P] };
1532
1593
  /**
1533
1594
  * Utility type to make all properties non-nullable.
1534
1595
  */
1535
- type RemoveNullability<T$1 extends Record<string, unknown>> = { [k in keyof T$1]: NonNullable<T$1[k]> };
1596
+ type RemoveNullability<T extends Record<string, unknown>> = { [k in keyof T]: NonNullable<T[k]> };
1536
1597
  /**
1537
1598
  * Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
1538
1599
  * a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
@@ -2288,9 +2349,13 @@ interface Classnames {
2288
2349
  */
2289
2350
  branches: Classname;
2290
2351
  /**
2291
- * Classname(s) rules that render a subquery.
2352
+ * Classname(s) applied to rules that render a subquery.
2292
2353
  */
2293
2354
  hasSubQuery: Classname;
2355
+ /**
2356
+ * Classname(s) applied to async components in their "loading" state.
2357
+ */
2358
+ loading: Classname;
2294
2359
  }
2295
2360
  /**
2296
2361
  * Placeholder strings for option lists.
@@ -2653,6 +2718,7 @@ declare const standardClassnames: {
2653
2718
  readonly branches: "queryBuilder-branches";
2654
2719
  readonly justified: "queryBuilder-justified";
2655
2720
  readonly hasSubQuery: "rule-hasSubQuery";
2721
+ readonly loading: "queryBuilder-loading";
2656
2722
  };
2657
2723
  /**
2658
2724
  * Default classnames for each component.
@@ -3441,7 +3507,19 @@ type ProcessedMatchMode = {
3441
3507
  mode: "exactly";
3442
3508
  threshold: number;
3443
3509
  };
3444
- declare const processMatchMode: (rule: RuleType) => void | false | ProcessedMatchMode;
3510
+ /**
3511
+ * Transforms
3512
+ * - `match: { mode: "atLeast", threshold: 1 }` to `match: { mode: "some" }`
3513
+ * - `match: { mode: "atMost", threshold: 0 }` to `match: { mode: "none" }`.
3514
+ *
3515
+ * Returns:
3516
+ * - Processed `{ mode, threshold }` object for valid subqueries
3517
+ * - `null` if match mode is not applicable for the rule
3518
+ * - `false` if match mode is valid, but either
3519
+ * 1. `threshold` is required and invalid, or
3520
+ * 2. `value` is not a valid rule group.
3521
+ */
3522
+ declare const processMatchMode: (rule: RuleType) => null | false | ProcessedMatchMode;
3445
3523
  /**
3446
3524
  * "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
3447
3525
  * objects with a `$bigint` property having a value of a string representation of
@@ -3630,7 +3708,7 @@ declare const nullOrUndefinedOrEmpty: (value: unknown) => value is null | undefi
3630
3708
  * type ObjectKeys<T extends object> = `${Exclude<keyof T, symbol>}`;
3631
3709
  * ```
3632
3710
  */
3633
- type ObjectKeys<T$1 extends object> = Exclude<keyof T$1, symbol>;
3711
+ type ObjectKeys<T extends object> = Exclude<keyof T, symbol>;
3634
3712
  /**
3635
3713
  * A strongly-typed version of `Object.keys()`.
3636
3714
  *
@@ -3764,14 +3842,14 @@ declare const uniqOptGroups: <T extends BaseOption>(originalArray: FlexibleOptio
3764
3842
  * @group Option Lists
3765
3843
  */
3766
3844
  declare const uniqOptList: <T extends BaseOption>(originalArray: FlexibleOptionList<T>) => WithUnknownIndex<BaseOption & FullOption>[] | OptionGroup<ToFullOption<T>>[];
3767
- interface PreparedOptionList<O$1 extends FullOption> {
3845
+ interface PreparedOptionList<O extends FullOption> {
3768
3846
  defaultOption: FullOption;
3769
- optionList: O$1[] | OptionGroup<O$1>[];
3847
+ optionList: FullOptionList<O>;
3770
3848
  optionsMap: Partial<FullOptionRecord<FullOption>>;
3771
3849
  }
3772
- interface PrepareOptionListParams<O$1 extends FullOption> {
3850
+ interface PrepareOptionListParams<O extends FullOption> {
3773
3851
  placeholder?: Placeholder;
3774
- optionList?: FlexibleOptionListProp<O$1> | BaseOptionMap<O$1>;
3852
+ optionList?: FlexibleOptionListProp<O> | BaseOptionMap<O>;
3775
3853
  baseOption?: Record<string, unknown>;
3776
3854
  labelMap?: Record<string, string>;
3777
3855
  autoSelectOption?: boolean;
@@ -4124,7 +4202,7 @@ declare const regenerateIDs: <RG>(subject: RG, {
4124
4202
  /**
4125
4203
  * Options object for {@link index!transformQuery transformQuery}.
4126
4204
  */
4127
- interface TransformQueryOptions<RG$1 extends RuleGroupTypeAny = RuleGroupType> {
4205
+ interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
4128
4206
  /**
4129
4207
  * When a rule is encountered in the hierarchy, it will be replaced
4130
4208
  * with the result of this function.
@@ -4138,7 +4216,7 @@ interface TransformQueryOptions<RG$1 extends RuleGroupTypeAny = RuleGroupType> {
4138
4216
  *
4139
4217
  * @defaultValue `rg => rg`
4140
4218
  */
4141
- ruleGroupProcessor?: (ruleGroup: RG$1) => Record<string, any>;
4219
+ ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;
4142
4220
  /**
4143
4221
  * For each rule and group in the query, any properties matching a key
4144
4222
  * in this object will be renamed to the corresponding value. To retain both
@@ -424,7 +424,8 @@ const standardClassnames = {
424
424
  valueListItem: "rule-value-list-item",
425
425
  branches: "queryBuilder-branches",
426
426
  justified: "queryBuilder-justified",
427
- hasSubQuery: "rule-hasSubQuery"
427
+ hasSubQuery: "rule-hasSubQuery",
428
+ loading: "queryBuilder-loading"
428
429
  };
429
430
  /**
430
431
  * Default classnames for each component.
@@ -471,7 +472,8 @@ const defaultControlClassnames = {
471
472
  disabled: "",
472
473
  valueListItem: "",
473
474
  branches: "",
474
- hasSubQuery: ""
475
+ hasSubQuery: "",
476
+ loading: ""
475
477
  };
476
478
  /**
477
479
  * Default reason codes for a group being invalid.
@@ -693,7 +695,7 @@ const isRuleGroupType = (rg) => isRuleGroup(rg) && typeof rg.combinator === "str
693
695
  const isRuleGroupTypeIC = (rg) => isRuleGroup(rg) && rg.combinator === void 0;
694
696
 
695
697
  //#endregion
696
- //#region \0@oxc-project+runtime@0.95.0/helpers/typeof.js
698
+ //#region \0@oxc-project+runtime@0.96.0/helpers/typeof.js
697
699
  function _typeof(o) {
698
700
  "@babel/helpers - typeof";
699
701
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -704,7 +706,7 @@ function _typeof(o) {
704
706
  }
705
707
 
706
708
  //#endregion
707
- //#region \0@oxc-project+runtime@0.95.0/helpers/toPrimitive.js
709
+ //#region \0@oxc-project+runtime@0.96.0/helpers/toPrimitive.js
708
710
  function toPrimitive(t, r) {
709
711
  if ("object" != _typeof(t) || !t) return t;
710
712
  var e = t[Symbol.toPrimitive];
@@ -717,14 +719,14 @@ function toPrimitive(t, r) {
717
719
  }
718
720
 
719
721
  //#endregion
720
- //#region \0@oxc-project+runtime@0.95.0/helpers/toPropertyKey.js
722
+ //#region \0@oxc-project+runtime@0.96.0/helpers/toPropertyKey.js
721
723
  function toPropertyKey(t) {
722
724
  var i = toPrimitive(t, "string");
723
725
  return "symbol" == _typeof(i) ? i : i + "";
724
726
  }
725
727
 
726
728
  //#endregion
727
- //#region \0@oxc-project+runtime@0.95.0/helpers/defineProperty.js
729
+ //#region \0@oxc-project+runtime@0.96.0/helpers/defineProperty.js
728
730
  function _defineProperty(e, r, t) {
729
731
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
730
732
  value: t,
@@ -735,7 +737,7 @@ function _defineProperty(e, r, t) {
735
737
  }
736
738
 
737
739
  //#endregion
738
- //#region \0@oxc-project+runtime@0.95.0/helpers/objectSpread2.js
740
+ //#region \0@oxc-project+runtime@0.96.0/helpers/objectSpread2.js
739
741
  function ownKeys(e, r) {
740
742
  var t = Object.keys(e);
741
743
  if (Object.getOwnPropertySymbols) {
@@ -759,7 +761,7 @@ function _objectSpread2(e) {
759
761
  }
760
762
 
761
763
  //#endregion
762
- //#region \0@oxc-project+runtime@0.95.0/helpers/objectWithoutPropertiesLoose.js
764
+ //#region \0@oxc-project+runtime@0.96.0/helpers/objectWithoutPropertiesLoose.js
763
765
  function _objectWithoutPropertiesLoose(r, e) {
764
766
  if (null == r) return {};
765
767
  var t = {};
@@ -771,7 +773,7 @@ function _objectWithoutPropertiesLoose(r, e) {
771
773
  }
772
774
 
773
775
  //#endregion
774
- //#region \0@oxc-project+runtime@0.95.0/helpers/objectWithoutProperties.js
776
+ //#region \0@oxc-project+runtime@0.96.0/helpers/objectWithoutProperties.js
775
777
  function _objectWithoutProperties(e, t) {
776
778
  if (null == e) return {};
777
779
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
@@ -1101,7 +1103,7 @@ const prepareOptionList = (props) => {
1101
1103
  label: placeholderLabel
1102
1104
  };
1103
1105
  const optionsProp = optionListPropOriginal !== null && optionListPropOriginal !== void 0 ? optionListPropOriginal : [defaultOption];
1104
- let optionList = [];
1106
+ let optionList;
1105
1107
  const opts = Array.isArray(optionsProp) ? toFullOptionList(optionsProp, baseOption, labelMap) : objectKeys(toFullOptionMap(optionsProp, baseOption)).map((opt) => _objectSpread2(_objectSpread2({}, optionsProp[opt]), {}, {
1106
1108
  name: opt,
1107
1109
  value: opt
@@ -1186,6 +1188,13 @@ const parseNumber = (val, { parseNumbers, bigIntOnOverflow } = {}) => {
1186
1188
 
1187
1189
  //#endregion
1188
1190
  //#region src/utils/transformQuery.ts
1191
+ /**
1192
+ * Recursively steps through a query object ({@link index!RuleGroupType RuleGroupType} or {@link index!RuleGroupTypeIC RuleGroupTypeIC}),
1193
+ * passing each {@link index!RuleType RuleType} object to a provided `ruleProcessor` function and returning a
1194
+ * new query object if there were any referential changes.
1195
+ *
1196
+ * @module transformQuery
1197
+ */
1189
1198
  const remapProperties = (obj, propertyMap, deleteRemappedProperties) => produce(obj, (draft) => {
1190
1199
  for (const [k, v] of Object.entries(propertyMap)) if (v === false) delete draft[k];
1191
1200
  else if (!!v && k !== v && k in draft) {
@@ -1446,19 +1455,30 @@ const getNLTranslataion = (key, translations, conditions = []) => {
1446
1455
  var _ref, _translations$key, _ref2, _ref3, _Object$entries$find$, _Object$entries$find, _Object$entries$find2;
1447
1456
  return conditions.length === 0 ? (_ref = (_translations$key = translations[key]) !== null && _translations$key !== void 0 ? _translations$key : defaultNLTranslations[key]) !== null && _ref !== void 0 ? _ref : "" : (_ref2 = (_ref3 = (_Object$entries$find$ = (_Object$entries$find = Object.entries(translations).find(([keyToTest]) => translationMatchFilter(key, keyToTest, conditions))) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[1]) !== null && _Object$entries$find$ !== void 0 ? _Object$entries$find$ : (_Object$entries$find2 = Object.entries(defaultNLTranslations).find(([keyToTest]) => translationMatchFilter(key, keyToTest, conditions))) === null || _Object$entries$find2 === void 0 ? void 0 : _Object$entries$find2[1]) !== null && _ref3 !== void 0 ? _ref3 : defaultNLTranslations[key]) !== null && _ref2 !== void 0 ? _ref2 : "";
1448
1457
  };
1458
+ /**
1459
+ * Transforms
1460
+ * - `match: { mode: "atLeast", threshold: 1 }` to `match: { mode: "some" }`
1461
+ * - `match: { mode: "atMost", threshold: 0 }` to `match: { mode: "none" }`.
1462
+ *
1463
+ * Returns:
1464
+ * - Processed `{ mode, threshold }` object for valid subqueries
1465
+ * - `null` if match mode is not applicable for the rule
1466
+ * - `false` if match mode is valid, but either
1467
+ * 1. `threshold` is required and invalid, or
1468
+ * 2. `value` is not a valid rule group.
1469
+ */
1449
1470
  const processMatchMode = (rule) => {
1450
1471
  var _rule$match;
1451
1472
  const { mode, threshold } = (_rule$match = rule.match) !== null && _rule$match !== void 0 ? _rule$match : {};
1452
- if (mode) {
1453
- if (!isRuleGroup(rule.value)) return false;
1454
- const matchModeLC = lc(mode);
1455
- const matchModeCoerced = matchModeLC === "atleast" && threshold === 1 ? "some" : matchModeLC === "atmost" && threshold === 0 ? "none" : matchModeLC;
1456
- if ((matchModeCoerced === "atleast" || matchModeCoerced === "atmost" || matchModeCoerced === "exactly") && (typeof threshold !== "number" || threshold < 0)) return false;
1457
- return {
1458
- mode: matchModeCoerced,
1459
- threshold
1460
- };
1461
- }
1473
+ if (!mode) return null;
1474
+ if (!isRuleGroup(rule.value)) return false;
1475
+ const matchModeLC = lc(mode);
1476
+ const matchModeCoerced = matchModeLC === "atleast" && threshold === 1 ? "some" : matchModeLC === "atmost" && threshold === 0 ? "none" : matchModeLC;
1477
+ if ((matchModeCoerced === "atleast" || matchModeCoerced === "atmost" || matchModeCoerced === "exactly") && (typeof threshold !== "number" || threshold < 0)) return false;
1478
+ return {
1479
+ mode: matchModeCoerced,
1480
+ threshold
1481
+ };
1462
1482
  };
1463
1483
  /**
1464
1484
  * "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
@@ -3944,7 +3964,8 @@ const mergeClassnames = (...args) => ({
3944
3964
  matchMode: joinClassnamesByName("matchMode", args),
3945
3965
  matchThreshold: joinClassnamesByName("matchThreshold", args),
3946
3966
  branches: joinClassnamesByName("branches", args),
3947
- hasSubQuery: joinClassnamesByName("hasSubQuery", args)
3967
+ hasSubQuery: joinClassnamesByName("hasSubQuery", args),
3968
+ loading: joinClassnamesByName("loading", args)
3948
3969
  });
3949
3970
 
3950
3971
  //#endregion
@@ -3977,6 +3998,7 @@ const preferFlagProps = (props = {}, contextVals = {}, finalize) => objectEntrie
3977
3998
  */
3978
3999
  const prepareRule = (rule, { idGenerator = generateID } = {}) => produce(rule, (draft) => {
3979
4000
  if (!draft.id) draft.id = idGenerator();
4001
+ if (processMatchMode(draft)) draft.value = prepareRuleGroup(draft.value, { idGenerator });
3980
4002
  });
3981
4003
  /**
3982
4004
  * Ensures that a rule group is valid by recursively adding an `id` property to the group itself