@qidcloud/sdk 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2243 @@
1
+ import axios from 'axios';
2
+ import { io } from 'socket.io-client';
3
+
4
+ class AuthModule {
5
+ sdk;
6
+ socket = null;
7
+ constructor(sdk) {
8
+ this.sdk = sdk;
9
+ }
10
+ /**
11
+ * Initialize a new handshake session for QR login
12
+ */
13
+ async createSession() {
14
+ const resp = await this.sdk.api.post('/api/initiate-generic');
15
+ const { sessionId, nonce } = resp.data;
16
+ // Construct QR data
17
+ const qrData = `qid: handshake:${sessionId}:${nonce} `;
18
+ return {
19
+ sessionId,
20
+ qrData,
21
+ expiresAt: Date.now() + 120000 // 2 minutes
22
+ };
23
+ }
24
+ /**
25
+ * Listen for authorization events for a specific session
26
+ */
27
+ listen(sessionId, onAuthorized, onDenied) {
28
+ if (!this.socket) {
29
+ const baseUrl = this.sdk.getConfig().baseUrl || 'https://api.qidcloud.com';
30
+ this.socket = io(baseUrl);
31
+ }
32
+ this.socket.emit('join', sessionId);
33
+ this.socket.on('authenticated', (token) => {
34
+ onAuthorized(token);
35
+ });
36
+ this.socket.on('identity_authorized', (data) => {
37
+ // Some backend routes wrap the token in an object
38
+ const token = typeof data === 'string' ? data : data.token;
39
+ onAuthorized(token);
40
+ });
41
+ this.socket.on('identity_denied', (data) => {
42
+ if (onDenied)
43
+ onDenied(data.message || 'Authorization denied');
44
+ });
45
+ }
46
+ /**
47
+ * Stop listening and disconnect socket
48
+ */
49
+ disconnect() {
50
+ if (this.socket) {
51
+ this.socket.disconnect();
52
+ this.socket = null;
53
+ }
54
+ }
55
+ /**
56
+ * Fetch user profile using a session token
57
+ */
58
+ async getProfile(token) {
59
+ const resp = await this.sdk.api.get('/api/me', {
60
+ headers: {
61
+ 'Authorization': `Bearer ${token}`
62
+ }
63
+ });
64
+ return resp.data;
65
+ }
66
+ }
67
+
68
+ class DbModule {
69
+ sdk;
70
+ constructor(sdk) {
71
+ this.sdk = sdk;
72
+ }
73
+ /**
74
+ * Execute a SQL query against the project's enclave database
75
+ * @param sql The SQL query string
76
+ * @param params Parameterized values for the query
77
+ * @param userToken Optional session token for user-scoped access
78
+ */
79
+ async query(sql, params = [], userToken) {
80
+ const headers = {};
81
+ if (userToken) {
82
+ headers['Authorization'] = `Bearer ${userToken}`;
83
+ }
84
+ const resp = await this.sdk.api.post('/api/db/query', { sql, params }, { headers });
85
+ return resp.data;
86
+ }
87
+ /**
88
+ * Initialize the project's enclave database schema
89
+ * Useful for first-time project setup
90
+ */
91
+ async setup(userToken) {
92
+ const headers = {};
93
+ if (userToken) {
94
+ headers['Authorization'] = `Bearer ${userToken}`;
95
+ }
96
+ const resp = await this.sdk.api.post('/api/db/setup', {}, { headers });
97
+ return resp.data;
98
+ }
99
+ }
100
+
101
+ class EdgeModule {
102
+ sdk;
103
+ constructor(sdk) {
104
+ this.sdk = sdk;
105
+ }
106
+ /**
107
+ * Invoke a serverless edge function
108
+ * @param name Name of the function to invoke
109
+ * @param params Arguments passed to the function
110
+ * @param userToken Optional session token for user-scoped access
111
+ */
112
+ async invoke(name, params = {}, userToken) {
113
+ const headers = {};
114
+ if (userToken) {
115
+ headers['Authorization'] = `Bearer ${userToken}`;
116
+ }
117
+ const resp = await this.sdk.api.post('/api/edge/invoke', { name, params }, { headers });
118
+ return resp.data;
119
+ }
120
+ /**
121
+ * List all functions in the project enclave
122
+ */
123
+ async list() {
124
+ const resp = await this.sdk.api.get('/api/edge/list');
125
+ return resp.data;
126
+ }
127
+ /**
128
+ * Get logs for a specific function
129
+ * @param name Function name
130
+ * @param userToken Optional session token
131
+ */
132
+ async getLogs(name, userToken) {
133
+ const headers = {};
134
+ if (userToken)
135
+ headers['Authorization'] = `Bearer ${userToken}`;
136
+ const resp = await this.sdk.api.get(`/api/edge/${name}/logs`, { headers });
137
+ return resp.data;
138
+ }
139
+ /**
140
+ * Get project-wide enclave logs
141
+ */
142
+ async getProjectLogs(userToken) {
143
+ const headers = {};
144
+ if (userToken)
145
+ headers['Authorization'] = `Bearer ${userToken}`;
146
+ const resp = await this.sdk.api.get('/api/edge/logs/project', { headers });
147
+ return resp.data;
148
+ }
149
+ /**
150
+ * Delete a function from the enclave
151
+ */
152
+ async delete(name, userToken) {
153
+ const headers = {};
154
+ if (userToken)
155
+ headers['Authorization'] = `Bearer ${userToken}`;
156
+ const resp = await this.sdk.api.delete(`/api/edge/${name}`, { headers });
157
+ return resp.data;
158
+ }
159
+ }
160
+
161
+ class VaultModule {
162
+ sdk;
163
+ constructor(sdk) {
164
+ this.sdk = sdk;
165
+ }
166
+ /**
167
+ * Upload a file to the project's secure enclave storage
168
+ * @param file The file data (Buffer or Blob)
169
+ * @param fileName Name of the file
170
+ * @param metadata Optional E2EE metadata or custom tags
171
+ * @param userToken Session token for user-scoped storage
172
+ */
173
+ async upload(file, fileName, metadata = {}, userToken) {
174
+ const formData = new FormData();
175
+ formData.append('file', file, fileName);
176
+ formData.append('metadata', JSON.stringify(metadata));
177
+ const headers = {
178
+ 'Content-Type': 'multipart/form-data'
179
+ };
180
+ if (userToken) {
181
+ headers['Authorization'] = `Bearer ${userToken}`;
182
+ }
183
+ const resp = await this.sdk.api.post('/api/storage/upload', formData, { headers });
184
+ return resp.data;
185
+ }
186
+ /**
187
+ * List files in the project enclave
188
+ * @param userToken Session token for user-scoped storage
189
+ */
190
+ async list(userToken) {
191
+ const headers = {};
192
+ if (userToken) {
193
+ headers['Authorization'] = `Bearer ${userToken}`;
194
+ }
195
+ const resp = await this.sdk.api.get('/api/storage/list', { headers });
196
+ return resp.data;
197
+ }
198
+ /**
199
+ * Download a file from storage
200
+ * @param fileId Unique ID of the file
201
+ * @param userToken Session token for user-scoped storage
202
+ */
203
+ async download(fileId, userToken) {
204
+ const headers = {};
205
+ if (userToken) {
206
+ headers['Authorization'] = `Bearer ${userToken}`;
207
+ }
208
+ const resp = await this.sdk.api.get(`/api/storage/${fileId}`, {
209
+ headers,
210
+ responseType: 'arraybuffer'
211
+ });
212
+ return resp.data;
213
+ }
214
+ /**
215
+ * Delete a file from storage
216
+ * @param fileId Unique ID of the file
217
+ * @param userToken Session token for user-scoped storage
218
+ */
219
+ async delete(fileId, userToken) {
220
+ const headers = {};
221
+ if (userToken) {
222
+ headers['Authorization'] = `Bearer ${userToken}`;
223
+ }
224
+ const resp = await this.sdk.api.delete(`/api/storage/${fileId}`, { headers });
225
+ return resp.data;
226
+ }
227
+ }
228
+
229
+ class LogsModule {
230
+ sdk;
231
+ constructor(sdk) {
232
+ this.sdk = sdk;
233
+ }
234
+ /**
235
+ * Write a custom application log to the project enclave
236
+ * @param message The log message
237
+ * @param source The source of the log (e.g. 'auth-service', 'frontend')
238
+ * @param level Log level (info, warn, error)
239
+ * @param metadata Structured data for searching/filtering
240
+ */
241
+ async write(message, source = 'app', level = 'info', metadata = {}) {
242
+ const resp = await this.sdk.api.post('/api/logs', { message, source, level, metadata });
243
+ return resp.data;
244
+ }
245
+ /**
246
+ * Retrieve application logs for the project
247
+ * @param query Filters (limit, level, etc.)
248
+ */
249
+ async fetch(query = {}) {
250
+ const resp = await this.sdk.api.get('/api/logs', { params: query });
251
+ return resp.data;
252
+ }
253
+ }
254
+
255
+ function getDefaultExportFromCjs (x) {
256
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
257
+ }
258
+
259
+ var react = {exports: {}};
260
+
261
+ var react_production = {};
262
+
263
+ /**
264
+ * @license React
265
+ * react.production.js
266
+ *
267
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
268
+ *
269
+ * This source code is licensed under the MIT license found in the
270
+ * LICENSE file in the root directory of this source tree.
271
+ */
272
+
273
+ var hasRequiredReact_production;
274
+
275
+ function requireReact_production () {
276
+ if (hasRequiredReact_production) return react_production;
277
+ hasRequiredReact_production = 1;
278
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
279
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
280
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
281
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
282
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
283
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
284
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
285
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
286
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
287
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
288
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
289
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
290
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
291
+ function getIteratorFn(maybeIterable) {
292
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
293
+ maybeIterable =
294
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
295
+ maybeIterable["@@iterator"];
296
+ return "function" === typeof maybeIterable ? maybeIterable : null;
297
+ }
298
+ var ReactNoopUpdateQueue = {
299
+ isMounted: function () {
300
+ return false;
301
+ },
302
+ enqueueForceUpdate: function () {},
303
+ enqueueReplaceState: function () {},
304
+ enqueueSetState: function () {}
305
+ },
306
+ assign = Object.assign,
307
+ emptyObject = {};
308
+ function Component(props, context, updater) {
309
+ this.props = props;
310
+ this.context = context;
311
+ this.refs = emptyObject;
312
+ this.updater = updater || ReactNoopUpdateQueue;
313
+ }
314
+ Component.prototype.isReactComponent = {};
315
+ Component.prototype.setState = function (partialState, callback) {
316
+ if (
317
+ "object" !== typeof partialState &&
318
+ "function" !== typeof partialState &&
319
+ null != partialState
320
+ )
321
+ throw Error(
322
+ "takes an object of state variables to update or a function which returns an object of state variables."
323
+ );
324
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
325
+ };
326
+ Component.prototype.forceUpdate = function (callback) {
327
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
328
+ };
329
+ function ComponentDummy() {}
330
+ ComponentDummy.prototype = Component.prototype;
331
+ function PureComponent(props, context, updater) {
332
+ this.props = props;
333
+ this.context = context;
334
+ this.refs = emptyObject;
335
+ this.updater = updater || ReactNoopUpdateQueue;
336
+ }
337
+ var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
338
+ pureComponentPrototype.constructor = PureComponent;
339
+ assign(pureComponentPrototype, Component.prototype);
340
+ pureComponentPrototype.isPureReactComponent = true;
341
+ var isArrayImpl = Array.isArray;
342
+ function noop() {}
343
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null },
344
+ hasOwnProperty = Object.prototype.hasOwnProperty;
345
+ function ReactElement(type, key, props) {
346
+ var refProp = props.ref;
347
+ return {
348
+ $$typeof: REACT_ELEMENT_TYPE,
349
+ type: type,
350
+ key: key,
351
+ ref: void 0 !== refProp ? refProp : null,
352
+ props: props
353
+ };
354
+ }
355
+ function cloneAndReplaceKey(oldElement, newKey) {
356
+ return ReactElement(oldElement.type, newKey, oldElement.props);
357
+ }
358
+ function isValidElement(object) {
359
+ return (
360
+ "object" === typeof object &&
361
+ null !== object &&
362
+ object.$$typeof === REACT_ELEMENT_TYPE
363
+ );
364
+ }
365
+ function escape(key) {
366
+ var escaperLookup = { "=": "=0", ":": "=2" };
367
+ return (
368
+ "$" +
369
+ key.replace(/[=:]/g, function (match) {
370
+ return escaperLookup[match];
371
+ })
372
+ );
373
+ }
374
+ var userProvidedKeyEscapeRegex = /\/+/g;
375
+ function getElementKey(element, index) {
376
+ return "object" === typeof element && null !== element && null != element.key
377
+ ? escape("" + element.key)
378
+ : index.toString(36);
379
+ }
380
+ function resolveThenable(thenable) {
381
+ switch (thenable.status) {
382
+ case "fulfilled":
383
+ return thenable.value;
384
+ case "rejected":
385
+ throw thenable.reason;
386
+ default:
387
+ switch (
388
+ ("string" === typeof thenable.status
389
+ ? thenable.then(noop, noop)
390
+ : ((thenable.status = "pending"),
391
+ thenable.then(
392
+ function (fulfilledValue) {
393
+ "pending" === thenable.status &&
394
+ ((thenable.status = "fulfilled"),
395
+ (thenable.value = fulfilledValue));
396
+ },
397
+ function (error) {
398
+ "pending" === thenable.status &&
399
+ ((thenable.status = "rejected"), (thenable.reason = error));
400
+ }
401
+ )),
402
+ thenable.status)
403
+ ) {
404
+ case "fulfilled":
405
+ return thenable.value;
406
+ case "rejected":
407
+ throw thenable.reason;
408
+ }
409
+ }
410
+ throw thenable;
411
+ }
412
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
413
+ var type = typeof children;
414
+ if ("undefined" === type || "boolean" === type) children = null;
415
+ var invokeCallback = false;
416
+ if (null === children) invokeCallback = true;
417
+ else
418
+ switch (type) {
419
+ case "bigint":
420
+ case "string":
421
+ case "number":
422
+ invokeCallback = true;
423
+ break;
424
+ case "object":
425
+ switch (children.$$typeof) {
426
+ case REACT_ELEMENT_TYPE:
427
+ case REACT_PORTAL_TYPE:
428
+ invokeCallback = true;
429
+ break;
430
+ case REACT_LAZY_TYPE:
431
+ return (
432
+ (invokeCallback = children._init),
433
+ mapIntoArray(
434
+ invokeCallback(children._payload),
435
+ array,
436
+ escapedPrefix,
437
+ nameSoFar,
438
+ callback
439
+ )
440
+ );
441
+ }
442
+ }
443
+ if (invokeCallback)
444
+ return (
445
+ (callback = callback(children)),
446
+ (invokeCallback =
447
+ "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
448
+ isArrayImpl(callback)
449
+ ? ((escapedPrefix = ""),
450
+ null != invokeCallback &&
451
+ (escapedPrefix =
452
+ invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
453
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
454
+ return c;
455
+ }))
456
+ : null != callback &&
457
+ (isValidElement(callback) &&
458
+ (callback = cloneAndReplaceKey(
459
+ callback,
460
+ escapedPrefix +
461
+ (null == callback.key ||
462
+ (children && children.key === callback.key)
463
+ ? ""
464
+ : ("" + callback.key).replace(
465
+ userProvidedKeyEscapeRegex,
466
+ "$&/"
467
+ ) + "/") +
468
+ invokeCallback
469
+ )),
470
+ array.push(callback)),
471
+ 1
472
+ );
473
+ invokeCallback = 0;
474
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
475
+ if (isArrayImpl(children))
476
+ for (var i = 0; i < children.length; i++)
477
+ (nameSoFar = children[i]),
478
+ (type = nextNamePrefix + getElementKey(nameSoFar, i)),
479
+ (invokeCallback += mapIntoArray(
480
+ nameSoFar,
481
+ array,
482
+ escapedPrefix,
483
+ type,
484
+ callback
485
+ ));
486
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
487
+ for (
488
+ children = i.call(children), i = 0;
489
+ !(nameSoFar = children.next()).done;
490
+
491
+ )
492
+ (nameSoFar = nameSoFar.value),
493
+ (type = nextNamePrefix + getElementKey(nameSoFar, i++)),
494
+ (invokeCallback += mapIntoArray(
495
+ nameSoFar,
496
+ array,
497
+ escapedPrefix,
498
+ type,
499
+ callback
500
+ ));
501
+ else if ("object" === type) {
502
+ if ("function" === typeof children.then)
503
+ return mapIntoArray(
504
+ resolveThenable(children),
505
+ array,
506
+ escapedPrefix,
507
+ nameSoFar,
508
+ callback
509
+ );
510
+ array = String(children);
511
+ throw Error(
512
+ "Objects are not valid as a React child (found: " +
513
+ ("[object Object]" === array
514
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
515
+ : array) +
516
+ "). If you meant to render a collection of children, use an array instead."
517
+ );
518
+ }
519
+ return invokeCallback;
520
+ }
521
+ function mapChildren(children, func, context) {
522
+ if (null == children) return children;
523
+ var result = [],
524
+ count = 0;
525
+ mapIntoArray(children, result, "", "", function (child) {
526
+ return func.call(context, child, count++);
527
+ });
528
+ return result;
529
+ }
530
+ function lazyInitializer(payload) {
531
+ if (-1 === payload._status) {
532
+ var ctor = payload._result;
533
+ ctor = ctor();
534
+ ctor.then(
535
+ function (moduleObject) {
536
+ if (0 === payload._status || -1 === payload._status)
537
+ (payload._status = 1), (payload._result = moduleObject);
538
+ },
539
+ function (error) {
540
+ if (0 === payload._status || -1 === payload._status)
541
+ (payload._status = 2), (payload._result = error);
542
+ }
543
+ );
544
+ -1 === payload._status && ((payload._status = 0), (payload._result = ctor));
545
+ }
546
+ if (1 === payload._status) return payload._result.default;
547
+ throw payload._result;
548
+ }
549
+ var reportGlobalError =
550
+ "function" === typeof reportError
551
+ ? reportError
552
+ : function (error) {
553
+ if (
554
+ "object" === typeof window &&
555
+ "function" === typeof window.ErrorEvent
556
+ ) {
557
+ var event = new window.ErrorEvent("error", {
558
+ bubbles: true,
559
+ cancelable: true,
560
+ message:
561
+ "object" === typeof error &&
562
+ null !== error &&
563
+ "string" === typeof error.message
564
+ ? String(error.message)
565
+ : String(error),
566
+ error: error
567
+ });
568
+ if (!window.dispatchEvent(event)) return;
569
+ } else if (
570
+ "object" === typeof process &&
571
+ "function" === typeof process.emit
572
+ ) {
573
+ process.emit("uncaughtException", error);
574
+ return;
575
+ }
576
+ console.error(error);
577
+ },
578
+ Children = {
579
+ map: mapChildren,
580
+ forEach: function (children, forEachFunc, forEachContext) {
581
+ mapChildren(
582
+ children,
583
+ function () {
584
+ forEachFunc.apply(this, arguments);
585
+ },
586
+ forEachContext
587
+ );
588
+ },
589
+ count: function (children) {
590
+ var n = 0;
591
+ mapChildren(children, function () {
592
+ n++;
593
+ });
594
+ return n;
595
+ },
596
+ toArray: function (children) {
597
+ return (
598
+ mapChildren(children, function (child) {
599
+ return child;
600
+ }) || []
601
+ );
602
+ },
603
+ only: function (children) {
604
+ if (!isValidElement(children))
605
+ throw Error(
606
+ "React.Children.only expected to receive a single React element child."
607
+ );
608
+ return children;
609
+ }
610
+ };
611
+ react_production.Activity = REACT_ACTIVITY_TYPE;
612
+ react_production.Children = Children;
613
+ react_production.Component = Component;
614
+ react_production.Fragment = REACT_FRAGMENT_TYPE;
615
+ react_production.Profiler = REACT_PROFILER_TYPE;
616
+ react_production.PureComponent = PureComponent;
617
+ react_production.StrictMode = REACT_STRICT_MODE_TYPE;
618
+ react_production.Suspense = REACT_SUSPENSE_TYPE;
619
+ react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
620
+ ReactSharedInternals;
621
+ react_production.__COMPILER_RUNTIME = {
622
+ __proto__: null,
623
+ c: function (size) {
624
+ return ReactSharedInternals.H.useMemoCache(size);
625
+ }
626
+ };
627
+ react_production.cache = function (fn) {
628
+ return function () {
629
+ return fn.apply(null, arguments);
630
+ };
631
+ };
632
+ react_production.cacheSignal = function () {
633
+ return null;
634
+ };
635
+ react_production.cloneElement = function (element, config, children) {
636
+ if (null === element || void 0 === element)
637
+ throw Error(
638
+ "The argument must be a React element, but you passed " + element + "."
639
+ );
640
+ var props = assign({}, element.props),
641
+ key = element.key;
642
+ if (null != config)
643
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
644
+ !hasOwnProperty.call(config, propName) ||
645
+ "key" === propName ||
646
+ "__self" === propName ||
647
+ "__source" === propName ||
648
+ ("ref" === propName && void 0 === config.ref) ||
649
+ (props[propName] = config[propName]);
650
+ var propName = arguments.length - 2;
651
+ if (1 === propName) props.children = children;
652
+ else if (1 < propName) {
653
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
654
+ childArray[i] = arguments[i + 2];
655
+ props.children = childArray;
656
+ }
657
+ return ReactElement(element.type, key, props);
658
+ };
659
+ react_production.createContext = function (defaultValue) {
660
+ defaultValue = {
661
+ $$typeof: REACT_CONTEXT_TYPE,
662
+ _currentValue: defaultValue,
663
+ _currentValue2: defaultValue,
664
+ _threadCount: 0,
665
+ Provider: null,
666
+ Consumer: null
667
+ };
668
+ defaultValue.Provider = defaultValue;
669
+ defaultValue.Consumer = {
670
+ $$typeof: REACT_CONSUMER_TYPE,
671
+ _context: defaultValue
672
+ };
673
+ return defaultValue;
674
+ };
675
+ react_production.createElement = function (type, config, children) {
676
+ var propName,
677
+ props = {},
678
+ key = null;
679
+ if (null != config)
680
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
681
+ hasOwnProperty.call(config, propName) &&
682
+ "key" !== propName &&
683
+ "__self" !== propName &&
684
+ "__source" !== propName &&
685
+ (props[propName] = config[propName]);
686
+ var childrenLength = arguments.length - 2;
687
+ if (1 === childrenLength) props.children = children;
688
+ else if (1 < childrenLength) {
689
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
690
+ childArray[i] = arguments[i + 2];
691
+ props.children = childArray;
692
+ }
693
+ if (type && type.defaultProps)
694
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
695
+ void 0 === props[propName] &&
696
+ (props[propName] = childrenLength[propName]);
697
+ return ReactElement(type, key, props);
698
+ };
699
+ react_production.createRef = function () {
700
+ return { current: null };
701
+ };
702
+ react_production.forwardRef = function (render) {
703
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
704
+ };
705
+ react_production.isValidElement = isValidElement;
706
+ react_production.lazy = function (ctor) {
707
+ return {
708
+ $$typeof: REACT_LAZY_TYPE,
709
+ _payload: { _status: -1, _result: ctor },
710
+ _init: lazyInitializer
711
+ };
712
+ };
713
+ react_production.memo = function (type, compare) {
714
+ return {
715
+ $$typeof: REACT_MEMO_TYPE,
716
+ type: type,
717
+ compare: void 0 === compare ? null : compare
718
+ };
719
+ };
720
+ react_production.startTransition = function (scope) {
721
+ var prevTransition = ReactSharedInternals.T,
722
+ currentTransition = {};
723
+ ReactSharedInternals.T = currentTransition;
724
+ try {
725
+ var returnValue = scope(),
726
+ onStartTransitionFinish = ReactSharedInternals.S;
727
+ null !== onStartTransitionFinish &&
728
+ onStartTransitionFinish(currentTransition, returnValue);
729
+ "object" === typeof returnValue &&
730
+ null !== returnValue &&
731
+ "function" === typeof returnValue.then &&
732
+ returnValue.then(noop, reportGlobalError);
733
+ } catch (error) {
734
+ reportGlobalError(error);
735
+ } finally {
736
+ null !== prevTransition &&
737
+ null !== currentTransition.types &&
738
+ (prevTransition.types = currentTransition.types),
739
+ (ReactSharedInternals.T = prevTransition);
740
+ }
741
+ };
742
+ react_production.unstable_useCacheRefresh = function () {
743
+ return ReactSharedInternals.H.useCacheRefresh();
744
+ };
745
+ react_production.use = function (usable) {
746
+ return ReactSharedInternals.H.use(usable);
747
+ };
748
+ react_production.useActionState = function (action, initialState, permalink) {
749
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
750
+ };
751
+ react_production.useCallback = function (callback, deps) {
752
+ return ReactSharedInternals.H.useCallback(callback, deps);
753
+ };
754
+ react_production.useContext = function (Context) {
755
+ return ReactSharedInternals.H.useContext(Context);
756
+ };
757
+ react_production.useDebugValue = function () {};
758
+ react_production.useDeferredValue = function (value, initialValue) {
759
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
760
+ };
761
+ react_production.useEffect = function (create, deps) {
762
+ return ReactSharedInternals.H.useEffect(create, deps);
763
+ };
764
+ react_production.useEffectEvent = function (callback) {
765
+ return ReactSharedInternals.H.useEffectEvent(callback);
766
+ };
767
+ react_production.useId = function () {
768
+ return ReactSharedInternals.H.useId();
769
+ };
770
+ react_production.useImperativeHandle = function (ref, create, deps) {
771
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
772
+ };
773
+ react_production.useInsertionEffect = function (create, deps) {
774
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
775
+ };
776
+ react_production.useLayoutEffect = function (create, deps) {
777
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
778
+ };
779
+ react_production.useMemo = function (create, deps) {
780
+ return ReactSharedInternals.H.useMemo(create, deps);
781
+ };
782
+ react_production.useOptimistic = function (passthrough, reducer) {
783
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
784
+ };
785
+ react_production.useReducer = function (reducer, initialArg, init) {
786
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
787
+ };
788
+ react_production.useRef = function (initialValue) {
789
+ return ReactSharedInternals.H.useRef(initialValue);
790
+ };
791
+ react_production.useState = function (initialState) {
792
+ return ReactSharedInternals.H.useState(initialState);
793
+ };
794
+ react_production.useSyncExternalStore = function (
795
+ subscribe,
796
+ getSnapshot,
797
+ getServerSnapshot
798
+ ) {
799
+ return ReactSharedInternals.H.useSyncExternalStore(
800
+ subscribe,
801
+ getSnapshot,
802
+ getServerSnapshot
803
+ );
804
+ };
805
+ react_production.useTransition = function () {
806
+ return ReactSharedInternals.H.useTransition();
807
+ };
808
+ react_production.version = "19.2.4";
809
+ return react_production;
810
+ }
811
+
812
+ var react_development = {exports: {}};
813
+
814
+ /**
815
+ * @license React
816
+ * react.development.js
817
+ *
818
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
819
+ *
820
+ * This source code is licensed under the MIT license found in the
821
+ * LICENSE file in the root directory of this source tree.
822
+ */
823
+ react_development.exports;
824
+
825
+ var hasRequiredReact_development;
826
+
827
+ function requireReact_development () {
828
+ if (hasRequiredReact_development) return react_development.exports;
829
+ hasRequiredReact_development = 1;
830
+ (function (module, exports$1) {
831
+ "production" !== process.env.NODE_ENV &&
832
+ (function () {
833
+ function defineDeprecationWarning(methodName, info) {
834
+ Object.defineProperty(Component.prototype, methodName, {
835
+ get: function () {
836
+ console.warn(
837
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
838
+ info[0],
839
+ info[1]
840
+ );
841
+ }
842
+ });
843
+ }
844
+ function getIteratorFn(maybeIterable) {
845
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
846
+ return null;
847
+ maybeIterable =
848
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
849
+ maybeIterable["@@iterator"];
850
+ return "function" === typeof maybeIterable ? maybeIterable : null;
851
+ }
852
+ function warnNoop(publicInstance, callerName) {
853
+ publicInstance =
854
+ ((publicInstance = publicInstance.constructor) &&
855
+ (publicInstance.displayName || publicInstance.name)) ||
856
+ "ReactClass";
857
+ var warningKey = publicInstance + "." + callerName;
858
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
859
+ (console.error(
860
+ "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.",
861
+ callerName,
862
+ publicInstance
863
+ ),
864
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = true));
865
+ }
866
+ function Component(props, context, updater) {
867
+ this.props = props;
868
+ this.context = context;
869
+ this.refs = emptyObject;
870
+ this.updater = updater || ReactNoopUpdateQueue;
871
+ }
872
+ function ComponentDummy() {}
873
+ function PureComponent(props, context, updater) {
874
+ this.props = props;
875
+ this.context = context;
876
+ this.refs = emptyObject;
877
+ this.updater = updater || ReactNoopUpdateQueue;
878
+ }
879
+ function noop() {}
880
+ function testStringCoercion(value) {
881
+ return "" + value;
882
+ }
883
+ function checkKeyStringCoercion(value) {
884
+ try {
885
+ testStringCoercion(value);
886
+ var JSCompiler_inline_result = !1;
887
+ } catch (e) {
888
+ JSCompiler_inline_result = true;
889
+ }
890
+ if (JSCompiler_inline_result) {
891
+ JSCompiler_inline_result = console;
892
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
893
+ var JSCompiler_inline_result$jscomp$0 =
894
+ ("function" === typeof Symbol &&
895
+ Symbol.toStringTag &&
896
+ value[Symbol.toStringTag]) ||
897
+ value.constructor.name ||
898
+ "Object";
899
+ JSCompiler_temp_const.call(
900
+ JSCompiler_inline_result,
901
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
902
+ JSCompiler_inline_result$jscomp$0
903
+ );
904
+ return testStringCoercion(value);
905
+ }
906
+ }
907
+ function getComponentNameFromType(type) {
908
+ if (null == type) return null;
909
+ if ("function" === typeof type)
910
+ return type.$$typeof === REACT_CLIENT_REFERENCE
911
+ ? null
912
+ : type.displayName || type.name || null;
913
+ if ("string" === typeof type) return type;
914
+ switch (type) {
915
+ case REACT_FRAGMENT_TYPE:
916
+ return "Fragment";
917
+ case REACT_PROFILER_TYPE:
918
+ return "Profiler";
919
+ case REACT_STRICT_MODE_TYPE:
920
+ return "StrictMode";
921
+ case REACT_SUSPENSE_TYPE:
922
+ return "Suspense";
923
+ case REACT_SUSPENSE_LIST_TYPE:
924
+ return "SuspenseList";
925
+ case REACT_ACTIVITY_TYPE:
926
+ return "Activity";
927
+ }
928
+ if ("object" === typeof type)
929
+ switch (
930
+ ("number" === typeof type.tag &&
931
+ console.error(
932
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
933
+ ),
934
+ type.$$typeof)
935
+ ) {
936
+ case REACT_PORTAL_TYPE:
937
+ return "Portal";
938
+ case REACT_CONTEXT_TYPE:
939
+ return type.displayName || "Context";
940
+ case REACT_CONSUMER_TYPE:
941
+ return (type._context.displayName || "Context") + ".Consumer";
942
+ case REACT_FORWARD_REF_TYPE:
943
+ var innerType = type.render;
944
+ type = type.displayName;
945
+ type ||
946
+ ((type = innerType.displayName || innerType.name || ""),
947
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
948
+ return type;
949
+ case REACT_MEMO_TYPE:
950
+ return (
951
+ (innerType = type.displayName || null),
952
+ null !== innerType
953
+ ? innerType
954
+ : getComponentNameFromType(type.type) || "Memo"
955
+ );
956
+ case REACT_LAZY_TYPE:
957
+ innerType = type._payload;
958
+ type = type._init;
959
+ try {
960
+ return getComponentNameFromType(type(innerType));
961
+ } catch (x) {}
962
+ }
963
+ return null;
964
+ }
965
+ function getTaskName(type) {
966
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
967
+ if (
968
+ "object" === typeof type &&
969
+ null !== type &&
970
+ type.$$typeof === REACT_LAZY_TYPE
971
+ )
972
+ return "<...>";
973
+ try {
974
+ var name = getComponentNameFromType(type);
975
+ return name ? "<" + name + ">" : "<...>";
976
+ } catch (x) {
977
+ return "<...>";
978
+ }
979
+ }
980
+ function getOwner() {
981
+ var dispatcher = ReactSharedInternals.A;
982
+ return null === dispatcher ? null : dispatcher.getOwner();
983
+ }
984
+ function UnknownOwner() {
985
+ return Error("react-stack-top-frame");
986
+ }
987
+ function hasValidKey(config) {
988
+ if (hasOwnProperty.call(config, "key")) {
989
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
990
+ if (getter && getter.isReactWarning) return false;
991
+ }
992
+ return void 0 !== config.key;
993
+ }
994
+ function defineKeyPropWarningGetter(props, displayName) {
995
+ function warnAboutAccessingKey() {
996
+ specialPropKeyWarningShown ||
997
+ ((specialPropKeyWarningShown = true),
998
+ console.error(
999
+ "%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)",
1000
+ displayName
1001
+ ));
1002
+ }
1003
+ warnAboutAccessingKey.isReactWarning = true;
1004
+ Object.defineProperty(props, "key", {
1005
+ get: warnAboutAccessingKey,
1006
+ configurable: true
1007
+ });
1008
+ }
1009
+ function elementRefGetterWithDeprecationWarning() {
1010
+ var componentName = getComponentNameFromType(this.type);
1011
+ didWarnAboutElementRef[componentName] ||
1012
+ ((didWarnAboutElementRef[componentName] = true),
1013
+ console.error(
1014
+ "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."
1015
+ ));
1016
+ componentName = this.props.ref;
1017
+ return void 0 !== componentName ? componentName : null;
1018
+ }
1019
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
1020
+ var refProp = props.ref;
1021
+ type = {
1022
+ $$typeof: REACT_ELEMENT_TYPE,
1023
+ type: type,
1024
+ key: key,
1025
+ props: props,
1026
+ _owner: owner
1027
+ };
1028
+ null !== (void 0 !== refProp ? refProp : null)
1029
+ ? Object.defineProperty(type, "ref", {
1030
+ enumerable: false,
1031
+ get: elementRefGetterWithDeprecationWarning
1032
+ })
1033
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
1034
+ type._store = {};
1035
+ Object.defineProperty(type._store, "validated", {
1036
+ configurable: false,
1037
+ enumerable: false,
1038
+ writable: true,
1039
+ value: 0
1040
+ });
1041
+ Object.defineProperty(type, "_debugInfo", {
1042
+ configurable: false,
1043
+ enumerable: false,
1044
+ writable: true,
1045
+ value: null
1046
+ });
1047
+ Object.defineProperty(type, "_debugStack", {
1048
+ configurable: false,
1049
+ enumerable: false,
1050
+ writable: true,
1051
+ value: debugStack
1052
+ });
1053
+ Object.defineProperty(type, "_debugTask", {
1054
+ configurable: false,
1055
+ enumerable: false,
1056
+ writable: true,
1057
+ value: debugTask
1058
+ });
1059
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
1060
+ return type;
1061
+ }
1062
+ function cloneAndReplaceKey(oldElement, newKey) {
1063
+ newKey = ReactElement(
1064
+ oldElement.type,
1065
+ newKey,
1066
+ oldElement.props,
1067
+ oldElement._owner,
1068
+ oldElement._debugStack,
1069
+ oldElement._debugTask
1070
+ );
1071
+ oldElement._store &&
1072
+ (newKey._store.validated = oldElement._store.validated);
1073
+ return newKey;
1074
+ }
1075
+ function validateChildKeys(node) {
1076
+ isValidElement(node)
1077
+ ? node._store && (node._store.validated = 1)
1078
+ : "object" === typeof node &&
1079
+ null !== node &&
1080
+ node.$$typeof === REACT_LAZY_TYPE &&
1081
+ ("fulfilled" === node._payload.status
1082
+ ? isValidElement(node._payload.value) &&
1083
+ node._payload.value._store &&
1084
+ (node._payload.value._store.validated = 1)
1085
+ : node._store && (node._store.validated = 1));
1086
+ }
1087
+ function isValidElement(object) {
1088
+ return (
1089
+ "object" === typeof object &&
1090
+ null !== object &&
1091
+ object.$$typeof === REACT_ELEMENT_TYPE
1092
+ );
1093
+ }
1094
+ function escape(key) {
1095
+ var escaperLookup = { "=": "=0", ":": "=2" };
1096
+ return (
1097
+ "$" +
1098
+ key.replace(/[=:]/g, function (match) {
1099
+ return escaperLookup[match];
1100
+ })
1101
+ );
1102
+ }
1103
+ function getElementKey(element, index) {
1104
+ return "object" === typeof element &&
1105
+ null !== element &&
1106
+ null != element.key
1107
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
1108
+ : index.toString(36);
1109
+ }
1110
+ function resolveThenable(thenable) {
1111
+ switch (thenable.status) {
1112
+ case "fulfilled":
1113
+ return thenable.value;
1114
+ case "rejected":
1115
+ throw thenable.reason;
1116
+ default:
1117
+ switch (
1118
+ ("string" === typeof thenable.status
1119
+ ? thenable.then(noop, noop)
1120
+ : ((thenable.status = "pending"),
1121
+ thenable.then(
1122
+ function (fulfilledValue) {
1123
+ "pending" === thenable.status &&
1124
+ ((thenable.status = "fulfilled"),
1125
+ (thenable.value = fulfilledValue));
1126
+ },
1127
+ function (error) {
1128
+ "pending" === thenable.status &&
1129
+ ((thenable.status = "rejected"),
1130
+ (thenable.reason = error));
1131
+ }
1132
+ )),
1133
+ thenable.status)
1134
+ ) {
1135
+ case "fulfilled":
1136
+ return thenable.value;
1137
+ case "rejected":
1138
+ throw thenable.reason;
1139
+ }
1140
+ }
1141
+ throw thenable;
1142
+ }
1143
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1144
+ var type = typeof children;
1145
+ if ("undefined" === type || "boolean" === type) children = null;
1146
+ var invokeCallback = false;
1147
+ if (null === children) invokeCallback = true;
1148
+ else
1149
+ switch (type) {
1150
+ case "bigint":
1151
+ case "string":
1152
+ case "number":
1153
+ invokeCallback = true;
1154
+ break;
1155
+ case "object":
1156
+ switch (children.$$typeof) {
1157
+ case REACT_ELEMENT_TYPE:
1158
+ case REACT_PORTAL_TYPE:
1159
+ invokeCallback = true;
1160
+ break;
1161
+ case REACT_LAZY_TYPE:
1162
+ return (
1163
+ (invokeCallback = children._init),
1164
+ mapIntoArray(
1165
+ invokeCallback(children._payload),
1166
+ array,
1167
+ escapedPrefix,
1168
+ nameSoFar,
1169
+ callback
1170
+ )
1171
+ );
1172
+ }
1173
+ }
1174
+ if (invokeCallback) {
1175
+ invokeCallback = children;
1176
+ callback = callback(invokeCallback);
1177
+ var childKey =
1178
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
1179
+ isArrayImpl(callback)
1180
+ ? ((escapedPrefix = ""),
1181
+ null != childKey &&
1182
+ (escapedPrefix =
1183
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
1184
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
1185
+ return c;
1186
+ }))
1187
+ : null != callback &&
1188
+ (isValidElement(callback) &&
1189
+ (null != callback.key &&
1190
+ ((invokeCallback && invokeCallback.key === callback.key) ||
1191
+ checkKeyStringCoercion(callback.key)),
1192
+ (escapedPrefix = cloneAndReplaceKey(
1193
+ callback,
1194
+ escapedPrefix +
1195
+ (null == callback.key ||
1196
+ (invokeCallback && invokeCallback.key === callback.key)
1197
+ ? ""
1198
+ : ("" + callback.key).replace(
1199
+ userProvidedKeyEscapeRegex,
1200
+ "$&/"
1201
+ ) + "/") +
1202
+ childKey
1203
+ )),
1204
+ "" !== nameSoFar &&
1205
+ null != invokeCallback &&
1206
+ isValidElement(invokeCallback) &&
1207
+ null == invokeCallback.key &&
1208
+ invokeCallback._store &&
1209
+ !invokeCallback._store.validated &&
1210
+ (escapedPrefix._store.validated = 2),
1211
+ (callback = escapedPrefix)),
1212
+ array.push(callback));
1213
+ return 1;
1214
+ }
1215
+ invokeCallback = 0;
1216
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
1217
+ if (isArrayImpl(children))
1218
+ for (var i = 0; i < children.length; i++)
1219
+ (nameSoFar = children[i]),
1220
+ (type = childKey + getElementKey(nameSoFar, i)),
1221
+ (invokeCallback += mapIntoArray(
1222
+ nameSoFar,
1223
+ array,
1224
+ escapedPrefix,
1225
+ type,
1226
+ callback
1227
+ ));
1228
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
1229
+ for (
1230
+ i === children.entries &&
1231
+ (didWarnAboutMaps ||
1232
+ console.warn(
1233
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
1234
+ ),
1235
+ (didWarnAboutMaps = true)),
1236
+ children = i.call(children),
1237
+ i = 0;
1238
+ !(nameSoFar = children.next()).done;
1239
+
1240
+ )
1241
+ (nameSoFar = nameSoFar.value),
1242
+ (type = childKey + getElementKey(nameSoFar, i++)),
1243
+ (invokeCallback += mapIntoArray(
1244
+ nameSoFar,
1245
+ array,
1246
+ escapedPrefix,
1247
+ type,
1248
+ callback
1249
+ ));
1250
+ else if ("object" === type) {
1251
+ if ("function" === typeof children.then)
1252
+ return mapIntoArray(
1253
+ resolveThenable(children),
1254
+ array,
1255
+ escapedPrefix,
1256
+ nameSoFar,
1257
+ callback
1258
+ );
1259
+ array = String(children);
1260
+ throw Error(
1261
+ "Objects are not valid as a React child (found: " +
1262
+ ("[object Object]" === array
1263
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
1264
+ : array) +
1265
+ "). If you meant to render a collection of children, use an array instead."
1266
+ );
1267
+ }
1268
+ return invokeCallback;
1269
+ }
1270
+ function mapChildren(children, func, context) {
1271
+ if (null == children) return children;
1272
+ var result = [],
1273
+ count = 0;
1274
+ mapIntoArray(children, result, "", "", function (child) {
1275
+ return func.call(context, child, count++);
1276
+ });
1277
+ return result;
1278
+ }
1279
+ function lazyInitializer(payload) {
1280
+ if (-1 === payload._status) {
1281
+ var ioInfo = payload._ioInfo;
1282
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
1283
+ ioInfo = payload._result;
1284
+ var thenable = ioInfo();
1285
+ thenable.then(
1286
+ function (moduleObject) {
1287
+ if (0 === payload._status || -1 === payload._status) {
1288
+ payload._status = 1;
1289
+ payload._result = moduleObject;
1290
+ var _ioInfo = payload._ioInfo;
1291
+ null != _ioInfo && (_ioInfo.end = performance.now());
1292
+ void 0 === thenable.status &&
1293
+ ((thenable.status = "fulfilled"),
1294
+ (thenable.value = moduleObject));
1295
+ }
1296
+ },
1297
+ function (error) {
1298
+ if (0 === payload._status || -1 === payload._status) {
1299
+ payload._status = 2;
1300
+ payload._result = error;
1301
+ var _ioInfo2 = payload._ioInfo;
1302
+ null != _ioInfo2 && (_ioInfo2.end = performance.now());
1303
+ void 0 === thenable.status &&
1304
+ ((thenable.status = "rejected"), (thenable.reason = error));
1305
+ }
1306
+ }
1307
+ );
1308
+ ioInfo = payload._ioInfo;
1309
+ if (null != ioInfo) {
1310
+ ioInfo.value = thenable;
1311
+ var displayName = thenable.displayName;
1312
+ "string" === typeof displayName && (ioInfo.name = displayName);
1313
+ }
1314
+ -1 === payload._status &&
1315
+ ((payload._status = 0), (payload._result = thenable));
1316
+ }
1317
+ if (1 === payload._status)
1318
+ return (
1319
+ (ioInfo = payload._result),
1320
+ void 0 === ioInfo &&
1321
+ console.error(
1322
+ "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?",
1323
+ ioInfo
1324
+ ),
1325
+ "default" in ioInfo ||
1326
+ console.error(
1327
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
1328
+ ioInfo
1329
+ ),
1330
+ ioInfo.default
1331
+ );
1332
+ throw payload._result;
1333
+ }
1334
+ function resolveDispatcher() {
1335
+ var dispatcher = ReactSharedInternals.H;
1336
+ null === dispatcher &&
1337
+ console.error(
1338
+ "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."
1339
+ );
1340
+ return dispatcher;
1341
+ }
1342
+ function releaseAsyncTransition() {
1343
+ ReactSharedInternals.asyncTransitions--;
1344
+ }
1345
+ function enqueueTask(task) {
1346
+ if (null === enqueueTaskImpl)
1347
+ try {
1348
+ var requireString = ("require" + Math.random()).slice(0, 7);
1349
+ enqueueTaskImpl = (module && module[requireString]).call(
1350
+ module,
1351
+ "timers"
1352
+ ).setImmediate;
1353
+ } catch (_err) {
1354
+ enqueueTaskImpl = function (callback) {
1355
+ false === didWarnAboutMessageChannel &&
1356
+ ((didWarnAboutMessageChannel = true),
1357
+ "undefined" === typeof MessageChannel &&
1358
+ console.error(
1359
+ "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."
1360
+ ));
1361
+ var channel = new MessageChannel();
1362
+ channel.port1.onmessage = callback;
1363
+ channel.port2.postMessage(void 0);
1364
+ };
1365
+ }
1366
+ return enqueueTaskImpl(task);
1367
+ }
1368
+ function aggregateErrors(errors) {
1369
+ return 1 < errors.length && "function" === typeof AggregateError
1370
+ ? new AggregateError(errors)
1371
+ : errors[0];
1372
+ }
1373
+ function popActScope(prevActQueue, prevActScopeDepth) {
1374
+ prevActScopeDepth !== actScopeDepth - 1 &&
1375
+ console.error(
1376
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
1377
+ );
1378
+ actScopeDepth = prevActScopeDepth;
1379
+ }
1380
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
1381
+ var queue = ReactSharedInternals.actQueue;
1382
+ if (null !== queue)
1383
+ if (0 !== queue.length)
1384
+ try {
1385
+ flushActQueue(queue);
1386
+ enqueueTask(function () {
1387
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1388
+ });
1389
+ return;
1390
+ } catch (error) {
1391
+ ReactSharedInternals.thrownErrors.push(error);
1392
+ }
1393
+ else ReactSharedInternals.actQueue = null;
1394
+ 0 < ReactSharedInternals.thrownErrors.length
1395
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
1396
+ (ReactSharedInternals.thrownErrors.length = 0),
1397
+ reject(queue))
1398
+ : resolve(returnValue);
1399
+ }
1400
+ function flushActQueue(queue) {
1401
+ if (!isFlushing) {
1402
+ isFlushing = true;
1403
+ var i = 0;
1404
+ try {
1405
+ for (; i < queue.length; i++) {
1406
+ var callback = queue[i];
1407
+ do {
1408
+ ReactSharedInternals.didUsePromise = !1;
1409
+ var continuation = callback(!1);
1410
+ if (null !== continuation) {
1411
+ if (ReactSharedInternals.didUsePromise) {
1412
+ queue[i] = callback;
1413
+ queue.splice(0, i);
1414
+ return;
1415
+ }
1416
+ callback = continuation;
1417
+ } else break;
1418
+ } while (1);
1419
+ }
1420
+ queue.length = 0;
1421
+ } catch (error) {
1422
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
1423
+ } finally {
1424
+ isFlushing = false;
1425
+ }
1426
+ }
1427
+ }
1428
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1429
+ "function" ===
1430
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
1431
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1432
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
1433
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
1434
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
1435
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
1436
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1437
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
1438
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
1439
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
1440
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
1441
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
1442
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
1443
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
1444
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
1445
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
1446
+ didWarnStateUpdateForUnmountedComponent = {},
1447
+ ReactNoopUpdateQueue = {
1448
+ isMounted: function () {
1449
+ return false;
1450
+ },
1451
+ enqueueForceUpdate: function (publicInstance) {
1452
+ warnNoop(publicInstance, "forceUpdate");
1453
+ },
1454
+ enqueueReplaceState: function (publicInstance) {
1455
+ warnNoop(publicInstance, "replaceState");
1456
+ },
1457
+ enqueueSetState: function (publicInstance) {
1458
+ warnNoop(publicInstance, "setState");
1459
+ }
1460
+ },
1461
+ assign = Object.assign,
1462
+ emptyObject = {};
1463
+ Object.freeze(emptyObject);
1464
+ Component.prototype.isReactComponent = {};
1465
+ Component.prototype.setState = function (partialState, callback) {
1466
+ if (
1467
+ "object" !== typeof partialState &&
1468
+ "function" !== typeof partialState &&
1469
+ null != partialState
1470
+ )
1471
+ throw Error(
1472
+ "takes an object of state variables to update or a function which returns an object of state variables."
1473
+ );
1474
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1475
+ };
1476
+ Component.prototype.forceUpdate = function (callback) {
1477
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1478
+ };
1479
+ var deprecatedAPIs = {
1480
+ isMounted: [
1481
+ "isMounted",
1482
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1483
+ ],
1484
+ replaceState: [
1485
+ "replaceState",
1486
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1487
+ ]
1488
+ };
1489
+ for (fnName in deprecatedAPIs)
1490
+ deprecatedAPIs.hasOwnProperty(fnName) &&
1491
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1492
+ ComponentDummy.prototype = Component.prototype;
1493
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1494
+ deprecatedAPIs.constructor = PureComponent;
1495
+ assign(deprecatedAPIs, Component.prototype);
1496
+ deprecatedAPIs.isPureReactComponent = true;
1497
+ var isArrayImpl = Array.isArray,
1498
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
1499
+ ReactSharedInternals = {
1500
+ H: null,
1501
+ A: null,
1502
+ T: null,
1503
+ S: null,
1504
+ actQueue: null,
1505
+ asyncTransitions: 0,
1506
+ isBatchingLegacy: false,
1507
+ didScheduleLegacyUpdate: false,
1508
+ didUsePromise: false,
1509
+ thrownErrors: [],
1510
+ getCurrentStack: null,
1511
+ recentlyCreatedOwnerStacks: 0
1512
+ },
1513
+ hasOwnProperty = Object.prototype.hasOwnProperty,
1514
+ createTask = console.createTask
1515
+ ? console.createTask
1516
+ : function () {
1517
+ return null;
1518
+ };
1519
+ deprecatedAPIs = {
1520
+ react_stack_bottom_frame: function (callStackForError) {
1521
+ return callStackForError();
1522
+ }
1523
+ };
1524
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1525
+ var didWarnAboutElementRef = {};
1526
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1527
+ deprecatedAPIs,
1528
+ UnknownOwner
1529
+ )();
1530
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1531
+ var didWarnAboutMaps = false,
1532
+ userProvidedKeyEscapeRegex = /\/+/g,
1533
+ reportGlobalError =
1534
+ "function" === typeof reportError
1535
+ ? reportError
1536
+ : function (error) {
1537
+ if (
1538
+ "object" === typeof window &&
1539
+ "function" === typeof window.ErrorEvent
1540
+ ) {
1541
+ var event = new window.ErrorEvent("error", {
1542
+ bubbles: true,
1543
+ cancelable: true,
1544
+ message:
1545
+ "object" === typeof error &&
1546
+ null !== error &&
1547
+ "string" === typeof error.message
1548
+ ? String(error.message)
1549
+ : String(error),
1550
+ error: error
1551
+ });
1552
+ if (!window.dispatchEvent(event)) return;
1553
+ } else if (
1554
+ "object" === typeof process &&
1555
+ "function" === typeof process.emit
1556
+ ) {
1557
+ process.emit("uncaughtException", error);
1558
+ return;
1559
+ }
1560
+ console.error(error);
1561
+ },
1562
+ didWarnAboutMessageChannel = false,
1563
+ enqueueTaskImpl = null,
1564
+ actScopeDepth = 0,
1565
+ didWarnNoAwaitAct = false,
1566
+ isFlushing = false,
1567
+ queueSeveralMicrotasks =
1568
+ "function" === typeof queueMicrotask
1569
+ ? function (callback) {
1570
+ queueMicrotask(function () {
1571
+ return queueMicrotask(callback);
1572
+ });
1573
+ }
1574
+ : enqueueTask;
1575
+ deprecatedAPIs = Object.freeze({
1576
+ __proto__: null,
1577
+ c: function (size) {
1578
+ return resolveDispatcher().useMemoCache(size);
1579
+ }
1580
+ });
1581
+ var fnName = {
1582
+ map: mapChildren,
1583
+ forEach: function (children, forEachFunc, forEachContext) {
1584
+ mapChildren(
1585
+ children,
1586
+ function () {
1587
+ forEachFunc.apply(this, arguments);
1588
+ },
1589
+ forEachContext
1590
+ );
1591
+ },
1592
+ count: function (children) {
1593
+ var n = 0;
1594
+ mapChildren(children, function () {
1595
+ n++;
1596
+ });
1597
+ return n;
1598
+ },
1599
+ toArray: function (children) {
1600
+ return (
1601
+ mapChildren(children, function (child) {
1602
+ return child;
1603
+ }) || []
1604
+ );
1605
+ },
1606
+ only: function (children) {
1607
+ if (!isValidElement(children))
1608
+ throw Error(
1609
+ "React.Children.only expected to receive a single React element child."
1610
+ );
1611
+ return children;
1612
+ }
1613
+ };
1614
+ exports$1.Activity = REACT_ACTIVITY_TYPE;
1615
+ exports$1.Children = fnName;
1616
+ exports$1.Component = Component;
1617
+ exports$1.Fragment = REACT_FRAGMENT_TYPE;
1618
+ exports$1.Profiler = REACT_PROFILER_TYPE;
1619
+ exports$1.PureComponent = PureComponent;
1620
+ exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
1621
+ exports$1.Suspense = REACT_SUSPENSE_TYPE;
1622
+ exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1623
+ ReactSharedInternals;
1624
+ exports$1.__COMPILER_RUNTIME = deprecatedAPIs;
1625
+ exports$1.act = function (callback) {
1626
+ var prevActQueue = ReactSharedInternals.actQueue,
1627
+ prevActScopeDepth = actScopeDepth;
1628
+ actScopeDepth++;
1629
+ var queue = (ReactSharedInternals.actQueue =
1630
+ null !== prevActQueue ? prevActQueue : []),
1631
+ didAwaitActCall = false;
1632
+ try {
1633
+ var result = callback();
1634
+ } catch (error) {
1635
+ ReactSharedInternals.thrownErrors.push(error);
1636
+ }
1637
+ if (0 < ReactSharedInternals.thrownErrors.length)
1638
+ throw (
1639
+ (popActScope(prevActQueue, prevActScopeDepth),
1640
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1641
+ (ReactSharedInternals.thrownErrors.length = 0),
1642
+ callback)
1643
+ );
1644
+ if (
1645
+ null !== result &&
1646
+ "object" === typeof result &&
1647
+ "function" === typeof result.then
1648
+ ) {
1649
+ var thenable = result;
1650
+ queueSeveralMicrotasks(function () {
1651
+ didAwaitActCall ||
1652
+ didWarnNoAwaitAct ||
1653
+ ((didWarnNoAwaitAct = true),
1654
+ console.error(
1655
+ "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 () => ...);"
1656
+ ));
1657
+ });
1658
+ return {
1659
+ then: function (resolve, reject) {
1660
+ didAwaitActCall = true;
1661
+ thenable.then(
1662
+ function (returnValue) {
1663
+ popActScope(prevActQueue, prevActScopeDepth);
1664
+ if (0 === prevActScopeDepth) {
1665
+ try {
1666
+ flushActQueue(queue),
1667
+ enqueueTask(function () {
1668
+ return recursivelyFlushAsyncActWork(
1669
+ returnValue,
1670
+ resolve,
1671
+ reject
1672
+ );
1673
+ });
1674
+ } catch (error$0) {
1675
+ ReactSharedInternals.thrownErrors.push(error$0);
1676
+ }
1677
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1678
+ var _thrownError = aggregateErrors(
1679
+ ReactSharedInternals.thrownErrors
1680
+ );
1681
+ ReactSharedInternals.thrownErrors.length = 0;
1682
+ reject(_thrownError);
1683
+ }
1684
+ } else resolve(returnValue);
1685
+ },
1686
+ function (error) {
1687
+ popActScope(prevActQueue, prevActScopeDepth);
1688
+ 0 < ReactSharedInternals.thrownErrors.length
1689
+ ? ((error = aggregateErrors(
1690
+ ReactSharedInternals.thrownErrors
1691
+ )),
1692
+ (ReactSharedInternals.thrownErrors.length = 0),
1693
+ reject(error))
1694
+ : reject(error);
1695
+ }
1696
+ );
1697
+ }
1698
+ };
1699
+ }
1700
+ var returnValue$jscomp$0 = result;
1701
+ popActScope(prevActQueue, prevActScopeDepth);
1702
+ 0 === prevActScopeDepth &&
1703
+ (flushActQueue(queue),
1704
+ 0 !== queue.length &&
1705
+ queueSeveralMicrotasks(function () {
1706
+ didAwaitActCall ||
1707
+ didWarnNoAwaitAct ||
1708
+ ((didWarnNoAwaitAct = true),
1709
+ console.error(
1710
+ "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(() => ...)"
1711
+ ));
1712
+ }),
1713
+ (ReactSharedInternals.actQueue = null));
1714
+ if (0 < ReactSharedInternals.thrownErrors.length)
1715
+ throw (
1716
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1717
+ (ReactSharedInternals.thrownErrors.length = 0),
1718
+ callback)
1719
+ );
1720
+ return {
1721
+ then: function (resolve, reject) {
1722
+ didAwaitActCall = true;
1723
+ 0 === prevActScopeDepth
1724
+ ? ((ReactSharedInternals.actQueue = queue),
1725
+ enqueueTask(function () {
1726
+ return recursivelyFlushAsyncActWork(
1727
+ returnValue$jscomp$0,
1728
+ resolve,
1729
+ reject
1730
+ );
1731
+ }))
1732
+ : resolve(returnValue$jscomp$0);
1733
+ }
1734
+ };
1735
+ };
1736
+ exports$1.cache = function (fn) {
1737
+ return function () {
1738
+ return fn.apply(null, arguments);
1739
+ };
1740
+ };
1741
+ exports$1.cacheSignal = function () {
1742
+ return null;
1743
+ };
1744
+ exports$1.captureOwnerStack = function () {
1745
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1746
+ return null === getCurrentStack ? null : getCurrentStack();
1747
+ };
1748
+ exports$1.cloneElement = function (element, config, children) {
1749
+ if (null === element || void 0 === element)
1750
+ throw Error(
1751
+ "The argument must be a React element, but you passed " +
1752
+ element +
1753
+ "."
1754
+ );
1755
+ var props = assign({}, element.props),
1756
+ key = element.key,
1757
+ owner = element._owner;
1758
+ if (null != config) {
1759
+ var JSCompiler_inline_result;
1760
+ a: {
1761
+ if (
1762
+ hasOwnProperty.call(config, "ref") &&
1763
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1764
+ config,
1765
+ "ref"
1766
+ ).get) &&
1767
+ JSCompiler_inline_result.isReactWarning
1768
+ ) {
1769
+ JSCompiler_inline_result = false;
1770
+ break a;
1771
+ }
1772
+ JSCompiler_inline_result = void 0 !== config.ref;
1773
+ }
1774
+ JSCompiler_inline_result && (owner = getOwner());
1775
+ hasValidKey(config) &&
1776
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
1777
+ for (propName in config)
1778
+ !hasOwnProperty.call(config, propName) ||
1779
+ "key" === propName ||
1780
+ "__self" === propName ||
1781
+ "__source" === propName ||
1782
+ ("ref" === propName && void 0 === config.ref) ||
1783
+ (props[propName] = config[propName]);
1784
+ }
1785
+ var propName = arguments.length - 2;
1786
+ if (1 === propName) props.children = children;
1787
+ else if (1 < propName) {
1788
+ JSCompiler_inline_result = Array(propName);
1789
+ for (var i = 0; i < propName; i++)
1790
+ JSCompiler_inline_result[i] = arguments[i + 2];
1791
+ props.children = JSCompiler_inline_result;
1792
+ }
1793
+ props = ReactElement(
1794
+ element.type,
1795
+ key,
1796
+ props,
1797
+ owner,
1798
+ element._debugStack,
1799
+ element._debugTask
1800
+ );
1801
+ for (key = 2; key < arguments.length; key++)
1802
+ validateChildKeys(arguments[key]);
1803
+ return props;
1804
+ };
1805
+ exports$1.createContext = function (defaultValue) {
1806
+ defaultValue = {
1807
+ $$typeof: REACT_CONTEXT_TYPE,
1808
+ _currentValue: defaultValue,
1809
+ _currentValue2: defaultValue,
1810
+ _threadCount: 0,
1811
+ Provider: null,
1812
+ Consumer: null
1813
+ };
1814
+ defaultValue.Provider = defaultValue;
1815
+ defaultValue.Consumer = {
1816
+ $$typeof: REACT_CONSUMER_TYPE,
1817
+ _context: defaultValue
1818
+ };
1819
+ defaultValue._currentRenderer = null;
1820
+ defaultValue._currentRenderer2 = null;
1821
+ return defaultValue;
1822
+ };
1823
+ exports$1.createElement = function (type, config, children) {
1824
+ for (var i = 2; i < arguments.length; i++)
1825
+ validateChildKeys(arguments[i]);
1826
+ i = {};
1827
+ var key = null;
1828
+ if (null != config)
1829
+ for (propName in (didWarnAboutOldJSXRuntime ||
1830
+ !("__self" in config) ||
1831
+ "key" in config ||
1832
+ ((didWarnAboutOldJSXRuntime = true),
1833
+ console.warn(
1834
+ "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"
1835
+ )),
1836
+ hasValidKey(config) &&
1837
+ (checkKeyStringCoercion(config.key), (key = "" + config.key)),
1838
+ config))
1839
+ hasOwnProperty.call(config, propName) &&
1840
+ "key" !== propName &&
1841
+ "__self" !== propName &&
1842
+ "__source" !== propName &&
1843
+ (i[propName] = config[propName]);
1844
+ var childrenLength = arguments.length - 2;
1845
+ if (1 === childrenLength) i.children = children;
1846
+ else if (1 < childrenLength) {
1847
+ for (
1848
+ var childArray = Array(childrenLength), _i = 0;
1849
+ _i < childrenLength;
1850
+ _i++
1851
+ )
1852
+ childArray[_i] = arguments[_i + 2];
1853
+ Object.freeze && Object.freeze(childArray);
1854
+ i.children = childArray;
1855
+ }
1856
+ if (type && type.defaultProps)
1857
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1858
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1859
+ key &&
1860
+ defineKeyPropWarningGetter(
1861
+ i,
1862
+ "function" === typeof type
1863
+ ? type.displayName || type.name || "Unknown"
1864
+ : type
1865
+ );
1866
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1867
+ return ReactElement(
1868
+ type,
1869
+ key,
1870
+ i,
1871
+ getOwner(),
1872
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1873
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1874
+ );
1875
+ };
1876
+ exports$1.createRef = function () {
1877
+ var refObject = { current: null };
1878
+ Object.seal(refObject);
1879
+ return refObject;
1880
+ };
1881
+ exports$1.forwardRef = function (render) {
1882
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1883
+ ? console.error(
1884
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1885
+ )
1886
+ : "function" !== typeof render
1887
+ ? console.error(
1888
+ "forwardRef requires a render function but was given %s.",
1889
+ null === render ? "null" : typeof render
1890
+ )
1891
+ : 0 !== render.length &&
1892
+ 2 !== render.length &&
1893
+ console.error(
1894
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1895
+ 1 === render.length
1896
+ ? "Did you forget to use the ref parameter?"
1897
+ : "Any additional parameter will be undefined."
1898
+ );
1899
+ null != render &&
1900
+ null != render.defaultProps &&
1901
+ console.error(
1902
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1903
+ );
1904
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1905
+ ownName;
1906
+ Object.defineProperty(elementType, "displayName", {
1907
+ enumerable: false,
1908
+ configurable: true,
1909
+ get: function () {
1910
+ return ownName;
1911
+ },
1912
+ set: function (name) {
1913
+ ownName = name;
1914
+ render.name ||
1915
+ render.displayName ||
1916
+ (Object.defineProperty(render, "name", { value: name }),
1917
+ (render.displayName = name));
1918
+ }
1919
+ });
1920
+ return elementType;
1921
+ };
1922
+ exports$1.isValidElement = isValidElement;
1923
+ exports$1.lazy = function (ctor) {
1924
+ ctor = { _status: -1, _result: ctor };
1925
+ var lazyType = {
1926
+ $$typeof: REACT_LAZY_TYPE,
1927
+ _payload: ctor,
1928
+ _init: lazyInitializer
1929
+ },
1930
+ ioInfo = {
1931
+ name: "lazy",
1932
+ start: -1,
1933
+ end: -1,
1934
+ value: null,
1935
+ owner: null,
1936
+ debugStack: Error("react-stack-top-frame"),
1937
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1938
+ };
1939
+ ctor._ioInfo = ioInfo;
1940
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1941
+ return lazyType;
1942
+ };
1943
+ exports$1.memo = function (type, compare) {
1944
+ null == type &&
1945
+ console.error(
1946
+ "memo: The first argument must be a component. Instead received: %s",
1947
+ null === type ? "null" : typeof type
1948
+ );
1949
+ compare = {
1950
+ $$typeof: REACT_MEMO_TYPE,
1951
+ type: type,
1952
+ compare: void 0 === compare ? null : compare
1953
+ };
1954
+ var ownName;
1955
+ Object.defineProperty(compare, "displayName", {
1956
+ enumerable: false,
1957
+ configurable: true,
1958
+ get: function () {
1959
+ return ownName;
1960
+ },
1961
+ set: function (name) {
1962
+ ownName = name;
1963
+ type.name ||
1964
+ type.displayName ||
1965
+ (Object.defineProperty(type, "name", { value: name }),
1966
+ (type.displayName = name));
1967
+ }
1968
+ });
1969
+ return compare;
1970
+ };
1971
+ exports$1.startTransition = function (scope) {
1972
+ var prevTransition = ReactSharedInternals.T,
1973
+ currentTransition = {};
1974
+ currentTransition._updatedFibers = new Set();
1975
+ ReactSharedInternals.T = currentTransition;
1976
+ try {
1977
+ var returnValue = scope(),
1978
+ onStartTransitionFinish = ReactSharedInternals.S;
1979
+ null !== onStartTransitionFinish &&
1980
+ onStartTransitionFinish(currentTransition, returnValue);
1981
+ "object" === typeof returnValue &&
1982
+ null !== returnValue &&
1983
+ "function" === typeof returnValue.then &&
1984
+ (ReactSharedInternals.asyncTransitions++,
1985
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
1986
+ returnValue.then(noop, reportGlobalError));
1987
+ } catch (error) {
1988
+ reportGlobalError(error);
1989
+ } finally {
1990
+ null === prevTransition &&
1991
+ currentTransition._updatedFibers &&
1992
+ ((scope = currentTransition._updatedFibers.size),
1993
+ currentTransition._updatedFibers.clear(),
1994
+ 10 < scope &&
1995
+ console.warn(
1996
+ "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."
1997
+ )),
1998
+ null !== prevTransition &&
1999
+ null !== currentTransition.types &&
2000
+ (null !== prevTransition.types &&
2001
+ prevTransition.types !== currentTransition.types &&
2002
+ console.error(
2003
+ "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."
2004
+ ),
2005
+ (prevTransition.types = currentTransition.types)),
2006
+ (ReactSharedInternals.T = prevTransition);
2007
+ }
2008
+ };
2009
+ exports$1.unstable_useCacheRefresh = function () {
2010
+ return resolveDispatcher().useCacheRefresh();
2011
+ };
2012
+ exports$1.use = function (usable) {
2013
+ return resolveDispatcher().use(usable);
2014
+ };
2015
+ exports$1.useActionState = function (action, initialState, permalink) {
2016
+ return resolveDispatcher().useActionState(
2017
+ action,
2018
+ initialState,
2019
+ permalink
2020
+ );
2021
+ };
2022
+ exports$1.useCallback = function (callback, deps) {
2023
+ return resolveDispatcher().useCallback(callback, deps);
2024
+ };
2025
+ exports$1.useContext = function (Context) {
2026
+ var dispatcher = resolveDispatcher();
2027
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
2028
+ console.error(
2029
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
2030
+ );
2031
+ return dispatcher.useContext(Context);
2032
+ };
2033
+ exports$1.useDebugValue = function (value, formatterFn) {
2034
+ return resolveDispatcher().useDebugValue(value, formatterFn);
2035
+ };
2036
+ exports$1.useDeferredValue = function (value, initialValue) {
2037
+ return resolveDispatcher().useDeferredValue(value, initialValue);
2038
+ };
2039
+ exports$1.useEffect = function (create, deps) {
2040
+ null == create &&
2041
+ console.warn(
2042
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2043
+ );
2044
+ return resolveDispatcher().useEffect(create, deps);
2045
+ };
2046
+ exports$1.useEffectEvent = function (callback) {
2047
+ return resolveDispatcher().useEffectEvent(callback);
2048
+ };
2049
+ exports$1.useId = function () {
2050
+ return resolveDispatcher().useId();
2051
+ };
2052
+ exports$1.useImperativeHandle = function (ref, create, deps) {
2053
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
2054
+ };
2055
+ exports$1.useInsertionEffect = function (create, deps) {
2056
+ null == create &&
2057
+ console.warn(
2058
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2059
+ );
2060
+ return resolveDispatcher().useInsertionEffect(create, deps);
2061
+ };
2062
+ exports$1.useLayoutEffect = function (create, deps) {
2063
+ null == create &&
2064
+ console.warn(
2065
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2066
+ );
2067
+ return resolveDispatcher().useLayoutEffect(create, deps);
2068
+ };
2069
+ exports$1.useMemo = function (create, deps) {
2070
+ return resolveDispatcher().useMemo(create, deps);
2071
+ };
2072
+ exports$1.useOptimistic = function (passthrough, reducer) {
2073
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
2074
+ };
2075
+ exports$1.useReducer = function (reducer, initialArg, init) {
2076
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
2077
+ };
2078
+ exports$1.useRef = function (initialValue) {
2079
+ return resolveDispatcher().useRef(initialValue);
2080
+ };
2081
+ exports$1.useState = function (initialState) {
2082
+ return resolveDispatcher().useState(initialState);
2083
+ };
2084
+ exports$1.useSyncExternalStore = function (
2085
+ subscribe,
2086
+ getSnapshot,
2087
+ getServerSnapshot
2088
+ ) {
2089
+ return resolveDispatcher().useSyncExternalStore(
2090
+ subscribe,
2091
+ getSnapshot,
2092
+ getServerSnapshot
2093
+ );
2094
+ };
2095
+ exports$1.useTransition = function () {
2096
+ return resolveDispatcher().useTransition();
2097
+ };
2098
+ exports$1.version = "19.2.4";
2099
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2100
+ "function" ===
2101
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
2102
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2103
+ })();
2104
+ } (react_development, react_development.exports));
2105
+ return react_development.exports;
2106
+ }
2107
+
2108
+ var hasRequiredReact;
2109
+
2110
+ function requireReact () {
2111
+ if (hasRequiredReact) return react.exports;
2112
+ hasRequiredReact = 1;
2113
+
2114
+ if (process.env.NODE_ENV === 'production') {
2115
+ react.exports = requireReact_production();
2116
+ } else {
2117
+ react.exports = requireReact_development();
2118
+ }
2119
+ return react.exports;
2120
+ }
2121
+
2122
+ var reactExports = requireReact();
2123
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2124
+
2125
+ const QidSignInButton = ({ sdk, onSuccess, onError, className, buttonText = 'Login with QidCloud' }) => {
2126
+ const [modalOpen, setModalOpen] = reactExports.useState(false);
2127
+ const [qrData, setQrData] = reactExports.useState(null);
2128
+ const [loading, setLoading] = reactExports.useState(false);
2129
+ const startLogin = async () => {
2130
+ setLoading(true);
2131
+ try {
2132
+ const session = await sdk.auth.createSession();
2133
+ setQrData(session.qrData);
2134
+ setModalOpen(true);
2135
+ sdk.auth.listen(session.sessionId, async (token) => {
2136
+ const user = await sdk.auth.getProfile(token);
2137
+ setModalOpen(false);
2138
+ onSuccess(user, token);
2139
+ }, (err) => {
2140
+ if (onError)
2141
+ onError(err);
2142
+ setModalOpen(false);
2143
+ });
2144
+ }
2145
+ catch (err) {
2146
+ if (onError)
2147
+ onError(err.message || 'Failed to initiate login');
2148
+ }
2149
+ finally {
2150
+ setLoading(false);
2151
+ }
2152
+ };
2153
+ return (React.createElement(React.Fragment, null,
2154
+ React.createElement("button", { onClick: startLogin, disabled: loading, className: className || 'qid-signin-btn', style: {
2155
+ backgroundColor: '#00e5ff',
2156
+ color: '#000',
2157
+ padding: '10px 20px',
2158
+ borderRadius: '8px',
2159
+ border: 'none',
2160
+ fontWeight: 'bold',
2161
+ cursor: 'pointer',
2162
+ display: 'flex',
2163
+ alignItems: 'center',
2164
+ gap: '10px'
2165
+ } }, loading ? 'Initializing...' : buttonText),
2166
+ modalOpen && (React.createElement("div", { className: "qid-modal-overlay", style: {
2167
+ position: 'fixed',
2168
+ top: 0, left: 0, right: 0, bottom: 0,
2169
+ backgroundColor: 'rgba(0,0,0,0.8)',
2170
+ display: 'flex',
2171
+ justifyContent: 'center',
2172
+ alignItems: 'center',
2173
+ zIndex: 9999
2174
+ } },
2175
+ React.createElement("div", { className: "qid-modal-content", style: {
2176
+ backgroundColor: '#1a1a1a',
2177
+ padding: '30px',
2178
+ borderRadius: '16px',
2179
+ textAlign: 'center',
2180
+ color: '#fff',
2181
+ maxWidth: '400px',
2182
+ width: '90%'
2183
+ } },
2184
+ React.createElement("h2", { style: { marginBottom: '10px' } }, "Identity Handshake"),
2185
+ React.createElement("p", { style: { marginBottom: '20px', fontSize: '14px', color: '#ccc' } }, "Open your QidCloud Mobile App and scan this PQC-secured QR code."),
2186
+ React.createElement("div", { style: {
2187
+ backgroundColor: '#fff',
2188
+ padding: '10px',
2189
+ display: 'inline-block',
2190
+ borderRadius: '8px',
2191
+ marginBottom: '20px'
2192
+ } },
2193
+ React.createElement("div", { style: { color: '#000', fontSize: '12px', wordBreak: 'break-all', width: '200px' } },
2194
+ "QR: ",
2195
+ qrData)),
2196
+ React.createElement("button", { onClick: () => setModalOpen(false), style: {
2197
+ display: 'block',
2198
+ width: '100%',
2199
+ padding: '10px',
2200
+ backgroundColor: '#333',
2201
+ color: '#fff',
2202
+ border: 'none',
2203
+ borderRadius: '8px',
2204
+ cursor: 'pointer'
2205
+ } }, "Cancel"))))));
2206
+ };
2207
+
2208
+ class QidCloud {
2209
+ config;
2210
+ api;
2211
+ auth;
2212
+ db;
2213
+ edge;
2214
+ vault;
2215
+ logs;
2216
+ constructor(config) {
2217
+ this.config = {
2218
+ baseUrl: 'https://api.qidcloud.com',
2219
+ ...config,
2220
+ };
2221
+ this.api = axios.create({
2222
+ baseURL: this.config.baseUrl,
2223
+ headers: {
2224
+ 'x-api-key': this.config.apiKey,
2225
+ 'Content-Type': 'application/json',
2226
+ },
2227
+ });
2228
+ this.auth = new AuthModule(this);
2229
+ this.db = new DbModule(this);
2230
+ this.edge = new EdgeModule(this);
2231
+ this.vault = new VaultModule(this);
2232
+ this.logs = new LogsModule(this);
2233
+ }
2234
+ /**
2235
+ * Get the current project configuration
2236
+ */
2237
+ getConfig() {
2238
+ return { ...this.config };
2239
+ }
2240
+ }
2241
+
2242
+ export { QidCloud, QidSignInButton, QidCloud as default };
2243
+ //# sourceMappingURL=index.mjs.map