@dreamcommerce/aurora 3.0.0-262 → 3.0.0-264

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 (59) hide show
  1. package/build/cjs/external/fast-equals/dist/esm/index.mjs.js +619 -0
  2. package/build/cjs/external/fast-equals/dist/esm/index.mjs.js.map +1 -0
  3. package/build/cjs/packages/aurora/src/components/color_picker/components/color_picker_mode_toggler.js +22 -10
  4. package/build/cjs/packages/aurora/src/components/color_picker/components/color_picker_mode_toggler.js.map +1 -1
  5. package/build/cjs/packages/aurora/src/components/controls/select_control/select_control.js +3 -3
  6. package/build/cjs/packages/aurora/src/components/select/components/select_content.js +35 -43
  7. package/build/cjs/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  8. package/build/cjs/packages/aurora/src/components/select/components/select_group_label.js +4 -4
  9. package/build/cjs/packages/aurora/src/components/select/components/select_item.js +12 -8
  10. package/build/cjs/packages/aurora/src/components/select/components/select_item.js.map +1 -1
  11. package/build/cjs/packages/aurora/src/components/select/components/select_search.js +36 -0
  12. package/build/cjs/packages/aurora/src/components/select/components/select_search.js.map +1 -0
  13. package/build/cjs/packages/aurora/src/components/select/components/select_trigger.js +7 -4
  14. package/build/cjs/packages/aurora/src/components/select/components/select_trigger.js.map +1 -1
  15. package/build/cjs/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js +49 -0
  16. package/build/cjs/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js.map +1 -0
  17. package/build/cjs/packages/aurora/src/components/select/hooks/use_select_value.js +39 -0
  18. package/build/cjs/packages/aurora/src/components/select/hooks/use_select_value.js.map +1 -0
  19. package/build/cjs/packages/aurora/src/components/select/select.js +56 -83
  20. package/build/cjs/packages/aurora/src/components/select/select.js.map +1 -1
  21. package/build/cjs/packages/aurora/src/components/select/select_utils.js +39 -0
  22. package/build/cjs/packages/aurora/src/components/select/select_utils.js.map +1 -0
  23. package/build/esm/external/fast-equals/dist/esm/index.mjs.js +606 -0
  24. package/build/esm/external/fast-equals/dist/esm/index.mjs.js.map +1 -0
  25. package/build/esm/packages/aurora/src/components/color_picker/components/color_picker_mode_toggler.js +22 -10
  26. package/build/esm/packages/aurora/src/components/color_picker/components/color_picker_mode_toggler.js.map +1 -1
  27. package/build/esm/packages/aurora/src/components/controls/select_control/select_control.js +3 -3
  28. package/build/esm/packages/aurora/src/components/select/components/select_content.js +39 -47
  29. package/build/esm/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  30. package/build/esm/packages/aurora/src/components/select/components/select_group_label.d.ts +2 -2
  31. package/build/esm/packages/aurora/src/components/select/components/select_group_label.js +4 -4
  32. package/build/esm/packages/aurora/src/components/select/components/select_item.js +13 -9
  33. package/build/esm/packages/aurora/src/components/select/components/select_item.js.map +1 -1
  34. package/build/esm/packages/aurora/src/components/select/components/select_search.d.ts +3 -0
  35. package/build/esm/packages/aurora/src/components/select/components/select_search.js +28 -0
  36. package/build/{cjs/packages/aurora/src/components/select/components/select_value.js.map → esm/packages/aurora/src/components/select/components/select_search.js.map} +1 -1
  37. package/build/esm/packages/aurora/src/components/select/components/select_trigger.js +7 -4
  38. package/build/esm/packages/aurora/src/components/select/components/select_trigger.js.map +1 -1
  39. package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.d.ts +4 -0
  40. package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js +45 -0
  41. package/build/esm/packages/aurora/src/components/select/hooks/use_prevent_search_blur.js.map +1 -0
  42. package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.d.ts +5 -0
  43. package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.js +35 -0
  44. package/build/esm/packages/aurora/src/components/select/hooks/use_select_value.js.map +1 -0
  45. package/build/esm/packages/aurora/src/components/select/select.d.ts +1 -1
  46. package/build/esm/packages/aurora/src/components/select/select.js +57 -84
  47. package/build/esm/packages/aurora/src/components/select/select.js.map +1 -1
  48. package/build/esm/packages/aurora/src/components/select/select_types.d.ts +23 -7
  49. package/build/esm/packages/aurora/src/components/select/select_types.js +1 -0
  50. package/build/esm/packages/aurora/src/components/select/select_types.js.map +1 -1
  51. package/build/esm/packages/aurora/src/components/select/select_utils.d.ts +6 -0
  52. package/build/esm/packages/aurora/src/components/select/select_utils.js +35 -0
  53. package/build/esm/packages/aurora/src/components/select/select_utils.js.map +1 -0
  54. package/build/index.css +1 -1
  55. package/package.json +2 -1
  56. package/build/cjs/packages/aurora/src/components/select/components/select_value.js +0 -10
  57. package/build/esm/packages/aurora/src/components/select/components/select_value.d.ts +0 -3
  58. package/build/esm/packages/aurora/src/components/select/components/select_value.js +0 -6
  59. package/build/esm/packages/aurora/src/components/select/components/select_value.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
6
+
7
+ var _SelectUtils;
8
+ var SelectUtils = /*#__PURE__*/_rollupPluginBabelHelpers.createClass(function SelectUtils() {
9
+ _rollupPluginBabelHelpers.classCallCheck(this, SelectUtils);
10
+ });
11
+ _SelectUtils = SelectUtils;
12
+ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "localSearchIsOptionVisible", function (option, search) {
13
+ return option.text.toLocaleLowerCase().includes(search.toLocaleLowerCase());
14
+ });
15
+ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "localSearchIsHeaderVisible", function (search, options, index) {
16
+ var visible = false;
17
+ var i = index + 1;
18
+ while (options[i]) {
19
+ var curr = options[i];
20
+ if (curr.isHeader) {
21
+ break;
22
+ }
23
+ if (_SelectUtils.localSearchIsOptionVisible(curr, search)) {
24
+ visible = true;
25
+ break;
26
+ }
27
+ i++;
28
+ }
29
+ return visible;
30
+ });
31
+ _rollupPluginBabelHelpers.defineProperty(SelectUtils, "findValueInOptions", function (value, options) {
32
+ if (!value) return undefined;
33
+ return options.find(function (opt) {
34
+ return opt.value === value;
35
+ });
36
+ });
37
+
38
+ exports.SelectUtils = SelectUtils;
39
+ //# sourceMappingURL=select_utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,606 @@
1
+ var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
2
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
3
+ /**
4
+ * Combine two comparators into a single comparators.
5
+ */
6
+ function combineComparators(comparatorA, comparatorB) {
7
+ return function isEqual(a, b, state) {
8
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
9
+ };
10
+ }
11
+ /**
12
+ * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
13
+ * for circular references to be safely included in the comparison without creating
14
+ * stack overflows.
15
+ */
16
+ function createIsCircular(areItemsEqual) {
17
+ return function isCircular(a, b, state) {
18
+ if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
19
+ return areItemsEqual(a, b, state);
20
+ }
21
+ var cache = state.cache;
22
+ var cachedA = cache.get(a);
23
+ var cachedB = cache.get(b);
24
+ if (cachedA && cachedB) {
25
+ return cachedA === b && cachedB === a;
26
+ }
27
+ cache.set(a, b);
28
+ cache.set(b, a);
29
+ var result = areItemsEqual(a, b, state);
30
+ cache.delete(a);
31
+ cache.delete(b);
32
+ return result;
33
+ };
34
+ }
35
+ /**
36
+ * Get the properties to strictly examine, which include both own properties that are
37
+ * not enumerable and symbol properties.
38
+ */
39
+ function getStrictProperties(object) {
40
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
41
+ }
42
+ /**
43
+ * Whether the object contains the property passed as an own property.
44
+ */
45
+ var hasOwn = Object.hasOwn ||
46
+ (function (object, property) {
47
+ return hasOwnProperty.call(object, property);
48
+ });
49
+ /**
50
+ * Whether the values passed are strictly equal or both NaN.
51
+ */
52
+ function sameValueZeroEqual(a, b) {
53
+ return a === b || (!a && !b && a !== a && b !== b);
54
+ }
55
+
56
+ var PREACT_VNODE = '__v';
57
+ var PREACT_OWNER = '__o';
58
+ var REACT_OWNER = '_owner';
59
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
60
+ /**
61
+ * Whether the arrays are equal in value.
62
+ */
63
+ function areArraysEqual(a, b, state) {
64
+ var index = a.length;
65
+ if (b.length !== index) {
66
+ return false;
67
+ }
68
+ while (index-- > 0) {
69
+ if (!state.equals(a[index], b[index], index, index, a, b, state)) {
70
+ return false;
71
+ }
72
+ }
73
+ return true;
74
+ }
75
+ /**
76
+ * Whether the dates passed are equal in value.
77
+ */
78
+ function areDatesEqual(a, b) {
79
+ return sameValueZeroEqual(a.getTime(), b.getTime());
80
+ }
81
+ /**
82
+ * Whether the errors passed are equal in value.
83
+ */
84
+ function areErrorsEqual(a, b) {
85
+ return (a.name === b.name &&
86
+ a.message === b.message &&
87
+ a.cause === b.cause &&
88
+ a.stack === b.stack);
89
+ }
90
+ /**
91
+ * Whether the functions passed are equal in value.
92
+ */
93
+ function areFunctionsEqual(a, b) {
94
+ return a === b;
95
+ }
96
+ /**
97
+ * Whether the `Map`s are equal in value.
98
+ */
99
+ function areMapsEqual(a, b, state) {
100
+ var size = a.size;
101
+ if (size !== b.size) {
102
+ return false;
103
+ }
104
+ if (!size) {
105
+ return true;
106
+ }
107
+ var matchedIndices = new Array(size);
108
+ var aIterable = a.entries();
109
+ var aResult;
110
+ var bResult;
111
+ var index = 0;
112
+ while ((aResult = aIterable.next())) {
113
+ if (aResult.done) {
114
+ break;
115
+ }
116
+ var bIterable = b.entries();
117
+ var hasMatch = false;
118
+ var matchIndex = 0;
119
+ while ((bResult = bIterable.next())) {
120
+ if (bResult.done) {
121
+ break;
122
+ }
123
+ if (matchedIndices[matchIndex]) {
124
+ matchIndex++;
125
+ continue;
126
+ }
127
+ var aEntry = aResult.value;
128
+ var bEntry = bResult.value;
129
+ if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) &&
130
+ state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
131
+ hasMatch = matchedIndices[matchIndex] = true;
132
+ break;
133
+ }
134
+ matchIndex++;
135
+ }
136
+ if (!hasMatch) {
137
+ return false;
138
+ }
139
+ index++;
140
+ }
141
+ return true;
142
+ }
143
+ /**
144
+ * Whether the numbers are equal in value.
145
+ */
146
+ var areNumbersEqual = sameValueZeroEqual;
147
+ /**
148
+ * Whether the objects are equal in value.
149
+ */
150
+ function areObjectsEqual(a, b, state) {
151
+ var properties = keys(a);
152
+ var index = properties.length;
153
+ if (keys(b).length !== index) {
154
+ return false;
155
+ }
156
+ // Decrementing `while` showed faster results than either incrementing or
157
+ // decrementing `for` loop and than an incrementing `while` loop. Declarative
158
+ // methods like `some` / `every` were not used to avoid incurring the garbage
159
+ // cost of anonymous callbacks.
160
+ while (index-- > 0) {
161
+ if (!isPropertyEqual(a, b, state, properties[index])) {
162
+ return false;
163
+ }
164
+ }
165
+ return true;
166
+ }
167
+ /**
168
+ * Whether the objects are equal in value with strict property checking.
169
+ */
170
+ function areObjectsEqualStrict(a, b, state) {
171
+ var properties = getStrictProperties(a);
172
+ var index = properties.length;
173
+ if (getStrictProperties(b).length !== index) {
174
+ return false;
175
+ }
176
+ var property;
177
+ var descriptorA;
178
+ var descriptorB;
179
+ // Decrementing `while` showed faster results than either incrementing or
180
+ // decrementing `for` loop and than an incrementing `while` loop. Declarative
181
+ // methods like `some` / `every` were not used to avoid incurring the garbage
182
+ // cost of anonymous callbacks.
183
+ while (index-- > 0) {
184
+ property = properties[index];
185
+ if (!isPropertyEqual(a, b, state, property)) {
186
+ return false;
187
+ }
188
+ descriptorA = getOwnPropertyDescriptor(a, property);
189
+ descriptorB = getOwnPropertyDescriptor(b, property);
190
+ if ((descriptorA || descriptorB) &&
191
+ (!descriptorA ||
192
+ !descriptorB ||
193
+ descriptorA.configurable !== descriptorB.configurable ||
194
+ descriptorA.enumerable !== descriptorB.enumerable ||
195
+ descriptorA.writable !== descriptorB.writable)) {
196
+ return false;
197
+ }
198
+ }
199
+ return true;
200
+ }
201
+ /**
202
+ * Whether the primitive wrappers passed are equal in value.
203
+ */
204
+ function arePrimitiveWrappersEqual(a, b) {
205
+ return sameValueZeroEqual(a.valueOf(), b.valueOf());
206
+ }
207
+ /**
208
+ * Whether the regexps passed are equal in value.
209
+ */
210
+ function areRegExpsEqual(a, b) {
211
+ return a.source === b.source && a.flags === b.flags;
212
+ }
213
+ /**
214
+ * Whether the `Set`s are equal in value.
215
+ */
216
+ function areSetsEqual(a, b, state) {
217
+ var size = a.size;
218
+ if (size !== b.size) {
219
+ return false;
220
+ }
221
+ if (!size) {
222
+ return true;
223
+ }
224
+ var matchedIndices = new Array(size);
225
+ var aIterable = a.values();
226
+ var aResult;
227
+ var bResult;
228
+ while ((aResult = aIterable.next())) {
229
+ if (aResult.done) {
230
+ break;
231
+ }
232
+ var bIterable = b.values();
233
+ var hasMatch = false;
234
+ var matchIndex = 0;
235
+ while ((bResult = bIterable.next())) {
236
+ if (bResult.done) {
237
+ break;
238
+ }
239
+ if (!matchedIndices[matchIndex] &&
240
+ state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
241
+ hasMatch = matchedIndices[matchIndex] = true;
242
+ break;
243
+ }
244
+ matchIndex++;
245
+ }
246
+ if (!hasMatch) {
247
+ return false;
248
+ }
249
+ }
250
+ return true;
251
+ }
252
+ /**
253
+ * Whether the TypedArray instances are equal in value.
254
+ */
255
+ function areTypedArraysEqual(a, b) {
256
+ var index = a.length;
257
+ if (b.length !== index) {
258
+ return false;
259
+ }
260
+ while (index-- > 0) {
261
+ if (a[index] !== b[index]) {
262
+ return false;
263
+ }
264
+ }
265
+ return true;
266
+ }
267
+ /**
268
+ * Whether the URL instances are equal in value.
269
+ */
270
+ function areUrlsEqual(a, b) {
271
+ return (a.hostname === b.hostname &&
272
+ a.pathname === b.pathname &&
273
+ a.protocol === b.protocol &&
274
+ a.port === b.port &&
275
+ a.hash === b.hash &&
276
+ a.username === b.username &&
277
+ a.password === b.password);
278
+ }
279
+ function isPropertyEqual(a, b, state, property) {
280
+ if ((property === REACT_OWNER ||
281
+ property === PREACT_OWNER ||
282
+ property === PREACT_VNODE) &&
283
+ (a.$$typeof || b.$$typeof)) {
284
+ return true;
285
+ }
286
+ return (hasOwn(b, property) &&
287
+ state.equals(a[property], b[property], property, property, a, b, state));
288
+ }
289
+
290
+ var ARGUMENTS_TAG = '[object Arguments]';
291
+ var BOOLEAN_TAG = '[object Boolean]';
292
+ var DATE_TAG = '[object Date]';
293
+ var ERROR_TAG = '[object Error]';
294
+ var MAP_TAG = '[object Map]';
295
+ var NUMBER_TAG = '[object Number]';
296
+ var OBJECT_TAG = '[object Object]';
297
+ var REG_EXP_TAG = '[object RegExp]';
298
+ var SET_TAG = '[object Set]';
299
+ var STRING_TAG = '[object String]';
300
+ var URL_TAG = '[object URL]';
301
+ var isArray = Array.isArray;
302
+ var isTypedArray = typeof ArrayBuffer === 'function' && ArrayBuffer.isView
303
+ ? ArrayBuffer.isView
304
+ : null;
305
+ var assign = Object.assign;
306
+ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
307
+ /**
308
+ * Create a comparator method based on the type-specific equality comparators passed.
309
+ */
310
+ function createEqualityComparator(_a) {
311
+ var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areErrorsEqual = _a.areErrorsEqual, areFunctionsEqual = _a.areFunctionsEqual, areMapsEqual = _a.areMapsEqual, areNumbersEqual = _a.areNumbersEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual, areUrlsEqual = _a.areUrlsEqual;
312
+ /**
313
+ * compare the value of the two objects and return true if they are equivalent in values
314
+ */
315
+ return function comparator(a, b, state) {
316
+ // If the items are strictly equal, no need to do a value comparison.
317
+ if (a === b) {
318
+ return true;
319
+ }
320
+ // If either of the items are nullish and fail the strictly equal check
321
+ // above, then they must be unequal.
322
+ if (a == null || b == null) {
323
+ return false;
324
+ }
325
+ var type = typeof a;
326
+ if (type !== typeof b) {
327
+ return false;
328
+ }
329
+ if (type !== 'object') {
330
+ if (type === 'number') {
331
+ return areNumbersEqual(a, b, state);
332
+ }
333
+ if (type === 'function') {
334
+ return areFunctionsEqual(a, b, state);
335
+ }
336
+ // If a primitive value that is not strictly equal, it must be unequal.
337
+ return false;
338
+ }
339
+ var constructor = a.constructor;
340
+ // Checks are listed in order of commonality of use-case:
341
+ // 1. Common complex object types (plain object, array)
342
+ // 2. Common data values (date, regexp)
343
+ // 3. Less-common complex object types (map, set)
344
+ // 4. Less-common data values (promise, primitive wrappers)
345
+ // Inherently this is both subjective and assumptive, however
346
+ // when reviewing comparable libraries in the wild this order
347
+ // appears to be generally consistent.
348
+ // Constructors should match, otherwise there is potential for false positives
349
+ // between class and subclass or custom object and POJO.
350
+ if (constructor !== b.constructor) {
351
+ return false;
352
+ }
353
+ // `isPlainObject` only checks against the object's own realm. Cross-realm
354
+ // comparisons are rare, and will be handled in the ultimate fallback, so
355
+ // we can avoid capturing the string tag.
356
+ if (constructor === Object) {
357
+ return areObjectsEqual(a, b, state);
358
+ }
359
+ // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
360
+ // the string tag or doing an `instanceof` check.
361
+ if (isArray(a)) {
362
+ return areArraysEqual(a, b, state);
363
+ }
364
+ // `isTypedArray()` works on all possible TypedArray classes, so we can avoid
365
+ // capturing the string tag or comparing against all possible constructors.
366
+ if (isTypedArray != null && isTypedArray(a)) {
367
+ return areTypedArraysEqual(a, b, state);
368
+ }
369
+ // Try to fast-path equality checks for other complex object types in the
370
+ // same realm to avoid capturing the string tag. Strict equality is used
371
+ // instead of `instanceof` because it is more performant for the common
372
+ // use-case. If someone is subclassing a native class, it will be handled
373
+ // with the string tag comparison.
374
+ if (constructor === Date) {
375
+ return areDatesEqual(a, b, state);
376
+ }
377
+ if (constructor === RegExp) {
378
+ return areRegExpsEqual(a, b, state);
379
+ }
380
+ if (constructor === Map) {
381
+ return areMapsEqual(a, b, state);
382
+ }
383
+ if (constructor === Set) {
384
+ return areSetsEqual(a, b, state);
385
+ }
386
+ // Since this is a custom object, capture the string tag to determing its type.
387
+ // This is reasonably performant in modern environments like v8 and SpiderMonkey.
388
+ var tag = getTag(a);
389
+ if (tag === DATE_TAG) {
390
+ return areDatesEqual(a, b, state);
391
+ }
392
+ // For RegExp, the properties are not enumerable, and therefore will give false positives if
393
+ // tested like a standard object.
394
+ if (tag === REG_EXP_TAG) {
395
+ return areRegExpsEqual(a, b, state);
396
+ }
397
+ if (tag === MAP_TAG) {
398
+ return areMapsEqual(a, b, state);
399
+ }
400
+ if (tag === SET_TAG) {
401
+ return areSetsEqual(a, b, state);
402
+ }
403
+ if (tag === OBJECT_TAG) {
404
+ // The exception for value comparison is custom `Promise`-like class instances. These should
405
+ // be treated the same as standard `Promise` objects, which means strict equality, and if
406
+ // it reaches this point then that strict equality comparison has already failed.
407
+ return (typeof a.then !== 'function' &&
408
+ typeof b.then !== 'function' &&
409
+ areObjectsEqual(a, b, state));
410
+ }
411
+ // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
412
+ // enumerable, and therefore will give false positives if tested like a standard object.
413
+ if (tag === URL_TAG) {
414
+ return areUrlsEqual(a, b, state);
415
+ }
416
+ // If an error tag, it should be tested explicitly. Like RegExp, the properties are not
417
+ // enumerable, and therefore will give false positives if tested like a standard object.
418
+ if (tag === ERROR_TAG) {
419
+ return areErrorsEqual(a, b, state);
420
+ }
421
+ // If an arguments tag, it should be treated as a standard object.
422
+ if (tag === ARGUMENTS_TAG) {
423
+ return areObjectsEqual(a, b, state);
424
+ }
425
+ // As the penultimate fallback, check if the values passed are primitive wrappers. This
426
+ // is very rare in modern JS, which is why it is deprioritized compared to all other object
427
+ // types.
428
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
429
+ return arePrimitiveWrappersEqual(a, b, state);
430
+ }
431
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
432
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
433
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
434
+ // comparison that can be made.
435
+ // - For types that can be introspected, but rarely have requirements to be compared
436
+ // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
437
+ // use-cases (may be included in a future release, if requested enough).
438
+ // - For types that can be introspected but do not have an objective definition of what
439
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
440
+ // In all cases, these decisions should be reevaluated based on changes to the language and
441
+ // common development practices.
442
+ return false;
443
+ };
444
+ }
445
+ /**
446
+ * Create the configuration object used for building comparators.
447
+ */
448
+ function createEqualityComparatorConfig(_a) {
449
+ var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
450
+ var config = {
451
+ areArraysEqual: strict
452
+ ? areObjectsEqualStrict
453
+ : areArraysEqual,
454
+ areDatesEqual: areDatesEqual,
455
+ areErrorsEqual: areErrorsEqual,
456
+ areFunctionsEqual: areFunctionsEqual,
457
+ areMapsEqual: strict
458
+ ? combineComparators(areMapsEqual, areObjectsEqualStrict)
459
+ : areMapsEqual,
460
+ areNumbersEqual: areNumbersEqual,
461
+ areObjectsEqual: strict
462
+ ? areObjectsEqualStrict
463
+ : areObjectsEqual,
464
+ arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
465
+ areRegExpsEqual: areRegExpsEqual,
466
+ areSetsEqual: strict
467
+ ? combineComparators(areSetsEqual, areObjectsEqualStrict)
468
+ : areSetsEqual,
469
+ areTypedArraysEqual: strict
470
+ ? areObjectsEqualStrict
471
+ : areTypedArraysEqual,
472
+ areUrlsEqual: areUrlsEqual,
473
+ };
474
+ if (createCustomConfig) {
475
+ config = assign({}, config, createCustomConfig(config));
476
+ }
477
+ if (circular) {
478
+ var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
479
+ var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
480
+ var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
481
+ var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
482
+ config = assign({}, config, {
483
+ areArraysEqual: areArraysEqual$1,
484
+ areMapsEqual: areMapsEqual$1,
485
+ areObjectsEqual: areObjectsEqual$1,
486
+ areSetsEqual: areSetsEqual$1,
487
+ });
488
+ }
489
+ return config;
490
+ }
491
+ /**
492
+ * Default equality comparator pass-through, used as the standard `isEqual` creator for
493
+ * use inside the built comparator.
494
+ */
495
+ function createInternalEqualityComparator(compare) {
496
+ return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
497
+ return compare(a, b, state);
498
+ };
499
+ }
500
+ /**
501
+ * Create the `isEqual` function used by the consuming application.
502
+ */
503
+ function createIsEqual(_a) {
504
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
505
+ if (createState) {
506
+ return function isEqual(a, b) {
507
+ var _a = createState(), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, meta = _a.meta;
508
+ return comparator(a, b, {
509
+ cache: cache,
510
+ equals: equals,
511
+ meta: meta,
512
+ strict: strict,
513
+ });
514
+ };
515
+ }
516
+ if (circular) {
517
+ return function isEqual(a, b) {
518
+ return comparator(a, b, {
519
+ cache: new WeakMap(),
520
+ equals: equals,
521
+ meta: undefined,
522
+ strict: strict,
523
+ });
524
+ };
525
+ }
526
+ var state = {
527
+ cache: undefined,
528
+ equals: equals,
529
+ meta: undefined,
530
+ strict: strict,
531
+ };
532
+ return function isEqual(a, b) {
533
+ return comparator(a, b, state);
534
+ };
535
+ }
536
+
537
+ /**
538
+ * Whether the items passed are deeply-equal in value.
539
+ */
540
+ var deepEqual = createCustomEqual();
541
+ /**
542
+ * Whether the items passed are deeply-equal in value based on strict comparison.
543
+ */
544
+ var strictDeepEqual = createCustomEqual({ strict: true });
545
+ /**
546
+ * Whether the items passed are deeply-equal in value, including circular references.
547
+ */
548
+ var circularDeepEqual = createCustomEqual({ circular: true });
549
+ /**
550
+ * Whether the items passed are deeply-equal in value, including circular references,
551
+ * based on strict comparison.
552
+ */
553
+ var strictCircularDeepEqual = createCustomEqual({
554
+ circular: true,
555
+ strict: true,
556
+ });
557
+ /**
558
+ * Whether the items passed are shallowly-equal in value.
559
+ */
560
+ var shallowEqual = createCustomEqual({
561
+ createInternalComparator: function () { return sameValueZeroEqual; },
562
+ });
563
+ /**
564
+ * Whether the items passed are shallowly-equal in value based on strict comparison
565
+ */
566
+ var strictShallowEqual = createCustomEqual({
567
+ strict: true,
568
+ createInternalComparator: function () { return sameValueZeroEqual; },
569
+ });
570
+ /**
571
+ * Whether the items passed are shallowly-equal in value, including circular references.
572
+ */
573
+ var circularShallowEqual = createCustomEqual({
574
+ circular: true,
575
+ createInternalComparator: function () { return sameValueZeroEqual; },
576
+ });
577
+ /**
578
+ * Whether the items passed are shallowly-equal in value, including circular references,
579
+ * based on strict comparison.
580
+ */
581
+ var strictCircularShallowEqual = createCustomEqual({
582
+ circular: true,
583
+ createInternalComparator: function () { return sameValueZeroEqual; },
584
+ strict: true,
585
+ });
586
+ /**
587
+ * Create a custom equality comparison method.
588
+ *
589
+ * This can be done to create very targeted comparisons in extreme hot-path scenarios
590
+ * where the standard methods are not performant enough, but can also be used to provide
591
+ * support for legacy environments that do not support expected features like
592
+ * `RegExp.prototype.flags` out of the box.
593
+ */
594
+ function createCustomEqual(options) {
595
+ if (options === void 0) { options = {}; }
596
+ var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
597
+ var config = createEqualityComparatorConfig(options);
598
+ var comparator = createEqualityComparator(config);
599
+ var equals = createCustomInternalComparator
600
+ ? createCustomInternalComparator(comparator)
601
+ : createInternalEqualityComparator(comparator);
602
+ return createIsEqual({ circular: circular, comparator: comparator, createState: createState, equals: equals, strict: strict });
603
+ }
604
+
605
+ export { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };
606
+ //# sourceMappingURL=index.mjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}