likec4 1.59.4 → 1.61.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 (186) hide show
  1. package/README.md +2 -0
  2. package/__app__/codegen/react.mjs +4 -10
  3. package/__app__/codegen/webcomponent.mjs +6 -131
  4. package/__app__/index.html +15 -15
  5. package/__app__/src/aichat/index.mjs +11 -7
  6. package/__app__/src/chunks/AIChat.mjs +1355 -739
  7. package/__app__/src/chunks/ErrorComponent.mjs +444 -0
  8. package/__app__/src/chunks/Header.mjs +269 -0
  9. package/__app__/src/chunks/ViewReact.mjs +438 -0
  10. package/__app__/src/chunks/find.mjs +38 -0
  11. package/__app__/src/chunks/hooks.mjs +158 -472
  12. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +340 -0
  13. package/__app__/src/chunks/libs/@tanstack-ai.mjs +11841 -1417
  14. package/__app__/src/chunks/libs/@tanstack.mjs +5110 -2404
  15. package/__app__/src/chunks/libs/fast-equals.mjs +507 -214
  16. package/__app__/src/chunks/libs/html-to-image.mjs +613 -0
  17. package/__app__/src/chunks/libs/nanostores.mjs +170 -0
  18. package/__app__/src/chunks/libs/react-resizable-panels.mjs +2792 -0
  19. package/__app__/src/chunks/react.mjs +22 -0
  20. package/__app__/src/chunks/rolldown-runtime.mjs +16 -29
  21. package/__app__/src/chunks/router.mjs +106 -0
  22. package/__app__/src/chunks/scope.mjs +106 -0
  23. package/__app__/src/chunks/searchParams.mjs +29 -0
  24. package/__app__/src/chunks/single-index.mjs +465 -0
  25. package/__app__/src/chunks/styled-system.mjs +1826 -2528
  26. package/__app__/src/chunks/useAsync.mjs +69 -0
  27. package/__app__/src/chunks/useSyncedRef.mjs +16 -0
  28. package/__app__/src/components/ColorSchemeToggle.mjs +124 -0
  29. package/__app__/src/components/CopyToClipboard.mjs +53 -0
  30. package/__app__/src/components/ErrorComponent.mjs +1 -0
  31. package/__app__/src/components/NavigationPanel.mjs +63 -0
  32. package/__app__/src/components/NotFound.mjs +155 -0
  33. package/__app__/src/components/ViewOutlet.mjs +9 -0
  34. package/__app__/src/components/model-diff/CompareModelProvider.mjs +44 -0
  35. package/__app__/src/components/model-diff/ModelDiffPanel.mjs +179 -0
  36. package/__app__/src/components/model-diff/compare-model.mjs +76 -0
  37. package/__app__/src/components/model-diff/state.mjs +45 -0
  38. package/__app__/src/components/search/OverviewSearch.mjs +92 -0
  39. package/__app__/src/components/search/OverviewSearchAdapter.mjs +94 -0
  40. package/__app__/src/components/sidebar/DiagramTree.css.mjs +48 -0
  41. package/__app__/src/components/sidebar/DiagramsTree.mjs +304 -0
  42. package/__app__/src/components/sidebar/Drawer.mjs +178 -0
  43. package/__app__/src/components/sidebar/SidebarBurger.mjs +28 -0
  44. package/__app__/src/components/sidebar/data.mjs +94 -0
  45. package/__app__/src/components/sidebar/state.mjs +16 -0
  46. package/__app__/src/components/view-page/Header.mjs +1 -0
  47. package/__app__/src/components/view-page/SelectProject.mjs +258 -0
  48. package/__app__/src/components/view-page/ShareModal.mjs +111 -0
  49. package/__app__/src/components/view-page/share-modal/AlertLocalhost.mjs +31 -0
  50. package/__app__/src/components/view-page/share-modal/CopyButtonChild.mjs +36 -0
  51. package/__app__/src/components/view-page/share-modal/EmbedPanel.mjs +100 -0
  52. package/__app__/src/components/view-page/share-modal/WebcomponentsPanel.mjs +264 -0
  53. package/__app__/src/components/view-page/state.mjs +17 -0
  54. package/__app__/src/context/LikeC4CustomizationContext.mjs +26 -0
  55. package/__app__/src/context/LikeC4IconRendererContext.mjs +29 -0
  56. package/__app__/src/context/LikeC4ModelContext.mjs +34 -0
  57. package/__app__/src/context/LikeC4ProjectsContext.mjs +40 -0
  58. package/__app__/src/context/ModelDiffsContext.mjs +33 -0
  59. package/__app__/src/context/safeCtx.mjs +14 -0
  60. package/__app__/src/fonts.css +112 -1
  61. package/__app__/src/hooks.mjs +1 -0
  62. package/__app__/src/main.mjs +6 -29151
  63. package/__app__/src/pages/EmbedPage.mjs +93 -0
  64. package/__app__/src/pages/ExportPage.mjs +691 -0
  65. package/__app__/src/pages/ProjectsOverview.mjs +23 -0
  66. package/__app__/src/pages/ViewAsD2.mjs +105 -0
  67. package/__app__/src/pages/ViewAsDot.mjs +65 -0
  68. package/__app__/src/pages/ViewAsMmd.mjs +109 -0
  69. package/__app__/src/pages/ViewAsPuml.mjs +105 -0
  70. package/__app__/src/pages/ViewEditor.mjs +220 -0
  71. package/__app__/src/pages/ViewReact.mjs +1 -0
  72. package/__app__/src/pages/export-layout.mjs +95 -0
  73. package/__app__/src/pages/export-page-params.mjs +9 -0
  74. package/__app__/src/pages/styles.css.mjs +23 -0
  75. package/__app__/src/routeTree.gen.mjs +105 -0
  76. package/__app__/src/router.mjs +1 -0
  77. package/__app__/src/routes/__root.mjs +65 -0
  78. package/__app__/src/routes/index.css.mjs +29 -0
  79. package/__app__/src/routes/index.mjs +32 -0
  80. package/__app__/src/routes/project._projectId/-components.mjs +100 -0
  81. package/__app__/src/routes/project._projectId/embed._viewId.mjs +5 -0
  82. package/__app__/src/routes/project._projectId/export._viewId.mjs +24 -0
  83. package/__app__/src/routes/project._projectId/index.mjs +14 -0
  84. package/__app__/src/routes/project._projectId/route.mjs +93 -0
  85. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +34 -0
  86. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +41 -0
  87. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +7 -0
  88. package/__app__/src/routes/project._projectId/view._viewId.mjs +23 -0
  89. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +39 -0
  90. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +34 -0
  91. package/__app__/src/routes/projects.mjs +36 -0
  92. package/__app__/src/routes/single-index.mjs +1 -0
  93. package/__app__/src/routes/webcomponent._.mjs +94 -0
  94. package/__app__/src/style.css +18497 -1
  95. package/config/schema.json +146 -97
  96. package/dist/app/render-view-client.css +1 -1
  97. package/dist/app/render-view-client.js +394 -238
  98. package/dist/chunks/enableServer.mjs +1 -1
  99. package/dist/chunks/filenames.mjs +25 -17
  100. package/dist/chunks/generate-likec4.mjs +5 -0
  101. package/dist/chunks/index.d.mts +255 -194
  102. package/dist/chunks/index2.d.mts +8246 -3610
  103. package/dist/chunks/libs/@chenglou/pretext.mjs +9 -0
  104. package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
  105. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
  106. package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
  107. package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
  108. package/dist/chunks/libs/@ts-graphviz/common.d.mts +2 -4
  109. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  110. package/dist/chunks/libs/birpc.mjs +1 -1
  111. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  112. package/dist/chunks/libs/chevrotain.mjs +88 -36
  113. package/dist/chunks/libs/clone.mjs +1 -0
  114. package/dist/chunks/libs/eventemitter3.mjs +1 -1
  115. package/dist/chunks/libs/fast-equals.mjs +1 -0
  116. package/dist/chunks/libs/fontkit.mjs +1 -0
  117. package/dist/chunks/libs/json5.mjs +4 -4
  118. package/dist/chunks/libs/langium.d.mts +6707 -6715
  119. package/dist/chunks/libs/langium.mjs +16 -24
  120. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -1
  123. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  124. package/dist/chunks/libs/pako.mjs +1 -1
  125. package/dist/chunks/libs/pathe.mjs +1 -1
  126. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  127. package/dist/chunks/libs/remeda.mjs +1 -1
  128. package/dist/chunks/libs/ufo.mjs +1 -1
  129. package/dist/chunks/libs/unstorage.mjs +1 -1
  130. package/dist/chunks/libs/which.mjs +1 -1
  131. package/dist/chunks/node.mjs +111 -77
  132. package/dist/chunks/rolldown-runtime.mjs +1 -1
  133. package/dist/chunks/sequence-view.mjs +1 -1
  134. package/dist/chunks/vite-plugin.mjs +185 -166
  135. package/dist/cli/index.mjs +254 -1306
  136. package/dist/config/index.d.mts +66 -5
  137. package/dist/config/index.mjs +1 -1
  138. package/dist/generators/likec4.d.mts +6530 -0
  139. package/dist/generators/likec4.mjs +1 -0
  140. package/dist/index.d.mts +2 -4
  141. package/dist/model/index.d.mts +0 -7
  142. package/dist/vite-plugin/index.d.mts +83 -58
  143. package/dist/vite-plugin/index.mjs +1 -1
  144. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +8 -0
  145. package/dist/vite-plugin/internal/index.d.mts +92 -17
  146. package/dist/vite-plugin/internal/index.mjs +225 -126
  147. package/generators/likec4/package.json +4 -0
  148. package/package.json +134 -122
  149. package/react/index.d.mts +7496 -26659
  150. package/react/index.mjs +533 -63936
  151. package/react/rolldown-runtime-CfRud99p.js +1 -0
  152. package/skills/likec4-dsl/SKILL.md +474 -0
  153. package/skills/likec4-dsl/evals/evals-public.json +207 -0
  154. package/skills/likec4-dsl/evals/grading-spec.json +603 -0
  155. package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
  156. package/skills/likec4-dsl/references/cli.md +168 -0
  157. package/skills/likec4-dsl/references/configuration.md +266 -0
  158. package/skills/likec4-dsl/references/deployment.md +160 -0
  159. package/skills/likec4-dsl/references/diffs.md +52 -0
  160. package/skills/likec4-dsl/references/dynamic-views.md +455 -0
  161. package/skills/likec4-dsl/references/examples.md +370 -0
  162. package/skills/likec4-dsl/references/identifier-validity.md +90 -0
  163. package/skills/likec4-dsl/references/include-predicates-wildcards.md +180 -0
  164. package/skills/likec4-dsl/references/model.md +182 -0
  165. package/skills/likec4-dsl/references/predicates.md +123 -0
  166. package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
  167. package/skills/likec4-dsl/references/specification.md +79 -0
  168. package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
  169. package/skills/likec4-dsl/references/troubleshooting.md +101 -0
  170. package/skills/likec4-dsl/references/views.md +329 -0
  171. package/vite-plugin-modules.d.ts +126 -51
  172. package/__app__/src/chunks/LikeC4Styles.mjs +0 -2306
  173. package/__app__/src/chunks/ProjectsOverview.mjs +0 -537
  174. package/__app__/src/chunks/es.mjs +0 -439
  175. package/__app__/src/chunks/libs/@floating-ui.mjs +0 -2532
  176. package/__app__/src/chunks/libs/@mantine.mjs +0 -13868
  177. package/__app__/src/chunks/libs/@xstate/react.mjs +0 -2015
  178. package/__app__/src/chunks/libs/@xyflow/react.mjs +0 -5367
  179. package/__app__/src/chunks/libs/bezier-js.mjs +0 -1007
  180. package/__app__/src/chunks/libs/d3.mjs +0 -2817
  181. package/__app__/src/chunks/libs/framer.mjs +0 -5926
  182. package/__app__/src/chunks/libs/zod.mjs +0 -3176
  183. package/dist/chunks/libs/@chevrotain/types.d.mts +0 -108
  184. package/dist/chunks/libs/picomatch.mjs +0 -1
  185. package/dist/chunks/libs/zod.d.mts +0 -3840
  186. package/dist/chunks/libs/zod.mjs +0 -65
@@ -1,281 +1,574 @@
1
1
  import "../rolldown-runtime.mjs";
2
- //#region ../../node_modules/.pnpm/fast-equals@6.0.3/node_modules/fast-equals/dist/es/index.mjs
3
- var { getOwnPropertyNames: e, getOwnPropertySymbols: t } = Object, { hasOwnProperty: n } = Object.prototype;
4
- function combineComparators(e, t) {
5
- return function isEqual(n, r, i) {
6
- return e(n, r, i) && t(n, r, i);
2
+ // ../../node_modules/.pnpm/fast-equals@6.2.2/node_modules/fast-equals/dist/es/index.mjs
3
+ var { getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols } = Object;
4
+ var { hasOwnProperty, toString: toString$1 } = Object.prototype;
5
+ var OBJECT_TAG = "[object Object]";
6
+ /**
7
+ * Whether the own properties from `end` onward are equal with strict property checking, where the
8
+ * caller has already verified that both objects have the same number of own properties.
9
+ */
10
+ function areStrictPropertiesEqual(a, b, state, properties, end) {
11
+ let index = properties.length;
12
+ let property;
13
+ let descriptorA;
14
+ let descriptorB;
15
+ while (index-- > end) {
16
+ property = properties[index];
17
+ if (!isReactProperty(a, b, property) && (!hasOwn(b, property) || !state.equals(a[property], b[property], property, property, a, b, state))) return false;
18
+ descriptorA = getOwnPropertyDescriptor(a, property);
19
+ descriptorB = getOwnPropertyDescriptor(b, property);
20
+ if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) return false;
21
+ }
22
+ return true;
23
+ }
24
+ /**
25
+ * Combine two comparators into a single comparators.
26
+ */
27
+ function combineComparators(comparatorA, comparatorB) {
28
+ return function isEqual(a, b, state) {
29
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
7
30
  };
8
31
  }
9
- function createIsCircular(e) {
10
- return function isCircular(t, n, r) {
11
- if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
12
- let { cache: i } = r, a = i.get(t), o = i.get(n);
13
- if (a && o) return a === n && o === t;
14
- i.set(t, n), i.set(n, t);
15
- let s = e(t, n, r);
16
- return i.delete(t), i.delete(n), s;
32
+ /**
33
+ * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
34
+ * for circular references to be safely included in the comparison without creating
35
+ * stack overflows.
36
+ */
37
+ function createIsCircular(areItemsEqual) {
38
+ return function isCircular(a, b, state) {
39
+ if (!a || !b || typeof a !== "object" || typeof b !== "object") return areItemsEqual(a, b, state);
40
+ const { cache } = state;
41
+ const cachedA = cache.get(a);
42
+ const cachedB = cache.get(b);
43
+ if (cachedA && cachedB) return cachedA === b && cachedB === a;
44
+ cache.set(a, b);
45
+ cache.set(b, a);
46
+ const result = areItemsEqual(a, b, state);
47
+ cache.delete(a);
48
+ cache.delete(b);
49
+ return result;
17
50
  };
18
51
  }
19
- function getStrictProperties(n) {
20
- let r = t(n);
21
- return r.length ? e(n).concat(r) : e(n);
52
+ /**
53
+ * Get the properties to strictly examine, which include both own properties that are
54
+ * not enumerable and symbol properties.
55
+ */
56
+ function getStrictProperties(object) {
57
+ const symbols = getOwnPropertySymbols(object);
58
+ return symbols.length ? getOwnPropertyNames(object).concat(symbols) : getOwnPropertyNames(object);
59
+ }
60
+ /**
61
+ * Identify the element type of TypedArrays across realms and subclasses.
62
+ */
63
+ var getTypedArrayTag = getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), Symbol.toStringTag).get;
64
+ /**
65
+ * Whether the object contains the property passed as an own property.
66
+ */
67
+ var hasOwn = Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
68
+ /**
69
+ * Whether a null-prototype object is being compared with a plain object. Only one side can be
70
+ * null-prototype when the constructors differ. The other side must be a plain object by
71
+ * constructor, or by tag when it comes from another realm.
72
+ */
73
+ function isNullPrototypeComparable(a, b) {
74
+ const aConstructor = a.constructor;
75
+ const bConstructor = b.constructor;
76
+ if (aConstructor == null) return bConstructor === Object || toString$1.call(b) === OBJECT_TAG;
77
+ if (bConstructor == null) return aConstructor === Object || toString$1.call(a) === OBJECT_TAG;
78
+ return false;
79
+ }
80
+ /**
81
+ * Whether the property passed is a property specific to React/Preact elements. These are ignored in comparison, as they
82
+ * are deeply circular and will return frequent false negatives for the comparison that matters, which is often the
83
+ * React element's aspects (`props`, `type`, etc.).
84
+ */
85
+ function isReactProperty(a, b, property) {
86
+ return (property === "_owner" || property === "__o" || property === "__v") && !!(a.$$typeof || b.$$typeof);
87
+ }
88
+ /**
89
+ * Reorder a serialized query string so that params holding the same pairs compare as equal
90
+ * regardless of the order they appear in.
91
+ *
92
+ * @note
93
+ * The serializer percent-encodes `&` and `=` wherever they appear inside a name or a value, so
94
+ * splitting on `&` recovers exactly the pairs and nothing else.
95
+ */
96
+ function sortSearchParams(serialized) {
97
+ return serialized.split("&").sort().join("&");
22
98
  }
23
- var r = Object.hasOwn || ((e, t) => n.call(e, t)), i = "__v", a = "__o", o = "_owner", s = typeof Float16Array < "u", { getOwnPropertyDescriptor: c, keys: l } = Object, u = Object.is || function sameValueEqual(e, t) {
24
- return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
99
+ /**
100
+ * Above this many keys, out-of-position keys are checked with `propertyIsEnumerable` rather than by
101
+ * scanning the other object's keys. Measured in V8: scanning wins up to 50 keys and loses from 100.
102
+ */
103
+ var MAX_SCANNED_PROPERTIES = 64;
104
+ var { keys } = Object;
105
+ var { propertyIsEnumerable } = Object.prototype;
106
+ /**
107
+ * Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.
108
+ * Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.
109
+ *
110
+ * @note
111
+ * When available in the environment, this is just a re-export of the global
112
+ * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) method.
113
+ */
114
+ var sameValueEqual = Object.is || function sameValueEqual(a, b) {
115
+ return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;
25
116
  };
26
- function strictEqual(e, t) {
27
- return e === t;
117
+ /**
118
+ * Whether the values passed are equal based on a
119
+ * [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.
120
+ * Simplified, this maps to if the two values are referentially equal to one another (`a === b`).
121
+ *
122
+ * @note
123
+ * This is mainly available as a convenience function, such as being a default when a function to determine equality between
124
+ * two objects is used.
125
+ */
126
+ function strictEqual(a, b) {
127
+ return a === b;
28
128
  }
29
- function areArrayBuffersEqual(e, t) {
30
- return e.byteLength === t.byteLength && areTypedArraysEqual(new Uint8Array(e), new Uint8Array(t));
129
+ /**
130
+ * Whether the array buffers are equal in value.
131
+ */
132
+ function areArrayBuffersEqual(a, b) {
133
+ return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
31
134
  }
32
- function areArraysEqual(e, t, n) {
33
- let r = e.length;
34
- if (t.length !== r) return !1;
35
- for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
36
- return !0;
135
+ /**
136
+ * Whether the arrays are equal in value.
137
+ */
138
+ function areArraysEqual(a, b, state) {
139
+ let index = a.length;
140
+ if (b.length !== index) return false;
141
+ while (index-- > 0) if (!state.equals(a[index], b[index], index, index, a, b, state)) return false;
142
+ return true;
37
143
  }
38
- function areDataViewsEqual(e, t) {
39
- return e.byteLength === t.byteLength && areTypedArraysEqual(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
144
+ /**
145
+ * Whether the dataviews are equal in value.
146
+ */
147
+ function areDataViewsEqual(a, b) {
148
+ return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
40
149
  }
41
- function areDatesEqual(e, t) {
42
- return u(e.getTime(), t.getTime());
150
+ /**
151
+ * Whether the dates passed are equal in value.
152
+ */
153
+ function areDatesEqual(a, b) {
154
+ return sameValueEqual(a.getTime(), b.getTime());
43
155
  }
44
- function areErrorsEqual(e, t, n) {
45
- return e.name === t.name && e.message === t.message && e.stack === t.stack && n.equals(e.cause, t.cause, "cause", "cause", e, t, n);
156
+ /**
157
+ * Whether the errors passed are equal in value.
158
+ *
159
+ * @note
160
+ * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared
161
+ * explicitly. `cause` and `errors` are compared by value rather than by reference, matching how
162
+ * every other nested value in the comparison is treated. They are compared exactly once, regardless
163
+ * of whether they were assigned (enumerable) or set by the constructor (non-enumerable). Other own
164
+ * enumerable properties (which custom `Error` subclasses commonly add) are compared afterward.
165
+ *
166
+ * The own property comparison is inlined rather than extracted, which measured faster in V8 when
167
+ * recursing through `cause`. Keep the bytecode under V8's 460-byte TurboFan inlining limit (383 bytes
168
+ * at time of writing; check with `node --print-bytecode --print-bytecode-filter=areErrorsEqual`), or
169
+ * this stops being inlined into its callers.
170
+ */
171
+ function areErrorsEqual(a, b, state) {
172
+ if (a.name !== b.name || a.message !== b.message || a.stack !== b.stack) return false;
173
+ const causeA = a.cause;
174
+ const causeB = b.cause;
175
+ if (causeA !== causeB && !state.equals(causeA, causeB, "cause", "cause", a, b, state)) return false;
176
+ const errorsA = a.errors;
177
+ const errorsB = b.errors;
178
+ if (errorsA !== errorsB && !state.equals(errorsA, errorsB, "errors", "errors", a, b, state)) return false;
179
+ const propertiesA = keys(a);
180
+ const propertiesB = keys(b);
181
+ let index = propertiesA.length;
182
+ if (!index && !propertiesB.length) return true;
183
+ let compared = 0;
184
+ let property;
185
+ while (index-- > 0) {
186
+ property = propertiesA[index];
187
+ if (property === "cause" || property === "errors") continue;
188
+ if (property !== propertiesB[index] && !propertyIsEnumerable.call(b, property) || !state.equals(a[property], b[property], property, property, a, b, state)) return false;
189
+ ++compared;
190
+ }
191
+ const remaining = propertiesB.length - compared;
192
+ return !remaining || remaining === (propertyIsEnumerable.call(b, "cause") ? 1 : 0) + (propertyIsEnumerable.call(b, "errors") ? 1 : 0);
193
+ }
194
+ /**
195
+ * Whether the errors passed are equal in value.
196
+ *
197
+ * @note
198
+ * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared
199
+ * explicitly. `cause` and `errors` are own properties, so `areObjectsEqualStrict` compares them along
200
+ * with every other own property; they are not compared explicitly to avoid comparing them twice.
201
+ */
202
+ function areErrorsEqualStrict(a, b, state) {
203
+ return a.name === b.name && a.message === b.message && a.stack === b.stack && areObjectsEqualStrict(a, b, state);
46
204
  }
47
- function areMapsEqual(e, t, n) {
48
- let r = e.size;
49
- if (r !== t.size) return !1;
50
- if (!r) return !0;
51
- let i = new Uint8Array(r), a = e.entries(), o, s, c = 0;
52
- for (; (o = a.next()) && !o.done;) {
53
- let r = t.entries(), a = 0, l = 0;
54
- for (; (s = r.next()) && !s.done;) {
55
- if (i[l]) {
56
- l++;
205
+ /**
206
+ * Whether the `Map`s are equal in value.
207
+ */
208
+ function areMapsEqual(a, b, state) {
209
+ const size = a.size;
210
+ if (size !== b.size) return false;
211
+ if (!size) return true;
212
+ const matchedIndices = new Array(size);
213
+ const aIterable = a.entries();
214
+ let aResult;
215
+ let bResult;
216
+ let index = 0;
217
+ while (aResult = aIterable.next()) {
218
+ if (aResult.done) break;
219
+ const bIterable = b.entries();
220
+ let hasMatch = false;
221
+ let matchIndex = 0;
222
+ while (bResult = bIterable.next()) {
223
+ if (bResult.done) break;
224
+ if (matchedIndices[matchIndex]) {
225
+ matchIndex++;
57
226
  continue;
58
227
  }
59
- let r = o.value, u = s.value;
60
- if (n.equals(r[0], u[0], c, l, e, t, n) && n.equals(r[1], u[1], r[0], u[0], e, t, n)) {
61
- a = i[l] = 1;
228
+ const aEntry = aResult.value;
229
+ const bEntry = bResult.value;
230
+ if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
231
+ hasMatch = matchedIndices[matchIndex] = true;
62
232
  break;
63
233
  }
64
- l++;
234
+ matchIndex++;
65
235
  }
66
- if (!a) return !1;
67
- c++;
236
+ if (!hasMatch) return false;
237
+ index++;
238
+ }
239
+ return true;
240
+ }
241
+ /**
242
+ * Whether the objects are equal in value.
243
+ */
244
+ function areObjectsEqual(a, b, state) {
245
+ const properties = keys(a);
246
+ const propertiesB = keys(b);
247
+ let index = properties.length;
248
+ if (propertiesB.length !== index) return false;
249
+ const isScannable = index <= MAX_SCANNED_PROPERTIES;
250
+ let property;
251
+ while (index-- > 0) {
252
+ property = properties[index];
253
+ if (isReactProperty(a, b, property)) continue;
254
+ if (property !== propertiesB[index] && !(isScannable ? propertiesB.includes(property) : propertyIsEnumerable.call(b, property)) || !state.equals(a[property], b[property], property, property, a, b, state)) return false;
68
255
  }
69
- return !0;
256
+ return true;
70
257
  }
71
- function areObjectsEqual(e, t, n) {
72
- let r = l(e), i = r.length;
73
- if (l(t).length !== i) return !1;
74
- for (; i-- > 0;) if (!isPropertyEqual(e, t, n, r[i])) return !1;
75
- return !0;
258
+ /**
259
+ * Whether the objects are equal in value with strict property checking.
260
+ */
261
+ function areObjectsEqualStrict(a, b, state) {
262
+ const properties = getStrictProperties(a);
263
+ return getStrictProperties(b).length === properties.length && areStrictPropertiesEqual(a, b, state, properties, 0);
76
264
  }
77
- function areObjectsEqualStrict(e, t, n) {
78
- let r = getStrictProperties(e), i = r.length;
79
- if (getStrictProperties(t).length !== i) return !1;
80
- let a, o, s;
81
- for (; i-- > 0;) if (a = r[i], !isPropertyEqual(e, t, n, a) || (o = c(e, a), s = c(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
82
- return !0;
265
+ /**
266
+ * Whether the primitive wrappers passed are equal in value.
267
+ */
268
+ function arePrimitiveWrappersEqual(a, b) {
269
+ return sameValueEqual(a.valueOf(), b.valueOf());
83
270
  }
84
- function arePrimitiveWrappersEqual(e, t) {
85
- return u(e.valueOf(), t.valueOf());
271
+ /**
272
+ * Whether the regexps passed are equal in value.
273
+ */
274
+ function areRegExpsEqual(a, b) {
275
+ return a.source === b.source && a.flags === b.flags;
86
276
  }
87
- function areRegExpsEqual(e, t) {
88
- return e.source === t.source && e.flags === t.flags;
277
+ /**
278
+ * Whether the search params passed are equal in value.
279
+ *
280
+ * @note
281
+ * Order is not significant, matching how the other unordered collections in the library are
282
+ * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:
283
+ * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.
284
+ */
285
+ function areSearchParamsEqual(a, b) {
286
+ const serializedA = a.toString();
287
+ const serializedB = b.toString();
288
+ return serializedA === serializedB || sortSearchParams(serializedA) === sortSearchParams(serializedB);
89
289
  }
90
- function areSetsEqual(e, t, n) {
91
- let r = e.size;
92
- if (r !== t.size) return !1;
93
- if (!r) return !0;
94
- let i = new Uint8Array(r), a = e.values(), o, s;
95
- for (; (o = a.next()) && !o.done;) {
96
- let r = t.values(), a = 0, c = 0;
97
- for (; (s = r.next()) && !s.done;) {
98
- if (!i[c] && n.equals(o.value, s.value, o.value, s.value, e, t, n)) {
99
- a = i[c] = 1;
290
+ /**
291
+ * Whether the `Set`s are equal in value.
292
+ */
293
+ function areSetsEqual(a, b, state) {
294
+ const size = a.size;
295
+ if (size !== b.size) return false;
296
+ if (!size) return true;
297
+ const matchedIndices = new Array(size);
298
+ const aIterable = a.values();
299
+ let aResult;
300
+ let bResult;
301
+ while (aResult = aIterable.next()) {
302
+ if (aResult.done) break;
303
+ const bIterable = b.values();
304
+ let hasMatch = false;
305
+ let matchIndex = 0;
306
+ while (bResult = bIterable.next()) {
307
+ if (bResult.done) break;
308
+ if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
309
+ hasMatch = matchedIndices[matchIndex] = true;
100
310
  break;
101
311
  }
102
- c++;
312
+ matchIndex++;
103
313
  }
104
- if (!a) return !1;
314
+ if (!hasMatch) return false;
105
315
  }
106
- return !0;
316
+ return true;
107
317
  }
108
- function areTypedArraysEqual(e, t) {
109
- let n = e.length;
110
- if (t.length !== n || e.byteOffset !== t.byteOffset) return !1;
111
- if (e instanceof Float64Array || e instanceof Float32Array || s && e instanceof Float16Array) {
112
- for (; n-- > 0;) if (e[n] !== t[n] && (e[n] === e[n] || t[n] === t[n])) return !1;
113
- return !0;
318
+ /**
319
+ * Whether the TypedArray instances are equal in value.
320
+ */
321
+ function areTypedArraysEqual(a, b) {
322
+ let index = a.length;
323
+ if (b.length !== index || a.byteOffset !== b.byteOffset) return false;
324
+ const tag = getTypedArrayTag.call(a);
325
+ if (tag === "Float64Array" || tag === "Float32Array" || tag === "Float16Array") {
326
+ while (index-- > 0) if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) return false;
327
+ return true;
114
328
  }
115
- for (; n-- > 0;) if (e[n] !== t[n]) return !1;
116
- return !0;
329
+ while (index-- > 0) if (a[index] !== b[index]) return false;
330
+ return true;
117
331
  }
118
- function areUrlsEqual(e, t) {
119
- return e.href === t.href || e.protocol === t.protocol && e.username === t.username && e.password === t.password && e.host === t.host && e.pathname === t.pathname && e.hash === t.hash && areSearchParamsEqual(e.searchParams, t.searchParams);
332
+ /**
333
+ * Whether the TypedArray instances are equal in value with strict property checking.
334
+ *
335
+ * @note
336
+ * Indexed elements are also own properties, listed first and in order, with descriptors fixed by the
337
+ * spec. They are compared once by `areTypedArraysEqual`, so only the own properties after them
338
+ * (including symbols) are compared with strict property checking.
339
+ */
340
+ function areTypedArraysEqualStrict(a, b, state) {
341
+ if (!areTypedArraysEqual(a, b)) return false;
342
+ const properties = getStrictProperties(a);
343
+ return getStrictProperties(b).length === properties.length && areStrictPropertiesEqual(a, b, state, properties, a.length);
120
344
  }
121
- function areSearchParamsEqual(e, t) {
122
- let n = e.toString(), r = t.toString();
123
- return n === r || sortSearchParams(n) === sortSearchParams(r);
345
+ /**
346
+ * Whether the URL instances are equal in value.
347
+ */
348
+ function areUrlsEqual(a, b) {
349
+ if (a.href === b.href) return true;
350
+ return a.protocol === b.protocol && a.username === b.username && a.password === b.password && a.host === b.host && a.pathname === b.pathname && a.hash === b.hash && areSearchParamsEqual(a.searchParams, b.searchParams);
124
351
  }
125
- function sortSearchParams(e) {
126
- return e.split("&").sort().join("&");
127
- }
128
- function isPropertyEqual(e, t, n, s) {
129
- return (s === o || s === a || s === i) && (e.$$typeof || t.$$typeof) ? !0 : r(t, s) && n.equals(e[s], t[s], s, s, e, t, n);
130
- }
131
- var d = Object.prototype.toString;
132
- function createEqualityComparator(e) {
133
- let t = createSupportedComparatorMap(e), { areArraysEqual: n, areDatesEqual: r, areFunctionsEqual: i, areMapsEqual: a, areNumbersEqual: o, areObjectsEqual: s, areRegExpsEqual: c, areSetsEqual: l, getUnsupportedCustomComparator: u } = e;
134
- return function comparator(e, f, p) {
135
- if (e === f) return !0;
136
- if (e == null || f == null) return !1;
137
- let m = typeof e;
138
- if (m !== typeof f) return !1;
139
- if (m !== "object") return m === "number" || m === "bigint" ? o(e, f, p) : m === "function" && i(e, f, p);
140
- let h = e.constructor;
141
- if (h !== f.constructor) return !1;
142
- if (h === Object) return s(e, f, p);
143
- if (h === Array) return n(e, f, p);
144
- if (h === Date) return r(e, f, p);
145
- if (h === RegExp) return c(e, f, p);
146
- if (h === Map) return a(e, f, p);
147
- if (h === Set) return l(e, f, p);
148
- if (h === Promise) return !1;
149
- if (Array.isArray(e)) return n(e, f, p);
150
- let g = d.call(e), _ = t[g];
151
- if (_) return _(e, f, p);
152
- let v = u && u(e, f, p, g);
153
- return v ? v(e, f, p) : !1;
352
+ var { toString } = Object.prototype;
353
+ /**
354
+ * Create a comparator method based on the type-specific equality comparators passed.
355
+ */
356
+ function createEqualityComparator(config) {
357
+ const supportedComparatorMap = createSupportedComparatorMap(config);
358
+ const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator, strictNullPrototypeComparison } = config;
359
+ /**
360
+ * Whether the custom objects are equal in value, based on their string tag. If not matching any tags
361
+ * that require a specific type of comparison, then we hard-code false because the only thing remaining
362
+ * is strict equality, which has already been compared. This is for a few reasons:
363
+ * - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
364
+ * comparison that can be made.
365
+ * - For types that can be introspected but do not have an objective definition of what
366
+ * equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
367
+ * In all cases, these decisions should be reevaluated based on changes to the language and
368
+ * common development practices.
369
+ *
370
+ * Capturing the tag is reasonably performant in modern environments like v8 and SpiderMonkey. This is
371
+ * kept out of the main comparator so that it stays within the engine's bytecode budget for inlining.
372
+ * See [#207](https://github.com/planttheidea/fast-equals/pull/207) for more details.
373
+ */
374
+ const areTaggedObjectsEqual = getUnsupportedCustomComparator ? function areTaggedObjectsEqual(a, b, state) {
375
+ const tag = toString.call(a);
376
+ const supportedComparator = supportedComparatorMap[tag];
377
+ if (supportedComparator) return supportedComparator(a, b, state);
378
+ const unsupportedCustomComparator = getUnsupportedCustomComparator(a, b, state, tag);
379
+ return unsupportedCustomComparator ? unsupportedCustomComparator(a, b, state) : false;
380
+ } : function areTaggedObjectsEqual(a, b, state) {
381
+ const supportedComparator = supportedComparatorMap[toString.call(a)];
382
+ return supportedComparator ? supportedComparator(a, b, state) : false;
383
+ };
384
+ /**
385
+ * compare the value of the two objects and return true if they are equivalent in values
386
+ */
387
+ return function comparator(a, b, state) {
388
+ if (a === b) return true;
389
+ if (a == null || b == null) return false;
390
+ const type = typeof a;
391
+ if (type !== typeof b) return false;
392
+ if (type !== "object") {
393
+ if (type === "number" || type === "bigint") return areNumbersEqual(a, b, state);
394
+ if (type === "function") return areFunctionsEqual(a, b, state);
395
+ return false;
396
+ }
397
+ const constructor = a.constructor;
398
+ if (constructor !== b.constructor) return strictNullPrototypeComparison ? false : isNullPrototypeComparable(a, b) && areObjectsEqual(a, b, state);
399
+ if (constructor === Object) return areObjectsEqual(a, b, state);
400
+ if (constructor === Array) return areArraysEqual(a, b, state);
401
+ if (constructor === Date) return areDatesEqual(a, b, state);
402
+ if (constructor === RegExp) return areRegExpsEqual(a, b, state);
403
+ if (constructor === Map) return areMapsEqual(a, b, state);
404
+ if (constructor === Set) return areSetsEqual(a, b, state);
405
+ if (constructor == null) return areObjectsEqual(a, b, state);
406
+ if (constructor === Promise) return false;
407
+ if (Array.isArray(a)) return areArraysEqual(a, b, state);
408
+ return areTaggedObjectsEqual(a, b, state);
154
409
  };
155
410
  }
156
- function createEqualityComparatorConfig({ circular: e, createCustomConfig: t, strict: n }) {
157
- let r = {
411
+ /**
412
+ * Create the configuration object used for building comparators.
413
+ */
414
+ function createEqualityComparatorConfig({ circular, createCustomConfig, strict, strictNullPrototypeComparison = true }) {
415
+ let config = {
158
416
  areArrayBuffersEqual,
159
- areArraysEqual: n ? areObjectsEqualStrict : areArraysEqual,
417
+ areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
160
418
  areDataViewsEqual,
161
- areDatesEqual,
162
- areErrorsEqual: n ? combineComparators(areErrorsEqual, areObjectsEqualStrict) : combineComparators(areErrorsEqual, areObjectsEqual),
419
+ areDatesEqual: strict ? combineComparators(areDatesEqual, areObjectsEqualStrict) : areDatesEqual,
420
+ areErrorsEqual: strict ? areErrorsEqualStrict : areErrorsEqual,
163
421
  areFunctionsEqual: strictEqual,
164
- areMapsEqual: n ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
165
- areNumbersEqual: u,
166
- areObjectsEqual: n ? areObjectsEqualStrict : areObjectsEqual,
422
+ areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
423
+ areNumbersEqual: sameValueEqual,
424
+ areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
167
425
  arePrimitiveWrappersEqual,
168
426
  areRegExpsEqual,
169
- areSetsEqual: n ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
170
- areTypedArraysEqual: n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
427
+ areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
428
+ areTypedArraysEqual: strict ? areTypedArraysEqualStrict : areTypedArraysEqual,
171
429
  areUrlsEqual,
172
- getUnsupportedCustomComparator: void 0
430
+ getUnsupportedCustomComparator: void 0,
431
+ strictNullPrototypeComparison
173
432
  };
174
- if (t && (r = Object.assign({}, r, t(r))), e) {
175
- let e = createIsCircular(r.areArraysEqual), t = createIsCircular(r.areErrorsEqual), n = createIsCircular(r.areMapsEqual), i = createIsCircular(r.areObjectsEqual), a = createIsCircular(r.areSetsEqual);
176
- r = Object.assign({}, r, {
177
- areArraysEqual: e,
178
- areErrorsEqual: t,
179
- areMapsEqual: n,
180
- areObjectsEqual: i,
181
- areSetsEqual: a
433
+ if (createCustomConfig) config = Object.assign({}, config, createCustomConfig(config));
434
+ if (circular) {
435
+ const areArraysEqual = createIsCircular(config.areArraysEqual);
436
+ const areDatesEqual = strict ? createIsCircular(config.areDatesEqual) : config.areDatesEqual;
437
+ const areErrorsEqual = createIsCircular(config.areErrorsEqual);
438
+ const areMapsEqual = createIsCircular(config.areMapsEqual);
439
+ const areObjectsEqual = createIsCircular(config.areObjectsEqual);
440
+ const areSetsEqual = createIsCircular(config.areSetsEqual);
441
+ const areTypedArraysEqual = strict ? createIsCircular(config.areTypedArraysEqual) : config.areTypedArraysEqual;
442
+ config = Object.assign({}, config, {
443
+ areArraysEqual,
444
+ areDatesEqual,
445
+ areErrorsEqual,
446
+ areMapsEqual,
447
+ areObjectsEqual,
448
+ areSetsEqual,
449
+ areTypedArraysEqual
182
450
  });
183
451
  }
184
- return r;
452
+ return config;
185
453
  }
186
- function createInternalEqualityComparator(e) {
187
- return function(t, n, r, i, a, o, s) {
188
- return e(t, n, s);
454
+ /**
455
+ * Default equality comparator pass-through, used as the standard `isEqual` creator for
456
+ * use inside the built comparator.
457
+ */
458
+ function createInternalEqualityComparator(compare) {
459
+ return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
460
+ return compare(a, b, state);
189
461
  };
190
462
  }
191
- function createIsEqual({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
192
- if (n) return function isEqual(a, o) {
193
- let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
194
- return t(a, o, {
195
- cache: s,
196
- equals: r,
197
- meta: c,
198
- strict: i
463
+ /**
464
+ * Create the `isEqual` function used by the consuming application.
465
+ */
466
+ function createIsEqual({ circular, comparator, createState, equals, strict }) {
467
+ if (createState) return function isEqual(a, b) {
468
+ const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
469
+ return comparator(a, b, {
470
+ cache,
471
+ equals,
472
+ meta,
473
+ strict
199
474
  });
200
475
  };
201
- if (e) return function isEqual(e, n) {
202
- return t(e, n, {
476
+ if (circular) return function isEqual(a, b) {
477
+ return comparator(a, b, {
203
478
  cache: /* @__PURE__ */ new WeakMap(),
204
- equals: r,
479
+ equals,
205
480
  meta: void 0,
206
- strict: i
481
+ strict
207
482
  });
208
483
  };
209
- let a = {
484
+ const state = {
210
485
  cache: void 0,
211
- equals: r,
486
+ equals,
212
487
  meta: void 0,
213
- strict: i
488
+ strict
214
489
  };
215
- return function isEqual(e, n) {
216
- return t(e, n, a);
490
+ return function isEqual(a, b) {
491
+ return comparator(a, b, state);
217
492
  };
218
493
  }
219
- function createSupportedComparatorMap({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areObjectsEqual: s, arePrimitiveWrappersEqual: c, areRegExpsEqual: l, areSetsEqual: u, areTypedArraysEqual: d, areUrlsEqual: f }) {
494
+ /**
495
+ * Create a map of `toString()` values to their respective handlers for `tag`-based lookups.
496
+ */
497
+ function createSupportedComparatorMap({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual }) {
220
498
  return {
221
- "[object Arguments]": s,
222
- "[object Array]": t,
223
- "[object ArrayBuffer]": e,
224
- "[object AsyncGeneratorFunction]": a,
225
- "[object BigInt]": c,
226
- "[object BigInt64Array]": d,
227
- "[object BigUint64Array]": d,
228
- "[object Boolean]": c,
229
- "[object DataView]": n,
230
- "[object Date]": r,
231
- "[object Error]": i,
232
- "[object Float16Array]": d,
233
- "[object Float32Array]": d,
234
- "[object Float64Array]": d,
235
- "[object Function]": a,
236
- "[object GeneratorFunction]": a,
237
- "[object Int8Array]": d,
238
- "[object Int16Array]": d,
239
- "[object Int32Array]": d,
240
- "[object Map]": o,
241
- "[object Number]": c,
242
- "[object Object]": (e, t, n) => typeof e.then != "function" && typeof t.then != "function" && s(e, t, n),
243
- "[object RegExp]": l,
244
- "[object Set]": u,
245
- "[object String]": c,
246
- "[object URL]": f,
247
- "[object Uint8Array]": d,
248
- "[object Uint8ClampedArray]": d,
249
- "[object Uint16Array]": d,
250
- "[object Uint32Array]": d
499
+ "[object Arguments]": areObjectsEqual,
500
+ "[object Array]": areArraysEqual,
501
+ "[object ArrayBuffer]": areArrayBuffersEqual,
502
+ "[object AsyncGeneratorFunction]": areFunctionsEqual,
503
+ "[object BigInt]": arePrimitiveWrappersEqual,
504
+ "[object BigInt64Array]": areTypedArraysEqual,
505
+ "[object BigUint64Array]": areTypedArraysEqual,
506
+ "[object Boolean]": arePrimitiveWrappersEqual,
507
+ "[object DataView]": areDataViewsEqual,
508
+ "[object Date]": areDatesEqual,
509
+ "[object Error]": areErrorsEqual,
510
+ "[object Float16Array]": areTypedArraysEqual,
511
+ "[object Float32Array]": areTypedArraysEqual,
512
+ "[object Float64Array]": areTypedArraysEqual,
513
+ "[object Function]": areFunctionsEqual,
514
+ "[object GeneratorFunction]": areFunctionsEqual,
515
+ "[object Int8Array]": areTypedArraysEqual,
516
+ "[object Int16Array]": areTypedArraysEqual,
517
+ "[object Int32Array]": areTypedArraysEqual,
518
+ "[object Map]": areMapsEqual,
519
+ "[object Number]": arePrimitiveWrappersEqual,
520
+ "[object Object]": (a, b, state) => typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual(a, b, state),
521
+ "[object RegExp]": areRegExpsEqual,
522
+ "[object Set]": areSetsEqual,
523
+ "[object String]": arePrimitiveWrappersEqual,
524
+ "[object URL]": areUrlsEqual,
525
+ "[object Uint8Array]": areTypedArraysEqual,
526
+ "[object Uint8ClampedArray]": areTypedArraysEqual,
527
+ "[object Uint16Array]": areTypedArraysEqual,
528
+ "[object Uint32Array]": areTypedArraysEqual
251
529
  };
252
530
  }
253
- var f = createCustomEqual();
254
- createCustomEqual({ strict: !0 }), createCustomEqual({ circular: !0 }), createCustomEqual({
255
- circular: !0,
256
- strict: !0
531
+ /**
532
+ * Whether the items passed are deeply-equal in value.
533
+ */
534
+ var deepEqual = createCustomEqual();
535
+ createCustomEqual({ strict: true });
536
+ createCustomEqual({ circular: true });
537
+ createCustomEqual({
538
+ circular: true,
539
+ strict: true
540
+ });
541
+ createCustomEqual({ createInternalComparator: () => sameValueEqual });
542
+ createCustomEqual({
543
+ strict: true,
544
+ createInternalComparator: () => sameValueEqual
545
+ });
546
+ createCustomEqual({
547
+ circular: true,
548
+ createInternalComparator: () => sameValueEqual
257
549
  });
258
- var p = createCustomEqual({ createInternalComparator: () => u });
259
550
  createCustomEqual({
260
- strict: !0,
261
- createInternalComparator: () => u
262
- }), createCustomEqual({
263
- circular: !0,
264
- createInternalComparator: () => u
265
- }), createCustomEqual({
266
- circular: !0,
267
- createInternalComparator: () => u,
268
- strict: !0
551
+ circular: true,
552
+ createInternalComparator: () => sameValueEqual,
553
+ strict: true
269
554
  });
270
- function createCustomEqual(e = {}) {
271
- let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = createEqualityComparator(createEqualityComparatorConfig(e));
555
+ /**
556
+ * Create a custom equality comparison method.
557
+ *
558
+ * This can be done to create very targeted comparisons in extreme hot-path scenarios
559
+ * where the standard methods are not performant enough, but can also be used to provide
560
+ * support for legacy environments that do not support expected features like
561
+ * `RegExp.prototype.flags` out of the box.
562
+ */
563
+ function createCustomEqual(options = {}) {
564
+ const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
565
+ const comparator = createEqualityComparator(createEqualityComparatorConfig(options));
272
566
  return createIsEqual({
273
- circular: t,
274
- comparator: a,
275
- createState: r,
276
- equals: n ? n(a) : createInternalEqualityComparator(a),
277
- strict: i
567
+ circular,
568
+ comparator,
569
+ createState,
570
+ equals: createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator),
571
+ strict
278
572
  });
279
573
  }
280
- //#endregion
281
- export { p as n, f as t };
574
+ export { deepEqual as t };