@w3ux/hooks 2.2.2 → 2.3.1

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 (63) hide show
  1. package/index.cjs +1713 -0
  2. package/index.d.cts +41 -0
  3. package/index.d.ts +41 -0
  4. package/index.js +1693 -0
  5. package/package.json +7 -7
  6. package/util.cjs +104 -0
  7. package/util.d.cts +7 -0
  8. package/util.d.ts +7 -0
  9. package/util.js +77 -0
  10. package/cjs/index.d.ts +0 -6
  11. package/cjs/index.js +0 -26
  12. package/cjs/index.js.map +0 -1
  13. package/cjs/useEffectIgnoreInitial.d.ts +0 -1
  14. package/cjs/useEffectIgnoreInitial.js +0 -20
  15. package/cjs/useEffectIgnoreInitial.js.map +0 -1
  16. package/cjs/useOnResize.d.ts +0 -7
  17. package/cjs/useOnResize.js +0 -28
  18. package/cjs/useOnResize.js.map +0 -1
  19. package/cjs/useOutsideAlerter.d.ts +0 -2
  20. package/cjs/useOutsideAlerter.js +0 -29
  21. package/cjs/useOutsideAlerter.js.map +0 -1
  22. package/cjs/useSafeContext.d.ts +0 -3
  23. package/cjs/useSafeContext.js +0 -21
  24. package/cjs/useSafeContext.js.map +0 -1
  25. package/cjs/useSize.d.ts +0 -10
  26. package/cjs/useSize.js +0 -35
  27. package/cjs/useSize.js.map +0 -1
  28. package/cjs/useTimeLeft/defaults.d.ts +0 -3
  29. package/cjs/useTimeLeft/defaults.js +0 -15
  30. package/cjs/useTimeLeft/defaults.js.map +0 -1
  31. package/cjs/useTimeLeft/index.d.ts +0 -5
  32. package/cjs/useTimeLeft/index.js +0 -87
  33. package/cjs/useTimeLeft/index.js.map +0 -1
  34. package/cjs/util.d.ts +0 -4
  35. package/cjs/util.js +0 -69
  36. package/cjs/util.js.map +0 -1
  37. package/mjs/index.d.ts +0 -6
  38. package/mjs/index.js +0 -10
  39. package/mjs/index.js.map +0 -1
  40. package/mjs/useEffectIgnoreInitial.d.ts +0 -1
  41. package/mjs/useEffectIgnoreInitial.js +0 -16
  42. package/mjs/useEffectIgnoreInitial.js.map +0 -1
  43. package/mjs/useOnResize.d.ts +0 -7
  44. package/mjs/useOnResize.js +0 -24
  45. package/mjs/useOnResize.js.map +0 -1
  46. package/mjs/useOutsideAlerter.d.ts +0 -2
  47. package/mjs/useOutsideAlerter.js +0 -25
  48. package/mjs/useOutsideAlerter.js.map +0 -1
  49. package/mjs/useSafeContext.d.ts +0 -3
  50. package/mjs/useSafeContext.js +0 -16
  51. package/mjs/useSafeContext.js.map +0 -1
  52. package/mjs/useSize.d.ts +0 -10
  53. package/mjs/useSize.js +0 -31
  54. package/mjs/useSize.js.map +0 -1
  55. package/mjs/useTimeLeft/defaults.d.ts +0 -3
  56. package/mjs/useTimeLeft/defaults.js +0 -12
  57. package/mjs/useTimeLeft/defaults.js.map +0 -1
  58. package/mjs/useTimeLeft/index.d.ts +0 -5
  59. package/mjs/useTimeLeft/index.js +0 -83
  60. package/mjs/useTimeLeft/index.js.map +0 -1
  61. package/mjs/util.d.ts +0 -4
  62. package/mjs/util.js +0 -63
  63. package/mjs/util.js.map +0 -1
package/index.js ADDED
@@ -0,0 +1,1693 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js
28
+ var require_react_production = __commonJS({
29
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js"(exports) {
30
+ "use strict";
31
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
32
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
33
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
34
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
35
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
36
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
37
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
38
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
39
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
40
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
41
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
42
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
43
+ function getIteratorFn(maybeIterable) {
44
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
45
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
46
+ return "function" === typeof maybeIterable ? maybeIterable : null;
47
+ }
48
+ var ReactNoopUpdateQueue = {
49
+ isMounted: function() {
50
+ return false;
51
+ },
52
+ enqueueForceUpdate: function() {
53
+ },
54
+ enqueueReplaceState: function() {
55
+ },
56
+ enqueueSetState: function() {
57
+ }
58
+ };
59
+ var assign = Object.assign;
60
+ var emptyObject = {};
61
+ function Component(props, context, updater) {
62
+ this.props = props;
63
+ this.context = context;
64
+ this.refs = emptyObject;
65
+ this.updater = updater || ReactNoopUpdateQueue;
66
+ }
67
+ Component.prototype.isReactComponent = {};
68
+ Component.prototype.setState = function(partialState, callback) {
69
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
70
+ throw Error(
71
+ "takes an object of state variables to update or a function which returns an object of state variables."
72
+ );
73
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
74
+ };
75
+ Component.prototype.forceUpdate = function(callback) {
76
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
77
+ };
78
+ function ComponentDummy() {
79
+ }
80
+ ComponentDummy.prototype = Component.prototype;
81
+ function PureComponent(props, context, updater) {
82
+ this.props = props;
83
+ this.context = context;
84
+ this.refs = emptyObject;
85
+ this.updater = updater || ReactNoopUpdateQueue;
86
+ }
87
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
88
+ pureComponentPrototype.constructor = PureComponent;
89
+ assign(pureComponentPrototype, Component.prototype);
90
+ pureComponentPrototype.isPureReactComponent = true;
91
+ var isArrayImpl = Array.isArray;
92
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null };
93
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
94
+ function ReactElement(type, key, self, source, owner, props) {
95
+ self = props.ref;
96
+ return {
97
+ $$typeof: REACT_ELEMENT_TYPE,
98
+ type,
99
+ key,
100
+ ref: void 0 !== self ? self : null,
101
+ props
102
+ };
103
+ }
104
+ function cloneAndReplaceKey(oldElement, newKey) {
105
+ return ReactElement(
106
+ oldElement.type,
107
+ newKey,
108
+ void 0,
109
+ void 0,
110
+ void 0,
111
+ oldElement.props
112
+ );
113
+ }
114
+ function isValidElement(object) {
115
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
116
+ }
117
+ function escape(key) {
118
+ var escaperLookup = { "=": "=0", ":": "=2" };
119
+ return "$" + key.replace(/[=:]/g, function(match) {
120
+ return escaperLookup[match];
121
+ });
122
+ }
123
+ var userProvidedKeyEscapeRegex = /\/+/g;
124
+ function getElementKey(element, index) {
125
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
126
+ }
127
+ function noop$1() {
128
+ }
129
+ function resolveThenable(thenable) {
130
+ switch (thenable.status) {
131
+ case "fulfilled":
132
+ return thenable.value;
133
+ case "rejected":
134
+ throw thenable.reason;
135
+ default:
136
+ switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
137
+ function(fulfilledValue) {
138
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
139
+ },
140
+ function(error) {
141
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
142
+ }
143
+ )), thenable.status) {
144
+ case "fulfilled":
145
+ return thenable.value;
146
+ case "rejected":
147
+ throw thenable.reason;
148
+ }
149
+ }
150
+ throw thenable;
151
+ }
152
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
153
+ var type = typeof children;
154
+ if ("undefined" === type || "boolean" === type) children = null;
155
+ var invokeCallback = false;
156
+ if (null === children) invokeCallback = true;
157
+ else
158
+ switch (type) {
159
+ case "bigint":
160
+ case "string":
161
+ case "number":
162
+ invokeCallback = true;
163
+ break;
164
+ case "object":
165
+ switch (children.$$typeof) {
166
+ case REACT_ELEMENT_TYPE:
167
+ case REACT_PORTAL_TYPE:
168
+ invokeCallback = true;
169
+ break;
170
+ case REACT_LAZY_TYPE:
171
+ return invokeCallback = children._init, mapIntoArray(
172
+ invokeCallback(children._payload),
173
+ array,
174
+ escapedPrefix,
175
+ nameSoFar,
176
+ callback
177
+ );
178
+ }
179
+ }
180
+ if (invokeCallback)
181
+ return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
182
+ return c;
183
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
184
+ callback,
185
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
186
+ userProvidedKeyEscapeRegex,
187
+ "$&/"
188
+ ) + "/") + invokeCallback
189
+ )), array.push(callback)), 1;
190
+ invokeCallback = 0;
191
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
192
+ if (isArrayImpl(children))
193
+ for (var i = 0; i < children.length; i++)
194
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
195
+ nameSoFar,
196
+ array,
197
+ escapedPrefix,
198
+ type,
199
+ callback
200
+ );
201
+ else if (i = getIteratorFn(children), "function" === typeof i)
202
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
203
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
204
+ nameSoFar,
205
+ array,
206
+ escapedPrefix,
207
+ type,
208
+ callback
209
+ );
210
+ else if ("object" === type) {
211
+ if ("function" === typeof children.then)
212
+ return mapIntoArray(
213
+ resolveThenable(children),
214
+ array,
215
+ escapedPrefix,
216
+ nameSoFar,
217
+ callback
218
+ );
219
+ array = String(children);
220
+ throw Error(
221
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
222
+ );
223
+ }
224
+ return invokeCallback;
225
+ }
226
+ function mapChildren(children, func, context) {
227
+ if (null == children) return children;
228
+ var result = [], count = 0;
229
+ mapIntoArray(children, result, "", "", function(child) {
230
+ return func.call(context, child, count++);
231
+ });
232
+ return result;
233
+ }
234
+ function lazyInitializer(payload) {
235
+ if (-1 === payload._status) {
236
+ var ctor = payload._result;
237
+ ctor = ctor();
238
+ ctor.then(
239
+ function(moduleObject) {
240
+ if (0 === payload._status || -1 === payload._status)
241
+ payload._status = 1, payload._result = moduleObject;
242
+ },
243
+ function(error) {
244
+ if (0 === payload._status || -1 === payload._status)
245
+ payload._status = 2, payload._result = error;
246
+ }
247
+ );
248
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
249
+ }
250
+ if (1 === payload._status) return payload._result.default;
251
+ throw payload._result;
252
+ }
253
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
254
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
255
+ var event = new window.ErrorEvent("error", {
256
+ bubbles: true,
257
+ cancelable: true,
258
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
259
+ error
260
+ });
261
+ if (!window.dispatchEvent(event)) return;
262
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
263
+ process.emit("uncaughtException", error);
264
+ return;
265
+ }
266
+ console.error(error);
267
+ };
268
+ function noop() {
269
+ }
270
+ exports.Children = {
271
+ map: mapChildren,
272
+ forEach: function(children, forEachFunc, forEachContext) {
273
+ mapChildren(
274
+ children,
275
+ function() {
276
+ forEachFunc.apply(this, arguments);
277
+ },
278
+ forEachContext
279
+ );
280
+ },
281
+ count: function(children) {
282
+ var n = 0;
283
+ mapChildren(children, function() {
284
+ n++;
285
+ });
286
+ return n;
287
+ },
288
+ toArray: function(children) {
289
+ return mapChildren(children, function(child) {
290
+ return child;
291
+ }) || [];
292
+ },
293
+ only: function(children) {
294
+ if (!isValidElement(children))
295
+ throw Error(
296
+ "React.Children.only expected to receive a single React element child."
297
+ );
298
+ return children;
299
+ }
300
+ };
301
+ exports.Component = Component;
302
+ exports.Fragment = REACT_FRAGMENT_TYPE;
303
+ exports.Profiler = REACT_PROFILER_TYPE;
304
+ exports.PureComponent = PureComponent;
305
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
306
+ exports.Suspense = REACT_SUSPENSE_TYPE;
307
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
308
+ exports.__COMPILER_RUNTIME = {
309
+ __proto__: null,
310
+ c: function(size) {
311
+ return ReactSharedInternals.H.useMemoCache(size);
312
+ }
313
+ };
314
+ exports.cache = function(fn) {
315
+ return function() {
316
+ return fn.apply(null, arguments);
317
+ };
318
+ };
319
+ exports.cloneElement = function(element, config, children) {
320
+ if (null === element || void 0 === element)
321
+ throw Error(
322
+ "The argument must be a React element, but you passed " + element + "."
323
+ );
324
+ var props = assign({}, element.props), key = element.key, owner = void 0;
325
+ if (null != config)
326
+ for (propName in void 0 !== config.ref && (owner = void 0), void 0 !== config.key && (key = "" + config.key), config)
327
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
328
+ var propName = arguments.length - 2;
329
+ if (1 === propName) props.children = children;
330
+ else if (1 < propName) {
331
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
332
+ childArray[i] = arguments[i + 2];
333
+ props.children = childArray;
334
+ }
335
+ return ReactElement(element.type, key, void 0, void 0, owner, props);
336
+ };
337
+ exports.createContext = function(defaultValue) {
338
+ defaultValue = {
339
+ $$typeof: REACT_CONTEXT_TYPE,
340
+ _currentValue: defaultValue,
341
+ _currentValue2: defaultValue,
342
+ _threadCount: 0,
343
+ Provider: null,
344
+ Consumer: null
345
+ };
346
+ defaultValue.Provider = defaultValue;
347
+ defaultValue.Consumer = {
348
+ $$typeof: REACT_CONSUMER_TYPE,
349
+ _context: defaultValue
350
+ };
351
+ return defaultValue;
352
+ };
353
+ exports.createElement = function(type, config, children) {
354
+ var propName, props = {}, key = null;
355
+ if (null != config)
356
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
357
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
358
+ var childrenLength = arguments.length - 2;
359
+ if (1 === childrenLength) props.children = children;
360
+ else if (1 < childrenLength) {
361
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
362
+ childArray[i] = arguments[i + 2];
363
+ props.children = childArray;
364
+ }
365
+ if (type && type.defaultProps)
366
+ for (propName in childrenLength = type.defaultProps, childrenLength)
367
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
368
+ return ReactElement(type, key, void 0, void 0, null, props);
369
+ };
370
+ exports.createRef = function() {
371
+ return { current: null };
372
+ };
373
+ exports.forwardRef = function(render) {
374
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
375
+ };
376
+ exports.isValidElement = isValidElement;
377
+ exports.lazy = function(ctor) {
378
+ return {
379
+ $$typeof: REACT_LAZY_TYPE,
380
+ _payload: { _status: -1, _result: ctor },
381
+ _init: lazyInitializer
382
+ };
383
+ };
384
+ exports.memo = function(type, compare) {
385
+ return {
386
+ $$typeof: REACT_MEMO_TYPE,
387
+ type,
388
+ compare: void 0 === compare ? null : compare
389
+ };
390
+ };
391
+ exports.startTransition = function(scope) {
392
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
393
+ ReactSharedInternals.T = currentTransition;
394
+ try {
395
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
396
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
397
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
398
+ } catch (error) {
399
+ reportGlobalError(error);
400
+ } finally {
401
+ ReactSharedInternals.T = prevTransition;
402
+ }
403
+ };
404
+ exports.unstable_useCacheRefresh = function() {
405
+ return ReactSharedInternals.H.useCacheRefresh();
406
+ };
407
+ exports.use = function(usable) {
408
+ return ReactSharedInternals.H.use(usable);
409
+ };
410
+ exports.useActionState = function(action, initialState, permalink) {
411
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
412
+ };
413
+ exports.useCallback = function(callback, deps) {
414
+ return ReactSharedInternals.H.useCallback(callback, deps);
415
+ };
416
+ exports.useContext = function(Context) {
417
+ return ReactSharedInternals.H.useContext(Context);
418
+ };
419
+ exports.useDebugValue = function() {
420
+ };
421
+ exports.useDeferredValue = function(value, initialValue) {
422
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
423
+ };
424
+ exports.useEffect = function(create, createDeps, update) {
425
+ var dispatcher = ReactSharedInternals.H;
426
+ if ("function" === typeof update)
427
+ throw Error(
428
+ "useEffect CRUD overload is not enabled in this build of React."
429
+ );
430
+ return dispatcher.useEffect(create, createDeps);
431
+ };
432
+ exports.useId = function() {
433
+ return ReactSharedInternals.H.useId();
434
+ };
435
+ exports.useImperativeHandle = function(ref, create, deps) {
436
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
437
+ };
438
+ exports.useInsertionEffect = function(create, deps) {
439
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
440
+ };
441
+ exports.useLayoutEffect = function(create, deps) {
442
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
443
+ };
444
+ exports.useMemo = function(create, deps) {
445
+ return ReactSharedInternals.H.useMemo(create, deps);
446
+ };
447
+ exports.useOptimistic = function(passthrough, reducer) {
448
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
449
+ };
450
+ exports.useReducer = function(reducer, initialArg, init) {
451
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
452
+ };
453
+ exports.useRef = function(initialValue) {
454
+ return ReactSharedInternals.H.useRef(initialValue);
455
+ };
456
+ exports.useState = function(initialState) {
457
+ return ReactSharedInternals.H.useState(initialState);
458
+ };
459
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
460
+ return ReactSharedInternals.H.useSyncExternalStore(
461
+ subscribe,
462
+ getSnapshot,
463
+ getServerSnapshot
464
+ );
465
+ };
466
+ exports.useTransition = function() {
467
+ return ReactSharedInternals.H.useTransition();
468
+ };
469
+ exports.version = "19.1.0";
470
+ }
471
+ });
472
+
473
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js
474
+ var require_react_development = __commonJS({
475
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js"(exports, module) {
476
+ "use strict";
477
+ "production" !== process.env.NODE_ENV && function() {
478
+ function defineDeprecationWarning(methodName, info) {
479
+ Object.defineProperty(Component.prototype, methodName, {
480
+ get: function() {
481
+ console.warn(
482
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
483
+ info[0],
484
+ info[1]
485
+ );
486
+ }
487
+ });
488
+ }
489
+ function getIteratorFn(maybeIterable) {
490
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
491
+ return null;
492
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
493
+ return "function" === typeof maybeIterable ? maybeIterable : null;
494
+ }
495
+ function warnNoop(publicInstance, callerName) {
496
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
497
+ var warningKey = publicInstance + "." + callerName;
498
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
499
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
500
+ callerName,
501
+ publicInstance
502
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
503
+ }
504
+ function Component(props, context, updater) {
505
+ this.props = props;
506
+ this.context = context;
507
+ this.refs = emptyObject;
508
+ this.updater = updater || ReactNoopUpdateQueue;
509
+ }
510
+ function ComponentDummy() {
511
+ }
512
+ function PureComponent(props, context, updater) {
513
+ this.props = props;
514
+ this.context = context;
515
+ this.refs = emptyObject;
516
+ this.updater = updater || ReactNoopUpdateQueue;
517
+ }
518
+ function testStringCoercion(value) {
519
+ return "" + value;
520
+ }
521
+ function checkKeyStringCoercion(value) {
522
+ try {
523
+ testStringCoercion(value);
524
+ var JSCompiler_inline_result = false;
525
+ } catch (e) {
526
+ JSCompiler_inline_result = true;
527
+ }
528
+ if (JSCompiler_inline_result) {
529
+ JSCompiler_inline_result = console;
530
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
531
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
532
+ JSCompiler_temp_const.call(
533
+ JSCompiler_inline_result,
534
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
535
+ JSCompiler_inline_result$jscomp$0
536
+ );
537
+ return testStringCoercion(value);
538
+ }
539
+ }
540
+ function getComponentNameFromType(type) {
541
+ if (null == type) return null;
542
+ if ("function" === typeof type)
543
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
544
+ if ("string" === typeof type) return type;
545
+ switch (type) {
546
+ case REACT_FRAGMENT_TYPE:
547
+ return "Fragment";
548
+ case REACT_PROFILER_TYPE:
549
+ return "Profiler";
550
+ case REACT_STRICT_MODE_TYPE:
551
+ return "StrictMode";
552
+ case REACT_SUSPENSE_TYPE:
553
+ return "Suspense";
554
+ case REACT_SUSPENSE_LIST_TYPE:
555
+ return "SuspenseList";
556
+ case REACT_ACTIVITY_TYPE:
557
+ return "Activity";
558
+ }
559
+ if ("object" === typeof type)
560
+ switch ("number" === typeof type.tag && console.error(
561
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
562
+ ), type.$$typeof) {
563
+ case REACT_PORTAL_TYPE:
564
+ return "Portal";
565
+ case REACT_CONTEXT_TYPE:
566
+ return (type.displayName || "Context") + ".Provider";
567
+ case REACT_CONSUMER_TYPE:
568
+ return (type._context.displayName || "Context") + ".Consumer";
569
+ case REACT_FORWARD_REF_TYPE:
570
+ var innerType = type.render;
571
+ type = type.displayName;
572
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
573
+ return type;
574
+ case REACT_MEMO_TYPE:
575
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
576
+ case REACT_LAZY_TYPE:
577
+ innerType = type._payload;
578
+ type = type._init;
579
+ try {
580
+ return getComponentNameFromType(type(innerType));
581
+ } catch (x) {
582
+ }
583
+ }
584
+ return null;
585
+ }
586
+ function getTaskName(type) {
587
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
588
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
589
+ return "<...>";
590
+ try {
591
+ var name = getComponentNameFromType(type);
592
+ return name ? "<" + name + ">" : "<...>";
593
+ } catch (x) {
594
+ return "<...>";
595
+ }
596
+ }
597
+ function getOwner() {
598
+ var dispatcher = ReactSharedInternals.A;
599
+ return null === dispatcher ? null : dispatcher.getOwner();
600
+ }
601
+ function UnknownOwner() {
602
+ return Error("react-stack-top-frame");
603
+ }
604
+ function hasValidKey(config) {
605
+ if (hasOwnProperty.call(config, "key")) {
606
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
607
+ if (getter && getter.isReactWarning) return false;
608
+ }
609
+ return void 0 !== config.key;
610
+ }
611
+ function defineKeyPropWarningGetter(props, displayName) {
612
+ function warnAboutAccessingKey() {
613
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
614
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
615
+ displayName
616
+ ));
617
+ }
618
+ warnAboutAccessingKey.isReactWarning = true;
619
+ Object.defineProperty(props, "key", {
620
+ get: warnAboutAccessingKey,
621
+ configurable: true
622
+ });
623
+ }
624
+ function elementRefGetterWithDeprecationWarning() {
625
+ var componentName = getComponentNameFromType(this.type);
626
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
627
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
628
+ ));
629
+ componentName = this.props.ref;
630
+ return void 0 !== componentName ? componentName : null;
631
+ }
632
+ function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
633
+ self = props.ref;
634
+ type = {
635
+ $$typeof: REACT_ELEMENT_TYPE,
636
+ type,
637
+ key,
638
+ props,
639
+ _owner: owner
640
+ };
641
+ null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
642
+ enumerable: false,
643
+ get: elementRefGetterWithDeprecationWarning
644
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
645
+ type._store = {};
646
+ Object.defineProperty(type._store, "validated", {
647
+ configurable: false,
648
+ enumerable: false,
649
+ writable: true,
650
+ value: 0
651
+ });
652
+ Object.defineProperty(type, "_debugInfo", {
653
+ configurable: false,
654
+ enumerable: false,
655
+ writable: true,
656
+ value: null
657
+ });
658
+ Object.defineProperty(type, "_debugStack", {
659
+ configurable: false,
660
+ enumerable: false,
661
+ writable: true,
662
+ value: debugStack
663
+ });
664
+ Object.defineProperty(type, "_debugTask", {
665
+ configurable: false,
666
+ enumerable: false,
667
+ writable: true,
668
+ value: debugTask
669
+ });
670
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
671
+ return type;
672
+ }
673
+ function cloneAndReplaceKey(oldElement, newKey) {
674
+ newKey = ReactElement(
675
+ oldElement.type,
676
+ newKey,
677
+ void 0,
678
+ void 0,
679
+ oldElement._owner,
680
+ oldElement.props,
681
+ oldElement._debugStack,
682
+ oldElement._debugTask
683
+ );
684
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
685
+ return newKey;
686
+ }
687
+ function isValidElement(object) {
688
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
689
+ }
690
+ function escape(key) {
691
+ var escaperLookup = { "=": "=0", ":": "=2" };
692
+ return "$" + key.replace(/[=:]/g, function(match) {
693
+ return escaperLookup[match];
694
+ });
695
+ }
696
+ function getElementKey(element, index) {
697
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
698
+ }
699
+ function noop$1() {
700
+ }
701
+ function resolveThenable(thenable) {
702
+ switch (thenable.status) {
703
+ case "fulfilled":
704
+ return thenable.value;
705
+ case "rejected":
706
+ throw thenable.reason;
707
+ default:
708
+ switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
709
+ function(fulfilledValue) {
710
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
711
+ },
712
+ function(error) {
713
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
714
+ }
715
+ )), thenable.status) {
716
+ case "fulfilled":
717
+ return thenable.value;
718
+ case "rejected":
719
+ throw thenable.reason;
720
+ }
721
+ }
722
+ throw thenable;
723
+ }
724
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
725
+ var type = typeof children;
726
+ if ("undefined" === type || "boolean" === type) children = null;
727
+ var invokeCallback = false;
728
+ if (null === children) invokeCallback = true;
729
+ else
730
+ switch (type) {
731
+ case "bigint":
732
+ case "string":
733
+ case "number":
734
+ invokeCallback = true;
735
+ break;
736
+ case "object":
737
+ switch (children.$$typeof) {
738
+ case REACT_ELEMENT_TYPE:
739
+ case REACT_PORTAL_TYPE:
740
+ invokeCallback = true;
741
+ break;
742
+ case REACT_LAZY_TYPE:
743
+ return invokeCallback = children._init, mapIntoArray(
744
+ invokeCallback(children._payload),
745
+ array,
746
+ escapedPrefix,
747
+ nameSoFar,
748
+ callback
749
+ );
750
+ }
751
+ }
752
+ if (invokeCallback) {
753
+ invokeCallback = children;
754
+ callback = callback(invokeCallback);
755
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
756
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
757
+ return c;
758
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
759
+ callback,
760
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
761
+ userProvidedKeyEscapeRegex,
762
+ "$&/"
763
+ ) + "/") + childKey
764
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
765
+ return 1;
766
+ }
767
+ invokeCallback = 0;
768
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
769
+ if (isArrayImpl(children))
770
+ for (var i = 0; i < children.length; i++)
771
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
772
+ nameSoFar,
773
+ array,
774
+ escapedPrefix,
775
+ type,
776
+ callback
777
+ );
778
+ else if (i = getIteratorFn(children), "function" === typeof i)
779
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
780
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
781
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
782
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
783
+ nameSoFar,
784
+ array,
785
+ escapedPrefix,
786
+ type,
787
+ callback
788
+ );
789
+ else if ("object" === type) {
790
+ if ("function" === typeof children.then)
791
+ return mapIntoArray(
792
+ resolveThenable(children),
793
+ array,
794
+ escapedPrefix,
795
+ nameSoFar,
796
+ callback
797
+ );
798
+ array = String(children);
799
+ throw Error(
800
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
801
+ );
802
+ }
803
+ return invokeCallback;
804
+ }
805
+ function mapChildren(children, func, context) {
806
+ if (null == children) return children;
807
+ var result = [], count = 0;
808
+ mapIntoArray(children, result, "", "", function(child) {
809
+ return func.call(context, child, count++);
810
+ });
811
+ return result;
812
+ }
813
+ function lazyInitializer(payload) {
814
+ if (-1 === payload._status) {
815
+ var ctor = payload._result;
816
+ ctor = ctor();
817
+ ctor.then(
818
+ function(moduleObject) {
819
+ if (0 === payload._status || -1 === payload._status)
820
+ payload._status = 1, payload._result = moduleObject;
821
+ },
822
+ function(error) {
823
+ if (0 === payload._status || -1 === payload._status)
824
+ payload._status = 2, payload._result = error;
825
+ }
826
+ );
827
+ -1 === payload._status && (payload._status = 0, payload._result = ctor);
828
+ }
829
+ if (1 === payload._status)
830
+ return ctor = payload._result, void 0 === ctor && console.error(
831
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
832
+ ctor
833
+ ), "default" in ctor || console.error(
834
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
835
+ ctor
836
+ ), ctor.default;
837
+ throw payload._result;
838
+ }
839
+ function resolveDispatcher() {
840
+ var dispatcher = ReactSharedInternals.H;
841
+ null === dispatcher && console.error(
842
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
843
+ );
844
+ return dispatcher;
845
+ }
846
+ function noop() {
847
+ }
848
+ function enqueueTask(task) {
849
+ if (null === enqueueTaskImpl)
850
+ try {
851
+ var requireString = ("require" + Math.random()).slice(0, 7);
852
+ enqueueTaskImpl = (module && module[requireString]).call(
853
+ module,
854
+ "timers"
855
+ ).setImmediate;
856
+ } catch (_err) {
857
+ enqueueTaskImpl = function(callback) {
858
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
859
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
860
+ ));
861
+ var channel = new MessageChannel();
862
+ channel.port1.onmessage = callback;
863
+ channel.port2.postMessage(void 0);
864
+ };
865
+ }
866
+ return enqueueTaskImpl(task);
867
+ }
868
+ function aggregateErrors(errors) {
869
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
870
+ }
871
+ function popActScope(prevActQueue, prevActScopeDepth) {
872
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
873
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
874
+ );
875
+ actScopeDepth = prevActScopeDepth;
876
+ }
877
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
878
+ var queue = ReactSharedInternals.actQueue;
879
+ if (null !== queue)
880
+ if (0 !== queue.length)
881
+ try {
882
+ flushActQueue(queue);
883
+ enqueueTask(function() {
884
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
885
+ });
886
+ return;
887
+ } catch (error) {
888
+ ReactSharedInternals.thrownErrors.push(error);
889
+ }
890
+ else ReactSharedInternals.actQueue = null;
891
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
892
+ }
893
+ function flushActQueue(queue) {
894
+ if (!isFlushing) {
895
+ isFlushing = true;
896
+ var i = 0;
897
+ try {
898
+ for (; i < queue.length; i++) {
899
+ var callback = queue[i];
900
+ do {
901
+ ReactSharedInternals.didUsePromise = false;
902
+ var continuation = callback(false);
903
+ if (null !== continuation) {
904
+ if (ReactSharedInternals.didUsePromise) {
905
+ queue[i] = callback;
906
+ queue.splice(0, i);
907
+ return;
908
+ }
909
+ callback = continuation;
910
+ } else break;
911
+ } while (1);
912
+ }
913
+ queue.length = 0;
914
+ } catch (error) {
915
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
916
+ } finally {
917
+ isFlushing = false;
918
+ }
919
+ }
920
+ }
921
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
922
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
923
+ Symbol.for("react.provider");
924
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
925
+ isMounted: function() {
926
+ return false;
927
+ },
928
+ enqueueForceUpdate: function(publicInstance) {
929
+ warnNoop(publicInstance, "forceUpdate");
930
+ },
931
+ enqueueReplaceState: function(publicInstance) {
932
+ warnNoop(publicInstance, "replaceState");
933
+ },
934
+ enqueueSetState: function(publicInstance) {
935
+ warnNoop(publicInstance, "setState");
936
+ }
937
+ }, assign = Object.assign, emptyObject = {};
938
+ Object.freeze(emptyObject);
939
+ Component.prototype.isReactComponent = {};
940
+ Component.prototype.setState = function(partialState, callback) {
941
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
942
+ throw Error(
943
+ "takes an object of state variables to update or a function which returns an object of state variables."
944
+ );
945
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
946
+ };
947
+ Component.prototype.forceUpdate = function(callback) {
948
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
949
+ };
950
+ var deprecatedAPIs = {
951
+ isMounted: [
952
+ "isMounted",
953
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
954
+ ],
955
+ replaceState: [
956
+ "replaceState",
957
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
958
+ ]
959
+ }, fnName;
960
+ for (fnName in deprecatedAPIs)
961
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
962
+ ComponentDummy.prototype = Component.prototype;
963
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
964
+ deprecatedAPIs.constructor = PureComponent;
965
+ assign(deprecatedAPIs, Component.prototype);
966
+ deprecatedAPIs.isPureReactComponent = true;
967
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
968
+ H: null,
969
+ A: null,
970
+ T: null,
971
+ S: null,
972
+ V: null,
973
+ actQueue: null,
974
+ isBatchingLegacy: false,
975
+ didScheduleLegacyUpdate: false,
976
+ didUsePromise: false,
977
+ thrownErrors: [],
978
+ getCurrentStack: null,
979
+ recentlyCreatedOwnerStacks: 0
980
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
981
+ return null;
982
+ };
983
+ deprecatedAPIs = {
984
+ "react-stack-bottom-frame": function(callStackForError) {
985
+ return callStackForError();
986
+ }
987
+ };
988
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
989
+ var didWarnAboutElementRef = {};
990
+ var unknownOwnerDebugStack = deprecatedAPIs["react-stack-bottom-frame"].bind(deprecatedAPIs, UnknownOwner)();
991
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
992
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
993
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
994
+ var event = new window.ErrorEvent("error", {
995
+ bubbles: true,
996
+ cancelable: true,
997
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
998
+ error
999
+ });
1000
+ if (!window.dispatchEvent(event)) return;
1001
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1002
+ process.emit("uncaughtException", error);
1003
+ return;
1004
+ }
1005
+ console.error(error);
1006
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1007
+ queueMicrotask(function() {
1008
+ return queueMicrotask(callback);
1009
+ });
1010
+ } : enqueueTask;
1011
+ deprecatedAPIs = Object.freeze({
1012
+ __proto__: null,
1013
+ c: function(size) {
1014
+ return resolveDispatcher().useMemoCache(size);
1015
+ }
1016
+ });
1017
+ exports.Children = {
1018
+ map: mapChildren,
1019
+ forEach: function(children, forEachFunc, forEachContext) {
1020
+ mapChildren(
1021
+ children,
1022
+ function() {
1023
+ forEachFunc.apply(this, arguments);
1024
+ },
1025
+ forEachContext
1026
+ );
1027
+ },
1028
+ count: function(children) {
1029
+ var n = 0;
1030
+ mapChildren(children, function() {
1031
+ n++;
1032
+ });
1033
+ return n;
1034
+ },
1035
+ toArray: function(children) {
1036
+ return mapChildren(children, function(child) {
1037
+ return child;
1038
+ }) || [];
1039
+ },
1040
+ only: function(children) {
1041
+ if (!isValidElement(children))
1042
+ throw Error(
1043
+ "React.Children.only expected to receive a single React element child."
1044
+ );
1045
+ return children;
1046
+ }
1047
+ };
1048
+ exports.Component = Component;
1049
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1050
+ exports.Profiler = REACT_PROFILER_TYPE;
1051
+ exports.PureComponent = PureComponent;
1052
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1053
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1054
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1055
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1056
+ exports.act = function(callback) {
1057
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1058
+ actScopeDepth++;
1059
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1060
+ try {
1061
+ var result = callback();
1062
+ } catch (error) {
1063
+ ReactSharedInternals.thrownErrors.push(error);
1064
+ }
1065
+ if (0 < ReactSharedInternals.thrownErrors.length)
1066
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1067
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1068
+ var thenable = result;
1069
+ queueSeveralMicrotasks(function() {
1070
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1071
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1072
+ ));
1073
+ });
1074
+ return {
1075
+ then: function(resolve, reject) {
1076
+ didAwaitActCall = true;
1077
+ thenable.then(
1078
+ function(returnValue) {
1079
+ popActScope(prevActQueue, prevActScopeDepth);
1080
+ if (0 === prevActScopeDepth) {
1081
+ try {
1082
+ flushActQueue(queue), enqueueTask(function() {
1083
+ return recursivelyFlushAsyncActWork(
1084
+ returnValue,
1085
+ resolve,
1086
+ reject
1087
+ );
1088
+ });
1089
+ } catch (error$0) {
1090
+ ReactSharedInternals.thrownErrors.push(error$0);
1091
+ }
1092
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1093
+ var _thrownError = aggregateErrors(
1094
+ ReactSharedInternals.thrownErrors
1095
+ );
1096
+ ReactSharedInternals.thrownErrors.length = 0;
1097
+ reject(_thrownError);
1098
+ }
1099
+ } else resolve(returnValue);
1100
+ },
1101
+ function(error) {
1102
+ popActScope(prevActQueue, prevActScopeDepth);
1103
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1104
+ ReactSharedInternals.thrownErrors
1105
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1106
+ }
1107
+ );
1108
+ }
1109
+ };
1110
+ }
1111
+ var returnValue$jscomp$0 = result;
1112
+ popActScope(prevActQueue, prevActScopeDepth);
1113
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1114
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1115
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1116
+ ));
1117
+ }), ReactSharedInternals.actQueue = null);
1118
+ if (0 < ReactSharedInternals.thrownErrors.length)
1119
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1120
+ return {
1121
+ then: function(resolve, reject) {
1122
+ didAwaitActCall = true;
1123
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1124
+ return recursivelyFlushAsyncActWork(
1125
+ returnValue$jscomp$0,
1126
+ resolve,
1127
+ reject
1128
+ );
1129
+ })) : resolve(returnValue$jscomp$0);
1130
+ }
1131
+ };
1132
+ };
1133
+ exports.cache = function(fn) {
1134
+ return function() {
1135
+ return fn.apply(null, arguments);
1136
+ };
1137
+ };
1138
+ exports.captureOwnerStack = function() {
1139
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1140
+ return null === getCurrentStack ? null : getCurrentStack();
1141
+ };
1142
+ exports.cloneElement = function(element, config, children) {
1143
+ if (null === element || void 0 === element)
1144
+ throw Error(
1145
+ "The argument must be a React element, but you passed " + element + "."
1146
+ );
1147
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1148
+ if (null != config) {
1149
+ var JSCompiler_inline_result;
1150
+ a: {
1151
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1152
+ config,
1153
+ "ref"
1154
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1155
+ JSCompiler_inline_result = false;
1156
+ break a;
1157
+ }
1158
+ JSCompiler_inline_result = void 0 !== config.ref;
1159
+ }
1160
+ JSCompiler_inline_result && (owner = getOwner());
1161
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1162
+ for (propName in config)
1163
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1164
+ }
1165
+ var propName = arguments.length - 2;
1166
+ if (1 === propName) props.children = children;
1167
+ else if (1 < propName) {
1168
+ JSCompiler_inline_result = Array(propName);
1169
+ for (var i = 0; i < propName; i++)
1170
+ JSCompiler_inline_result[i] = arguments[i + 2];
1171
+ props.children = JSCompiler_inline_result;
1172
+ }
1173
+ props = ReactElement(
1174
+ element.type,
1175
+ key,
1176
+ void 0,
1177
+ void 0,
1178
+ owner,
1179
+ props,
1180
+ element._debugStack,
1181
+ element._debugTask
1182
+ );
1183
+ for (key = 2; key < arguments.length; key++)
1184
+ owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
1185
+ return props;
1186
+ };
1187
+ exports.createContext = function(defaultValue) {
1188
+ defaultValue = {
1189
+ $$typeof: REACT_CONTEXT_TYPE,
1190
+ _currentValue: defaultValue,
1191
+ _currentValue2: defaultValue,
1192
+ _threadCount: 0,
1193
+ Provider: null,
1194
+ Consumer: null
1195
+ };
1196
+ defaultValue.Provider = defaultValue;
1197
+ defaultValue.Consumer = {
1198
+ $$typeof: REACT_CONSUMER_TYPE,
1199
+ _context: defaultValue
1200
+ };
1201
+ defaultValue._currentRenderer = null;
1202
+ defaultValue._currentRenderer2 = null;
1203
+ return defaultValue;
1204
+ };
1205
+ exports.createElement = function(type, config, children) {
1206
+ for (var i = 2; i < arguments.length; i++) {
1207
+ var node = arguments[i];
1208
+ isValidElement(node) && node._store && (node._store.validated = 1);
1209
+ }
1210
+ i = {};
1211
+ node = null;
1212
+ if (null != config)
1213
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1214
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1215
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), node = "" + config.key), config)
1216
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1217
+ var childrenLength = arguments.length - 2;
1218
+ if (1 === childrenLength) i.children = children;
1219
+ else if (1 < childrenLength) {
1220
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1221
+ childArray[_i] = arguments[_i + 2];
1222
+ Object.freeze && Object.freeze(childArray);
1223
+ i.children = childArray;
1224
+ }
1225
+ if (type && type.defaultProps)
1226
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1227
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1228
+ node && defineKeyPropWarningGetter(
1229
+ i,
1230
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1231
+ );
1232
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1233
+ return ReactElement(
1234
+ type,
1235
+ node,
1236
+ void 0,
1237
+ void 0,
1238
+ getOwner(),
1239
+ i,
1240
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1241
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1242
+ );
1243
+ };
1244
+ exports.createRef = function() {
1245
+ var refObject = { current: null };
1246
+ Object.seal(refObject);
1247
+ return refObject;
1248
+ };
1249
+ exports.forwardRef = function(render) {
1250
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1251
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1252
+ ) : "function" !== typeof render ? console.error(
1253
+ "forwardRef requires a render function but was given %s.",
1254
+ null === render ? "null" : typeof render
1255
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1256
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1257
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1258
+ );
1259
+ null != render && null != render.defaultProps && console.error(
1260
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1261
+ );
1262
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1263
+ Object.defineProperty(elementType, "displayName", {
1264
+ enumerable: false,
1265
+ configurable: true,
1266
+ get: function() {
1267
+ return ownName;
1268
+ },
1269
+ set: function(name) {
1270
+ ownName = name;
1271
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1272
+ }
1273
+ });
1274
+ return elementType;
1275
+ };
1276
+ exports.isValidElement = isValidElement;
1277
+ exports.lazy = function(ctor) {
1278
+ return {
1279
+ $$typeof: REACT_LAZY_TYPE,
1280
+ _payload: { _status: -1, _result: ctor },
1281
+ _init: lazyInitializer
1282
+ };
1283
+ };
1284
+ exports.memo = function(type, compare) {
1285
+ null == type && console.error(
1286
+ "memo: The first argument must be a component. Instead received: %s",
1287
+ null === type ? "null" : typeof type
1288
+ );
1289
+ compare = {
1290
+ $$typeof: REACT_MEMO_TYPE,
1291
+ type,
1292
+ compare: void 0 === compare ? null : compare
1293
+ };
1294
+ var ownName;
1295
+ Object.defineProperty(compare, "displayName", {
1296
+ enumerable: false,
1297
+ configurable: true,
1298
+ get: function() {
1299
+ return ownName;
1300
+ },
1301
+ set: function(name) {
1302
+ ownName = name;
1303
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1304
+ }
1305
+ });
1306
+ return compare;
1307
+ };
1308
+ exports.startTransition = function(scope) {
1309
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
1310
+ ReactSharedInternals.T = currentTransition;
1311
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1312
+ try {
1313
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1314
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1315
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
1316
+ } catch (error) {
1317
+ reportGlobalError(error);
1318
+ } finally {
1319
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1320
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1321
+ )), ReactSharedInternals.T = prevTransition;
1322
+ }
1323
+ };
1324
+ exports.unstable_useCacheRefresh = function() {
1325
+ return resolveDispatcher().useCacheRefresh();
1326
+ };
1327
+ exports.use = function(usable) {
1328
+ return resolveDispatcher().use(usable);
1329
+ };
1330
+ exports.useActionState = function(action, initialState, permalink) {
1331
+ return resolveDispatcher().useActionState(
1332
+ action,
1333
+ initialState,
1334
+ permalink
1335
+ );
1336
+ };
1337
+ exports.useCallback = function(callback, deps) {
1338
+ return resolveDispatcher().useCallback(callback, deps);
1339
+ };
1340
+ exports.useContext = function(Context) {
1341
+ var dispatcher = resolveDispatcher();
1342
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1343
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1344
+ );
1345
+ return dispatcher.useContext(Context);
1346
+ };
1347
+ exports.useDebugValue = function(value, formatterFn) {
1348
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1349
+ };
1350
+ exports.useDeferredValue = function(value, initialValue) {
1351
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1352
+ };
1353
+ exports.useEffect = function(create, createDeps, update) {
1354
+ null == create && console.warn(
1355
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1356
+ );
1357
+ var dispatcher = resolveDispatcher();
1358
+ if ("function" === typeof update)
1359
+ throw Error(
1360
+ "useEffect CRUD overload is not enabled in this build of React."
1361
+ );
1362
+ return dispatcher.useEffect(create, createDeps);
1363
+ };
1364
+ exports.useId = function() {
1365
+ return resolveDispatcher().useId();
1366
+ };
1367
+ exports.useImperativeHandle = function(ref, create, deps) {
1368
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1369
+ };
1370
+ exports.useInsertionEffect = function(create, deps) {
1371
+ null == create && console.warn(
1372
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1373
+ );
1374
+ return resolveDispatcher().useInsertionEffect(create, deps);
1375
+ };
1376
+ exports.useLayoutEffect = function(create, deps) {
1377
+ null == create && console.warn(
1378
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1379
+ );
1380
+ return resolveDispatcher().useLayoutEffect(create, deps);
1381
+ };
1382
+ exports.useMemo = function(create, deps) {
1383
+ return resolveDispatcher().useMemo(create, deps);
1384
+ };
1385
+ exports.useOptimistic = function(passthrough, reducer) {
1386
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1387
+ };
1388
+ exports.useReducer = function(reducer, initialArg, init) {
1389
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1390
+ };
1391
+ exports.useRef = function(initialValue) {
1392
+ return resolveDispatcher().useRef(initialValue);
1393
+ };
1394
+ exports.useState = function(initialState) {
1395
+ return resolveDispatcher().useState(initialState);
1396
+ };
1397
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1398
+ return resolveDispatcher().useSyncExternalStore(
1399
+ subscribe,
1400
+ getSnapshot,
1401
+ getServerSnapshot
1402
+ );
1403
+ };
1404
+ exports.useTransition = function() {
1405
+ return resolveDispatcher().useTransition();
1406
+ };
1407
+ exports.version = "19.1.0";
1408
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1409
+ }();
1410
+ }
1411
+ });
1412
+
1413
+ // ../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js
1414
+ var require_react = __commonJS({
1415
+ "../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js"(exports, module) {
1416
+ "use strict";
1417
+ if (process.env.NODE_ENV === "production") {
1418
+ module.exports = require_react_production();
1419
+ } else {
1420
+ module.exports = require_react_development();
1421
+ }
1422
+ }
1423
+ });
1424
+
1425
+ // src/useEffectIgnoreInitial.tsx
1426
+ var import_react = __toESM(require_react(), 1);
1427
+ var useEffectIgnoreInitial = (fn, deps) => {
1428
+ const isInitial = (0, import_react.useRef)(true);
1429
+ (0, import_react.useEffect)(
1430
+ () => {
1431
+ if (!isInitial.current) {
1432
+ if (typeof fn === "function") {
1433
+ fn();
1434
+ }
1435
+ }
1436
+ isInitial.current = false;
1437
+ },
1438
+ deps ? [...deps] : void 0
1439
+ );
1440
+ };
1441
+
1442
+ // src/useOnResize.tsx
1443
+ var import_react2 = __toESM(require_react(), 1);
1444
+ var useOnResize = (callback, options = {}) => {
1445
+ const { outerElement, throttle: throttleDuration = 100 } = options;
1446
+ const lastExecutedRef = (0, import_react2.useRef)(0);
1447
+ const handleResize = () => {
1448
+ const now = Date.now();
1449
+ if (now - lastExecutedRef.current < throttleDuration) {
1450
+ return;
1451
+ }
1452
+ lastExecutedRef.current = now;
1453
+ callback();
1454
+ };
1455
+ (0, import_react2.useEffect)(() => {
1456
+ const target = outerElement?.current || window;
1457
+ target.addEventListener("resize", handleResize);
1458
+ return () => {
1459
+ target.removeEventListener("resize", handleResize);
1460
+ };
1461
+ }, [throttleDuration, callback]);
1462
+ };
1463
+
1464
+ // src/useOutsideAlerter.tsx
1465
+ var import_react3 = __toESM(require_react(), 1);
1466
+ var useOutsideAlerter = (ref, callback, ignore = []) => {
1467
+ (0, import_react3.useEffect)(() => {
1468
+ const handleClickOutside = (ev) => {
1469
+ if (ev) {
1470
+ if (ref.current && !ref.current.contains(ev.target)) {
1471
+ const target = ev.target;
1472
+ const tagName = target.tagName.toLowerCase();
1473
+ const ignored = ignore.some(
1474
+ (i) => i.toLowerCase() === tagName || target.closest(`.${i}`) !== null
1475
+ );
1476
+ if (!ignored) {
1477
+ callback();
1478
+ }
1479
+ }
1480
+ }
1481
+ };
1482
+ document.addEventListener("mousedown", handleClickOutside);
1483
+ return () => {
1484
+ document.removeEventListener("mousedown", handleClickOutside);
1485
+ };
1486
+ }, [ref]);
1487
+ };
1488
+
1489
+ // src/useSafeContext.tsx
1490
+ var import_react4 = __toESM(require_react(), 1);
1491
+ var useSafeContext = (ctx) => {
1492
+ if (ctx === null || ctx === void 0) {
1493
+ throw new Error(
1494
+ "Context value is null or undefined. Please ensure the context Provider is used correctly."
1495
+ );
1496
+ }
1497
+ return ctx;
1498
+ };
1499
+ var createSafeContext = () => {
1500
+ const Context = (0, import_react4.createContext)(null);
1501
+ const useHook = () => useSafeContext((0, import_react4.useContext)(Context));
1502
+ return [Context, useHook];
1503
+ };
1504
+
1505
+ // src/useSize.tsx
1506
+ var import_react5 = __toESM(require_react(), 1);
1507
+ var useSize = (element, options = {}) => {
1508
+ const { outerElement, throttle: throttleDuration = 100 } = options;
1509
+ const getSize = (el = null) => {
1510
+ const width = el?.offsetWidth || 0;
1511
+ const height = el?.offsetHeight || 0;
1512
+ return { width, height };
1513
+ };
1514
+ const lastExecutedRef = (0, import_react5.useRef)(0);
1515
+ const [size, setSize] = (0, import_react5.useState)(
1516
+ getSize(element?.current)
1517
+ );
1518
+ const handleResize = () => {
1519
+ const now = Date.now();
1520
+ if (now - lastExecutedRef.current < throttleDuration) {
1521
+ return;
1522
+ }
1523
+ lastExecutedRef.current = now;
1524
+ setSize(getSize(element?.current));
1525
+ };
1526
+ (0, import_react5.useEffect)(() => {
1527
+ const listenFor = outerElement?.current || window;
1528
+ listenFor.addEventListener("resize", handleResize);
1529
+ return () => {
1530
+ listenFor.removeEventListener("resize", handleResize);
1531
+ };
1532
+ }, [outerElement?.current]);
1533
+ return size;
1534
+ };
1535
+
1536
+ // src/useTimeLeft/index.tsx
1537
+ var import_react6 = __toESM(require_react(), 1);
1538
+ import { setStateWithRef } from "@w3ux/utils";
1539
+
1540
+ // src/util.ts
1541
+ import { differenceInDays, getUnixTime, intervalToDuration } from "date-fns";
1542
+
1543
+ // src/useTimeLeft/defaults.ts
1544
+ var defaultDuration = {
1545
+ days: 0,
1546
+ hours: 0,
1547
+ minutes: 0,
1548
+ seconds: 0,
1549
+ lastMinute: false
1550
+ };
1551
+
1552
+ // src/util.ts
1553
+ var getDuration = (toDate) => {
1554
+ if (!toDate) {
1555
+ return defaultDuration;
1556
+ }
1557
+ if (getUnixTime(toDate) <= getUnixTime(/* @__PURE__ */ new Date())) {
1558
+ return defaultDuration;
1559
+ }
1560
+ toDate.setSeconds(toDate.getSeconds());
1561
+ const d = intervalToDuration({
1562
+ start: Date.now(),
1563
+ end: toDate
1564
+ });
1565
+ const days = differenceInDays(toDate, Date.now());
1566
+ const hours = d?.hours || 0;
1567
+ const minutes = d?.minutes || 0;
1568
+ const seconds = d?.seconds || 0;
1569
+ const lastHour = days === 0 && hours === 0;
1570
+ const lastMinute = lastHour && minutes === 0;
1571
+ return {
1572
+ days,
1573
+ hours,
1574
+ minutes,
1575
+ seconds,
1576
+ lastMinute
1577
+ };
1578
+ };
1579
+
1580
+ // src/useTimeLeft/index.tsx
1581
+ var useTimeLeft = (props) => {
1582
+ const depsTimeleft = props?.depsTimeleft || [];
1583
+ const depsFormat = props?.depsFormat || [];
1584
+ const inLastHour = () => {
1585
+ const { days, hours } = getDuration(toRef.current);
1586
+ return !days && !hours;
1587
+ };
1588
+ const lastMinuteCountdown = () => {
1589
+ const { seconds } = getDuration(toRef.current);
1590
+ if (!inLastHour()) {
1591
+ return 60;
1592
+ }
1593
+ return seconds;
1594
+ };
1595
+ const getTimeleft = (c) => {
1596
+ const { days, hours, minutes, seconds } = c || getDuration(toRef.current);
1597
+ const raw = {
1598
+ days,
1599
+ hours,
1600
+ minutes
1601
+ };
1602
+ if (!days && !hours) {
1603
+ raw.seconds = seconds;
1604
+ }
1605
+ return {
1606
+ raw
1607
+ };
1608
+ };
1609
+ const [to, setTo] = (0, import_react6.useState)(null);
1610
+ const toRef = (0, import_react6.useRef)(to);
1611
+ const [timeleft, setTimeleft] = (0, import_react6.useState)(getTimeleft());
1612
+ const [minInterval, setMinInterval] = (0, import_react6.useState)(void 0);
1613
+ const minIntervalRef = (0, import_react6.useRef)(minInterval);
1614
+ const [secInterval, setSecInterval] = (0, import_react6.useState)(void 0);
1615
+ const secIntervalRef = (0, import_react6.useRef)(secInterval);
1616
+ (0, import_react6.useEffect)(() => {
1617
+ setTimeleft(getTimeleft());
1618
+ if (inLastHour()) {
1619
+ if (!secIntervalRef.current) {
1620
+ const interval = setInterval(() => {
1621
+ if (!inLastHour()) {
1622
+ clearInterval(secIntervalRef.current);
1623
+ setStateWithRef(void 0, setSecInterval, secIntervalRef);
1624
+ }
1625
+ setTimeleft(getTimeleft());
1626
+ }, 1e3);
1627
+ setStateWithRef(interval, setSecInterval, secIntervalRef);
1628
+ }
1629
+ } else if (!minIntervalRef.current) {
1630
+ const interval = setInterval(() => {
1631
+ if (inLastHour()) {
1632
+ clearInterval(minIntervalRef.current);
1633
+ setStateWithRef(void 0, setMinInterval, minIntervalRef);
1634
+ }
1635
+ setTimeleft(getTimeleft());
1636
+ }, 6e4);
1637
+ setStateWithRef(interval, setMinInterval, minIntervalRef);
1638
+ }
1639
+ }, [to, inLastHour(), lastMinuteCountdown(), ...depsTimeleft]);
1640
+ (0, import_react6.useEffect)(() => {
1641
+ setTimeleft(getTimeleft());
1642
+ }, [...depsFormat]);
1643
+ (0, import_react6.useEffect)(
1644
+ () => () => {
1645
+ clearInterval(minInterval);
1646
+ clearInterval(secInterval);
1647
+ },
1648
+ []
1649
+ );
1650
+ const setFromNow = (dateFrom, dateTo) => {
1651
+ setTimeleft(getTimeleft(getDuration(dateFrom)));
1652
+ setStateWithRef(dateTo, setTo, toRef);
1653
+ };
1654
+ return {
1655
+ setFromNow,
1656
+ timeleft
1657
+ };
1658
+ };
1659
+ export {
1660
+ createSafeContext,
1661
+ useEffectIgnoreInitial,
1662
+ useOnResize,
1663
+ useOutsideAlerter,
1664
+ useSafeContext,
1665
+ useSize,
1666
+ useTimeLeft
1667
+ };
1668
+ /* @license Copyright 2024 w3ux authors & contributors
1669
+ SPDX-License-Identifier: GPL-3.0-only */
1670
+ /*! Bundled license information:
1671
+
1672
+ react/cjs/react.production.js:
1673
+ (**
1674
+ * @license React
1675
+ * react.production.js
1676
+ *
1677
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1678
+ *
1679
+ * This source code is licensed under the MIT license found in the
1680
+ * LICENSE file in the root directory of this source tree.
1681
+ *)
1682
+
1683
+ react/cjs/react.development.js:
1684
+ (**
1685
+ * @license React
1686
+ * react.development.js
1687
+ *
1688
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1689
+ *
1690
+ * This source code is licensed under the MIT license found in the
1691
+ * LICENSE file in the root directory of this source tree.
1692
+ *)
1693
+ */