@hyperfrontend/immutable-api-utils 0.0.2 → 0.1.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 (188) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +65 -4
  3. package/built-in-copy/array/index.cjs.js +40 -0
  4. package/built-in-copy/array/index.cjs.js.map +1 -0
  5. package/built-in-copy/array/index.d.ts +40 -0
  6. package/built-in-copy/array/index.d.ts.map +1 -0
  7. package/built-in-copy/array/index.esm.js +35 -0
  8. package/built-in-copy/array/index.esm.js.map +1 -0
  9. package/built-in-copy/console/index.cjs.js +130 -0
  10. package/built-in-copy/console/index.cjs.js.map +1 -0
  11. package/built-in-copy/console/index.d.ts +105 -0
  12. package/built-in-copy/console/index.d.ts.map +1 -0
  13. package/built-in-copy/console/index.esm.js +110 -0
  14. package/built-in-copy/console/index.esm.js.map +1 -0
  15. package/built-in-copy/date/index.cjs.js +49 -0
  16. package/built-in-copy/date/index.cjs.js.map +1 -0
  17. package/built-in-copy/date/index.d.ts +49 -0
  18. package/built-in-copy/date/index.d.ts.map +1 -0
  19. package/built-in-copy/date/index.esm.js +43 -0
  20. package/built-in-copy/date/index.esm.js.map +1 -0
  21. package/built-in-copy/encoding/index.cjs.js +67 -0
  22. package/built-in-copy/encoding/index.cjs.js.map +1 -0
  23. package/built-in-copy/encoding/index.d.ts +52 -0
  24. package/built-in-copy/encoding/index.d.ts.map +1 -0
  25. package/built-in-copy/encoding/index.esm.js +61 -0
  26. package/built-in-copy/encoding/index.esm.js.map +1 -0
  27. package/built-in-copy/error/index.cjs.js +122 -0
  28. package/built-in-copy/error/index.cjs.js.map +1 -0
  29. package/built-in-copy/error/index.d.ts +99 -0
  30. package/built-in-copy/error/index.d.ts.map +1 -0
  31. package/built-in-copy/error/index.esm.js +112 -0
  32. package/built-in-copy/error/index.esm.js.map +1 -0
  33. package/built-in-copy/function/index.cjs.js +61 -0
  34. package/built-in-copy/function/index.cjs.js.map +1 -0
  35. package/built-in-copy/function/index.d.ts +47 -0
  36. package/built-in-copy/function/index.d.ts.map +1 -0
  37. package/built-in-copy/function/index.esm.js +54 -0
  38. package/built-in-copy/function/index.esm.js.map +1 -0
  39. package/built-in-copy/json/index.cjs.js +34 -0
  40. package/built-in-copy/json/index.cjs.js.map +1 -0
  41. package/built-in-copy/json/index.d.ts +31 -0
  42. package/built-in-copy/json/index.d.ts.map +1 -0
  43. package/built-in-copy/json/index.esm.js +30 -0
  44. package/built-in-copy/json/index.esm.js.map +1 -0
  45. package/built-in-copy/map/index.cjs.js +44 -0
  46. package/built-in-copy/map/index.cjs.js.map +1 -0
  47. package/built-in-copy/map/index.d.ts +33 -0
  48. package/built-in-copy/map/index.d.ts.map +1 -0
  49. package/built-in-copy/map/index.esm.js +40 -0
  50. package/built-in-copy/map/index.esm.js.map +1 -0
  51. package/built-in-copy/math/index.cjs.js +317 -0
  52. package/built-in-copy/math/index.cjs.js.map +1 -0
  53. package/built-in-copy/math/index.d.ts +232 -0
  54. package/built-in-copy/math/index.d.ts.map +1 -0
  55. package/built-in-copy/math/index.esm.js +272 -0
  56. package/built-in-copy/math/index.esm.js.map +1 -0
  57. package/built-in-copy/messaging/index.cjs.js +123 -0
  58. package/built-in-copy/messaging/index.cjs.js.map +1 -0
  59. package/built-in-copy/messaging/index.d.ts +95 -0
  60. package/built-in-copy/messaging/index.d.ts.map +1 -0
  61. package/built-in-copy/messaging/index.esm.js +114 -0
  62. package/built-in-copy/messaging/index.esm.js.map +1 -0
  63. package/built-in-copy/number/index.cjs.js +141 -0
  64. package/built-in-copy/number/index.cjs.js.map +1 -0
  65. package/built-in-copy/number/index.d.ts +95 -0
  66. package/built-in-copy/number/index.d.ts.map +1 -0
  67. package/built-in-copy/number/index.esm.js +123 -0
  68. package/built-in-copy/number/index.esm.js.map +1 -0
  69. package/built-in-copy/object/index.cjs.js +174 -0
  70. package/built-in-copy/object/index.cjs.js.map +1 -0
  71. package/built-in-copy/object/index.d.ts +209 -0
  72. package/built-in-copy/object/index.d.ts.map +1 -0
  73. package/built-in-copy/object/index.esm.js +149 -0
  74. package/built-in-copy/object/index.esm.js.map +1 -0
  75. package/built-in-copy/promise/index.cjs.js +80 -0
  76. package/built-in-copy/promise/index.cjs.js.map +1 -0
  77. package/built-in-copy/promise/index.d.ts +63 -0
  78. package/built-in-copy/promise/index.d.ts.map +1 -0
  79. package/built-in-copy/promise/index.esm.js +70 -0
  80. package/built-in-copy/promise/index.esm.js.map +1 -0
  81. package/built-in-copy/reflect/index.cjs.js +101 -0
  82. package/built-in-copy/reflect/index.cjs.js.map +1 -0
  83. package/built-in-copy/reflect/index.d.ts +81 -0
  84. package/built-in-copy/reflect/index.d.ts.map +1 -0
  85. package/built-in-copy/reflect/index.esm.js +86 -0
  86. package/built-in-copy/reflect/index.esm.js.map +1 -0
  87. package/built-in-copy/regexp/index.cjs.js +37 -0
  88. package/built-in-copy/regexp/index.cjs.js.map +1 -0
  89. package/built-in-copy/regexp/index.d.ts +28 -0
  90. package/built-in-copy/regexp/index.d.ts.map +1 -0
  91. package/built-in-copy/regexp/index.esm.js +34 -0
  92. package/built-in-copy/regexp/index.esm.js.map +1 -0
  93. package/built-in-copy/set/index.cjs.js +36 -0
  94. package/built-in-copy/set/index.cjs.js.map +1 -0
  95. package/built-in-copy/set/index.d.ts +27 -0
  96. package/built-in-copy/set/index.d.ts.map +1 -0
  97. package/built-in-copy/set/index.esm.js +33 -0
  98. package/built-in-copy/set/index.esm.js.map +1 -0
  99. package/built-in-copy/string/index.cjs.js +46 -0
  100. package/built-in-copy/string/index.cjs.js.map +1 -0
  101. package/built-in-copy/string/index.d.ts +34 -0
  102. package/built-in-copy/string/index.d.ts.map +1 -0
  103. package/built-in-copy/string/index.esm.js +41 -0
  104. package/built-in-copy/string/index.esm.js.map +1 -0
  105. package/built-in-copy/symbol/index.cjs.js +123 -0
  106. package/built-in-copy/symbol/index.cjs.js.map +1 -0
  107. package/built-in-copy/symbol/index.d.ts +99 -0
  108. package/built-in-copy/symbol/index.d.ts.map +1 -0
  109. package/built-in-copy/symbol/index.esm.js +105 -0
  110. package/built-in-copy/symbol/index.esm.js.map +1 -0
  111. package/built-in-copy/timers/index.cjs.js +105 -0
  112. package/built-in-copy/timers/index.cjs.js.map +1 -0
  113. package/built-in-copy/timers/index.d.ts +73 -0
  114. package/built-in-copy/timers/index.d.ts.map +1 -0
  115. package/built-in-copy/timers/index.esm.js +96 -0
  116. package/built-in-copy/timers/index.esm.js.map +1 -0
  117. package/built-in-copy/typed-arrays/index.cjs.js +360 -0
  118. package/built-in-copy/typed-arrays/index.cjs.js.map +1 -0
  119. package/built-in-copy/typed-arrays/index.d.ts +321 -0
  120. package/built-in-copy/typed-arrays/index.d.ts.map +1 -0
  121. package/built-in-copy/typed-arrays/index.esm.js +321 -0
  122. package/built-in-copy/typed-arrays/index.esm.js.map +1 -0
  123. package/built-in-copy/url/index.cjs.js +103 -0
  124. package/built-in-copy/url/index.cjs.js.map +1 -0
  125. package/built-in-copy/url/index.d.ts +71 -0
  126. package/built-in-copy/url/index.d.ts.map +1 -0
  127. package/built-in-copy/url/index.esm.js +95 -0
  128. package/built-in-copy/url/index.esm.js.map +1 -0
  129. package/built-in-copy/weak-map/index.cjs.js +36 -0
  130. package/built-in-copy/weak-map/index.cjs.js.map +1 -0
  131. package/built-in-copy/weak-map/index.d.ts +27 -0
  132. package/built-in-copy/weak-map/index.d.ts.map +1 -0
  133. package/built-in-copy/weak-map/index.esm.js +33 -0
  134. package/built-in-copy/weak-map/index.esm.js.map +1 -0
  135. package/built-in-copy/weak-set/index.cjs.js +36 -0
  136. package/built-in-copy/weak-set/index.cjs.js.map +1 -0
  137. package/built-in-copy/weak-set/index.d.ts +27 -0
  138. package/built-in-copy/weak-set/index.d.ts.map +1 -0
  139. package/built-in-copy/weak-set/index.esm.js +33 -0
  140. package/built-in-copy/weak-set/index.esm.js.map +1 -0
  141. package/built-in-copy/websocket/index.cjs.js +50 -0
  142. package/built-in-copy/websocket/index.cjs.js.map +1 -0
  143. package/built-in-copy/websocket/index.d.ts +37 -0
  144. package/built-in-copy/websocket/index.d.ts.map +1 -0
  145. package/built-in-copy/websocket/index.esm.js +43 -0
  146. package/built-in-copy/websocket/index.esm.js.map +1 -0
  147. package/bundle/index.iife.js +1167 -5
  148. package/bundle/index.iife.js.map +1 -1
  149. package/bundle/index.iife.min.js +1 -1
  150. package/bundle/index.iife.min.js.map +1 -1
  151. package/bundle/index.umd.js +1167 -5
  152. package/bundle/index.umd.js.map +1 -1
  153. package/bundle/index.umd.min.js +1 -1
  154. package/bundle/index.umd.min.js.map +1 -1
  155. package/index.cjs.js +1167 -5
  156. package/index.cjs.js.map +1 -1
  157. package/index.d.ts +32 -3
  158. package/index.d.ts.map +1 -1
  159. package/index.esm.js +1151 -6
  160. package/index.esm.js.map +1 -1
  161. package/lib/locked-prop-descriptors.d.ts.map +1 -0
  162. package/lib/locked-props.d.ts.map +1 -0
  163. package/{locked.d.ts → lib/locked.d.ts} +12 -1
  164. package/lib/locked.d.ts.map +1 -0
  165. package/locked/index.cjs.js +107 -0
  166. package/locked/index.cjs.js.map +1 -0
  167. package/locked/index.d.ts +2 -0
  168. package/locked/index.d.ts.map +1 -0
  169. package/locked/index.esm.js +105 -0
  170. package/locked/index.esm.js.map +1 -0
  171. package/locked-prop-descriptors/index.cjs.js +11 -0
  172. package/locked-prop-descriptors/index.cjs.js.map +1 -0
  173. package/locked-prop-descriptors/index.d.ts +2 -0
  174. package/locked-prop-descriptors/index.d.ts.map +1 -0
  175. package/locked-prop-descriptors/index.esm.js +9 -0
  176. package/locked-prop-descriptors/index.esm.js.map +1 -0
  177. package/locked-props/index.cjs.js +32 -0
  178. package/locked-props/index.cjs.js.map +1 -0
  179. package/locked-props/index.d.ts +2 -0
  180. package/locked-props/index.d.ts.map +1 -0
  181. package/locked-props/index.esm.js +30 -0
  182. package/locked-props/index.esm.js.map +1 -0
  183. package/package.json +149 -14
  184. package/locked-prop-descriptors.d.ts.map +0 -1
  185. package/locked-props.d.ts.map +0 -1
  186. package/locked.d.ts.map +0 -1
  187. /package/{locked-prop-descriptors.d.ts → lib/locked-prop-descriptors.d.ts} +0 -0
  188. /package/{locked-props.d.ts → lib/locked-props.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -1,7 +1,1140 @@
1
+ /**
2
+ * Safe copies of Array built-in static methods.
3
+ *
4
+ * These references are captured at module initialization time to protect against
5
+ * prototype pollution attacks. Import only what you need for tree-shaking.
6
+ *
7
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/array
8
+ */
9
+ // Capture references at module initialization time
10
+ const _Array = globalThis.Array;
11
+ const _freeze$f = globalThis.Object.freeze;
12
+ /**
13
+ * (Safe copy) Determines whether the passed value is an Array.
14
+ */
15
+ const isArray = _Array.isArray;
16
+ /**
17
+ * (Safe copy) Creates an array from an array-like or iterable object.
18
+ */
19
+ const from = _Array.from;
20
+ /**
21
+ * (Safe copy) Creates a new Array instance from a variable number of arguments.
22
+ */
23
+ const of = _Array.of;
24
+ /**
25
+ * (Safe copy) Namespace object containing all Array static methods.
26
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
27
+ */
28
+ const Array = _freeze$f({
29
+ isArray,
30
+ from,
31
+ of,
32
+ });
33
+
34
+ /**
35
+ * Safe copies of Console built-in methods.
36
+ *
37
+ * These references are captured at module initialization time to protect against
38
+ * prototype pollution attacks. Import only what you need for tree-shaking.
39
+ *
40
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/console
41
+ */
42
+ // Capture references at module initialization time
43
+ const _console = globalThis.console;
44
+ const _freeze$e = globalThis.Object.freeze;
45
+ /**
46
+ * (Safe copy) Outputs a message to the console.
47
+ */
48
+ const log = _console.log.bind(_console);
49
+ /**
50
+ * (Safe copy) Outputs a warning message to the console.
51
+ */
52
+ const warn = _console.warn.bind(_console);
53
+ /**
54
+ * (Safe copy) Outputs an error message to the console.
55
+ */
56
+ const error = _console.error.bind(_console);
57
+ /**
58
+ * (Safe copy) Outputs an informational message to the console.
59
+ */
60
+ const info = _console.info.bind(_console);
61
+ /**
62
+ * (Safe copy) Outputs a debug message to the console.
63
+ */
64
+ const debug = _console.debug.bind(_console);
65
+ /**
66
+ * (Safe copy) Outputs a stack trace to the console.
67
+ */
68
+ const trace = _console.trace.bind(_console);
69
+ /**
70
+ * (Safe copy) Displays an interactive listing of the properties of a specified object.
71
+ */
72
+ const dir = _console.dir.bind(_console);
73
+ /**
74
+ * (Safe copy) Displays tabular data as a table.
75
+ */
76
+ const table = _console.table.bind(_console);
77
+ /**
78
+ * (Safe copy) Writes an error message to the console if the assertion is false.
79
+ */
80
+ const assert = _console.assert.bind(_console);
81
+ /**
82
+ * (Safe copy) Clears the console.
83
+ */
84
+ const clear = _console.clear.bind(_console);
85
+ /**
86
+ * (Safe copy) Logs the number of times that this particular call to count() has been called.
87
+ */
88
+ const count = _console.count.bind(_console);
89
+ /**
90
+ * (Safe copy) Resets the counter used with console.count().
91
+ */
92
+ const countReset = _console.countReset.bind(_console);
93
+ /**
94
+ * (Safe copy) Creates a new inline group in the console.
95
+ */
96
+ const group = _console.group.bind(_console);
97
+ /**
98
+ * (Safe copy) Creates a new inline group in the console that is initially collapsed.
99
+ */
100
+ const groupCollapsed = _console.groupCollapsed.bind(_console);
101
+ /**
102
+ * (Safe copy) Exits the current inline group.
103
+ */
104
+ const groupEnd = _console.groupEnd.bind(_console);
105
+ /**
106
+ * (Safe copy) Starts a timer with a name specified as an input parameter.
107
+ */
108
+ const time = _console.time.bind(_console);
109
+ /**
110
+ * (Safe copy) Stops a timer that was previously started.
111
+ */
112
+ const timeEnd = _console.timeEnd.bind(_console);
113
+ /**
114
+ * (Safe copy) Logs the current value of a timer that was previously started.
115
+ */
116
+ const timeLog = _console.timeLog.bind(_console);
117
+ /**
118
+ * (Safe copy) Namespace object containing all Console methods.
119
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
120
+ */
121
+ const Console = _freeze$e({
122
+ log,
123
+ warn,
124
+ error,
125
+ info,
126
+ debug,
127
+ trace,
128
+ dir,
129
+ table,
130
+ assert,
131
+ clear,
132
+ count,
133
+ countReset,
134
+ group,
135
+ groupCollapsed,
136
+ groupEnd,
137
+ time,
138
+ timeEnd,
139
+ timeLog,
140
+ });
141
+
142
+ /**
143
+ * Safe copies of Date built-in via factory function and static methods.
144
+ *
145
+ * Since constructors cannot be safely captured via Object.assign, this module
146
+ * provides a factory function that uses Reflect.construct internally.
147
+ *
148
+ * These references are captured at module initialization time to protect against
149
+ * prototype pollution attacks. Import only what you need for tree-shaking.
150
+ *
151
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/date
152
+ */
153
+ // Capture references at module initialization time
154
+ const _Date = globalThis.Date;
155
+ const _Reflect$b = globalThis.Reflect;
156
+ const _freeze$d = globalThis.Object.freeze;
157
+ function createDate(...args) {
158
+ return _Reflect$b.construct(_Date, args);
159
+ }
160
+ /**
161
+ * (Safe copy) Returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
162
+ */
163
+ const dateNow = _Date.now;
164
+ /**
165
+ * (Safe copy) Parses a string representation of a date.
166
+ */
167
+ const dateParse = _Date.parse;
168
+ /**
169
+ * (Safe copy) Returns the number of milliseconds in a Date object since January 1, 1970 UTC.
170
+ */
171
+ const dateUTC = _Date.UTC;
172
+ /**
173
+ * (Safe copy) Namespace object containing Date factory and static methods.
174
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
175
+ */
176
+ const Date = _freeze$d({
177
+ create: createDate,
178
+ now: dateNow,
179
+ parse: dateParse,
180
+ UTC: dateUTC,
181
+ });
182
+
183
+ /**
184
+ * Safe copies of Error built-ins via factory functions.
185
+ *
186
+ * Since constructors cannot be safely captured via Object.assign, this module
187
+ * provides factory functions that use Reflect.construct internally.
188
+ *
189
+ * These references are captured at module initialization time to protect against
190
+ * prototype pollution attacks. Import only what you need for tree-shaking.
191
+ *
192
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/error
193
+ */
194
+ // Capture references at module initialization time
195
+ const _Error = globalThis.Error;
196
+ const _TypeError = globalThis.TypeError;
197
+ const _RangeError = globalThis.RangeError;
198
+ const _ReferenceError = globalThis.ReferenceError;
199
+ const _SyntaxError = globalThis.SyntaxError;
200
+ const _URIError = globalThis.URIError;
201
+ const _EvalError = globalThis.EvalError;
202
+ const _AggregateError = globalThis.AggregateError;
203
+ const _Reflect$a = globalThis.Reflect;
204
+ const _freeze$c = globalThis.Object.freeze;
205
+ /**
206
+ * (Safe copy) Creates a new Error using the captured Error constructor.
207
+ * Use this instead of `new Error()`.
208
+ *
209
+ * @param message - Optional error message.
210
+ * @param options - Optional error options.
211
+ * @returns A new Error instance.
212
+ */
213
+ const createError = (message, options) => _Reflect$a.construct(_Error, [message, options]);
214
+ /**
215
+ * (Safe copy) Creates a new TypeError using the captured TypeError constructor.
216
+ * Use this instead of `new TypeError()`.
217
+ *
218
+ * @param message - Optional error message.
219
+ * @param options - Optional error options.
220
+ * @returns A new TypeError instance.
221
+ */
222
+ const createTypeError = (message, options) => _Reflect$a.construct(_TypeError, [message, options]);
223
+ /**
224
+ * (Safe copy) Creates a new RangeError using the captured RangeError constructor.
225
+ * Use this instead of `new RangeError()`.
226
+ *
227
+ * @param message - Optional error message.
228
+ * @param options - Optional error options.
229
+ * @returns A new RangeError instance.
230
+ */
231
+ const createRangeError = (message, options) => _Reflect$a.construct(_RangeError, [message, options]);
232
+ /**
233
+ * (Safe copy) Creates a new ReferenceError using the captured ReferenceError constructor.
234
+ * Use this instead of `new ReferenceError()`.
235
+ *
236
+ * @param message - Optional error message.
237
+ * @param options - Optional error options.
238
+ * @returns A new ReferenceError instance.
239
+ */
240
+ const createReferenceError = (message, options) => _Reflect$a.construct(_ReferenceError, [message, options]);
241
+ /**
242
+ * (Safe copy) Creates a new SyntaxError using the captured SyntaxError constructor.
243
+ * Use this instead of `new SyntaxError()`.
244
+ *
245
+ * @param message - Optional error message.
246
+ * @param options - Optional error options.
247
+ * @returns A new SyntaxError instance.
248
+ */
249
+ const createSyntaxError = (message, options) => _Reflect$a.construct(_SyntaxError, [message, options]);
250
+ /**
251
+ * (Safe copy) Creates a new URIError using the captured URIError constructor.
252
+ * Use this instead of `new URIError()`.
253
+ *
254
+ * @param message - Optional error message.
255
+ * @param options - Optional error options.
256
+ * @returns A new URIError instance.
257
+ */
258
+ const createURIError = (message, options) => _Reflect$a.construct(_URIError, [message, options]);
259
+ /**
260
+ * (Safe copy) Creates a new EvalError using the captured EvalError constructor.
261
+ * Use this instead of `new EvalError()`.
262
+ *
263
+ * @param message - Optional error message.
264
+ * @param options - Optional error options.
265
+ * @returns A new EvalError instance.
266
+ */
267
+ const createEvalError = (message, options) => _Reflect$a.construct(_EvalError, [message, options]);
268
+ /**
269
+ * (Safe copy) Creates a new AggregateError using the captured AggregateError constructor.
270
+ * Use this instead of `new AggregateError()`.
271
+ *
272
+ * @param errors - An iterable of errors to aggregate.
273
+ * @param message - Optional error message.
274
+ * @param options - Optional error options.
275
+ * @returns A new AggregateError instance.
276
+ */
277
+ const createAggregateError = (errors, message, options) => _Reflect$a.construct(_AggregateError, [errors, message, options]);
278
+ /**
279
+ * (Safe copy) Namespace object containing Error factory functions.
280
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
281
+ */
282
+ const Error = _freeze$c({
283
+ create: createError,
284
+ TypeError: createTypeError,
285
+ RangeError: createRangeError,
286
+ ReferenceError: createReferenceError,
287
+ SyntaxError: createSyntaxError,
288
+ URIError: createURIError,
289
+ EvalError: createEvalError,
290
+ AggregateError: createAggregateError,
291
+ });
292
+
293
+ /**
294
+ * Safe copies of Function built-in and utilities.
295
+ *
296
+ * These references are captured at module initialization time to protect against
297
+ * prototype pollution attacks. Import only what you need for tree-shaking.
298
+ *
299
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/function
300
+ */
301
+ // Capture references at module initialization time
302
+ const _Function = globalThis.Function;
303
+ const _FunctionPrototype = _Function.prototype;
304
+ const _Reflect$9 = globalThis.Reflect;
305
+ const _freeze$b = globalThis.Object.freeze;
306
+ /**
307
+ * (Safe copy) Creates a new Function using the captured Function constructor.
308
+ * Use this instead of `new Function()`.
309
+ *
310
+ * NOTE: Dynamic code generation via Function constructor should be avoided when possible
311
+ * due to security risks similar to eval().
312
+ *
313
+ * @param args - Function body and parameter strings.
314
+ * @returns A new Function.
315
+ */
316
+ const createFunction = (...args) => _Reflect$9.construct(_Function, args);
317
+ /**
318
+ * (Safe copy) Reference to the captured Function.prototype.
319
+ */
320
+ const functionPrototype = _FunctionPrototype;
321
+ /**
322
+ * (Safe copy) Reference to the captured Function.prototype.call.
323
+ */
324
+ const functionCall = _FunctionPrototype.call;
325
+ /**
326
+ * (Safe copy) Reference to the captured Function.prototype.apply.
327
+ */
328
+ const functionApply = _FunctionPrototype.apply;
329
+ /**
330
+ * (Safe copy) Reference to the captured Function.prototype.bind.
331
+ */
332
+ const functionBind = _FunctionPrototype.bind;
333
+ /**
334
+ * (Safe copy) Namespace object containing Function utilities.
335
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
336
+ */
337
+ const Function = _freeze$b({
338
+ create: createFunction,
339
+ prototype: functionPrototype,
340
+ call: functionCall,
341
+ apply: functionApply,
342
+ bind: functionBind,
343
+ });
344
+
345
+ /**
346
+ * Safe copies of JSON built-in methods.
347
+ *
348
+ * These references are captured at module initialization time to protect against
349
+ * prototype pollution attacks. Import only what you need for tree-shaking.
350
+ *
351
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/json
352
+ */
353
+ // Capture references at module initialization time
354
+ const _JSON = globalThis.JSON;
355
+ const _freeze$a = globalThis.Object.freeze;
356
+ /**
357
+ * (Safe copy) Converts a JavaScript Object Notation (JSON) string into an object.
358
+ */
359
+ const parse = _JSON.parse;
360
+ /**
361
+ * (Safe copy) Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
362
+ */
363
+ const stringify = _JSON.stringify;
364
+ /**
365
+ * (Safe copy) Namespace object containing all JSON methods.
366
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
367
+ */
368
+ const JSON = _freeze$a({
369
+ parse,
370
+ stringify,
371
+ });
372
+
373
+ /**
374
+ * Safe copies of Map built-in via factory function.
375
+ *
376
+ * Since constructors cannot be safely captured via Object.assign, this module
377
+ * provides a factory function that uses Reflect.construct internally.
378
+ *
379
+ * These references are captured at module initialization time to protect against
380
+ * prototype pollution attacks. Import only what you need for tree-shaking.
381
+ *
382
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/map
383
+ */
384
+ // Capture references at module initialization time
385
+ const _Map = globalThis.Map;
386
+ const _Reflect$8 = globalThis.Reflect;
387
+ const _freeze$9 = globalThis.Object.freeze;
388
+ /**
389
+ * (Safe copy) Creates a new Map using the captured Map constructor.
390
+ * Use this instead of `new Map()`.
391
+ *
392
+ * @param iterable - Optional iterable of key-value pairs.
393
+ * @returns A new Map instance.
394
+ */
395
+ const createMap = (iterable) => _Reflect$8.construct(_Map, iterable ? [iterable] : []);
396
+ /**
397
+ * (Safe copy) Groups elements by key using the captured Map.groupBy if available.
398
+ * Note: Available only in ES2024+ environments.
399
+ */
400
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
401
+ const mapGroupBy = _Map.groupBy;
402
+ /**
403
+ * (Safe copy) Namespace object containing Map factory.
404
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
405
+ */
406
+ const Map = _freeze$9({
407
+ create: createMap,
408
+ groupBy: mapGroupBy,
409
+ });
410
+
411
+ /**
412
+ * Safe copies of Messaging/Communication built-in functions and constructors.
413
+ *
414
+ * These references are captured at module initialization time to protect against
415
+ * prototype pollution attacks. Import only what you need for tree-shaking.
416
+ *
417
+ * Note: `postMessage` is a method on specific objects (Window, Worker, MessagePort)
418
+ * rather than a global. This module provides factory functions for MessageChannel
419
+ * and BroadcastChannel, whose instances have safe postMessage methods.
420
+ *
421
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/messaging
422
+ */
423
+ // Capture references at module initialization time
424
+ const _Reflect$7 = globalThis.Reflect;
425
+ const _freeze$8 = globalThis.Object.freeze;
426
+ const _structuredClone = typeof globalThis.structuredClone === 'function' ? globalThis.structuredClone : undefined;
427
+ const _MessageChannel = typeof globalThis.MessageChannel === 'function' ? globalThis.MessageChannel : undefined;
428
+ const _BroadcastChannel = typeof globalThis.BroadcastChannel === 'function' ? globalThis.BroadcastChannel : undefined;
429
+ /**
430
+ * (Safe copy) Creates a deep clone of a value using the structured clone algorithm.
431
+ * Available in modern browsers and Node.js 17+.
432
+ *
433
+ * @param value - The value to clone.
434
+ * @param options - Optional transfer or serialization options.
435
+ * @returns A deep clone of the value.
436
+ */
437
+ const structuredClone = _structuredClone
438
+ ? (value, options) => _structuredClone(value, options)
439
+ : undefined;
440
+ /**
441
+ * (Safe copy) Creates a new MessageChannel using the captured constructor.
442
+ * MessageChannel provides two ports for bidirectional communication.
443
+ *
444
+ * @returns A new MessageChannel instance or undefined if not available.
445
+ */
446
+ const createMessageChannel = _MessageChannel
447
+ ? () => _Reflect$7.construct(_MessageChannel, [])
448
+ : undefined;
449
+ /**
450
+ * (Safe copy) Creates a new BroadcastChannel using the captured constructor.
451
+ * BroadcastChannel enables communication between browsing contexts with the same origin.
452
+ *
453
+ * @param name - Identifier for the broadcast channel that other contexts use to subscribe.
454
+ * @returns A new BroadcastChannel instance or undefined if not available.
455
+ */
456
+ const createBroadcastChannel = _BroadcastChannel
457
+ ? (name) => _Reflect$7.construct(_BroadcastChannel, [name])
458
+ : undefined;
459
+ /**
460
+ * (Safe copy) Posts a message to a Window object using captured postMessage.
461
+ * This is a helper that wraps Window.postMessage for safe messaging.
462
+ *
463
+ * @param target - Destination window, iframe, or popup context.
464
+ * @param message - The data payload to send, must be structured-cloneable.
465
+ * @param options - Target origin and optional transferables.
466
+ */
467
+ const postMessageToWindow = (target, message, options) => {
468
+ target.postMessage(message, options.targetOrigin, options.transfer);
469
+ };
470
+ /**
471
+ * (Safe copy) Posts a message to a Worker using captured postMessage.
472
+ *
473
+ * @param target - Web Worker or service worker instance.
474
+ * @param message - The data payload to send, must be structured-cloneable.
475
+ * @param transfer - Optional array of Transferable objects.
476
+ */
477
+ const postMessageToWorker = (target, message, transfer) => {
478
+ if (transfer) {
479
+ target.postMessage(message, transfer);
480
+ }
481
+ else {
482
+ target.postMessage(message);
483
+ }
484
+ };
485
+ /**
486
+ * (Safe copy) Posts a message to a MessagePort.
487
+ *
488
+ * @param port - One end of a two-way communication channel.
489
+ * @param message - The data payload to send, must be structured-cloneable.
490
+ * @param transfer - Optional array of Transferable objects.
491
+ */
492
+ const postMessageToPort = (port, message, transfer) => {
493
+ if (transfer) {
494
+ port.postMessage(message, transfer);
495
+ }
496
+ else {
497
+ port.postMessage(message);
498
+ }
499
+ };
500
+ /**
501
+ * (Safe copy) Posts a message to a BroadcastChannel.
502
+ *
503
+ * @param channel - Named broadcast channel for same-origin contexts.
504
+ * @param message - The data payload to send, must be structured-cloneable.
505
+ */
506
+ const postMessageToBroadcast = (channel, message) => {
507
+ channel.postMessage(message);
508
+ };
509
+ /**
510
+ * (Safe copy) Namespace object containing all Messaging functions.
511
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
512
+ */
513
+ const Messaging = _freeze$8({
514
+ structuredClone,
515
+ createMessageChannel,
516
+ createBroadcastChannel,
517
+ postMessageToWindow,
518
+ postMessageToWorker,
519
+ postMessageToPort,
520
+ postMessageToBroadcast,
521
+ });
522
+
523
+ /**
524
+ * Safe copies of Object built-in methods.
525
+ *
526
+ * These references are captured at module initialization time to protect against
527
+ * prototype pollution attacks. Import only what you need for tree-shaking.
528
+ *
529
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/object
530
+ */
531
+ // Capture references at module initialization time
532
+ const _Object = globalThis.Object;
533
+ const _Reflect$6 = globalThis.Reflect;
534
+ const _ObjectPrototype = _Object.prototype;
535
+ const _hasOwnProperty = _ObjectPrototype.hasOwnProperty;
536
+ /**
537
+ * (Safe copy) Prevents modification of existing property attributes and values,
538
+ * and prevents the addition of new properties.
539
+ */
540
+ const freeze = _Object.freeze;
541
+ /**
542
+ * (Safe copy) Creates an object that has the specified prototype or that has null prototype.
543
+ */
544
+ const create = _Object.create;
545
+ /**
546
+ * (Safe copy) Returns the names of the enumerable string properties and methods of an object.
547
+ */
548
+ const keys = _Object.keys;
549
+ /**
550
+ * (Safe copy) Returns an array of key/values of the enumerable own properties of an object.
551
+ */
552
+ const entries = _Object.entries;
553
+ /**
554
+ * (Safe copy) Returns an array of values of the enumerable own properties of an object.
555
+ */
556
+ const values = _Object.values;
557
+ /**
558
+ * (Safe copy) Returns an object from an iterable of key-value pairs.
559
+ */
560
+ const fromEntries = _Object.fromEntries;
561
+ /**
562
+ * (Safe copy) Copy the values of all enumerable own properties from one or more source objects
563
+ * to a target object. Returns the target object.
564
+ */
565
+ const assign = _Object.assign;
566
+ /**
567
+ * (Safe copy) Adds a property to an object, or modifies attributes of an existing property.
568
+ */
569
+ const defineProperty$1 = _Object.defineProperty;
570
+ /**
571
+ * (Safe copy) Adds one or more properties to an object, and/or modifies attributes of existing properties.
572
+ */
573
+ const defineProperties = _Object.defineProperties;
574
+ /**
575
+ * (Safe copy) Determines whether an object has a property with the specified name.
576
+ */
577
+ const objectHasOwn = _Object.hasOwn;
578
+ /**
579
+ * (Safe copy) Sets the prototype of a specified object o to object proto or null.
580
+ */
581
+ const setPrototypeOf$1 = _Object.setPrototypeOf;
582
+ /**
583
+ * (Safe copy) Returns the prototype of an object.
584
+ */
585
+ const getPrototypeOf$1 = _Object.getPrototypeOf;
586
+ /**
587
+ * (Safe copy) Prevents the addition of new properties to an object.
588
+ */
589
+ const seal = _Object.seal;
590
+ /**
591
+ * (Safe copy) Returns true if existing property attributes and values cannot be modified
592
+ * in an object, and new properties cannot be added to the object.
593
+ */
594
+ const isFrozen = _Object.isFrozen;
595
+ /**
596
+ * (Safe copy) Returns true if existing property attributes cannot be modified in an object
597
+ * and new properties cannot be added to the object.
598
+ */
599
+ const isSealed = _Object.isSealed;
600
+ /**
601
+ * (Safe copy) Returns a value that indicates whether new properties can be added to an object.
602
+ */
603
+ const isExtensible$1 = _Object.isExtensible;
604
+ /**
605
+ * (Safe copy) Prevents the addition of new properties to an object.
606
+ */
607
+ const preventExtensions$1 = _Object.preventExtensions;
608
+ /**
609
+ * (Safe copy) Gets the own property descriptor of the specified object.
610
+ */
611
+ const getOwnPropertyDescriptor$1 = _Object.getOwnPropertyDescriptor;
612
+ /**
613
+ * (Safe copy) Returns the names of the own properties of an object.
614
+ */
615
+ const getOwnPropertyNames = _Object.getOwnPropertyNames;
616
+ /**
617
+ * (Safe copy) Returns an array of all symbol properties found directly on object o.
618
+ */
619
+ const getOwnPropertySymbols = _Object.getOwnPropertySymbols;
620
+ /**
621
+ * (Safe copy) Gets the own property descriptors of the specified object.
622
+ */
623
+ const getOwnPropertyDescriptors = _Object.getOwnPropertyDescriptors;
624
+ /**
625
+ * (Safe copy) Safe wrapper for Object.prototype.hasOwnProperty.call().
626
+ * Checks if an object has a property as its own (not inherited) property.
627
+ *
628
+ * @param obj - The object to check.
629
+ * @param key - The property key to check.
630
+ * @returns True if the object has the property as its own property.
631
+ */
632
+ const hasOwn = (obj, key) => _Reflect$6.apply(_hasOwnProperty, obj, [key]);
633
+ /**
634
+ * (Safe copy) Namespace object containing all Object static methods.
635
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
636
+ */
637
+ const Object$1 = _Object.freeze({
638
+ freeze,
639
+ create,
640
+ keys,
641
+ entries,
642
+ values,
643
+ fromEntries,
644
+ assign,
645
+ defineProperty: defineProperty$1,
646
+ defineProperties,
647
+ hasOwn: objectHasOwn,
648
+ setPrototypeOf: setPrototypeOf$1,
649
+ getPrototypeOf: getPrototypeOf$1,
650
+ seal,
651
+ isFrozen,
652
+ isSealed,
653
+ isExtensible: isExtensible$1,
654
+ preventExtensions: preventExtensions$1,
655
+ getOwnPropertyDescriptor: getOwnPropertyDescriptor$1,
656
+ getOwnPropertyNames,
657
+ getOwnPropertySymbols,
658
+ getOwnPropertyDescriptors,
659
+ });
660
+
661
+ /**
662
+ * Safe copies of Promise built-in methods via factory functions.
663
+ *
664
+ * Since constructors cannot be safely captured via Object.assign, this module
665
+ * provides factory functions that use Reflect.construct internally.
666
+ *
667
+ * These references are captured at module initialization time to protect against
668
+ * prototype pollution attacks. Import only what you need for tree-shaking.
669
+ *
670
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/promise
671
+ */
672
+ // Capture references at module initialization time
673
+ const _Promise = globalThis.Promise;
674
+ const _Reflect$5 = globalThis.Reflect;
675
+ const _freeze$7 = globalThis.Object.freeze;
676
+ /**
677
+ * (Safe copy) Creates a new Promise using the captured Promise constructor.
678
+ * Use this instead of `new Promise()`.
679
+ *
680
+ * @param executor - The executor function.
681
+ * @returns A new Promise instance.
682
+ */
683
+ const createPromise = (executor) => _Reflect$5.construct(_Promise, [executor]);
684
+ /**
685
+ * (Safe copy) Returns a Promise that resolves with the given value.
686
+ */
687
+ const promiseResolve = _Promise.resolve.bind(_Promise);
688
+ /**
689
+ * (Safe copy) Returns a Promise that rejects with the given reason.
690
+ */
691
+ const promiseReject = _Promise.reject.bind(_Promise);
692
+ /**
693
+ * (Safe copy) Returns a Promise that resolves when all promises resolve.
694
+ */
695
+ const promiseAll = _Promise.all.bind(_Promise);
696
+ /**
697
+ * (Safe copy) Returns a Promise that resolves/rejects with the first settled promise.
698
+ */
699
+ const promiseRace = _Promise.race.bind(_Promise);
700
+ /**
701
+ * (Safe copy) Returns a Promise that resolves when all promises settle.
702
+ */
703
+ const promiseAllSettled = _Promise.allSettled.bind(_Promise);
704
+ /**
705
+ * (Safe copy) Returns a Promise that resolves with the first fulfilled promise.
706
+ */
707
+ const promiseAny = _Promise.any.bind(_Promise);
708
+ /**
709
+ * (Safe copy) Creates a Promise along with its resolve and reject functions.
710
+ * Note: Available only in ES2024+ environments.
711
+ */
712
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
713
+ const promiseWithResolvers = _Promise.withResolvers?.bind(_Promise);
714
+ /**
715
+ * (Safe copy) Namespace object containing all Promise factory functions.
716
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
717
+ */
718
+ const Promise$1 = _freeze$7({
719
+ create: createPromise,
720
+ resolve: promiseResolve,
721
+ reject: promiseReject,
722
+ all: promiseAll,
723
+ race: promiseRace,
724
+ allSettled: promiseAllSettled,
725
+ any: promiseAny,
726
+ withResolvers: promiseWithResolvers,
727
+ });
728
+
729
+ /**
730
+ * Safe copies of Reflect built-in methods.
731
+ *
732
+ * These references are captured at module initialization time to protect against
733
+ * prototype pollution attacks. Import only what you need for tree-shaking.
734
+ *
735
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/reflect
736
+ */
737
+ // Capture references at module initialization time
738
+ const _Reflect$4 = globalThis.Reflect;
739
+ const _freeze$6 = globalThis.Object.freeze;
740
+ /**
741
+ * (Safe copy) Calls the function with the specified object as the this value
742
+ * and the elements of specified array as the arguments.
743
+ */
744
+ const apply = _Reflect$4.apply;
745
+ /**
746
+ * (Safe copy) Constructs the target with the elements of specified array as the arguments.
747
+ */
748
+ const construct = _Reflect$4.construct;
749
+ /**
750
+ * (Safe copy) Gets the property of target, equivalent to target[propertyKey].
751
+ */
752
+ const get = _Reflect$4.get;
753
+ /**
754
+ * (Safe copy) Sets the property of target, equivalent to target[propertyKey] = value.
755
+ */
756
+ const set = _Reflect$4.set;
757
+ /**
758
+ * (Safe copy) Determines whether an object has a property with the specified name.
759
+ */
760
+ const has = _Reflect$4.has;
761
+ /**
762
+ * (Safe copy) Returns an array of the target object's own property keys.
763
+ */
764
+ const ownKeys = _Reflect$4.ownKeys;
765
+ /**
766
+ * (Safe copy) Adds or modifies a property on an object.
767
+ */
768
+ const defineProperty = _Reflect$4.defineProperty;
769
+ /**
770
+ * (Safe copy) Deletes a property from an object.
771
+ */
772
+ const deleteProperty = _Reflect$4.deleteProperty;
773
+ /**
774
+ * (Safe copy) Gets the property descriptor of the specified property.
775
+ */
776
+ const getOwnPropertyDescriptor = _Reflect$4.getOwnPropertyDescriptor;
777
+ /**
778
+ * (Safe copy) Returns the prototype of the specified object.
779
+ */
780
+ const getPrototypeOf = _Reflect$4.getPrototypeOf;
781
+ /**
782
+ * (Safe copy) Sets the prototype of the specified object.
783
+ */
784
+ const setPrototypeOf = _Reflect$4.setPrototypeOf;
785
+ /**
786
+ * (Safe copy) Returns a boolean indicating whether the object is extensible.
787
+ */
788
+ const isExtensible = _Reflect$4.isExtensible;
789
+ /**
790
+ * (Safe copy) Prevents new properties from being added to the object.
791
+ */
792
+ const preventExtensions = _Reflect$4.preventExtensions;
793
+ /**
794
+ * (Safe copy) Namespace object containing all Reflect methods.
795
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
796
+ */
797
+ const Reflect = _freeze$6({
798
+ apply,
799
+ construct,
800
+ get,
801
+ set,
802
+ has,
803
+ ownKeys,
804
+ defineProperty,
805
+ deleteProperty,
806
+ getOwnPropertyDescriptor,
807
+ getPrototypeOf,
808
+ setPrototypeOf,
809
+ isExtensible,
810
+ preventExtensions,
811
+ });
812
+
813
+ /**
814
+ * Safe copies of RegExp built-in via factory function.
815
+ *
816
+ * Since constructors cannot be safely captured via Object.assign, this module
817
+ * provides a factory function that uses Reflect.construct internally.
818
+ *
819
+ * These references are captured at module initialization time to protect against
820
+ * prototype pollution attacks. Import only what you need for tree-shaking.
821
+ *
822
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/regexp
823
+ */
824
+ // Capture references at module initialization time
825
+ const _RegExp = globalThis.RegExp;
826
+ const _Reflect$3 = globalThis.Reflect;
827
+ const _freeze$5 = globalThis.Object.freeze;
828
+ /**
829
+ * (Safe copy) Creates a new RegExp using the captured RegExp constructor.
830
+ * Use this instead of `new RegExp()`.
831
+ *
832
+ * @param pattern - The pattern string or RegExp to copy.
833
+ * @param flags - Optional flags string.
834
+ * @returns A new RegExp instance.
835
+ */
836
+ const createRegExp = (pattern, flags) => _Reflect$3.construct(_RegExp, [pattern, flags]);
837
+ /**
838
+ * (Safe copy) Namespace object containing RegExp factory.
839
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
840
+ */
841
+ const RegExp = _freeze$5({
842
+ create: createRegExp,
843
+ });
844
+
845
+ /**
846
+ * Safe copies of Set built-in via factory function.
847
+ *
848
+ * Since constructors cannot be safely captured via Object.assign, this module
849
+ * provides a factory function that uses Reflect.construct internally.
850
+ *
851
+ * These references are captured at module initialization time to protect against
852
+ * prototype pollution attacks. Import only what you need for tree-shaking.
853
+ *
854
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/set
855
+ */
856
+ // Capture references at module initialization time
857
+ const _Set = globalThis.Set;
858
+ const _Reflect$2 = globalThis.Reflect;
859
+ const _freeze$4 = globalThis.Object.freeze;
860
+ /**
861
+ * (Safe copy) Creates a new Set using the captured Set constructor.
862
+ * Use this instead of `new Set()`.
863
+ *
864
+ * @param iterable - Optional iterable of values.
865
+ * @returns A new Set instance.
866
+ */
867
+ const createSet = (iterable) => _Reflect$2.construct(_Set, iterable ? [iterable] : []);
868
+ /**
869
+ * (Safe copy) Namespace object containing Set factory.
870
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
871
+ */
872
+ const Set = _freeze$4({
873
+ create: createSet,
874
+ });
875
+
876
+ /**
877
+ * Safe copies of Symbol built-in and well-known symbols.
878
+ *
879
+ * These references are captured at module initialization time to protect against
880
+ * prototype pollution attacks. Import only what you need for tree-shaking.
881
+ *
882
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/symbol
883
+ */
884
+ // Capture references at module initialization time
885
+ const _Symbol = globalThis.Symbol;
886
+ const _freeze$3 = globalThis.Object.freeze;
887
+ /**
888
+ * (Safe copy) Creates a new Symbol with optional description.
889
+ * Use this instead of `Symbol()`.
890
+ *
891
+ * @param description - Optional description for the symbol.
892
+ * @returns A new Symbol.
893
+ */
894
+ const createSymbol = (description) => _Symbol(description);
895
+ /**
896
+ * (Safe copy) Returns a Symbol object from the global symbol registry.
897
+ */
898
+ const symbolFor = _Symbol.for;
899
+ /**
900
+ * (Safe copy) Returns a key from the global symbol registry.
901
+ */
902
+ const symbolKeyFor = _Symbol.keyFor;
903
+ // Well-known symbols (captured)
904
+ /**
905
+ * (Safe copy) A method that returns the default iterator for an object.
906
+ */
907
+ const symbolIterator = _Symbol.iterator;
908
+ /**
909
+ * (Safe copy) A method that returns the default async iterator for an object.
910
+ */
911
+ const symbolAsyncIterator = _Symbol.asyncIterator;
912
+ /**
913
+ * (Safe copy) A method that converts an object to a primitive value.
914
+ */
915
+ const symbolToStringTag = _Symbol.toStringTag;
916
+ /**
917
+ * (Safe copy) A method that determines if a constructor object recognizes an object as its instance.
918
+ */
919
+ const symbolHasInstance = _Symbol.hasInstance;
920
+ /**
921
+ * (Safe copy) A Boolean value indicating if an object should be flattened to its array elements.
922
+ */
923
+ const symbolIsConcatSpreadable = _Symbol.isConcatSpreadable;
924
+ /**
925
+ * (Safe copy) A method that matches against a string.
926
+ */
927
+ const symbolMatch = _Symbol.match;
928
+ /**
929
+ * (Safe copy) A method that returns an index within a string that matches the regular expression.
930
+ */
931
+ const symbolMatchAll = _Symbol.matchAll;
932
+ /**
933
+ * (Safe copy) A method that replaces matched substrings of a string.
934
+ */
935
+ const symbolReplace = _Symbol.replace;
936
+ /**
937
+ * (Safe copy) A method that returns the index within a string that matches the regular expression.
938
+ */
939
+ const symbolSearch = _Symbol.search;
940
+ /**
941
+ * (Safe copy) A method that splits a string at the indices that match a regular expression.
942
+ */
943
+ const symbolSplit = _Symbol.split;
944
+ /**
945
+ * (Safe copy) A function valued property that is the constructor function that is used to create derived objects.
946
+ */
947
+ const symbolSpecies = _Symbol.species;
948
+ /**
949
+ * (Safe copy) A method that converts an object to a primitive value.
950
+ */
951
+ const symbolToPrimitive = _Symbol.toPrimitive;
952
+ /**
953
+ * (Safe copy) An Object whose own property names are property names that are excluded from the with environment bindings.
954
+ */
955
+ const symbolUnscopables = _Symbol.unscopables;
956
+ /**
957
+ * (Safe copy) Namespace object containing Symbol utilities and well-known symbols.
958
+ * Note: Importing this imports all symbols in this namespace (no tree-shaking).
959
+ */
960
+ const Symbol$1 = _freeze$3({
961
+ create: createSymbol,
962
+ for: symbolFor,
963
+ keyFor: symbolKeyFor,
964
+ iterator: symbolIterator,
965
+ asyncIterator: symbolAsyncIterator,
966
+ toStringTag: symbolToStringTag,
967
+ hasInstance: symbolHasInstance,
968
+ isConcatSpreadable: symbolIsConcatSpreadable,
969
+ match: symbolMatch,
970
+ matchAll: symbolMatchAll,
971
+ replace: symbolReplace,
972
+ search: symbolSearch,
973
+ split: symbolSplit,
974
+ species: symbolSpecies,
975
+ toPrimitive: symbolToPrimitive,
976
+ unscopables: symbolUnscopables,
977
+ });
978
+
979
+ /**
980
+ * Safe copies of Timer/Scheduling built-in functions.
981
+ *
982
+ * These references are captured at module initialization time to protect against
983
+ * prototype pollution attacks. Import only what you need for tree-shaking.
984
+ *
985
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/timers
986
+ */
987
+ // Capture references at module initialization time
988
+ const _setTimeout = globalThis.setTimeout;
989
+ const _setInterval = globalThis.setInterval;
990
+ const _clearTimeout = globalThis.clearTimeout;
991
+ const _clearInterval = globalThis.clearInterval;
992
+ const _queueMicrotask = globalThis.queueMicrotask;
993
+ const _requestAnimationFrame = typeof globalThis.requestAnimationFrame === 'function' ? globalThis.requestAnimationFrame : undefined;
994
+ const _cancelAnimationFrame = typeof globalThis.cancelAnimationFrame === 'function' ? globalThis.cancelAnimationFrame : undefined;
995
+ const _freeze$2 = globalThis.Object.freeze;
996
+ /**
997
+ * (Safe copy) Sets a timer which executes a function once the timer expires.
998
+ *
999
+ * @param callback - Function to call when the timer elapses.
1000
+ * @param delay - Time in milliseconds before executing.
1001
+ * @param args - Additional arguments to pass to the callback.
1002
+ * @returns A numeric ID for the timer.
1003
+ */
1004
+ const setTimeout = (callback, delay, ...args) => _setTimeout(callback, delay, ...args);
1005
+ /**
1006
+ * (Safe copy) Repeatedly calls a function with a fixed time delay between each call.
1007
+ *
1008
+ * @param callback - Function to call at each interval.
1009
+ * @param delay - Time in milliseconds between calls.
1010
+ * @param args - Additional arguments to pass to the callback.
1011
+ * @returns A numeric ID for the interval.
1012
+ */
1013
+ const setInterval = (callback, delay, ...args) => _setInterval(callback, delay, ...args);
1014
+ /**
1015
+ * (Safe copy) Cancels a timeout previously established by setTimeout.
1016
+ *
1017
+ * @param id - The identifier of the timeout to cancel.
1018
+ */
1019
+ const clearTimeout = (id) => {
1020
+ _clearTimeout(id);
1021
+ };
1022
+ /**
1023
+ * (Safe copy) Cancels a timed, repeating action previously established by setInterval.
1024
+ *
1025
+ * @param id - The identifier of the interval to cancel.
1026
+ */
1027
+ const clearInterval = (id) => {
1028
+ _clearInterval(id);
1029
+ };
1030
+ /**
1031
+ * (Safe copy) Queues a microtask to be executed before control returns to the event loop.
1032
+ *
1033
+ * @param callback - Function to execute.
1034
+ */
1035
+ const queueMicrotask = (callback) => {
1036
+ _queueMicrotask(callback);
1037
+ };
1038
+ /**
1039
+ * (Safe copy) Requests the browser to call a function before the next repaint.
1040
+ * Available only in browser environments.
1041
+ *
1042
+ * @param callback - Function to call before repaint.
1043
+ * @returns A request ID or undefined if not available.
1044
+ */
1045
+ const requestAnimationFrame = _requestAnimationFrame
1046
+ ? (callback) => _requestAnimationFrame(callback)
1047
+ : undefined;
1048
+ /**
1049
+ * (Safe copy) Cancels an animation frame request previously scheduled.
1050
+ * Available only in browser environments.
1051
+ *
1052
+ * @param handle - The ID value returned by requestAnimationFrame.
1053
+ */
1054
+ const cancelAnimationFrame = _cancelAnimationFrame
1055
+ ? (handle) => {
1056
+ _cancelAnimationFrame(handle);
1057
+ }
1058
+ : undefined;
1059
+ /**
1060
+ * (Safe copy) Namespace object containing all Timer/Scheduling functions.
1061
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
1062
+ */
1063
+ const Timers = _freeze$2({
1064
+ setTimeout,
1065
+ setInterval,
1066
+ clearTimeout,
1067
+ clearInterval,
1068
+ queueMicrotask,
1069
+ requestAnimationFrame,
1070
+ cancelAnimationFrame,
1071
+ });
1072
+
1073
+ /**
1074
+ * Safe copies of WeakMap built-in via factory function.
1075
+ *
1076
+ * Since constructors cannot be safely captured via Object.assign, this module
1077
+ * provides a factory function that uses Reflect.construct internally.
1078
+ *
1079
+ * These references are captured at module initialization time to protect against
1080
+ * prototype pollution attacks. Import only what you need for tree-shaking.
1081
+ *
1082
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-map
1083
+ */
1084
+ // Capture references at module initialization time
1085
+ const _WeakMap = globalThis.WeakMap;
1086
+ const _Reflect$1 = globalThis.Reflect;
1087
+ const _freeze$1 = globalThis.Object.freeze;
1088
+ /**
1089
+ * (Safe copy) Creates a new WeakMap using the captured WeakMap constructor.
1090
+ * Use this instead of `new WeakMap()`.
1091
+ *
1092
+ * @param iterable - Optional iterable of key-value pairs.
1093
+ * @returns A new WeakMap instance.
1094
+ */
1095
+ const createWeakMap = (iterable) => _Reflect$1.construct(_WeakMap, iterable ? [iterable] : []);
1096
+ /**
1097
+ * (Safe copy) Namespace object containing WeakMap factory.
1098
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
1099
+ */
1100
+ const WeakMap = _freeze$1({
1101
+ create: createWeakMap,
1102
+ });
1103
+
1104
+ /**
1105
+ * Safe copies of WeakSet built-in via factory function.
1106
+ *
1107
+ * Since constructors cannot be safely captured via Object.assign, this module
1108
+ * provides a factory function that uses Reflect.construct internally.
1109
+ *
1110
+ * These references are captured at module initialization time to protect against
1111
+ * prototype pollution attacks. Import only what you need for tree-shaking.
1112
+ *
1113
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-set
1114
+ */
1115
+ // Capture references at module initialization time
1116
+ const _WeakSet = globalThis.WeakSet;
1117
+ const _Reflect = globalThis.Reflect;
1118
+ const _freeze = globalThis.Object.freeze;
1119
+ /**
1120
+ * (Safe copy) Creates a new WeakSet using the captured WeakSet constructor.
1121
+ * Use this instead of `new WeakSet()`.
1122
+ *
1123
+ * @param iterable - Optional iterable of values.
1124
+ * @returns A new WeakSet instance.
1125
+ */
1126
+ const createWeakSet = (iterable) => _Reflect.construct(_WeakSet, iterable ? [iterable] : []);
1127
+ /**
1128
+ * (Safe copy) Namespace object containing WeakSet factory.
1129
+ * Note: Importing this imports all methods in this namespace (no tree-shaking).
1130
+ */
1131
+ const WeakSet = _freeze({
1132
+ create: createWeakSet,
1133
+ });
1134
+
1
1135
  /**
2
1136
  * Creates a decorator that locks a method to prevent overwriting and ensure correct `this` binding.
3
1137
  *
4
- * @locked
5
1138
  * Ensures a classic prototype method cannot be overwritten and is
6
1139
  * always called with the correct `this` instance without needing arrow functions.
7
1140
  *
@@ -9,6 +1142,18 @@
9
1142
  * - Any attempt to assign to the method throws an error.
10
1143
  * - It does not support class fields / arrow functions.
11
1144
  *
1145
+ * @example
1146
+ * ```ts
1147
+ * class Counter {
1148
+ * private count = 0
1149
+ *
1150
+ * \@locked()
1151
+ * increment() {
1152
+ * return ++this.count
1153
+ * }
1154
+ * }
1155
+ * ```
1156
+ *
12
1157
  * @returns A method decorator that locks the method
13
1158
  */
14
1159
  const locked = () => {
@@ -22,8 +1167,8 @@ const locked = () => {
22
1167
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
1168
  get() {
24
1169
  // cache a bound function per instance
25
- if (!Object.prototype.hasOwnProperty.call(this, BOUND)) {
26
- Object.defineProperty(this, BOUND, {
1170
+ if (!hasOwn(this, BOUND)) {
1171
+ defineProperty$1(this, BOUND, {
27
1172
  value: original.bind(this),
28
1173
  writable: false,
29
1174
  configurable: false,
@@ -33,7 +1178,7 @@ const locked = () => {
33
1178
  return this[BOUND];
34
1179
  },
35
1180
  set() {
36
- throw new TypeError(`Cannot overwrite locked method ${String(key)}`);
1181
+ throw createTypeError(`Cannot overwrite locked method ${String(key)}`);
37
1182
  },
38
1183
  };
39
1184
  };
@@ -49,8 +1194,8 @@ const lockedPropertyDescriptors = (value, enumerable = false) => ({
49
1194
  const lockedProps = (object, propertyValuePairs) => {
50
1195
  const propertyMap = {};
51
1196
  propertyValuePairs.forEach(([key, value]) => (propertyMap[key] = lockedPropertyDescriptors(value)));
52
- Object.defineProperties(object, propertyMap);
1197
+ defineProperties(object, propertyMap);
53
1198
  };
54
1199
 
55
- export { locked, lockedPropertyDescriptors, lockedProps };
1200
+ export { Array, Console, Date, Error, Function, JSON, Map, Messaging, Object$1 as Object, Promise$1 as Promise, Reflect, RegExp, Set, Symbol$1 as Symbol, Timers, WeakMap, WeakSet, locked, lockedPropertyDescriptors, lockedProps };
56
1201
  //# sourceMappingURL=index.esm.js.map