mito-ai 0.1.41__py3-none-any.whl → 0.1.43__py3-none-any.whl

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.

Potentially problematic release.


This version of mito-ai might be problematic. Click here for more details.

Files changed (56) hide show
  1. mito_ai/__init__.py +7 -0
  2. mito_ai/_version.py +1 -1
  3. mito_ai/app_manager/__init__.py +4 -0
  4. mito_ai/app_manager/handlers.py +134 -0
  5. mito_ai/app_manager/models.py +57 -0
  6. mito_ai/app_manager/utils.py +24 -0
  7. mito_ai/completions/completion_handlers/agent_execution_handler.py +1 -1
  8. mito_ai/completions/completion_handlers/chat_completion_handler.py +2 -2
  9. mito_ai/completions/completion_handlers/utils.py +99 -37
  10. mito_ai/completions/prompt_builders/utils.py +7 -1
  11. mito_ai/file_uploads/handlers.py +49 -26
  12. mito_ai/tests/completions/completion_handlers_utils_test.py +190 -0
  13. mito_ai/tests/file_uploads/test_handlers.py +15 -0
  14. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +100 -100
  15. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
  16. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
  17. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.81703ac2bc645e5c2fc2.js +1324 -247
  18. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.81703ac2bc645e5c2fc2.js.map +1 -0
  19. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +198 -0
  20. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +1 -0
  21. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.502aef26f0416fab7435.js +23 -23
  22. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.502aef26f0416fab7435.js.map +1 -0
  23. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js +533 -0
  24. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map +1 -0
  25. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js +2977 -610
  26. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map +1 -0
  27. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +1 -481
  28. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +1 -0
  29. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js +2 -60
  30. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map +1 -0
  31. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js → mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +2 -240
  32. mito_ai-0.1.43.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +1 -0
  33. {mito_ai-0.1.41.dist-info → mito_ai-0.1.43.dist-info}/METADATA +1 -1
  34. {mito_ai-0.1.41.dist-info → mito_ai-0.1.43.dist-info}/RECORD +46 -41
  35. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js.map +0 -1
  36. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js +0 -63
  37. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js.map +0 -1
  38. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js.map +0 -1
  39. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js.map +0 -1
  40. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js +0 -2345
  41. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js.map +0 -1
  42. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js.map +0 -1
  43. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js.map +0 -1
  44. mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -1
  45. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
  46. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
  47. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
  48. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
  49. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
  50. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
  51. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
  52. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
  53. {mito_ai-0.1.41.data → mito_ai-0.1.43.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
  54. {mito_ai-0.1.41.dist-info → mito_ai-0.1.43.dist-info}/WHEEL +0 -0
  55. {mito_ai-0.1.41.dist-info → mito_ai-0.1.43.dist-info}/entry_points.txt +0 -0
  56. {mito_ai-0.1.41.dist-info → mito_ai-0.1.43.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- (self["webpackChunkmito_ai"] = self["webpackChunkmito_ai"] || []).push([["vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs"],{
1
+ (self["webpackChunkmito_ai"] = self["webpackChunkmito_ai"] || []).push([["vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8"],{
2
2
 
3
3
  /***/ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs":
4
4
  /*!**********************************************************************!*\
@@ -1325,6 +1325,368 @@ function isAuthenticatedWithImplicitOauthFlow(tokens) {
1325
1325
  //# sourceMappingURL=types.mjs.map
1326
1326
 
1327
1327
 
1328
+ /***/ }),
1329
+
1330
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs":
1331
+ /*!***************************************************************!*\
1332
+ !*** ./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs ***!
1333
+ \***************************************************************/
1334
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1335
+
1336
+ "use strict";
1337
+ __webpack_require__.r(__webpack_exports__);
1338
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1339
+ /* harmony export */ AMPLIFY_SYMBOL: () => (/* binding */ AMPLIFY_SYMBOL),
1340
+ /* harmony export */ Hub: () => (/* binding */ Hub),
1341
+ /* harmony export */ HubClass: () => (/* binding */ HubClass),
1342
+ /* harmony export */ HubInternal: () => (/* binding */ HubInternal)
1343
+ /* harmony export */ });
1344
+ /* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
1345
+ /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs");
1346
+ /* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1354
+ // SPDX-License-Identifier: Apache-2.0
1355
+ const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'
1356
+ ? Symbol('amplify_default')
1357
+ : '@@amplify_default');
1358
+ const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('Hub');
1359
+ class HubClass {
1360
+ constructor(name) {
1361
+ this.listeners = new Map();
1362
+ this.protectedChannels = [
1363
+ 'core',
1364
+ 'auth',
1365
+ 'api',
1366
+ 'analytics',
1367
+ 'interactions',
1368
+ 'pubsub',
1369
+ 'storage',
1370
+ 'ui',
1371
+ 'xr',
1372
+ ];
1373
+ this.name = name;
1374
+ }
1375
+ /**
1376
+ * Used internally to remove a Hub listener.
1377
+ *
1378
+ * @remarks
1379
+ * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
1380
+ */
1381
+ _remove(channel, listener) {
1382
+ const holder = this.listeners.get(channel);
1383
+ if (!holder) {
1384
+ logger.warn(`No listeners for ${channel}`);
1385
+ return;
1386
+ }
1387
+ this.listeners.set(channel, [
1388
+ ...holder.filter(({ callback }) => callback !== listener),
1389
+ ]);
1390
+ }
1391
+ dispatch(channel, payload, source, ampSymbol) {
1392
+ if (typeof channel === 'string' &&
1393
+ this.protectedChannels.indexOf(channel) > -1) {
1394
+ const hasAccess = ampSymbol === AMPLIFY_SYMBOL;
1395
+ if (!hasAccess) {
1396
+ logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);
1397
+ }
1398
+ }
1399
+ const capsule = {
1400
+ channel,
1401
+ payload: { ...payload },
1402
+ source,
1403
+ patternInfo: [],
1404
+ };
1405
+ try {
1406
+ this._toListeners(capsule);
1407
+ }
1408
+ catch (e) {
1409
+ logger.error(e);
1410
+ }
1411
+ }
1412
+ listen(channel, callback, listenerName = 'noname') {
1413
+ let cb;
1414
+ if (typeof callback !== 'function') {
1415
+ throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyError({
1416
+ name: _constants_mjs__WEBPACK_IMPORTED_MODULE_2__.NO_HUBCALLBACK_PROVIDED_EXCEPTION,
1417
+ message: 'No callback supplied to Hub',
1418
+ });
1419
+ }
1420
+ else {
1421
+ // Needs to be casted as a more generic type
1422
+ cb = callback;
1423
+ }
1424
+ let holder = this.listeners.get(channel);
1425
+ if (!holder) {
1426
+ holder = [];
1427
+ this.listeners.set(channel, holder);
1428
+ }
1429
+ holder.push({
1430
+ name: listenerName,
1431
+ callback: cb,
1432
+ });
1433
+ return () => {
1434
+ this._remove(channel, cb);
1435
+ };
1436
+ }
1437
+ _toListeners(capsule) {
1438
+ const { channel, payload } = capsule;
1439
+ const holder = this.listeners.get(channel);
1440
+ if (holder) {
1441
+ holder.forEach(listener => {
1442
+ logger.debug(`Dispatching to ${channel} with `, payload);
1443
+ try {
1444
+ listener.callback(capsule);
1445
+ }
1446
+ catch (e) {
1447
+ logger.error(e);
1448
+ }
1449
+ });
1450
+ }
1451
+ }
1452
+ }
1453
+ /* We export a __default__ instance of HubClass to use it as a
1454
+ pseudo Singleton for the main messaging bus, however you can still create
1455
+ your own instance of HubClass() for a separate "private bus" of events. */
1456
+ const Hub = new HubClass('__default__');
1457
+ /**
1458
+ * @internal
1459
+ *
1460
+ * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
1461
+ *
1462
+ */
1463
+ const HubInternal = new HubClass('internal-hub');
1464
+
1465
+
1466
+ //# sourceMappingURL=index.mjs.map
1467
+
1468
+
1469
+ /***/ }),
1470
+
1471
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs":
1472
+ /*!**************************************************************************!*\
1473
+ !*** ./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs ***!
1474
+ \**************************************************************************/
1475
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1476
+
1477
+ "use strict";
1478
+ __webpack_require__.r(__webpack_exports__);
1479
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1480
+ /* harmony export */ ConsoleLogger: () => (/* binding */ ConsoleLogger)
1481
+ /* harmony export */ });
1482
+ /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs");
1483
+ /* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs");
1484
+
1485
+
1486
+
1487
+ /* eslint-disable no-console */
1488
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1489
+ // SPDX-License-Identifier: Apache-2.0
1490
+ const LOG_LEVELS = {
1491
+ VERBOSE: 1,
1492
+ DEBUG: 2,
1493
+ INFO: 3,
1494
+ WARN: 4,
1495
+ ERROR: 5,
1496
+ NONE: 6,
1497
+ };
1498
+ /**
1499
+ * Write logs
1500
+ * @class Logger
1501
+ */
1502
+ class ConsoleLogger {
1503
+ /**
1504
+ * @constructor
1505
+ * @param {string} name - Name of the logger
1506
+ */
1507
+ constructor(name, level = _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN) {
1508
+ this.name = name;
1509
+ this.level = level;
1510
+ this._pluggables = [];
1511
+ }
1512
+ _padding(n) {
1513
+ return n < 10 ? '0' + n : '' + n;
1514
+ }
1515
+ _ts() {
1516
+ const dt = new Date();
1517
+ return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +
1518
+ '.' +
1519
+ dt.getMilliseconds());
1520
+ }
1521
+ configure(config) {
1522
+ if (!config)
1523
+ return this._config;
1524
+ this._config = config;
1525
+ return this._config;
1526
+ }
1527
+ /**
1528
+ * Write log
1529
+ * @method
1530
+ * @memeberof Logger
1531
+ * @param {LogType|string} type - log type, default INFO
1532
+ * @param {string|object} msg - Logging message or object
1533
+ */
1534
+ _log(type, ...msg) {
1535
+ let loggerLevelName = this.level;
1536
+ if (ConsoleLogger.LOG_LEVEL) {
1537
+ loggerLevelName = ConsoleLogger.LOG_LEVEL;
1538
+ }
1539
+ if (typeof window !== 'undefined' && window.LOG_LEVEL) {
1540
+ loggerLevelName = window.LOG_LEVEL;
1541
+ }
1542
+ const loggerLevel = LOG_LEVELS[loggerLevelName];
1543
+ const typeLevel = LOG_LEVELS[type];
1544
+ if (!(typeLevel >= loggerLevel)) {
1545
+ // Do nothing if type is not greater than or equal to logger level (handle undefined)
1546
+ return;
1547
+ }
1548
+ let log = console.log.bind(console);
1549
+ if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.ERROR && console.error) {
1550
+ log = console.error.bind(console);
1551
+ }
1552
+ if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN && console.warn) {
1553
+ log = console.warn.bind(console);
1554
+ }
1555
+ if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {
1556
+ if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO && console.info) {
1557
+ log = console.info.bind(console);
1558
+ }
1559
+ if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.DEBUG && console.debug) {
1560
+ log = console.debug.bind(console);
1561
+ }
1562
+ }
1563
+ const prefix = `[${type}] ${this._ts()} ${this.name}`;
1564
+ let message = '';
1565
+ if (msg.length === 1 && typeof msg[0] === 'string') {
1566
+ message = `${prefix} - ${msg[0]}`;
1567
+ log(message);
1568
+ }
1569
+ else if (msg.length === 1) {
1570
+ message = `${prefix} ${msg[0]}`;
1571
+ log(prefix, msg[0]);
1572
+ }
1573
+ else if (typeof msg[0] === 'string') {
1574
+ let obj = msg.slice(1);
1575
+ if (obj.length === 1) {
1576
+ obj = obj[0];
1577
+ }
1578
+ message = `${prefix} - ${msg[0]} ${obj}`;
1579
+ log(`${prefix} - ${msg[0]}`, obj);
1580
+ }
1581
+ else {
1582
+ message = `${prefix} ${msg}`;
1583
+ log(prefix, msg);
1584
+ }
1585
+ for (const plugin of this._pluggables) {
1586
+ const logEvent = { message, timestamp: Date.now() };
1587
+ plugin.pushLogs([logEvent]);
1588
+ }
1589
+ }
1590
+ /**
1591
+ * Write General log. Default to INFO
1592
+ * @method
1593
+ * @memeberof Logger
1594
+ * @param {string|object} msg - Logging message or object
1595
+ */
1596
+ log(...msg) {
1597
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO, ...msg);
1598
+ }
1599
+ /**
1600
+ * Write INFO log
1601
+ * @method
1602
+ * @memeberof Logger
1603
+ * @param {string|object} msg - Logging message or object
1604
+ */
1605
+ info(...msg) {
1606
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO, ...msg);
1607
+ }
1608
+ /**
1609
+ * Write WARN log
1610
+ * @method
1611
+ * @memeberof Logger
1612
+ * @param {string|object} msg - Logging message or object
1613
+ */
1614
+ warn(...msg) {
1615
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN, ...msg);
1616
+ }
1617
+ /**
1618
+ * Write ERROR log
1619
+ * @method
1620
+ * @memeberof Logger
1621
+ * @param {string|object} msg - Logging message or object
1622
+ */
1623
+ error(...msg) {
1624
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.ERROR, ...msg);
1625
+ }
1626
+ /**
1627
+ * Write DEBUG log
1628
+ * @method
1629
+ * @memeberof Logger
1630
+ * @param {string|object} msg - Logging message or object
1631
+ */
1632
+ debug(...msg) {
1633
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.DEBUG, ...msg);
1634
+ }
1635
+ /**
1636
+ * Write VERBOSE log
1637
+ * @method
1638
+ * @memeberof Logger
1639
+ * @param {string|object} msg - Logging message or object
1640
+ */
1641
+ verbose(...msg) {
1642
+ this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.VERBOSE, ...msg);
1643
+ }
1644
+ addPluggable(pluggable) {
1645
+ if (pluggable && pluggable.getCategoryName() === _constants_mjs__WEBPACK_IMPORTED_MODULE_1__.AWS_CLOUDWATCH_CATEGORY) {
1646
+ this._pluggables.push(pluggable);
1647
+ pluggable.configure(this._config);
1648
+ }
1649
+ }
1650
+ listPluggables() {
1651
+ return this._pluggables;
1652
+ }
1653
+ }
1654
+ ConsoleLogger.LOG_LEVEL = null;
1655
+ ConsoleLogger.BIND_ALL_LOG_LEVELS = false;
1656
+
1657
+
1658
+ //# sourceMappingURL=ConsoleLogger.mjs.map
1659
+
1660
+
1661
+ /***/ }),
1662
+
1663
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs":
1664
+ /*!******************************************************************!*\
1665
+ !*** ./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs ***!
1666
+ \******************************************************************/
1667
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1668
+
1669
+ "use strict";
1670
+ __webpack_require__.r(__webpack_exports__);
1671
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1672
+ /* harmony export */ LogType: () => (/* binding */ LogType)
1673
+ /* harmony export */ });
1674
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1675
+ // SPDX-License-Identifier: Apache-2.0
1676
+ var LogType;
1677
+ (function (LogType) {
1678
+ LogType["DEBUG"] = "DEBUG";
1679
+ LogType["ERROR"] = "ERROR";
1680
+ LogType["INFO"] = "INFO";
1681
+ LogType["WARN"] = "WARN";
1682
+ LogType["VERBOSE"] = "VERBOSE";
1683
+ LogType["NONE"] = "NONE";
1684
+ })(LogType || (LogType = {}));
1685
+
1686
+
1687
+ //# sourceMappingURL=types.mjs.map
1688
+
1689
+
1328
1690
  /***/ }),
1329
1691
 
1330
1692
  /***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/customUserAgent.mjs":
@@ -3055,6 +3417,76 @@ const withMemoization = (payloadAccessor) => {
3055
3417
  //# sourceMappingURL=memoization.mjs.map
3056
3418
 
3057
3419
 
3420
+ /***/ }),
3421
+
3422
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs":
3423
+ /*!***************************************************************!*\
3424
+ !*** ./node_modules/@aws-amplify/core/dist/esm/constants.mjs ***!
3425
+ \***************************************************************/
3426
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3427
+
3428
+ "use strict";
3429
+ __webpack_require__.r(__webpack_exports__);
3430
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3431
+ /* harmony export */ AWS_CLOUDWATCH_CATEGORY: () => (/* binding */ AWS_CLOUDWATCH_CATEGORY),
3432
+ /* harmony export */ NO_HUBCALLBACK_PROVIDED_EXCEPTION: () => (/* binding */ NO_HUBCALLBACK_PROVIDED_EXCEPTION),
3433
+ /* harmony export */ USER_AGENT_HEADER: () => (/* binding */ USER_AGENT_HEADER)
3434
+ /* harmony export */ });
3435
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3436
+ // SPDX-License-Identifier: Apache-2.0
3437
+ // Logging constants
3438
+ const AWS_CLOUDWATCH_CATEGORY = 'Logging';
3439
+ const USER_AGENT_HEADER = 'x-amz-user-agent';
3440
+ // Error exception code constants
3441
+ const NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
3442
+
3443
+
3444
+ //# sourceMappingURL=constants.mjs.map
3445
+
3446
+
3447
+ /***/ }),
3448
+
3449
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs":
3450
+ /*!*************************************************************************!*\
3451
+ !*** ./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs ***!
3452
+ \*************************************************************************/
3453
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3454
+
3455
+ "use strict";
3456
+ __webpack_require__.r(__webpack_exports__);
3457
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3458
+ /* harmony export */ AmplifyError: () => (/* binding */ AmplifyError)
3459
+ /* harmony export */ });
3460
+ class AmplifyError extends Error {
3461
+ /**
3462
+ * Constructs an AmplifyError.
3463
+ *
3464
+ * @param message text that describes the main problem.
3465
+ * @param underlyingError the underlying cause of the error.
3466
+ * @param recoverySuggestion suggestion to recover from the error.
3467
+ *
3468
+ */
3469
+ constructor({ message, name, recoverySuggestion, underlyingError, metadata, }) {
3470
+ super(message);
3471
+ this.name = name;
3472
+ this.underlyingError = underlyingError;
3473
+ this.recoverySuggestion = recoverySuggestion;
3474
+ if (metadata) {
3475
+ // If metadata exists, explicitly only record the following properties.
3476
+ const { extendedRequestId, httpStatusCode, requestId } = metadata;
3477
+ this.metadata = { extendedRequestId, httpStatusCode, requestId };
3478
+ }
3479
+ // Hack for making the custom error class work when transpiled to es5
3480
+ // TODO: Delete the following 2 lines after we change the build target to >= es2015
3481
+ this.constructor = AmplifyError;
3482
+ Object.setPrototypeOf(this, AmplifyError.prototype);
3483
+ }
3484
+ }
3485
+
3486
+
3487
+ //# sourceMappingURL=AmplifyError.mjs.map
3488
+
3489
+
3058
3490
  /***/ }),
3059
3491
 
3060
3492
  /***/ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs":
@@ -3125,79 +3557,19 @@ const createAssertionFunction = (errorMap, AssertionError = _AmplifyError_mjs__W
3125
3557
 
3126
3558
  /***/ }),
3127
3559
 
3128
- /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs":
3129
- /*!***************************************************************************************!*\
3130
- !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs ***!
3131
- \***************************************************************************************/
3132
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3133
-
3134
- "use strict";
3135
- __webpack_require__.r(__webpack_exports__);
3136
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3137
- /* harmony export */ AuthConfigurationErrorCode: () => (/* binding */ AuthConfigurationErrorCode),
3138
- /* harmony export */ assert: () => (/* binding */ assert)
3139
- /* harmony export */ });
3140
- /* harmony import */ var _errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../errors/createAssertionFunction.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs");
3141
-
3142
-
3143
-
3144
-
3145
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3146
- // SPDX-License-Identifier: Apache-2.0
3147
- var AuthConfigurationErrorCode;
3148
- (function (AuthConfigurationErrorCode) {
3149
- AuthConfigurationErrorCode["AuthTokenConfigException"] = "AuthTokenConfigException";
3150
- AuthConfigurationErrorCode["AuthUserPoolAndIdentityPoolException"] = "AuthUserPoolAndIdentityPoolException";
3151
- AuthConfigurationErrorCode["AuthUserPoolException"] = "AuthUserPoolException";
3152
- AuthConfigurationErrorCode["InvalidIdentityPoolIdException"] = "InvalidIdentityPoolIdException";
3153
- AuthConfigurationErrorCode["OAuthNotConfigureException"] = "OAuthNotConfigureException";
3154
- })(AuthConfigurationErrorCode || (AuthConfigurationErrorCode = {}));
3155
- const authConfigurationErrorMap = {
3156
- [AuthConfigurationErrorCode.AuthTokenConfigException]: {
3157
- message: 'Auth Token Provider not configured.',
3158
- recoverySuggestion: 'Make sure to call Amplify.configure in your app.',
3159
- },
3160
- [AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException]: {
3161
- message: 'Auth UserPool or IdentityPool not configured.',
3162
- recoverySuggestion: 'Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId.',
3163
- },
3164
- [AuthConfigurationErrorCode.AuthUserPoolException]: {
3165
- message: 'Auth UserPool not configured.',
3166
- recoverySuggestion: 'Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId.',
3167
- },
3168
- [AuthConfigurationErrorCode.InvalidIdentityPoolIdException]: {
3169
- message: 'Invalid identity pool id provided.',
3170
- recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',
3171
- },
3172
- [AuthConfigurationErrorCode.OAuthNotConfigureException]: {
3173
- message: 'oauth param not configured.',
3174
- recoverySuggestion: 'Make sure to call Amplify.configure with oauth parameter in your app.',
3175
- },
3176
- };
3177
- const assert = (0,_errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__.createAssertionFunction)(authConfigurationErrorMap);
3178
-
3179
-
3180
- //# sourceMappingURL=errorHelpers.mjs.map
3181
-
3182
-
3183
- /***/ }),
3184
-
3185
- /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs":
3186
- /*!********************************************************************************!*\
3187
- !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs ***!
3188
- \********************************************************************************/
3560
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs":
3561
+ /*!*********************************************************************!*\
3562
+ !*** ./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs ***!
3563
+ \*********************************************************************/
3189
3564
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3190
3565
 
3191
3566
  "use strict";
3192
3567
  __webpack_require__.r(__webpack_exports__);
3193
3568
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3194
- /* harmony export */ assertIdentityPoolIdConfig: () => (/* binding */ assertIdentityPoolIdConfig),
3195
- /* harmony export */ assertOAuthConfig: () => (/* binding */ assertOAuthConfig),
3196
- /* harmony export */ assertTokenProviderConfig: () => (/* binding */ assertTokenProviderConfig),
3197
- /* harmony export */ decodeJWT: () => (/* binding */ decodeJWT)
3569
+ /* harmony export */ parseAWSExports: () => (/* binding */ parseAWSExports)
3198
3570
  /* harmony export */ });
3199
- /* harmony import */ var _utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/convert/base64/base64Decoder.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs");
3200
- /* harmony import */ var _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorHelpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs");
3571
+ /* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
3572
+ /* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
3201
3573
 
3202
3574
 
3203
3575
 
@@ -3205,847 +3577,2394 @@ __webpack_require__.r(__webpack_exports__);
3205
3577
 
3206
3578
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3207
3579
  // SPDX-License-Identifier: Apache-2.0
3208
- function assertTokenProviderConfig(cognitoConfig) {
3209
- let assertionValid = true; // assume valid until otherwise proveed
3210
- if (!cognitoConfig) {
3211
- assertionValid = false;
3580
+ const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('parseAWSExports');
3581
+ const authTypeMapping = {
3582
+ API_KEY: 'apiKey',
3583
+ AWS_IAM: 'iam',
3584
+ AMAZON_COGNITO_USER_POOLS: 'userPool',
3585
+ OPENID_CONNECT: 'oidc',
3586
+ NONE: 'none',
3587
+ AWS_LAMBDA: 'lambda',
3588
+ // `LAMBDA` is an incorrect value that was added during the v6 rewrite.
3589
+ // Keeping it as a valid value until v7 to prevent breaking customers who might
3590
+ // be relying on it as a workaround.
3591
+ // ref: https://github.com/aws-amplify/amplify-js/pull/12922
3592
+ // TODO: @v7 remove next line
3593
+ LAMBDA: 'lambda',
3594
+ };
3595
+ /**
3596
+ * Converts the object imported from `aws-exports.js` or `amplifyconfiguration.json` files generated by
3597
+ * the Amplify CLI into an object that conforms to the {@link ResourcesConfig}.
3598
+ *
3599
+ * @param config A configuration object imported from `aws-exports.js` or `amplifyconfiguration.json`.
3600
+ *
3601
+ * @returns An object that conforms to the {@link ResourcesConfig} .
3602
+ */
3603
+ const parseAWSExports = (config = {}) => {
3604
+ if (!Object.prototype.hasOwnProperty.call(config, 'aws_project_region')) {
3605
+ throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyError({
3606
+ name: 'InvalidParameterException',
3607
+ message: 'Invalid config parameter.',
3608
+ recoverySuggestion: 'Ensure passing the config object imported from `amplifyconfiguration.json`.',
3609
+ });
3212
3610
  }
3213
- else {
3214
- assertionValid =
3215
- !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;
3611
+ const { aws_appsync_apiKey, aws_appsync_authenticationType, aws_appsync_graphqlEndpoint, aws_appsync_region, aws_bots_config, aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration, aws_cognito_mfa_types, aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms, aws_cognito_signup_attributes, aws_cognito_social_providers, aws_cognito_username_attributes, aws_mandatory_sign_in, aws_mobile_analytics_app_id, aws_mobile_analytics_app_region, aws_user_files_s3_bucket, aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id, aws_user_pools_web_client_id, geo, oauth, predictions, aws_cloud_logic_custom, Notifications, modelIntrospection, } = config;
3612
+ const amplifyConfig = {};
3613
+ // Analytics
3614
+ if (aws_mobile_analytics_app_id) {
3615
+ amplifyConfig.Analytics = {
3616
+ Pinpoint: {
3617
+ appId: aws_mobile_analytics_app_id,
3618
+ region: aws_mobile_analytics_app_region,
3619
+ },
3620
+ };
3216
3621
  }
3217
- (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(assertionValid, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.AuthUserPoolException);
3218
- }
3219
- function assertOAuthConfig(cognitoConfig) {
3220
- const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
3221
- !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
3222
- !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&
3223
- !!cognitoConfig?.loginWith?.oauth?.responseType;
3224
- (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validOAuthConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.OAuthNotConfigureException);
3225
- }
3226
- function assertIdentityPoolIdConfig(cognitoConfig) {
3227
- const validConfig = !!cognitoConfig?.identityPoolId;
3228
- (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
3229
- }
3230
- /**
3231
- * Decodes payload of JWT token
3232
- *
3233
- * @param {String} token A string representing a token to be decoded
3234
- * @throws {@link Error} - Throws error when token is invalid or payload malformed.
3235
- */
3236
- function decodeJWT(token) {
3237
- const tokenParts = token.split('.');
3238
- if (tokenParts.length !== 3) {
3239
- throw new Error('Invalid token');
3622
+ // Notifications
3623
+ const { InAppMessaging, Push } = Notifications ?? {};
3624
+ if (InAppMessaging?.AWSPinpoint || Push?.AWSPinpoint) {
3625
+ if (InAppMessaging?.AWSPinpoint) {
3626
+ const { appId, region } = InAppMessaging.AWSPinpoint;
3627
+ amplifyConfig.Notifications = {
3628
+ InAppMessaging: {
3629
+ Pinpoint: {
3630
+ appId,
3631
+ region,
3632
+ },
3633
+ },
3634
+ };
3635
+ }
3636
+ if (Push?.AWSPinpoint) {
3637
+ const { appId, region } = Push.AWSPinpoint;
3638
+ amplifyConfig.Notifications = {
3639
+ ...amplifyConfig.Notifications,
3640
+ PushNotification: {
3641
+ Pinpoint: {
3642
+ appId,
3643
+ region,
3644
+ },
3645
+ },
3646
+ };
3647
+ }
3240
3648
  }
3241
- try {
3242
- const base64WithUrlSafe = tokenParts[1];
3243
- const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');
3244
- const jsonStr = decodeURIComponent(_utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__.base64Decoder
3245
- .convert(base64)
3246
- .split('')
3247
- .map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)
3248
- .join(''));
3249
- const payload = JSON.parse(jsonStr);
3250
- return {
3251
- toString: () => token,
3252
- payload,
3649
+ // Interactions
3650
+ if (Array.isArray(aws_bots_config)) {
3651
+ amplifyConfig.Interactions = {
3652
+ LexV1: Object.fromEntries(aws_bots_config.map(bot => [bot.name, bot])),
3253
3653
  };
3254
3654
  }
3255
- catch (err) {
3256
- throw new Error('Invalid token payload');
3655
+ // API
3656
+ if (aws_appsync_graphqlEndpoint) {
3657
+ const defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];
3658
+ if (!defaultAuthMode) {
3659
+ logger.debug(`Invalid authentication type ${aws_appsync_authenticationType}. Falling back to IAM.`);
3660
+ }
3661
+ amplifyConfig.API = {
3662
+ GraphQL: {
3663
+ endpoint: aws_appsync_graphqlEndpoint,
3664
+ apiKey: aws_appsync_apiKey,
3665
+ region: aws_appsync_region,
3666
+ defaultAuthMode: defaultAuthMode ?? 'iam',
3667
+ },
3668
+ };
3669
+ if (modelIntrospection) {
3670
+ amplifyConfig.API.GraphQL.modelIntrospection = modelIntrospection;
3671
+ }
3257
3672
  }
3258
- }
3673
+ // Auth
3674
+ const mfaConfig = aws_cognito_mfa_configuration
3675
+ ? {
3676
+ status: aws_cognito_mfa_configuration &&
3677
+ aws_cognito_mfa_configuration.toLowerCase(),
3678
+ totpEnabled: aws_cognito_mfa_types?.includes('TOTP') ?? false,
3679
+ smsEnabled: aws_cognito_mfa_types?.includes('SMS') ?? false,
3680
+ }
3681
+ : undefined;
3682
+ const passwordFormatConfig = aws_cognito_password_protection_settings
3683
+ ? {
3684
+ minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
3685
+ requireLowercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_LOWERCASE') ?? false,
3686
+ requireUppercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_UPPERCASE') ?? false,
3687
+ requireNumbers: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_NUMBERS') ?? false,
3688
+ requireSpecialCharacters: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_SYMBOLS') ?? false,
3689
+ }
3690
+ : undefined;
3691
+ const mergedUserAttributes = Array.from(new Set([
3692
+ ...(aws_cognito_verification_mechanisms ?? []),
3693
+ ...(aws_cognito_signup_attributes ?? []),
3694
+ ]));
3695
+ const userAttributes = mergedUserAttributes.reduce((attributes, key) => ({
3696
+ ...attributes,
3697
+ // All user attributes generated by the CLI are required
3698
+ [key.toLowerCase()]: { required: true },
3699
+ }), {});
3700
+ const loginWithEmailEnabled = aws_cognito_username_attributes?.includes('EMAIL') ?? false;
3701
+ const loginWithPhoneEnabled = aws_cognito_username_attributes?.includes('PHONE_NUMBER') ?? false;
3702
+ if (aws_cognito_identity_pool_id || aws_user_pools_id) {
3703
+ amplifyConfig.Auth = {
3704
+ Cognito: {
3705
+ identityPoolId: aws_cognito_identity_pool_id,
3706
+ allowGuestAccess: aws_mandatory_sign_in !== 'enable',
3707
+ signUpVerificationMethod: aws_cognito_sign_up_verification_method,
3708
+ userAttributes,
3709
+ userPoolClientId: aws_user_pools_web_client_id,
3710
+ userPoolId: aws_user_pools_id,
3711
+ mfa: mfaConfig,
3712
+ passwordFormat: passwordFormatConfig,
3713
+ loginWith: {
3714
+ username: !(loginWithEmailEnabled || loginWithPhoneEnabled),
3715
+ email: loginWithEmailEnabled,
3716
+ phone: loginWithPhoneEnabled,
3717
+ },
3718
+ },
3719
+ };
3720
+ }
3721
+ const hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
3722
+ const hasSocialProviderConfig = aws_cognito_social_providers
3723
+ ? aws_cognito_social_providers.length > 0
3724
+ : false;
3725
+ if (amplifyConfig.Auth && hasOAuthConfig) {
3726
+ amplifyConfig.Auth.Cognito.loginWith = {
3727
+ ...amplifyConfig.Auth.Cognito.loginWith,
3728
+ oauth: {
3729
+ ...getOAuthConfig(oauth),
3730
+ ...(hasSocialProviderConfig && {
3731
+ providers: parseSocialProviders(aws_cognito_social_providers),
3732
+ }),
3733
+ },
3734
+ };
3735
+ }
3736
+ // Storage
3737
+ if (aws_user_files_s3_bucket) {
3738
+ amplifyConfig.Storage = {
3739
+ S3: {
3740
+ bucket: aws_user_files_s3_bucket,
3741
+ region: aws_user_files_s3_bucket_region,
3742
+ dangerouslyConnectToHttpEndpointForTesting: aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing,
3743
+ },
3744
+ };
3745
+ }
3746
+ // Geo
3747
+ if (geo) {
3748
+ const { amazon_location_service } = geo;
3749
+ amplifyConfig.Geo = {
3750
+ LocationService: {
3751
+ maps: amazon_location_service.maps,
3752
+ geofenceCollections: amazon_location_service.geofenceCollections,
3753
+ searchIndices: amazon_location_service.search_indices,
3754
+ region: amazon_location_service.region,
3755
+ },
3756
+ };
3757
+ }
3758
+ // REST API
3759
+ if (aws_cloud_logic_custom) {
3760
+ amplifyConfig.API = {
3761
+ ...amplifyConfig.API,
3762
+ REST: aws_cloud_logic_custom.reduce((acc, api) => {
3763
+ const { name, endpoint, region, service } = api;
3764
+ return {
3765
+ ...acc,
3766
+ [name]: {
3767
+ endpoint,
3768
+ ...(service ? { service } : undefined),
3769
+ ...(region ? { region } : undefined),
3770
+ },
3771
+ };
3772
+ }, {}),
3773
+ };
3774
+ }
3775
+ // Predictions
3776
+ if (predictions) {
3777
+ // map VoiceId from speechGenerator defaults to voiceId
3778
+ const { VoiceId: voiceId } = predictions?.convert?.speechGenerator?.defaults ?? {};
3779
+ amplifyConfig.Predictions = voiceId
3780
+ ? {
3781
+ ...predictions,
3782
+ convert: {
3783
+ ...predictions.convert,
3784
+ speechGenerator: {
3785
+ ...predictions.convert.speechGenerator,
3786
+ defaults: { voiceId },
3787
+ },
3788
+ },
3789
+ }
3790
+ : predictions;
3791
+ }
3792
+ return amplifyConfig;
3793
+ };
3794
+ const getRedirectUrl = (redirectStr) => redirectStr?.split(',') ?? [];
3795
+ const getOAuthConfig = ({ domain, scope, redirectSignIn, redirectSignOut, responseType, }) => ({
3796
+ domain,
3797
+ scopes: scope,
3798
+ redirectSignIn: getRedirectUrl(redirectSignIn),
3799
+ redirectSignOut: getRedirectUrl(redirectSignOut),
3800
+ responseType,
3801
+ });
3802
+ const parseSocialProviders = (aws_cognito_social_providers) => {
3803
+ return aws_cognito_social_providers.map((provider) => {
3804
+ const updatedProvider = provider.toLowerCase();
3805
+ return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);
3806
+ });
3807
+ };
3259
3808
 
3260
3809
 
3261
- //# sourceMappingURL=index.mjs.map
3810
+ //# sourceMappingURL=parseAWSExports.mjs.map
3262
3811
 
3263
3812
 
3264
3813
  /***/ }),
3265
3814
 
3266
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs":
3267
- /*!***************************************************************************!*\
3268
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs ***!
3269
- \***************************************************************************/
3815
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs":
3816
+ /*!*************************************************************************!*\
3817
+ !*** ./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs ***!
3818
+ \*************************************************************************/
3270
3819
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3271
3820
 
3272
3821
  "use strict";
3273
3822
  __webpack_require__.r(__webpack_exports__);
3274
3823
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3275
- /* harmony export */ CookieStorage: () => (/* binding */ CookieStorage)
3824
+ /* harmony export */ isAmplifyOutputs: () => (/* binding */ isAmplifyOutputs),
3825
+ /* harmony export */ parseAmplifyOutputs: () => (/* binding */ parseAmplifyOutputs),
3826
+ /* harmony export */ parseAnalytics: () => (/* binding */ parseAnalytics)
3276
3827
  /* harmony export */ });
3277
- /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs");
3278
-
3279
-
3280
3828
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3281
3829
  // SPDX-License-Identifier: Apache-2.0
3282
- class CookieStorage {
3283
- constructor(data = {}) {
3284
- const { path, domain, expires, sameSite, secure } = data;
3285
- this.domain = domain;
3286
- this.path = path || '/';
3287
- this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')
3288
- ? expires
3289
- : 365;
3290
- this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')
3291
- ? secure
3292
- : true;
3293
- if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {
3294
- if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {
3295
- throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');
3296
- }
3297
- if (sameSite === 'none' && !this.secure) {
3298
- throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');
3299
- }
3300
- this.sameSite = sameSite;
3301
- }
3830
+ function isAmplifyOutputs(config) {
3831
+ // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version
3832
+ const { version } = config;
3833
+ if (!version) {
3834
+ return false;
3302
3835
  }
3303
- async setItem(key, value) {
3304
- js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set(key, value, this.getData());
3836
+ return version.startsWith('1');
3837
+ }
3838
+ function parseStorage(amplifyOutputsStorageProperties) {
3839
+ if (!amplifyOutputsStorageProperties) {
3840
+ return undefined;
3305
3841
  }
3306
- async getItem(key) {
3307
- const item = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get(key);
3308
- return item ?? null;
3842
+ const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;
3843
+ return {
3844
+ S3: {
3845
+ bucket: bucket_name,
3846
+ region: aws_region,
3847
+ buckets: buckets && createBucketInfoMap(buckets),
3848
+ },
3849
+ };
3850
+ }
3851
+ function parseAuth(amplifyOutputsAuthProperties) {
3852
+ if (!amplifyOutputsAuthProperties) {
3853
+ return undefined;
3854
+ }
3855
+ const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;
3856
+ const authConfig = {
3857
+ Cognito: {
3858
+ userPoolId: user_pool_id,
3859
+ userPoolClientId: user_pool_client_id,
3860
+ groups,
3861
+ },
3862
+ };
3863
+ if (identity_pool_id) {
3864
+ authConfig.Cognito = {
3865
+ ...authConfig.Cognito,
3866
+ identityPoolId: identity_pool_id,
3867
+ };
3309
3868
  }
3310
- async removeItem(key) {
3311
- js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].remove(key, this.getData());
3869
+ if (password_policy) {
3870
+ authConfig.Cognito.passwordFormat = {
3871
+ requireLowercase: password_policy.require_lowercase,
3872
+ requireNumbers: password_policy.require_numbers,
3873
+ requireUppercase: password_policy.require_uppercase,
3874
+ requireSpecialCharacters: password_policy.require_symbols,
3875
+ minLength: password_policy.min_length ?? 6,
3876
+ };
3312
3877
  }
3313
- async clear() {
3314
- const cookie = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get();
3315
- const promises = Object.keys(cookie).map(key => this.removeItem(key));
3316
- await Promise.all(promises);
3878
+ if (mfa_configuration) {
3879
+ authConfig.Cognito.mfa = {
3880
+ status: getMfaStatus(mfa_configuration),
3881
+ smsEnabled: mfa_methods?.includes('SMS'),
3882
+ totpEnabled: mfa_methods?.includes('TOTP'),
3883
+ };
3317
3884
  }
3318
- getData() {
3319
- return {
3320
- path: this.path,
3321
- expires: this.expires,
3322
- domain: this.domain,
3323
- secure: this.secure,
3324
- ...(this.sameSite && { sameSite: this.sameSite }),
3885
+ if (unauthenticated_identities_enabled) {
3886
+ authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;
3887
+ }
3888
+ if (oauth) {
3889
+ authConfig.Cognito.loginWith = {
3890
+ oauth: {
3891
+ domain: oauth.domain,
3892
+ redirectSignIn: oauth.redirect_sign_in_uri,
3893
+ redirectSignOut: oauth.redirect_sign_out_uri,
3894
+ responseType: oauth.response_type === 'token' ? 'token' : 'code',
3895
+ scopes: oauth.scopes,
3896
+ providers: getOAuthProviders(oauth.identity_providers),
3897
+ },
3898
+ };
3899
+ }
3900
+ if (username_attributes) {
3901
+ authConfig.Cognito.loginWith = {
3902
+ ...authConfig.Cognito.loginWith,
3903
+ email: username_attributes.includes('email'),
3904
+ phone: username_attributes.includes('phone_number'),
3905
+ // Signing in with a username is not currently supported in Gen2, this should always evaluate to false
3906
+ username: username_attributes.includes('username'),
3907
+ };
3908
+ }
3909
+ if (standard_required_attributes) {
3910
+ authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});
3911
+ }
3912
+ return authConfig;
3913
+ }
3914
+ function parseAnalytics(amplifyOutputsAnalyticsProperties) {
3915
+ if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {
3916
+ return undefined;
3917
+ }
3918
+ const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;
3919
+ return {
3920
+ Pinpoint: {
3921
+ appId: amazon_pinpoint.app_id,
3922
+ region: amazon_pinpoint.aws_region,
3923
+ },
3924
+ };
3925
+ }
3926
+ function parseGeo(amplifyOutputsAnalyticsProperties) {
3927
+ if (!amplifyOutputsAnalyticsProperties) {
3928
+ return undefined;
3929
+ }
3930
+ const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;
3931
+ return {
3932
+ LocationService: {
3933
+ region: aws_region,
3934
+ searchIndices: search_indices,
3935
+ geofenceCollections: geofence_collections,
3936
+ maps,
3937
+ },
3938
+ };
3939
+ }
3940
+ function parseData(amplifyOutputsDataProperties) {
3941
+ if (!amplifyOutputsDataProperties) {
3942
+ return undefined;
3943
+ }
3944
+ const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;
3945
+ const GraphQL = {
3946
+ endpoint: url,
3947
+ defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
3948
+ region: aws_region,
3949
+ apiKey: api_key,
3950
+ modelIntrospection: model_introspection,
3951
+ };
3952
+ return {
3953
+ GraphQL,
3954
+ };
3955
+ }
3956
+ function parseCustom(amplifyOutputsCustomProperties) {
3957
+ if (!amplifyOutputsCustomProperties?.events) {
3958
+ return undefined;
3959
+ }
3960
+ const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;
3961
+ const Events = {
3962
+ endpoint: url,
3963
+ defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
3964
+ region: aws_region,
3965
+ apiKey: api_key,
3966
+ };
3967
+ return {
3968
+ Events,
3969
+ };
3970
+ }
3971
+ function parseNotifications(amplifyOutputsNotificationsProperties) {
3972
+ if (!amplifyOutputsNotificationsProperties) {
3973
+ return undefined;
3974
+ }
3975
+ const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;
3976
+ const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');
3977
+ const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');
3978
+ if (!(hasInAppMessaging || hasPushNotification)) {
3979
+ return undefined;
3980
+ }
3981
+ // At this point, we know the Amplify outputs contains at least one supported channel
3982
+ const notificationsConfig = {};
3983
+ if (hasInAppMessaging) {
3984
+ notificationsConfig.InAppMessaging = {
3985
+ Pinpoint: {
3986
+ appId: amazon_pinpoint_app_id,
3987
+ region: aws_region,
3988
+ },
3989
+ };
3990
+ }
3991
+ if (hasPushNotification) {
3992
+ notificationsConfig.PushNotification = {
3993
+ Pinpoint: {
3994
+ appId: amazon_pinpoint_app_id,
3995
+ region: aws_region,
3996
+ },
3325
3997
  };
3326
3998
  }
3999
+ return notificationsConfig;
4000
+ }
4001
+ function parseAmplifyOutputs(amplifyOutputs) {
4002
+ const resourcesConfig = {};
4003
+ if (amplifyOutputs.storage) {
4004
+ resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);
4005
+ }
4006
+ if (amplifyOutputs.auth) {
4007
+ resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);
4008
+ }
4009
+ if (amplifyOutputs.analytics) {
4010
+ resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);
4011
+ }
4012
+ if (amplifyOutputs.geo) {
4013
+ resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);
4014
+ }
4015
+ if (amplifyOutputs.data) {
4016
+ resourcesConfig.API = parseData(amplifyOutputs.data);
4017
+ }
4018
+ if (amplifyOutputs.custom) {
4019
+ const customConfig = parseCustom(amplifyOutputs.custom);
4020
+ if (customConfig && 'Events' in customConfig) {
4021
+ resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
4022
+ }
4023
+ }
4024
+ if (amplifyOutputs.notifications) {
4025
+ resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);
4026
+ }
4027
+ return resourcesConfig;
4028
+ }
4029
+ const authModeNames = {
4030
+ AMAZON_COGNITO_USER_POOLS: 'userPool',
4031
+ API_KEY: 'apiKey',
4032
+ AWS_IAM: 'iam',
4033
+ AWS_LAMBDA: 'lambda',
4034
+ OPENID_CONNECT: 'oidc',
4035
+ };
4036
+ function getGraphQLAuthMode(authType) {
4037
+ return authModeNames[authType];
4038
+ }
4039
+ const providerNames = {
4040
+ GOOGLE: 'Google',
4041
+ LOGIN_WITH_AMAZON: 'Amazon',
4042
+ FACEBOOK: 'Facebook',
4043
+ SIGN_IN_WITH_APPLE: 'Apple',
4044
+ };
4045
+ function getOAuthProviders(providers = []) {
4046
+ return providers.reduce((oAuthProviders, provider) => {
4047
+ if (providerNames[provider] !== undefined) {
4048
+ oAuthProviders.push(providerNames[provider]);
4049
+ }
4050
+ return oAuthProviders;
4051
+ }, []);
4052
+ }
4053
+ function getMfaStatus(mfaConfiguration) {
4054
+ if (mfaConfiguration === 'OPTIONAL')
4055
+ return 'optional';
4056
+ if (mfaConfiguration === 'REQUIRED')
4057
+ return 'on';
4058
+ return 'off';
4059
+ }
4060
+ function createBucketInfoMap(buckets) {
4061
+ const mappedBuckets = {};
4062
+ buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {
4063
+ if (name in mappedBuckets) {
4064
+ throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);
4065
+ }
4066
+ const sanitizedPaths = paths
4067
+ ? Object.entries(paths).reduce((acc, [key, value]) => {
4068
+ if (value !== undefined) {
4069
+ acc[key] = value;
4070
+ }
4071
+ return acc;
4072
+ }, {})
4073
+ : undefined;
4074
+ mappedBuckets[name] = {
4075
+ bucketName,
4076
+ region,
4077
+ paths: sanitizedPaths,
4078
+ };
4079
+ });
4080
+ return mappedBuckets;
3327
4081
  }
3328
4082
 
3329
4083
 
3330
- //# sourceMappingURL=CookieStorage.mjs.map
4084
+ //# sourceMappingURL=parseAmplifyOutputs.mjs.map
3331
4085
 
3332
4086
 
3333
4087
  /***/ }),
3334
4088
 
3335
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs":
3336
- /*!****************************************************************************!*\
3337
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs ***!
3338
- \****************************************************************************/
4089
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Amplify.mjs":
4090
+ /*!***********************************************************************!*\
4091
+ !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Amplify.mjs ***!
4092
+ \***********************************************************************/
3339
4093
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3340
4094
 
3341
4095
  "use strict";
3342
4096
  __webpack_require__.r(__webpack_exports__);
3343
4097
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3344
- /* harmony export */ DefaultStorage: () => (/* binding */ DefaultStorage)
4098
+ /* harmony export */ Amplify: () => (/* binding */ Amplify),
4099
+ /* harmony export */ AmplifyClass: () => (/* binding */ AmplifyClass)
3345
4100
  /* harmony export */ });
3346
- /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
3347
- /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
4101
+ /* harmony import */ var _Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Hub/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs");
4102
+ /* harmony import */ var _utils_deepFreeze_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/deepFreeze.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs");
4103
+ /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs");
4104
+ /* harmony import */ var _utils_parseAmplifyConfig_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/parseAmplifyConfig.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs");
4105
+ /* harmony import */ var _aws_crypto_sha256_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-crypto/sha256-js */ "./node_modules/@aws-crypto/sha256-js/build/module/index.js");
4106
+ /* harmony import */ var _smithy_util_hex_encoding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smithy/util-hex-encoding */ "./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js");
4107
+ /* harmony import */ var _Auth_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Auth/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs");
4108
+
4109
+
4110
+
4111
+
4112
+
4113
+
4114
+
4115
+
4116
+
4117
+
4118
+
4119
+
4120
+
4121
+
4122
+
4123
+
4124
+
3348
4125
 
3349
4126
 
3350
4127
 
3351
4128
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3352
4129
  // SPDX-License-Identifier: Apache-2.0
3353
- /**
3354
- * @internal
3355
- */
3356
- class DefaultStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
4130
+ class AmplifyClass {
3357
4131
  constructor() {
3358
- super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocalStorageWithFallback)());
4132
+ this.oAuthListener = undefined;
4133
+ this.isConfigured = false;
4134
+ this.resourcesConfig = {};
4135
+ this.libraryOptions = {};
4136
+ this.Auth = new _Auth_index_mjs__WEBPACK_IMPORTED_MODULE_2__.AuthClass();
4137
+ }
4138
+ /**
4139
+ * Configures Amplify for use with your back-end resources.
4140
+ *
4141
+ * @remarks
4142
+ * This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently
4143
+ * provided values will be used after configuration.
4144
+ *
4145
+ * @remarks
4146
+ * `configure` can be used to specify additional library options where available for supported categories.
4147
+ *
4148
+ * @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.
4149
+ * @param libraryOptions - Additional options for customizing the behavior of the library.
4150
+ */
4151
+ configure(resourcesConfig, libraryOptions) {
4152
+ const resolvedResourceConfig = (0,_utils_parseAmplifyConfig_mjs__WEBPACK_IMPORTED_MODULE_3__.parseAmplifyConfig)(resourcesConfig);
4153
+ this.resourcesConfig = resolvedResourceConfig;
4154
+ if (libraryOptions) {
4155
+ this.libraryOptions = libraryOptions;
4156
+ }
4157
+ // Make resource config immutable
4158
+ this.resourcesConfig = (0,_utils_deepFreeze_mjs__WEBPACK_IMPORTED_MODULE_4__.deepFreeze)(this.resourcesConfig);
4159
+ this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);
4160
+ _Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__.Hub.dispatch('core', {
4161
+ event: 'configure',
4162
+ data: this.resourcesConfig,
4163
+ }, 'Configure', _Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__.AMPLIFY_SYMBOL);
4164
+ this.notifyOAuthListener();
4165
+ this.isConfigured = true;
4166
+ }
4167
+ /**
4168
+ * Provides access to the current back-end resource configuration for the Library.
4169
+ *
4170
+ * @returns Returns the immutable back-end resource configuration.
4171
+ */
4172
+ getConfig() {
4173
+ if (!this.isConfigured) {
4174
+ // eslint-disable-next-line no-console
4175
+ console.warn(`Amplify has not been configured. Please call Amplify.configure() before using this service.`);
4176
+ }
4177
+ return this.resourcesConfig;
4178
+ }
4179
+ /** @internal */
4180
+ [_constants_mjs__WEBPACK_IMPORTED_MODULE_6__.ADD_OAUTH_LISTENER](listener) {
4181
+ if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {
4182
+ // when Amplify has been configured with a valid OAuth config while adding the listener, run it directly
4183
+ listener(this.resourcesConfig.Auth?.Cognito);
4184
+ }
4185
+ else {
4186
+ // otherwise register the listener and run it later when Amplify gets configured with a valid oauth config
4187
+ this.oAuthListener = listener;
4188
+ }
4189
+ }
4190
+ notifyOAuthListener() {
4191
+ if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||
4192
+ !this.oAuthListener) {
4193
+ return;
4194
+ }
4195
+ this.oAuthListener(this.resourcesConfig.Auth?.Cognito);
4196
+ // the listener should only be notified once with a valid oauth config
4197
+ this.oAuthListener = undefined;
3359
4198
  }
3360
4199
  }
4200
+ /**
4201
+ * The `Amplify` utility is used to configure the library.
4202
+ *
4203
+ * @remarks
4204
+ * `Amplify` orchestrates cross-category communication within the library.
4205
+ */
4206
+ const Amplify = new AmplifyClass();
3361
4207
 
3362
4208
 
3363
- //# sourceMappingURL=DefaultStorage.mjs.map
4209
+ //# sourceMappingURL=Amplify.mjs.map
3364
4210
 
3365
4211
 
3366
4212
  /***/ }),
3367
4213
 
3368
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs":
3369
- /*!*****************************************************************************!*\
3370
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs ***!
3371
- \*****************************************************************************/
4214
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs":
4215
+ /*!**************************************************************************!*\
4216
+ !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs ***!
4217
+ \**************************************************************************/
4218
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4219
+
4220
+ "use strict";
4221
+ __webpack_require__.r(__webpack_exports__);
4222
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4223
+ /* harmony export */ AuthClass: () => (/* binding */ AuthClass)
4224
+ /* harmony export */ });
4225
+ /* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
4226
+
4227
+
4228
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4229
+ // SPDX-License-Identifier: Apache-2.0
4230
+ const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('Auth');
4231
+ class AuthClass {
4232
+ /**
4233
+ * Configure Auth category
4234
+ *
4235
+ * @internal
4236
+ *
4237
+ * @param authResourcesConfig - Resources configurations required by Auth providers.
4238
+ * @param authOptions - Client options used by library
4239
+ *
4240
+ * @returns void
4241
+ */
4242
+ configure(authResourcesConfig, authOptions) {
4243
+ this.authConfig = authResourcesConfig;
4244
+ this.authOptions = authOptions;
4245
+ if (authResourcesConfig && authResourcesConfig.Cognito?.userPoolEndpoint) {
4246
+ logger.warn(getCustomEndpointWarningMessage('Amazon Cognito User Pool'));
4247
+ }
4248
+ if (authResourcesConfig &&
4249
+ authResourcesConfig.Cognito?.identityPoolEndpoint) {
4250
+ logger.warn(getCustomEndpointWarningMessage('Amazon Cognito Identity Pool'));
4251
+ }
4252
+ }
4253
+ /**
4254
+ * Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it
4255
+ * will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh
4256
+ * of non-expired tokens with `{ forceRefresh: true }` input.
4257
+ *
4258
+ * @param options - Options configuring the fetch behavior.
4259
+ *
4260
+ * @returns Promise of current auth session {@link AuthSession}.
4261
+ */
4262
+ async fetchAuthSession(options = {}) {
4263
+ let credentialsAndIdentityId;
4264
+ let userSub;
4265
+ // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
4266
+ const tokens = await this.getTokens(options);
4267
+ if (tokens) {
4268
+ userSub = tokens.accessToken?.payload?.sub;
4269
+ // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
4270
+ credentialsAndIdentityId =
4271
+ await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({
4272
+ authConfig: this.authConfig,
4273
+ tokens,
4274
+ authenticated: true,
4275
+ forceRefresh: options.forceRefresh,
4276
+ });
4277
+ }
4278
+ else {
4279
+ // getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
4280
+ credentialsAndIdentityId =
4281
+ await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({
4282
+ authConfig: this.authConfig,
4283
+ authenticated: false,
4284
+ forceRefresh: options.forceRefresh,
4285
+ });
4286
+ }
4287
+ return {
4288
+ tokens,
4289
+ credentials: credentialsAndIdentityId?.credentials,
4290
+ identityId: credentialsAndIdentityId?.identityId,
4291
+ userSub,
4292
+ };
4293
+ }
4294
+ async clearCredentials() {
4295
+ await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();
4296
+ }
4297
+ async getTokens(options) {
4298
+ return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);
4299
+ }
4300
+ }
4301
+ const getCustomEndpointWarningMessage = (target) => `You are using a custom Amazon ${target} endpoint, ensure the endpoint is correct.`;
4302
+
4303
+
4304
+ //# sourceMappingURL=index.mjs.map
4305
+
4306
+
4307
+ /***/ }),
4308
+
4309
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs":
4310
+ /*!***************************************************************************************!*\
4311
+ !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs ***!
4312
+ \***************************************************************************************/
4313
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4314
+
4315
+ "use strict";
4316
+ __webpack_require__.r(__webpack_exports__);
4317
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4318
+ /* harmony export */ AuthConfigurationErrorCode: () => (/* binding */ AuthConfigurationErrorCode),
4319
+ /* harmony export */ assert: () => (/* binding */ assert)
4320
+ /* harmony export */ });
4321
+ /* harmony import */ var _errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../errors/createAssertionFunction.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs");
4322
+
4323
+
4324
+
4325
+
4326
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4327
+ // SPDX-License-Identifier: Apache-2.0
4328
+ var AuthConfigurationErrorCode;
4329
+ (function (AuthConfigurationErrorCode) {
4330
+ AuthConfigurationErrorCode["AuthTokenConfigException"] = "AuthTokenConfigException";
4331
+ AuthConfigurationErrorCode["AuthUserPoolAndIdentityPoolException"] = "AuthUserPoolAndIdentityPoolException";
4332
+ AuthConfigurationErrorCode["AuthUserPoolException"] = "AuthUserPoolException";
4333
+ AuthConfigurationErrorCode["InvalidIdentityPoolIdException"] = "InvalidIdentityPoolIdException";
4334
+ AuthConfigurationErrorCode["OAuthNotConfigureException"] = "OAuthNotConfigureException";
4335
+ })(AuthConfigurationErrorCode || (AuthConfigurationErrorCode = {}));
4336
+ const authConfigurationErrorMap = {
4337
+ [AuthConfigurationErrorCode.AuthTokenConfigException]: {
4338
+ message: 'Auth Token Provider not configured.',
4339
+ recoverySuggestion: 'Make sure to call Amplify.configure in your app.',
4340
+ },
4341
+ [AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException]: {
4342
+ message: 'Auth UserPool or IdentityPool not configured.',
4343
+ recoverySuggestion: 'Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId.',
4344
+ },
4345
+ [AuthConfigurationErrorCode.AuthUserPoolException]: {
4346
+ message: 'Auth UserPool not configured.',
4347
+ recoverySuggestion: 'Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId.',
4348
+ },
4349
+ [AuthConfigurationErrorCode.InvalidIdentityPoolIdException]: {
4350
+ message: 'Invalid identity pool id provided.',
4351
+ recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',
4352
+ },
4353
+ [AuthConfigurationErrorCode.OAuthNotConfigureException]: {
4354
+ message: 'oauth param not configured.',
4355
+ recoverySuggestion: 'Make sure to call Amplify.configure with oauth parameter in your app.',
4356
+ },
4357
+ };
4358
+ const assert = (0,_errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__.createAssertionFunction)(authConfigurationErrorMap);
4359
+
4360
+
4361
+ //# sourceMappingURL=errorHelpers.mjs.map
4362
+
4363
+
4364
+ /***/ }),
4365
+
4366
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs":
4367
+ /*!********************************************************************************!*\
4368
+ !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs ***!
4369
+ \********************************************************************************/
4370
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4371
+
4372
+ "use strict";
4373
+ __webpack_require__.r(__webpack_exports__);
4374
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4375
+ /* harmony export */ assertIdentityPoolIdConfig: () => (/* binding */ assertIdentityPoolIdConfig),
4376
+ /* harmony export */ assertOAuthConfig: () => (/* binding */ assertOAuthConfig),
4377
+ /* harmony export */ assertTokenProviderConfig: () => (/* binding */ assertTokenProviderConfig),
4378
+ /* harmony export */ decodeJWT: () => (/* binding */ decodeJWT)
4379
+ /* harmony export */ });
4380
+ /* harmony import */ var _utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/convert/base64/base64Decoder.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs");
4381
+ /* harmony import */ var _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorHelpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs");
4382
+
4383
+
4384
+
4385
+
4386
+
4387
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4388
+ // SPDX-License-Identifier: Apache-2.0
4389
+ function assertTokenProviderConfig(cognitoConfig) {
4390
+ let assertionValid = true; // assume valid until otherwise proveed
4391
+ if (!cognitoConfig) {
4392
+ assertionValid = false;
4393
+ }
4394
+ else {
4395
+ assertionValid =
4396
+ !!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;
4397
+ }
4398
+ (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(assertionValid, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.AuthUserPoolException);
4399
+ }
4400
+ function assertOAuthConfig(cognitoConfig) {
4401
+ const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
4402
+ !!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
4403
+ !!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&
4404
+ !!cognitoConfig?.loginWith?.oauth?.responseType;
4405
+ (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validOAuthConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.OAuthNotConfigureException);
4406
+ }
4407
+ function assertIdentityPoolIdConfig(cognitoConfig) {
4408
+ const validConfig = !!cognitoConfig?.identityPoolId;
4409
+ (0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
4410
+ }
4411
+ /**
4412
+ * Decodes payload of JWT token
4413
+ *
4414
+ * @param {String} token A string representing a token to be decoded
4415
+ * @throws {@link Error} - Throws error when token is invalid or payload malformed.
4416
+ */
4417
+ function decodeJWT(token) {
4418
+ const tokenParts = token.split('.');
4419
+ if (tokenParts.length !== 3) {
4420
+ throw new Error('Invalid token');
4421
+ }
4422
+ try {
4423
+ const base64WithUrlSafe = tokenParts[1];
4424
+ const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');
4425
+ const jsonStr = decodeURIComponent(_utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__.base64Decoder
4426
+ .convert(base64)
4427
+ .split('')
4428
+ .map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)
4429
+ .join(''));
4430
+ const payload = JSON.parse(jsonStr);
4431
+ return {
4432
+ toString: () => token,
4433
+ payload,
4434
+ };
4435
+ }
4436
+ catch (err) {
4437
+ throw new Error('Invalid token payload');
4438
+ }
4439
+ }
4440
+
4441
+
4442
+ //# sourceMappingURL=index.mjs.map
4443
+
4444
+
4445
+ /***/ }),
4446
+
4447
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs":
4448
+ /*!*************************************************************************!*\
4449
+ !*** ./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs ***!
4450
+ \*************************************************************************/
4451
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4452
+
4453
+ "use strict";
4454
+ __webpack_require__.r(__webpack_exports__);
4455
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4456
+ /* harmony export */ ADD_OAUTH_LISTENER: () => (/* binding */ ADD_OAUTH_LISTENER)
4457
+ /* harmony export */ });
4458
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4459
+ // SPDX-License-Identifier: Apache-2.0
4460
+ const ADD_OAUTH_LISTENER = Symbol('oauth-listener');
4461
+
4462
+
4463
+ //# sourceMappingURL=constants.mjs.map
4464
+
4465
+
4466
+ /***/ }),
4467
+
4468
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs":
4469
+ /*!***************************************************************************!*\
4470
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs ***!
4471
+ \***************************************************************************/
4472
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4473
+
4474
+ "use strict";
4475
+ __webpack_require__.r(__webpack_exports__);
4476
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4477
+ /* harmony export */ CookieStorage: () => (/* binding */ CookieStorage)
4478
+ /* harmony export */ });
4479
+ /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs");
4480
+
4481
+
4482
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4483
+ // SPDX-License-Identifier: Apache-2.0
4484
+ class CookieStorage {
4485
+ constructor(data = {}) {
4486
+ const { path, domain, expires, sameSite, secure } = data;
4487
+ this.domain = domain;
4488
+ this.path = path || '/';
4489
+ this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')
4490
+ ? expires
4491
+ : 365;
4492
+ this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')
4493
+ ? secure
4494
+ : true;
4495
+ if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {
4496
+ if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {
4497
+ throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');
4498
+ }
4499
+ if (sameSite === 'none' && !this.secure) {
4500
+ throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');
4501
+ }
4502
+ this.sameSite = sameSite;
4503
+ }
4504
+ }
4505
+ async setItem(key, value) {
4506
+ js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set(key, value, this.getData());
4507
+ }
4508
+ async getItem(key) {
4509
+ const item = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get(key);
4510
+ return item ?? null;
4511
+ }
4512
+ async removeItem(key) {
4513
+ js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].remove(key, this.getData());
4514
+ }
4515
+ async clear() {
4516
+ const cookie = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get();
4517
+ const promises = Object.keys(cookie).map(key => this.removeItem(key));
4518
+ await Promise.all(promises);
4519
+ }
4520
+ getData() {
4521
+ return {
4522
+ path: this.path,
4523
+ expires: this.expires,
4524
+ domain: this.domain,
4525
+ secure: this.secure,
4526
+ ...(this.sameSite && { sameSite: this.sameSite }),
4527
+ };
4528
+ }
4529
+ }
4530
+
4531
+
4532
+ //# sourceMappingURL=CookieStorage.mjs.map
4533
+
4534
+
4535
+ /***/ }),
4536
+
4537
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs":
4538
+ /*!****************************************************************************!*\
4539
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs ***!
4540
+ \****************************************************************************/
4541
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4542
+
4543
+ "use strict";
4544
+ __webpack_require__.r(__webpack_exports__);
4545
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4546
+ /* harmony export */ DefaultStorage: () => (/* binding */ DefaultStorage)
4547
+ /* harmony export */ });
4548
+ /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
4549
+ /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
4550
+
4551
+
4552
+
4553
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4554
+ // SPDX-License-Identifier: Apache-2.0
4555
+ /**
4556
+ * @internal
4557
+ */
4558
+ class DefaultStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
4559
+ constructor() {
4560
+ super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocalStorageWithFallback)());
4561
+ }
4562
+ }
4563
+
4564
+
4565
+ //# sourceMappingURL=DefaultStorage.mjs.map
4566
+
4567
+
4568
+ /***/ }),
4569
+
4570
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs":
4571
+ /*!*****************************************************************************!*\
4572
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs ***!
4573
+ \*****************************************************************************/
4574
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4575
+
4576
+ "use strict";
4577
+ __webpack_require__.r(__webpack_exports__);
4578
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4579
+ /* harmony export */ InMemoryStorage: () => (/* binding */ InMemoryStorage)
4580
+ /* harmony export */ });
4581
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4582
+ // SPDX-License-Identifier: Apache-2.0
4583
+ /**
4584
+ * @internal
4585
+ */
4586
+ class InMemoryStorage {
4587
+ constructor() {
4588
+ this.storage = new Map();
4589
+ }
4590
+ get length() {
4591
+ return this.storage.size;
4592
+ }
4593
+ key(index) {
4594
+ if (index > this.length - 1) {
4595
+ return null;
4596
+ }
4597
+ return Array.from(this.storage.keys())[index];
4598
+ }
4599
+ setItem(key, value) {
4600
+ this.storage.set(key, value);
4601
+ }
4602
+ getItem(key) {
4603
+ return this.storage.get(key) ?? null;
4604
+ }
4605
+ removeItem(key) {
4606
+ this.storage.delete(key);
4607
+ }
4608
+ clear() {
4609
+ this.storage.clear();
4610
+ }
4611
+ }
4612
+
4613
+
4614
+ //# sourceMappingURL=InMemoryStorage.mjs.map
4615
+
4616
+
4617
+ /***/ }),
4618
+
4619
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs":
4620
+ /*!*****************************************************************************!*\
4621
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs ***!
4622
+ \*****************************************************************************/
4623
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4624
+
4625
+ "use strict";
4626
+ __webpack_require__.r(__webpack_exports__);
4627
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4628
+ /* harmony export */ KeyValueStorage: () => (/* binding */ KeyValueStorage)
4629
+ /* harmony export */ });
4630
+ /* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
4631
+
4632
+
4633
+
4634
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4635
+ // SPDX-License-Identifier: Apache-2.0
4636
+ /**
4637
+ * @internal
4638
+ */
4639
+ class KeyValueStorage {
4640
+ constructor(storage) {
4641
+ this.storage = storage;
4642
+ }
4643
+ /**
4644
+ * This is used to set a specific item in storage
4645
+ * @param {string} key - the key for the item
4646
+ * @param {object} value - the value
4647
+ * @returns {string} value that was set
4648
+ */
4649
+ async setItem(key, value) {
4650
+ if (!this.storage)
4651
+ throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
4652
+ this.storage.setItem(key, value);
4653
+ }
4654
+ /**
4655
+ * This is used to get a specific key from storage
4656
+ * @param {string} key - the key for the item
4657
+ * This is used to clear the storage
4658
+ * @returns {string} the data item
4659
+ */
4660
+ async getItem(key) {
4661
+ if (!this.storage)
4662
+ throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
4663
+ return this.storage.getItem(key);
4664
+ }
4665
+ /**
4666
+ * This is used to remove an item from storage
4667
+ * @param {string} key - the key being set
4668
+ * @returns {string} value - value that was deleted
4669
+ */
4670
+ async removeItem(key) {
4671
+ if (!this.storage)
4672
+ throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
4673
+ this.storage.removeItem(key);
4674
+ }
4675
+ /**
4676
+ * This is used to clear the storage
4677
+ * @returns {string} nothing
4678
+ */
4679
+ async clear() {
4680
+ if (!this.storage)
4681
+ throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
4682
+ this.storage.clear();
4683
+ }
4684
+ }
4685
+
4686
+
4687
+ //# sourceMappingURL=KeyValueStorage.mjs.map
4688
+
4689
+
4690
+ /***/ }),
4691
+
4692
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs":
4693
+ /*!****************************************************************************!*\
4694
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs ***!
4695
+ \****************************************************************************/
4696
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4697
+
4698
+ "use strict";
4699
+ __webpack_require__.r(__webpack_exports__);
4700
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4701
+ /* harmony export */ SessionStorage: () => (/* binding */ SessionStorage)
4702
+ /* harmony export */ });
4703
+ /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
4704
+ /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
4705
+
4706
+
4707
+
4708
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4709
+ // SPDX-License-Identifier: Apache-2.0
4710
+ /**
4711
+ * @internal
4712
+ */
4713
+ class SessionStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
4714
+ constructor() {
4715
+ super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
4716
+ }
4717
+ }
4718
+
4719
+
4720
+ //# sourceMappingURL=SessionStorage.mjs.map
4721
+
4722
+
4723
+ /***/ }),
4724
+
4725
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs":
4726
+ /*!*********************************************************************************!*\
4727
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs ***!
4728
+ \*********************************************************************************/
4729
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4730
+
4731
+ "use strict";
4732
+ __webpack_require__.r(__webpack_exports__);
4733
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4734
+ /* harmony export */ SyncKeyValueStorage: () => (/* binding */ SyncKeyValueStorage)
4735
+ /* harmony export */ });
4736
+ /* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
4737
+
4738
+
4739
+
4740
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4741
+ // SPDX-License-Identifier: Apache-2.0
4742
+ /**
4743
+ * @internal
4744
+ */
4745
+ class SyncKeyValueStorage {
4746
+ constructor(storage) {
4747
+ this._storage = storage;
4748
+ }
4749
+ get storage() {
4750
+ if (!this._storage)
4751
+ throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
4752
+ return this._storage;
4753
+ }
4754
+ /**
4755
+ * This is used to set a specific item in storage
4756
+ * @param {string} key - the key for the item
4757
+ * @param {object} value - the value
4758
+ * @returns {string} value that was set
4759
+ */
4760
+ setItem(key, value) {
4761
+ this.storage.setItem(key, value);
4762
+ }
4763
+ /**
4764
+ * This is used to get a specific key from storage
4765
+ * @param {string} key - the key for the item
4766
+ * This is used to clear the storage
4767
+ * @returns {string} the data item
4768
+ */
4769
+ getItem(key) {
4770
+ return this.storage.getItem(key);
4771
+ }
4772
+ /**
4773
+ * This is used to remove an item from storage
4774
+ * @param {string} key - the key being set
4775
+ * @returns {string} value - value that was deleted
4776
+ */
4777
+ removeItem(key) {
4778
+ this.storage.removeItem(key);
4779
+ }
4780
+ /**
4781
+ * This is used to clear the storage
4782
+ * @returns {string} nothing
4783
+ */
4784
+ clear() {
4785
+ this.storage.clear();
4786
+ }
4787
+ }
4788
+
4789
+
4790
+ //# sourceMappingURL=SyncKeyValueStorage.mjs.map
4791
+
4792
+
4793
+ /***/ }),
4794
+
4795
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs":
4796
+ /*!********************************************************************************!*\
4797
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs ***!
4798
+ \********************************************************************************/
4799
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4800
+
4801
+ "use strict";
4802
+ __webpack_require__.r(__webpack_exports__);
4803
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4804
+ /* harmony export */ SyncSessionStorage: () => (/* binding */ SyncSessionStorage)
4805
+ /* harmony export */ });
4806
+ /* harmony import */ var _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SyncKeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs");
4807
+ /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
4808
+
4809
+
4810
+
4811
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4812
+ // SPDX-License-Identifier: Apache-2.0
4813
+ /**
4814
+ * @internal
4815
+ */
4816
+ class SyncSessionStorage extends _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.SyncKeyValueStorage {
4817
+ constructor() {
4818
+ super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
4819
+ }
4820
+ }
4821
+
4822
+
4823
+ //# sourceMappingURL=SyncSessionStorage.mjs.map
4824
+
4825
+
4826
+ /***/ }),
4827
+
4828
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs":
4829
+ /*!*******************************************************************!*\
4830
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs ***!
4831
+ \*******************************************************************/
4832
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4833
+
4834
+ "use strict";
4835
+ __webpack_require__.r(__webpack_exports__);
4836
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4837
+ /* harmony export */ CookieStorage: () => (/* reexport safe */ _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.CookieStorage),
4838
+ /* harmony export */ defaultStorage: () => (/* binding */ defaultStorage),
4839
+ /* harmony export */ sessionStorage: () => (/* binding */ sessionStorage),
4840
+ /* harmony export */ sharedInMemoryStorage: () => (/* binding */ sharedInMemoryStorage),
4841
+ /* harmony export */ syncSessionStorage: () => (/* binding */ syncSessionStorage)
4842
+ /* harmony export */ });
4843
+ /* harmony import */ var _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DefaultStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs");
4844
+ /* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
4845
+ /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
4846
+ /* harmony import */ var _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs");
4847
+ /* harmony import */ var _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SyncSessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs");
4848
+ /* harmony import */ var _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CookieStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs");
4849
+
4850
+
4851
+
4852
+
4853
+
4854
+
4855
+
4856
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4857
+ // SPDX-License-Identifier: Apache-2.0
4858
+ const defaultStorage = new _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.DefaultStorage();
4859
+ const sessionStorage = new _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__.SessionStorage();
4860
+ const syncSessionStorage = new _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__.SyncSessionStorage();
4861
+ const sharedInMemoryStorage = new _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__.KeyValueStorage(new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__.InMemoryStorage());
4862
+
4863
+
4864
+ //# sourceMappingURL=index.mjs.map
4865
+
4866
+
4867
+ /***/ }),
4868
+
4869
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs":
4870
+ /*!*******************************************************************!*\
4871
+ !*** ./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs ***!
4872
+ \*******************************************************************/
4873
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4874
+
4875
+ "use strict";
4876
+ __webpack_require__.r(__webpack_exports__);
4877
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4878
+ /* harmony export */ getLocalStorageWithFallback: () => (/* binding */ getLocalStorageWithFallback),
4879
+ /* harmony export */ getSessionStorageWithFallback: () => (/* binding */ getSessionStorageWithFallback)
4880
+ /* harmony export */ });
4881
+ /* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
4882
+ /* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
4883
+
4884
+
4885
+
4886
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4887
+ // SPDX-License-Identifier: Apache-2.0
4888
+ /**
4889
+ * @internal
4890
+ * @returns Either a reference to window.localStorage or an in-memory storage as fallback
4891
+ */
4892
+ const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('CoreStorageUtils');
4893
+ const getLocalStorageWithFallback = () => {
4894
+ try {
4895
+ // Attempt to use localStorage directly
4896
+ if (typeof window !== 'undefined' && window.localStorage) {
4897
+ return window.localStorage;
4898
+ }
4899
+ }
4900
+ catch (e) {
4901
+ // Handle any errors related to localStorage access
4902
+ logger.info('localStorage not found. InMemoryStorage is used as a fallback.');
4903
+ }
4904
+ // Return in-memory storage as a fallback if localStorage is not accessible
4905
+ return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
4906
+ };
4907
+ /**
4908
+ * @internal
4909
+ * @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
4910
+ */
4911
+ const getSessionStorageWithFallback = () => {
4912
+ try {
4913
+ // Attempt to use sessionStorage directly
4914
+ if (typeof window !== 'undefined' && window.sessionStorage) {
4915
+ // Verify we can actually use it by testing access
4916
+ window.sessionStorage.getItem('test');
4917
+ return window.sessionStorage;
4918
+ }
4919
+ throw new Error('sessionStorage is not defined');
4920
+ }
4921
+ catch (e) {
4922
+ // Handle any errors related to sessionStorage access
4923
+ logger.info('sessionStorage not found. InMemoryStorage is used as a fallback.');
4924
+ return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
4925
+ }
4926
+ };
4927
+
4928
+
4929
+ //# sourceMappingURL=utils.mjs.map
4930
+
4931
+
4932
+ /***/ }),
4933
+
4934
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs":
4935
+ /*!******************************************************************!*\
4936
+ !*** ./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs ***!
4937
+ \******************************************************************/
4938
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4939
+
4940
+ "use strict";
4941
+ __webpack_require__.r(__webpack_exports__);
4942
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4943
+ /* harmony export */ AmplifyErrorCode: () => (/* binding */ AmplifyErrorCode)
4944
+ /* harmony export */ });
4945
+ var AmplifyErrorCode;
4946
+ (function (AmplifyErrorCode) {
4947
+ AmplifyErrorCode["NoEndpointId"] = "NoEndpointId";
4948
+ AmplifyErrorCode["PlatformNotSupported"] = "PlatformNotSupported";
4949
+ AmplifyErrorCode["Unknown"] = "Unknown";
4950
+ AmplifyErrorCode["NetworkError"] = "NetworkError";
4951
+ })(AmplifyErrorCode || (AmplifyErrorCode = {}));
4952
+
4953
+
4954
+ //# sourceMappingURL=errors.mjs.map
4955
+
4956
+
4957
+ /***/ }),
4958
+
4959
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs":
4960
+ /*!****************************************************************************!*\
4961
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs ***!
4962
+ \****************************************************************************/
4963
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4964
+
4965
+ "use strict";
4966
+ __webpack_require__.r(__webpack_exports__);
4967
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4968
+ /* harmony export */ AmplifyUrl: () => (/* binding */ AmplifyUrl),
4969
+ /* harmony export */ AmplifyUrlSearchParams: () => (/* binding */ AmplifyUrlSearchParams)
4970
+ /* harmony export */ });
4971
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4972
+ // SPDX-License-Identifier: Apache-2.0
4973
+ const AmplifyUrl = URL;
4974
+ const AmplifyUrlSearchParams = URLSearchParams;
4975
+
4976
+
4977
+ //# sourceMappingURL=index.mjs.map
4978
+
4979
+
4980
+ /***/ }),
4981
+
4982
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs":
4983
+ /*!*****************************************************************************!*\
4984
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs ***!
4985
+ \*****************************************************************************/
4986
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4987
+
4988
+ "use strict";
4989
+ __webpack_require__.r(__webpack_exports__);
4990
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4991
+ /* harmony export */ amplifyUuid: () => (/* binding */ amplifyUuid)
4992
+ /* harmony export */ });
4993
+ /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
4994
+
4995
+
4996
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4997
+ // SPDX-License-Identifier: Apache-2.0
4998
+ const amplifyUuid = uuid__WEBPACK_IMPORTED_MODULE_0__["default"];
4999
+
5000
+
5001
+ //# sourceMappingURL=index.mjs.map
5002
+
5003
+
5004
+ /***/ }),
5005
+
5006
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs":
5007
+ /*!****************************************************************************************!*\
5008
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs ***!
5009
+ \****************************************************************************************/
5010
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5011
+
5012
+ "use strict";
5013
+ __webpack_require__.r(__webpack_exports__);
5014
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5015
+ /* harmony export */ base64Decoder: () => (/* binding */ base64Decoder)
5016
+ /* harmony export */ });
5017
+ /* harmony import */ var _globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../globalHelpers/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs");
5018
+
5019
+
5020
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5021
+ // SPDX-License-Identifier: Apache-2.0
5022
+ const base64Decoder = {
5023
+ convert(input, options) {
5024
+ let inputStr = input;
5025
+ // urlSafe character replacement options conform to the base64 url spec
5026
+ // https://datatracker.ietf.org/doc/html/rfc4648#page-7
5027
+ if (options?.urlSafe) {
5028
+ inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');
5029
+ }
5030
+ return (0,_globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__.getAtob)()(inputStr);
5031
+ },
5032
+ };
5033
+
5034
+
5035
+ //# sourceMappingURL=base64Decoder.mjs.map
5036
+
5037
+
5038
+ /***/ }),
5039
+
5040
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs":
5041
+ /*!*******************************************************************************!*\
5042
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs ***!
5043
+ \*******************************************************************************/
5044
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5045
+
5046
+ "use strict";
5047
+ __webpack_require__.r(__webpack_exports__);
5048
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5049
+ /* harmony export */ deDupeAsyncFunction: () => (/* binding */ deDupeAsyncFunction)
5050
+ /* harmony export */ });
5051
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5052
+ // SPDX-License-Identifier: Apache-2.0
5053
+ /**
5054
+ * returns in-flight promise if there is one
5055
+ *
5056
+ * @param asyncFunction - asyncFunction to be deduped.
5057
+ * @returns - the return type of the callback
5058
+ */
5059
+ const deDupeAsyncFunction = (asyncFunction) => {
5060
+ let inflightPromise;
5061
+ return async (...args) => {
5062
+ if (inflightPromise)
5063
+ return inflightPromise;
5064
+ inflightPromise = new Promise((resolve, reject) => {
5065
+ asyncFunction(...args)
5066
+ .then(result => {
5067
+ resolve(result);
5068
+ })
5069
+ .catch(error => {
5070
+ reject(error);
5071
+ })
5072
+ .finally(() => {
5073
+ inflightPromise = undefined;
5074
+ });
5075
+ });
5076
+ return inflightPromise;
5077
+ };
5078
+ };
5079
+
5080
+
5081
+ //# sourceMappingURL=deDupeAsyncFunction.mjs.map
5082
+
5083
+
5084
+ /***/ }),
5085
+
5086
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs":
5087
+ /*!**********************************************************************!*\
5088
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs ***!
5089
+ \**********************************************************************/
3372
5090
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3373
5091
 
3374
5092
  "use strict";
3375
5093
  __webpack_require__.r(__webpack_exports__);
3376
5094
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3377
- /* harmony export */ InMemoryStorage: () => (/* binding */ InMemoryStorage)
5095
+ /* harmony export */ deepFreeze: () => (/* binding */ deepFreeze)
3378
5096
  /* harmony export */ });
3379
5097
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3380
5098
  // SPDX-License-Identifier: Apache-2.0
3381
- /**
3382
- * @internal
3383
- */
3384
- class InMemoryStorage {
3385
- constructor() {
3386
- this.storage = new Map();
3387
- }
3388
- get length() {
3389
- return this.storage.size;
3390
- }
3391
- key(index) {
3392
- if (index > this.length - 1) {
3393
- return null;
5099
+ const deepFreeze = (object) => {
5100
+ const propNames = Reflect.ownKeys(object);
5101
+ for (const name of propNames) {
5102
+ const value = object[name];
5103
+ if ((value && typeof value === 'object') || typeof value === 'function') {
5104
+ deepFreeze(value);
3394
5105
  }
3395
- return Array.from(this.storage.keys())[index];
3396
- }
3397
- setItem(key, value) {
3398
- this.storage.set(key, value);
3399
- }
3400
- getItem(key) {
3401
- return this.storage.get(key) ?? null;
3402
5106
  }
3403
- removeItem(key) {
3404
- this.storage.delete(key);
3405
- }
3406
- clear() {
3407
- this.storage.clear();
3408
- }
3409
- }
5107
+ return Object.freeze(object);
5108
+ };
3410
5109
 
3411
5110
 
3412
- //# sourceMappingURL=InMemoryStorage.mjs.map
5111
+ //# sourceMappingURL=deepFreeze.mjs.map
3413
5112
 
3414
5113
 
3415
5114
  /***/ }),
3416
5115
 
3417
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs":
3418
- /*!*****************************************************************************!*\
3419
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs ***!
3420
- \*****************************************************************************/
5116
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs":
5117
+ /*!*******************************************************************************!*\
5118
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs ***!
5119
+ \*******************************************************************************/
3421
5120
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3422
5121
 
3423
5122
  "use strict";
3424
5123
  __webpack_require__.r(__webpack_exports__);
3425
5124
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3426
- /* harmony export */ KeyValueStorage: () => (/* binding */ KeyValueStorage)
5125
+ /* harmony export */ getAtob: () => (/* binding */ getAtob),
5126
+ /* harmony export */ getBtoa: () => (/* binding */ getBtoa),
5127
+ /* harmony export */ getCrypto: () => (/* binding */ getCrypto)
3427
5128
  /* harmony export */ });
3428
- /* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
5129
+ /* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
5130
+
3429
5131
 
3430
5132
 
3431
5133
 
3432
5134
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3433
5135
  // SPDX-License-Identifier: Apache-2.0
3434
- /**
3435
- * @internal
3436
- */
3437
- class KeyValueStorage {
3438
- constructor(storage) {
3439
- this.storage = storage;
5136
+ const getCrypto = () => {
5137
+ if (typeof window === 'object' && typeof window.crypto === 'object') {
5138
+ return window.crypto;
3440
5139
  }
3441
- /**
3442
- * This is used to set a specific item in storage
3443
- * @param {string} key - the key for the item
3444
- * @param {object} value - the value
3445
- * @returns {string} value that was set
3446
- */
3447
- async setItem(key, value) {
3448
- if (!this.storage)
3449
- throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
3450
- this.storage.setItem(key, value);
5140
+ // Next.js global polyfill
5141
+ if (typeof crypto === 'object') {
5142
+ return crypto;
3451
5143
  }
3452
- /**
3453
- * This is used to get a specific key from storage
3454
- * @param {string} key - the key for the item
3455
- * This is used to clear the storage
3456
- * @returns {string} the data item
3457
- */
3458
- async getItem(key) {
3459
- if (!this.storage)
3460
- throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
3461
- return this.storage.getItem(key);
5144
+ throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
5145
+ name: 'MissingPolyfill',
5146
+ message: 'Cannot resolve the `crypto` function from the environment.',
5147
+ });
5148
+ };
5149
+ const getBtoa = () => {
5150
+ // browser
5151
+ if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
5152
+ return window.btoa;
3462
5153
  }
3463
- /**
3464
- * This is used to remove an item from storage
3465
- * @param {string} key - the key being set
3466
- * @returns {string} value - value that was deleted
3467
- */
3468
- async removeItem(key) {
3469
- if (!this.storage)
3470
- throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
3471
- this.storage.removeItem(key);
5154
+ // Next.js global polyfill
5155
+ if (typeof btoa === 'function') {
5156
+ return btoa;
3472
5157
  }
3473
- /**
3474
- * This is used to clear the storage
3475
- * @returns {string} nothing
3476
- */
3477
- async clear() {
3478
- if (!this.storage)
3479
- throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
3480
- this.storage.clear();
5158
+ throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
5159
+ name: 'Base64EncoderError',
5160
+ message: 'Cannot resolve the `btoa` function from the environment.',
5161
+ });
5162
+ };
5163
+ const getAtob = () => {
5164
+ // browser
5165
+ if (typeof window !== 'undefined' && typeof window.atob === 'function') {
5166
+ return window.atob;
3481
5167
  }
3482
- }
5168
+ // Next.js global polyfill
5169
+ if (typeof atob === 'function') {
5170
+ return atob;
5171
+ }
5172
+ throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
5173
+ name: 'Base64EncoderError',
5174
+ message: 'Cannot resolve the `atob` function from the environment.',
5175
+ });
5176
+ };
3483
5177
 
3484
5178
 
3485
- //# sourceMappingURL=KeyValueStorage.mjs.map
5179
+ //# sourceMappingURL=index.mjs.map
3486
5180
 
3487
5181
 
3488
5182
  /***/ }),
3489
5183
 
3490
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs":
3491
- /*!****************************************************************************!*\
3492
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs ***!
3493
- \****************************************************************************/
5184
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs":
5185
+ /*!*********************************************************************!*\
5186
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs ***!
5187
+ \*********************************************************************/
3494
5188
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3495
5189
 
3496
5190
  "use strict";
3497
5191
  __webpack_require__.r(__webpack_exports__);
3498
5192
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3499
- /* harmony export */ SessionStorage: () => (/* binding */ SessionStorage)
5193
+ /* harmony export */ isBrowser: () => (/* binding */ isBrowser)
3500
5194
  /* harmony export */ });
3501
- /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
3502
- /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
5195
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5196
+ // SPDX-License-Identifier: Apache-2.0
5197
+ const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
5198
+
5199
+
5200
+ //# sourceMappingURL=isBrowser.mjs.map
3503
5201
 
3504
5202
 
5203
+ /***/ }),
5204
+
5205
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs":
5206
+ /*!**************************************************************************!*\
5207
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs ***!
5208
+ \**************************************************************************/
5209
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3505
5210
 
5211
+ "use strict";
5212
+ __webpack_require__.r(__webpack_exports__);
5213
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5214
+ /* harmony export */ isTokenExpired: () => (/* binding */ isTokenExpired)
5215
+ /* harmony export */ });
3506
5216
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3507
5217
  // SPDX-License-Identifier: Apache-2.0
3508
- /**
3509
- * @internal
3510
- */
3511
- class SessionStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
3512
- constructor() {
3513
- super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
3514
- }
5218
+ function isTokenExpired({ expiresAt, clockDrift, tolerance = 5000, }) {
5219
+ const currentTime = Date.now();
5220
+ return currentTime + clockDrift + tolerance > expiresAt;
3515
5221
  }
3516
5222
 
3517
5223
 
3518
- //# sourceMappingURL=SessionStorage.mjs.map
5224
+ //# sourceMappingURL=isTokenExpired.mjs.map
3519
5225
 
3520
5226
 
3521
5227
  /***/ }),
3522
5228
 
3523
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs":
3524
- /*!*********************************************************************************!*\
3525
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs ***!
3526
- \*********************************************************************************/
5229
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs":
5230
+ /*!******************************************************************************!*\
5231
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs ***!
5232
+ \******************************************************************************/
3527
5233
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3528
5234
 
3529
5235
  "use strict";
3530
5236
  __webpack_require__.r(__webpack_exports__);
3531
5237
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3532
- /* harmony export */ SyncKeyValueStorage: () => (/* binding */ SyncKeyValueStorage)
5238
+ /* harmony export */ parseAmplifyConfig: () => (/* binding */ parseAmplifyConfig)
3533
5239
  /* harmony export */ });
3534
- /* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
5240
+ /* harmony import */ var _parseAWSExports_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseAWSExports.mjs */ "./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs");
5241
+ /* harmony import */ var _parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseAmplifyOutputs.mjs */ "./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs");
3535
5242
 
3536
5243
 
3537
5244
 
3538
5245
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3539
5246
  // SPDX-License-Identifier: Apache-2.0
3540
5247
  /**
3541
- * @internal
5248
+ * Parses the variety of configuration shapes that Amplify can accept into a ResourcesConfig.
5249
+ *
5250
+ * @param amplifyConfig An Amplify configuration object conforming to one of the supported schemas.
5251
+ * @return A ResourcesConfig for the provided configuration object.
3542
5252
  */
3543
- class SyncKeyValueStorage {
3544
- constructor(storage) {
3545
- this._storage = storage;
3546
- }
3547
- get storage() {
3548
- if (!this._storage)
3549
- throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
3550
- return this._storage;
3551
- }
3552
- /**
3553
- * This is used to set a specific item in storage
3554
- * @param {string} key - the key for the item
3555
- * @param {object} value - the value
3556
- * @returns {string} value that was set
3557
- */
3558
- setItem(key, value) {
3559
- this.storage.setItem(key, value);
3560
- }
3561
- /**
3562
- * This is used to get a specific key from storage
3563
- * @param {string} key - the key for the item
3564
- * This is used to clear the storage
3565
- * @returns {string} the data item
3566
- */
3567
- getItem(key) {
3568
- return this.storage.getItem(key);
5253
+ const parseAmplifyConfig = (amplifyConfig) => {
5254
+ if (Object.keys(amplifyConfig).some(key => key.startsWith('aws_'))) {
5255
+ return (0,_parseAWSExports_mjs__WEBPACK_IMPORTED_MODULE_0__.parseAWSExports)(amplifyConfig);
3569
5256
  }
3570
- /**
3571
- * This is used to remove an item from storage
3572
- * @param {string} key - the key being set
3573
- * @returns {string} value - value that was deleted
3574
- */
3575
- removeItem(key) {
3576
- this.storage.removeItem(key);
5257
+ else if ((0,_parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__.isAmplifyOutputs)(amplifyConfig)) {
5258
+ return (0,_parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__.parseAmplifyOutputs)(amplifyConfig);
3577
5259
  }
3578
- /**
3579
- * This is used to clear the storage
3580
- * @returns {string} nothing
3581
- */
3582
- clear() {
3583
- this.storage.clear();
5260
+ else {
5261
+ return amplifyConfig;
3584
5262
  }
3585
- }
5263
+ };
3586
5264
 
3587
5265
 
3588
- //# sourceMappingURL=SyncKeyValueStorage.mjs.map
5266
+ //# sourceMappingURL=parseAmplifyConfig.mjs.map
3589
5267
 
3590
5268
 
3591
5269
  /***/ }),
3592
5270
 
3593
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs":
3594
- /*!********************************************************************************!*\
3595
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs ***!
3596
- \********************************************************************************/
5271
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs":
5272
+ /*!***************************************************************************!*\
5273
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs ***!
5274
+ \***************************************************************************/
3597
5275
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3598
5276
 
3599
5277
  "use strict";
3600
5278
  __webpack_require__.r(__webpack_exports__);
3601
5279
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3602
- /* harmony export */ SyncSessionStorage: () => (/* binding */ SyncSessionStorage)
5280
+ /* harmony export */ MAX_DELAY_MS: () => (/* binding */ MAX_DELAY_MS)
3603
5281
  /* harmony export */ });
3604
- /* harmony import */ var _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SyncKeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs");
3605
- /* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
3606
-
3607
-
3608
-
3609
5282
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3610
5283
  // SPDX-License-Identifier: Apache-2.0
3611
- /**
3612
- * @internal
3613
- */
3614
- class SyncSessionStorage extends _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.SyncKeyValueStorage {
3615
- constructor() {
3616
- super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
3617
- }
3618
- }
5284
+ const MAX_DELAY_MS = 5 * 60 * 1000;
3619
5285
 
3620
5286
 
3621
- //# sourceMappingURL=SyncSessionStorage.mjs.map
5287
+ //# sourceMappingURL=constants.mjs.map
3622
5288
 
3623
5289
 
3624
5290
  /***/ }),
3625
5291
 
3626
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs":
3627
- /*!*******************************************************************!*\
3628
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs ***!
3629
- \*******************************************************************/
5292
+ /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs":
5293
+ /*!*********************************************************************************!*\
5294
+ !*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs ***!
5295
+ \*********************************************************************************/
3630
5296
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3631
5297
 
3632
5298
  "use strict";
3633
5299
  __webpack_require__.r(__webpack_exports__);
3634
5300
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3635
- /* harmony export */ CookieStorage: () => (/* reexport safe */ _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.CookieStorage),
3636
- /* harmony export */ defaultStorage: () => (/* binding */ defaultStorage),
3637
- /* harmony export */ sessionStorage: () => (/* binding */ sessionStorage),
3638
- /* harmony export */ sharedInMemoryStorage: () => (/* binding */ sharedInMemoryStorage),
3639
- /* harmony export */ syncSessionStorage: () => (/* binding */ syncSessionStorage)
5301
+ /* harmony export */ jitteredBackoff: () => (/* binding */ jitteredBackoff)
3640
5302
  /* harmony export */ });
3641
- /* harmony import */ var _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DefaultStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs");
3642
- /* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
3643
- /* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
3644
- /* harmony import */ var _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs");
3645
- /* harmony import */ var _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SyncSessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs");
3646
- /* harmony import */ var _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CookieStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs");
3647
-
3648
-
3649
-
3650
-
3651
-
5303
+ /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs");
3652
5304
 
3653
5305
 
3654
5306
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3655
5307
  // SPDX-License-Identifier: Apache-2.0
3656
- const defaultStorage = new _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.DefaultStorage();
3657
- const sessionStorage = new _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__.SessionStorage();
3658
- const syncSessionStorage = new _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__.SyncSessionStorage();
3659
- const sharedInMemoryStorage = new _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__.KeyValueStorage(new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__.InMemoryStorage());
5308
+ /**
5309
+ * @private
5310
+ * Internal use of Amplify only
5311
+ */
5312
+ function jitteredBackoff(maxDelayMs = _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.MAX_DELAY_MS) {
5313
+ const BASE_TIME_MS = 100;
5314
+ const JITTER_FACTOR = 100;
5315
+ return attempt => {
5316
+ const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();
5317
+ return delay > maxDelayMs ? false : delay;
5318
+ };
5319
+ }
3660
5320
 
3661
5321
 
3662
- //# sourceMappingURL=index.mjs.map
5322
+ //# sourceMappingURL=jitteredBackoff.mjs.map
3663
5323
 
3664
5324
 
3665
5325
  /***/ }),
3666
5326
 
3667
- /***/ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs":
3668
- /*!*******************************************************************!*\
3669
- !*** ./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs ***!
3670
- \*******************************************************************/
5327
+ /***/ "./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js":
5328
+ /*!************************************************************************************************!*\
5329
+ !*** ./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js ***!
5330
+ \************************************************************************************************/
3671
5331
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3672
5332
 
3673
5333
  "use strict";
3674
5334
  __webpack_require__.r(__webpack_exports__);
3675
5335
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3676
- /* harmony export */ getLocalStorageWithFallback: () => (/* binding */ getLocalStorageWithFallback),
3677
- /* harmony export */ getSessionStorageWithFallback: () => (/* binding */ getSessionStorageWithFallback)
5336
+ /* harmony export */ fromHex: () => (/* binding */ fromHex),
5337
+ /* harmony export */ toHex: () => (/* binding */ toHex)
3678
5338
  /* harmony export */ });
3679
- /* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
3680
- /* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
5339
+ const SHORT_TO_HEX = {};
5340
+ const HEX_TO_SHORT = {};
5341
+ for (let i = 0; i < 256; i++) {
5342
+ let encodedByte = i.toString(16).toLowerCase();
5343
+ if (encodedByte.length === 1) {
5344
+ encodedByte = `0${encodedByte}`;
5345
+ }
5346
+ SHORT_TO_HEX[i] = encodedByte;
5347
+ HEX_TO_SHORT[encodedByte] = i;
5348
+ }
5349
+ function fromHex(encoded) {
5350
+ if (encoded.length % 2 !== 0) {
5351
+ throw new Error("Hex encoded strings must have an even number length");
5352
+ }
5353
+ const out = new Uint8Array(encoded.length / 2);
5354
+ for (let i = 0; i < encoded.length; i += 2) {
5355
+ const encodedByte = encoded.slice(i, i + 2).toLowerCase();
5356
+ if (encodedByte in HEX_TO_SHORT) {
5357
+ out[i / 2] = HEX_TO_SHORT[encodedByte];
5358
+ }
5359
+ else {
5360
+ throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
5361
+ }
5362
+ }
5363
+ return out;
5364
+ }
5365
+ function toHex(bytes) {
5366
+ let out = "";
5367
+ for (let i = 0; i < bytes.byteLength; i++) {
5368
+ out += SHORT_TO_HEX[bytes[i]];
5369
+ }
5370
+ return out;
5371
+ }
3681
5372
 
3682
5373
 
5374
+ /***/ }),
5375
+
5376
+ /***/ "./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js":
5377
+ /*!**********************************************************************!*\
5378
+ !*** ./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js ***!
5379
+ \**********************************************************************/
5380
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5381
+
5382
+ "use strict";
5383
+ __webpack_require__.r(__webpack_exports__);
5384
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5385
+ /* harmony export */ RawSha256: () => (/* binding */ RawSha256)
5386
+ /* harmony export */ });
5387
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js");
3683
5388
 
3684
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3685
- // SPDX-License-Identifier: Apache-2.0
3686
5389
  /**
3687
5390
  * @internal
3688
- * @returns Either a reference to window.localStorage or an in-memory storage as fallback
3689
5391
  */
3690
- const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('CoreStorageUtils');
3691
- const getLocalStorageWithFallback = () => {
3692
- try {
3693
- // Attempt to use localStorage directly
3694
- if (typeof window !== 'undefined' && window.localStorage) {
3695
- return window.localStorage;
5392
+ var RawSha256 = /** @class */ (function () {
5393
+ function RawSha256() {
5394
+ this.state = Int32Array.from(_constants__WEBPACK_IMPORTED_MODULE_0__.INIT);
5395
+ this.temp = new Int32Array(64);
5396
+ this.buffer = new Uint8Array(64);
5397
+ this.bufferLength = 0;
5398
+ this.bytesHashed = 0;
5399
+ /**
5400
+ * @internal
5401
+ */
5402
+ this.finished = false;
5403
+ }
5404
+ RawSha256.prototype.update = function (data) {
5405
+ if (this.finished) {
5406
+ throw new Error("Attempted to update an already finished hash.");
3696
5407
  }
3697
- }
3698
- catch (e) {
3699
- // Handle any errors related to localStorage access
3700
- logger.info('localStorage not found. InMemoryStorage is used as a fallback.');
3701
- }
3702
- // Return in-memory storage as a fallback if localStorage is not accessible
3703
- return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
3704
- };
3705
- /**
3706
- * @internal
3707
- * @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
3708
- */
3709
- const getSessionStorageWithFallback = () => {
3710
- try {
3711
- // Attempt to use sessionStorage directly
3712
- if (typeof window !== 'undefined' && window.sessionStorage) {
3713
- // Verify we can actually use it by testing access
3714
- window.sessionStorage.getItem('test');
3715
- return window.sessionStorage;
5408
+ var position = 0;
5409
+ var byteLength = data.byteLength;
5410
+ this.bytesHashed += byteLength;
5411
+ if (this.bytesHashed * 8 > _constants__WEBPACK_IMPORTED_MODULE_0__.MAX_HASHABLE_LENGTH) {
5412
+ throw new Error("Cannot hash more than 2^53 - 1 bits");
3716
5413
  }
3717
- throw new Error('sessionStorage is not defined');
3718
- }
3719
- catch (e) {
3720
- // Handle any errors related to sessionStorage access
3721
- logger.info('sessionStorage not found. InMemoryStorage is used as a fallback.');
3722
- return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
3723
- }
3724
- };
3725
-
5414
+ while (byteLength > 0) {
5415
+ this.buffer[this.bufferLength++] = data[position++];
5416
+ byteLength--;
5417
+ if (this.bufferLength === _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE) {
5418
+ this.hashBuffer();
5419
+ this.bufferLength = 0;
5420
+ }
5421
+ }
5422
+ };
5423
+ RawSha256.prototype.digest = function () {
5424
+ if (!this.finished) {
5425
+ var bitsHashed = this.bytesHashed * 8;
5426
+ var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);
5427
+ var undecoratedLength = this.bufferLength;
5428
+ bufferView.setUint8(this.bufferLength++, 0x80);
5429
+ // Ensure the final block has enough room for the hashed length
5430
+ if (undecoratedLength % _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE >= _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8) {
5431
+ for (var i = this.bufferLength; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
5432
+ bufferView.setUint8(i, 0);
5433
+ }
5434
+ this.hashBuffer();
5435
+ this.bufferLength = 0;
5436
+ }
5437
+ for (var i = this.bufferLength; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8; i++) {
5438
+ bufferView.setUint8(i, 0);
5439
+ }
5440
+ bufferView.setUint32(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true);
5441
+ bufferView.setUint32(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 4, bitsHashed);
5442
+ this.hashBuffer();
5443
+ this.finished = true;
5444
+ }
5445
+ // The value in state is little-endian rather than big-endian, so flip
5446
+ // each word into a new Uint8Array
5447
+ var out = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.DIGEST_LENGTH);
5448
+ for (var i = 0; i < 8; i++) {
5449
+ out[i * 4] = (this.state[i] >>> 24) & 0xff;
5450
+ out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;
5451
+ out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;
5452
+ out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;
5453
+ }
5454
+ return out;
5455
+ };
5456
+ RawSha256.prototype.hashBuffer = function () {
5457
+ var _a = this, buffer = _a.buffer, state = _a.state;
5458
+ var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7];
5459
+ for (var i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
5460
+ if (i < 16) {
5461
+ this.temp[i] =
5462
+ ((buffer[i * 4] & 0xff) << 24) |
5463
+ ((buffer[i * 4 + 1] & 0xff) << 16) |
5464
+ ((buffer[i * 4 + 2] & 0xff) << 8) |
5465
+ (buffer[i * 4 + 3] & 0xff);
5466
+ }
5467
+ else {
5468
+ var u = this.temp[i - 2];
5469
+ var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);
5470
+ u = this.temp[i - 15];
5471
+ var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);
5472
+ this.temp[i] =
5473
+ ((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0);
5474
+ }
5475
+ var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^
5476
+ ((state4 >>> 11) | (state4 << 21)) ^
5477
+ ((state4 >>> 25) | (state4 << 7))) +
5478
+ ((state4 & state5) ^ (~state4 & state6))) |
5479
+ 0) +
5480
+ ((state7 + ((_constants__WEBPACK_IMPORTED_MODULE_0__.KEY[i] + this.temp[i]) | 0)) | 0)) |
5481
+ 0;
5482
+ var t2 = ((((state0 >>> 2) | (state0 << 30)) ^
5483
+ ((state0 >>> 13) | (state0 << 19)) ^
5484
+ ((state0 >>> 22) | (state0 << 10))) +
5485
+ ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |
5486
+ 0;
5487
+ state7 = state6;
5488
+ state6 = state5;
5489
+ state5 = state4;
5490
+ state4 = (state3 + t1) | 0;
5491
+ state3 = state2;
5492
+ state2 = state1;
5493
+ state1 = state0;
5494
+ state0 = (t1 + t2) | 0;
5495
+ }
5496
+ state[0] += state0;
5497
+ state[1] += state1;
5498
+ state[2] += state2;
5499
+ state[3] += state3;
5500
+ state[4] += state4;
5501
+ state[5] += state5;
5502
+ state[6] += state6;
5503
+ state[7] += state7;
5504
+ };
5505
+ return RawSha256;
5506
+ }());
3726
5507
 
3727
- //# sourceMappingURL=utils.mjs.map
3728
5508
 
3729
5509
 
3730
5510
  /***/ }),
3731
5511
 
3732
- /***/ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs":
3733
- /*!******************************************************************!*\
3734
- !*** ./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs ***!
3735
- \******************************************************************/
5512
+ /***/ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js":
5513
+ /*!**********************************************************************!*\
5514
+ !*** ./node_modules/@aws-crypto/sha256-js/build/module/constants.js ***!
5515
+ \**********************************************************************/
3736
5516
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3737
5517
 
3738
5518
  "use strict";
3739
5519
  __webpack_require__.r(__webpack_exports__);
3740
5520
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3741
- /* harmony export */ AmplifyErrorCode: () => (/* binding */ AmplifyErrorCode)
5521
+ /* harmony export */ BLOCK_SIZE: () => (/* binding */ BLOCK_SIZE),
5522
+ /* harmony export */ DIGEST_LENGTH: () => (/* binding */ DIGEST_LENGTH),
5523
+ /* harmony export */ INIT: () => (/* binding */ INIT),
5524
+ /* harmony export */ KEY: () => (/* binding */ KEY),
5525
+ /* harmony export */ MAX_HASHABLE_LENGTH: () => (/* binding */ MAX_HASHABLE_LENGTH)
3742
5526
  /* harmony export */ });
3743
- var AmplifyErrorCode;
3744
- (function (AmplifyErrorCode) {
3745
- AmplifyErrorCode["NoEndpointId"] = "NoEndpointId";
3746
- AmplifyErrorCode["PlatformNotSupported"] = "PlatformNotSupported";
3747
- AmplifyErrorCode["Unknown"] = "Unknown";
3748
- AmplifyErrorCode["NetworkError"] = "NetworkError";
3749
- })(AmplifyErrorCode || (AmplifyErrorCode = {}));
3750
-
3751
-
3752
- //# sourceMappingURL=errors.mjs.map
5527
+ /**
5528
+ * @internal
5529
+ */
5530
+ var BLOCK_SIZE = 64;
5531
+ /**
5532
+ * @internal
5533
+ */
5534
+ var DIGEST_LENGTH = 32;
5535
+ /**
5536
+ * @internal
5537
+ */
5538
+ var KEY = new Uint32Array([
5539
+ 0x428a2f98,
5540
+ 0x71374491,
5541
+ 0xb5c0fbcf,
5542
+ 0xe9b5dba5,
5543
+ 0x3956c25b,
5544
+ 0x59f111f1,
5545
+ 0x923f82a4,
5546
+ 0xab1c5ed5,
5547
+ 0xd807aa98,
5548
+ 0x12835b01,
5549
+ 0x243185be,
5550
+ 0x550c7dc3,
5551
+ 0x72be5d74,
5552
+ 0x80deb1fe,
5553
+ 0x9bdc06a7,
5554
+ 0xc19bf174,
5555
+ 0xe49b69c1,
5556
+ 0xefbe4786,
5557
+ 0x0fc19dc6,
5558
+ 0x240ca1cc,
5559
+ 0x2de92c6f,
5560
+ 0x4a7484aa,
5561
+ 0x5cb0a9dc,
5562
+ 0x76f988da,
5563
+ 0x983e5152,
5564
+ 0xa831c66d,
5565
+ 0xb00327c8,
5566
+ 0xbf597fc7,
5567
+ 0xc6e00bf3,
5568
+ 0xd5a79147,
5569
+ 0x06ca6351,
5570
+ 0x14292967,
5571
+ 0x27b70a85,
5572
+ 0x2e1b2138,
5573
+ 0x4d2c6dfc,
5574
+ 0x53380d13,
5575
+ 0x650a7354,
5576
+ 0x766a0abb,
5577
+ 0x81c2c92e,
5578
+ 0x92722c85,
5579
+ 0xa2bfe8a1,
5580
+ 0xa81a664b,
5581
+ 0xc24b8b70,
5582
+ 0xc76c51a3,
5583
+ 0xd192e819,
5584
+ 0xd6990624,
5585
+ 0xf40e3585,
5586
+ 0x106aa070,
5587
+ 0x19a4c116,
5588
+ 0x1e376c08,
5589
+ 0x2748774c,
5590
+ 0x34b0bcb5,
5591
+ 0x391c0cb3,
5592
+ 0x4ed8aa4a,
5593
+ 0x5b9cca4f,
5594
+ 0x682e6ff3,
5595
+ 0x748f82ee,
5596
+ 0x78a5636f,
5597
+ 0x84c87814,
5598
+ 0x8cc70208,
5599
+ 0x90befffa,
5600
+ 0xa4506ceb,
5601
+ 0xbef9a3f7,
5602
+ 0xc67178f2
5603
+ ]);
5604
+ /**
5605
+ * @internal
5606
+ */
5607
+ var INIT = [
5608
+ 0x6a09e667,
5609
+ 0xbb67ae85,
5610
+ 0x3c6ef372,
5611
+ 0xa54ff53a,
5612
+ 0x510e527f,
5613
+ 0x9b05688c,
5614
+ 0x1f83d9ab,
5615
+ 0x5be0cd19
5616
+ ];
5617
+ /**
5618
+ * @internal
5619
+ */
5620
+ var MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1;
3753
5621
 
3754
5622
 
3755
5623
  /***/ }),
3756
5624
 
3757
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs":
3758
- /*!****************************************************************************!*\
3759
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs ***!
3760
- \****************************************************************************/
5625
+ /***/ "./node_modules/@aws-crypto/sha256-js/build/module/index.js":
5626
+ /*!******************************************************************!*\
5627
+ !*** ./node_modules/@aws-crypto/sha256-js/build/module/index.js ***!
5628
+ \******************************************************************/
3761
5629
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3762
5630
 
3763
5631
  "use strict";
3764
5632
  __webpack_require__.r(__webpack_exports__);
3765
5633
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3766
- /* harmony export */ AmplifyUrl: () => (/* binding */ AmplifyUrl),
3767
- /* harmony export */ AmplifyUrlSearchParams: () => (/* binding */ AmplifyUrlSearchParams)
5634
+ /* harmony export */ Sha256: () => (/* reexport safe */ _jsSha256__WEBPACK_IMPORTED_MODULE_0__.Sha256)
3768
5635
  /* harmony export */ });
3769
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3770
- // SPDX-License-Identifier: Apache-2.0
3771
- const AmplifyUrl = URL;
3772
- const AmplifyUrlSearchParams = URLSearchParams;
3773
-
5636
+ /* harmony import */ var _jsSha256__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsSha256 */ "./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js");
3774
5637
 
3775
- //# sourceMappingURL=index.mjs.map
3776
5638
 
3777
5639
 
3778
5640
  /***/ }),
3779
5641
 
3780
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs":
3781
- /*!*****************************************************************************!*\
3782
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs ***!
3783
- \*****************************************************************************/
5642
+ /***/ "./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js":
5643
+ /*!*********************************************************************!*\
5644
+ !*** ./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js ***!
5645
+ \*********************************************************************/
3784
5646
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3785
5647
 
3786
5648
  "use strict";
3787
5649
  __webpack_require__.r(__webpack_exports__);
3788
5650
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3789
- /* harmony export */ amplifyUuid: () => (/* binding */ amplifyUuid)
5651
+ /* harmony export */ Sha256: () => (/* binding */ Sha256)
3790
5652
  /* harmony export */ });
3791
- /* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
5653
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
5654
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js");
5655
+ /* harmony import */ var _RawSha256__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RawSha256 */ "./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js");
5656
+ /* harmony import */ var _aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-crypto/util */ "./node_modules/@aws-crypto/util/build/module/index.js");
3792
5657
 
3793
5658
 
3794
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3795
- // SPDX-License-Identifier: Apache-2.0
3796
- const amplifyUuid = uuid__WEBPACK_IMPORTED_MODULE_0__["default"];
3797
5659
 
3798
5660
 
3799
- //# sourceMappingURL=index.mjs.map
5661
+ var Sha256 = /** @class */ (function () {
5662
+ function Sha256(secret) {
5663
+ this.secret = secret;
5664
+ this.hash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
5665
+ this.reset();
5666
+ }
5667
+ Sha256.prototype.update = function (toHash) {
5668
+ if ((0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.isEmptyData)(toHash) || this.error) {
5669
+ return;
5670
+ }
5671
+ try {
5672
+ this.hash.update((0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.convertToBuffer)(toHash));
5673
+ }
5674
+ catch (e) {
5675
+ this.error = e;
5676
+ }
5677
+ };
5678
+ /* This synchronous method keeps compatibility
5679
+ * with the v2 aws-sdk.
5680
+ */
5681
+ Sha256.prototype.digestSync = function () {
5682
+ if (this.error) {
5683
+ throw this.error;
5684
+ }
5685
+ if (this.outer) {
5686
+ if (!this.outer.finished) {
5687
+ this.outer.update(this.hash.digest());
5688
+ }
5689
+ return this.outer.digest();
5690
+ }
5691
+ return this.hash.digest();
5692
+ };
5693
+ /* The underlying digest method here is synchronous.
5694
+ * To keep the same interface with the other hash functions
5695
+ * the default is to expose this as an async method.
5696
+ * However, it can sometimes be useful to have a sync method.
5697
+ */
5698
+ Sha256.prototype.digest = function () {
5699
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () {
5700
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) {
5701
+ return [2 /*return*/, this.digestSync()];
5702
+ });
5703
+ });
5704
+ };
5705
+ Sha256.prototype.reset = function () {
5706
+ this.hash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
5707
+ if (this.secret) {
5708
+ this.outer = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
5709
+ var inner = bufferFromSecret(this.secret);
5710
+ var outer = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE);
5711
+ outer.set(inner);
5712
+ for (var i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
5713
+ inner[i] ^= 0x36;
5714
+ outer[i] ^= 0x5c;
5715
+ }
5716
+ this.hash.update(inner);
5717
+ this.outer.update(outer);
5718
+ // overwrite the copied key in memory
5719
+ for (var i = 0; i < inner.byteLength; i++) {
5720
+ inner[i] = 0;
5721
+ }
5722
+ }
5723
+ };
5724
+ return Sha256;
5725
+ }());
5726
+
5727
+ function bufferFromSecret(secret) {
5728
+ var input = (0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.convertToBuffer)(secret);
5729
+ if (input.byteLength > _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE) {
5730
+ var bufferHash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
5731
+ bufferHash.update(input);
5732
+ input = bufferHash.digest();
5733
+ }
5734
+ var buffer = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE);
5735
+ buffer.set(input);
5736
+ return buffer;
5737
+ }
3800
5738
 
3801
5739
 
3802
5740
  /***/ }),
3803
5741
 
3804
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs":
3805
- /*!****************************************************************************************!*\
3806
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs ***!
3807
- \****************************************************************************************/
5742
+ /***/ "./node_modules/@aws-crypto/util/build/module/convertToBuffer.js":
5743
+ /*!***********************************************************************!*\
5744
+ !*** ./node_modules/@aws-crypto/util/build/module/convertToBuffer.js ***!
5745
+ \***********************************************************************/
3808
5746
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3809
5747
 
3810
5748
  "use strict";
3811
5749
  __webpack_require__.r(__webpack_exports__);
3812
5750
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3813
- /* harmony export */ base64Decoder: () => (/* binding */ base64Decoder)
5751
+ /* harmony export */ convertToBuffer: () => (/* binding */ convertToBuffer)
3814
5752
  /* harmony export */ });
3815
- /* harmony import */ var _globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../globalHelpers/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs");
3816
-
3817
-
3818
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5753
+ /* harmony import */ var _smithy_util_utf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @smithy/util-utf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js");
5754
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3819
5755
  // SPDX-License-Identifier: Apache-2.0
3820
- const base64Decoder = {
3821
- convert(input, options) {
3822
- let inputStr = input;
3823
- // urlSafe character replacement options conform to the base64 url spec
3824
- // https://datatracker.ietf.org/doc/html/rfc4648#page-7
3825
- if (options?.urlSafe) {
3826
- inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');
3827
- }
3828
- return (0,_globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__.getAtob)()(inputStr);
3829
- },
3830
- };
3831
5756
 
3832
-
3833
- //# sourceMappingURL=base64Decoder.mjs.map
5757
+ // Quick polyfill
5758
+ var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from
5759
+ ? function (input) { return Buffer.from(input, "utf8"); }
5760
+ : _smithy_util_utf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8;
5761
+ function convertToBuffer(data) {
5762
+ // Already a Uint8, do nothing
5763
+ if (data instanceof Uint8Array)
5764
+ return data;
5765
+ if (typeof data === "string") {
5766
+ return fromUtf8(data);
5767
+ }
5768
+ if (ArrayBuffer.isView(data)) {
5769
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
5770
+ }
5771
+ return new Uint8Array(data);
5772
+ }
3834
5773
 
3835
5774
 
3836
5775
  /***/ }),
3837
5776
 
3838
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs":
3839
- /*!*******************************************************************************!*\
3840
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs ***!
3841
- \*******************************************************************************/
5777
+ /***/ "./node_modules/@aws-crypto/util/build/module/index.js":
5778
+ /*!*************************************************************!*\
5779
+ !*** ./node_modules/@aws-crypto/util/build/module/index.js ***!
5780
+ \*************************************************************/
3842
5781
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3843
5782
 
3844
5783
  "use strict";
3845
5784
  __webpack_require__.r(__webpack_exports__);
3846
5785
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3847
- /* harmony export */ deDupeAsyncFunction: () => (/* binding */ deDupeAsyncFunction)
5786
+ /* harmony export */ convertToBuffer: () => (/* reexport safe */ _convertToBuffer__WEBPACK_IMPORTED_MODULE_0__.convertToBuffer),
5787
+ /* harmony export */ isEmptyData: () => (/* reexport safe */ _isEmptyData__WEBPACK_IMPORTED_MODULE_1__.isEmptyData),
5788
+ /* harmony export */ numToUint8: () => (/* reexport safe */ _numToUint8__WEBPACK_IMPORTED_MODULE_2__.numToUint8),
5789
+ /* harmony export */ uint32ArrayFrom: () => (/* reexport safe */ _uint32ArrayFrom__WEBPACK_IMPORTED_MODULE_3__.uint32ArrayFrom)
3848
5790
  /* harmony export */ });
3849
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5791
+ /* harmony import */ var _convertToBuffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./convertToBuffer */ "./node_modules/@aws-crypto/util/build/module/convertToBuffer.js");
5792
+ /* harmony import */ var _isEmptyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isEmptyData */ "./node_modules/@aws-crypto/util/build/module/isEmptyData.js");
5793
+ /* harmony import */ var _numToUint8__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./numToUint8 */ "./node_modules/@aws-crypto/util/build/module/numToUint8.js");
5794
+ /* harmony import */ var _uint32ArrayFrom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uint32ArrayFrom */ "./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js");
5795
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3850
5796
  // SPDX-License-Identifier: Apache-2.0
3851
- /**
3852
- * returns in-flight promise if there is one
3853
- *
3854
- * @param asyncFunction - asyncFunction to be deduped.
3855
- * @returns - the return type of the callback
3856
- */
3857
- const deDupeAsyncFunction = (asyncFunction) => {
3858
- let inflightPromise;
3859
- return async (...args) => {
3860
- if (inflightPromise)
3861
- return inflightPromise;
3862
- inflightPromise = new Promise((resolve, reject) => {
3863
- asyncFunction(...args)
3864
- .then(result => {
3865
- resolve(result);
3866
- })
3867
- .catch(error => {
3868
- reject(error);
3869
- })
3870
- .finally(() => {
3871
- inflightPromise = undefined;
3872
- });
3873
- });
3874
- return inflightPromise;
3875
- };
3876
- };
3877
5797
 
3878
5798
 
3879
- //# sourceMappingURL=deDupeAsyncFunction.mjs.map
5799
+
5800
+
3880
5801
 
3881
5802
 
3882
5803
  /***/ }),
3883
5804
 
3884
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs":
3885
- /*!*******************************************************************************!*\
3886
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs ***!
3887
- \*******************************************************************************/
5805
+ /***/ "./node_modules/@aws-crypto/util/build/module/isEmptyData.js":
5806
+ /*!*******************************************************************!*\
5807
+ !*** ./node_modules/@aws-crypto/util/build/module/isEmptyData.js ***!
5808
+ \*******************************************************************/
3888
5809
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3889
5810
 
3890
5811
  "use strict";
3891
5812
  __webpack_require__.r(__webpack_exports__);
3892
5813
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3893
- /* harmony export */ getAtob: () => (/* binding */ getAtob),
3894
- /* harmony export */ getBtoa: () => (/* binding */ getBtoa),
3895
- /* harmony export */ getCrypto: () => (/* binding */ getCrypto)
5814
+ /* harmony export */ isEmptyData: () => (/* binding */ isEmptyData)
3896
5815
  /* harmony export */ });
3897
- /* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
3898
-
3899
-
3900
-
3901
-
3902
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5816
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3903
5817
  // SPDX-License-Identifier: Apache-2.0
3904
- const getCrypto = () => {
3905
- if (typeof window === 'object' && typeof window.crypto === 'object') {
3906
- return window.crypto;
3907
- }
3908
- // Next.js global polyfill
3909
- if (typeof crypto === 'object') {
3910
- return crypto;
3911
- }
3912
- throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
3913
- name: 'MissingPolyfill',
3914
- message: 'Cannot resolve the `crypto` function from the environment.',
3915
- });
3916
- };
3917
- const getBtoa = () => {
3918
- // browser
3919
- if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
3920
- return window.btoa;
3921
- }
3922
- // Next.js global polyfill
3923
- if (typeof btoa === 'function') {
3924
- return btoa;
3925
- }
3926
- throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
3927
- name: 'Base64EncoderError',
3928
- message: 'Cannot resolve the `btoa` function from the environment.',
3929
- });
3930
- };
3931
- const getAtob = () => {
3932
- // browser
3933
- if (typeof window !== 'undefined' && typeof window.atob === 'function') {
3934
- return window.atob;
5818
+ function isEmptyData(data) {
5819
+ if (typeof data === "string") {
5820
+ return data.length === 0;
3935
5821
  }
3936
- // Next.js global polyfill
3937
- if (typeof atob === 'function') {
3938
- return atob;
3939
- }
3940
- throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
3941
- name: 'Base64EncoderError',
3942
- message: 'Cannot resolve the `atob` function from the environment.',
3943
- });
3944
- };
3945
-
3946
-
3947
- //# sourceMappingURL=index.mjs.map
5822
+ return data.byteLength === 0;
5823
+ }
3948
5824
 
3949
5825
 
3950
5826
  /***/ }),
3951
5827
 
3952
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs":
3953
- /*!*********************************************************************!*\
3954
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs ***!
3955
- \*********************************************************************/
5828
+ /***/ "./node_modules/@aws-crypto/util/build/module/numToUint8.js":
5829
+ /*!******************************************************************!*\
5830
+ !*** ./node_modules/@aws-crypto/util/build/module/numToUint8.js ***!
5831
+ \******************************************************************/
3956
5832
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3957
5833
 
3958
5834
  "use strict";
3959
5835
  __webpack_require__.r(__webpack_exports__);
3960
5836
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3961
- /* harmony export */ isBrowser: () => (/* binding */ isBrowser)
5837
+ /* harmony export */ numToUint8: () => (/* binding */ numToUint8)
3962
5838
  /* harmony export */ });
3963
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5839
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3964
5840
  // SPDX-License-Identifier: Apache-2.0
3965
- const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
3966
-
3967
-
3968
- //# sourceMappingURL=isBrowser.mjs.map
5841
+ function numToUint8(num) {
5842
+ return new Uint8Array([
5843
+ (num & 0xff000000) >> 24,
5844
+ (num & 0x00ff0000) >> 16,
5845
+ (num & 0x0000ff00) >> 8,
5846
+ num & 0x000000ff,
5847
+ ]);
5848
+ }
3969
5849
 
3970
5850
 
3971
5851
  /***/ }),
3972
5852
 
3973
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs":
3974
- /*!**************************************************************************!*\
3975
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs ***!
3976
- \**************************************************************************/
5853
+ /***/ "./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js":
5854
+ /*!***********************************************************************!*\
5855
+ !*** ./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js ***!
5856
+ \***********************************************************************/
3977
5857
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3978
5858
 
3979
5859
  "use strict";
3980
5860
  __webpack_require__.r(__webpack_exports__);
3981
5861
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3982
- /* harmony export */ isTokenExpired: () => (/* binding */ isTokenExpired)
5862
+ /* harmony export */ uint32ArrayFrom: () => (/* binding */ uint32ArrayFrom)
3983
5863
  /* harmony export */ });
3984
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5864
+ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3985
5865
  // SPDX-License-Identifier: Apache-2.0
3986
- function isTokenExpired({ expiresAt, clockDrift, tolerance = 5000, }) {
3987
- const currentTime = Date.now();
3988
- return currentTime + clockDrift + tolerance > expiresAt;
5866
+ // IE 11 does not support Array.from, so we do it manually
5867
+ function uint32ArrayFrom(a_lookUpTable) {
5868
+ if (!Uint32Array.from) {
5869
+ var return_array = new Uint32Array(a_lookUpTable.length);
5870
+ var a_index = 0;
5871
+ while (a_index < a_lookUpTable.length) {
5872
+ return_array[a_index] = a_lookUpTable[a_index];
5873
+ a_index += 1;
5874
+ }
5875
+ return return_array;
5876
+ }
5877
+ return Uint32Array.from(a_lookUpTable);
3989
5878
  }
3990
5879
 
3991
5880
 
3992
- //# sourceMappingURL=isTokenExpired.mjs.map
5881
+ /***/ }),
5882
+
5883
+ /***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js":
5884
+ /*!**************************************************************************************************!*\
5885
+ !*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js ***!
5886
+ \**************************************************************************************************/
5887
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5888
+
5889
+ "use strict";
5890
+ __webpack_require__.r(__webpack_exports__);
5891
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5892
+ /* harmony export */ fromUtf8: () => (/* binding */ fromUtf8)
5893
+ /* harmony export */ });
5894
+ const fromUtf8 = (input) => new TextEncoder().encode(input);
3993
5895
 
3994
5896
 
3995
5897
  /***/ }),
3996
5898
 
3997
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs":
3998
- /*!***************************************************************************!*\
3999
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs ***!
4000
- \***************************************************************************/
5899
+ /***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js":
5900
+ /*!***************************************************************************************!*\
5901
+ !*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js ***!
5902
+ \***************************************************************************************/
4001
5903
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4002
5904
 
4003
5905
  "use strict";
4004
5906
  __webpack_require__.r(__webpack_exports__);
4005
5907
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4006
- /* harmony export */ MAX_DELAY_MS: () => (/* binding */ MAX_DELAY_MS)
5908
+ /* harmony export */ fromUtf8: () => (/* reexport safe */ _fromUtf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8),
5909
+ /* harmony export */ toUint8Array: () => (/* reexport safe */ _toUint8Array__WEBPACK_IMPORTED_MODULE_1__.toUint8Array),
5910
+ /* harmony export */ toUtf8: () => (/* reexport safe */ _toUtf8__WEBPACK_IMPORTED_MODULE_2__.toUtf8)
4007
5911
  /* harmony export */ });
4008
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4009
- // SPDX-License-Identifier: Apache-2.0
4010
- const MAX_DELAY_MS = 5 * 60 * 1000;
5912
+ /* harmony import */ var _fromUtf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js");
5913
+ /* harmony import */ var _toUint8Array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toUint8Array */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js");
5914
+ /* harmony import */ var _toUtf8__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js");
5915
+
4011
5916
 
4012
5917
 
4013
- //# sourceMappingURL=constants.mjs.map
4014
5918
 
4015
5919
 
4016
5920
  /***/ }),
4017
5921
 
4018
- /***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs":
4019
- /*!*********************************************************************************!*\
4020
- !*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs ***!
4021
- \*********************************************************************************/
5922
+ /***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js":
5923
+ /*!**********************************************************************************************!*\
5924
+ !*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js ***!
5925
+ \**********************************************************************************************/
4022
5926
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4023
5927
 
4024
5928
  "use strict";
4025
5929
  __webpack_require__.r(__webpack_exports__);
4026
5930
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4027
- /* harmony export */ jitteredBackoff: () => (/* binding */ jitteredBackoff)
5931
+ /* harmony export */ toUint8Array: () => (/* binding */ toUint8Array)
4028
5932
  /* harmony export */ });
4029
- /* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs");
5933
+ /* harmony import */ var _fromUtf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js");
4030
5934
 
5935
+ const toUint8Array = (data) => {
5936
+ if (typeof data === "string") {
5937
+ return (0,_fromUtf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8)(data);
5938
+ }
5939
+ if (ArrayBuffer.isView(data)) {
5940
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
5941
+ }
5942
+ return new Uint8Array(data);
5943
+ };
4031
5944
 
4032
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4033
- // SPDX-License-Identifier: Apache-2.0
4034
- /**
4035
- * @private
4036
- * Internal use of Amplify only
4037
- */
4038
- function jitteredBackoff(maxDelayMs = _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.MAX_DELAY_MS) {
4039
- const BASE_TIME_MS = 100;
4040
- const JITTER_FACTOR = 100;
4041
- return attempt => {
4042
- const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();
4043
- return delay > maxDelayMs ? false : delay;
4044
- };
4045
- }
4046
5945
 
5946
+ /***/ }),
4047
5947
 
4048
- //# sourceMappingURL=jitteredBackoff.mjs.map
5948
+ /***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js":
5949
+ /*!************************************************************************************************!*\
5950
+ !*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js ***!
5951
+ \************************************************************************************************/
5952
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5953
+
5954
+ "use strict";
5955
+ __webpack_require__.r(__webpack_exports__);
5956
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5957
+ /* harmony export */ toUtf8: () => (/* binding */ toUtf8)
5958
+ /* harmony export */ });
5959
+ const toUtf8 = (input) => {
5960
+ if (typeof input === "string") {
5961
+ return input;
5962
+ }
5963
+ if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
5964
+ throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
5965
+ }
5966
+ return new TextDecoder("utf-8").decode(input);
5967
+ };
4049
5968
 
4050
5969
 
4051
5970
  /***/ }),
@@ -4391,6 +6310,454 @@ process.chdir = function (dir) {
4391
6310
  process.umask = function() { return 0; };
4392
6311
 
4393
6312
 
6313
+ /***/ }),
6314
+
6315
+ /***/ "./node_modules/tslib/tslib.es6.mjs":
6316
+ /*!******************************************!*\
6317
+ !*** ./node_modules/tslib/tslib.es6.mjs ***!
6318
+ \******************************************/
6319
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6320
+
6321
+ "use strict";
6322
+ __webpack_require__.r(__webpack_exports__);
6323
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6324
+ /* harmony export */ __addDisposableResource: () => (/* binding */ __addDisposableResource),
6325
+ /* harmony export */ __assign: () => (/* binding */ __assign),
6326
+ /* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator),
6327
+ /* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator),
6328
+ /* harmony export */ __asyncValues: () => (/* binding */ __asyncValues),
6329
+ /* harmony export */ __await: () => (/* binding */ __await),
6330
+ /* harmony export */ __awaiter: () => (/* binding */ __awaiter),
6331
+ /* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet),
6332
+ /* harmony export */ __classPrivateFieldIn: () => (/* binding */ __classPrivateFieldIn),
6333
+ /* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet),
6334
+ /* harmony export */ __createBinding: () => (/* binding */ __createBinding),
6335
+ /* harmony export */ __decorate: () => (/* binding */ __decorate),
6336
+ /* harmony export */ __disposeResources: () => (/* binding */ __disposeResources),
6337
+ /* harmony export */ __esDecorate: () => (/* binding */ __esDecorate),
6338
+ /* harmony export */ __exportStar: () => (/* binding */ __exportStar),
6339
+ /* harmony export */ __extends: () => (/* binding */ __extends),
6340
+ /* harmony export */ __generator: () => (/* binding */ __generator),
6341
+ /* harmony export */ __importDefault: () => (/* binding */ __importDefault),
6342
+ /* harmony export */ __importStar: () => (/* binding */ __importStar),
6343
+ /* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject),
6344
+ /* harmony export */ __metadata: () => (/* binding */ __metadata),
6345
+ /* harmony export */ __param: () => (/* binding */ __param),
6346
+ /* harmony export */ __propKey: () => (/* binding */ __propKey),
6347
+ /* harmony export */ __read: () => (/* binding */ __read),
6348
+ /* harmony export */ __rest: () => (/* binding */ __rest),
6349
+ /* harmony export */ __rewriteRelativeImportExtension: () => (/* binding */ __rewriteRelativeImportExtension),
6350
+ /* harmony export */ __runInitializers: () => (/* binding */ __runInitializers),
6351
+ /* harmony export */ __setFunctionName: () => (/* binding */ __setFunctionName),
6352
+ /* harmony export */ __spread: () => (/* binding */ __spread),
6353
+ /* harmony export */ __spreadArray: () => (/* binding */ __spreadArray),
6354
+ /* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays),
6355
+ /* harmony export */ __values: () => (/* binding */ __values),
6356
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
6357
+ /* harmony export */ });
6358
+ /******************************************************************************
6359
+ Copyright (c) Microsoft Corporation.
6360
+
6361
+ Permission to use, copy, modify, and/or distribute this software for any
6362
+ purpose with or without fee is hereby granted.
6363
+
6364
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6365
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6366
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6367
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6368
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6369
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6370
+ PERFORMANCE OF THIS SOFTWARE.
6371
+ ***************************************************************************** */
6372
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
6373
+
6374
+ var extendStatics = function(d, b) {
6375
+ extendStatics = Object.setPrototypeOf ||
6376
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6377
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6378
+ return extendStatics(d, b);
6379
+ };
6380
+
6381
+ function __extends(d, b) {
6382
+ if (typeof b !== "function" && b !== null)
6383
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
6384
+ extendStatics(d, b);
6385
+ function __() { this.constructor = d; }
6386
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6387
+ }
6388
+
6389
+ var __assign = function() {
6390
+ __assign = Object.assign || function __assign(t) {
6391
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6392
+ s = arguments[i];
6393
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6394
+ }
6395
+ return t;
6396
+ }
6397
+ return __assign.apply(this, arguments);
6398
+ }
6399
+
6400
+ function __rest(s, e) {
6401
+ var t = {};
6402
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6403
+ t[p] = s[p];
6404
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6405
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6406
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
6407
+ t[p[i]] = s[p[i]];
6408
+ }
6409
+ return t;
6410
+ }
6411
+
6412
+ function __decorate(decorators, target, key, desc) {
6413
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6414
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6415
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6416
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6417
+ }
6418
+
6419
+ function __param(paramIndex, decorator) {
6420
+ return function (target, key) { decorator(target, key, paramIndex); }
6421
+ }
6422
+
6423
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
6424
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
6425
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
6426
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6427
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6428
+ var _, done = false;
6429
+ for (var i = decorators.length - 1; i >= 0; i--) {
6430
+ var context = {};
6431
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
6432
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
6433
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
6434
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
6435
+ if (kind === "accessor") {
6436
+ if (result === void 0) continue;
6437
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
6438
+ if (_ = accept(result.get)) descriptor.get = _;
6439
+ if (_ = accept(result.set)) descriptor.set = _;
6440
+ if (_ = accept(result.init)) initializers.unshift(_);
6441
+ }
6442
+ else if (_ = accept(result)) {
6443
+ if (kind === "field") initializers.unshift(_);
6444
+ else descriptor[key] = _;
6445
+ }
6446
+ }
6447
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
6448
+ done = true;
6449
+ };
6450
+
6451
+ function __runInitializers(thisArg, initializers, value) {
6452
+ var useValue = arguments.length > 2;
6453
+ for (var i = 0; i < initializers.length; i++) {
6454
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
6455
+ }
6456
+ return useValue ? value : void 0;
6457
+ };
6458
+
6459
+ function __propKey(x) {
6460
+ return typeof x === "symbol" ? x : "".concat(x);
6461
+ };
6462
+
6463
+ function __setFunctionName(f, name, prefix) {
6464
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
6465
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
6466
+ };
6467
+
6468
+ function __metadata(metadataKey, metadataValue) {
6469
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
6470
+ }
6471
+
6472
+ function __awaiter(thisArg, _arguments, P, generator) {
6473
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6474
+ return new (P || (P = Promise))(function (resolve, reject) {
6475
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6476
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6477
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6478
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
6479
+ });
6480
+ }
6481
+
6482
+ function __generator(thisArg, body) {
6483
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
6484
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
6485
+ function verb(n) { return function (v) { return step([n, v]); }; }
6486
+ function step(op) {
6487
+ if (f) throw new TypeError("Generator is already executing.");
6488
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
6489
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
6490
+ if (y = 0, t) op = [op[0] & 2, t.value];
6491
+ switch (op[0]) {
6492
+ case 0: case 1: t = op; break;
6493
+ case 4: _.label++; return { value: op[1], done: false };
6494
+ case 5: _.label++; y = op[1]; op = [0]; continue;
6495
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
6496
+ default:
6497
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
6498
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
6499
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
6500
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
6501
+ if (t[2]) _.ops.pop();
6502
+ _.trys.pop(); continue;
6503
+ }
6504
+ op = body.call(thisArg, _);
6505
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
6506
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
6507
+ }
6508
+ }
6509
+
6510
+ var __createBinding = Object.create ? (function(o, m, k, k2) {
6511
+ if (k2 === undefined) k2 = k;
6512
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6513
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6514
+ desc = { enumerable: true, get: function() { return m[k]; } };
6515
+ }
6516
+ Object.defineProperty(o, k2, desc);
6517
+ }) : (function(o, m, k, k2) {
6518
+ if (k2 === undefined) k2 = k;
6519
+ o[k2] = m[k];
6520
+ });
6521
+
6522
+ function __exportStar(m, o) {
6523
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
6524
+ }
6525
+
6526
+ function __values(o) {
6527
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
6528
+ if (m) return m.call(o);
6529
+ if (o && typeof o.length === "number") return {
6530
+ next: function () {
6531
+ if (o && i >= o.length) o = void 0;
6532
+ return { value: o && o[i++], done: !o };
6533
+ }
6534
+ };
6535
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
6536
+ }
6537
+
6538
+ function __read(o, n) {
6539
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
6540
+ if (!m) return o;
6541
+ var i = m.call(o), r, ar = [], e;
6542
+ try {
6543
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
6544
+ }
6545
+ catch (error) { e = { error: error }; }
6546
+ finally {
6547
+ try {
6548
+ if (r && !r.done && (m = i["return"])) m.call(i);
6549
+ }
6550
+ finally { if (e) throw e.error; }
6551
+ }
6552
+ return ar;
6553
+ }
6554
+
6555
+ /** @deprecated */
6556
+ function __spread() {
6557
+ for (var ar = [], i = 0; i < arguments.length; i++)
6558
+ ar = ar.concat(__read(arguments[i]));
6559
+ return ar;
6560
+ }
6561
+
6562
+ /** @deprecated */
6563
+ function __spreadArrays() {
6564
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
6565
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
6566
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6567
+ r[k] = a[j];
6568
+ return r;
6569
+ }
6570
+
6571
+ function __spreadArray(to, from, pack) {
6572
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
6573
+ if (ar || !(i in from)) {
6574
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6575
+ ar[i] = from[i];
6576
+ }
6577
+ }
6578
+ return to.concat(ar || Array.prototype.slice.call(from));
6579
+ }
6580
+
6581
+ function __await(v) {
6582
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
6583
+ }
6584
+
6585
+ function __asyncGenerator(thisArg, _arguments, generator) {
6586
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6587
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
6588
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
6589
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
6590
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
6591
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
6592
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
6593
+ function fulfill(value) { resume("next", value); }
6594
+ function reject(value) { resume("throw", value); }
6595
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
6596
+ }
6597
+
6598
+ function __asyncDelegator(o) {
6599
+ var i, p;
6600
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
6601
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
6602
+ }
6603
+
6604
+ function __asyncValues(o) {
6605
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6606
+ var m = o[Symbol.asyncIterator], i;
6607
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
6608
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
6609
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
6610
+ }
6611
+
6612
+ function __makeTemplateObject(cooked, raw) {
6613
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
6614
+ return cooked;
6615
+ };
6616
+
6617
+ var __setModuleDefault = Object.create ? (function(o, v) {
6618
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6619
+ }) : function(o, v) {
6620
+ o["default"] = v;
6621
+ };
6622
+
6623
+ var ownKeys = function(o) {
6624
+ ownKeys = Object.getOwnPropertyNames || function (o) {
6625
+ var ar = [];
6626
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
6627
+ return ar;
6628
+ };
6629
+ return ownKeys(o);
6630
+ };
6631
+
6632
+ function __importStar(mod) {
6633
+ if (mod && mod.__esModule) return mod;
6634
+ var result = {};
6635
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
6636
+ __setModuleDefault(result, mod);
6637
+ return result;
6638
+ }
6639
+
6640
+ function __importDefault(mod) {
6641
+ return (mod && mod.__esModule) ? mod : { default: mod };
6642
+ }
6643
+
6644
+ function __classPrivateFieldGet(receiver, state, kind, f) {
6645
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
6646
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
6647
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6648
+ }
6649
+
6650
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
6651
+ if (kind === "m") throw new TypeError("Private method is not writable");
6652
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
6653
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6654
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6655
+ }
6656
+
6657
+ function __classPrivateFieldIn(state, receiver) {
6658
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
6659
+ return typeof state === "function" ? receiver === state : state.has(receiver);
6660
+ }
6661
+
6662
+ function __addDisposableResource(env, value, async) {
6663
+ if (value !== null && value !== void 0) {
6664
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
6665
+ var dispose, inner;
6666
+ if (async) {
6667
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
6668
+ dispose = value[Symbol.asyncDispose];
6669
+ }
6670
+ if (dispose === void 0) {
6671
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
6672
+ dispose = value[Symbol.dispose];
6673
+ if (async) inner = dispose;
6674
+ }
6675
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
6676
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
6677
+ env.stack.push({ value: value, dispose: dispose, async: async });
6678
+ }
6679
+ else if (async) {
6680
+ env.stack.push({ async: true });
6681
+ }
6682
+ return value;
6683
+ }
6684
+
6685
+ var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
6686
+ var e = new Error(message);
6687
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
6688
+ };
6689
+
6690
+ function __disposeResources(env) {
6691
+ function fail(e) {
6692
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
6693
+ env.hasError = true;
6694
+ }
6695
+ var r, s = 0;
6696
+ function next() {
6697
+ while (r = env.stack.pop()) {
6698
+ try {
6699
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
6700
+ if (r.dispose) {
6701
+ var result = r.dispose.call(r.value);
6702
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
6703
+ }
6704
+ else s |= 1;
6705
+ }
6706
+ catch (e) {
6707
+ fail(e);
6708
+ }
6709
+ }
6710
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
6711
+ if (env.hasError) throw env.error;
6712
+ }
6713
+ return next();
6714
+ }
6715
+
6716
+ function __rewriteRelativeImportExtension(path, preserveJsx) {
6717
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
6718
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
6719
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
6720
+ });
6721
+ }
6722
+ return path;
6723
+ }
6724
+
6725
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
6726
+ __extends,
6727
+ __assign,
6728
+ __rest,
6729
+ __decorate,
6730
+ __param,
6731
+ __esDecorate,
6732
+ __runInitializers,
6733
+ __propKey,
6734
+ __setFunctionName,
6735
+ __metadata,
6736
+ __awaiter,
6737
+ __generator,
6738
+ __createBinding,
6739
+ __exportStar,
6740
+ __values,
6741
+ __read,
6742
+ __spread,
6743
+ __spreadArrays,
6744
+ __spreadArray,
6745
+ __await,
6746
+ __asyncGenerator,
6747
+ __asyncDelegator,
6748
+ __asyncValues,
6749
+ __makeTemplateObject,
6750
+ __importStar,
6751
+ __importDefault,
6752
+ __classPrivateFieldGet,
6753
+ __classPrivateFieldSet,
6754
+ __classPrivateFieldIn,
6755
+ __addDisposableResource,
6756
+ __disposeResources,
6757
+ __rewriteRelativeImportExtension,
6758
+ });
6759
+
6760
+
4394
6761
  /***/ }),
4395
6762
 
4396
6763
  /***/ "./node_modules/uuid/dist/esm-browser/native.js":
@@ -4571,4 +6938,4 @@ function validate(uuid) {
4571
6938
  /***/ })
4572
6939
 
4573
6940
  }]);
4574
- //# sourceMappingURL=vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js.map
6941
+ //# sourceMappingURL=vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map