@cuemath/leap 3.1.30 → 3.1.31

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 (20) hide show
  1. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +160 -135
  2. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  3. package/dist/features/circle-games/game-launcher/game-launcher.js +101 -122
  4. package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
  5. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +112 -132
  6. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  7. package/dist/features/circle-games/leaderboard/leaderboard.js +38 -38
  8. package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
  9. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  10. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  11. package/dist/index.d.ts +5 -2
  12. package/package.json +1 -1
  13. package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-button-card.js +0 -42
  14. package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-button-card.js.map +0 -1
  15. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js +0 -10
  16. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js.map +0 -1
  17. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js +0 -13
  18. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js.map +0 -1
  19. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +0 -126
  20. package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +0 -1
@@ -1,142 +1,122 @@
1
- import { jsx as r, Fragment as S } from "react/jsx-runtime";
2
- import { useRef as $, useCallback as C, useEffect as q } from "react";
3
- import z from "../../../../../assets/line-icons/icons/carat-right.js";
4
- import { PLATFORM_EVENTS_STUDENT as x } from "../../../../analytics-events/platform-events-student.js";
5
- import { JOURNEY_ID_STUDENT as Q } from "../../../../journey/journey-id/journey-id-student.js";
6
- import { IndicatorType as u } from "../../../../journey/use-journey/constants.js";
7
- import { useJourney as tt } from "../../../../journey/use-journey/use-journey.js";
8
- import et from "../../../../ui/buttons/icon-button/icon-button.js";
9
- import { useUIContext as rt } from "../../../../ui/context/context.js";
10
- import P from "../../../../ui/layout/flex-view.js";
11
- import E from "../../../../ui/text/text.js";
12
- import { getTheme as nt } from "../../../../ui/theme/get-theme.js";
13
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as w } from "../../../enum/circle-onboarding-steps.js";
14
- import { useCircleSounds as ot } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
- import { TablesCard as F } from "../../comps/tables-card/tables-card.js";
16
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as it } from "../../game-launcher-analytics-events.js";
17
- import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as ct, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as st, START_ANIMATING_CLONED_ELEM as V, TABLE_CARD_INDEX as X, GO_TO_TABLE_LAUNCHER_DURATION_MS as dt, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as lt, PUZZLE_CARD_INDEX as ut, SHOW_INITIAL_COACHMARK_AFTER_MS as J, LESSON_CARD_INDEX as mt, SHOW_INITIAL_TOOLTIP_AFTER_MS as at } from "./constants.js";
18
- import { Indicator as Et } from "./use-table-launcher-journey-styled.js";
19
- const Rt = ({
20
- carouselRefs: d,
21
- originalTableRef: t,
22
- onTableSegmentClick: H,
23
- onJourneyComplete: y,
24
- onContinueNextJourney: D
1
+ import { jsx as r, Fragment as O } from "react/jsx-runtime";
2
+ import { useRef as N, useCallback as L, useEffect as j } from "react";
3
+ import Z from "../../../../../assets/line-icons/icons/carat-right.js";
4
+ import { PLATFORM_EVENTS_STUDENT as M } from "../../../../analytics-events/platform-events-student.js";
5
+ import { JOURNEY_ID_STUDENT as q } from "../../../../journey/journey-id/journey-id-student.js";
6
+ import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
7
+ import { useJourney as z } from "../../../../journey/use-journey/use-journey.js";
8
+ import Q from "../../../../ui/buttons/icon-button/icon-button.js";
9
+ import { useUIContext as ee } from "../../../../ui/context/context.js";
10
+ import S from "../../../../ui/layout/flex-view.js";
11
+ import T from "../../../../ui/text/text.js";
12
+ import { getTheme as te } from "../../../../ui/theme/get-theme.js";
13
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as x } from "../../../enum/circle-onboarding-steps.js";
14
+ import { useCircleSounds as re } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
+ import { TablesCard as $ } from "../../comps/tables-card/tables-card.js";
16
+ import { GAME_LAUNCHER_ANALYTICS_EVENTS as ne } from "../../game-launcher-analytics-events.js";
17
+ import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as oe, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as ie, START_ANIMATING_CLONED_ELEM as w, TABLE_CARD_INDEX as F, GO_TO_TABLE_LAUNCHER_DURATION_MS as le, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ce, PUZZLE_CARD_INDEX as ae, SHOW_INITIAL_COACHMARK_AFTER_MS as V, LESSON_CARD_INDEX as se, SHOW_INITIAL_TOOLTIP_AFTER_MS as de } from "./constants.js";
18
+ import { Indicator as ue } from "./use-table-launcher-journey-styled.js";
19
+ const He = ({
20
+ carouselRefs: a,
21
+ onTableSegmentClick: P,
22
+ onJourneyComplete: H
25
23
  }) => {
26
- const e = Q.CIRCLE_TABLES_INTRO_JOURNEY, { device: K } = nt(), m = K === "mobile", h = m ? "ab3-bold" : "ab2-bold", L = $(null), p = $([]), { playButtonSound: W } = ot(), { nextCoachmark: c, setJourney: f, addCoachmark: a, endJourney: R } = tt(), { onEvent: I } = rt(), O = C(
24
+ const e = q.CIRCLE_TABLES_INTRO_JOURNEY, { device: X } = te(), u = X === "mobile", g = u ? "ab3-bold" : "ab2-bold", t = N(null), A = N(null), E = N([]), { playButtonSound: y } = re(), { nextCoachmark: l, setJourney: I, addCoachmark: m, endJourney: D } = z(), { onEvent: C } = ee(), R = L(
27
25
  (n) => {
28
- var s, o;
29
- R(e), n && H(n), I(x.ONBOARDING_STEP_COMPLETED, {
30
- step: w.TABLES
31
- }), (s = t == null ? void 0 : t.current) == null || s.setLabelVisiblity(!0), (o = t == null ? void 0 : t.current) == null || o.stopLabelAnimation(), y(e);
26
+ var c, o;
27
+ D(e), n && P(n), C(M.ONBOARDING_STEP_COMPLETED, {
28
+ step: x.TABLES
29
+ }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (o = t == null ? void 0 : t.current) == null || o.stopLabelAnimation(), H(e);
32
30
  },
33
- [
34
- R,
35
- e,
36
- y,
37
- H,
38
- t,
39
- I
40
- ]
41
- ), b = C(() => {
42
- O(), D();
43
- }, [O, D]), Y = C(
44
- (n, s) => {
45
- var _, T, A;
46
- if (!((_ = t.current) != null && _.segmentedCardWrapperRef.current) || !((T = t.current) != null && T.labelRef.current))
31
+ [D, e, H, P, C]
32
+ ), W = L(
33
+ (n, c) => {
34
+ var h, p, _;
35
+ if (!((h = t.current) != null && h.segmentedCardWrapperRef.current) || !((p = t.current) != null && p.labelRef.current))
47
36
  return;
48
- const o = t.current.labelRef.current.getBoundingClientRect(), i = (A = t.current) == null ? void 0 : A.segmentedCardWrapperRef.current.getBoundingClientRect();
49
- a(e, {
37
+ const o = t.current.labelRef.current.getBoundingClientRect(), i = (_ = t.current) == null ? void 0 : _.segmentedCardWrapperRef.current.getBoundingClientRect();
38
+ m(e, {
50
39
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
51
40
  isActive: !1,
52
- type: u.TOOLTIP,
41
+ type: d.TOOLTIP,
53
42
  elementToHighlight: /* @__PURE__ */ r(
54
- F,
43
+ $,
55
44
  {
56
- ref: L,
57
- defaultTable: s,
45
+ ref: A,
46
+ defaultTable: c,
58
47
  label: n.label,
59
48
  data: n.data,
60
- onPress: O,
61
- onGoBackFromTableLevel: b
49
+ onPress: R,
50
+ onGoBackFromTableLevel: R
62
51
  }
63
52
  ),
64
53
  indicator: {
65
54
  position: "top",
66
55
  backgroundColor: "YELLOW_4",
67
56
  width: 236,
68
- tooltipItem: /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(E, { $renderAs: h, children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
57
+ tooltipItem: /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(T, { $renderAs: g, children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
69
58
  tooltipXCoOrdinates: o.width / 2,
70
59
  tooltipYCoOrdinates: 45
71
60
  }
72
- }), a(e, {
61
+ }), m(e, {
73
62
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
74
63
  isActive: !1,
75
- type: u.NUDGE,
64
+ type: d.NUDGE,
76
65
  indicator: {
77
66
  nudge: "click",
78
- content: !m && /* @__PURE__ */ r(E, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
67
+ content: !u && /* @__PURE__ */ r(T, { $renderAs: "ab1", $color: "WHITE", children: "Pick a level" }),
79
68
  nudgePointerX: i.width / 2 + 50,
80
69
  nudgePointerY: i.height * 0.4
81
70
  },
82
- elementToHighlight: /* @__PURE__ */ r(S, {})
83
- }), c(e, !1, ct), c(e, !0, st);
84
- const l = setTimeout(() => {
85
- var g;
86
- clearTimeout(l), (g = L.current) == null || g.startLabelAnimation("YELLOW_4");
87
- }, V);
88
- p.current.push(l);
71
+ elementToHighlight: /* @__PURE__ */ r(O, {})
72
+ }), l(e, !1, oe), l(e, !0, ie);
73
+ const s = setTimeout(() => {
74
+ var f;
75
+ clearTimeout(s), (f = A.current) == null || f.startLabelAnimation("YELLOW_4");
76
+ }, w);
77
+ E.current.push(s);
89
78
  },
90
- [
91
- a,
92
- b,
93
- O,
94
- m,
95
- e,
96
- c,
97
- t,
98
- h
99
- ]
100
- ), N = C(() => {
79
+ [m, R, u, e, l, g]
80
+ ), b = L(() => {
101
81
  var o;
102
- W(), (o = d.current) == null || o.goToIndex(X), c(e, !1, dt), I(x.ONBOARDING_STEP_VIEWED, {
103
- step: w.TABLES
82
+ y(), (o = a.current) == null || o.goToIndex(F), l(e, !1, le), C(M.ONBOARDING_STEP_VIEWED, {
83
+ step: x.TABLES
104
84
  });
105
85
  const n = setTimeout(() => {
106
86
  var i;
107
- clearTimeout(n), (i = t.current) == null || i.setLabelVisiblity(!1), c(e, !0);
108
- }, lt);
109
- p.current.push(n);
110
- const s = setTimeout(() => {
87
+ clearTimeout(n), (i = t.current) == null || i.setLabelVisiblity(!1), l(e, !0);
88
+ }, ce);
89
+ E.current.push(n);
90
+ const c = setTimeout(() => {
111
91
  var i;
112
- clearTimeout(s), (i = L.current) == null || i.startLabelAnimation("YELLOW_4");
113
- }, V);
114
- p.current.push(s);
115
- }, [d, e, c, t, W, I]), j = C(
116
- (n, s = !1) => {
117
- var A, g, k, B, U, v, G, M;
118
- const o = (A = d.current) == null ? void 0 : A.indicatorRefs, i = (g = d.current) == null ? void 0 : g.nextBtnRef, l = o == null ? void 0 : o[X];
119
- if (!((k = t.current) != null && k.segmentedCardWrapperRef.current) || !((B = t.current) != null && B.labelRef.current) || !o || !(i != null && i.current) || !l || !l.current)
92
+ clearTimeout(c), (i = A.current) == null || i.startLabelAnimation("YELLOW_4");
93
+ }, w);
94
+ E.current.push(c);
95
+ }, [a, e, l, y, C]), J = L(
96
+ (n, c = !1) => {
97
+ var _, f, Y, k, B, U, v, G;
98
+ const o = (_ = a.current) == null ? void 0 : _.indicatorRefs, i = (f = a.current) == null ? void 0 : f.nextBtnRef, s = o == null ? void 0 : o[F];
99
+ if (!((Y = t.current) != null && Y.segmentedCardWrapperRef.current) || !((k = t.current) != null && k.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
120
100
  return;
121
- const _ = t.current.labelRef.current.getBoundingClientRect(), T = (U = t.current) == null ? void 0 : U.segmentedCardWrapperRef.current.getBoundingClientRect();
122
- s ? (f(e, [
101
+ const h = t.current.labelRef.current.getBoundingClientRect(), p = (B = t.current) == null ? void 0 : B.segmentedCardWrapperRef.current.getBoundingClientRect();
102
+ c ? (I(e, [
123
103
  {
124
- originalElementToHighlightRef: l,
104
+ originalElementToHighlightRef: s,
125
105
  isActive: !1,
126
- type: u.TOOLTIP,
127
- elementToHighlight: /* @__PURE__ */ r(Et, { $isActive: !1 }),
106
+ type: d.TOOLTIP,
107
+ elementToHighlight: /* @__PURE__ */ r(ue, { $isActive: !1 }),
128
108
  indicator: {
129
109
  position: "bottom",
130
110
  backgroundColor: "YELLOW_4",
131
111
  width: 52,
132
112
  tooltipItem: /* @__PURE__ */ r(
133
- P,
113
+ S,
134
114
  {
135
115
  $position: "absolute",
136
116
  $flexDirection: "row",
137
117
  style: { top: 6, left: 8, cursor: "pointer" },
138
- onClick: N,
139
- children: /* @__PURE__ */ r(E, { $renderAs: h, children: "NEW" })
118
+ onClick: b,
119
+ children: /* @__PURE__ */ r(T, { $renderAs: g, children: "NEW" })
140
120
  }
141
121
  ),
142
122
  tooltipYCoOrdinates: 14
@@ -144,93 +124,93 @@ const Rt = ({
144
124
  }
145
125
  },
146
126
  {
147
- originalElementToHighlightRef: l,
127
+ originalElementToHighlightRef: s,
148
128
  isActive: !1,
149
- type: u.NUDGE,
129
+ type: d.NUDGE,
150
130
  indicator: {
151
131
  nudge: "click",
152
132
  content: "",
153
133
  nudgePointerY: 20
154
134
  },
155
- elementToHighlight: /* @__PURE__ */ r(S, {})
135
+ elementToHighlight: /* @__PURE__ */ r(O, {})
156
136
  }
157
- ]), (M = d.current) == null || M.goToIndex(mt), c(e, !1, J), c(e, !0, at)) : (f(e, [
137
+ ]), (G = a.current) == null || G.goToIndex(se), l(e, !1, V), l(e, !0, de)) : (I(e, [
158
138
  {
159
- originalElementToHighlightRef: (v = d.current) == null ? void 0 : v.nextBtnRef,
139
+ originalElementToHighlightRef: (U = a.current) == null ? void 0 : U.nextBtnRef,
160
140
  isActive: !1,
161
- type: u.NUDGE,
141
+ type: d.NUDGE,
162
142
  indicator: {
163
143
  nudge: "click",
164
- content: !m && /* @__PURE__ */ r(E, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
144
+ content: !u && /* @__PURE__ */ r(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
165
145
  nudgePointerX: 0,
166
146
  nudgePointerY: 0
167
147
  },
168
148
  elementToHighlight: /* @__PURE__ */ r(
169
- et,
149
+ Q,
170
150
  {
171
151
  renderAs: "secondary",
172
- Icon: z,
173
- onClick: N,
174
- analyticsLabel: it.JOURNEY_NEXT_ACTIVITY
152
+ Icon: Z,
153
+ onClick: b,
154
+ analyticsLabel: ne.JOURNEY_NEXT_ACTIVITY
175
155
  }
176
156
  )
177
157
  }
178
- ]), (G = d.current) == null || G.goToIndex(ut), c(e, !1, J)), a(e, {
158
+ ]), (v = a.current) == null || v.goToIndex(ae), l(e, !1, V)), m(e, {
179
159
  originalElementToHighlightRef: t.current.labelRef,
180
160
  isActive: !1,
181
- type: u.TOOLTIP,
182
- elementToHighlight: /* @__PURE__ */ r(S, {}),
161
+ type: d.TOOLTIP,
162
+ elementToHighlight: /* @__PURE__ */ r(O, {}),
183
163
  indicator: {
184
164
  position: "top",
185
165
  backgroundColor: "YELLOW_4",
186
166
  width: 264,
187
- tooltipItem: /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(E, { $renderAs: h, children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
188
- tooltipXCoOrdinates: _.width / 2,
189
- tooltipYCoOrdinates: _.height + 10
167
+ tooltipItem: /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(T, { $renderAs: g, children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
168
+ tooltipXCoOrdinates: h.width / 2,
169
+ tooltipYCoOrdinates: h.height + 10
190
170
  }
191
- }), a(e, {
171
+ }), m(e, {
192
172
  originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
193
173
  isActive: !1,
194
- type: u.NUDGE,
174
+ type: d.NUDGE,
195
175
  indicator: {
196
176
  nudge: "click",
197
- content: !m && /* @__PURE__ */ r(E, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
198
- nudgePointerX: T.width / 2 + 50,
199
- nudgePointerY: T.height / 2
177
+ content: !u && /* @__PURE__ */ r(T, { $renderAs: "ab1", $color: "WHITE", children: "Pick a table to start" }),
178
+ nudgePointerX: p.width / 2 + 50,
179
+ nudgePointerY: p.height / 2
200
180
  },
201
181
  elementToHighlight: /* @__PURE__ */ r(
202
- F,
182
+ $,
203
183
  {
204
- ref: L,
184
+ ref: A,
205
185
  label: n.label,
206
186
  data: n.data,
207
187
  onPress: () => {
208
188
  },
209
- onPressTableSegment: (Z) => Y(n, Z)
189
+ onPressTableSegment: (K) => W(n, K)
210
190
  }
211
191
  )
212
192
  });
213
193
  },
214
194
  [
215
- a,
216
- d,
217
- N,
218
- Y,
219
195
  m,
196
+ a,
197
+ b,
198
+ W,
199
+ u,
220
200
  e,
221
- c,
222
- t,
223
- f,
224
- h
201
+ l,
202
+ I,
203
+ g
225
204
  ]
226
205
  );
227
- return q(() => () => {
228
- p.current.forEach((n) => clearTimeout(n)), p.current = [];
206
+ return j(() => () => {
207
+ E.current.forEach((n) => clearTimeout(n)), E.current = [];
229
208
  }, [e]), {
230
- startJourney: j
209
+ tableRef: t,
210
+ startJourney: J
231
211
  };
232
212
  };
233
213
  export {
234
- Rt as useTableLauncherJourney
214
+ He as useTableLauncherJourney
235
215
  };
236
216
  //# sourceMappingURL=use-table-launcher-journey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { getTheme } from '../../../../ui/theme/get-theme';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n originalTableRef,\n onTableSegmentClick,\n onJourneyComplete,\n onContinueNextJourney,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n endJourney(journeyId);\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n onJourneyComplete(journeyId);\n },\n [\n endJourney,\n journeyId,\n onJourneyComplete,\n onTableSegmentClick,\n originalTableRef,\n trackAnalytics,\n ],\n );\n\n const handleContinueJourney = useCallback(() => {\n handleEndJourney();\n onContinueNextJourney();\n }, [handleEndJourney, onContinueNextJourney]);\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n const segmentedCardDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={handleEndJourney}\n onGoBackFromTableLevel={handleContinueJourney}\n />\n ),\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Each table has 3 levels—clear them and earn 3 stars!\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: segmentedCardDims.width / 2,\n tooltipYCoOrdinates: 45,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [\n addCoachmark,\n handleContinueJourney,\n handleEndJourney,\n isMobile,\n journeyId,\n nextCoachmark,\n originalTableRef,\n tooltipTextRenderAs,\n ],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, originalTableRef, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs={tooltipTextRenderAs}>NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current?.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width / 2,\n tooltipYCoOrdinates: labelDims.height + 10,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n isMobile,\n journeyId,\n nextCoachmark,\n originalTableRef,\n setJourney,\n tooltipTextRenderAs,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","originalTableRef","onTableSegmentClick","onJourneyComplete","onContinueNextJourney","journeyId","JOURNEY_ID_STUDENT","device","getTheme","isMobile","tooltipTextRenderAs","highlightedTableRef","useRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleContinueJourney","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AA0CO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,uBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAE/B,EAAE,QAAAC,MAAWC,MACbC,IAAWF,MAAW,UACtBG,IAAsBD,IAAW,aAAa,YAE9CE,IAAsBC,EAAsB,IAAI,GAEhDC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAE,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,cAAAC,GAAc,YAAAC,EAAA,IAAeC,MAC1D,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAiC;;AAChC,MAAAN,EAAWd,CAAS,GAEhBoB,KACFvB,EAAoBuB,CAAY,GAElCJ,EAAeK,EAAwB,2BAA2B;AAAA,QAChE,MAAMC,EAAO;AAAA,MAAA,CACd,IAGiBC,IAAA3B,KAAA,gBAAAA,EAAA,YAAA,QAAA2B,EAAS,kBAAkB,MAC7CC,IAAA5B,KAAA,gBAAAA,EAAkB,YAAlB,QAAA4B,EAA2B,sBAC3B1B,EAAkBE,CAAS;AAAA,IAC7B;AAAA,IACA;AAAA,MACEc;AAAA,MACAd;AAAA,MACAF;AAAA,MACAD;AAAA,MACAD;AAAA,MACAoB;AAAA,IACF;AAAA,EAAA,GAGIS,IAAwBN,EAAY,MAA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,EAAc;AAAA,QACpB,WAAW;AAAA,UACT,OAAO;AAAA,UACP,SAAS,CAAC5B,KACR,gBAAA6B,EAACG,KAAK,WAAU,OAAM,QAAO,SAC1B,UACH,wBAAA,CAAA;AAAA,UAEF,eAAeN,EAAc,QAAQ,IAAI;AAAA,UACzC,eAAeA,EAAc,SAAS;AAAA,QACxC;AAAA,QACA,oBACE,gBAAAG;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAK5B;AAAA,YACL,OAAO2C,EAAW;AAAA,YAClB,MAAMA,EAAW;AAAA,YACjB,SAAS,MAAM;AAAA,YAAC;AAAA,YAChB,qBAAqB,CAAAmB,MAAa1C,EAAwBuB,GAAYmB,CAAS;AAAA,UAAA;AAAA,QACjF;AAAA,MAAA,CAEH;AAAA,IACH;AAAA,IACA;AAAA,MACEvD;AAAA,MACAlB;AAAA,MACA+C;AAAA,MACAhB;AAAA,MACAtB;AAAA,MACAJ;AAAA,MACAW;AAAA,MACAf;AAAA,MACAgB;AAAA,MACAP;AAAA,IACF;AAAA,EAAA;AAIF,SAAAgE,EAAU,MACD,MAAM;AACX,IAAA7D,EAAU,QAAQ,QAAQ,CAAS8D,MAAA,aAAaA,CAAK,CAAC,GACtD9D,EAAU,UAAU;EAAC,GAEtB,CAACR,CAAS,CAAC,GAEP;AAAA,IACL,cAAAgD;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"use-table-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.tsx"],"sourcesContent":["/* eslint-disable react-native/no-inline-styles */\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { ITableCardRef, ITableDetails } from '../../comps/tables-card/tables-card-types';\nimport type {\n ITableInfo,\n ITables,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseTableJourneyProps } from './use-table-launcher-journey-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT } from '../../../../analytics-events/platform-events-student';\nimport { JOURNEY_ID_STUDENT } from '../../../../journey/journey-id/journey-id-student';\nimport { IndicatorType } from '../../../../journey/use-journey/constants';\nimport { useJourney } from '../../../../journey/use-journey/use-journey';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport { useUIContext } from '../../../../ui/context/context';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { getTheme } from '../../../../ui/theme/get-theme';\nimport { CIRCLE_ONBOARDING_ANALYTICS_STEPS as Action } from '../../../enum/circle-onboarding-steps';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { TablesCard } from '../../comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n LESSON_CARD_INDEX,\n PUZZLE_CARD_INDEX,\n SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS,\n SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS,\n TABLE_CARD_INDEX,\n} from './constants';\nimport {\n GO_TO_TABLE_LAUNCHER_DURATION_MS,\n SHOW_CLICK_TABLE_NUDGE_AFTER_MS,\n SHOW_INITIAL_COACHMARK_AFTER_MS,\n SHOW_INITIAL_TOOLTIP_AFTER_MS,\n START_ANIMATING_CLONED_ELEM,\n} from './constants';\nimport * as S from './use-table-launcher-journey-styled';\n\nexport const useTableLauncherJourney = ({\n carouselRefs,\n onTableSegmentClick,\n onJourneyComplete,\n}: IUseTableJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY;\n\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const originalTableRef = useRef<ITableCardRef>(null);\n const highlightedTableRef = useRef<ITableCardRef>(null);\n\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, addCoachmark, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const handleEndJourney = useCallback(\n (tableDetails?: ITableDetails) => {\n endJourney(journeyId);\n // Only when User clicked on play\n if (tableDetails) {\n onTableSegmentClick(tableDetails);\n }\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED, {\n step: Action.TABLES,\n });\n\n // Reset original table card ref label\n originalTableRef?.current?.setLabelVisiblity(true);\n originalTableRef?.current?.stopLabelAnimation();\n onJourneyComplete(journeyId);\n },\n [endJourney, journeyId, onJourneyComplete, onTableSegmentClick, trackAnalytics],\n );\n\n const handleTableSegmentClick = useCallback(\n (launcherData: ITables, tableData: ITableInfo) => {\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current\n ) {\n return;\n }\n\n const segmentedCardDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n defaultTable={tableData}\n label={launcherData.label}\n data={launcherData.data}\n onPress={handleEndJourney}\n onGoBackFromTableLevel={handleEndJourney}\n />\n ),\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 236,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Each table has 3 levels—clear them and earn 3 stars!\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: segmentedCardDims.width / 2,\n tooltipYCoOrdinates: 45,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Pick a level\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height * 0.4,\n } as INudgeProps,\n elementToHighlight: <></>,\n });\n\n nextCoachmark(journeyId, false, SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS); // Show coachmark => Each table has 3... and Hide the previous two\n nextCoachmark(journeyId, true, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS); // Show nudge => Pick a level\n\n const startAnimationOnLabelAgain = setTimeout(() => {\n clearTimeout(startAnimationOnLabelAgain);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(startAnimationOnLabelAgain);\n },\n [addCoachmark, handleEndJourney, isMobile, journeyId, nextCoachmark, tooltipTextRenderAs],\n );\n\n const goToTableLauncher = useCallback(() => {\n playButtonSound();\n carouselRefs.current?.goToIndex(TABLE_CARD_INDEX);\n nextCoachmark(journeyId, false, GO_TO_TABLE_LAUNCHER_DURATION_MS);\n\n trackAnalytics(PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED, {\n step: Action.TABLES,\n });\n\n const showNudge = setTimeout(() => {\n clearTimeout(showNudge);\n originalTableRef.current?.setLabelVisiblity(false);\n nextCoachmark(journeyId, true);\n }, SHOW_CLICK_TABLE_NUDGE_AFTER_MS);\n\n timerRefs.current.push(showNudge);\n\n const animateLabel = setTimeout(() => {\n clearTimeout(animateLabel);\n highlightedTableRef.current?.startLabelAnimation('YELLOW_4');\n }, START_ANIMATING_CLONED_ELEM);\n\n timerRefs.current.push(animateLabel);\n }, [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackAnalytics]);\n\n const startJourney = useCallback(\n (tablesData: ITables, isTutorialOnboardingDone: boolean = false) => {\n const paginationList = carouselRefs.current?.indicatorRefs;\n const carouselNextBtnRef = carouselRefs.current?.nextBtnRef;\n const tablePaginationRef = paginationList?.[TABLE_CARD_INDEX];\n\n if (\n !originalTableRef.current?.segmentedCardWrapperRef.current ||\n !originalTableRef.current?.labelRef.current ||\n !paginationList ||\n !carouselNextBtnRef?.current ||\n !tablePaginationRef ||\n !tablePaginationRef.current\n ) {\n return;\n }\n\n const labelDims = originalTableRef.current.labelRef.current.getBoundingClientRect();\n const tableCardDims =\n originalTableRef.current?.segmentedCardWrapperRef.current.getBoundingClientRect();\n\n // TAKE THE USER TO THE TABLE CARD\n if (!isTutorialOnboardingDone) {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={goToTableLauncher}\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n },\n ]);\n carouselRefs.current?.goToIndex(PUZZLE_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show nudge => Click to proceed\n } else {\n setJourney(journeyId, [\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <S.Indicator $isActive={false} />,\n indicator: {\n position: 'bottom',\n backgroundColor: 'YELLOW_4',\n width: 52,\n tooltipItem: (\n <FlexView\n $position=\"absolute\"\n $flexDirection=\"row\"\n style={{ top: 6, left: 8, cursor: 'pointer' }}\n onClick={goToTableLauncher}\n >\n <Text $renderAs={tooltipTextRenderAs}>NEW</Text>\n </FlexView>\n ),\n tooltipYCoOrdinates: 14, // Need some offset in Y direction from top\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: tablePaginationRef as React.RefObject<HTMLDivElement>,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: '',\n nudgePointerY: 20,\n } as INudgeProps,\n elementToHighlight: <></>,\n },\n ]);\n carouselRefs.current?.goToIndex(LESSON_CARD_INDEX);\n nextCoachmark(journeyId, false, SHOW_INITIAL_COACHMARK_AFTER_MS); // Show Coachmark => NEW\n nextCoachmark(journeyId, true, SHOW_INITIAL_TOOLTIP_AFTER_MS); // Show Nudge over Coachmark\n }\n\n // SHOW THE USER SELECT A TABLE\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'YELLOW_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster at multiplication! Practice everyday and become a Tables champ.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: labelDims.width / 2,\n tooltipYCoOrdinates: labelDims.height + 10,\n } as IArrowTooltipProps,\n });\n\n addCoachmark(journeyId, {\n originalElementToHighlightRef: originalTableRef.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n {'Pick a table to start'}\n </Text>\n ),\n nudgePointerX: tableCardDims.width / 2 + 50,\n nudgePointerY: tableCardDims.height / 2,\n } as INudgeProps,\n elementToHighlight: (\n <TablesCard\n ref={highlightedTableRef}\n label={tablesData.label}\n data={tablesData.data}\n onPress={() => {}}\n onPressTableSegment={tableInfo => handleTableSegmentClick(tablesData, tableInfo)}\n />\n ),\n });\n },\n [\n addCoachmark,\n carouselRefs,\n goToTableLauncher,\n handleTableSegmentClick,\n isMobile,\n journeyId,\n nextCoachmark,\n setJourney,\n tooltipTextRenderAs,\n ],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [journeyId]);\n\n return {\n tableRef: originalTableRef,\n startJourney,\n };\n};\n"],"names":["useTableLauncherJourney","carouselRefs","onTableSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","device","getTheme","isMobile","tooltipTextRenderAs","originalTableRef","useRef","highlightedTableRef","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","addCoachmark","endJourney","useJourney","trackAnalytics","useUIContext","handleEndJourney","useCallback","tableDetails","PLATFORM_EVENTS_STUDENT","Action","_a","_b","handleTableSegmentClick","launcherData","tableData","segmentedCardDims","tableCardDims","_c","IndicatorType","jsx","TablesCard","FlexView","Text","Fragment","SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS","SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS","startAnimationOnLabelAgain","START_ANIMATING_CLONED_ELEM","goToTableLauncher","TABLE_CARD_INDEX","GO_TO_TABLE_LAUNCHER_DURATION_MS","showNudge","SHOW_CLICK_TABLE_NUDGE_AFTER_MS","animateLabel","startJourney","tablesData","isTutorialOnboardingDone","paginationList","carouselNextBtnRef","tablePaginationRef","_d","labelDims","_e","S.Indicator","_h","LESSON_CARD_INDEX","SHOW_INITIAL_COACHMARK_AFTER_MS","SHOW_INITIAL_TOOLTIP_AFTER_MS","_f","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","_g","PUZZLE_CARD_INDEX","tableInfo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AA0CO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAYC,EAAmB,6BAE/B,EAAE,QAAAC,MAAWC,MACbC,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AAA5D,EAAU,QAAQ,QAAQ,CAAS6D,MAAA,aAAaA,CAAK,CAAC,GACtD7D,EAAU,UAAU;EAAC,GAEtB,CAACT,CAAS,CAAC,GAEP;AAAA,IACL,UAAUM;AAAA,IACV,cAAA0C;AAAA,EAAA;AAEJ;"}
@@ -1,19 +1,19 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { useState as c, useCallback as F, useEffect as K } from "react";
2
+ import { useState as c, useCallback as K, useEffect as M } from "react";
3
3
  import { ILLUSTRATIONS as J } from "../../../assets/illustrations/illustrations.js";
4
4
  import { LOTTIE as E } from "../../../assets/lottie/lottie.js";
5
5
  import { CircularLoader as Q } from "../../ui/loader/circular-loader/circular-loader.js";
6
- import M from "../../ui/text/text.js";
6
+ import k from "../../ui/text/text.js";
7
7
  import { useCircleSounds as V } from "../hooks/use-circle-sounds/use-circle-sounds.js";
8
- import { Banner as I } from "./comps/banner/banner.js";
8
+ import { Banner as d } from "./comps/banner/banner.js";
9
9
  import { LeaderboardItemWithObserver as X } from "./comps/leaderboard-item/leaderboard-item.js";
10
10
  import { NavigationButton as Z } from "./comps/navigation-button/navigation-button.js";
11
11
  import { StreakReductionInfoBar as D } from "./comps/streak-reduction-infobar/streak-reduction-infobar.js";
12
12
  import { Timer as ee } from "./comps/timer/timer.js";
13
13
  import { ELeaderboardType as t } from "./enums/leaderboard-type-enum.js";
14
- import { useTimer as te } from "./hooks/use-timer/use-timer.js";
15
- import { Leaderboard as re, LeaderboardContainer as ne, BannerWrapper as oe, TournamentBannerCustContainer as ie, TrophyWrapper as se, ItemsWrapper as k, Banner as me, ActionButtonWrapper as Te } from "./leaderboard-styled.js";
16
- const d = {
14
+ import { useTimer as re } from "./hooks/use-timer/use-timer.js";
15
+ import { Leaderboard as te, LeaderboardContainer as ne, BannerWrapper as oe, TournamentBannerCustContainer as ie, TrophyWrapper as se, ItemsWrapper as F, Banner as me, ActionButtonWrapper as Te } from "./leaderboard-styled.js";
16
+ const I = {
17
17
  [t.ALL_TIME_STREAK]: E.ELITE_CIRCLE,
18
18
  [t.ALL_TIME]: E.ELITE_CIRCLE,
19
19
  [t.BI_WEEKLY]: E.TOURNAMENT_RIPPLE,
@@ -31,33 +31,33 @@ const d = {
31
31
  {
32
32
  name: "ALL TIME",
33
33
  type: t.ALL_TIME
34
- },
35
- {
36
- name: "TABLE INFINITY",
37
- type: t.INFINITE_TABLE
38
34
  }
35
+ // {
36
+ // name: 'TABLE INFINITY',
37
+ // type: ELeaderboardType.INFINITE_TABLE,
38
+ // },
39
39
  ], Se = ({
40
40
  leaderboardData: m,
41
- type: l = t.BI_WEEKLY,
41
+ type: L = t.BI_WEEKLY,
42
42
  userId: Y,
43
43
  onClose: O,
44
44
  isLoading: T,
45
45
  streakInfo: h
46
46
  }) => {
47
- var y, f, R, S, B, x, C, N, g, P;
47
+ var y, A, R, S, x, B, C, g, P, b;
48
48
  const [s, u] = c(() => {
49
- const r = o.findIndex((i) => i.type === l);
49
+ const r = o.findIndex((i) => i.type === L);
50
50
  return r !== -1 ? r : 0;
51
- }), [n, $] = c(((y = m == null ? void 0 : m[l]) == null ? void 0 : y.leaderboardPlayers) || []), [_, H] = c({ current: 0, end: 0 }), [v, A] = te(0), [L, w] = c(!1), U = (f = n == null ? void 0 : n[0]) == null ? void 0 : f.points, j = (R = n == null ? void 0 : n[0]) == null ? void 0 : R.highScore, q = ((S = n == null ? void 0 : n[0]) == null ? void 0 : S.streakDays) || 0, { playButtonSound: p } = V(), z = F(() => {
51
+ }), [n, $] = c(((y = m == null ? void 0 : m[L]) == null ? void 0 : y.leaderboardPlayers) || []), [_, H] = c({ current: 0, end: 0 }), [v, f] = re(0), [l, w] = c(!1), U = (A = n == null ? void 0 : n[0]) == null ? void 0 : A.points, j = (R = n == null ? void 0 : n[0]) == null ? void 0 : R.highScore, q = ((S = n == null ? void 0 : n[0]) == null ? void 0 : S.streakDays) || 0, { playButtonSound: p } = V(), z = K(() => {
52
52
  p(), u((r) => r - 1 < 0 ? o.length - 1 : r - 1);
53
- }, [p]), G = F(() => {
53
+ }, [p]), G = K(() => {
54
54
  p(), u((r) => r + 1 === o.length ? 0 : r + 1);
55
55
  }, [p]);
56
- return K(() => {
57
- A(0);
58
- }, [A]), K(() => {
59
- var b;
60
- const r = (b = o[s]) == null ? void 0 : b.type, i = r && (m == null ? void 0 : m[r]);
56
+ return M(() => {
57
+ f(0);
58
+ }, [f]), M(() => {
59
+ var N;
60
+ const r = (N = o[s]) == null ? void 0 : N.type, i = r && (m == null ? void 0 : m[r]);
61
61
  if (i) {
62
62
  const W = i.leaderboardPlayers || [];
63
63
  r === t.BI_WEEKLY && (H({
@@ -65,16 +65,16 @@ const d = {
65
65
  end: i.endTimestamp
66
66
  }), i.currentTimestamp > i.endTimestamp && (W.splice(10), w(!0))), $([...W]);
67
67
  }
68
- }, [s, m]), /* @__PURE__ */ e(re, { children: /* @__PURE__ */ a(ne, { children: [
68
+ }, [s, m]), /* @__PURE__ */ e(te, { children: /* @__PURE__ */ a(ne, { children: [
69
69
  /* @__PURE__ */ a(oe, { children: [
70
- ((B = o[s]) == null ? void 0 : B.type) === t.BI_WEEKLY && /* @__PURE__ */ e(
71
- I,
70
+ ((x = o[s]) == null ? void 0 : x.type) === t.BI_WEEKLY && /* @__PURE__ */ e(
71
+ d,
72
72
  {
73
73
  isLoading: T || n.length === 0,
74
74
  bgFromTopPosition: -120,
75
75
  bgFromRightPosition: -110,
76
- primaryText: L ? /* @__PURE__ */ e("span", { children: "New Tournament" }) : /* @__PURE__ */ e("span", { children: "Tournament" }),
77
- secondaryText: L ? /* @__PURE__ */ e("span", { children: "Starts Soon" }) : /* @__PURE__ */ a("span", { children: [
76
+ primaryText: l ? /* @__PURE__ */ e("span", { children: "New Tournament" }) : /* @__PURE__ */ e("span", { children: "Tournament" }),
77
+ secondaryText: l ? /* @__PURE__ */ e("span", { children: "Starts Soon" }) : /* @__PURE__ */ a("span", { children: [
78
78
  " ",
79
79
  /* @__PURE__ */ e(
80
80
  ee,
@@ -86,54 +86,54 @@ const d = {
86
86
  " ",
87
87
  "left"
88
88
  ] }),
89
- lottiePath: d[t.BI_WEEKLY],
89
+ lottiePath: I[t.BI_WEEKLY],
90
90
  custEle: /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e("img", { src: J.TROPHY_CIRCLE }) }) })
91
91
  }
92
92
  ),
93
- ((x = o[s]) == null ? void 0 : x.type) === t.ALL_TIME_STREAK && /* @__PURE__ */ e(
94
- I,
93
+ ((B = o[s]) == null ? void 0 : B.type) === t.ALL_TIME_STREAK && /* @__PURE__ */ e(
94
+ d,
95
95
  {
96
96
  isLoading: T,
97
97
  bgFromTopPosition: -140,
98
98
  bgFromRightPosition: -90,
99
99
  primaryText: /* @__PURE__ */ e("span", { children: "Streak Stars" }),
100
100
  secondaryText: /* @__PURE__ */ e("span", { children: "Top 50" }),
101
- lottiePath: d[t.ALL_TIME_STREAK]
101
+ lottiePath: I[t.ALL_TIME_STREAK]
102
102
  }
103
103
  ),
104
104
  ((C = o[s]) == null ? void 0 : C.type) === t.ALL_TIME && /* @__PURE__ */ e(
105
- I,
105
+ d,
106
106
  {
107
107
  isLoading: T,
108
108
  bgFromTopPosition: -140,
109
109
  bgFromRightPosition: -90,
110
110
  primaryText: /* @__PURE__ */ e("span", { children: "Elite Circle" }),
111
111
  secondaryText: /* @__PURE__ */ e("span", { children: "Top 50" }),
112
- lottiePath: d[t.ALL_TIME]
112
+ lottiePath: I[t.ALL_TIME]
113
113
  }
114
114
  ),
115
- ((N = o[s]) == null ? void 0 : N.type) === t.INFINITE_TABLE && /* @__PURE__ */ e(
116
- I,
115
+ ((g = o[s]) == null ? void 0 : g.type) === t.INFINITE_TABLE && /* @__PURE__ */ e(
116
+ d,
117
117
  {
118
118
  isLoading: T,
119
119
  bgFromTopPosition: -140,
120
120
  bgFromRightPosition: -90,
121
121
  primaryText: "Table Infinity",
122
122
  secondaryText: "Top 50",
123
- lottiePath: d[t.INFINITE_TABLE]
123
+ lottiePath: I[t.INFINITE_TABLE]
124
124
  }
125
125
  )
126
126
  ] }),
127
127
  T && /* @__PURE__ */ e(Q, {}),
128
- !T && n && n.length > 0 ? /* @__PURE__ */ a(k, { children: [
129
- ((g = o[s]) == null ? void 0 : g.type) === t.ALL_TIME_STREAK && /* @__PURE__ */ e(
128
+ !T && n && n.length > 0 ? /* @__PURE__ */ a(F, { children: [
129
+ ((P = o[s]) == null ? void 0 : P.type) === t.ALL_TIME_STREAK && /* @__PURE__ */ e(
130
130
  D,
131
131
  {
132
132
  startTimestampToday: h.startTimestampToday,
133
133
  streakReduction: h.streakReduction
134
134
  }
135
135
  ),
136
- L && ((P = o[s]) == null ? void 0 : P.type) === t.BI_WEEKLY && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(M, { $renderAs: "ab3", $color: "WHITE", children: "Congratulating winners of the last tournament!" }) }),
136
+ l && ((b = o[s]) == null ? void 0 : b.type) === t.BI_WEEKLY && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(k, { $renderAs: "ab3", $color: "WHITE", children: "Congratulating winners of the last tournament!" }) }),
137
137
  n.map((r) => {
138
138
  var i;
139
139
  return /* @__PURE__ */ e(
@@ -150,7 +150,7 @@ const d = {
150
150
  r.rank
151
151
  );
152
152
  })
153
- ] }) : /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(M, { $renderAs: "ab3", $color: "WHITE", children: "No content available" }) }),
153
+ ] }) : /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(k, { $renderAs: "ab3", $color: "WHITE", children: "No content available" }) }),
154
154
  /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
155
155
  Z,
156
156
  {