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