@techstuff-dev/foundation-api-utils 1.47.0 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/cjs/chunks/index-CfrYa4U_.js +9 -0
  2. package/dist/cjs/chunks/index-CfrYa4U_.js.map +1 -0
  3. package/dist/cjs/chunks/shared-2Qy1c7Qz.js +19 -0
  4. package/dist/cjs/chunks/shared-2Qy1c7Qz.js.map +1 -0
  5. package/dist/cjs/chunks/slice-CkWobkWw.js +125 -0
  6. package/dist/cjs/chunks/slice-CkWobkWw.js.map +1 -0
  7. package/dist/{index.js → cjs/chunks/slice-DsZzY7T7.js} +618 -875
  8. package/dist/cjs/chunks/slice-DsZzY7T7.js.map +1 -0
  9. package/dist/cjs/chunks/useAuth-DKhvUX_r.js +13 -0
  10. package/dist/cjs/chunks/useAuth-DKhvUX_r.js.map +1 -0
  11. package/dist/cjs/hooks/index.native.js +19 -0
  12. package/dist/cjs/hooks/index.native.js.map +1 -0
  13. package/dist/cjs/hooks/index.web.js +19 -0
  14. package/dist/cjs/hooks/index.web.js.map +1 -0
  15. package/dist/cjs/index.js +96 -0
  16. package/dist/cjs/index.js.map +1 -0
  17. package/dist/cjs/store/index.native.js +415 -0
  18. package/dist/cjs/store/index.native.js.map +1 -0
  19. package/dist/cjs/store/index.web.js +188 -0
  20. package/dist/cjs/store/index.web.js.map +1 -0
  21. package/dist/esm/chunks/index-KjhWa1AL.js +6 -0
  22. package/dist/esm/chunks/index-KjhWa1AL.js.map +1 -0
  23. package/dist/esm/chunks/shared--CrxBBZ8.js +16 -0
  24. package/dist/esm/chunks/shared--CrxBBZ8.js.map +1 -0
  25. package/dist/{index.esm.js → esm/chunks/slice-3o-PH5Gz.js} +619 -855
  26. package/dist/esm/chunks/slice-3o-PH5Gz.js.map +1 -0
  27. package/dist/esm/chunks/slice-ChJ8ZvmP.js +107 -0
  28. package/dist/esm/chunks/slice-ChJ8ZvmP.js.map +1 -0
  29. package/dist/esm/chunks/useAuth-8d6DlERn.js +11 -0
  30. package/dist/esm/chunks/useAuth-8d6DlERn.js.map +1 -0
  31. package/dist/esm/hooks/index.native.js +14 -0
  32. package/dist/esm/hooks/index.native.js.map +1 -0
  33. package/dist/esm/hooks/index.web.js +14 -0
  34. package/dist/esm/hooks/index.web.js.map +1 -0
  35. package/dist/esm/index.js +9 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/dist/esm/store/index.native.js +412 -0
  38. package/dist/esm/store/index.native.js.map +1 -0
  39. package/dist/esm/store/index.web.js +185 -0
  40. package/dist/esm/store/index.web.js.map +1 -0
  41. package/dist/types/hooks/index.d.ts +3 -0
  42. package/dist/types/index-BDQnFTra.d.ts +1299 -0
  43. package/dist/{index.d.ts → types/index.d.ts} +64 -1301
  44. package/dist/types/store/index.d.ts +3 -0
  45. package/package.json +37 -9
  46. package/dist/index.esm.js.map +0 -1
  47. package/dist/index.js.map +0 -1
  48. package/dist/lib/api/index.d.ts +0 -21
  49. package/dist/lib/hooks/index.d.ts +0 -4
  50. package/dist/lib/hooks/useAuth.d.ts +0 -1
  51. package/dist/lib/index.d.ts +0 -6
  52. package/dist/lib/services/auth/index.d.ts +0 -2027
  53. package/dist/lib/services/auth/slice.d.ts +0 -91
  54. package/dist/lib/services/cart/slice.d.ts +0 -155
  55. package/dist/lib/services/content/content.interfaces.d.ts +0 -801
  56. package/dist/lib/services/content/index.d.ts +0 -532
  57. package/dist/lib/services/index.d.ts +0 -7
  58. package/dist/lib/services/orders/index.d.ts +0 -271
  59. package/dist/lib/services/payment/index.d.ts +0 -1063
  60. package/dist/lib/store/index.d.ts +0 -2
  61. package/dist/lib/store/index.native.d.ts +0 -68
  62. package/dist/lib/store/index.web.d.ts +0 -68
  63. package/dist/lib/store/storage.d.ts +0 -2
  64. package/dist/lib/types/index.interfaces.d.ts +0 -428
  65. package/dist/lib/utils/dataFormat/index.d.ts +0 -86
  66. package/dist/lib/utils/helpers/index.d.ts +0 -14
  67. package/dist/node_modules/@reduxjs/toolkit/dist/uncheckedindexed.d.ts +0 -5
@@ -1,92 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ var awsAmplify = require('aws-amplify');
4
+ var slice = require('./slice-CkWobkWw.js');
3
5
  var toolkit = require('@reduxjs/toolkit');
4
6
  var reactRedux = require('react-redux');
5
7
  var React = require('react');
6
- var awsAmplify = require('aws-amplify');
7
8
  var jwtDecode = require('jwt-decode');
8
- var reactNative = require('react-native');
9
-
10
- /******************************************************************************
11
- Copyright (c) Microsoft Corporation.
12
-
13
- Permission to use, copy, modify, and/or distribute this software for any
14
- purpose with or without fee is hereby granted.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
17
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
19
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
- PERFORMANCE OF THIS SOFTWARE.
23
- ***************************************************************************** */
24
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
25
-
26
-
27
- var __assign = function() {
28
- __assign = Object.assign || function __assign(t) {
29
- for (var s, i = 1, n = arguments.length; i < n; i++) {
30
- s = arguments[i];
31
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
32
- }
33
- return t;
34
- };
35
- return __assign.apply(this, arguments);
36
- };
37
-
38
- function __awaiter(thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- }
47
-
48
- function __generator(thisArg, body) {
49
- 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);
50
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
- function verb(n) { return function (v) { return step([n, v]); }; }
52
- function step(op) {
53
- if (f) throw new TypeError("Generator is already executing.");
54
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
55
- 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;
56
- if (y = 0, t) op = [op[0] & 2, t.value];
57
- switch (op[0]) {
58
- case 0: case 1: t = op; break;
59
- case 4: _.label++; return { value: op[1], done: false };
60
- case 5: _.label++; y = op[1]; op = [0]; continue;
61
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
62
- default:
63
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
64
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
65
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
66
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
67
- if (t[2]) _.ops.pop();
68
- _.trys.pop(); continue;
69
- }
70
- op = body.call(thisArg, _);
71
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
72
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
- }
74
- }
75
-
76
- function __spreadArray(to, from, pack) {
77
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
78
- if (ar || !(i in from)) {
79
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
80
- ar[i] = from[i];
81
- }
82
- }
83
- return to.concat(ar || Array.prototype.slice.call(from));
84
- }
85
-
86
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
87
- var e = new Error(message);
88
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
89
- };
90
9
 
91
10
  // src/utils/env.ts
92
11
  var NOTHING = Symbol.for("immer-nothing");
@@ -2431,7 +2350,7 @@ function updateMutationSubstateIfExists(state, id, update) {
2431
2350
  update(substate);
2432
2351
  }
2433
2352
  }
2434
- var initialState$2 = {};
2353
+ var initialState$1 = {};
2435
2354
  function buildSlice({
2436
2355
  reducerPath,
2437
2356
  queryThunk,
@@ -2507,7 +2426,7 @@ function buildSlice({
2507
2426
  }
2508
2427
  const querySlice = toolkit.createSlice({
2509
2428
  name: `${reducerPath}/queries`,
2510
- initialState: initialState$2,
2429
+ initialState: initialState$1,
2511
2430
  reducers: {
2512
2431
  removeQueryResult: {
2513
2432
  reducer(draft, {
@@ -2641,7 +2560,7 @@ function buildSlice({
2641
2560
  });
2642
2561
  const mutationSlice = toolkit.createSlice({
2643
2562
  name: `${reducerPath}/mutations`,
2644
- initialState: initialState$2,
2563
+ initialState: initialState$1,
2645
2564
  reducers: {
2646
2565
  removeMutationResult: {
2647
2566
  reducer(draft, {
@@ -2810,7 +2729,7 @@ function buildSlice({
2810
2729
  }
2811
2730
  const subscriptionSlice = toolkit.createSlice({
2812
2731
  name: `${reducerPath}/subscriptions`,
2813
- initialState: initialState$2,
2732
+ initialState: initialState$1,
2814
2733
  reducers: {
2815
2734
  updateSubscriptionOptions(d, a) {
2816
2735
  },
@@ -2822,7 +2741,7 @@ function buildSlice({
2822
2741
  });
2823
2742
  const internalSubscriptionsSlice = toolkit.createSlice({
2824
2743
  name: `${reducerPath}/internalSubscriptions`,
2825
- initialState: initialState$2,
2744
+ initialState: initialState$1,
2826
2745
  reducers: {
2827
2746
  subscriptionsUpdated: {
2828
2747
  reducer(state, action) {
@@ -4765,110 +4684,30 @@ Hook ${hookName} was either not provided or not a function.`);
4765
4684
  // src/query/react/index.ts
4766
4685
  var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
4767
4686
 
4768
- var _a$2, _b$2;
4769
- var initialState$1 = {
4770
- authenticated: false,
4771
- verifying: false,
4772
- user: {
4773
- details: {
4774
- userSub: '',
4775
- uuid: '',
4776
- subscription: '',
4777
- subscriptionDetails: undefined,
4778
- firstName: '',
4779
- lastName: '',
4780
- userEmail: '',
4781
- termsAccepted: '',
4782
- contactPreference: false,
4783
- dateOfBirth: '',
4784
- picture: '',
4785
- },
4786
- accessToken: '',
4787
- idToken: '',
4788
- accessTokenExpiry: null,
4789
- refreshToken: '',
4790
- email: '',
4791
- sub: '',
4792
- },
4793
- loading: false,
4794
- error: false,
4795
- session: undefined,
4796
- };
4797
- var authSlice = toolkit.createSlice({
4798
- name: 'auth',
4799
- initialState: initialState$1,
4800
- reducers: {
4801
- setCredentials: function (state, data) {
4802
- return __assign(__assign({}, state), { session: data.payload.accessToken, authenticated: true, verifying: true, user: __assign(__assign({}, state.user), data.payload) });
4803
- },
4804
- resetCreating: function (state) {
4805
- return __assign(__assign({}, state), { creating: {
4806
- details: '',
4807
- payment: '',
4808
- } });
4809
- },
4810
- updateSubscription: function (state, data) {
4811
- return __assign(__assign({}, state), { user: __assign(__assign({}, state.user), { details: __assign(__assign({}, state.user.details), { customerId: data.payload.customerId, subscription: data.payload.subscription, subscriptionDetails: data.payload.subscriptionDetails }) }) });
4812
- },
4813
- logout: function () { return initialState$1; },
4814
- },
4815
- selectors: {
4816
- isAuthenticated: function (auth) { return auth.authenticated; },
4817
- selectAccessToken: function (auth) { return auth.user.accessToken; },
4818
- selectRefreshToken: function (auth) { return auth.user.refreshToken; },
4819
- selectCurrentUser: function (auth) { return auth.user.details; },
4820
- isVerifying: function (auth) { return auth.verifying; },
4821
- getUserSession: function (auth) { return (auth.authenticated ? auth.session : false); },
4822
- // TODO: override this selector directly in the CNBCMEDIA app.
4823
- selectCurrentUserSub: function (auth) { var _a, _b, _c; return ((_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c["custom:legacySub"]) || auth.user.sub; },
4824
- selectCurrentUserRefreshToken: function (auth) { return auth.user.refreshToken; },
4825
- selectUserTokens: function (auth) {
4826
- return {
4827
- accessToken: auth.user.accessToken,
4828
- refreshToken: auth.user.refreshToken,
4829
- idToken: auth.user.idToken,
4830
- };
4831
- },
4832
- selectUserSubscriptionStatus: function (auth) {
4833
- var _a, _b, _c;
4834
- return (_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails) === null || _c === void 0 ? void 0 : _c.status;
4835
- },
4836
- selectSubscription: function (auth) {
4837
- var _a, _b;
4838
- return (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails;
4839
- },
4840
- selectSubscriptionPrice: function (auth) {
4841
- var _a, _b, _c;
4842
- return (_c = (_b = (_a = auth === null || auth === void 0 ? void 0 : auth.user) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.subscriptionDetails) === null || _c === void 0 ? void 0 : _c.amount;
4843
- },
4844
- },
4845
- });
4846
- // Action creators are generated for each case reducer function.
4847
- var setCredentials = (_a$2 = authSlice.actions, _a$2.setCredentials), resetCreating = _a$2.resetCreating, logout = _a$2.logout, updateSubscription = _a$2.updateSubscription;
4848
- // Selectors returned by `slice.selectors` take the root state as their first argument.
4849
- var isAuthenticated = (_b$2 = authSlice.selectors, _b$2.isAuthenticated), selectAccessToken = _b$2.selectAccessToken, selectRefreshToken = _b$2.selectRefreshToken, selectCurrentUser = _b$2.selectCurrentUser, isVerifying = _b$2.isVerifying, getUserSession = _b$2.getUserSession, selectCurrentUserSub = _b$2.selectCurrentUserSub, selectCurrentUserRefreshToken = _b$2.selectCurrentUserRefreshToken, selectUserTokens = _b$2.selectUserTokens, selectUserSubscriptionStatus = _b$2.selectUserSubscriptionStatus, selectSubscription = _b$2.selectSubscription, selectSubscriptionPrice = _b$2.selectSubscriptionPrice;
4850
- authSlice.reducer;
4851
-
4852
4687
  function applyCoupon(coupon, netTotal) {
4853
- var discountedAmount = netTotal * (Number(coupon.discount) / 100);
4854
- var discountedTotal = netTotal - discountedAmount;
4855
- var data = __assign(__assign({}, coupon), { discountedTotal: discountedTotal, discountedAmount: discountedAmount });
4688
+ const discountedAmount = netTotal * (Number(coupon.discount) / 100);
4689
+ const discountedTotal = netTotal - discountedAmount;
4690
+ const data = {
4691
+ ...coupon,
4692
+ discountedTotal,
4693
+ discountedAmount,
4694
+ };
4856
4695
  return data;
4857
4696
  }
4858
4697
  function applyTax(taxRate, netTotal) {
4859
- var taxAmount = netTotal * (taxRate.percentage / 100);
4698
+ const taxAmount = netTotal * (taxRate.percentage / 100);
4860
4699
  return taxAmount;
4861
4700
  }
4862
4701
  function toCamelCaseObject(obj) {
4863
- var toCamelCase = function (str) {
4864
- return str.replace(/([-_][a-z])/gi, function (match) {
4702
+ const toCamelCase = (str) => {
4703
+ return str.replace(/([-_][a-z])/gi, (match) => {
4865
4704
  return match.toUpperCase().replace(/[-_]/, '');
4866
4705
  });
4867
4706
  };
4868
- var camelCaseObject = {};
4869
- for (var key in obj) {
4707
+ const camelCaseObject = {};
4708
+ for (const key in obj) {
4870
4709
  if (obj.hasOwnProperty(key)) {
4871
- var camelKey = toCamelCase(key);
4710
+ const camelKey = toCamelCase(key);
4872
4711
  camelCaseObject[camelKey] = obj[key];
4873
4712
  }
4874
4713
  }
@@ -4876,44 +4715,43 @@ function toCamelCaseObject(obj) {
4876
4715
  }
4877
4716
 
4878
4717
  // TODO: typing.
4879
- var formatUserPayload = function (payload) {
4880
- var userEmail = payload.email, firstName = payload.given_name, lastName = payload.family_name, dateOfBirth = payload.birthdate, picture = payload.picture, uuid = payload["cognito:username"], termsAccepted = payload["custom:termsAccepted"], subscriptionId = payload["custom:subscriptionId"], contactPreference = payload["custom:contactPreferences"], customerId = payload["custom:customerId"];
4881
- var parsedTermsAccepted = termsAccepted ? JSON.parse(termsAccepted) : null;
4882
- var parsedContactPreference = contactPreference
4718
+ const formatUserPayload = (payload) => {
4719
+ const { email: userEmail, given_name: firstName, family_name: lastName, birthdate: dateOfBirth, picture: picture, 'cognito:username': uuid, 'custom:termsAccepted': termsAccepted, 'custom:subscriptionId': subscriptionId, 'custom:contactPreferences': contactPreference, 'custom:customerId': customerId, } = payload;
4720
+ const parsedTermsAccepted = termsAccepted ? JSON.parse(termsAccepted) : null;
4721
+ const parsedContactPreference = contactPreference
4883
4722
  ? JSON.parse(contactPreference)
4884
4723
  : null;
4885
- var data = {
4886
- userEmail: userEmail,
4887
- lastName: lastName,
4888
- firstName: firstName,
4889
- dateOfBirth: dateOfBirth,
4724
+ const data = {
4725
+ userEmail,
4726
+ lastName,
4727
+ firstName,
4728
+ dateOfBirth,
4890
4729
  /** Handles the auth micro service/Cognito serving boolean options as a string. */
4891
4730
  termsAccepted: parsedTermsAccepted,
4892
4731
  contactPreference: parsedContactPreference,
4893
- uuid: uuid,
4732
+ uuid,
4894
4733
  subscription: subscriptionId || null,
4895
- customerId: customerId,
4896
- picture: picture,
4734
+ customerId,
4735
+ picture,
4897
4736
  };
4898
4737
  return data;
4899
4738
  };
4900
4739
  function formatPromos(data) {
4901
- return data.map(function (item) {
4902
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
4740
+ return data.map((item) => {
4903
4741
  return {
4904
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
4905
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
4906
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
4907
- image: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.image) === null || _h === void 0 ? void 0 : _h[0],
4908
- imageFormatted: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.image_formatted) === null || _k === void 0 ? void 0 : _k[0],
4909
- description: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.description) === null || _m === void 0 ? void 0 : _m[0],
4910
- created: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.created) === null || _p === void 0 ? void 0 : _p[0],
4911
- updated: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.updated) === null || _r === void 0 ? void 0 : _r[0],
4912
- weight: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.weight) === null || _t === void 0 ? void 0 : _t[0],
4913
- buttonText: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.button_text) === null || _v === void 0 ? void 0 : _v[0],
4914
- link: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.link) === null || _x === void 0 ? void 0 : _x[0],
4915
- linkMobile: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.link_mobile) === null || _z === void 0 ? void 0 : _z[0],
4916
- term: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.term) === null || _1 === void 0 ? void 0 : _1[0],
4742
+ uuid: item?._source?.uuid?.[0],
4743
+ id: item?._source?.uuid?.[0],
4744
+ title: item?._source?.title?.[0],
4745
+ image: item?._source?.image?.[0],
4746
+ imageFormatted: item?._source?.image_formatted?.[0],
4747
+ description: item?._source?.description?.[0],
4748
+ created: item?._source?.created?.[0],
4749
+ updated: item?._source?.updated?.[0],
4750
+ weight: item?._source?.weight?.[0],
4751
+ buttonText: item?._source?.button_text?.[0],
4752
+ link: item?._source?.link?.[0],
4753
+ linkMobile: item?._source?.link_mobile?.[0],
4754
+ term: item?._source?.term?.[0],
4917
4755
  // video: item?._source?.video?.[0],
4918
4756
  // align: item?._source?.align?.[0],
4919
4757
  // section: item?._source?.section?.[0],
@@ -4926,28 +4764,27 @@ function formatPromos(data) {
4926
4764
  });
4927
4765
  }
4928
4766
  function formatWorkout(data) {
4929
- return data.map(function (item) {
4930
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
4767
+ return data.map((item) => {
4931
4768
  return {
4932
- changed: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.changed) === null || _b === void 0 ? void 0 : _b[0],
4933
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
4934
- uuid: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.uuid) === null || _f === void 0 ? void 0 : _f[0],
4935
- description: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.description) === null || _h === void 0 ? void 0 : _h[0],
4936
- duration: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.duration_filter) === null || _k === void 0 ? void 0 : _k[0],
4769
+ changed: item?._source?.changed?.[0],
4770
+ created: item?._source?.created?.[0],
4771
+ uuid: item?._source?.uuid?.[0],
4772
+ description: item?._source?.description?.[0],
4773
+ duration: item?._source?.duration_filter?.[0],
4937
4774
  // duration_filter: item?._source?.duration_filter?.[0],
4938
- level: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.level) === null || _m === void 0 ? void 0 : _m[0],
4939
- published: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.published) === null || _p === void 0 ? void 0 : _p[0],
4940
- targeted_section: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.targeted_section) === null || _r === void 0 ? void 0 : _r[0],
4941
- uid: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.uid) === null || _t === void 0 ? void 0 : _t[0],
4942
- imageStyled: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.image_16_9) === null || _v === void 0 ? void 0 : _v[0],
4943
- image: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.image) === null || _x === void 0 ? void 0 : _x[0],
4944
- title: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.title) === null || _z === void 0 ? void 0 : _z[0],
4945
- video: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.video_url) === null || _1 === void 0 ? void 0 : _1[0],
4946
- videoDownload: (_3 = (_2 = item === null || item === void 0 ? void 0 : item._source) === null || _2 === void 0 ? void 0 : _2.video_download) === null || _3 === void 0 ? void 0 : _3[0],
4947
- videoPoster: (_5 = (_4 = item === null || item === void 0 ? void 0 : item._source) === null || _4 === void 0 ? void 0 : _4.video_poster) === null || _5 === void 0 ? void 0 : _5[0],
4948
- workoutCategory: (_7 = (_6 = item === null || item === void 0 ? void 0 : item._source) === null || _6 === void 0 ? void 0 : _6.workout_category) === null || _7 === void 0 ? void 0 : _7[0],
4949
- workoutType: (_9 = (_8 = item === null || item === void 0 ? void 0 : item._source) === null || _8 === void 0 ? void 0 : _8.workout_type) === null || _9 === void 0 ? void 0 : _9[0],
4950
- livestreamSection: (_11 = (_10 = item === null || item === void 0 ? void 0 : item._source) === null || _10 === void 0 ? void 0 : _10.livestream_section) === null || _11 === void 0 ? void 0 : _11[0],
4775
+ level: item?._source?.level?.[0],
4776
+ published: item?._source?.published?.[0],
4777
+ targeted_section: item?._source?.targeted_section?.[0],
4778
+ uid: item?._source?.uid?.[0],
4779
+ imageStyled: item?._source?.image_16_9?.[0],
4780
+ image: item?._source?.image?.[0],
4781
+ title: item?._source?.title?.[0],
4782
+ video: item?._source?.video_url?.[0],
4783
+ videoDownload: item?._source?.video_download?.[0],
4784
+ videoPoster: item?._source?.video_poster?.[0],
4785
+ workoutCategory: item?._source?.workout_category?.[0],
4786
+ workoutType: item?._source?.workout_type?.[0],
4787
+ livestreamSection: item?._source?.livestream_section?.[0],
4951
4788
  };
4952
4789
  });
4953
4790
  }
@@ -4970,8 +4807,8 @@ function formatWorkout(data) {
4970
4807
  // return formattedSeriesSelection;
4971
4808
  // }
4972
4809
  function formatShortform(data) {
4973
- return data.map(function (item) {
4974
- var _source = item._source;
4810
+ return data.map((item) => {
4811
+ const { _source } = item;
4975
4812
  return {
4976
4813
  uuid: _source.uuid && _source.uuid[0],
4977
4814
  id: _source.uuid && _source.uuid[0],
@@ -5020,8 +4857,8 @@ function formatShortform(data) {
5020
4857
  // });
5021
4858
  // }
5022
4859
  function formatFaqs(data) {
5023
- return data.map(function (item) {
5024
- var _source = item._source;
4860
+ return data.map((item) => {
4861
+ const { _source } = item;
5025
4862
  return {
5026
4863
  uuid: _source.uuid && _source.uuid[0],
5027
4864
  id: _source.uuid && _source.uuid[0],
@@ -5033,24 +4870,23 @@ function formatFaqs(data) {
5033
4870
  });
5034
4871
  }
5035
4872
  function formatPages(data) {
5036
- return data.map(function (item) {
5037
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
4873
+ return data.map((item) => {
5038
4874
  return {
5039
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5040
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5041
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5042
- body: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h[0],
5043
- created: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.created) === null || _k === void 0 ? void 0 : _k[0],
5044
- updated: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.updated) === null || _m === void 0 ? void 0 : _m[0],
5045
- langcode: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.langcode) === null || _p === void 0 ? void 0 : _p[0],
5046
- url: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.url) === null || _r === void 0 ? void 0 : _r[0],
4875
+ uuid: item?._source?.uuid?.[0],
4876
+ id: item?._source?.uuid?.[0],
4877
+ title: item?._source?.title?.[0],
4878
+ body: item?._source?.body?.[0],
4879
+ created: item?._source?.created?.[0],
4880
+ updated: item?._source?.updated?.[0],
4881
+ langcode: item?._source?.langcode?.[0],
4882
+ url: item?._source?.url?.[0],
5047
4883
  };
5048
4884
  });
5049
4885
  }
5050
4886
  function formatSettings(data) {
5051
- return data.map(function (item) {
5052
- var _source = item._source;
5053
- var fieldset = _source.fieldset && _source.fieldset[0].toLowerCase();
4887
+ return data.map((item) => {
4888
+ const { _source } = item;
4889
+ const fieldset = _source.fieldset && _source.fieldset[0].toLowerCase();
5054
4890
  return {
5055
4891
  uuid: _source.uuid && _source.uuid[0],
5056
4892
  created: _source.created && _source.created[0],
@@ -5060,13 +4896,13 @@ function formatSettings(data) {
5060
4896
  video: _source.video && _source.video[0],
5061
4897
  number: _source.number && _source.number[0],
5062
4898
  pass: _source.pass && _source.pass[0],
5063
- fieldset: fieldset,
4899
+ fieldset,
5064
4900
  };
5065
4901
  });
5066
4902
  }
5067
4903
  function formatPress(data) {
5068
- return data.map(function (item) {
5069
- var _source = item._source;
4904
+ return data.map((item) => {
4905
+ const { _source } = item;
5070
4906
  return {
5071
4907
  uuid: _source.uuid && _source.uuid[0],
5072
4908
  created: _source.created && _source.created[0],
@@ -5077,8 +4913,8 @@ function formatPress(data) {
5077
4913
  });
5078
4914
  }
5079
4915
  function formatGuests(data) {
5080
- return data.map(function (item) {
5081
- var _source = item._source;
4916
+ return data.map((item) => {
4917
+ const { _source } = item;
5082
4918
  return {
5083
4919
  uuid: _source.uuid && _source.uuid[0],
5084
4920
  id: _source.id && _source.id[0],
@@ -5091,27 +4927,26 @@ function formatGuests(data) {
5091
4927
  });
5092
4928
  }
5093
4929
  function formatVideos(data) {
5094
- return data.map(function (item) {
5095
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
4930
+ return data.map((item) => {
5096
4931
  return {
5097
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5098
- title: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d[0],
5099
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5100
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5101
- description: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.description) === null || _k === void 0 ? void 0 : _k[0],
5102
- image: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.image) === null || _m === void 0 ? void 0 : _m[0],
5103
- duration: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.duration) === null || _p === void 0 ? void 0 : _p[0],
5104
- section: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.section) === null || _r === void 0 ? void 0 : _r[0],
5105
- videoPoster: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.video_poster) === null || _t === void 0 ? void 0 : _t[0],
5106
- video: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.video_url) === null || _v === void 0 ? void 0 : _v[0],
5107
- videoDownload: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video_download) === null || _x === void 0 ? void 0 : _x[0],
5108
- sectionId: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.section_id) === null || _z === void 0 ? void 0 : _z[0],
4932
+ uuid: item?._source?.uuid?.[0],
4933
+ title: item?._source?.title?.[0],
4934
+ created: item?._source?.created?.[0],
4935
+ updated: item?._source?.updated?.[0],
4936
+ description: item?._source?.description?.[0],
4937
+ image: item?._source?.image?.[0],
4938
+ duration: item?._source?.duration?.[0],
4939
+ section: item?._source?.section?.[0],
4940
+ videoPoster: item?._source?.video_poster?.[0],
4941
+ video: item?._source?.video_url?.[0],
4942
+ videoDownload: item?._source?.video_download?.[0],
4943
+ sectionId: item?._source?.section_id?.[0],
5109
4944
  };
5110
4945
  });
5111
4946
  }
5112
4947
  function formatSections(data) {
5113
- return data.map(function (item) {
5114
- var _source = item._source;
4948
+ return data.map((item) => {
4949
+ const { _source } = item;
5115
4950
  return {
5116
4951
  uuid: _source.uuid && _source.uuid[0],
5117
4952
  title: _source.title && _source.title[0],
@@ -5124,95 +4959,87 @@ function formatSections(data) {
5124
4959
  });
5125
4960
  }
5126
4961
  function formatSchedule(data) {
5127
- return data.map(function (item) {
5128
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
4962
+ return data.map((item) => {
5129
4963
  return {
5130
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5131
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
5132
- langcode: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.langcode) === null || _f === void 0 ? void 0 : _f[0],
5133
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
4964
+ uuid: item?._source?.uuid?.[0],
4965
+ created: item?._source?.created?.[0],
4966
+ langcode: item?._source?.langcode?.[0],
4967
+ updated: item?._source?.updated?.[0],
5134
4968
  days: [
5135
4969
  {
5136
- monday: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.monday_title) === null || _k === void 0 ? void 0 : _k.map(function (title, index) {
5137
- var _a, _b, _c, _d, _e, _f, _g, _h;
4970
+ monday: item?._source?.monday_title?.map((title, index) => {
5138
4971
  return {
5139
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.monday_end) === null || _b === void 0 ? void 0 : _b[index],
5140
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.monday_start) === null || _d === void 0 ? void 0 : _d[index],
4972
+ end: item?._source?.monday_end?.[index],
4973
+ start: item?._source?.monday_start?.[index],
5141
4974
  title: title,
5142
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.monday_video) === null || _f === void 0 ? void 0 : _f[index],
5143
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.monday_live) === null || _h === void 0 ? void 0 : _h[index],
4975
+ video: item?._source?.monday_video?.[index],
4976
+ live: item?._source?.monday_live?.[index],
5144
4977
  };
5145
4978
  }),
5146
4979
  },
5147
4980
  {
5148
- tuesday: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.tuesday_title) === null || _m === void 0 ? void 0 : _m.map(function (title, index) {
5149
- var _a, _b, _c, _d, _e, _f, _g, _h;
4981
+ tuesday: item?._source?.tuesday_title?.map((title, index) => {
5150
4982
  return {
5151
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.tuesday_end) === null || _b === void 0 ? void 0 : _b[index],
5152
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.tuesday_start) === null || _d === void 0 ? void 0 : _d[index],
4983
+ end: item?._source?.tuesday_end?.[index],
4984
+ start: item?._source?.tuesday_start?.[index],
5153
4985
  title: title,
5154
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.tuesday_video) === null || _f === void 0 ? void 0 : _f[index],
5155
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.tuesday_live) === null || _h === void 0 ? void 0 : _h[index],
4986
+ video: item?._source?.tuesday_video?.[index],
4987
+ live: item?._source?.tuesday_live?.[index],
5156
4988
  };
5157
4989
  }),
5158
4990
  },
5159
4991
  {
5160
- wednesday: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.wednesday_title) === null || _p === void 0 ? void 0 : _p.map(function (title, index) {
5161
- var _a, _b, _c, _d, _e, _f, _g, _h;
4992
+ wednesday: item?._source?.wednesday_title?.map((title, index) => {
5162
4993
  return {
5163
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.wednesday_end) === null || _b === void 0 ? void 0 : _b[index],
5164
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.wednesday_start) === null || _d === void 0 ? void 0 : _d[index],
4994
+ end: item?._source?.wednesday_end?.[index],
4995
+ start: item?._source?.wednesday_start?.[index],
5165
4996
  title: title,
5166
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.wednesday_video) === null || _f === void 0 ? void 0 : _f[index],
5167
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.wednesday_live) === null || _h === void 0 ? void 0 : _h[index],
4997
+ video: item?._source?.wednesday_video?.[index],
4998
+ live: item?._source?.wednesday_live?.[index],
5168
4999
  };
5169
5000
  }),
5170
5001
  },
5171
5002
  {
5172
- thursday: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.thursday_title) === null || _r === void 0 ? void 0 : _r.map(function (title, index) {
5173
- var _a, _b, _c, _d, _e, _f, _g, _h;
5003
+ thursday: item?._source?.thursday_title?.map((title, index) => {
5174
5004
  return {
5175
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.thursday_end) === null || _b === void 0 ? void 0 : _b[index],
5176
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.thursday_start) === null || _d === void 0 ? void 0 : _d[index],
5005
+ end: item?._source?.thursday_end?.[index],
5006
+ start: item?._source?.thursday_start?.[index],
5177
5007
  title: title,
5178
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.thursday_video) === null || _f === void 0 ? void 0 : _f[index],
5179
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.thursday_live) === null || _h === void 0 ? void 0 : _h[index],
5008
+ video: item?._source?.thursday_video?.[index],
5009
+ live: item?._source?.thursday_live?.[index],
5180
5010
  };
5181
5011
  }),
5182
5012
  },
5183
5013
  {
5184
- friday: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.friday_title) === null || _t === void 0 ? void 0 : _t.map(function (title, index) {
5185
- var _a, _b, _c, _d, _e, _f, _g, _h;
5014
+ friday: item?._source?.friday_title?.map((title, index) => {
5186
5015
  return {
5187
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.friday_end) === null || _b === void 0 ? void 0 : _b[index],
5188
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.friday_start) === null || _d === void 0 ? void 0 : _d[index],
5016
+ end: item?._source?.friday_end?.[index],
5017
+ start: item?._source?.friday_start?.[index],
5189
5018
  title: title,
5190
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.friday_video) === null || _f === void 0 ? void 0 : _f[index],
5191
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.friday_live) === null || _h === void 0 ? void 0 : _h[index],
5019
+ video: item?._source?.friday_video?.[index],
5020
+ live: item?._source?.friday_live?.[index],
5192
5021
  };
5193
5022
  }),
5194
5023
  },
5195
5024
  {
5196
- saturday: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.saturday_title) === null || _v === void 0 ? void 0 : _v.map(function (title, index) {
5197
- var _a, _b, _c, _d, _e, _f, _g, _h;
5025
+ saturday: item?._source?.saturday_title?.map((title, index) => {
5198
5026
  return {
5199
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.saturday_end) === null || _b === void 0 ? void 0 : _b[index],
5200
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.saturday_start) === null || _d === void 0 ? void 0 : _d[index],
5027
+ end: item?._source?.saturday_end?.[index],
5028
+ start: item?._source?.saturday_start?.[index],
5201
5029
  title: title,
5202
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.saturday_video) === null || _f === void 0 ? void 0 : _f[index],
5203
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.saturday_live) === null || _h === void 0 ? void 0 : _h[index],
5030
+ video: item?._source?.saturday_video?.[index],
5031
+ live: item?._source?.saturday_live?.[index],
5204
5032
  };
5205
5033
  }),
5206
5034
  },
5207
5035
  {
5208
- sunday: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.sunday_title) === null || _x === void 0 ? void 0 : _x.map(function (title, index) {
5209
- var _a, _b, _c, _d, _e, _f, _g, _h;
5036
+ sunday: item?._source?.sunday_title?.map((title, index) => {
5210
5037
  return {
5211
- end: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.sunday_end) === null || _b === void 0 ? void 0 : _b[index],
5212
- start: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.sunday_start) === null || _d === void 0 ? void 0 : _d[index],
5038
+ end: item?._source?.sunday_end?.[index],
5039
+ start: item?._source?.sunday_start?.[index],
5213
5040
  title: title,
5214
- video: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.sunday_video) === null || _f === void 0 ? void 0 : _f[index],
5215
- live: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.sunday_live) === null || _h === void 0 ? void 0 : _h[index],
5041
+ video: item?._source?.sunday_video?.[index],
5042
+ live: item?._source?.sunday_live?.[index],
5216
5043
  };
5217
5044
  }),
5218
5045
  },
@@ -5221,11 +5048,10 @@ function formatSchedule(data) {
5221
5048
  });
5222
5049
  }
5223
5050
  function formatChallenges(data) {
5224
- return data.map(function (item) {
5225
- var _a;
5226
- var _source = item._source;
5051
+ return data.map((item) => {
5052
+ const { _source } = item;
5227
5053
  return {
5228
- uuid: (_a = _source === null || _source === void 0 ? void 0 : _source.uuid) === null || _a === void 0 ? void 0 : _a[0],
5054
+ uuid: _source?.uuid?.[0],
5229
5055
  title: _source.title && _source.title[0],
5230
5056
  body: _source.body && _source.body[0],
5231
5057
  image: _source.image && _source.image[0],
@@ -5239,17 +5065,16 @@ function formatChallenges(data) {
5239
5065
  });
5240
5066
  }
5241
5067
  function formatChallengeDays(data) {
5242
- return data.map(function (item) {
5243
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
5068
+ return data.map((item) => {
5244
5069
  return {
5245
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5246
- title: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d[0],
5247
- body: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.body) === null || _f === void 0 ? void 0 : _f[0],
5248
- image: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.image) === null || _h === void 0 ? void 0 : _h[0],
5249
- created: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.created) === null || _k === void 0 ? void 0 : _k[0],
5250
- updated: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.updated) === null || _m === void 0 ? void 0 : _m[0],
5251
- video: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.video) === null || _p === void 0 ? void 0 : _p[0],
5252
- workout: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.workout) === null || _r === void 0 ? void 0 : _r[0],
5070
+ uuid: item?._source?.uuid?.[0],
5071
+ title: item?._source?.title?.[0],
5072
+ body: item?._source?.body?.[0],
5073
+ image: item?._source?.image?.[0],
5074
+ created: item?._source?.created?.[0],
5075
+ updated: item?._source?.updated?.[0],
5076
+ video: item?._source?.video?.[0],
5077
+ workout: item?._source?.workout?.[0],
5253
5078
  };
5254
5079
  });
5255
5080
  }
@@ -5257,360 +5082,328 @@ function formatSecondsToISO8601Duration(seconds) {
5257
5082
  if (!seconds)
5258
5083
  return '';
5259
5084
  // Calculate hours, minutes, and remaining seconds
5260
- var hours = Math.floor(seconds / 3600);
5261
- var minutes = Math.floor((seconds % 3600) / 60);
5262
- var remainingSeconds = seconds % 60;
5085
+ const hours = Math.floor(seconds / 3600);
5086
+ const minutes = Math.floor((seconds % 3600) / 60);
5087
+ const remainingSeconds = seconds % 60;
5263
5088
  // Build the ISO 8601 duration string
5264
- var duration = 'PT';
5089
+ let duration = 'PT';
5265
5090
  if (hours > 0) {
5266
- duration += "".concat(hours, "H");
5091
+ duration += `${hours}H`;
5267
5092
  }
5268
5093
  if (minutes > 0) {
5269
- duration += "".concat(minutes, "M");
5094
+ duration += `${minutes}M`;
5270
5095
  }
5271
5096
  if (remainingSeconds > 0 || duration === 'PT') {
5272
- duration += "".concat(remainingSeconds, "S");
5097
+ duration += `${remainingSeconds}S`;
5273
5098
  }
5274
5099
  return duration;
5275
5100
  }
5276
5101
  function formatAuthSession(session) {
5277
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
5278
5102
  return {
5279
- accessToken: (_a = session === null || session === void 0 ? void 0 : session.tokens) === null || _a === void 0 ? void 0 : _a.accessToken.toString(),
5280
- idToken: (_c = (_b = session === null || session === void 0 ? void 0 : session.tokens) === null || _b === void 0 ? void 0 : _b.idToken) === null || _c === void 0 ? void 0 : _c.toString(),
5103
+ accessToken: session?.tokens?.accessToken.toString(),
5104
+ idToken: session?.tokens?.idToken?.toString(),
5281
5105
  refreshToken: undefined,
5282
- accessTokenExpiry: (_f = (_e = (_d = session === null || session === void 0 ? void 0 : session.tokens) === null || _d === void 0 ? void 0 : _d.idToken) === null || _e === void 0 ? void 0 : _e.payload) === null || _f === void 0 ? void 0 : _f.exp,
5283
- expires: (_j = (_h = (_g = session === null || session === void 0 ? void 0 : session.tokens) === null || _g === void 0 ? void 0 : _g.idToken) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.exp,
5284
- sub: (_o = (_m = (_l = (_k = session === null || session === void 0 ? void 0 : session.tokens) === null || _k === void 0 ? void 0 : _k.idToken) === null || _l === void 0 ? void 0 : _l.payload) === null || _m === void 0 ? void 0 : _m['cognito:username']) === null || _o === void 0 ? void 0 : _o.toString(),
5106
+ accessTokenExpiry: session?.tokens?.idToken?.payload?.exp,
5107
+ expires: session?.tokens?.idToken?.payload?.exp,
5108
+ sub: session?.tokens?.idToken?.payload?.['cognito:username']?.toString(),
5285
5109
  details: {
5286
- userEmail: (_s = (_r = (_q = (_p = session === null || session === void 0 ? void 0 : session.tokens) === null || _p === void 0 ? void 0 : _p.idToken) === null || _q === void 0 ? void 0 : _q.payload) === null || _r === void 0 ? void 0 : _r.email) === null || _s === void 0 ? void 0 : _s.toString(),
5287
- firstName: (_w = (_v = (_u = (_t = session === null || session === void 0 ? void 0 : session.tokens) === null || _t === void 0 ? void 0 : _t.idToken) === null || _u === void 0 ? void 0 : _u.payload) === null || _v === void 0 ? void 0 : _v.given_name) === null || _w === void 0 ? void 0 : _w.toString(),
5288
- lastName: (_0 = (_z = (_y = (_x = session === null || session === void 0 ? void 0 : session.tokens) === null || _x === void 0 ? void 0 : _x.idToken) === null || _y === void 0 ? void 0 : _y.payload) === null || _z === void 0 ? void 0 : _z.family_name) === null || _0 === void 0 ? void 0 : _0.toString(),
5289
- dateOfBirth: (_4 = (_3 = (_2 = (_1 = session === null || session === void 0 ? void 0 : session.tokens) === null || _1 === void 0 ? void 0 : _1.idToken) === null || _2 === void 0 ? void 0 : _2.payload) === null || _3 === void 0 ? void 0 : _3.birthdate) === null || _4 === void 0 ? void 0 : _4.toString(),
5290
- 'cognito:username': (_8 = (_7 = (_6 = (_5 = session === null || session === void 0 ? void 0 : session.tokens) === null || _5 === void 0 ? void 0 : _5.idToken) === null || _6 === void 0 ? void 0 : _6.payload) === null || _7 === void 0 ? void 0 : _7['cognito:username']) === null || _8 === void 0 ? void 0 : _8.toString(),
5291
- 'custom:termsAccepted': (_12 = (_11 = (_10 = (_9 = session === null || session === void 0 ? void 0 : session.tokens) === null || _9 === void 0 ? void 0 : _9.idToken) === null || _10 === void 0 ? void 0 : _10.payload) === null || _11 === void 0 ? void 0 : _11['custom:termsAccepted']) === null || _12 === void 0 ? void 0 : _12.toString(),
5292
- 'custom:subscriptionId': (_16 = (_15 = (_14 = (_13 = session === null || session === void 0 ? void 0 : session.tokens) === null || _13 === void 0 ? void 0 : _13.idToken) === null || _14 === void 0 ? void 0 : _14.payload) === null || _15 === void 0 ? void 0 : _15['custom:subscriptionId']) === null || _16 === void 0 ? void 0 : _16.toString(),
5293
- 'custom:contactPreferences': (_20 = (_19 = (_18 = (_17 = session === null || session === void 0 ? void 0 : session.tokens) === null || _17 === void 0 ? void 0 : _17.idToken) === null || _18 === void 0 ? void 0 : _18.payload) === null || _19 === void 0 ? void 0 : _19['custom:contactPreferences']) === null || _20 === void 0 ? void 0 : _20.toString(),
5294
- 'custom:customerId': (_24 = (_23 = (_22 = (_21 = session === null || session === void 0 ? void 0 : session.tokens) === null || _21 === void 0 ? void 0 : _21.idToken) === null || _22 === void 0 ? void 0 : _22.payload) === null || _23 === void 0 ? void 0 : _23['custom:customerId']) === null || _24 === void 0 ? void 0 : _24.toString(),
5295
- picture: (_28 = (_27 = (_26 = (_25 = session === null || session === void 0 ? void 0 : session.tokens) === null || _25 === void 0 ? void 0 : _25.idToken) === null || _26 === void 0 ? void 0 : _26.payload) === null || _27 === void 0 ? void 0 : _27.picture) === null || _28 === void 0 ? void 0 : _28.toString(),
5110
+ userEmail: session?.tokens?.idToken?.payload?.email?.toString(),
5111
+ firstName: session?.tokens?.idToken?.payload?.given_name?.toString(),
5112
+ lastName: session?.tokens?.idToken?.payload?.family_name?.toString(),
5113
+ dateOfBirth: session?.tokens?.idToken?.payload?.birthdate?.toString(),
5114
+ 'cognito:username': session?.tokens?.idToken?.payload?.['cognito:username']?.toString(),
5115
+ 'custom:termsAccepted': session?.tokens?.idToken?.payload?.['custom:termsAccepted']?.toString(),
5116
+ 'custom:subscriptionId': session?.tokens?.idToken?.payload?.['custom:subscriptionId']?.toString(),
5117
+ 'custom:contactPreferences': session?.tokens?.idToken?.payload?.['custom:contactPreferences']?.toString(),
5118
+ 'custom:customerId': session?.tokens?.idToken?.payload?.['custom:customerId']?.toString(),
5119
+ picture: session?.tokens?.idToken?.payload?.picture?.toString(),
5296
5120
  },
5297
5121
  };
5298
5122
  }
5299
5123
  function formatFedaratedSession(session) {
5300
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
5301
5124
  return {
5302
- accessToken: (_a = session === null || session === void 0 ? void 0 : session.accessToken) === null || _a === void 0 ? void 0 : _a.jwtToken,
5303
- idToken: (_b = session === null || session === void 0 ? void 0 : session.idToken) === null || _b === void 0 ? void 0 : _b.jwtToken,
5304
- refreshToken: (_c = session === null || session === void 0 ? void 0 : session.refreshToken) === null || _c === void 0 ? void 0 : _c.token,
5305
- accessTokenExpiry: (_e = (_d = session === null || session === void 0 ? void 0 : session.accessToken) === null || _d === void 0 ? void 0 : _d.payload) === null || _e === void 0 ? void 0 : _e.exp,
5306
- expires: (_g = (_f = session === null || session === void 0 ? void 0 : session.accessToken) === null || _f === void 0 ? void 0 : _f.payload) === null || _g === void 0 ? void 0 : _g.exp,
5307
- sub: (_j = (_h = session === null || session === void 0 ? void 0 : session.idToken) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.sub,
5125
+ accessToken: session?.accessToken?.jwtToken,
5126
+ idToken: session?.idToken?.jwtToken,
5127
+ refreshToken: session?.refreshToken?.token,
5128
+ accessTokenExpiry: session?.accessToken?.payload?.exp,
5129
+ expires: session?.accessToken?.payload?.exp,
5130
+ sub: session?.idToken?.payload?.sub,
5308
5131
  details: {
5309
- userEmail: (_l = (_k = session === null || session === void 0 ? void 0 : session.idToken) === null || _k === void 0 ? void 0 : _k.payload) === null || _l === void 0 ? void 0 : _l.email,
5310
- firstName: (_o = (_m = session === null || session === void 0 ? void 0 : session.idToken) === null || _m === void 0 ? void 0 : _m.payload) === null || _o === void 0 ? void 0 : _o.given_name,
5311
- lastName: (_q = (_p = session === null || session === void 0 ? void 0 : session.idToken) === null || _p === void 0 ? void 0 : _p.payload) === null || _q === void 0 ? void 0 : _q.family_name,
5312
- dateOfBirth: (_s = (_r = session === null || session === void 0 ? void 0 : session.idToken) === null || _r === void 0 ? void 0 : _r.payload) === null || _s === void 0 ? void 0 : _s.birthdate,
5313
- 'cognito:username': (_u = (_t = session === null || session === void 0 ? void 0 : session.idToken) === null || _t === void 0 ? void 0 : _t.payload) === null || _u === void 0 ? void 0 : _u.sub,
5314
- 'custom:termsAccepted': (_w = (_v = session === null || session === void 0 ? void 0 : session.idToken) === null || _v === void 0 ? void 0 : _v.payload) === null || _w === void 0 ? void 0 : _w['custom:termsAccepted'],
5315
- 'custom:subscriptionId': (_y = (_x = session === null || session === void 0 ? void 0 : session.idToken) === null || _x === void 0 ? void 0 : _x.payload) === null || _y === void 0 ? void 0 : _y['custom:subscriptionId'],
5316
- 'custom:contactPreferences': (_0 = (_z = session === null || session === void 0 ? void 0 : session.idToken) === null || _z === void 0 ? void 0 : _z.payload) === null || _0 === void 0 ? void 0 : _0['custom:contactPreferences'],
5317
- 'custom:customerId': (_2 = (_1 = session === null || session === void 0 ? void 0 : session.idToken) === null || _1 === void 0 ? void 0 : _1.payload) === null || _2 === void 0 ? void 0 : _2['custom:customerId'],
5318
- picture: (_4 = (_3 = session === null || session === void 0 ? void 0 : session.idToken) === null || _3 === void 0 ? void 0 : _3.payload) === null || _4 === void 0 ? void 0 : _4.picture,
5319
- id: toCamelCaseObject((_5 = session === null || session === void 0 ? void 0 : session.idToken) === null || _5 === void 0 ? void 0 : _5.payload),
5132
+ userEmail: session?.idToken?.payload?.email,
5133
+ firstName: session?.idToken?.payload?.given_name,
5134
+ lastName: session?.idToken?.payload?.family_name,
5135
+ dateOfBirth: session?.idToken?.payload?.birthdate,
5136
+ 'cognito:username': session?.idToken?.payload?.sub,
5137
+ 'custom:termsAccepted': session?.idToken?.payload?.['custom:termsAccepted'],
5138
+ 'custom:subscriptionId': session?.idToken?.payload?.['custom:subscriptionId'],
5139
+ 'custom:contactPreferences': session?.idToken?.payload?.['custom:contactPreferences'],
5140
+ 'custom:customerId': session?.idToken?.payload?.['custom:customerId'],
5141
+ picture: session?.idToken?.payload?.picture,
5142
+ id: toCamelCaseObject(session?.idToken?.payload),
5320
5143
  },
5321
5144
  };
5322
5145
  }
5323
5146
  function formatSocialAuthSession(tokens) {
5324
- var idToken = jwtDecode.jwtDecode(tokens.idToken);
5147
+ const idToken = jwtDecode.jwtDecode(tokens.idToken);
5325
5148
  return {
5326
5149
  socialSignin: true,
5327
5150
  accessToken: tokens.accessToken,
5328
5151
  idToken: tokens.idToken,
5329
5152
  refreshToken: tokens.refreshToken,
5330
- accessTokenExpiry: idToken === null || idToken === void 0 ? void 0 : idToken.exp,
5331
- expires: idToken === null || idToken === void 0 ? void 0 : idToken.exp,
5153
+ accessTokenExpiry: idToken?.exp,
5154
+ expires: idToken?.exp,
5332
5155
  sub: idToken.sub,
5333
5156
  details: {
5334
5157
  userEmail: idToken.email,
5335
5158
  firstName: idToken.given_name,
5336
5159
  lastName: idToken.family_name,
5337
- dateOfBirth: idToken === null || idToken === void 0 ? void 0 : idToken.birthdate,
5338
- 'cognito:username': idToken === null || idToken === void 0 ? void 0 : idToken['cognito:username'],
5339
- 'custom:termsAccepted': idToken === null || idToken === void 0 ? void 0 : idToken['custom:termsAccepted'],
5340
- 'custom:subscriptionId': idToken === null || idToken === void 0 ? void 0 : idToken['custom:subscriptionId'],
5341
- 'custom:contactPreferences': idToken === null || idToken === void 0 ? void 0 : idToken['custom:contactPreferences'],
5342
- 'custom:customerId': idToken === null || idToken === void 0 ? void 0 : idToken['custom:customerId'],
5343
- picture: idToken === null || idToken === void 0 ? void 0 : idToken.picture,
5160
+ dateOfBirth: idToken?.birthdate,
5161
+ 'cognito:username': idToken?.['cognito:username'],
5162
+ 'custom:termsAccepted': idToken?.['custom:termsAccepted'],
5163
+ 'custom:subscriptionId': idToken?.['custom:subscriptionId'],
5164
+ 'custom:contactPreferences': idToken?.['custom:contactPreferences'],
5165
+ 'custom:customerId': idToken?.['custom:customerId'],
5166
+ picture: idToken?.picture,
5344
5167
  },
5345
5168
  };
5346
5169
  }
5347
5170
  function formatConfig(data) {
5348
- return data.map(function (item) {
5349
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
5171
+ return data.map((item) => {
5350
5172
  return {
5351
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5352
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5353
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5354
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5355
- type: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.type) === null || _k === void 0 ? void 0 : _k[0],
5356
- cla: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.cla) === null || _m === void 0 ? void 0 : _m[0],
5357
- enabled: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.enabled) === null || _p === void 0 ? void 0 : _p[0],
5358
- name: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.name) === null || _r === void 0 ? void 0 : _r[0],
5359
- price: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.price) === null || _t === void 0 ? void 0 : _t[0],
5360
- video: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.video) === null || _v === void 0 ? void 0 : _v[0],
5361
- imageHomepage: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.image_homepage) === null || _x === void 0 ? void 0 : _x[0],
5362
- imageSectionBanner: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.image_section_banner) === null || _z === void 0 ? void 0 : _z[0],
5173
+ uuid: item?._source?.uuid?.[0],
5174
+ id: item?._source?.uuid?.[0],
5175
+ created: item?._source?.created?.[0],
5176
+ updated: item?._source?.updated?.[0],
5177
+ type: item?._source?.type?.[0],
5178
+ cla: item?._source?.cla?.[0],
5179
+ enabled: item?._source?.enabled?.[0],
5180
+ name: item?._source?.name?.[0],
5181
+ price: item?._source?.price?.[0],
5182
+ video: item?._source?.video?.[0],
5183
+ imageHomepage: item?._source?.image_homepage?.[0],
5184
+ imageSectionBanner: item?._source?.image_section_banner?.[0],
5363
5185
  };
5364
5186
  });
5365
5187
  }
5366
5188
  function formatSectionPanels(data) {
5367
- return data.map(function (item) {
5368
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
5189
+ return data.map((item) => {
5369
5190
  return {
5370
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5371
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5372
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5373
- created: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.created) === null || _h === void 0 ? void 0 : _h[0],
5374
- updated: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.updated) === null || _k === void 0 ? void 0 : _k[0],
5375
- weight: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.weight) === null || _m === void 0 ? void 0 : _m[0],
5376
- items: (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.item_uuid,
5377
- type: (_q = (_p = item === null || item === void 0 ? void 0 : item._source) === null || _p === void 0 ? void 0 : _p.type) === null || _q === void 0 ? void 0 : _q[0],
5191
+ uuid: item?._source?.uuid?.[0],
5192
+ id: item?._source?.uuid?.[0],
5193
+ title: item?._source?.title?.[0],
5194
+ created: item?._source?.created?.[0],
5195
+ updated: item?._source?.updated?.[0],
5196
+ weight: item?._source?.weight?.[0],
5197
+ items: item?._source?.item_uuid,
5198
+ type: item?._source?.type?.[0],
5378
5199
  };
5379
5200
  });
5380
5201
  }
5381
5202
  function formatSectionItems(data) {
5382
- return data.map(function (item) {
5383
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
5203
+ return data.map((item) => {
5384
5204
  return {
5385
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5386
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5387
- title: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f[0],
5388
- created: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.created) === null || _h === void 0 ? void 0 : _h[0],
5389
- updated: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.updated) === null || _k === void 0 ? void 0 : _k[0],
5390
- type: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.type) === null || _m === void 0 ? void 0 : _m[0],
5391
- term: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.term) === null || _p === void 0 ? void 0 : _p[0],
5392
- image: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.custom_image_formatted) === null || _r === void 0 ? void 0 : _r[0],
5393
- bannerImage: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.banner_image_formatted) === null || _t === void 0 ? void 0 : _t[0],
5205
+ uuid: item?._source?.uuid?.[0],
5206
+ id: item?._source?.uuid?.[0],
5207
+ title: item?._source?.title?.[0],
5208
+ created: item?._source?.created?.[0],
5209
+ updated: item?._source?.updated?.[0],
5210
+ type: item?._source?.type?.[0],
5211
+ term: item?._source?.term?.[0],
5212
+ image: item?._source?.custom_image_formatted?.[0],
5213
+ bannerImage: item?._source?.banner_image_formatted?.[0],
5394
5214
  };
5395
5215
  });
5396
5216
  }
5397
- var formatTaxonomies = function (data) {
5398
- return data.map(function (item) {
5399
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
5217
+ const formatTaxonomies = (data) => {
5218
+ return data.map((item) => {
5400
5219
  return {
5401
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5402
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5403
- updated: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.updated) === null || _f === void 0 ? void 0 : _f[0],
5404
- vocabulary: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.vocabulary) === null || _h === void 0 ? void 0 : _h[0],
5405
- name: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.name) === null || _k === void 0 ? void 0 : _k[0],
5406
- description: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.description) === null || _m === void 0 ? void 0 : _m[0],
5407
- image: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image) === null || _p === void 0 ? void 0 : _p[0],
5408
- imageBanner: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_banner) === null || _r === void 0 ? void 0 : _r[0],
5409
- imageBannerTaxonomy: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.image_banner_taxonomy) === null || _t === void 0 ? void 0 : _t[0],
5410
- imageLarge: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.image_large_16_9) === null || _v === void 0 ? void 0 : _v[0],
5411
- weight: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.weight) === null || _x === void 0 ? void 0 : _x[0],
5412
- parentName: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.parent_name) === null || _z === void 0 ? void 0 : _z[0],
5413
- color: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.color) === null || _1 === void 0 ? void 0 : _1[0],
5220
+ uuid: item?._source?.uuid?.[0],
5221
+ id: item?._source?.uuid?.[0],
5222
+ updated: item?._source?.updated?.[0],
5223
+ vocabulary: item?._source?.vocabulary?.[0],
5224
+ name: item?._source?.name?.[0],
5225
+ description: item?._source?.description?.[0],
5226
+ image: item?._source?.image?.[0],
5227
+ imageBanner: item?._source?.image_banner?.[0],
5228
+ imageBannerTaxonomy: item?._source?.image_banner_taxonomy?.[0],
5229
+ imageLarge: item?._source?.image_large_16_9?.[0],
5230
+ weight: item?._source?.weight?.[0],
5231
+ parentName: item?._source?.parent_name?.[0],
5232
+ color: item?._source?.color?.[0],
5414
5233
  };
5415
5234
  });
5416
5235
  };
5417
- var formatSeries = function (data) {
5418
- return data.map(function (item) {
5419
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5236
+ const formatSeries = (data) => {
5237
+ return data.map((item) => {
5420
5238
  return {
5421
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5422
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5423
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5424
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5425
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5426
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5427
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5428
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5429
- category: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.category) === null || _t === void 0 ? void 0 : _t[0],
5430
- categoryId: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.category_id) === null || _v === void 0 ? void 0 : _v[0],
5431
- seasons: ((_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.seasons) || [],
5239
+ uuid: item?._source?.uuid?.[0],
5240
+ id: item?._source?.uuid?.[0],
5241
+ created: item?._source?.created?.[0],
5242
+ updated: item?._source?.updated?.[0],
5243
+ title: item?._source?.display_title?.[0],
5244
+ synopsis: item?._source?.synopsis?.[0],
5245
+ imagePoster: item?._source?.image_style_poster?.[0],
5246
+ imageThumb: item?._source?.image_style_thumb?.[0],
5247
+ category: item?._source?.category?.[0],
5248
+ categoryId: item?._source?.category_id?.[0],
5249
+ seasons: item?._source?.seasons || [],
5432
5250
  };
5433
5251
  });
5434
5252
  };
5435
- var formatSeasons = function (data) {
5436
- return data.map(function (item) {
5437
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5253
+ const formatSeasons = (data) => {
5254
+ return data.map((item) => {
5438
5255
  return {
5439
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5440
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5441
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5442
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5443
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5444
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5445
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5446
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5447
- episodes: ((_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.episodes) || [],
5448
- seasonNumber: (_u = (_t = item === null || item === void 0 ? void 0 : item._source) === null || _t === void 0 ? void 0 : _t.season_number) === null || _u === void 0 ? void 0 : _u[0],
5449
- showId: (_w = (_v = item === null || item === void 0 ? void 0 : item._source) === null || _v === void 0 ? void 0 : _v.show) === null || _w === void 0 ? void 0 : _w[0],
5256
+ uuid: item?._source?.uuid?.[0],
5257
+ id: item?._source?.uuid?.[0],
5258
+ created: item?._source?.created?.[0],
5259
+ updated: item?._source?.updated?.[0],
5260
+ title: item?._source?.display_title?.[0],
5261
+ synopsis: item?._source?.synopsis?.[0],
5262
+ imagePoster: item?._source?.image_style_poster?.[0],
5263
+ imageThumb: item?._source?.image_style_thumb?.[0],
5264
+ episodes: item?._source?.episodes || [],
5265
+ seasonNumber: item?._source?.season_number?.[0],
5266
+ showId: item?._source?.show?.[0],
5450
5267
  };
5451
5268
  });
5452
5269
  };
5453
- var formatLongform = function (data) {
5454
- return data.map(function (item) {
5455
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
5270
+ const formatLongform = (data) => {
5271
+ return data.map((item) => {
5456
5272
  return {
5457
- uuid: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.uuid) === null || _b === void 0 ? void 0 : _b[0],
5458
- id: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.uuid) === null || _d === void 0 ? void 0 : _d[0],
5459
- created: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.created) === null || _f === void 0 ? void 0 : _f[0],
5460
- updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
5461
- title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
5462
- synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
5463
- imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
5464
- imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
5465
- duration: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.duration) === null || _t === void 0 ? void 0 : _t[0],
5466
- releaseDate: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.release_date) === null || _v === void 0 ? void 0 : _v[0],
5467
- video: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video) === null || _x === void 0 ? void 0 : _x[0],
5468
- imageUrl: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.image_url) === null || _z === void 0 ? void 0 : _z[0],
5469
- episodeNumber: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.episode_number) === null || _1 === void 0 ? void 0 : _1[0],
5273
+ uuid: item?._source?.uuid?.[0],
5274
+ id: item?._source?.uuid?.[0],
5275
+ created: item?._source?.created?.[0],
5276
+ updated: item?._source?.updated?.[0],
5277
+ title: item?._source?.display_title?.[0],
5278
+ synopsis: item?._source?.synopsis?.[0],
5279
+ imagePoster: item?._source?.image_style_poster?.[0],
5280
+ imageThumb: item?._source?.image_style_thumb?.[0],
5281
+ duration: item?._source?.duration?.[0],
5282
+ releaseDate: item?._source?.release_date?.[0],
5283
+ video: item?._source?.video?.[0],
5284
+ imageUrl: item?._source?.image_url?.[0],
5285
+ episodeNumber: item?._source?.episode_number?.[0],
5470
5286
  };
5471
5287
  });
5472
5288
  };
5473
- var formatMediaItem = function (data) {
5474
- return data.map(function (item) {
5475
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
5289
+ const formatMediaItem = (data) => {
5290
+ return data.map((item) => {
5476
5291
  return {
5477
- changed: (_b = (_a = item === null || item === void 0 ? void 0 : item._source) === null || _a === void 0 ? void 0 : _a.changed) === null || _b === void 0 ? void 0 : _b[0],
5478
- created: (_d = (_c = item === null || item === void 0 ? void 0 : item._source) === null || _c === void 0 ? void 0 : _c.created) === null || _d === void 0 ? void 0 : _d[0],
5479
- image: (_f = (_e = item === null || item === void 0 ? void 0 : item._source) === null || _e === void 0 ? void 0 : _e.image) === null || _f === void 0 ? void 0 : _f[0],
5480
- customThumbnail: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.custom_thumbnail) === null || _h === void 0 ? void 0 : _h[0],
5481
- price: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.price) === null || _k === void 0 ? void 0 : _k[0],
5482
- priceTwoYear: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.price_2_year) === null || _m === void 0 ? void 0 : _m[0],
5483
- revisionTimestamp: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.revision_timestamp) === null || _p === void 0 ? void 0 : _p[0],
5484
- sku: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.sku) === null || _r === void 0 ? void 0 : _r[0],
5485
- status: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.status) === null || _t === void 0 ? void 0 : _t[0],
5486
- uuid: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.uuid) === null || _v === void 0 ? void 0 : _v[0],
5487
- description: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.description) === null || _x === void 0 ? void 0 : _x[0],
5488
- transcript: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.transcript) === null || _z === void 0 ? void 0 : _z[0],
5489
- entities: (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.entities,
5490
- phrases: (_1 = item === null || item === void 0 ? void 0 : item._source) === null || _1 === void 0 ? void 0 : _1.phrases,
5491
- video: (_3 = (_2 = item === null || item === void 0 ? void 0 : item._source) === null || _2 === void 0 ? void 0 : _2.video) === null || _3 === void 0 ? void 0 : _3[0],
5492
- title: (_5 = (_4 = item === null || item === void 0 ? void 0 : item._source) === null || _4 === void 0 ? void 0 : _4.title) === null || _5 === void 0 ? void 0 : _5[0],
5493
- generatedTitle: (_7 = (_6 = item === null || item === void 0 ? void 0 : item._source) === null || _6 === void 0 ? void 0 : _6.generated_title) === null || _7 === void 0 ? void 0 : _7[0],
5494
- projectPricing: (_9 = (_8 = item === null || item === void 0 ? void 0 : item._source) === null || _8 === void 0 ? void 0 : _8.project_pricing) === null || _9 === void 0 ? void 0 : _9[0],
5495
- related_items: (_10 = item === null || item === void 0 ? void 0 : item._source) === null || _10 === void 0 ? void 0 : _10.related_uuids,
5496
- franchises: (_11 = item === null || item === void 0 ? void 0 : item._source) === null || _11 === void 0 ? void 0 : _11.franchise_name,
5497
- franchisesIds: (_12 = item === null || item === void 0 ? void 0 : item._source) === null || _12 === void 0 ? void 0 : _12.franchise_tid,
5498
- original: (_14 = (_13 = item === null || item === void 0 ? void 0 : item._source) === null || _13 === void 0 ? void 0 : _13.original) === null || _14 === void 0 ? void 0 : _14[0],
5499
- script: (_16 = (_15 = item === null || item === void 0 ? void 0 : item._source) === null || _15 === void 0 ? void 0 : _15.script) === null || _16 === void 0 ? void 0 : _16[0],
5500
- hideThumbnailTitle: (_18 = (_17 = item === null || item === void 0 ? void 0 : item._source) === null || _17 === void 0 ? void 0 : _17.hide_thumbnail_title) === null || _18 === void 0 ? void 0 : _18[0],
5292
+ changed: item?._source?.changed?.[0],
5293
+ created: item?._source?.created?.[0],
5294
+ image: item?._source?.image?.[0],
5295
+ customThumbnail: item?._source?.custom_thumbnail?.[0],
5296
+ price: item?._source?.price?.[0],
5297
+ priceTwoYear: item?._source?.price_2_year?.[0],
5298
+ revisionTimestamp: item?._source?.revision_timestamp?.[0],
5299
+ sku: item?._source?.sku?.[0],
5300
+ status: item?._source?.status?.[0],
5301
+ uuid: item?._source?.uuid?.[0],
5302
+ description: item?._source?.description?.[0],
5303
+ transcript: item?._source?.transcript?.[0],
5304
+ entities: item?._source?.entities,
5305
+ phrases: item?._source?.phrases,
5306
+ video: item?._source?.video?.[0],
5307
+ title: item?._source?.title?.[0],
5308
+ generatedTitle: item?._source?.generated_title?.[0],
5309
+ projectPricing: item?._source?.project_pricing?.[0],
5310
+ related_items: item?._source?.related_uuids,
5311
+ franchises: item?._source?.franchise_name,
5312
+ franchisesIds: item?._source?.franchise_tid,
5313
+ original: item?._source?.original?.[0],
5314
+ script: item?._source?.script?.[0],
5315
+ hideThumbnailTitle: item?._source?.hide_thumbnail_title?.[0],
5501
5316
  };
5502
5317
  });
5503
5318
  };
5504
5319
 
5505
- var _a$1, _b$1, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
5506
5320
  // Render the store based on the environment.
5507
- var isWeb = process.env.NEXT_PUBLIC_WEB_APP;
5508
- var ENV = isWeb ? process.env : Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.default; }).catch(function () { return ({}); });
5321
+ const isWeb = process.env.NEXT_PUBLIC_WEB_APP;
5322
+ const ENV = isWeb ? process.env : Promise.resolve().then(function () { return require('./index-CfrYa4U_.js'); }).then((mod) => mod.default).catch(() => ({}));
5509
5323
  // export const ENV = process.env;
5510
- ((_a$1 = process.env) === null || _a$1 === void 0 ? void 0 : _a$1.NEXT_PUBLIC_API_PREFIX) || ENV.API_PREFIX;
5324
+ process.env?.NEXT_PUBLIC_API_PREFIX || ENV.API_PREFIX;
5511
5325
  // Auth specific API
5512
- var API_AUTH_PREFIX = ((_b$1 = process.env) === null || _b$1 === void 0 ? void 0 : _b$1.NEXT_PUBLIC_API_AUTH_PREFIX) || ENV.API_AUTH_PREFIX;
5326
+ const API_AUTH_PREFIX = process.env?.NEXT_PUBLIC_API_AUTH_PREFIX || ENV.API_AUTH_PREFIX;
5513
5327
  // Payments specific API
5514
- var API_PAYMENTS_PREFIX = ((_c = process.env) === null || _c === void 0 ? void 0 : _c.NEXT_PUBLIC_API_PAYMENTS_PREFIX) || ENV.API_PAYMENTS_PREFIX;
5328
+ const API_PAYMENTS_PREFIX = process.env?.NEXT_PUBLIC_API_PAYMENTS_PREFIX || ENV.API_PAYMENTS_PREFIX;
5515
5329
  // Orders specific API
5516
- var API_ORDERS_PREFIX = ((_d = process.env) === null || _d === void 0 ? void 0 : _d.NEXT_PUBLIC_API_ORDERS_PREFIX) || ENV.API_ORDERS_PREFIX;
5517
- ((_e = process.env) === null || _e === void 0 ? void 0 : _e.NEXT_PUBLIC_APP_BASE_URL) || ENV.APP_BASE_URL;
5518
- var APP_ES_INSTANCE = ((_f = process.env) === null || _f === void 0 ? void 0 : _f.NEXT_PUBLIC_APP_ES_INSTANCE) || ENV.APP_ES_INSTANCE;
5519
- var APP_ES_AUTH = ((_g = process.env) === null || _g === void 0 ? void 0 : _g.NEXT_PUBLIC_APP_ES_AUTH) || ENV.APP_ES_AUTH;
5520
- ((_h = process.env) === null || _h === void 0 ? void 0 : _h.NEXT_PUBLIC_APP_ES_PROMO_PANEL_INDEX) ||
5330
+ const API_ORDERS_PREFIX = process.env?.NEXT_PUBLIC_API_ORDERS_PREFIX || ENV.API_ORDERS_PREFIX;
5331
+ process.env?.NEXT_PUBLIC_APP_BASE_URL || ENV.APP_BASE_URL;
5332
+ const APP_ES_INSTANCE = process.env?.NEXT_PUBLIC_APP_ES_INSTANCE || ENV.APP_ES_INSTANCE;
5333
+ const APP_ES_AUTH = process.env?.NEXT_PUBLIC_APP_ES_AUTH || ENV.APP_ES_AUTH;
5334
+ process.env?.NEXT_PUBLIC_APP_ES_PROMO_PANEL_INDEX ||
5521
5335
  ENV.APP_ES_PROMO_PANEL_INDEX;
5522
- ((_j = process.env) === null || _j === void 0 ? void 0 : _j.NEXT_PUBLIC_APP_ES_FAQ_INDEX) || ENV.APP_ES_FAQ_INDEX;
5523
- ((_k = process.env) === null || _k === void 0 ? void 0 : _k.NEXT_PUBLIC_APP_ES_PAGES_INDEX) || ENV.APP_ES_PAGES_INDEX;
5524
- ((_l = process.env) === null || _l === void 0 ? void 0 : _l.NEXT_PUBLIC_APP_ES_SETTINGS_INDEX) || ENV.APP_ES_SETTINGS_INDEX;
5525
- ((_m = process.env) === null || _m === void 0 ? void 0 : _m.NEXT_PUBLIC_APP_ES_PRESS_INDEX) || ENV.APP_ES_PRESS_INDEX;
5526
- ((_o = process.env) === null || _o === void 0 ? void 0 : _o.NEXT_PUBLIC_APP_ES_GUESTS_INDEX) || ENV.APP_ES_GUESTS_INDEX;
5527
- ((_p = process.env) === null || _p === void 0 ? void 0 : _p.NEXT_PUBLIC_APP_ES_VIDEOS_INDEX) || ENV.APP_ES_VIDEOS_INDEX;
5528
- ((_q = process.env) === null || _q === void 0 ? void 0 : _q.NEXT_PUBLIC_APP_ES_SECTIONS_INDEX) || ENV.APP_ES_SECTIONS_INDEX;
5529
- ((_r = process.env) === null || _r === void 0 ? void 0 : _r.NEXT_PUBLIC_APP_ES_WORKOUTS_INDEX) || ENV.APP_ES_WORKOUTS_INDEX;
5530
- ((_s = process.env) === null || _s === void 0 ? void 0 : _s.NEXT_PUBLIC_APP_ES_SCHEDULE_INDEX) || ENV.APP_ES_SCHEDULE_INDEX;
5531
- ((_t = process.env) === null || _t === void 0 ? void 0 : _t.NEXT_PUBLIC_APP_ES_CHALLENGES_INDEX) ||
5336
+ process.env?.NEXT_PUBLIC_APP_ES_FAQ_INDEX || ENV.APP_ES_FAQ_INDEX;
5337
+ process.env?.NEXT_PUBLIC_APP_ES_PAGES_INDEX || ENV.APP_ES_PAGES_INDEX;
5338
+ process.env?.NEXT_PUBLIC_APP_ES_SETTINGS_INDEX || ENV.APP_ES_SETTINGS_INDEX;
5339
+ process.env?.NEXT_PUBLIC_APP_ES_PRESS_INDEX || ENV.APP_ES_PRESS_INDEX;
5340
+ process.env?.NEXT_PUBLIC_APP_ES_GUESTS_INDEX || ENV.APP_ES_GUESTS_INDEX;
5341
+ process.env?.NEXT_PUBLIC_APP_ES_VIDEOS_INDEX || ENV.APP_ES_VIDEOS_INDEX;
5342
+ process.env?.NEXT_PUBLIC_APP_ES_SECTIONS_INDEX || ENV.APP_ES_SECTIONS_INDEX;
5343
+ process.env?.NEXT_PUBLIC_APP_ES_WORKOUTS_INDEX || ENV.APP_ES_WORKOUTS_INDEX;
5344
+ process.env?.NEXT_PUBLIC_APP_ES_SCHEDULE_INDEX || ENV.APP_ES_SCHEDULE_INDEX;
5345
+ process.env?.NEXT_PUBLIC_APP_ES_CHALLENGES_INDEX ||
5532
5346
  ENV.APP_ES_CHALLENGES_INDEX;
5533
- ((_u = process.env) === null || _u === void 0 ? void 0 : _u.NEXT_PUBLIC_APP_ES_CHALLENGE_DAYS_INDEX) ||
5347
+ process.env?.NEXT_PUBLIC_APP_ES_CHALLENGE_DAYS_INDEX ||
5534
5348
  ENV.APP_ES_CHALLENGE_DAYS_INDEX;
5535
5349
 
5536
- var authDataBaseQuery = fetchBaseQuery({
5350
+ const authDataBaseQuery = fetchBaseQuery({
5537
5351
  baseUrl: API_AUTH_PREFIX,
5538
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5539
- var session, idToken, accessToken, error_1;
5540
- return __generator(this, function (_c) {
5541
- switch (_c.label) {
5542
- case 0:
5543
- headers.set('Content-Type', 'application/json');
5544
- _c.label = 1;
5545
- case 1:
5546
- _c.trys.push([1, 3, , 4]);
5547
- return [4 /*yield*/, awsAmplify.Auth.currentSession()];
5548
- case 2:
5549
- session = _c.sent();
5550
- idToken = session.getIdToken().getJwtToken();
5551
- accessToken = session.getAccessToken().getJwtToken();
5552
- if (accessToken && idToken) {
5553
- headers.set('accesstoken', accessToken);
5554
- headers.set('idtoken', idToken);
5555
- // headers.set('refreshtoken', tokens.refreshToken);
5556
- }
5557
- return [2 /*return*/, headers];
5558
- case 3:
5559
- error_1 = _c.sent();
5560
- console.error('authDataBaseQuery: ', error_1);
5561
- return [2 /*return*/, headers];
5562
- case 4: return [2 /*return*/];
5352
+ prepareHeaders: async (headers, {}) => {
5353
+ headers.set('Content-Type', 'application/json');
5354
+ try {
5355
+ // add accessToken to headers from slice using selectAccessToken selector
5356
+ const session = await awsAmplify.Auth.currentSession();
5357
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5358
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5359
+ if (accessToken && idToken) {
5360
+ headers.set('accesstoken', accessToken);
5361
+ headers.set('idtoken', idToken);
5362
+ // headers.set('refreshtoken', tokens.refreshToken);
5563
5363
  }
5564
- });
5565
- }); },
5364
+ return headers;
5365
+ }
5366
+ catch (error) {
5367
+ console.error('authDataBaseQuery: ', error);
5368
+ return headers;
5369
+ }
5370
+ },
5566
5371
  credentials: 'include',
5567
5372
  });
5568
5373
  /**
5569
5374
  * This function is used to retry a request if we get a 401 error.
5570
5375
  */
5571
- var authDataBaseQueryWithReauth = function (args, api, extraOptions) { return __awaiter(void 0, void 0, void 0, function () {
5572
- var result, authSession, user;
5573
- var _a;
5574
- return __generator(this, function (_b) {
5575
- switch (_b.label) {
5576
- case 0: return [4 /*yield*/, authDataBaseQuery(args, api, extraOptions)];
5577
- case 1:
5578
- result = _b.sent();
5579
- if (!(((_a = result === null || result === void 0 ? void 0 : result.error) === null || _a === void 0 ? void 0 : _a.status) === 401)) return [3 /*break*/, 6];
5580
- return [4 /*yield*/, awsAmplify.Auth.currentAuthenticatedUser({
5581
- bypassCache: true, // Ensures that the user is refreshed from the server
5582
- })];
5583
- case 2:
5584
- authSession = _b.sent();
5585
- user = formatAuthSession(authSession);
5586
- api.dispatch(setCredentials(user));
5587
- if (!(authSession === null || authSession === void 0 ? void 0 : authSession.tokens)) return [3 /*break*/, 4];
5588
- return [4 /*yield*/, authDataBaseQuery(args, api, extraOptions)];
5589
- case 3:
5590
- // If we get a new access token, retry the original request.
5591
- result = _b.sent();
5592
- return [3 /*break*/, 6];
5593
- case 4:
5376
+ const authDataBaseQueryWithReauth = async (args, api, extraOptions) => {
5377
+ let result = await authDataBaseQuery(args, api, extraOptions);
5378
+ // If we get a 401 error
5379
+ if (result?.error?.status === 401) {
5380
+ const authSession = await awsAmplify.Auth.currentAuthenticatedUser({
5381
+ bypassCache: true, // Ensures that the user is refreshed from the server
5382
+ });
5383
+ const user = formatAuthSession(authSession);
5384
+ api.dispatch(slice.setCredentials(user));
5385
+ if (authSession?.tokens) {
5386
+ // If we get a new access token, retry the original request.
5387
+ result = await authDataBaseQuery(args, api, extraOptions);
5388
+ }
5389
+ else {
5594
5390
  // TODO; require full data reset?
5595
- return [4 /*yield*/, awsAmplify.Auth.signOut()];
5596
- case 5:
5597
- // TODO; require full data reset?
5598
- _b.sent();
5599
- api.dispatch(logout());
5600
- // If no access token throw error.
5601
- throw new Error('No access token found');
5602
- case 6: return [2 /*return*/, result];
5391
+ await awsAmplify.Auth.signOut();
5392
+ api.dispatch(slice.logout());
5393
+ // If no access token throw error.
5394
+ throw new Error('No access token found');
5603
5395
  }
5604
- });
5605
- }); };
5606
- var authApi = createApi({
5396
+ }
5397
+ return result;
5398
+ };
5399
+ const authApi = createApi({
5607
5400
  reducerPath: 'authApi',
5608
5401
  baseQuery: authDataBaseQueryWithReauth,
5609
5402
  tagTypes: ['UserToken', 'UserData'],
5610
5403
  // keepUnusedDataFor: 300,
5611
- endpoints: function (builder) { return ({
5404
+ endpoints: (builder) => ({
5612
5405
  resetPassword: builder.mutation({
5613
- query: function (data) { return ({
5406
+ query: (data) => ({
5614
5407
  url: '/user/password/reset',
5615
5408
  method: 'POST',
5616
5409
  body: {
@@ -5619,10 +5412,10 @@ var authApi = createApi({
5619
5412
  currentPassword: data.currentPassword,
5620
5413
  newPassword: data.newPassword,
5621
5414
  },
5622
- }); },
5415
+ }),
5623
5416
  }),
5624
5417
  resetPasswordAuth: builder.mutation({
5625
- query: function (data) { return ({
5418
+ query: (data) => ({
5626
5419
  url: '/user/password/reset-auth',
5627
5420
  method: 'POST',
5628
5421
  body: {
@@ -5630,54 +5423,41 @@ var authApi = createApi({
5630
5423
  currentPassword: data.currentPassword,
5631
5424
  newPassword: data.newPassword,
5632
5425
  },
5633
- }); },
5426
+ }),
5634
5427
  }),
5635
5428
  forgottenPassword: builder.mutation({
5636
- query: function (data) { return ({
5429
+ query: (data) => ({
5637
5430
  url: '/user/password/forgot',
5638
5431
  method: 'POST',
5639
5432
  body: {
5640
5433
  email: data.email,
5641
5434
  },
5642
- }); },
5435
+ }),
5643
5436
  }),
5644
5437
  register: builder.mutation({
5645
- query: function (data) { return ({
5438
+ query: (data) => ({
5646
5439
  url: '/user/register',
5647
5440
  method: 'POST',
5648
5441
  body: data,
5649
- }); },
5650
- onQueryStarted: function (arg_1, _a) {
5651
- return __awaiter(this, arguments, void 0, function (arg, _b) {
5652
- var err_1;
5653
- var dispatch = _b.dispatch, queryFulfilled = _b.queryFulfilled;
5654
- return __generator(this, function (_c) {
5655
- switch (_c.label) {
5656
- case 0:
5657
- _c.trys.push([0, 2, , 3]);
5658
- return [4 /*yield*/, queryFulfilled];
5659
- case 1:
5660
- _c.sent();
5661
- dispatch(resetCreating());
5662
- return [3 /*break*/, 3];
5663
- case 2:
5664
- err_1 = _c.sent();
5665
- console.error('REGISTER: ', err_1);
5666
- return [3 /*break*/, 3];
5667
- case 3: return [2 /*return*/];
5668
- }
5669
- });
5670
- });
5442
+ }),
5443
+ async onQueryStarted(arg, { dispatch, queryFulfilled }) {
5444
+ try {
5445
+ await queryFulfilled;
5446
+ dispatch(slice.resetCreating());
5447
+ }
5448
+ catch (err) {
5449
+ console.error('REGISTER: ', err);
5450
+ }
5671
5451
  },
5672
5452
  }),
5673
5453
  verifyUser: builder.query({
5674
- query: function (data) { return ({
5454
+ query: (data) => ({
5675
5455
  url: '/user/verify',
5676
5456
  method: 'POST',
5677
5457
  body: data,
5678
- }); },
5679
- transformErrorResponse: function (rawResult) {
5680
- var status = rawResult.status, data = rawResult.data, message = rawResult.message;
5458
+ }),
5459
+ transformErrorResponse: (rawResult) => {
5460
+ const { status, data, message } = rawResult;
5681
5461
  switch (status) {
5682
5462
  case 429:
5683
5463
  // Toast.info(TOO_MANY_REQUESTS_MESSAGE);
@@ -5689,7 +5469,7 @@ var authApi = createApi({
5689
5469
  */
5690
5470
  return {
5691
5471
  route: 'resend',
5692
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5472
+ message: data?.message || message,
5693
5473
  };
5694
5474
  case 404:
5695
5475
  /**
@@ -5697,7 +5477,7 @@ var authApi = createApi({
5697
5477
  */
5698
5478
  return {
5699
5479
  route: 'failed',
5700
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5480
+ message: data?.message || message,
5701
5481
  };
5702
5482
  case 401:
5703
5483
  /**
@@ -5705,159 +5485,146 @@ var authApi = createApi({
5705
5485
  */
5706
5486
  return {
5707
5487
  route: 'error',
5708
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5488
+ message: data?.message || message,
5709
5489
  };
5710
5490
  default:
5711
5491
  return {
5712
5492
  route: 'error',
5713
- message: (data === null || data === void 0 ? void 0 : data.message) || message,
5493
+ message: data?.message || message,
5714
5494
  };
5715
5495
  }
5716
5496
  },
5717
- transformResponse: function (rawResult) {
5718
- var data = rawResult.data;
5719
- return { route: 'success', message: data === null || data === void 0 ? void 0 : data.message };
5497
+ transformResponse: (rawResult) => {
5498
+ const { data } = rawResult;
5499
+ return { route: 'success', message: data?.message };
5720
5500
  },
5721
5501
  }),
5722
5502
  verifyUserAttributes: builder.query({
5723
- query: function (data) { return ({
5503
+ query: (data) => ({
5724
5504
  url: '/user/verify/email',
5725
5505
  method: 'POST',
5726
5506
  body: data,
5727
- }); },
5507
+ }),
5728
5508
  }),
5729
5509
  verifyUserResend: builder.query({
5730
- query: function (data) { return ({
5510
+ query: (data) => ({
5731
5511
  url: '/user/verify/resend',
5732
5512
  method: 'POST',
5733
5513
  body: data,
5734
- }); },
5514
+ }),
5735
5515
  }),
5736
5516
  getUserInfo: builder.query({
5737
- query: function (uuid) { return ({
5738
- url: "/data/user/".concat(uuid),
5517
+ query: (uuid) => ({
5518
+ url: `/data/user/${uuid}`,
5739
5519
  method: 'GET',
5740
- }); },
5520
+ }),
5741
5521
  providesTags: ['UserData'],
5742
5522
  }),
5743
5523
  updateUserInfo: builder.mutation({
5744
- query: function (expressions) { return ({
5524
+ query: (expressions) => ({
5745
5525
  url: '/data/user',
5746
5526
  method: 'PATCH',
5747
5527
  body: expressions,
5748
- }); },
5528
+ }),
5749
5529
  invalidatesTags: ['UserData'],
5750
5530
  }),
5751
5531
  updateUser: builder.mutation({
5752
- query: function (data) { return ({
5532
+ query: (data) => ({
5753
5533
  url: '/user',
5754
5534
  method: 'PATCH',
5755
5535
  body: data,
5756
- }); },
5536
+ }),
5757
5537
  invalidatesTags: ['UserData'],
5758
5538
  }),
5759
- }); },
5539
+ }),
5760
5540
  });
5761
5541
  // Export hooks for usage in functional components.
5762
- var // useLoginQuery,
5542
+ const {
5543
+ // useLoginQuery,
5763
5544
  // useLazyLoginQuery,
5764
5545
  // useRefreshTokenQuery,
5765
5546
  // useLazyRefreshTokenQuery,
5766
5547
  // useLogoutQuery,
5767
5548
  // useLazyLogoutQuery,
5768
- useResetPasswordMutation = authApi.useResetPasswordMutation, // Use this for mobile app.
5769
- useResetPasswordAuthMutation = authApi.useResetPasswordAuthMutation, useRegisterMutation = authApi.useRegisterMutation, useVerifyUserQuery = authApi.useVerifyUserQuery, useLazyVerifyUserQuery = authApi.useLazyVerifyUserQuery, useGetUserInfoQuery = authApi.useGetUserInfoQuery, useLazyGetUserInfoQuery = authApi.useLazyGetUserInfoQuery, useUpdateUserInfoMutation = authApi.useUpdateUserInfoMutation, useForgottenPasswordMutation = authApi.useForgottenPasswordMutation, useVerifyUserAttributesQuery = authApi.useVerifyUserAttributesQuery, useLazyVerifyUserAttributesQuery = authApi.useLazyVerifyUserAttributesQuery, useVerifyUserResendQuery = authApi.useVerifyUserResendQuery, useLazyVerifyUserResendQuery = authApi.useLazyVerifyUserResendQuery, useUpdateUserMutation = authApi.useUpdateUserMutation;
5549
+ useResetPasswordMutation, // Use this for mobile app.
5550
+ useResetPasswordAuthMutation, useRegisterMutation, useVerifyUserQuery, useLazyVerifyUserQuery, useGetUserInfoQuery, useLazyGetUserInfoQuery, useUpdateUserInfoMutation, useForgottenPasswordMutation, useVerifyUserAttributesQuery, useLazyVerifyUserAttributesQuery, useVerifyUserResendQuery, useLazyVerifyUserResendQuery, useUpdateUserMutation, } = authApi;
5770
5551
 
5771
- var contentApi = createApi({
5552
+ const contentApi = createApi({
5772
5553
  reducerPath: 'contentApi',
5773
5554
  baseQuery: fetchBaseQuery({
5774
5555
  baseUrl: APP_ES_INSTANCE,
5775
- prepareHeaders: function (headers) {
5556
+ prepareHeaders: (headers) => {
5776
5557
  headers.set('Authorization', APP_ES_AUTH);
5777
5558
  return headers;
5778
5559
  },
5779
5560
  }),
5780
5561
  tagTypes: ['Data', 'Workout'],
5781
5562
  // keepUnusedDataFor: 300,
5782
- endpoints: function (builder) { return ({
5563
+ endpoints: (builder) => ({
5783
5564
  getData: builder.query({
5784
- query: function (_a) {
5785
- var index = _a.index, _b = _a.options, options = _b === void 0 ? {} : _b;
5786
- return ({
5787
- url: "".concat(index, "/_search"),
5788
- method: 'POST',
5789
- body: {
5790
- from: 0,
5791
- size: options.size || 1000,
5792
- sort: options.sort || [{ created: { order: 'desc' } }],
5793
- query: options.query || {
5794
- match_all: {},
5795
- },
5565
+ query: ({ index, options = {} }) => ({
5566
+ url: `${index}/_search`,
5567
+ method: 'POST',
5568
+ body: {
5569
+ from: 0,
5570
+ size: options.size || 1000,
5571
+ sort: options.sort || [{ created: { order: 'desc' } }],
5572
+ query: options.query || {
5573
+ match_all: {},
5796
5574
  },
5797
- });
5798
- },
5799
- transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
5575
+ },
5576
+ }),
5577
+ transformResponse: (response) => response?.hits?.hits,
5800
5578
  providesTags: ['Data'],
5801
5579
  }),
5802
5580
  getDataById: builder.query({
5803
- query: function (_a) {
5804
- var _b;
5805
- var index = _a.index, ids = _a.ids;
5806
- return ({
5807
- url: "".concat(index, "/_search"),
5808
- method: 'POST',
5809
- body: {
5810
- from: 0,
5811
- size: ids.length,
5812
- query: {
5813
- terms: (_b = {},
5814
- _b['uuid.keyword'] = ids,
5815
- _b),
5581
+ query: ({ index, ids }) => ({
5582
+ url: `${index}/_search`,
5583
+ method: 'POST',
5584
+ body: {
5585
+ from: 0,
5586
+ size: ids.length,
5587
+ query: {
5588
+ terms: {
5589
+ ['uuid.keyword']: ids,
5816
5590
  },
5817
5591
  },
5818
- });
5819
- },
5820
- transformResponse: function (response) { var _a; return (_a = response === null || response === void 0 ? void 0 : response.hits) === null || _a === void 0 ? void 0 : _a.hits; },
5592
+ },
5593
+ }),
5594
+ transformResponse: (response) => response?.hits?.hits,
5821
5595
  providesTags: ['Workout'],
5822
5596
  }),
5823
- }); },
5597
+ }),
5824
5598
  });
5825
- contentApi.useGetDataQuery; contentApi.useLazyGetDataQuery; contentApi.useGetDataByIdQuery; contentApi.useLazyGetDataByIdQuery;
5599
+ const { useGetDataQuery, useLazyGetDataQuery, useGetDataByIdQuery, useLazyGetDataByIdQuery, } = contentApi;
5826
5600
 
5827
- var paymentApi = createApi({
5601
+ const paymentApi = createApi({
5828
5602
  reducerPath: 'paymentApi',
5829
5603
  baseQuery: fetchBaseQuery({
5830
5604
  baseUrl: API_PAYMENTS_PREFIX,
5831
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5832
- var session, idToken, accessToken;
5833
- return __generator(this, function (_c) {
5834
- switch (_c.label) {
5835
- case 0:
5836
- headers.set('Content-Type', 'application/json');
5837
- return [4 /*yield*/, awsAmplify.Auth.currentSession()];
5838
- case 1:
5839
- session = _c.sent();
5840
- idToken = session.getIdToken().getJwtToken();
5841
- accessToken = session.getAccessToken().getJwtToken();
5842
- if (accessToken && idToken) {
5843
- headers.set('accesstoken', accessToken);
5844
- headers.set('idtoken', idToken);
5845
- // headers.set('refreshtoken', tokens.refreshToken);
5846
- }
5847
- return [2 /*return*/, headers];
5848
- }
5849
- });
5850
- }); },
5605
+ prepareHeaders: async (headers, {}) => {
5606
+ headers.set('Content-Type', 'application/json');
5607
+ // add accessToken to headers from slice using selectAccessToken selector
5608
+ const session = await awsAmplify.Auth.currentSession();
5609
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5610
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5611
+ if (accessToken && idToken) {
5612
+ headers.set('accesstoken', accessToken);
5613
+ headers.set('idtoken', idToken);
5614
+ // headers.set('refreshtoken', tokens.refreshToken);
5615
+ }
5616
+ return headers;
5617
+ },
5851
5618
  credentials: 'include',
5852
5619
  }),
5853
5620
  tagTypes: ['UserSubscription', 'Plans', 'TaxRates', 'PromoCodes'],
5854
5621
  // keepUnusedDataFor: 300,
5855
- endpoints: function (builder) { return ({
5622
+ endpoints: (builder) => ({
5856
5623
  /**
5857
5624
  * USER API.
5858
5625
  */
5859
5626
  checkUserSubscription: builder.query({
5860
- query: function (data) { return ({
5627
+ query: (data) => ({
5861
5628
  url: '/payment/subscriber',
5862
5629
  method: 'POST',
5863
5630
  body: {
@@ -5865,119 +5632,99 @@ var paymentApi = createApi({
5865
5632
  email: data.email,
5866
5633
  sub: data.sub,
5867
5634
  },
5868
- }); },
5635
+ }),
5869
5636
  providesTags: ['UserSubscription'],
5870
5637
  }),
5871
5638
  getPaymentPlans: builder.query({
5872
- query: function () { return '/payment/plans'; },
5639
+ query: () => '/payment/plans',
5873
5640
  providesTags: ['Plans'],
5874
5641
  }),
5875
5642
  getTaxRates: builder.query({
5876
- query: function () { return ({
5643
+ query: () => ({
5877
5644
  url: '/payment/tax-rates',
5878
5645
  method: 'GET',
5879
- }); },
5646
+ }),
5880
5647
  providesTags: ['TaxRates'],
5881
5648
  }),
5882
5649
  checkPromoCode: builder.query({
5883
- query: function (promoCode) { return ({
5884
- url: "/payment/coupon/".concat(promoCode),
5650
+ query: (promoCode) => ({
5651
+ url: `/payment/coupon/${promoCode}`,
5885
5652
  method: 'GET',
5886
- }); },
5653
+ }),
5887
5654
  providesTags: ['PromoCodes'],
5888
5655
  }),
5889
- }); },
5656
+ }),
5890
5657
  });
5891
5658
  // Export hooks for usage in functional components.
5892
- paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery; paymentApi.useGetTaxRatesQuery; paymentApi.useLazyGetTaxRatesQuery; paymentApi.useCheckPromoCodeQuery; paymentApi.useLazyCheckPromoCodeQuery;
5659
+ const { useCheckUserSubscriptionQuery, useLazyCheckUserSubscriptionQuery, useGetPaymentPlansQuery, useLazyGetPaymentPlansQuery, useGetTaxRatesQuery, useLazyGetTaxRatesQuery, useCheckPromoCodeQuery, useLazyCheckPromoCodeQuery, } = paymentApi;
5893
5660
 
5894
- var dataBaseQuery = fetchBaseQuery({
5661
+ const dataBaseQuery = fetchBaseQuery({
5895
5662
  baseUrl: API_ORDERS_PREFIX,
5896
- prepareHeaders: function (headers_1, _a) { return __awaiter(void 0, [headers_1, _a], void 0, function (headers, _b) {
5897
- var session, idToken, accessToken;
5898
- return __generator(this, function (_c) {
5899
- switch (_c.label) {
5900
- case 0:
5901
- headers.set('Content-Type', 'application/json');
5902
- return [4 /*yield*/, awsAmplify.Auth.currentSession()];
5903
- case 1:
5904
- session = _c.sent();
5905
- idToken = session.getIdToken().getJwtToken();
5906
- accessToken = session.getAccessToken().getJwtToken();
5907
- if (accessToken && idToken) {
5908
- headers.set('accesstoken', accessToken);
5909
- headers.set('idtoken', idToken);
5910
- // headers.set('refreshtoken', tokens.refreshToken);
5911
- }
5912
- return [2 /*return*/, headers];
5913
- }
5914
- });
5915
- }); },
5663
+ prepareHeaders: async (headers, {}) => {
5664
+ headers.set('Content-Type', 'application/json');
5665
+ // add accessToken to headers from slice using selectAccessToken selector
5666
+ const session = await awsAmplify.Auth.currentSession();
5667
+ const idToken = session.getIdToken().getJwtToken(); // ID token
5668
+ const accessToken = session.getAccessToken().getJwtToken(); // Access token
5669
+ if (accessToken && idToken) {
5670
+ headers.set('accesstoken', accessToken);
5671
+ headers.set('idtoken', idToken);
5672
+ // headers.set('refreshtoken', tokens.refreshToken);
5673
+ }
5674
+ return headers;
5675
+ },
5916
5676
  credentials: 'include',
5917
5677
  });
5918
5678
  /**
5919
5679
  * This function is used to retry a request if we get a 401 error.
5920
5680
  */
5921
- var dataBaseQueryWithReauth = function (args, api, extraOptions) { return __awaiter(void 0, void 0, void 0, function () {
5922
- var result, authSession, user;
5923
- var _a;
5924
- return __generator(this, function (_b) {
5925
- switch (_b.label) {
5926
- case 0: return [4 /*yield*/, dataBaseQuery(args, api, extraOptions)];
5927
- case 1:
5928
- result = _b.sent();
5929
- if (!(((_a = result === null || result === void 0 ? void 0 : result.error) === null || _a === void 0 ? void 0 : _a.status) === 401)) return [3 /*break*/, 6];
5930
- return [4 /*yield*/, awsAmplify.Auth.currentAuthenticatedUser({
5931
- bypassCache: true, // Ensures that the user is refreshed from the server
5932
- })];
5933
- case 2:
5934
- authSession = _b.sent();
5935
- user = formatAuthSession(authSession);
5936
- api.dispatch(setCredentials(user));
5937
- if (!(authSession === null || authSession === void 0 ? void 0 : authSession.tokens)) return [3 /*break*/, 4];
5938
- return [4 /*yield*/, dataBaseQuery(args, api, extraOptions)];
5939
- case 3:
5940
- // If we get a new access token, retry the original request.
5941
- result = _b.sent();
5942
- return [3 /*break*/, 6];
5943
- case 4:
5681
+ const dataBaseQueryWithReauth = async (args, api, extraOptions) => {
5682
+ let result = await dataBaseQuery(args, api, extraOptions);
5683
+ // If we get a 401 error
5684
+ if (result?.error?.status === 401) {
5685
+ const authSession = await awsAmplify.Auth.currentAuthenticatedUser({
5686
+ bypassCache: true, // Ensures that the user is refreshed from the server
5687
+ });
5688
+ const user = formatAuthSession(authSession);
5689
+ api.dispatch(slice.setCredentials(user));
5690
+ if (authSession?.tokens) {
5691
+ // If we get a new access token, retry the original request.
5692
+ result = await dataBaseQuery(args, api, extraOptions);
5693
+ }
5694
+ else {
5944
5695
  // TODO; require full data reset?
5945
- return [4 /*yield*/, awsAmplify.Auth.signOut()];
5946
- case 5:
5947
- // TODO; require full data reset?
5948
- _b.sent();
5949
- api.dispatch(logout());
5950
- // If no access token throw error.
5951
- throw new Error('No access token found');
5952
- case 6: return [2 /*return*/, result];
5696
+ await awsAmplify.Auth.signOut();
5697
+ api.dispatch(slice.logout());
5698
+ // If no access token throw error.
5699
+ throw new Error('No access token found');
5953
5700
  }
5954
- });
5955
- }); };
5956
- var ordersApi = createApi({
5701
+ }
5702
+ return result;
5703
+ };
5704
+ const ordersApi = createApi({
5957
5705
  reducerPath: 'ordersApi',
5958
5706
  baseQuery: dataBaseQueryWithReauth,
5959
5707
  tagTypes: ['Orders'],
5960
5708
  // keepUnusedDataFor: 300,
5961
- endpoints: function (builder) { return ({
5709
+ endpoints: (builder) => ({
5962
5710
  /**
5963
5711
  * USER API.
5964
5712
  */
5965
5713
  fetchOrders: builder.query({
5966
- query: function (ids) { return ({
5714
+ query: (ids) => ({
5967
5715
  url: '/order/search',
5968
5716
  method: 'POST',
5969
5717
  body: {
5970
- ids: ids,
5718
+ ids,
5971
5719
  },
5972
- }); },
5720
+ }),
5973
5721
  }),
5974
- }); },
5722
+ }),
5975
5723
  });
5976
5724
  // Export hooks for usage in functional components.
5977
- ordersApi.useFetchOrdersQuery; ordersApi.useLazyFetchOrdersQuery;
5725
+ const { useFetchOrdersQuery, useLazyFetchOrdersQuery } = ordersApi;
5978
5726
 
5979
- var _a, _b;
5980
- var initialState = {
5727
+ const initialState = {
5981
5728
  addedItems: [],
5982
5729
  netTotal: 0,
5983
5730
  taxRate: {
@@ -5996,125 +5743,141 @@ var initialState = {
5996
5743
  error: false,
5997
5744
  open: false,
5998
5745
  };
5999
- var cartSlice = toolkit.createSlice({
5746
+ const cartSlice = toolkit.createSlice({
6000
5747
  name: 'cart',
6001
- initialState: initialState,
5748
+ initialState,
6002
5749
  reducers: {
6003
- setTaxRate: function (state, action) {
6004
- var netTotal = state.netTotal, promoCode = state.promoCode;
6005
- var currentTotal = netTotal;
6006
- if (promoCode === null || promoCode === void 0 ? void 0 : promoCode.code) {
6007
- var data = applyCoupon(promoCode, currentTotal);
5750
+ setTaxRate: (state, action) => {
5751
+ const { netTotal, promoCode } = state;
5752
+ let currentTotal = netTotal;
5753
+ if (promoCode?.code) {
5754
+ const data = applyCoupon(promoCode, currentTotal);
6008
5755
  currentTotal = data.discountedTotal;
6009
5756
  }
6010
- var taxAmount = applyTax(action.payload, currentTotal);
6011
- var grossTotal = currentTotal + taxAmount;
6012
- return __assign(__assign({}, state), { taxRate: action.payload, taxAmount: taxAmount, grossTotal: grossTotal });
5757
+ const taxAmount = applyTax(action.payload, currentTotal);
5758
+ const grossTotal = currentTotal + taxAmount;
5759
+ return {
5760
+ ...state,
5761
+ taxRate: action.payload,
5762
+ taxAmount,
5763
+ grossTotal,
5764
+ };
6013
5765
  },
6014
- resetTaxRate: function (state, action) {
6015
- return __assign(__assign({}, state), { taxRate: {
5766
+ resetTaxRate: (state, action) => {
5767
+ return {
5768
+ ...state,
5769
+ taxRate: {
6016
5770
  country: 'none',
6017
5771
  percentage: 0,
6018
- }, taxAmount: 0 });
5772
+ },
5773
+ taxAmount: 0,
5774
+ };
6019
5775
  },
6020
- setPromoCode: function (state, action) {
6021
- var netTotal = state.netTotal, taxRate = state.taxRate;
6022
- var data = applyCoupon(action.payload, netTotal);
6023
- var taxAmount = applyTax(taxRate, data.discountedTotal);
6024
- var grossTotal = data.discountedTotal + taxAmount;
6025
- return __assign(__assign({}, state), { promoCode: {
5776
+ setPromoCode: (state, action) => {
5777
+ const { netTotal, taxRate } = state;
5778
+ const data = applyCoupon(action.payload, netTotal);
5779
+ const taxAmount = applyTax(taxRate, data.discountedTotal);
5780
+ const grossTotal = data.discountedTotal + taxAmount;
5781
+ return {
5782
+ ...state,
5783
+ promoCode: {
6026
5784
  code: data.code,
6027
5785
  name: data.code,
6028
5786
  discount: data.discount,
6029
5787
  discountedAmount: data.discountedAmount,
6030
- }, taxAmount: taxAmount, grossTotal: grossTotal });
5788
+ },
5789
+ taxAmount,
5790
+ grossTotal,
5791
+ };
6031
5792
  },
6032
- removePromoCode: function (state, action) {
6033
- var netTotal = state.netTotal, taxRate = state.taxRate;
6034
- var taxAmount = applyTax(taxRate, netTotal);
6035
- var grossTotal = netTotal + taxAmount;
6036
- return __assign(__assign({}, state), { promoCode: initialState.promoCode, taxAmount: taxAmount, grossTotal: grossTotal });
5793
+ removePromoCode: (state, action) => {
5794
+ const { netTotal, taxRate } = state;
5795
+ const taxAmount = applyTax(taxRate, netTotal);
5796
+ const grossTotal = netTotal + taxAmount;
5797
+ return {
5798
+ ...state,
5799
+ promoCode: initialState.promoCode,
5800
+ taxAmount,
5801
+ grossTotal,
5802
+ };
6037
5803
  },
6038
- addToCart: function (state, action) {
6039
- var _a = action.payload, options = _a.options, item = _a.item;
6040
- var newTotal = state.netTotal + options.selectedPrice;
6041
- var taxAmount = newTotal * (state.taxRate.percentage / 100);
6042
- var grossTotal = newTotal + taxAmount;
6043
- var addItem = item ? __assign(__assign({}, item), { options: options }) : null;
5804
+ addToCart: (state, action) => {
5805
+ const { options, item } = action.payload;
5806
+ const newTotal = state.netTotal + options.selectedPrice;
5807
+ const taxAmount = newTotal * (state.taxRate.percentage / 100);
5808
+ const grossTotal = newTotal + taxAmount;
5809
+ const addItem = item ? { ...item, options } : null;
6044
5810
  if (!addItem) {
6045
5811
  return state;
6046
5812
  }
6047
- var addedItems = __spreadArray(__spreadArray([], state.addedItems, true), [addItem], false);
6048
- return __assign(__assign({}, state), { addedItems: addedItems, netTotal: newTotal, grossTotal: grossTotal });
5813
+ const addedItems = [...state.addedItems, addItem];
5814
+ return {
5815
+ ...state,
5816
+ addedItems: addedItems,
5817
+ netTotal: newTotal,
5818
+ grossTotal: grossTotal,
5819
+ };
6049
5820
  },
6050
- updateCart: function (state, action) {
6051
- var options = action.payload.options;
6052
- return __assign(__assign({}, state), { addedItems: state.addedItems.map(function (item) {
6053
- return item && __assign(__assign({}, item), { options: options });
6054
- }) });
5821
+ updateCart: (state, action) => {
5822
+ const { options } = action.payload;
5823
+ return {
5824
+ ...state,
5825
+ addedItems: state.addedItems.map((item) => item && {
5826
+ ...item,
5827
+ options: options,
5828
+ }),
5829
+ };
6055
5830
  },
6056
- removeFromCart: function (state, action) {
6057
- var _a = action.payload, id = _a.id, price = _a.price;
6058
- var newTotal = state.netTotal - price;
6059
- var taxAmount = newTotal * (state.taxRate.percentage / 100);
6060
- var grossTotal = newTotal + taxAmount;
6061
- return __assign(__assign({}, state), { addedItems: state.addedItems.filter(function (item) { return item && item.uuid !== id; }), netTotal: newTotal, grossTotal: grossTotal });
5831
+ removeFromCart: (state, action) => {
5832
+ const { id, price } = action.payload;
5833
+ const newTotal = state.netTotal - price;
5834
+ const taxAmount = newTotal * (state.taxRate.percentage / 100);
5835
+ const grossTotal = newTotal + taxAmount;
5836
+ return {
5837
+ ...state,
5838
+ addedItems: state.addedItems.filter((item) => item && item.uuid !== id),
5839
+ netTotal: newTotal,
5840
+ grossTotal: grossTotal,
5841
+ };
6062
5842
  },
6063
- toggleCart: function (state, action) {
6064
- return __assign(__assign({}, state), { open: action.payload });
5843
+ toggleCart: (state, action) => {
5844
+ return {
5845
+ ...state,
5846
+ open: action.payload,
5847
+ };
6065
5848
  },
6066
- emptyCart: function () { return initialState; },
5849
+ emptyCart: () => initialState,
6067
5850
  },
6068
5851
  selectors: {
6069
- selectMediaInCart: function (cart) { return cart.addedItems; },
6070
- selectCartTotal: function (cart) { return cart.grossTotal; },
6071
- selectCartNetTotal: function (cart) { return cart.netTotal; },
6072
- selectCartTaxRate: function (cart) { return cart.taxRate; },
6073
- selectCartTaxAmount: function (cart) { return cart.taxAmount; },
6074
- selectCartCount: function (cart) { return cart.addedItems.length; },
6075
- selectCartStatus: function (cart) { return cart.open; },
6076
- selectPromoCode: function (cart) { return cart.promoCode; },
5852
+ selectMediaInCart: (cart) => cart.addedItems,
5853
+ selectCartTotal: (cart) => cart.grossTotal,
5854
+ selectCartNetTotal: (cart) => cart.netTotal,
5855
+ selectCartTaxRate: (cart) => cart.taxRate,
5856
+ selectCartTaxAmount: (cart) => cart.taxAmount,
5857
+ selectCartCount: (cart) => cart.addedItems.length,
5858
+ selectCartStatus: (cart) => cart.open,
5859
+ selectPromoCode: (cart) => cart.promoCode,
6077
5860
  },
6078
5861
  });
6079
- var setTaxRate = (_a = cartSlice.actions, _a.setTaxRate), resetTaxRate = _a.resetTaxRate, setPromoCode = _a.setPromoCode, removePromoCode = _a.removePromoCode, addToCart = _a.addToCart, updateCart = _a.updateCart, removeFromCart = _a.removeFromCart, emptyCart = _a.emptyCart, toggleCart = _a.toggleCart;
6080
- var selectMediaInCart = (_b = cartSlice.selectors, _b.selectMediaInCart), selectCartTotal = _b.selectCartTotal, selectCartNetTotal = _b.selectCartNetTotal, selectCartTaxRate = _b.selectCartTaxRate, selectCartTaxAmount = _b.selectCartTaxAmount, selectCartCount = _b.selectCartCount, selectCartStatus = _b.selectCartStatus, selectPromoCode = _b.selectPromoCode;
6081
- var selectCartItems = toolkit.createSelector([selectMediaInCart], function (items) {
6082
- return items.map(function (item) {
5862
+ const { setTaxRate, resetTaxRate, setPromoCode, removePromoCode, addToCart, updateCart, removeFromCart, emptyCart, toggleCart, } = cartSlice.actions;
5863
+ const { selectMediaInCart, selectCartTotal, selectCartNetTotal, selectCartTaxRate, selectCartTaxAmount, selectCartCount, selectCartStatus, selectPromoCode, } = cartSlice.selectors;
5864
+ const selectCartItems = toolkit.createSelector([selectMediaInCart], (items) => {
5865
+ return items.map((item) => {
6083
5866
  return {
6084
5867
  title: item.title || item.generatedTitle,
6085
- file: "".concat(item.sku, ".mp4"),
5868
+ file: `${item.sku}.mp4`,
6086
5869
  options: item.options,
6087
5870
  script: item.script,
6088
5871
  };
6089
5872
  });
6090
5873
  });
6091
- var selectCartItemsIds = toolkit.createSelector([selectMediaInCart], function (items) {
6092
- return items.map(function (item) { return item.uuid; });
5874
+ const selectCartItemsIds = toolkit.createSelector([selectMediaInCart], (items) => {
5875
+ return items.map((item) => item.uuid);
6093
5876
  });
6094
5877
  cartSlice.reducer;
6095
5878
 
6096
- var useLoggedIn = function () {
6097
- var isLoggedIn = reactRedux.useSelector(isAuthenticated);
6098
- return React.useMemo(function () { return isLoggedIn; }, [isLoggedIn]);
6099
- };
6100
-
6101
- // This file serves as a central hub for re-exporting pre-typed Redux hooks.
6102
- // Use throughout your app instead of plain `useDispatch` and `useSelector`
6103
- var useAppDispatch = isWeb ? reactRedux.useDispatch.withTypes() : reactRedux.useDispatch.withTypes();
6104
- var useAppSelector = isWeb ? reactRedux.useSelector.withTypes() : reactRedux.useSelector.withTypes();
6105
- var useAppStore = isWeb ? reactRedux.useStore.withTypes() : reactRedux.useStore.withTypes();
6106
-
6107
- const Config = reactNative.NativeModules.RNCConfigModule || {};
6108
-
6109
- var index = /*#__PURE__*/Object.freeze({
6110
- __proto__: null,
6111
- Config: Config,
6112
- default: Config
6113
- });
6114
-
6115
5879
  exports.addToCart = addToCart;
6116
5880
  exports.authApi = authApi;
6117
- exports.authSlice = authSlice;
6118
5881
  exports.cartSlice = cartSlice;
6119
5882
  exports.contentApi = contentApi;
6120
5883
  exports.emptyCart = emptyCart;
@@ -6144,17 +5907,11 @@ exports.formatTaxonomies = formatTaxonomies;
6144
5907
  exports.formatUserPayload = formatUserPayload;
6145
5908
  exports.formatVideos = formatVideos;
6146
5909
  exports.formatWorkout = formatWorkout;
6147
- exports.getUserSession = getUserSession;
6148
- exports.isAuthenticated = isAuthenticated;
6149
- exports.isVerifying = isVerifying;
6150
- exports.logout = logout;
6151
5910
  exports.ordersApi = ordersApi;
6152
5911
  exports.paymentApi = paymentApi;
6153
5912
  exports.removeFromCart = removeFromCart;
6154
5913
  exports.removePromoCode = removePromoCode;
6155
- exports.resetCreating = resetCreating;
6156
5914
  exports.resetTaxRate = resetTaxRate;
6157
- exports.selectAccessToken = selectAccessToken;
6158
5915
  exports.selectCartCount = selectCartCount;
6159
5916
  exports.selectCartItems = selectCartItems;
6160
5917
  exports.selectCartItemsIds = selectCartItemsIds;
@@ -6163,32 +5920,18 @@ exports.selectCartStatus = selectCartStatus;
6163
5920
  exports.selectCartTaxAmount = selectCartTaxAmount;
6164
5921
  exports.selectCartTaxRate = selectCartTaxRate;
6165
5922
  exports.selectCartTotal = selectCartTotal;
6166
- exports.selectCurrentUser = selectCurrentUser;
6167
- exports.selectCurrentUserRefreshToken = selectCurrentUserRefreshToken;
6168
- exports.selectCurrentUserSub = selectCurrentUserSub;
6169
5923
  exports.selectMediaInCart = selectMediaInCart;
6170
5924
  exports.selectPromoCode = selectPromoCode;
6171
- exports.selectRefreshToken = selectRefreshToken;
6172
- exports.selectSubscription = selectSubscription;
6173
- exports.selectSubscriptionPrice = selectSubscriptionPrice;
6174
- exports.selectUserSubscriptionStatus = selectUserSubscriptionStatus;
6175
- exports.selectUserTokens = selectUserTokens;
6176
- exports.setCredentials = setCredentials;
6177
5925
  exports.setPromoCode = setPromoCode;
6178
5926
  exports.setTaxRate = setTaxRate;
6179
5927
  exports.toggleCart = toggleCart;
6180
5928
  exports.updateCart = updateCart;
6181
- exports.updateSubscription = updateSubscription;
6182
- exports.useAppDispatch = useAppDispatch;
6183
- exports.useAppSelector = useAppSelector;
6184
- exports.useAppStore = useAppStore;
6185
5929
  exports.useForgottenPasswordMutation = useForgottenPasswordMutation;
6186
5930
  exports.useGetUserInfoQuery = useGetUserInfoQuery;
6187
5931
  exports.useLazyGetUserInfoQuery = useLazyGetUserInfoQuery;
6188
5932
  exports.useLazyVerifyUserAttributesQuery = useLazyVerifyUserAttributesQuery;
6189
5933
  exports.useLazyVerifyUserQuery = useLazyVerifyUserQuery;
6190
5934
  exports.useLazyVerifyUserResendQuery = useLazyVerifyUserResendQuery;
6191
- exports.useLoggedIn = useLoggedIn;
6192
5935
  exports.useRegisterMutation = useRegisterMutation;
6193
5936
  exports.useResetPasswordAuthMutation = useResetPasswordAuthMutation;
6194
5937
  exports.useResetPasswordMutation = useResetPasswordMutation;
@@ -6197,4 +5940,4 @@ exports.useUpdateUserMutation = useUpdateUserMutation;
6197
5940
  exports.useVerifyUserAttributesQuery = useVerifyUserAttributesQuery;
6198
5941
  exports.useVerifyUserQuery = useVerifyUserQuery;
6199
5942
  exports.useVerifyUserResendQuery = useVerifyUserResendQuery;
6200
- //# sourceMappingURL=index.js.map
5943
+ //# sourceMappingURL=slice-DsZzY7T7.js.map