@cuemath/leap 2.8.61-rj-24 → 2.8.61-rj-XX

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.
@@ -1,79 +1,79 @@
1
- import { jsx as t, Fragment as y } from "react/jsx-runtime";
2
- import { useRef as T, useCallback as E, useMemo as le, useEffect as ce } from "react";
1
+ import { jsx as t, Fragment as O } from "react/jsx-runtime";
2
+ import { useRef as A, useCallback as T, useMemo as le, useEffect as ce } from "react";
3
3
  import z from "../../../../../assets/line-icons/icons/carat-right.js";
4
4
  import { PLATFORM_EVENTS_STUDENT as ee } from "../../../../analytics-events/platform-events-student.js";
5
5
  import { JOURNEY_ID_STUDENT as ae } from "../../../../journey/journey-id/journey-id-student.js";
6
6
  import { IndicatorType as c } from "../../../../journey/use-journey/constants.js";
7
7
  import { useJourney as de } from "../../../../journey/use-journey/use-journey.js";
8
8
  import te from "../../../../ui/buttons/icon-button/icon-button.js";
9
- import { useUIContext as se } from "../../../../ui/context/context.js";
9
+ import { useUIContext as he } from "../../../../ui/context/context.js";
10
10
  import L from "../../../../ui/layout/flex-view.js";
11
11
  import a from "../../../../ui/text/text.js";
12
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as p } from "../../../enum/circle-onboarding-steps.js";
13
- import { useCircleSounds as ue } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
- import { SegmentedGameCard as he } from "../../comps/segmented-game-card/segmented-game-card.js";
12
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as E } from "../../../enum/circle-onboarding-steps.js";
13
+ import { useCircleSounds as se } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
+ import { SegmentedGameCard as me } from "../../comps/segmented-game-card/segmented-game-card.js";
15
15
  import { GAME_LAUNCHER_ANALYTICS_EVENTS as re } from "../../game-launcher-analytics-events.js";
16
- import { GO_TO_NEXT_SLIDE_AFTER_MS as me, SHOW_LABEL_HIGHLIGHT_AFTER_MS as ge, SHOW_NUDGE_AFTER_MS as Te, SLIDE_TO_LESSON_MS as Ee } from "./constants.js";
16
+ import { GO_TO_NEXT_SLIDE_AFTER_MS as ue, SHOW_LABEL_HIGHLIGHT_AFTER_MS as ge, SHOW_NUDGE_AFTER_MS as Te, SLIDE_TO_LESSON_MS as Ee } from "./constants.js";
17
17
  import { ProjectType as pe } from "../../../games/web-view/enums/project-type-enum.js";
18
18
  const ke = ({
19
- carouselRef: n,
20
- onSegmentClick: R
19
+ carouselRefs: n,
20
+ onSegmentClick: R,
21
+ onJourneyComplete: y
21
22
  }) => {
22
- const i = ae.CIRCLE_ACTIVITIES_INTRO_JOURNEY, o = T(null), r = T(null), l = T(null), I = T([]), O = T(!1), { playButtonSound: S } = ue(), { nextCoachmark: d, setJourney: N, endJourney: b } = de(), { onEvent: _ } = se(), P = E(
23
+ const i = ae.CIRCLE_ACTIVITIES_INTRO_JOURNEY, o = A(null), r = A(null), l = A(null), p = A([]), { playButtonSound: S } = se(), { nextCoachmark: d, setJourney: N, endJourney: b } = de(), { onEvent: I } = he(), P = T(
23
24
  (e) => {
24
- _(ee.ONBOARDING_STEP_VIEWED, {
25
+ I(ee.ONBOARDING_STEP_VIEWED, {
25
26
  step: e
26
27
  });
27
28
  },
28
- [_]
29
- ), H = E(
29
+ [I]
30
+ ), H = T(
30
31
  (e) => {
31
- _(ee.ONBOARDING_STEP_COMPLETED, {
32
+ I(ee.ONBOARDING_STEP_COMPLETED, {
32
33
  step: e
33
34
  });
34
35
  },
35
- [_]
36
- ), s = E(
37
- (e, f, C, A = !1) => {
38
- var h, m;
39
- A || (S(), (m = n.current) == null || m.goToIndex(((h = n.current) == null ? void 0 : h.currentIndex) + 1), d(i, !1, me)), P(e);
40
- const u = setTimeout(() => {
41
- clearTimeout(u), f.startLabelAnimation(C);
36
+ [I]
37
+ ), h = T(
38
+ (e, _, C, f = !1) => {
39
+ var m, u;
40
+ f || (S(), (u = n.current) == null || u.goToIndex(((m = n.current) == null ? void 0 : m.currentIndex) + 1), d(i, !1, ue)), P(e);
41
+ const s = setTimeout(() => {
42
+ clearTimeout(s), _.startLabelAnimation(C);
42
43
  }, ge);
43
- I.current.push(u), d(i, !0, Te);
44
+ p.current.push(s), d(i, !0, Te);
44
45
  },
45
46
  [n, i, d, S, P]
46
- ), G = E(
47
+ ), G = T(
47
48
  (e) => {
48
- R(e, pe.PUZZLE), H(p.PUZZLE_ACTIVITY), b(i);
49
+ R(e, pe.PUZZLE), H(E.PUZZLE_ACTIVITY), b(i), y(i);
49
50
  },
50
- [b, i, R, H]
51
- ), U = E(
52
- (e, f) => {
53
- var k, w, v, B, V, x, D, J, M, W, X, $, F, Z, j, K, q, Q;
54
- if (O.current || !((k = n == null ? void 0 : n.current) != null && k.nextBtnRef.current) || !((w = r == null ? void 0 : r.current) != null && w.segmentedCardWrapperRef.current) || !((v = o == null ? void 0 : o.current) != null && v.labelRef.current) || !((B = r == null ? void 0 : r.current) != null && B.labelRef.current) || !e)
51
+ [b, i, y, R, H]
52
+ ), U = T(
53
+ (e, _) => {
54
+ var k, w, v, B, V, x, D, M, J, W, X, $, F, Z, j, K, q, Q;
55
+ if (!((k = n == null ? void 0 : n.current) != null && k.nextBtnRef.current) || !((w = r == null ? void 0 : r.current) != null && w.segmentedCardWrapperRef.current) || !((v = o == null ? void 0 : o.current) != null && v.labelRef.current) || !((B = r == null ? void 0 : r.current) != null && B.labelRef.current) || !e)
55
56
  return;
56
- O.current = !0;
57
57
  const C = ((D = (x = (V = l.current) == null ? void 0 : V.labelRef) == null ? void 0 : x.current) == null ? void 0 : D.getBoundingClientRect()) || {
58
58
  height: 0,
59
59
  width: 0
60
- }, A = ((W = (M = (J = o.current) == null ? void 0 : J.labelRef) == null ? void 0 : M.current) == null ? void 0 : W.getBoundingClientRect()) || {
60
+ }, f = ((W = (J = (M = o.current) == null ? void 0 : M.labelRef) == null ? void 0 : J.current) == null ? void 0 : W.getBoundingClientRect()) || {
61
61
  height: 0,
62
62
  width: 0
63
- }, u = ((F = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : F.getBoundingClientRect()) || {
63
+ }, s = ((F = ($ = (X = r.current) == null ? void 0 : X.labelRef) == null ? void 0 : $.current) == null ? void 0 : F.getBoundingClientRect()) || {
64
64
  height: 0,
65
65
  width: 0
66
- }, h = ((K = (j = (Z = r.current) == null ? void 0 : Z.segmentedCardWrapperRef) == null ? void 0 : j.current) == null ? void 0 : K.getBoundingClientRect()) || {
66
+ }, m = ((K = (j = (Z = r.current) == null ? void 0 : Z.segmentedCardWrapperRef) == null ? void 0 : j.current) == null ? void 0 : K.getBoundingClientRect()) || {
67
67
  height: 0,
68
68
  width: 0
69
69
  };
70
- let m = [];
71
- f && l.current && (m = [
70
+ let u = [];
71
+ _ && l.current && (u = [
72
72
  {
73
73
  originalElementToHighlightRef: l.current.labelRef,
74
74
  isActive: !1,
75
75
  type: c.TOOLTIP,
76
- elementToHighlight: /* @__PURE__ */ t(y, {}),
76
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
77
77
  indicator: {
78
78
  position: "right",
79
79
  backgroundColor: "BLUE_4",
@@ -92,8 +92,8 @@ const ke = ({
92
92
  {
93
93
  renderAs: "secondary",
94
94
  Icon: z,
95
- onClick: () => s(
96
- p.GAMES_ACTIVITY,
95
+ onClick: () => h(
96
+ E.GAMES_ACTIVITY,
97
97
  o.current,
98
98
  "ORANGE_4"
99
99
  ),
@@ -113,14 +113,14 @@ const ke = ({
113
113
  originalElementToHighlightRef: o.current.labelRef,
114
114
  isActive: !1,
115
115
  type: c.TOOLTIP,
116
- elementToHighlight: /* @__PURE__ */ t(y, {}),
116
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
117
117
  indicator: {
118
118
  position: "right",
119
119
  backgroundColor: "ORANGE_4",
120
120
  width: 264,
121
121
  tooltipItem: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(a, { $renderAs: "ab2-bold", children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
122
- tooltipXCoOrdinates: A.width + 50,
123
- tooltipYCoOrdinates: A.height / 2
122
+ tooltipXCoOrdinates: f.width + 50,
123
+ tooltipYCoOrdinates: f.height / 2
124
124
  }
125
125
  },
126
126
  {
@@ -132,8 +132,8 @@ const ke = ({
132
132
  {
133
133
  renderAs: "secondary",
134
134
  Icon: z,
135
- onClick: () => s(
136
- p.PUZZLE_ACTIVITY,
135
+ onClick: () => h(
136
+ E.PUZZLE_ACTIVITY,
137
137
  r.current,
138
138
  "PURPLE_4"
139
139
  ),
@@ -152,14 +152,14 @@ const ke = ({
152
152
  originalElementToHighlightRef: r.current.labelRef,
153
153
  isActive: !1,
154
154
  type: c.TOOLTIP,
155
- elementToHighlight: /* @__PURE__ */ t(y, {}),
155
+ elementToHighlight: /* @__PURE__ */ t(O, {}),
156
156
  indicator: {
157
157
  position: "right",
158
158
  backgroundColor: "PURPLE_4",
159
159
  width: 264,
160
160
  tooltipItem: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(a, { $renderAs: "ab2-bold", children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
161
- tooltipXCoOrdinates: u.width + 50,
162
- tooltipYCoOrdinates: u.height / 2
161
+ tooltipXCoOrdinates: s.width + 50,
162
+ tooltipYCoOrdinates: s.height / 2
163
163
  }
164
164
  },
165
165
  {
@@ -167,7 +167,7 @@ const ke = ({
167
167
  isActive: !1,
168
168
  type: c.NUDGE,
169
169
  elementToHighlight: /* @__PURE__ */ t(
170
- he,
170
+ me,
171
171
  {
172
172
  label: "",
173
173
  value: e.data.filter((g) => g.solved).length,
@@ -185,18 +185,18 @@ const ke = ({
185
185
  indicator: {
186
186
  nudge: "click",
187
187
  content: /* @__PURE__ */ t(a, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
188
- nudgePointerX: h.width * 0.6,
189
- nudgePointerY: h.height * 0.4
188
+ nudgePointerX: m.width * 0.6,
189
+ nudgePointerY: m.height * 0.4
190
190
  }
191
191
  }
192
192
  ];
193
- N(i, [...m, ...ie, ...oe]), (Q = n.current) == null || Q.goToIndex(0);
193
+ N(i, [...u, ...ie, ...oe]), (Q = n.current) == null || Q.goToIndex(0);
194
194
  const Y = setTimeout(() => {
195
195
  clearTimeout(Y), d(i);
196
196
  }, Ee);
197
- I.current.push(Y), f && l.current ? s(p.SKILL_ACTIVITY, l.current, "BLUE_4", !0) : s(p.GAMES_ACTIVITY, o.current, "ORANGE_4", !0);
197
+ p.current.push(Y), _ && l.current ? h(E.SKILL_ACTIVITY, l.current, "BLUE_4", !0) : h(E.GAMES_ACTIVITY, o.current, "ORANGE_4", !0);
198
198
  },
199
- [n, N, i, s, G, d]
199
+ [n, N, i, h, G, d]
200
200
  ), ne = le(
201
201
  () => ({
202
202
  gameRefs: o,
@@ -207,7 +207,7 @@ const ke = ({
207
207
  [U]
208
208
  );
209
209
  return ce(() => () => {
210
- I.current.forEach((e) => clearTimeout(e)), I.current = [], O.current = !1;
210
+ p.current.forEach((e) => clearTimeout(e)), p.current = [];
211
211
  }, [n]), ne;
212
212
  };
213
213
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { ICoachmarkProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } 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 { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRef,\n onSegmentClick,\n}: IUseGameLauncherJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY;\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const isJourneyInProgress = useRef(false);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRef.current?.goToIndex(carouselRef.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRef, journeyId, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourney = useCallback(\n (puzzlesData: Puzzle) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n },\n [endJourney, journeyId, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean) => {\n if (isJourneyInProgress.current) {\n return;\n }\n\n // If element refs are not available return, this is just for type safety\n if (\n !carouselRef?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n isJourneyInProgress.current = true;\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width + 50,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRef.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width + 50,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRef.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width + 50,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourney(puzzle),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n carouselRef.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current, 'ORANGE_4', true);\n }\n },\n [carouselRef, setJourney, journeyId, goToNextCard, handleEndJourney, nextCoachmark],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n isJourneyInProgress.current = false;\n };\n }, [carouselRef]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRef","onSegmentClick","journeyId","JOURNEY_ID_STUDENT","gameRefs","useRef","puzzleRefs","lessonRefs","timerRefs","isJourneyInProgress","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourney","puzzlesData","ProjectType","ActionEvent","startJourney","isLessonAvailable","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAkCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAoC;AAClC,QAAMC,IAAYC,GAAmB,iCAC/BC,IAAWC,EAA+B,IAAI,GAC9CC,IAAaD,EAA+B,IAAI,GAChDE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtDI,IAAsBJ,EAAO,EAAK,GAElC,EAAE,iBAAAK,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,GAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAEXM,IAAsBH;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXO,IAAeJ;AAAA,IACnB,CACEK,GACAC,GACAC,GACAC,IAAwB,OACrB;;AACH,MAAKA,MACajB,MAChBkB,IAAA5B,EAAY,YAAZ,QAAA4B,EAAqB,YAAUC,IAAA7B,EAAY,YAAZ,gBAAA6B,EAAqB,gBAAe,IACrDjB,EAAAV,GAAW,IAAO4B,EAAyB,I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AAac,EAAY,gBAAgB9B,EAAW,SAAS,UAAU,EAAI,IAE3EgB,EAAac,EAAY,gBAAgBjC,EAAS,SAAS,YAAY,EAAI;AAAA,IAE/E;AAAA,IACA,CAACJ,GAAaa,GAAYX,GAAWqB,GAAcW,GAAkBtB,CAAa;AAAA,EAAA,GAG9E+D,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAAxE;AAAA,MACA,YAAAE;AAAA,MACA,YAAAC;AAAA,MACA,cAAA+B;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAuC,GAAU,MACD,MAAM;AACX,IAAArE,EAAU,QAAQ,QAAQ,CAASsE,MAAA,aAAaA,CAAK,CAAC,GACtDtE,EAAU,UAAU,IACpBC,EAAoB,UAAU;AAAA,EAAA,GAE/B,CAACT,CAAW,CAAC,GAET2E;AACT;"}
1
+ {"version":3,"file":"use-game-launcher-journey.js","sources":["../../../../../../src/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.tsx"],"sourcesContent":["import type { ICoachmarkProps } from '../../../../journey/use-journey/journey-context-types';\nimport type { IArrowTooltipProps } from '../../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../../ui/nudge/nudge-types';\nimport type { TColorNames } from '../../../../ui/types';\nimport type { ISegmentedGameCardRefs } from '../../comps/segmented-game-card/segmented-game-card-types';\nimport type {\n IProject,\n Puzzle,\n} from '../../dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IUseGameLauncherJourneyProps } from './use-game-launcher-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport { PLATFORM_EVENTS_STUDENT as AnalyticsLabel } 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 { CIRCLE_ONBOARDING_ANALYTICS_STEPS as ActionEvent } from '../../../enum/circle-onboarding-steps';\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useCircleSounds } from '../../../hooks/use-circle-sounds/use-circle-sounds';\nimport { SegmentedGameCard } from '../../comps/segmented-game-card/segmented-game-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from '../../game-launcher-analytics-events';\nimport {\n GO_TO_NEXT_SLIDE_AFTER_MS,\n SHOW_LABEL_HIGHLIGHT_AFTER_MS,\n SHOW_NUDGE_AFTER_MS,\n SLIDE_TO_LESSON_MS,\n} from './constants';\n\nexport const useGameLauncherJourney = ({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n}: IUseGameLauncherJourneyProps) => {\n const journeyId = JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY;\n\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = useRef<ISegmentedGameCardRefs>(null);\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { playButtonSound } = useCircleSounds();\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n const { onEvent: trackAnalytics } = useUIContext();\n\n const trackEventViewed = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_VIEWED, {\n step,\n });\n },\n [trackAnalytics],\n );\n const trackEventCompleted = useCallback(\n (step: ActionEvent) => {\n trackAnalytics(AnalyticsLabel.ONBOARDING_STEP_COMPLETED, {\n step,\n });\n },\n [trackAnalytics],\n );\n\n const goToNextCard = useCallback(\n (\n analyticsLabelViewed: ActionEvent,\n refOfNextSlide: ISegmentedGameCardRefs,\n color: TColorNames,\n isFirstSlide: boolean = false,\n ) => {\n if (!isFirstSlide) {\n playButtonSound();\n carouselRefs.current?.goToIndex(carouselRefs.current?.currentIndex + 1);\n nextCoachmark(journeyId, false, GO_TO_NEXT_SLIDE_AFTER_MS);\n }\n\n trackEventViewed(analyticsLabelViewed);\n\n const animateLabelTimer = setTimeout(() => {\n clearTimeout(animateLabelTimer);\n refOfNextSlide.startLabelAnimation(color);\n }, SHOW_LABEL_HIGHLIGHT_AFTER_MS);\n\n timerRefs.current.push(animateLabelTimer); // Store to cleanup later\n\n nextCoachmark(journeyId, true, SHOW_NUDGE_AFTER_MS);\n },\n [carouselRefs, journeyId, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourney = useCallback(\n (puzzlesData: Puzzle) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, journeyId, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (puzzlesData: IProject<Puzzle>, isLessonAvailable: boolean) => {\n // If element refs are not available return, this is just for type safety\n if (\n !carouselRefs?.current?.nextBtnRef.current ||\n !puzzleRefs?.current?.segmentedCardWrapperRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const gameLabelDims = gameRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n const puzzleLabelDims = puzzleRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n const launcherDims =\n puzzleRefs.current?.segmentedCardWrapperRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\n\n let lessonSteps: ICoachmarkProps[] = [];\n\n if (isLessonAvailable && lessonRefs.current) {\n lessonSteps = [\n {\n originalElementToHighlightRef: lessonRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'BLUE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width + 50,\n tooltipYCoOrdinates: lessonLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current?.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.GAMES_ACTIVITY,\n gameRefs.current as ISegmentedGameCardRefs,\n 'ORANGE_4',\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n }\n\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'ORANGE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width + 50,\n tooltipYCoOrdinates: gameLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: carouselRefs.current.nextBtnRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={() =>\n goToNextCard(\n ActionEvent.PUZZLE_ACTIVITY,\n puzzleRefs.current as ISegmentedGameCardRefs,\n 'PURPLE_4',\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to proceed\n </Text>\n ),\n nudgePointerX: 0,\n nudgePointerY: 0,\n } as INudgeProps,\n },\n ];\n\n const puzzleSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'right',\n backgroundColor: 'PURPLE_4',\n width: 264,\n tooltipItem: (\n <FlexView>\n <Text $renderAs=\"ab2-bold\">\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width + 50,\n tooltipYCoOrdinates: puzzleLabelDims.height / 2,\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: puzzleRefs.current.segmentedCardWrapperRef,\n isActive: false,\n type: IndicatorType.NUDGE,\n elementToHighlight: (\n <SegmentedGameCard\n label={''} // This is intentionally left blank to avoid showing the label\n value={puzzlesData.data.filter(puzzle => puzzle.solved).length}\n maxValue={puzzlesData.data.length}\n initialValue={puzzlesData.initialProgressValue}\n data={puzzlesData.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: puzzle.solved,\n onPress: () => handleEndJourney(puzzle),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Click to solve a puzzle\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n\n setJourney(journeyId, [...lessonSteps, ...gameSteps, ...puzzleSteps]);\n\n carouselRefs.current?.goToIndex(0); // Always start from 0th Index no matter what the current index is\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n nextCoachmark(journeyId);\n }, SLIDE_TO_LESSON_MS);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current, 'ORANGE_4', true);\n }\n },\n [carouselRefs, setJourney, journeyId, goToNextCard, handleEndJourney, nextCoachmark],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\n lessonRefs,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, [carouselRefs]);\n\n return data;\n};\n"],"names":["useGameLauncherJourney","carouselRefs","onSegmentClick","onJourneyComplete","journeyId","JOURNEY_ID_STUDENT","gameRefs","useRef","puzzleRefs","lessonRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourney","puzzlesData","ProjectType","ActionEvent","startJourney","isLessonAvailable","_c","_d","lessonLabelDims","_g","_f","_e","gameLabelDims","_j","_i","_h","puzzleLabelDims","_m","_l","_k","launcherDims","_p","_o","_n","lessonSteps","IndicatorType","jsx","Fragment","FlexView","Text","_q","IconButton","CaratRightIcon","GAME_LAUNCHER_ANALYTICS_EVENTS","gameSteps","puzzleSteps","SegmentedGameCard","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;AAkCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAClC,QAAMC,IAAYC,GAAmB,iCAE/BC,IAAWC,EAA+B,IAAI,GAC9CC,IAAaD,EAA+B,IAAI,GAChDE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAI,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,GAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAEXM,IAAsBH;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXO,IAAeJ;AAAA,IACnB,CACEK,GACAC,GACAC,GACAC,IAAwB,OACrB;;AACH,MAAKA,MACajB,MAChBkB,IAAA5B,EAAa,YAAb,QAAA4B,EAAsB,YAAUC,IAAA7B,EAAa,YAAb,gBAAA6B,EAAsB,gBAAe,IACvDjB,EAAAT,GAAW,IAAO2B,EAAyB,IAG3DZ,EAAiBM,CAAoB;AAE/B,YAAAO,IAAoB,WAAW,MAAM;AACzC,qBAAaA,CAAiB,GAC9BN,EAAe,oBAAoBC,CAAK;AAAA,SACvCM,EAA6B;AAEtB,MAAAvB,EAAA,QAAQ,KAAKsB,CAAiB,GAE1BnB,EAAAT,G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ACX,OAAO;AAAA,MACL,UAAAvE;AAAA,MACA,YAAAE;AAAA,MACA,YAAAC;AAAA,MACA,cAAA8B;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAuC,GAAU,MACD,MAAM;AACX,IAAApE,EAAU,QAAQ,QAAQ,CAASqE,MAAA,aAAaA,CAAK,CAAC,GACtDrE,EAAU,UAAU;EAAC,GAEtB,CAACT,CAAY,CAAC,GAEV2E;AACT;"}
@@ -1,40 +1,41 @@
1
- import { jsx as r, Fragment as R } from "react/jsx-runtime";
2
- import { useRef as A, useCallback as C, useEffect as V } from "react";
3
- import X from "../../../../../assets/line-icons/icons/carat-right.js";
1
+ import { jsx as r, Fragment as b } from "react/jsx-runtime";
2
+ import { useRef as O, useCallback as A, useEffect as X } from "react";
3
+ import J from "../../../../../assets/line-icons/icons/carat-right.js";
4
4
  import { PLATFORM_EVENTS_STUDENT as G } from "../../../../analytics-events/platform-events-student.js";
5
5
  import { JOURNEY_ID_STUDENT as K } from "../../../../journey/journey-id/journey-id-student.js";
6
6
  import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
7
7
  import { useJourney as j } from "../../../../journey/use-journey/use-journey.js";
8
8
  import Z from "../../../../ui/buttons/icon-button/icon-button.js";
9
9
  import { useUIContext as q } from "../../../../ui/context/context.js";
10
- import N from "../../../../ui/layout/flex-view.js";
10
+ import R from "../../../../ui/layout/flex-view.js";
11
11
  import m from "../../../../ui/text/text.js";
12
12
  import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as v } from "../../../enum/circle-onboarding-steps.js";
13
13
  import { useCircleSounds as z } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
14
14
  import { TablesCard as M } from "../../comps/tables-card/tables-card.js";
15
15
  import { GAME_LAUNCHER_ANALYTICS_EVENTS as Q } from "../../game-launcher-analytics-events.js";
16
- import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as ee, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as te, START_ANIMATING_CLONED_ELEM as $, TABLE_CARD_INDEX as x, GO_TO_TABLE_LAUNCHER_DURATION_MS as re, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ne, PUZZLE_CARD_INDEX as oe, SHOW_INITIAL_COACHMARK_AFTER_MS as J, LESSON_CARD_INDEX as ie, SHOW_INITIAL_TOOLTIP_AFTER_MS as le } from "./constants.js";
16
+ import { SHOW_PICK_A_LEVEL_TOOLTIP_AFTER_MS as ee, SHOW_PICK_A_LEVEL_NUDGE_AFTER_MS as te, START_ANIMATING_CLONED_ELEM as $, TABLE_CARD_INDEX as x, GO_TO_TABLE_LAUNCHER_DURATION_MS as re, SHOW_CLICK_TABLE_NUDGE_AFTER_MS as ne, PUZZLE_CARD_INDEX as oe, SHOW_INITIAL_COACHMARK_AFTER_MS as w, LESSON_CARD_INDEX as ie, SHOW_INITIAL_TOOLTIP_AFTER_MS as le } from "./constants.js";
17
17
  import { Indicator as ce } from "./use-table-launcher-journey-styled.js";
18
18
  const Oe = ({
19
- carouselRef: a,
20
- onTableSegmentClick: S
19
+ carouselRefs: a,
20
+ onTableSegmentClick: N,
21
+ onJourneyComplete: S
21
22
  }) => {
22
- const t = K.CIRCLE_TABLES_INTRO_JOURNEY, e = A(null), p = A(null), L = A(!1), T = A([]), { playButtonSound: P } = z(), { nextCoachmark: l, setJourney: I, addCoachmark: u, endJourney: y } = j(), { onEvent: _ } = q(), b = C(
23
+ const e = K.CIRCLE_TABLES_INTRO_JOURNEY, t = O(null), p = O(null), T = O([]), { playButtonSound: P } = z(), { nextCoachmark: l, setJourney: C, addCoachmark: u, endJourney: H } = j(), { onEvent: f } = q(), L = A(
23
24
  (n) => {
24
25
  var c, o;
25
- n && S(n), _(G.ONBOARDING_STEP_COMPLETED, {
26
+ H(e), n && N(n), f(G.ONBOARDING_STEP_COMPLETED, {
26
27
  step: v.TABLES
27
- }), (c = e == null ? void 0 : e.current) == null || c.setLabelVisiblity(!0), (o = e == null ? void 0 : e.current) == null || o.stopLabelAnimation(), y(t);
28
+ }), (c = t == null ? void 0 : t.current) == null || c.setLabelVisiblity(!0), (o = t == null ? void 0 : t.current) == null || o.stopLabelAnimation(), S(e);
28
29
  },
29
- [y, t, S, _]
30
- ), H = C(
30
+ [H, e, S, N, f]
31
+ ), y = A(
31
32
  (n, c) => {
32
33
  var g, E, h;
33
- if (!((g = e.current) != null && g.segmentedCardWrapperRef.current) || !((E = e.current) != null && E.labelRef.current))
34
+ if (!((g = t.current) != null && g.segmentedCardWrapperRef.current) || !((E = t.current) != null && E.labelRef.current))
34
35
  return;
35
- const o = e.current.labelRef.current.getBoundingClientRect(), i = (h = e.current) == null ? void 0 : h.segmentedCardWrapperRef.current.getBoundingClientRect();
36
- u(t, {
37
- originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
36
+ const o = t.current.labelRef.current.getBoundingClientRect(), i = (h = t.current) == null ? void 0 : h.segmentedCardWrapperRef.current.getBoundingClientRect();
37
+ u(e, {
38
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
38
39
  isActive: !1,
39
40
  type: d.TOOLTIP,
40
41
  elementToHighlight: /* @__PURE__ */ r(
@@ -44,20 +45,20 @@ const Oe = ({
44
45
  defaultTable: c,
45
46
  label: n.label,
46
47
  data: n.data,
47
- onPress: b,
48
- onGoBackFromTableLevel: b
48
+ onPress: L,
49
+ onGoBackFromTableLevel: L
49
50
  }
50
51
  ),
51
52
  indicator: {
52
53
  position: "left",
53
54
  backgroundColor: "YELLOW_4",
54
55
  width: 236,
55
- tooltipItem: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
56
+ tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Each table has 3 levels—clear them and earn 3 stars!" }) }),
56
57
  tooltipXCoOrdinates: 0,
57
58
  tooltipYCoOrdinates: o.height * 0.35
58
59
  }
59
- }), u(t, {
60
- originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
60
+ }), u(e, {
61
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
61
62
  isActive: !1,
62
63
  type: d.NUDGE,
63
64
  indicator: {
@@ -66,23 +67,23 @@ const Oe = ({
66
67
  nudgePointerX: i.width / 2 + 50,
67
68
  nudgePointerY: i.height * 0.4
68
69
  },
69
- elementToHighlight: /* @__PURE__ */ r(R, {})
70
- }), l(t, !1, ee), l(t, !0, te);
70
+ elementToHighlight: /* @__PURE__ */ r(b, {})
71
+ }), l(e, !1, ee), l(e, !0, te);
71
72
  const s = setTimeout(() => {
72
- var f;
73
- clearTimeout(s), (f = p.current) == null || f.startLabelAnimation("YELLOW_4");
73
+ var _;
74
+ clearTimeout(s), (_ = p.current) == null || _.startLabelAnimation("YELLOW_4");
74
75
  }, $);
75
76
  T.current.push(s);
76
77
  },
77
- [u, b, t, l]
78
- ), O = C(() => {
78
+ [u, L, e, l]
79
+ ), I = A(() => {
79
80
  var o;
80
- P(), (o = a.current) == null || o.goToIndex(x), l(t, !1, re), _(G.ONBOARDING_STEP_VIEWED, {
81
+ P(), (o = a.current) == null || o.goToIndex(x), l(e, !1, re), f(G.ONBOARDING_STEP_VIEWED, {
81
82
  step: v.TABLES
82
83
  });
83
84
  const n = setTimeout(() => {
84
85
  var i;
85
- clearTimeout(n), (i = e.current) == null || i.setLabelVisiblity(!1), l(t, !0);
86
+ clearTimeout(n), (i = t.current) == null || i.setLabelVisiblity(!1), l(e, !0);
86
87
  }, ne);
87
88
  T.current.push(n);
88
89
  const c = setTimeout(() => {
@@ -90,17 +91,14 @@ const Oe = ({
90
91
  clearTimeout(c), (i = p.current) == null || i.startLabelAnimation("YELLOW_4");
91
92
  }, $);
92
93
  T.current.push(c);
93
- }, [a, t, l, P, _]), w = C(
94
+ }, [a, e, l, P, f]), F = A(
94
95
  (n, c = !1) => {
95
- var h, f, D, W, Y, k, B, U;
96
- if (L.current)
96
+ var h, _, D, W, Y, k, B, U;
97
+ const o = (h = a.current) == null ? void 0 : h.indicatorRefs, i = (_ = a.current) == null ? void 0 : _.nextBtnRef, s = o == null ? void 0 : o[x];
98
+ if (!((D = t.current) != null && D.segmentedCardWrapperRef.current) || !((W = t.current) != null && W.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
97
99
  return;
98
- const o = (h = a.current) == null ? void 0 : h.indicatorRefs, i = (f = a.current) == null ? void 0 : f.nextBtnRef, s = o == null ? void 0 : o[x];
99
- if (!((D = e.current) != null && D.segmentedCardWrapperRef.current) || !((W = e.current) != null && W.labelRef.current) || !o || !(i != null && i.current) || !s || !s.current)
100
- return;
101
- L.current = !0;
102
- const g = e.current.labelRef.current.getBoundingClientRect(), E = (Y = e.current) == null ? void 0 : Y.segmentedCardWrapperRef.current.getBoundingClientRect();
103
- c ? (I(t, [
100
+ const g = t.current.labelRef.current.getBoundingClientRect(), E = (Y = t.current) == null ? void 0 : Y.segmentedCardWrapperRef.current.getBoundingClientRect();
101
+ c ? (C(e, [
104
102
  {
105
103
  originalElementToHighlightRef: s,
106
104
  isActive: !1,
@@ -111,12 +109,12 @@ const Oe = ({
111
109
  backgroundColor: "YELLOW_4",
112
110
  width: 52,
113
111
  tooltipItem: /* @__PURE__ */ r(
114
- N,
112
+ R,
115
113
  {
116
114
  $position: "absolute",
117
115
  $flexDirection: "row",
118
116
  style: { top: 6, left: 8, cursor: "pointer" },
119
- onClick: O,
117
+ onClick: I,
120
118
  children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "NEW" })
121
119
  }
122
120
  ),
@@ -133,9 +131,9 @@ const Oe = ({
133
131
  content: "",
134
132
  nudgePointerY: 20
135
133
  },
136
- elementToHighlight: /* @__PURE__ */ r(R, {})
134
+ elementToHighlight: /* @__PURE__ */ r(b, {})
137
135
  }
138
- ]), (U = a.current) == null || U.goToIndex(ie), l(t, !1, J), l(t, !0, le)) : (I(t, [
136
+ ]), (U = a.current) == null || U.goToIndex(ie), l(e, !1, w), l(e, !0, le)) : (C(e, [
139
137
  {
140
138
  originalElementToHighlightRef: (k = a.current) == null ? void 0 : k.nextBtnRef,
141
139
  isActive: !1,
@@ -150,27 +148,27 @@ const Oe = ({
150
148
  Z,
151
149
  {
152
150
  renderAs: "secondary",
153
- Icon: X,
154
- onClick: O,
151
+ Icon: J,
152
+ onClick: I,
155
153
  analyticsLabel: Q.JOURNEY_NEXT_ACTIVITY
156
154
  }
157
155
  )
158
156
  }
159
- ]), (B = a.current) == null || B.goToIndex(oe), l(t, !1, J)), u(t, {
160
- originalElementToHighlightRef: e.current.labelRef,
157
+ ]), (B = a.current) == null || B.goToIndex(oe), l(e, !1, w)), u(e, {
158
+ originalElementToHighlightRef: t.current.labelRef,
161
159
  isActive: !1,
162
160
  type: d.TOOLTIP,
163
- elementToHighlight: /* @__PURE__ */ r(R, {}),
161
+ elementToHighlight: /* @__PURE__ */ r(b, {}),
164
162
  indicator: {
165
163
  position: "right",
166
164
  backgroundColor: "YELLOW_4",
167
165
  width: 264,
168
- tooltipItem: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
166
+ tooltipItem: /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(m, { $renderAs: "ab2-bold", children: "Get faster at multiplication! Practice everyday and become a Tables champ." }) }),
169
167
  tooltipXCoOrdinates: g.width + 50,
170
168
  tooltipYCoOrdinates: g.height / 2
171
169
  }
172
- }), u(t, {
173
- originalElementToHighlightRef: e.current.segmentedCardWrapperRef,
170
+ }), u(e, {
171
+ originalElementToHighlightRef: t.current.segmentedCardWrapperRef,
174
172
  isActive: !1,
175
173
  type: d.NUDGE,
176
174
  indicator: {
@@ -187,7 +185,7 @@ const Oe = ({
187
185
  data: n.data,
188
186
  onPress: () => {
189
187
  },
190
- onPressTableSegment: (F) => H(n, F)
188
+ onPressTableSegment: (V) => y(n, V)
191
189
  }
192
190
  )
193
191
  });
@@ -195,18 +193,18 @@ const Oe = ({
195
193
  [
196
194
  u,
197
195
  a,
198
- O,
199
- H,
200
- t,
196
+ I,
197
+ y,
198
+ e,
201
199
  l,
202
- I
200
+ C
203
201
  ]
204
202
  );
205
- return V(() => () => {
206
- T.current.forEach((n) => clearTimeout(n)), T.current = [], L.current = !1;
207
- }, [t]), {
208
- tableRef: e,
209
- startJourney: w
203
+ return X(() => () => {
204
+ T.current.forEach((n) => clearTimeout(n)), T.current = [];
205
+ }, [e]), {
206
+ tableRef: t,
207
+ startJourney: F
210
208
  };
211
209
  };
212
210
  export {