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