@alleyboss/micropay-solana-x402-paywall 3.2.0 → 3.2.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.
@@ -2,1454 +2,7 @@
2
2
 
3
3
  var http = require('@x402/core/http');
4
4
  var web3_js = require('@solana/web3.js');
5
-
6
- var __create = Object.create;
7
- var __defProp = Object.defineProperty;
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __commonJS = (cb, mod) => function __require() {
13
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- __defProp(target, "default", { value: mod, enumerable: true }) ,
29
- mod
30
- ));
31
-
32
- // ../../node_modules/react/cjs/react.production.js
33
- var require_react_production = __commonJS({
34
- "../../node_modules/react/cjs/react.production.js"(exports$1) {
35
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
36
- var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
37
- var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
38
- var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
39
- var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
40
- var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
41
- var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
42
- var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
43
- var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
44
- var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
45
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
46
- var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
47
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
48
- function getIteratorFn(maybeIterable) {
49
- if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
50
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
51
- return "function" === typeof maybeIterable ? maybeIterable : null;
52
- }
53
- var ReactNoopUpdateQueue = {
54
- isMounted: function() {
55
- return false;
56
- },
57
- enqueueForceUpdate: function() {
58
- },
59
- enqueueReplaceState: function() {
60
- },
61
- enqueueSetState: function() {
62
- }
63
- };
64
- var assign = Object.assign;
65
- var emptyObject = {};
66
- function Component(props, context, updater) {
67
- this.props = props;
68
- this.context = context;
69
- this.refs = emptyObject;
70
- this.updater = updater || ReactNoopUpdateQueue;
71
- }
72
- Component.prototype.isReactComponent = {};
73
- Component.prototype.setState = function(partialState, callback) {
74
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
75
- throw Error(
76
- "takes an object of state variables to update or a function which returns an object of state variables."
77
- );
78
- this.updater.enqueueSetState(this, partialState, callback, "setState");
79
- };
80
- Component.prototype.forceUpdate = function(callback) {
81
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
82
- };
83
- function ComponentDummy() {
84
- }
85
- ComponentDummy.prototype = Component.prototype;
86
- function PureComponent(props, context, updater) {
87
- this.props = props;
88
- this.context = context;
89
- this.refs = emptyObject;
90
- this.updater = updater || ReactNoopUpdateQueue;
91
- }
92
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
93
- pureComponentPrototype.constructor = PureComponent;
94
- assign(pureComponentPrototype, Component.prototype);
95
- pureComponentPrototype.isPureReactComponent = true;
96
- var isArrayImpl = Array.isArray;
97
- function noop() {
98
- }
99
- var ReactSharedInternals = { H: null, A: null, T: null, S: null };
100
- var hasOwnProperty = Object.prototype.hasOwnProperty;
101
- function ReactElement(type, key, props) {
102
- var refProp = props.ref;
103
- return {
104
- $$typeof: REACT_ELEMENT_TYPE,
105
- type,
106
- key,
107
- ref: void 0 !== refProp ? refProp : null,
108
- props
109
- };
110
- }
111
- function cloneAndReplaceKey(oldElement, newKey) {
112
- return ReactElement(oldElement.type, newKey, oldElement.props);
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 resolveThenable(thenable) {
128
- switch (thenable.status) {
129
- case "fulfilled":
130
- return thenable.value;
131
- case "rejected":
132
- throw thenable.reason;
133
- default:
134
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
135
- function(fulfilledValue) {
136
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
137
- },
138
- function(error) {
139
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
140
- }
141
- )), thenable.status) {
142
- case "fulfilled":
143
- return thenable.value;
144
- case "rejected":
145
- throw thenable.reason;
146
- }
147
- }
148
- throw thenable;
149
- }
150
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
151
- var type = typeof children;
152
- if ("undefined" === type || "boolean" === type) children = null;
153
- var invokeCallback = false;
154
- if (null === children) invokeCallback = true;
155
- else
156
- switch (type) {
157
- case "bigint":
158
- case "string":
159
- case "number":
160
- invokeCallback = true;
161
- break;
162
- case "object":
163
- switch (children.$$typeof) {
164
- case REACT_ELEMENT_TYPE:
165
- case REACT_PORTAL_TYPE:
166
- invokeCallback = true;
167
- break;
168
- case REACT_LAZY_TYPE:
169
- return invokeCallback = children._init, mapIntoArray(
170
- invokeCallback(children._payload),
171
- array,
172
- escapedPrefix,
173
- nameSoFar,
174
- callback
175
- );
176
- }
177
- }
178
- if (invokeCallback)
179
- 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) {
180
- return c;
181
- })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
182
- callback,
183
- escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
184
- userProvidedKeyEscapeRegex,
185
- "$&/"
186
- ) + "/") + invokeCallback
187
- )), array.push(callback)), 1;
188
- invokeCallback = 0;
189
- var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
190
- if (isArrayImpl(children))
191
- for (var i = 0; i < children.length; i++)
192
- nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
193
- nameSoFar,
194
- array,
195
- escapedPrefix,
196
- type,
197
- callback
198
- );
199
- else if (i = getIteratorFn(children), "function" === typeof i)
200
- for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
201
- nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
202
- nameSoFar,
203
- array,
204
- escapedPrefix,
205
- type,
206
- callback
207
- );
208
- else if ("object" === type) {
209
- if ("function" === typeof children.then)
210
- return mapIntoArray(
211
- resolveThenable(children),
212
- array,
213
- escapedPrefix,
214
- nameSoFar,
215
- callback
216
- );
217
- array = String(children);
218
- throw Error(
219
- "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."
220
- );
221
- }
222
- return invokeCallback;
223
- }
224
- function mapChildren(children, func, context) {
225
- if (null == children) return children;
226
- var result = [], count = 0;
227
- mapIntoArray(children, result, "", "", function(child) {
228
- return func.call(context, child, count++);
229
- });
230
- return result;
231
- }
232
- function lazyInitializer(payload) {
233
- if (-1 === payload._status) {
234
- var ctor = payload._result;
235
- ctor = ctor();
236
- ctor.then(
237
- function(moduleObject) {
238
- if (0 === payload._status || -1 === payload._status)
239
- payload._status = 1, payload._result = moduleObject;
240
- },
241
- function(error) {
242
- if (0 === payload._status || -1 === payload._status)
243
- payload._status = 2, payload._result = error;
244
- }
245
- );
246
- -1 === payload._status && (payload._status = 0, payload._result = ctor);
247
- }
248
- if (1 === payload._status) return payload._result.default;
249
- throw payload._result;
250
- }
251
- var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
252
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
253
- var event = new window.ErrorEvent("error", {
254
- bubbles: true,
255
- cancelable: true,
256
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
257
- error
258
- });
259
- if (!window.dispatchEvent(event)) return;
260
- } else if ("object" === typeof process && "function" === typeof process.emit) {
261
- process.emit("uncaughtException", error);
262
- return;
263
- }
264
- console.error(error);
265
- };
266
- var Children = {
267
- map: mapChildren,
268
- forEach: function(children, forEachFunc, forEachContext) {
269
- mapChildren(
270
- children,
271
- function() {
272
- forEachFunc.apply(this, arguments);
273
- },
274
- forEachContext
275
- );
276
- },
277
- count: function(children) {
278
- var n = 0;
279
- mapChildren(children, function() {
280
- n++;
281
- });
282
- return n;
283
- },
284
- toArray: function(children) {
285
- return mapChildren(children, function(child) {
286
- return child;
287
- }) || [];
288
- },
289
- only: function(children) {
290
- if (!isValidElement(children))
291
- throw Error(
292
- "React.Children.only expected to receive a single React element child."
293
- );
294
- return children;
295
- }
296
- };
297
- exports$1.Activity = REACT_ACTIVITY_TYPE;
298
- exports$1.Children = Children;
299
- exports$1.Component = Component;
300
- exports$1.Fragment = REACT_FRAGMENT_TYPE;
301
- exports$1.Profiler = REACT_PROFILER_TYPE;
302
- exports$1.PureComponent = PureComponent;
303
- exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
304
- exports$1.Suspense = REACT_SUSPENSE_TYPE;
305
- exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
306
- exports$1.__COMPILER_RUNTIME = {
307
- __proto__: null,
308
- c: function(size) {
309
- return ReactSharedInternals.H.useMemoCache(size);
310
- }
311
- };
312
- exports$1.cache = function(fn) {
313
- return function() {
314
- return fn.apply(null, arguments);
315
- };
316
- };
317
- exports$1.cacheSignal = function() {
318
- return null;
319
- };
320
- exports$1.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;
326
- if (null != config)
327
- for (propName in 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, props);
337
- };
338
- exports$1.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$1.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, props);
370
- };
371
- exports$1.createRef = function() {
372
- return { current: null };
373
- };
374
- exports$1.forwardRef = function(render) {
375
- return { $$typeof: REACT_FORWARD_REF_TYPE, render };
376
- };
377
- exports$1.isValidElement = isValidElement;
378
- exports$1.lazy = function(ctor) {
379
- return {
380
- $$typeof: REACT_LAZY_TYPE,
381
- _payload: { _status: -1, _result: ctor },
382
- _init: lazyInitializer
383
- };
384
- };
385
- exports$1.memo = function(type, compare) {
386
- return {
387
- $$typeof: REACT_MEMO_TYPE,
388
- type,
389
- compare: void 0 === compare ? null : compare
390
- };
391
- };
392
- exports$1.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
- null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
403
- }
404
- };
405
- exports$1.unstable_useCacheRefresh = function() {
406
- return ReactSharedInternals.H.useCacheRefresh();
407
- };
408
- exports$1.use = function(usable) {
409
- return ReactSharedInternals.H.use(usable);
410
- };
411
- exports$1.useActionState = function(action, initialState, permalink) {
412
- return ReactSharedInternals.H.useActionState(action, initialState, permalink);
413
- };
414
- exports$1.useCallback = function(callback, deps) {
415
- return ReactSharedInternals.H.useCallback(callback, deps);
416
- };
417
- exports$1.useContext = function(Context) {
418
- return ReactSharedInternals.H.useContext(Context);
419
- };
420
- exports$1.useDebugValue = function() {
421
- };
422
- exports$1.useDeferredValue = function(value, initialValue) {
423
- return ReactSharedInternals.H.useDeferredValue(value, initialValue);
424
- };
425
- exports$1.useEffect = function(create, deps) {
426
- return ReactSharedInternals.H.useEffect(create, deps);
427
- };
428
- exports$1.useEffectEvent = function(callback) {
429
- return ReactSharedInternals.H.useEffectEvent(callback);
430
- };
431
- exports$1.useId = function() {
432
- return ReactSharedInternals.H.useId();
433
- };
434
- exports$1.useImperativeHandle = function(ref, create, deps) {
435
- return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
436
- };
437
- exports$1.useInsertionEffect = function(create, deps) {
438
- return ReactSharedInternals.H.useInsertionEffect(create, deps);
439
- };
440
- exports$1.useLayoutEffect = function(create, deps) {
441
- return ReactSharedInternals.H.useLayoutEffect(create, deps);
442
- };
443
- exports$1.useMemo = function(create, deps) {
444
- return ReactSharedInternals.H.useMemo(create, deps);
445
- };
446
- exports$1.useOptimistic = function(passthrough, reducer) {
447
- return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
448
- };
449
- exports$1.useReducer = function(reducer, initialArg, init) {
450
- return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
451
- };
452
- exports$1.useRef = function(initialValue) {
453
- return ReactSharedInternals.H.useRef(initialValue);
454
- };
455
- exports$1.useState = function(initialState) {
456
- return ReactSharedInternals.H.useState(initialState);
457
- };
458
- exports$1.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
459
- return ReactSharedInternals.H.useSyncExternalStore(
460
- subscribe,
461
- getSnapshot,
462
- getServerSnapshot
463
- );
464
- };
465
- exports$1.useTransition = function() {
466
- return ReactSharedInternals.H.useTransition();
467
- };
468
- exports$1.version = "19.2.3";
469
- }
470
- });
471
-
472
- // ../../node_modules/react/cjs/react.development.js
473
- var require_react_development = __commonJS({
474
- "../../node_modules/react/cjs/react.development.js"(exports$1, module) {
475
- "production" !== process.env.NODE_ENV && (function() {
476
- function defineDeprecationWarning(methodName, info) {
477
- Object.defineProperty(Component.prototype, methodName, {
478
- get: function() {
479
- console.warn(
480
- "%s(...) is deprecated in plain JavaScript React classes. %s",
481
- info[0],
482
- info[1]
483
- );
484
- }
485
- });
486
- }
487
- function getIteratorFn(maybeIterable) {
488
- if (null === maybeIterable || "object" !== typeof maybeIterable)
489
- return null;
490
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
491
- return "function" === typeof maybeIterable ? maybeIterable : null;
492
- }
493
- function warnNoop(publicInstance, callerName) {
494
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
495
- var warningKey = publicInstance + "." + callerName;
496
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
497
- "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.",
498
- callerName,
499
- publicInstance
500
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
501
- }
502
- function Component(props, context, updater) {
503
- this.props = props;
504
- this.context = context;
505
- this.refs = emptyObject;
506
- this.updater = updater || ReactNoopUpdateQueue;
507
- }
508
- function ComponentDummy() {
509
- }
510
- function PureComponent(props, context, updater) {
511
- this.props = props;
512
- this.context = context;
513
- this.refs = emptyObject;
514
- this.updater = updater || ReactNoopUpdateQueue;
515
- }
516
- function noop() {
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";
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, props, owner, debugStack, debugTask) {
633
- var refProp = props.ref;
634
- type = {
635
- $$typeof: REACT_ELEMENT_TYPE,
636
- type,
637
- key,
638
- props,
639
- _owner: owner
640
- };
641
- null !== (void 0 !== refProp ? refProp : 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
- oldElement.props,
678
- oldElement._owner,
679
- oldElement._debugStack,
680
- oldElement._debugTask
681
- );
682
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
683
- return newKey;
684
- }
685
- function validateChildKeys(node) {
686
- isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
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 resolveThenable(thenable) {
701
- switch (thenable.status) {
702
- case "fulfilled":
703
- return thenable.value;
704
- case "rejected":
705
- throw thenable.reason;
706
- default:
707
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
708
- function(fulfilledValue) {
709
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
710
- },
711
- function(error) {
712
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
713
- }
714
- )), thenable.status) {
715
- case "fulfilled":
716
- return thenable.value;
717
- case "rejected":
718
- throw thenable.reason;
719
- }
720
- }
721
- throw thenable;
722
- }
723
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
724
- var type = typeof children;
725
- if ("undefined" === type || "boolean" === type) children = null;
726
- var invokeCallback = false;
727
- if (null === children) invokeCallback = true;
728
- else
729
- switch (type) {
730
- case "bigint":
731
- case "string":
732
- case "number":
733
- invokeCallback = true;
734
- break;
735
- case "object":
736
- switch (children.$$typeof) {
737
- case REACT_ELEMENT_TYPE:
738
- case REACT_PORTAL_TYPE:
739
- invokeCallback = true;
740
- break;
741
- case REACT_LAZY_TYPE:
742
- return invokeCallback = children._init, mapIntoArray(
743
- invokeCallback(children._payload),
744
- array,
745
- escapedPrefix,
746
- nameSoFar,
747
- callback
748
- );
749
- }
750
- }
751
- if (invokeCallback) {
752
- invokeCallback = children;
753
- callback = callback(invokeCallback);
754
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
755
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
756
- return c;
757
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
758
- callback,
759
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
760
- userProvidedKeyEscapeRegex,
761
- "$&/"
762
- ) + "/") + childKey
763
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
764
- return 1;
765
- }
766
- invokeCallback = 0;
767
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
768
- if (isArrayImpl(children))
769
- for (var i = 0; i < children.length; i++)
770
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
771
- nameSoFar,
772
- array,
773
- escapedPrefix,
774
- type,
775
- callback
776
- );
777
- else if (i = getIteratorFn(children), "function" === typeof i)
778
- for (i === children.entries && (didWarnAboutMaps || console.warn(
779
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
780
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
781
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
782
- nameSoFar,
783
- array,
784
- escapedPrefix,
785
- type,
786
- callback
787
- );
788
- else if ("object" === type) {
789
- if ("function" === typeof children.then)
790
- return mapIntoArray(
791
- resolveThenable(children),
792
- array,
793
- escapedPrefix,
794
- nameSoFar,
795
- callback
796
- );
797
- array = String(children);
798
- throw Error(
799
- "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."
800
- );
801
- }
802
- return invokeCallback;
803
- }
804
- function mapChildren(children, func, context) {
805
- if (null == children) return children;
806
- var result = [], count = 0;
807
- mapIntoArray(children, result, "", "", function(child) {
808
- return func.call(context, child, count++);
809
- });
810
- return result;
811
- }
812
- function lazyInitializer(payload) {
813
- if (-1 === payload._status) {
814
- var ioInfo = payload._ioInfo;
815
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
816
- ioInfo = payload._result;
817
- var thenable = ioInfo();
818
- thenable.then(
819
- function(moduleObject) {
820
- if (0 === payload._status || -1 === payload._status) {
821
- payload._status = 1;
822
- payload._result = moduleObject;
823
- var _ioInfo = payload._ioInfo;
824
- null != _ioInfo && (_ioInfo.end = performance.now());
825
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
826
- }
827
- },
828
- function(error) {
829
- if (0 === payload._status || -1 === payload._status) {
830
- payload._status = 2;
831
- payload._result = error;
832
- var _ioInfo2 = payload._ioInfo;
833
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
834
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
835
- }
836
- }
837
- );
838
- ioInfo = payload._ioInfo;
839
- if (null != ioInfo) {
840
- ioInfo.value = thenable;
841
- var displayName = thenable.displayName;
842
- "string" === typeof displayName && (ioInfo.name = displayName);
843
- }
844
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
845
- }
846
- if (1 === payload._status)
847
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
848
- "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?",
849
- ioInfo
850
- ), "default" in ioInfo || console.error(
851
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
852
- ioInfo
853
- ), ioInfo.default;
854
- throw payload._result;
855
- }
856
- function resolveDispatcher() {
857
- var dispatcher = ReactSharedInternals.H;
858
- null === dispatcher && console.error(
859
- "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."
860
- );
861
- return dispatcher;
862
- }
863
- function releaseAsyncTransition() {
864
- ReactSharedInternals.asyncTransitions--;
865
- }
866
- function enqueueTask(task) {
867
- if (null === enqueueTaskImpl)
868
- try {
869
- var requireString = ("require" + Math.random()).slice(0, 7);
870
- enqueueTaskImpl = (module && module[requireString]).call(
871
- module,
872
- "timers"
873
- ).setImmediate;
874
- } catch (_err) {
875
- enqueueTaskImpl = function(callback) {
876
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
877
- "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."
878
- ));
879
- var channel = new MessageChannel();
880
- channel.port1.onmessage = callback;
881
- channel.port2.postMessage(void 0);
882
- };
883
- }
884
- return enqueueTaskImpl(task);
885
- }
886
- function aggregateErrors(errors) {
887
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
888
- }
889
- function popActScope(prevActQueue, prevActScopeDepth) {
890
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
891
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
892
- );
893
- actScopeDepth = prevActScopeDepth;
894
- }
895
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
896
- var queue = ReactSharedInternals.actQueue;
897
- if (null !== queue)
898
- if (0 !== queue.length)
899
- try {
900
- flushActQueue(queue);
901
- enqueueTask(function() {
902
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
903
- });
904
- return;
905
- } catch (error) {
906
- ReactSharedInternals.thrownErrors.push(error);
907
- }
908
- else ReactSharedInternals.actQueue = null;
909
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
910
- }
911
- function flushActQueue(queue) {
912
- if (!isFlushing) {
913
- isFlushing = true;
914
- var i = 0;
915
- try {
916
- for (; i < queue.length; i++) {
917
- var callback = queue[i];
918
- do {
919
- ReactSharedInternals.didUsePromise = false;
920
- var continuation = callback(false);
921
- if (null !== continuation) {
922
- if (ReactSharedInternals.didUsePromise) {
923
- queue[i] = callback;
924
- queue.splice(0, i);
925
- return;
926
- }
927
- callback = continuation;
928
- } else break;
929
- } while (1);
930
- }
931
- queue.length = 0;
932
- } catch (error) {
933
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
934
- } finally {
935
- isFlushing = false;
936
- }
937
- }
938
- }
939
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
940
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
941
- isMounted: function() {
942
- return false;
943
- },
944
- enqueueForceUpdate: function(publicInstance) {
945
- warnNoop(publicInstance, "forceUpdate");
946
- },
947
- enqueueReplaceState: function(publicInstance) {
948
- warnNoop(publicInstance, "replaceState");
949
- },
950
- enqueueSetState: function(publicInstance) {
951
- warnNoop(publicInstance, "setState");
952
- }
953
- }, assign = Object.assign, emptyObject = {};
954
- Object.freeze(emptyObject);
955
- Component.prototype.isReactComponent = {};
956
- Component.prototype.setState = function(partialState, callback) {
957
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
958
- throw Error(
959
- "takes an object of state variables to update or a function which returns an object of state variables."
960
- );
961
- this.updater.enqueueSetState(this, partialState, callback, "setState");
962
- };
963
- Component.prototype.forceUpdate = function(callback) {
964
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
965
- };
966
- var deprecatedAPIs = {
967
- isMounted: [
968
- "isMounted",
969
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
970
- ],
971
- replaceState: [
972
- "replaceState",
973
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
974
- ]
975
- };
976
- for (fnName in deprecatedAPIs)
977
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
978
- ComponentDummy.prototype = Component.prototype;
979
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
980
- deprecatedAPIs.constructor = PureComponent;
981
- assign(deprecatedAPIs, Component.prototype);
982
- deprecatedAPIs.isPureReactComponent = true;
983
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
984
- H: null,
985
- A: null,
986
- T: null,
987
- S: null,
988
- actQueue: null,
989
- asyncTransitions: 0,
990
- isBatchingLegacy: false,
991
- didScheduleLegacyUpdate: false,
992
- didUsePromise: false,
993
- thrownErrors: [],
994
- getCurrentStack: null,
995
- recentlyCreatedOwnerStacks: 0
996
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
997
- return null;
998
- };
999
- deprecatedAPIs = {
1000
- react_stack_bottom_frame: function(callStackForError) {
1001
- return callStackForError();
1002
- }
1003
- };
1004
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1005
- var didWarnAboutElementRef = {};
1006
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1007
- deprecatedAPIs,
1008
- UnknownOwner
1009
- )();
1010
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1011
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1012
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1013
- var event = new window.ErrorEvent("error", {
1014
- bubbles: true,
1015
- cancelable: true,
1016
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1017
- error
1018
- });
1019
- if (!window.dispatchEvent(event)) return;
1020
- } else if ("object" === typeof process && "function" === typeof process.emit) {
1021
- process.emit("uncaughtException", error);
1022
- return;
1023
- }
1024
- console.error(error);
1025
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1026
- queueMicrotask(function() {
1027
- return queueMicrotask(callback);
1028
- });
1029
- } : enqueueTask;
1030
- deprecatedAPIs = Object.freeze({
1031
- __proto__: null,
1032
- c: function(size) {
1033
- return resolveDispatcher().useMemoCache(size);
1034
- }
1035
- });
1036
- var fnName = {
1037
- map: mapChildren,
1038
- forEach: function(children, forEachFunc, forEachContext) {
1039
- mapChildren(
1040
- children,
1041
- function() {
1042
- forEachFunc.apply(this, arguments);
1043
- },
1044
- forEachContext
1045
- );
1046
- },
1047
- count: function(children) {
1048
- var n = 0;
1049
- mapChildren(children, function() {
1050
- n++;
1051
- });
1052
- return n;
1053
- },
1054
- toArray: function(children) {
1055
- return mapChildren(children, function(child) {
1056
- return child;
1057
- }) || [];
1058
- },
1059
- only: function(children) {
1060
- if (!isValidElement(children))
1061
- throw Error(
1062
- "React.Children.only expected to receive a single React element child."
1063
- );
1064
- return children;
1065
- }
1066
- };
1067
- exports$1.Activity = REACT_ACTIVITY_TYPE;
1068
- exports$1.Children = fnName;
1069
- exports$1.Component = Component;
1070
- exports$1.Fragment = REACT_FRAGMENT_TYPE;
1071
- exports$1.Profiler = REACT_PROFILER_TYPE;
1072
- exports$1.PureComponent = PureComponent;
1073
- exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
1074
- exports$1.Suspense = REACT_SUSPENSE_TYPE;
1075
- exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1076
- exports$1.__COMPILER_RUNTIME = deprecatedAPIs;
1077
- exports$1.act = function(callback) {
1078
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1079
- actScopeDepth++;
1080
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1081
- try {
1082
- var result = callback();
1083
- } catch (error) {
1084
- ReactSharedInternals.thrownErrors.push(error);
1085
- }
1086
- if (0 < ReactSharedInternals.thrownErrors.length)
1087
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1088
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1089
- var thenable = result;
1090
- queueSeveralMicrotasks(function() {
1091
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1092
- "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 () => ...);"
1093
- ));
1094
- });
1095
- return {
1096
- then: function(resolve, reject) {
1097
- didAwaitActCall = true;
1098
- thenable.then(
1099
- function(returnValue) {
1100
- popActScope(prevActQueue, prevActScopeDepth);
1101
- if (0 === prevActScopeDepth) {
1102
- try {
1103
- flushActQueue(queue), enqueueTask(function() {
1104
- return recursivelyFlushAsyncActWork(
1105
- returnValue,
1106
- resolve,
1107
- reject
1108
- );
1109
- });
1110
- } catch (error$0) {
1111
- ReactSharedInternals.thrownErrors.push(error$0);
1112
- }
1113
- if (0 < ReactSharedInternals.thrownErrors.length) {
1114
- var _thrownError = aggregateErrors(
1115
- ReactSharedInternals.thrownErrors
1116
- );
1117
- ReactSharedInternals.thrownErrors.length = 0;
1118
- reject(_thrownError);
1119
- }
1120
- } else resolve(returnValue);
1121
- },
1122
- function(error) {
1123
- popActScope(prevActQueue, prevActScopeDepth);
1124
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1125
- ReactSharedInternals.thrownErrors
1126
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1127
- }
1128
- );
1129
- }
1130
- };
1131
- }
1132
- var returnValue$jscomp$0 = result;
1133
- popActScope(prevActQueue, prevActScopeDepth);
1134
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1135
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1136
- "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(() => ...)"
1137
- ));
1138
- }), ReactSharedInternals.actQueue = null);
1139
- if (0 < ReactSharedInternals.thrownErrors.length)
1140
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1141
- return {
1142
- then: function(resolve, reject) {
1143
- didAwaitActCall = true;
1144
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1145
- return recursivelyFlushAsyncActWork(
1146
- returnValue$jscomp$0,
1147
- resolve,
1148
- reject
1149
- );
1150
- })) : resolve(returnValue$jscomp$0);
1151
- }
1152
- };
1153
- };
1154
- exports$1.cache = function(fn) {
1155
- return function() {
1156
- return fn.apply(null, arguments);
1157
- };
1158
- };
1159
- exports$1.cacheSignal = function() {
1160
- return null;
1161
- };
1162
- exports$1.captureOwnerStack = function() {
1163
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
1164
- return null === getCurrentStack ? null : getCurrentStack();
1165
- };
1166
- exports$1.cloneElement = function(element, config, children) {
1167
- if (null === element || void 0 === element)
1168
- throw Error(
1169
- "The argument must be a React element, but you passed " + element + "."
1170
- );
1171
- var props = assign({}, element.props), key = element.key, owner = element._owner;
1172
- if (null != config) {
1173
- var JSCompiler_inline_result;
1174
- a: {
1175
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1176
- config,
1177
- "ref"
1178
- ).get) && JSCompiler_inline_result.isReactWarning) {
1179
- JSCompiler_inline_result = false;
1180
- break a;
1181
- }
1182
- JSCompiler_inline_result = void 0 !== config.ref;
1183
- }
1184
- JSCompiler_inline_result && (owner = getOwner());
1185
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1186
- for (propName in config)
1187
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1188
- }
1189
- var propName = arguments.length - 2;
1190
- if (1 === propName) props.children = children;
1191
- else if (1 < propName) {
1192
- JSCompiler_inline_result = Array(propName);
1193
- for (var i = 0; i < propName; i++)
1194
- JSCompiler_inline_result[i] = arguments[i + 2];
1195
- props.children = JSCompiler_inline_result;
1196
- }
1197
- props = ReactElement(
1198
- element.type,
1199
- key,
1200
- props,
1201
- owner,
1202
- element._debugStack,
1203
- element._debugTask
1204
- );
1205
- for (key = 2; key < arguments.length; key++)
1206
- validateChildKeys(arguments[key]);
1207
- return props;
1208
- };
1209
- exports$1.createContext = function(defaultValue) {
1210
- defaultValue = {
1211
- $$typeof: REACT_CONTEXT_TYPE,
1212
- _currentValue: defaultValue,
1213
- _currentValue2: defaultValue,
1214
- _threadCount: 0,
1215
- Provider: null,
1216
- Consumer: null
1217
- };
1218
- defaultValue.Provider = defaultValue;
1219
- defaultValue.Consumer = {
1220
- $$typeof: REACT_CONSUMER_TYPE,
1221
- _context: defaultValue
1222
- };
1223
- defaultValue._currentRenderer = null;
1224
- defaultValue._currentRenderer2 = null;
1225
- return defaultValue;
1226
- };
1227
- exports$1.createElement = function(type, config, children) {
1228
- for (var i = 2; i < arguments.length; i++)
1229
- validateChildKeys(arguments[i]);
1230
- i = {};
1231
- var key = null;
1232
- if (null != config)
1233
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1234
- "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"
1235
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1236
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1237
- var childrenLength = arguments.length - 2;
1238
- if (1 === childrenLength) i.children = children;
1239
- else if (1 < childrenLength) {
1240
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1241
- childArray[_i] = arguments[_i + 2];
1242
- Object.freeze && Object.freeze(childArray);
1243
- i.children = childArray;
1244
- }
1245
- if (type && type.defaultProps)
1246
- for (propName in childrenLength = type.defaultProps, childrenLength)
1247
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1248
- key && defineKeyPropWarningGetter(
1249
- i,
1250
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1251
- );
1252
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1253
- return ReactElement(
1254
- type,
1255
- key,
1256
- i,
1257
- getOwner(),
1258
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1259
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1260
- );
1261
- };
1262
- exports$1.createRef = function() {
1263
- var refObject = { current: null };
1264
- Object.seal(refObject);
1265
- return refObject;
1266
- };
1267
- exports$1.forwardRef = function(render) {
1268
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1269
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1270
- ) : "function" !== typeof render ? console.error(
1271
- "forwardRef requires a render function but was given %s.",
1272
- null === render ? "null" : typeof render
1273
- ) : 0 !== render.length && 2 !== render.length && console.error(
1274
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
1275
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1276
- );
1277
- null != render && null != render.defaultProps && console.error(
1278
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1279
- );
1280
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1281
- Object.defineProperty(elementType, "displayName", {
1282
- enumerable: false,
1283
- configurable: true,
1284
- get: function() {
1285
- return ownName;
1286
- },
1287
- set: function(name) {
1288
- ownName = name;
1289
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1290
- }
1291
- });
1292
- return elementType;
1293
- };
1294
- exports$1.isValidElement = isValidElement;
1295
- exports$1.lazy = function(ctor) {
1296
- ctor = { _status: -1, _result: ctor };
1297
- var lazyType = {
1298
- $$typeof: REACT_LAZY_TYPE,
1299
- _payload: ctor,
1300
- _init: lazyInitializer
1301
- }, ioInfo = {
1302
- name: "lazy",
1303
- start: -1,
1304
- end: -1,
1305
- value: null,
1306
- owner: null,
1307
- debugStack: Error("react-stack-top-frame"),
1308
- debugTask: console.createTask ? console.createTask("lazy()") : null
1309
- };
1310
- ctor._ioInfo = ioInfo;
1311
- lazyType._debugInfo = [{ awaited: ioInfo }];
1312
- return lazyType;
1313
- };
1314
- exports$1.memo = function(type, compare) {
1315
- null == type && console.error(
1316
- "memo: The first argument must be a component. Instead received: %s",
1317
- null === type ? "null" : typeof type
1318
- );
1319
- compare = {
1320
- $$typeof: REACT_MEMO_TYPE,
1321
- type,
1322
- compare: void 0 === compare ? null : compare
1323
- };
1324
- var ownName;
1325
- Object.defineProperty(compare, "displayName", {
1326
- enumerable: false,
1327
- configurable: true,
1328
- get: function() {
1329
- return ownName;
1330
- },
1331
- set: function(name) {
1332
- ownName = name;
1333
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1334
- }
1335
- });
1336
- return compare;
1337
- };
1338
- exports$1.startTransition = function(scope) {
1339
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
1340
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1341
- ReactSharedInternals.T = currentTransition;
1342
- try {
1343
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1344
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1345
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
1346
- } catch (error) {
1347
- reportGlobalError(error);
1348
- } finally {
1349
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1350
- "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."
1351
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
1352
- "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
1353
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
1354
- }
1355
- };
1356
- exports$1.unstable_useCacheRefresh = function() {
1357
- return resolveDispatcher().useCacheRefresh();
1358
- };
1359
- exports$1.use = function(usable) {
1360
- return resolveDispatcher().use(usable);
1361
- };
1362
- exports$1.useActionState = function(action, initialState, permalink) {
1363
- return resolveDispatcher().useActionState(
1364
- action,
1365
- initialState,
1366
- permalink
1367
- );
1368
- };
1369
- exports$1.useCallback = function(callback, deps) {
1370
- return resolveDispatcher().useCallback(callback, deps);
1371
- };
1372
- exports$1.useContext = function(Context) {
1373
- var dispatcher = resolveDispatcher();
1374
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1375
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1376
- );
1377
- return dispatcher.useContext(Context);
1378
- };
1379
- exports$1.useDebugValue = function(value, formatterFn) {
1380
- return resolveDispatcher().useDebugValue(value, formatterFn);
1381
- };
1382
- exports$1.useDeferredValue = function(value, initialValue) {
1383
- return resolveDispatcher().useDeferredValue(value, initialValue);
1384
- };
1385
- exports$1.useEffect = function(create, deps) {
1386
- null == create && console.warn(
1387
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1388
- );
1389
- return resolveDispatcher().useEffect(create, deps);
1390
- };
1391
- exports$1.useEffectEvent = function(callback) {
1392
- return resolveDispatcher().useEffectEvent(callback);
1393
- };
1394
- exports$1.useId = function() {
1395
- return resolveDispatcher().useId();
1396
- };
1397
- exports$1.useImperativeHandle = function(ref, create, deps) {
1398
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
1399
- };
1400
- exports$1.useInsertionEffect = function(create, deps) {
1401
- null == create && console.warn(
1402
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1403
- );
1404
- return resolveDispatcher().useInsertionEffect(create, deps);
1405
- };
1406
- exports$1.useLayoutEffect = function(create, deps) {
1407
- null == create && console.warn(
1408
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1409
- );
1410
- return resolveDispatcher().useLayoutEffect(create, deps);
1411
- };
1412
- exports$1.useMemo = function(create, deps) {
1413
- return resolveDispatcher().useMemo(create, deps);
1414
- };
1415
- exports$1.useOptimistic = function(passthrough, reducer) {
1416
- return resolveDispatcher().useOptimistic(passthrough, reducer);
1417
- };
1418
- exports$1.useReducer = function(reducer, initialArg, init) {
1419
- return resolveDispatcher().useReducer(reducer, initialArg, init);
1420
- };
1421
- exports$1.useRef = function(initialValue) {
1422
- return resolveDispatcher().useRef(initialValue);
1423
- };
1424
- exports$1.useState = function(initialState) {
1425
- return resolveDispatcher().useState(initialState);
1426
- };
1427
- exports$1.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1428
- return resolveDispatcher().useSyncExternalStore(
1429
- subscribe,
1430
- getSnapshot,
1431
- getServerSnapshot
1432
- );
1433
- };
1434
- exports$1.useTransition = function() {
1435
- return resolveDispatcher().useTransition();
1436
- };
1437
- exports$1.version = "19.2.3";
1438
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1439
- })();
1440
- }
1441
- });
1442
-
1443
- // ../../node_modules/react/index.js
1444
- var require_react = __commonJS({
1445
- "../../node_modules/react/index.js"(exports$1, module) {
1446
- if (process.env.NODE_ENV === "production") {
1447
- module.exports = require_react_production();
1448
- } else {
1449
- module.exports = require_react_development();
1450
- }
1451
- }
1452
- });
5
+ var react = require('react');
1453
6
 
1454
7
  // src/client/types.ts
1455
8
  var TOKEN_MINTS = {
@@ -1601,22 +154,19 @@ async function sendSolanaPayment({
1601
154
  throw new Error(error.message || "Payment failed");
1602
155
  }
1603
156
  }
1604
-
1605
- // src/client/react.ts
1606
- var import_react = __toESM(require_react());
1607
157
  function usePaywallResource({
1608
158
  url,
1609
159
  connection,
1610
160
  wallet
1611
161
  }) {
1612
- const [data, setData] = (0, import_react.useState)(null);
1613
- const [isLocked, setIsLocked] = (0, import_react.useState)(true);
1614
- const [isLoading, setIsLoading] = (0, import_react.useState)(true);
1615
- const [error, setError] = (0, import_react.useState)(null);
1616
- const [paymentHeader, setPaymentHeader] = (0, import_react.useState)(null);
1617
- const [price, setPrice] = (0, import_react.useState)();
1618
- const [recipient, setRecipient] = (0, import_react.useState)();
1619
- const fetchData = (0, import_react.useCallback)(async (authHeader) => {
162
+ const [data, setData] = react.useState(null);
163
+ const [isLocked, setIsLocked] = react.useState(true);
164
+ const [isLoading, setIsLoading] = react.useState(true);
165
+ const [error, setError] = react.useState(null);
166
+ const [paymentHeader, setPaymentHeader] = react.useState(null);
167
+ const [price, setPrice] = react.useState();
168
+ const [recipient, setRecipient] = react.useState();
169
+ const fetchData = react.useCallback(async (authHeader) => {
1620
170
  setIsLoading(true);
1621
171
  setError(null);
1622
172
  try {
@@ -1656,10 +206,10 @@ function usePaywallResource({
1656
206
  setIsLoading(false);
1657
207
  }
1658
208
  }, [url]);
1659
- (0, import_react.useEffect)(() => {
209
+ react.useEffect(() => {
1660
210
  fetchData();
1661
211
  }, [fetchData]);
1662
- const unlock = (0, import_react.useCallback)(async () => {
212
+ const unlock = react.useCallback(async () => {
1663
213
  if (!paymentHeader || !price || !recipient) {
1664
214
  setError("Missing payment requirements");
1665
215
  return;
@@ -1690,30 +240,6 @@ function usePaywallResource({
1690
240
  unlock
1691
241
  };
1692
242
  }
1693
- /*! Bundled license information:
1694
-
1695
- react/cjs/react.production.js:
1696
- (**
1697
- * @license React
1698
- * react.production.js
1699
- *
1700
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1701
- *
1702
- * This source code is licensed under the MIT license found in the
1703
- * LICENSE file in the root directory of this source tree.
1704
- *)
1705
-
1706
- react/cjs/react.development.js:
1707
- (**
1708
- * @license React
1709
- * react.development.js
1710
- *
1711
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1712
- *
1713
- * This source code is licensed under the MIT license found in the
1714
- * LICENSE file in the root directory of this source tree.
1715
- *)
1716
- */
1717
243
 
1718
244
  exports.buildSolanaPayUrl = buildSolanaPayUrl;
1719
245
  exports.createPaymentFlow = createPaymentFlow;