@cuemath/leap 3.1.53 → 3.1.54-akm-3

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,71 +1,68 @@
1
1
  import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
2
- const a = (e) => {
2
+ const a = (t) => {
3
3
  let s = null;
4
- return e && (s = {
5
- points: e.points,
6
- streakDays: e.streak_days,
7
- streakReduction: e.streak_reduction,
8
- streakDaysBeforeReduction: e.streak_days_before_reduction,
9
- streakStatus: e.streak_status,
10
- tournamentRank: e.tournament_rank,
11
- projects: {
12
- games: {
13
- label: e.projects.games.label,
14
- type: i.GAME,
15
- initialProgressValue: 0,
16
- data: e.projects.games.data.map((t) => ({
17
- id: t.id,
18
- name: t.name,
19
- cardLottie: t.card,
20
- tutorial: t.tutorial,
21
- variant: t.variant,
22
- isPlayed: t.played
23
- }))
24
- },
25
- puzzles: {
26
- label: e.projects.puzzles.label,
27
- type: i.PUZZLE,
28
- initialProgressValue: 0,
29
- data: e.projects.puzzles.data.map((t) => ({
30
- id: t.id,
31
- name: t.name,
32
- cardLottie: t.card,
33
- tutorial: t.tutorial,
34
- variant: t.variant,
35
- question: t.question,
36
- isHintSeen: t.is_hint_seen,
37
- solved: t.solved
38
- }))
39
- }
40
- },
4
+ return t && (s = {
5
+ points: t.points,
6
+ streakDays: t.streak_days,
7
+ streakReduction: t.streak_reduction,
8
+ streakDaysBeforeReduction: t.streak_days_before_reduction,
9
+ streakStatus: t.streak_status,
10
+ tournamentRank: t.tournament_rank,
11
+ projects: {},
41
12
  timestamps: {
42
- startTimestamp: e.timestamps.start_timestamp,
43
- endTimestamp: e.timestamps.end_timestamp,
44
- current: e.timestamps.current
13
+ startTimestamp: t.timestamps.start_timestamp,
14
+ endTimestamp: t.timestamps.end_timestamp,
15
+ current: t.timestamps.current
45
16
  }
46
- }, e.projects.lessons && (s.projects.lessons = {
47
- label: e.projects.lessons.label,
17
+ }, t.projects.games && (s.projects.games = {
18
+ label: t.projects.games.label,
19
+ type: i.GAME,
20
+ initialProgressValue: 0,
21
+ data: t.projects.games.data.map((e) => ({
22
+ id: e.id,
23
+ name: e.name,
24
+ cardLottie: e.card,
25
+ tutorial: e.tutorial,
26
+ variant: e.variant,
27
+ isPlayed: e.played
28
+ }))
29
+ }), t.projects.puzzles && (s.projects.puzzles = {
30
+ label: t.projects.puzzles.label,
31
+ type: i.PUZZLE,
32
+ initialProgressValue: 0,
33
+ data: t.projects.puzzles.data.map((e) => ({
34
+ id: e.id,
35
+ name: e.name,
36
+ cardLottie: e.card,
37
+ tutorial: e.tutorial,
38
+ variant: e.variant,
39
+ question: e.question,
40
+ isHintSeen: e.is_hint_seen,
41
+ solved: e.solved
42
+ }))
43
+ }), t.projects.lessons && (s.projects.lessons = {
44
+ label: t.projects.lessons.label,
48
45
  type: i.LESSON,
49
46
  initialProgressValue: 0,
50
- data: e.projects.lessons.data.map((t) => ({
51
- id: t.id,
52
- name: t.name,
53
- cardLottie: t.card,
54
- tutorial: t.tutorial,
55
- variant: t.variant,
56
- sessionId: t.session_id,
57
- miniGameIdentifier: t.mini_game_identifier,
58
- targetQuestions: t.target_questions,
59
- status: t.status
47
+ data: t.projects.lessons.data.map((e) => ({
48
+ id: e.id,
49
+ name: e.name,
50
+ cardLottie: e.card,
51
+ tutorial: e.tutorial,
52
+ variant: e.variant,
53
+ sessionId: e.session_id,
54
+ miniGameIdentifier: e.mini_game_identifier,
55
+ targetQuestions: e.target_questions,
56
+ status: e.status
60
57
  }))
61
- }), e.projects.tables && (s.projects.tables = {
62
- label: e.projects.tables.label,
58
+ }), t.projects.tables && (s.projects.tables = {
59
+ label: t.projects.tables.label,
63
60
  type: i.TABLE,
64
61
  data: {
65
- infiniteModeHighScore: e.projects.tables.data.infinite_mode_high_score,
66
- tableList: e.projects.tables.data.table_wise_details.map((t) => ({
67
- tableNumber: t.table_number,
68
- stars: t.stars
62
+ infiniteModeHighScore: t.projects.tables.data.infinite_mode_high_score,
63
+ tableList: t.projects.tables.data.table_wise_details.map((e) => ({
64
+ tableNumber: e.table_number,
65
+ stars: e.stars
69
66
  }))
70
67
  }
71
68
  })), s;
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.ts"],"sourcesContent":["import type { IGetCircleHomeResponseModel } from '../../api/get-content-for-today/get-circle-home-api-types';\nimport type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { ProjectType } from '../../../games/web-view/enums';\n\nexport const transformCircleHomeData = (data: IGetCircleHomeResponseModel | null) => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakReduction: data.streak_reduction,\n streakDaysBeforeReduction: data.streak_days_before_reduction,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.TABLE,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n\n return circleHomeDetails;\n};\n"],"names":["transformCircleHomeData","data","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":";AASa,MAAAA,IAA0B,CAACC,MAA6C;AACnF,MAAIC,IAA+C;AAEnD,SAAID,MACkBC,IAAA;AAAA,IAClB,QAAQD,EAAK;AAAA,IACb,YAAYA,EAAK;AAAA,IACjB,iBAAiBA,EAAK;AAAA,IACtB,2BAA2BA,EAAK;AAAA,IAChC,cAAcA,EAAK;AAAA,IACnB,gBAAgBA,EAAK;AAAA,IACrB,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAOA,EAAK,SAAS,MAAM;AAAA,QAC3B,MAAME,EAAY;AAAA,QAClB,sBAAsB;AAAA,QACtB,MAAMF,EAAK,SAAS,MAAM,KAAK,IAAI,CAASG,OAAA;AAAA,UAC1C,IAAIA,EAAK;AAAA,UACT,MAAMA,EAAK;AAAA,UACX,YAAYA,EAAK;AAAA,UACjB,UAAUA,EAAK;AAAA,UACf,SAASA,EAAK;AAAA,UACd,UAAUA,EAAK;AAAA,QAAA,EACf;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,QACP,OAAOH,EAAK,SAAS,QAAQ;AAAA,QAC7B,MAAME,EAAY;AAAA,QAClB,sBAAsB;AAAA,QACtB,MAAMF,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWI,OAAA;AAAA,UAC9C,IAAIA,EAAO;AAAA,UACX,MAAMA,EAAO;AAAA,UACb,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,SAASA,EAAO;AAAA,UAChB,UAAUA,EAAO;AAAA,UACjB,YAAYA,EAAO;AAAA,UACnB,QAAQA,EAAO;AAAA,QAAA,EACf;AAAA,MACJ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,gBAAgBJ,EAAK,WAAW;AAAA,MAChC,cAAcA,EAAK,WAAW;AAAA,MAC9B,SAASA,EAAK,WAAW;AAAA,IAC3B;AAAA,EAAA,GAGEA,EAAK,SAAS,YAChBC,EAAkB,SAAS,UAAU;AAAA,IACnC,OAAOD,EAAK,SAAS,QAAQ;AAAA,IAC7B,MAAME,EAAY;AAAA,IAClB,sBAAsB;AAAA,IACtB,MAAMF,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWK,OAAA;AAAA,MAC9C,IAAIA,EAAO;AAAA,MACX,MAAMA,EAAO;AAAA,MACb,YAAYA,EAAO;AAAA,MACnB,UAAUA,EAAO;AAAA,MACjB,SAASA,EAAO;AAAA,MAChB,WAAWA,EAAO;AAAA,MAClB,oBAAoBA,EAAO;AAAA,MAC3B,iBAAiBA,EAAO;AAAA,MACxB,QAAQA,EAAO;AAAA,IAAA,EACf;AAAA,EAAA,IAIFL,EAAK,SAAS,WAChBC,EAAkB,SAAS,SAAS;AAAA,IAClC,OAAOD,EAAK,SAAS,OAAO;AAAA,IAC5B,MAAME,EAAY;AAAA,IAClB,MAAM;AAAA,MACJ,uBAAuBF,EAAK,SAAS,OAAO,KAAK;AAAA,MACjD,WAAWA,EAAK,SAAS,OAAO,KAAK,mBAAmB,IAAI,CAAUM,OAAA;AAAA,QACpE,aAAaA,EAAM;AAAA,QACnB,OAAOA,EAAM;AAAA,MAAA,EACb;AAAA,IACJ;AAAA,EAAA,KAKCL;AACT;"}
1
+ {"version":3,"file":"helper.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.ts"],"sourcesContent":["import type { IGetCircleHomeResponseModel } from '../../api/get-content-for-today/get-circle-home-api-types';\nimport type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { ProjectType } from '../../../games/web-view/enums';\n\nexport const transformCircleHomeData = (data: IGetCircleHomeResponseModel | null) => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakReduction: data.streak_reduction,\n streakDaysBeforeReduction: data.streak_days_before_reduction,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {},\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n };\n\n if (data.projects.games) {\n circleHomeDetails.projects.games = {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n };\n }\n\n if (data.projects.puzzles) {\n circleHomeDetails.projects.puzzles = {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n };\n }\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.TABLE,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n\n return circleHomeDetails;\n};\n"],"names":["transformCircleHomeData","data","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":";AASa,MAAAA,IAA0B,CAACC,MAA6C;AACnF,MAAIC,IAA+C;AAEnD,SAAID,MACkBC,IAAA;AAAA,IAClB,QAAQD,EAAK;AAAA,IACb,YAAYA,EAAK;AAAA,IACjB,iBAAiBA,EAAK;AAAA,IACtB,2BAA2BA,EAAK;AAAA,IAChC,cAAcA,EAAK;AAAA,IACnB,gBAAgBA,EAAK;AAAA,IACrB,UAAU,CAAC;AAAA,IACX,YAAY;AAAA,MACV,gBAAgBA,EAAK,WAAW;AAAA,MAChC,cAAcA,EAAK,WAAW;AAAA,MAC9B,SAASA,EAAK,WAAW;AAAA,IAC3B;AAAA,EAAA,GAGEA,EAAK,SAAS,UAChBC,EAAkB,SAAS,QAAQ;AAAA,IACjC,OAAOD,EAAK,SAAS,MAAM;AAAA,IAC3B,MAAME,EAAY;AAAA,IAClB,sBAAsB;AAAA,IACtB,MAAMF,EAAK,SAAS,MAAM,KAAK,IAAI,CAASG,OAAA;AAAA,MAC1C,IAAIA,EAAK;AAAA,MACT,MAAMA,EAAK;AAAA,MACX,YAAYA,EAAK;AAAA,MACjB,UAAUA,EAAK;AAAA,MACf,SAASA,EAAK;AAAA,MACd,UAAUA,EAAK;AAAA,IAAA,EACf;AAAA,EAAA,IAIFH,EAAK,SAAS,YAChBC,EAAkB,SAAS,UAAU;AAAA,IACnC,OAAOD,EAAK,SAAS,QAAQ;AAAA,IAC7B,MAAME,EAAY;AAAA,IAClB,sBAAsB;AAAA,IACtB,MAAMF,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWI,OAAA;AAAA,MAC9C,IAAIA,EAAO;AAAA,MACX,MAAMA,EAAO;AAAA,MACb,YAAYA,EAAO;AAAA,MACnB,UAAUA,EAAO;AAAA,MACjB,SAASA,EAAO;AAAA,MAChB,UAAUA,EAAO;AAAA,MACjB,YAAYA,EAAO;AAAA,MACnB,QAAQA,EAAO;AAAA,IAAA,EACf;AAAA,EAAA,IAIFJ,EAAK,SAAS,YAChBC,EAAkB,SAAS,UAAU;AAAA,IACnC,OAAOD,EAAK,SAAS,QAAQ;AAAA,IAC7B,MAAME,EAAY;AAAA,IAClB,sBAAsB;AAAA,IACtB,MAAMF,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWK,OAAA;AAAA,MAC9C,IAAIA,EAAO;AAAA,MACX,MAAMA,EAAO;AAAA,MACb,YAAYA,EAAO;AAAA,MACnB,UAAUA,EAAO;AAAA,MACjB,SAASA,EAAO;AAAA,MAChB,WAAWA,EAAO;AAAA,MAClB,oBAAoBA,EAAO;AAAA,MAC3B,iBAAiBA,EAAO;AAAA,MACxB,QAAQA,EAAO;AAAA,IAAA,EACf;AAAA,EAAA,IAIFL,EAAK,SAAS,WAChBC,EAAkB,SAAS,SAAS;AAAA,IAClC,OAAOD,EAAK,SAAS,OAAO;AAAA,IAC5B,MAAME,EAAY;AAAA,IAClB,MAAM;AAAA,MACJ,uBAAuBF,EAAK,SAAS,OAAO,KAAK;AAAA,MACjD,WAAWA,EAAK,SAAS,OAAO,KAAK,mBAAmB,IAAI,CAAUM,OAAA;AAAA,QACpE,aAAaA,EAAM;AAAA,QACnB,OAAOA,EAAM;AAAA,MAAA,EACb;AAAA,IACJ;AAAA,EAAA,KAKCL;AACT;"}
@@ -1,82 +1,82 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { memo as g, useRef as J, useCallback as n, useMemo as V, useEffect as Y } from "react";
2
+ import { memo as D, useRef as b, useCallback as m, useMemo as S, useEffect as Y } from "react";
3
3
  import { LOTTIE as B } from "../../../assets/lottie/lottie.js";
4
- import { JOURNEY_ID_STUDENT as _ } from "../../journey/journey-id/journey-id-student.js";
4
+ import { JOURNEY_ID_STUDENT as c } from "../../journey/journey-id/journey-id-student.js";
5
5
  import { useJourney as K } from "../../journey/use-journey/use-journey.js";
6
6
  import { CircularLoader as H } from "../../ui/loader/circular-loader/circular-loader.js";
7
7
  import Z from "../../ui/lottie-animation/lottie-animation.js";
8
8
  import { useCircleSounds as w } from "../hooks/use-circle-sounds/use-circle-sounds.js";
9
9
  import { CircleSoundKey as t } from "../hooks/use-circle-sounds/use-circle-sounds-enums.js";
10
10
  import { GAME_LAUNCHER_SIZE as F } from "./comps/card-container/constants.js";
11
- import { Carousel as M } from "./comps/carousel/carousel.js";
11
+ import { Carousel as V } from "./comps/carousel/carousel.js";
12
12
  import { GAME_LAUNCHER_ASSET_PADDING as X } from "./comps/segmented-game-card/constants.js";
13
- import { SegmentedGameCard as a } from "./comps/segmented-game-card/segmented-game-card.js";
13
+ import { SegmentedGameCard as A } from "./comps/segmented-game-card/segmented-game-card.js";
14
14
  import { TablesCard as q } from "./comps/tables-card/tables-card.js";
15
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as S } from "./game-launcher-analytics-events.js";
15
+ import { GAME_LAUNCHER_ANALYTICS_EVENTS as M } from "./game-launcher-analytics-events.js";
16
16
  import { useGameLauncherJourney as Q } from "./hooks/use-game-launcher-journey/use-game-launcher-journey.js";
17
17
  import { useTableInfiniteLauncherJourney as W } from "./hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js";
18
18
  import { useTableLauncherJourney as $ } from "./hooks/use-table-launcher-journey/use-table-launcher-journey.js";
19
- import { ProjectType as m } from "../games/web-view/enums/project-type-enum.js";
20
- const O = F + X, _e = g(
19
+ import { ProjectType as u } from "../games/web-view/enums/project-type-enum.js";
20
+ const O = F + X, Te = D(
21
21
  ({
22
- onSegmentClick: l,
23
- journeyId: u,
22
+ onSegmentClick: r,
23
+ journeyId: n,
24
24
  data: e,
25
- isLoading: c,
26
- isTutorialOnboardingDone: b,
27
- defaultIndex: v = 0,
28
- onJourneyComplete: p
25
+ isLoading: p,
26
+ isTutorialOnboardingDone: R,
27
+ defaultIndex: U = 0,
28
+ onJourneyComplete: E
29
29
  }) => {
30
- const f = J(null), E = J(null), { isJourneyActive: C } = K(), { playSwipeSound: A, play: o } = w(), L = n(
31
- (r) => {
32
- o(t.GAME_CARD_CLICK), l(r, m.TABLE);
30
+ const f = b(null), L = b(null), _ = b(null), { isJourneyActive: I } = K(), { playSwipeSound: N, play: o } = w(), T = m(
31
+ (l) => {
32
+ o(t.GAME_CARD_CLICK), r(l, u.TABLE);
33
33
  },
34
- [l, o]
35
- ), x = n(() => {
36
- o(t.GAME_CARD_CLICK), l({ mode: "infinite" }, m.TABLE);
37
- }, [l, o]), I = n(
38
- (r) => {
39
- r.status !== "completed" && (o(t.GAME_CARD_CLICK), l(r, m.LESSON));
34
+ [r, o]
35
+ ), g = m(() => {
36
+ o(t.GAME_CARD_CLICK), r({ mode: "infinite" }, u.TABLE);
37
+ }, [r, o]), y = m(
38
+ (l) => {
39
+ l.status !== "completed" && (o(t.GAME_CARD_CLICK), r(l, u.LESSON));
40
40
  },
41
- [l, o]
42
- ), R = n(
43
- (r) => {
44
- o(t.GAME_CARD_CLICK), l(r, m.GAME);
41
+ [r, o]
42
+ ), a = m(
43
+ (l) => {
44
+ o(t.GAME_CARD_CLICK), r(l, u.GAME);
45
45
  },
46
- [l, o]
47
- ), y = n(
48
- (r) => {
49
- o(t.GAME_CARD_CLICK), l(r, m.PUZZLE);
46
+ [r, o]
47
+ ), P = m(
48
+ (l) => {
49
+ o(t.GAME_CARD_CLICK), r(l, u.PUZZLE);
50
50
  },
51
- [l, o]
51
+ [r, o]
52
52
  ), {
53
- gameRefs: N,
54
- lessonRefs: P,
55
- puzzleRefs: h,
53
+ gameRefs: h,
54
+ puzzleRefs: z,
56
55
  startJourney: G
57
56
  } = Q({
58
57
  carouselRefs: f,
59
- onSegmentClick: l,
60
- onJourneyComplete: p
61
- }), { startJourney: T } = W({
58
+ onSegmentClick: r,
59
+ onJourneyComplete: E,
60
+ lessonRefs: L
61
+ }), { startJourney: C } = W({
62
62
  carouselRefs: f,
63
- onTableInfiniteModeClick: x,
64
- onJourneyComplete: p,
65
- originalTableRef: E
66
- }), { startJourney: z } = $({
63
+ onTableInfiniteModeClick: g,
64
+ onJourneyComplete: E,
65
+ originalTableRef: _
66
+ }), { startJourney: J } = $({
67
67
  carouselRefs: f,
68
- originalTableRef: E,
69
- onTableSegmentClick: L,
70
- onJourneyComplete: p,
71
- onNextJourney: T
72
- }), D = V(() => {
73
- let r = [];
74
- return e && (e.lessons && (r = [
75
- ...r,
68
+ originalTableRef: _,
69
+ onTableSegmentClick: T,
70
+ onJourneyComplete: E,
71
+ onNextJourney: C
72
+ }), v = S(() => {
73
+ let l = [];
74
+ return e && (e.lessons && (l = [
75
+ ...l,
76
76
  /* @__PURE__ */ i(
77
- a,
77
+ A,
78
78
  {
79
- ref: P,
79
+ ref: L,
80
80
  label: e.lessons.label,
81
81
  value: e.lessons.data.filter((s) => s.status === "completed").length,
82
82
  maxValue: e.lessons.data.length,
@@ -85,16 +85,16 @@ const O = F + X, _e = g(
85
85
  card: s.cardLottie,
86
86
  name: s.name,
87
87
  isCompleted: s.status === "completed",
88
- onPress: () => I(s)
88
+ onPress: () => y(s)
89
89
  }))
90
90
  }
91
91
  )
92
- ]), r = [
93
- ...r,
92
+ ]), e.games && (l = [
93
+ ...l,
94
94
  /* @__PURE__ */ i(
95
- a,
95
+ A,
96
96
  {
97
- ref: N,
97
+ ref: h,
98
98
  label: e.games.label,
99
99
  value: e.games.data.filter((s) => s.isPlayed).length,
100
100
  maxValue: e.games.data.length,
@@ -103,14 +103,16 @@ const O = F + X, _e = g(
103
103
  card: s.cardLottie,
104
104
  name: s.name,
105
105
  isCompleted: !1,
106
- onPress: () => R(s)
106
+ onPress: () => a(s)
107
107
  }))
108
108
  }
109
- ),
109
+ )
110
+ ]), e.puzzles && (l = [
111
+ ...l,
110
112
  /* @__PURE__ */ i(
111
- a,
113
+ A,
112
114
  {
113
- ref: h,
115
+ ref: z,
114
116
  label: e.puzzles.label,
115
117
  value: e.puzzles.data.filter((s) => s.solved).length,
116
118
  maxValue: e.puzzles.data.length,
@@ -119,33 +121,33 @@ const O = F + X, _e = g(
119
121
  card: s.cardLottie,
120
122
  name: s.name,
121
123
  isCompleted: s.solved,
122
- onPress: () => y(s)
124
+ onPress: () => P(s)
123
125
  }))
124
126
  }
125
127
  )
126
- ], e.tables && (r = [
127
- ...r,
128
+ ]), e.tables && (l = [
129
+ ...l,
128
130
  /* @__PURE__ */ i(
129
131
  q,
130
132
  {
131
- ref: E,
133
+ ref: _,
132
134
  label: e.tables.label,
133
135
  data: e.tables.data,
134
- onPress: L,
136
+ onPress: T,
135
137
  openModesOfTable: e.tables.openModesOfTable
136
138
  }
137
139
  )
138
- ])), r;
140
+ ])), l;
139
141
  }, [
140
142
  e,
141
- N,
142
143
  h,
143
- P,
144
- I,
145
- R,
144
+ z,
145
+ L,
146
146
  y,
147
- L
148
- ]), U = V(
147
+ a,
148
+ P,
149
+ T
150
+ ]), x = S(
149
151
  () => [
150
152
  /* @__PURE__ */ i(
151
153
  Z,
@@ -159,48 +161,48 @@ const O = F + X, _e = g(
159
161
  []
160
162
  );
161
163
  return Y(() => {
162
- if (!(c || !e || C)) {
163
- if (e != null && e.puzzles && u === _.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {
164
- G(e == null ? void 0 : e.puzzles, !!(e != null && e.lessons));
164
+ if (!(p || !e || I)) {
165
+ if (e != null && e.puzzles && n === c.CIRCLE_ACTIVITIES_INTRO_JOURNEY || e != null && e.lessons && n === c.CIRCLE_LESSONS_INTRO_JOURNEY) {
166
+ G(n, e == null ? void 0 : e.puzzles, e == null ? void 0 : e.lessons);
165
167
  return;
166
168
  }
167
- if (e != null && e.tables && u === _.CIRCLE_TABLES_INTRO_JOURNEY) {
168
- z(e == null ? void 0 : e.tables, b);
169
+ if (e != null && e.tables && n === c.CIRCLE_TABLES_INTRO_JOURNEY) {
170
+ J(e == null ? void 0 : e.tables, R);
169
171
  return;
170
172
  }
171
- if (e != null && e.tables && u === _.CIRCLE_TABLES_INFINTE_JOURNEY) {
172
- T();
173
+ if (e != null && e.tables && n === c.CIRCLE_TABLES_INFINTE_JOURNEY) {
174
+ C();
173
175
  return;
174
176
  }
175
177
  }
176
178
  }, [
177
179
  e,
180
+ I,
181
+ p,
182
+ R,
183
+ n,
178
184
  C,
179
- c,
180
- b,
181
- u,
182
- T,
183
185
  G,
184
- z
185
- ]), c ? /* @__PURE__ */ i(H, {}) : e ? /* @__PURE__ */ i(
186
- M,
186
+ J
187
+ ]), p ? /* @__PURE__ */ i(H, {}) : e ? /* @__PURE__ */ i(
188
+ V,
187
189
  {
188
190
  ref: f,
189
- items: D,
190
- defaultIndex: v,
191
- onNext: A,
192
- onPrev: A,
191
+ items: v,
192
+ defaultIndex: U,
193
+ onNext: N,
194
+ onPrev: N,
193
195
  analyticsNext: {
194
- analyticsLabel: S.NEXT_ACTIVITY
196
+ analyticsLabel: M.NEXT_ACTIVITY
195
197
  },
196
198
  analyticsPrev: {
197
- analyticsLabel: S.PREV_ACTIVITY
199
+ analyticsLabel: M.PREV_ACTIVITY
198
200
  }
199
201
  }
200
202
  ) : /* @__PURE__ */ i(
201
- M,
203
+ V,
202
204
  {
203
- items: U,
205
+ items: x,
204
206
  analyticsNext: {
205
207
  analyticsLabel: ""
206
208
  },
@@ -212,6 +214,6 @@ const O = F + X, _e = g(
212
214
  }
213
215
  );
214
216
  export {
215
- _e as GameLauncher
217
+ Te as GameLauncher
216
218
  };
217
219
  //# sourceMappingURL=game-launcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ITableCardRef, ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableInfiniteLauncherJourney } from './hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null) as React.RefObject<ICarouselRefs>;\n\n const tableRef = useRef<ITableCardRef>(null) as React.RefObject<ITableCardRef>;\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipeSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const onTableInfiniteModeClick = useCallback(() => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick({ mode: 'infinite' } as ITableDetails, ProjectType.TABLE);\n }, [onSegmentClick, play]);\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n lessonRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n });\n\n const { startJourney: startInfiniteTablesJourney } = useTableInfiniteLauncherJourney({\n carouselRefs,\n onTableInfiniteModeClick,\n onJourneyComplete,\n originalTableRef: tableRef,\n });\n\n const { startJourney: startTablesJourney } = useTableLauncherJourney({\n carouselRefs,\n originalTableRef: tableRef,\n onTableSegmentClick,\n onJourneyComplete,\n onNextJourney: startInfiniteTablesJourney,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n startLessonPuzzleGamesJourney(data?.puzzles, !!data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n\n return;\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INFINTE_JOURNEY) {\n startInfiniteTablesJourney();\n\n return;\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startInfiniteTablesJourney,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\n onNext={playSwipeSound}\n onPrev={playSwipeSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","tableRef","isJourneyActive","useJourney","playSwipeSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","onTableInfiniteModeClick","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","lessonRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startInfiniteTablesJourney","useTableInfiniteLauncherJourney","startTablesJourney","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAI,GAEzCC,IAAWD,EAAsB,IAAI,GAErC,EAAE,iBAAAE,MAAoBC,KAEtB,EAAE,gBAAAC,GAAgB,MAAAC,EAAK,IAAIC,EAAgB,GAE3CC,IAAsBC;AAAA,MAC1B,CAACC,MAAyB;AACxB,QAAAJ,EAAKK,EAAe,eAAe,GACpBlB,EAAAiB,GAAOE,EAAY,KAAK;AAAA,MACzC;AAAA,MACA,CAACnB,GAAgBa,CAAI;AAAA,IAAA,GAGjBO,IAA2BJ,EAAY,MAAM;AACjD,MAAAH,EAAKK,EAAe,eAAe,GACnClB,EAAe,EAAE,MAAM,WAAW,GAAoBmB,EAAY,KAAK;AAAA,IAAA,GACtE,CAACnB,GAAgBa,CAAI,CAAC,GAEnBQ,IAA2BL;AAAA,MAC/B,CAACM,MAAmB;AACd,QAAAA,EAAO,WAAW,gBACpBT,EAAKK,EAAe,eAAe,GACpBlB,EAAAsB,GAAQH,EAAY,MAAM;AAAA,MAE7C;AAAA,MACA,CAACnB,GAAgBa,CAAI;AAAA,IAAA,GAGjBU,IAAyBP;AAAA,MAC7B,CAACQ,MAAe;AACd,QAAAX,EAAKK,EAAe,eAAe,GACpBlB,EAAAwB,GAAML,EAAY,IAAI;AAAA,MACvC;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B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAxBA,gBAAAV;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,OAAON;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
1
+ {"version":3,"file":"game-launcher.js","sources":["../../../../src/features/circle-games/game-launcher/game-launcher.tsx"],"sourcesContent":["import type { ICarouselRefs } from './comps/carousel/carousel-types';\nimport type { ISegmentedGameCardRefs } from './comps/segmented-game-card/segmented-game-card-types';\nimport type { ITableCardRef, ITableDetails } from './comps/tables-card/tables-card-types';\nimport type {\n Game,\n Lesson,\n Puzzle,\n} from './dal/use-get-circle-home-details-dal/use-get-circle-home-dal-types';\nimport type { IGameLauncherProps } from './game-launcher-types';\nimport type { FC, ReactNode } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport { JOURNEY_ID_STUDENT } from '../../journey/journey-id/journey-id-student';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { CircularLoader } from '../../ui/loader/circular-loader/circular-loader';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { ProjectType } from '../games/web-view/enums';\nimport { useCircleSounds } from '../hooks/use-circle-sounds/use-circle-sounds';\nimport { CircleSoundKey } from '../hooks/use-circle-sounds/use-circle-sounds-enums';\nimport { GAME_LAUNCHER_SIZE } from './comps/card-container/constants';\nimport { Carousel } from './comps/carousel/carousel';\nimport { GAME_LAUNCHER_ASSET_PADDING } from './comps/segmented-game-card/constants';\nimport { SegmentedGameCard } from './comps/segmented-game-card/segmented-game-card';\nimport { TablesCard } from './comps/tables-card/tables-card';\nimport { GAME_LAUNCHER_ANALYTICS_EVENTS } from './game-launcher-analytics-events';\nimport { useGameLauncherJourney } from './hooks/use-game-launcher-journey/use-game-launcher-journey';\nimport { useTableInfiniteLauncherJourney } from './hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey';\nimport { useTableLauncherJourney } from './hooks/use-table-launcher-journey/use-table-launcher-journey';\n\nconst sleepyBoiDimension = GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING;\n\nexport const GameLauncher: FC<IGameLauncherProps> = memo(\n ({\n onSegmentClick,\n journeyId,\n data,\n isLoading,\n isTutorialOnboardingDone,\n defaultIndex = 0,\n onJourneyComplete,\n }) => {\n const carouselRefs = useRef<ICarouselRefs>(null) as React.RefObject<ICarouselRefs>;\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\n const tableRef = useRef<ITableCardRef>(null) as React.RefObject<ITableCardRef>;\n\n const { isJourneyActive } = useJourney();\n\n const { playSwipeSound, play } = useCircleSounds();\n\n const onTableSegmentClick = useCallback(\n (table: ITableDetails) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(table, ProjectType.TABLE);\n },\n [onSegmentClick, play],\n );\n\n const onTableInfiniteModeClick = useCallback(() => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick({ mode: 'infinite' } as ITableDetails, ProjectType.TABLE);\n }, [onSegmentClick, play]);\n\n const handleLessonSegmentClick = useCallback(\n (lesson: Lesson) => {\n if (lesson.status !== 'completed') {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(lesson, ProjectType.LESSON);\n }\n },\n [onSegmentClick, play],\n );\n\n const handleGameSegmentClick = useCallback(\n (game: Game) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(game, ProjectType.GAME);\n },\n [onSegmentClick, play],\n );\n\n const handlePuzzleSegmentClick = useCallback(\n (puzzle: Puzzle) => {\n play(CircleSoundKey.GAME_CARD_CLICK);\n onSegmentClick(puzzle, ProjectType.PUZZLE);\n },\n [onSegmentClick, play],\n );\n\n const {\n gameRefs,\n puzzleRefs,\n startJourney: startLessonPuzzleGamesJourney,\n } = useGameLauncherJourney({\n carouselRefs,\n onSegmentClick,\n onJourneyComplete,\n lessonRefs,\n });\n\n const { startJourney: startInfiniteTablesJourney } = useTableInfiniteLauncherJourney({\n carouselRefs,\n onTableInfiniteModeClick,\n onJourneyComplete,\n originalTableRef: tableRef,\n });\n\n const { startJourney: startTablesJourney } = useTableLauncherJourney({\n carouselRefs,\n originalTableRef: tableRef,\n onTableSegmentClick,\n onJourneyComplete,\n onNextJourney: startInfiniteTablesJourney,\n });\n\n const items = useMemo(() => {\n let itemTypes: ReactNode[] = [];\n\n if (data) {\n if (data.lessons) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={lessonRefs}\n label={data.lessons.label}\n value={data.lessons.data.filter(lesson => lesson.status === 'completed').length}\n maxValue={data.lessons.data.length}\n initialValue={data.lessons.initialProgressValue}\n data={data?.lessons.data.map(lesson => ({\n card: lesson.cardLottie,\n name: lesson.name,\n isCompleted: lesson.status === 'completed',\n onPress: () => handleLessonSegmentClick(lesson),\n }))}\n />,\n ];\n }\n\n if (data.games) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={gameRefs}\n label={data.games.label}\n value={data.games.data.filter(game => game.isPlayed).length}\n maxValue={data.games.data.length}\n initialValue={data.games.initialProgressValue}\n data={data.games.data.map(game => ({\n card: game.cardLottie,\n name: game.name,\n isCompleted: false,\n onPress: () => handleGameSegmentClick(game),\n }))}\n />,\n ];\n }\n\n if (data.puzzles) {\n itemTypes = [\n ...itemTypes,\n <SegmentedGameCard\n ref={puzzleRefs}\n label={data.puzzles.label}\n value={data.puzzles.data.filter(puzzle => puzzle.solved).length}\n maxValue={data.puzzles.data.length}\n initialValue={data.puzzles.initialProgressValue}\n data={data.puzzles.data.map(puzzle => ({\n card: puzzle.cardLottie,\n name: puzzle.name,\n isCompleted: puzzle.solved,\n onPress: () => handlePuzzleSegmentClick(puzzle),\n }))}\n />,\n ];\n }\n\n if (data.tables) {\n itemTypes = [\n ...itemTypes,\n <TablesCard\n ref={tableRef}\n label={data.tables.label}\n data={data.tables.data}\n onPress={onTableSegmentClick}\n openModesOfTable={data.tables.openModesOfTable}\n />,\n ];\n }\n }\n\n return itemTypes;\n }, [\n data,\n gameRefs,\n puzzleRefs,\n lessonRefs,\n handleLessonSegmentClick,\n handleGameSegmentClick,\n handlePuzzleSegmentClick,\n onTableSegmentClick,\n ]);\n\n const sleepyBoiItem = useMemo(\n () => [\n <LottieAnimation\n src={LOTTIE.SLEEPY_BOI}\n width={sleepyBoiDimension}\n height={sleepyBoiDimension}\n />,\n ],\n [],\n );\n\n // Start game launcher journey only when isLoading has become false and data is available\n useEffect(() => {\n if (isLoading || !data || isJourneyActive) {\n return;\n }\n\n if (\n (data?.puzzles && journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) ||\n (data?.lessons && journeyId === JOURNEY_ID_STUDENT.CIRCLE_LESSONS_INTRO_JOURNEY)\n ) {\n startLessonPuzzleGamesJourney(journeyId, data?.puzzles, data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY / CIRCLE_LESSONS_INTRO_JOURNEY has higher priority\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INTRO_JOURNEY) {\n startTablesJourney(data?.tables, isTutorialOnboardingDone);\n\n return;\n }\n\n if (data?.tables && journeyId === JOURNEY_ID_STUDENT.CIRCLE_TABLES_INFINTE_JOURNEY) {\n startInfiniteTablesJourney();\n\n return;\n }\n }, [\n data,\n isJourneyActive,\n isLoading,\n isTutorialOnboardingDone,\n journeyId,\n startInfiniteTablesJourney,\n startLessonPuzzleGamesJourney,\n startTablesJourney,\n ]);\n\n if (isLoading) {\n return <CircularLoader />;\n }\n\n if (!data) {\n return (\n <Carousel\n items={sleepyBoiItem}\n analyticsNext={{\n analyticsLabel: '',\n }}\n analyticsPrev={{\n analyticsLabel: '',\n }}\n />\n );\n }\n\n return (\n <Carousel\n ref={carouselRefs}\n items={items}\n defaultIndex={defaultIndex}\n onNext={playSwipeSound}\n onPrev={playSwipeSound}\n analyticsNext={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.NEXT_ACTIVITY,\n }}\n analyticsPrev={{\n analyticsLabel: GAME_LAUNCHER_ANALYTICS_EVENTS.PREV_ACTIVITY,\n }}\n />\n );\n },\n);\n"],"names":["sleepyBoiDimension","GAME_LAUNCHER_SIZE","GAME_LAUNCHER_ASSET_PADDING","GameLauncher","memo","onSegmentClick","journeyId","data","isLoading","isTutorialOnboardingDone","defaultIndex","onJourneyComplete","carouselRefs","useRef","lessonRefs","tableRef","isJourneyActive","useJourney","playSwipeSound","play","useCircleSounds","onTableSegmentClick","useCallback","table","CircleSoundKey","ProjectType","onTableInfiniteModeClick","handleLessonSegmentClick","lesson","handleGameSegmentClick","game","handlePuzzleSegmentClick","puzzle","gameRefs","puzzleRefs","startLessonPuzzleGamesJourney","useGameLauncherJourney","startInfiniteTablesJourney","useTableInfiniteLauncherJourney","startTablesJourney","useTableLauncherJourney","items","useMemo","itemTypes","jsx","SegmentedGameCard","TablesCard","sleepyBoiItem","LottieAnimation","LOTTIE","useEffect","JOURNEY_ID_STUDENT","CircularLoader","Carousel","GAME_LAUNCHER_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,IAAqBC,IAAqBC,GAEnCC,KAAuCC;AAAA,EAClD,CAAC;AAAA,IACC,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAeC,EAAsB,IAAI,GACzCC,IAAaD,EAA+B,IAAI,GAChDE,IAAWF,EAAsB,IAAI,GAErC,EAAE,iBAAAG,MAAoBC,KAEtB,EAAE,gBAAAC,G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AAAA,EAAM,WAAWD,MAAc6C,EAAmB,mCAClD5C,KAAA,QAAAA,EAAM,WAAWD,MAAc6C,EAAmB,8BACnD;AACA,UAAAhB,EAA8B7B,GAAWC,KAAA,gBAAAA,EAAM,SAASA,KAAA,gBAAAA,EAAM,OAAO;AAErE;AAAA,QACF;AAEA,YAAIA,KAAA,QAAAA,EAAM,UAAUD,MAAc6C,EAAmB,6BAA6B;AAC7D,UAAAZ,EAAAhC,KAAA,gBAAAA,EAAM,QAAQE,CAAwB;AAEzD;AAAA,QACF;AAEA,YAAIF,KAAA,QAAAA,EAAM,UAAUD,MAAc6C,EAAmB,+BAA+B;AACvD,UAAAd;AAE3B;AAAA,QACF;AAAA;AAAA,IAAA,GACC;AAAA,MACD9B;AAAA,MACAS;AAAA,MACAR;AAAA,MACAC;AAAA,MACAH;AAAA,MACA+B;AAAA,MACAF;AAAA,MACAI;AAAA,IAAA,CACD,GAEG/B,sBACM4C,GAAe,CAAA,CAAA,IAGpB7C,IAeH,gBAAAqC;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAKzC;AAAA,QACL,OAAA6B;AAAA,QACA,cAAA/B;AAAA,QACA,QAAQQ;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBoC,EAA+B;AAAA,QACjD;AAAA,QACA,eAAe;AAAA,UACb,gBAAgBA,EAA+B;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA,IAxBA,gBAAAV;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,OAAON;AAAA,QACP,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,QACA,eAAe;AAAA,UACb,gBAAgB;AAAA,QAClB;AAAA,MAAA;AAAA,IAAA;AAAA,EAoBR;AACF;"}
@@ -1,223 +1,271 @@
1
- import { jsx as t, Fragment as R } from "react/jsx-runtime";
2
- import { useRef as L, useCallback as E, useMemo as de, useEffect as se } from "react";
3
- import te from "../../../../../assets/line-icons/icons/carat-right.js";
4
- import { PLATFORM_EVENTS_STUDENT as re } from "../../../../analytics-events/platform-events-student.js";
5
- import { JOURNEY_ID_STUDENT as me } from "../../../../journey/journey-id/journey-id-student.js";
6
- import { IndicatorType as c } from "../../../../journey/use-journey/constants.js";
7
- import { useJourney as Te } from "../../../../journey/use-journey/use-journey.js";
8
- import ne from "../../../../ui/buttons/icon-button/icon-button.js";
9
- import { useUIContext as ue } from "../../../../ui/context/context.js";
10
- import y from "../../../../ui/layout/flex-view.js";
11
- import a from "../../../../ui/text/text.js";
12
- import { getTheme as he } from "../../../../ui/theme/get-theme.js";
13
- import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as p } from "../../../enum/circle-onboarding-steps.js";
14
- import { useCircleSounds as ge } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
- import { SegmentedGameCard as Ee } from "../../comps/segmented-game-card/segmented-game-card.js";
16
- import { GAME_LAUNCHER_ANALYTICS_EVENTS as oe } from "../../game-launcher-analytics-events.js";
17
- import { GO_TO_NEXT_SLIDE_AFTER_MS as pe, SHOW_LABEL_HIGHLIGHT_AFTER_MS as Ie, SHOW_NUDGE_AFTER_MS as _e, SLIDE_TO_LESSON_MS as Ce } from "./constants.js";
18
- import { ProjectType as fe } from "../../../games/web-view/enums/project-type-enum.js";
19
- const xe = ({
1
+ import { jsx as t, Fragment as V } from "react/jsx-runtime";
2
+ import { useRef as v, useCallback as m, useMemo as _e, useEffect as se } from "react";
3
+ import ce from "../../../../../assets/line-icons/icons/carat-right.js";
4
+ import { PLATFORM_EVENTS_STUDENT as le } from "../../../../analytics-events/platform-events-student.js";
5
+ import { JOURNEY_ID_STUDENT as H } from "../../../../journey/journey-id/journey-id-student.js";
6
+ import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
7
+ import { useJourney as Ae } from "../../../../journey/use-journey/use-journey.js";
8
+ import de from "../../../../ui/buttons/icon-button/icon-button.js";
9
+ import { useUIContext as Ie } from "../../../../ui/context/context.js";
10
+ import G from "../../../../ui/layout/flex-view.js";
11
+ import T from "../../../../ui/text/text.js";
12
+ import { getTheme as Ce } from "../../../../ui/theme/get-theme.js";
13
+ import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as u } from "../../../enum/circle-onboarding-steps.js";
14
+ import { useCircleSounds as Le } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
15
+ import { SegmentedGameCard as Te } from "../../comps/segmented-game-card/segmented-game-card.js";
16
+ import { GAME_LAUNCHER_ANALYTICS_EVENTS as he } from "../../game-launcher-analytics-events.js";
17
+ import { GO_TO_NEXT_SLIDE_AFTER_MS as Oe, SHOW_LABEL_HIGHLIGHT_AFTER_MS as fe, SHOW_NUDGE_AFTER_MS as ge, SLIDE_TO_LESSON_MS as Ne } from "./constants.js";
18
+ import { ProjectType as me } from "../../../games/web-view/enums/project-type-enum.js";
19
+ const $e = ({
20
20
  carouselRefs: n,
21
- onSegmentClick: S,
22
- onJourneyComplete: N
21
+ onSegmentClick: C,
22
+ onJourneyComplete: L,
23
+ lessonRefs: i
23
24
  }) => {
24
- const o = me.CIRCLE_ACTIVITIES_INTRO_JOURNEY, { device: ie } = he(), d = ie === "mobile", I = d ? "ab3-bold" : "ab2-bold", i = L(null), r = L(null), l = L(null), _ = L([]), { playButtonSound: b } = ge(), { nextCoachmark: s, setJourney: P, endJourney: H } = Te(), { onEvent: C } = ue(), G = E(
25
+ const { device: ue } = Ce(), h = ue === "mobile", O = h ? "ab3-bold" : "ab2-bold", a = v(null), c = v(null), E = v([]), { playButtonSound: B } = Le(), { nextCoachmark: g, setJourney: U, endJourney: f } = Ae(), { onEvent: N } = Ie(), k = m(
25
26
  (e) => {
26
- C(re.ONBOARDING_STEP_VIEWED, {
27
+ N(le.ONBOARDING_STEP_VIEWED, {
27
28
  step: e
28
29
  });
29
30
  },
30
- [C]
31
- ), U = E(
31
+ [N]
32
+ ), S = m(
32
33
  (e) => {
33
- C(re.ONBOARDING_STEP_COMPLETED, {
34
+ N(le.ONBOARDING_STEP_COMPLETED, {
34
35
  step: e
35
36
  });
36
37
  },
37
- [C]
38
- ), m = E(
39
- (e, f, A, O = !1) => {
40
- var u, h;
41
- O || (b(), (h = n.current) == null || h.goToIndex(((u = n.current) == null ? void 0 : u.currentIndex) + 1), s(o, !1, pe)), G(e);
42
- const T = setTimeout(() => {
43
- clearTimeout(T), f.startLabelAnimation(A);
44
- }, Ie);
45
- _.current.push(T), s(o, !0, _e);
38
+ [N]
39
+ ), p = m(
40
+ (e, r, l, b = !1, P) => {
41
+ var s, A;
42
+ b || (B(), (A = n.current) == null || A.goToIndex(((s = n.current) == null ? void 0 : s.currentIndex) + 1), g(P, !1, Oe)), k(e);
43
+ const _ = setTimeout(() => {
44
+ clearTimeout(_), r.startLabelAnimation(l);
45
+ }, fe);
46
+ E.current.push(_), g(P, !0, ge);
46
47
  },
47
- [n, o, s, b, G]
48
- ), Y = E(
49
- (e) => {
50
- S(e, fe.PUZZLE), U(p.PUZZLE_ACTIVITY), H(o), N(o);
48
+ [n, g, B, k]
49
+ ), w = m(
50
+ (e, r) => {
51
+ C(e, me.PUZZLE), S(u.PUZZLE_ACTIVITY), f(r), L(r);
52
+ },
53
+ [f, L, C, S]
54
+ ), x = m(
55
+ (e, r) => {
56
+ C(e, me.LESSON), S(u.SKILL_ACTIVITY), f(r), L(r);
51
57
  },
52
- [H, o, N, S, U]
53
- ), k = E(
54
- (e, f) => {
55
- var B, V, w, x, D, M, J, W, X, $, F, Z, j, K, q, Q, z, ee;
56
- if (!((B = n == null ? void 0 : n.current) != null && B.nextBtnRef.current) || !((V = r == null ? void 0 : r.current) != null && V.segmentedCardWrapperRef.current) || !((w = i == null ? void 0 : i.current) != null && w.labelRef.current) || !((x = r == null ? void 0 : r.current) != null && x.labelRef.current) || !e)
58
+ [f, L, C, S]
59
+ ), y = m(
60
+ (e, r, l) => {
61
+ var M, W, $, D, X, F, Z, K, q, Q, z, j, ee, te, re, ie, ne, oe, ae;
62
+ const b = !!l, P = !!r;
63
+ if (!((M = i == null ? void 0 : i.current) != null && M.segmentedCardWrapperRef.current) || (!((W = n == null ? void 0 : n.current) != null && W.nextBtnRef.current) || !(($ = a == null ? void 0 : a.current) != null && $.labelRef.current) || !((D = c == null ? void 0 : c.current) != null && D.labelRef.current) || !r) && e === H.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
57
64
  return;
58
- const A = ((J = (M = (D = l.current) == null ? void 0 : D.labelRef) == null ? void 0 : M.current) == null ? void 0 : J.getBoundingClientRect()) || {
65
+ const _ = ((Z = (F = (X = i.current) == null ? void 0 : X.labelRef) == null ? void 0 : F.current) == null ? void 0 : Z.getBoundingClientRect()) || {
59
66
  height: 0,
60
67
  width: 0
61
- }, O = (($ = (X = (W = i.current) == null ? void 0 : W.labelRef) == null ? void 0 : X.current) == null ? void 0 : $.getBoundingClientRect()) || {
68
+ }, s = ((Q = (q = (K = a.current) == null ? void 0 : K.labelRef) == null ? void 0 : q.current) == null ? void 0 : Q.getBoundingClientRect()) || {
62
69
  height: 0,
63
70
  width: 0
64
- }, T = ((j = (Z = (F = r.current) == null ? void 0 : F.labelRef) == null ? void 0 : Z.current) == null ? void 0 : j.getBoundingClientRect()) || {
71
+ }, A = ((ee = (j = (z = c.current) == null ? void 0 : z.labelRef) == null ? void 0 : j.current) == null ? void 0 : ee.getBoundingClientRect()) || {
65
72
  height: 0,
66
73
  width: 0
67
- }, u = ((Q = (q = (K = r.current) == null ? void 0 : K.segmentedCardWrapperRef) == null ? void 0 : q.current) == null ? void 0 : Q.getBoundingClientRect()) || {
74
+ }, R = ((ie = (re = (te = i.current) == null ? void 0 : te.segmentedCardWrapperRef) == null ? void 0 : re.current) == null ? void 0 : ie.getBoundingClientRect()) || {
68
75
  height: 0,
69
76
  width: 0
70
77
  };
71
- let h = [];
72
- f && l.current && (h = [
73
- {
74
- originalElementToHighlightRef: l.current.labelRef,
75
- isActive: !1,
76
- type: c.TOOLTIP,
77
- elementToHighlight: /* @__PURE__ */ t(R, {}),
78
- indicator: {
79
- position: "top",
80
- backgroundColor: "BLUE_4",
81
- tooltipItem: /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(a, { $renderAs: I, children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
82
- tooltipXCoOrdinates: A.width / 2,
83
- tooltipYCoOrdinates: A.height + 10
84
- }
85
- },
86
- {
87
- originalElementToHighlightRef: (z = n.current) == null ? void 0 : z.nextBtnRef,
88
- isActive: !1,
89
- type: c.NUDGE,
90
- elementToHighlight: /* @__PURE__ */ t(
91
- ne,
92
- {
93
- renderAs: "secondary",
94
- Icon: te,
95
- onClick: () => m(
96
- p.GAMES_ACTIVITY,
97
- i.current,
98
- "ORANGE_4"
99
- ),
100
- analyticsLabel: oe.JOURNEY_NEXT_ACTIVITY
101
- }
102
- ),
103
- indicator: {
104
- nudge: "click",
105
- content: !d && /* @__PURE__ */ t(a, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
106
- nudgePointerX: 0,
107
- nudgePointerY: 0
108
- }
109
- }
110
- ]);
111
- const ce = [
78
+ let Y = [];
79
+ if (b && i.current && (Y = [
112
80
  {
113
81
  originalElementToHighlightRef: i.current.labelRef,
114
82
  isActive: !1,
115
- type: c.TOOLTIP,
116
- elementToHighlight: /* @__PURE__ */ t(R, {}),
83
+ type: d.TOOLTIP,
84
+ elementToHighlight: /* @__PURE__ */ t(V, {}),
117
85
  indicator: {
118
86
  position: "top",
119
- backgroundColor: "ORANGE_4",
120
- tooltipItem: /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(a, { $renderAs: I, children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
121
- tooltipXCoOrdinates: O.width / 2,
122
- tooltipYCoOrdinates: O.height + 10
87
+ backgroundColor: "BLUE_4",
88
+ tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(T, { $renderAs: O, children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
89
+ tooltipXCoOrdinates: _.width / 2,
90
+ tooltipYCoOrdinates: _.height + 10
123
91
  }
124
92
  },
125
- {
126
- originalElementToHighlightRef: n.current.nextBtnRef,
93
+ e === H.CIRCLE_ACTIVITIES_INTRO_JOURNEY ? {
94
+ originalElementToHighlightRef: (ne = n.current) == null ? void 0 : ne.nextBtnRef,
127
95
  isActive: !1,
128
- type: c.NUDGE,
96
+ type: d.NUDGE,
129
97
  elementToHighlight: /* @__PURE__ */ t(
130
- ne,
98
+ de,
131
99
  {
132
100
  renderAs: "secondary",
133
- Icon: te,
134
- onClick: () => m(
135
- p.PUZZLE_ACTIVITY,
136
- r.current,
137
- "PURPLE_4"
101
+ Icon: ce,
102
+ onClick: () => p(
103
+ u.GAMES_ACTIVITY,
104
+ a.current,
105
+ "ORANGE_4",
106
+ !1,
107
+ e
138
108
  ),
139
- analyticsLabel: oe.JOURNEY_NEXT_ACTIVITY
109
+ analyticsLabel: he.JOURNEY_NEXT_ACTIVITY
140
110
  }
141
111
  ),
142
112
  indicator: {
143
113
  nudge: "click",
144
- content: !d && /* @__PURE__ */ t(a, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
114
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
145
115
  nudgePointerX: 0,
146
116
  nudgePointerY: 0
147
117
  }
148
- }
149
- ], ae = [
150
- {
151
- originalElementToHighlightRef: r.current.labelRef,
118
+ } : {
119
+ originalElementToHighlightRef: i.current.segmentedCardWrapperRef,
152
120
  isActive: !1,
153
- type: c.TOOLTIP,
154
- elementToHighlight: /* @__PURE__ */ t(R, {}),
155
- indicator: {
156
- position: "top",
157
- backgroundColor: "PURPLE_4",
158
- tooltipItem: /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(a, { $renderAs: I, children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
159
- tooltipXCoOrdinates: T.width / 2,
160
- tooltipYCoOrdinates: T.height + 10
161
- }
162
- },
163
- {
164
- originalElementToHighlightRef: r.current.segmentedCardWrapperRef,
165
- isActive: !1,
166
- type: c.NUDGE,
121
+ type: d.NUDGE,
167
122
  elementToHighlight: /* @__PURE__ */ t(
168
- Ee,
123
+ Te,
169
124
  {
170
125
  label: "",
171
- value: e.data.filter((g) => g.solved).length,
172
- maxValue: e.data.length,
173
- initialValue: e.initialProgressValue,
174
- data: e.data.map((g) => ({
175
- card: g.cardLottie,
126
+ value: l.data.filter((o) => o.status === "pending").length,
127
+ maxValue: l.data.length,
128
+ initialValue: l.initialProgressValue,
129
+ data: l.data.map((o) => ({
130
+ card: o.cardLottie,
176
131
  name: "",
177
132
  // We dont want to show the name of the puzzle in onboarding
178
- isCompleted: g.solved,
179
- onPress: () => Y(g)
133
+ isCompleted: o.status === "completed",
134
+ onPress: () => x(o, e)
180
135
  }))
181
136
  }
182
137
  ),
183
138
  indicator: {
184
139
  nudge: "click",
185
- content: !d && /* @__PURE__ */ t(a, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
186
- nudgePointerX: u.width * 0.6,
187
- nudgePointerY: u.height * 0.4
140
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Tap here to get started" }),
141
+ nudgePointerX: R.width * 0.6,
142
+ nudgePointerY: R.height * 0.4
188
143
  }
189
144
  }
190
- ];
191
- P(o, [...h, ...ce, ...ae]), (ee = n.current) == null || ee.goToIndex(0);
192
- const v = setTimeout(() => {
193
- clearTimeout(v), s(o);
194
- }, Ce);
195
- _.current.push(v), f && l.current ? m(p.SKILL_ACTIVITY, l.current, "BLUE_4", !0) : m(p.GAMES_ACTIVITY, i.current, "ORANGE_4", !0);
145
+ ]), e === H.CIRCLE_ACTIVITIES_INTRO_JOURNEY && a.current && c.current && P) {
146
+ const o = [
147
+ {
148
+ originalElementToHighlightRef: a.current.labelRef,
149
+ isActive: !1,
150
+ type: d.TOOLTIP,
151
+ elementToHighlight: /* @__PURE__ */ t(V, {}),
152
+ indicator: {
153
+ position: "top",
154
+ backgroundColor: "ORANGE_4",
155
+ tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(T, { $renderAs: O, children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
156
+ tooltipXCoOrdinates: s.width / 2,
157
+ tooltipYCoOrdinates: s.height + 10
158
+ }
159
+ },
160
+ {
161
+ originalElementToHighlightRef: n.current.nextBtnRef,
162
+ isActive: !1,
163
+ type: d.NUDGE,
164
+ elementToHighlight: /* @__PURE__ */ t(
165
+ de,
166
+ {
167
+ renderAs: "secondary",
168
+ Icon: ce,
169
+ onClick: () => p(
170
+ u.PUZZLE_ACTIVITY,
171
+ c.current,
172
+ "PURPLE_4",
173
+ !1,
174
+ e
175
+ ),
176
+ analyticsLabel: he.JOURNEY_NEXT_ACTIVITY
177
+ }
178
+ ),
179
+ indicator: {
180
+ nudge: "click",
181
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
182
+ nudgePointerX: 0,
183
+ nudgePointerY: 0
184
+ }
185
+ }
186
+ ], pe = [
187
+ {
188
+ originalElementToHighlightRef: c.current.labelRef,
189
+ isActive: !1,
190
+ type: d.TOOLTIP,
191
+ elementToHighlight: /* @__PURE__ */ t(V, {}),
192
+ indicator: {
193
+ position: "top",
194
+ backgroundColor: "PURPLE_4",
195
+ tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(T, { $renderAs: O, children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
196
+ tooltipXCoOrdinates: A.width / 2,
197
+ tooltipYCoOrdinates: A.height + 10
198
+ }
199
+ },
200
+ {
201
+ originalElementToHighlightRef: c.current.segmentedCardWrapperRef,
202
+ isActive: !1,
203
+ type: d.NUDGE,
204
+ elementToHighlight: /* @__PURE__ */ t(
205
+ Te,
206
+ {
207
+ label: "",
208
+ value: r.data.filter((I) => I.solved).length,
209
+ maxValue: r.data.length,
210
+ initialValue: r.initialProgressValue,
211
+ data: r.data.map((I) => ({
212
+ card: I.cardLottie,
213
+ name: "",
214
+ // We dont want to show the name of the puzzle in onboarding
215
+ isCompleted: I.solved,
216
+ onPress: () => w(I, e)
217
+ }))
218
+ }
219
+ ),
220
+ indicator: {
221
+ nudge: "click",
222
+ content: !h && /* @__PURE__ */ t(T, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
223
+ nudgePointerX: R.width * 0.6,
224
+ nudgePointerY: R.height * 0.4
225
+ }
226
+ }
227
+ ];
228
+ U(e, [...Y, ...o, ...pe]);
229
+ } else
230
+ U(e, Y);
231
+ (oe = n.current) == null || oe.goToIndex(0);
232
+ const J = setTimeout(() => {
233
+ clearTimeout(J), g(e);
234
+ }, Ne);
235
+ if (E.current.push(J), e === H.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
236
+ b && i.current ? p(u.SKILL_ACTIVITY, i.current, "BLUE_4", !0, e) : p(u.GAMES_ACTIVITY, a.current, "ORANGE_4", !0, e);
237
+ else {
238
+ (ae = i.current) == null || ae.startLabelAnimation("BLUE_4");
239
+ const o = setTimeout(() => {
240
+ clearTimeout(o), g(e, !0);
241
+ }, ge);
242
+ E.current.push(o);
243
+ }
196
244
  },
197
245
  [
198
246
  n,
199
- I,
200
- d,
201
- P,
202
- o,
203
- m,
204
- Y,
205
- s
247
+ i,
248
+ O,
249
+ h,
250
+ U,
251
+ p,
252
+ x,
253
+ w,
254
+ g
206
255
  ]
207
- ), le = de(
256
+ ), Ee = _e(
208
257
  () => ({
209
- gameRefs: i,
210
- puzzleRefs: r,
211
- lessonRefs: l,
212
- startJourney: k
258
+ gameRefs: a,
259
+ puzzleRefs: c,
260
+ startJourney: y
213
261
  }),
214
- [k]
262
+ [y]
215
263
  );
216
264
  return se(() => () => {
217
- _.current.forEach((e) => clearTimeout(e)), _.current = [];
218
- }, [n]), le;
265
+ E.current.forEach((e) => clearTimeout(e)), E.current = [];
266
+ }, [n]), Ee;
219
267
  };
220
268
  export {
221
- xe as useGameLauncherJourney
269
+ $e as useGameLauncherJourney
222
270
  };
223
271
  //# sourceMappingURL=use-game-launcher-journey.js.map
@@ -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 { getTheme } from '../../../../ui/theme/get-theme';\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 { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\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: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\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: !isMobile && (\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: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\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: !isMobile && (\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: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\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: !isMobile && (\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 [\n carouselRefs,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n journeyId,\n goToNextCard,\n handleEndJourney,\n nextCoachmark,\n ],\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","device","getTheme","isMobile","tooltipTextRenderAs","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":";;;;;;;;;;;;;;;;;;AAmCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AACF,MAAoC;AAClC,QAAMC,IAAYC,GAAmB,iCAE/B,EAAE,QAAAC,OAAWC,MACbC,IAAWF,OA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ACX,IAAApE,EAAU,QAAQ,QAAQ,CAASqE,MAAA,aAAaA,CAAK,CAAC,GACtDrE,EAAU,UAAU;EAAC,GAEtB,CAACb,CAAY,CAAC,GAEV+E;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 Lesson,\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 { getTheme } from '../../../../ui/theme/get-theme';\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 lessonRefs,\n}: IUseGameLauncherJourneyProps) => {\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const gameRefs = useRef<ISegmentedGameCardRefs>(null);\n const puzzleRefs = 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 journeyId: JOURNEY_ID_STUDENT,\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, nextCoachmark, playButtonSound, trackEventViewed],\n );\n\n const handleEndJourneyForPuzzle = useCallback(\n (puzzlesData: Puzzle, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(puzzlesData, ProjectType.PUZZLE);\n trackEventCompleted(ActionEvent.PUZZLE_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const handleEndJourneyForLesson = useCallback(\n (lessonsData: Lesson, journeyId: JOURNEY_ID_STUDENT) => {\n onSegmentClick(lessonsData, ProjectType.LESSON);\n trackEventCompleted(ActionEvent.SKILL_ACTIVITY);\n endJourney(journeyId);\n onJourneyComplete(journeyId);\n },\n [endJourney, onJourneyComplete, onSegmentClick, trackEventCompleted],\n );\n\n const startJourney = useCallback(\n (\n journeyId: JOURNEY_ID_STUDENT,\n puzzlesData?: IProject<Puzzle>,\n lessonsData?: IProject<Lesson>,\n ) => {\n // If element refs are not available return, this is just for type safety\n const isLessonAvailable = !!lessonsData;\n const isPuzzleAvailable = !!puzzlesData;\n\n if (\n !lessonRefs?.current?.segmentedCardWrapperRef.current ||\n ((!carouselRefs?.current?.nextBtnRef.current ||\n !gameRefs?.current?.labelRef.current ||\n !puzzleRefs?.current?.labelRef.current ||\n !puzzlesData) &&\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY)\n ) {\n return;\n }\n\n const lessonLabelDims = lessonRefs.current?.labelRef?.current?.getBoundingClientRect() || {\n height: 0,\n width: 0,\n };\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 lessonRefs.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: 'top',\n backgroundColor: 'BLUE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Get faster & stay ahead in school. Practice 3 new skills everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: lessonLabelDims.width / 2,\n tooltipYCoOrdinates: lessonLabelDims.height + 10,\n } as IArrowTooltipProps,\n },\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\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 }\n : {\n originalElementToHighlightRef: lessonRefs.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={lessonsData.data.filter(lesson => lesson.status === 'pending').length}\n maxValue={lessonsData.data.length}\n initialValue={lessonsData.initialProgressValue}\n data={lessonsData.data.map(lesson => ({\n card: lesson.cardLottie,\n name: '', // We dont want to show the name of the puzzle in onboarding\n isCompleted: lesson.status === 'completed',\n onPress: () => handleEndJourneyForLesson(lesson, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n Tap here to get started\n </Text>\n ),\n nudgePointerX: launcherDims.width * 0.6,\n nudgePointerY: launcherDims.height * 0.4,\n } as INudgeProps,\n },\n ];\n }\n\n if (\n journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY &&\n gameRefs.current &&\n puzzleRefs.current &&\n isPuzzleAvailable\n ) {\n const gameSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: gameRefs.current.labelRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: <></>,\n indicator: {\n position: 'top',\n backgroundColor: 'ORANGE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Train to think deeper & plan ahead. Play 3 new games everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: gameLabelDims.width / 2,\n tooltipYCoOrdinates: gameLabelDims.height + 10,\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 false,\n journeyId,\n )\n }\n analyticsLabel={GAME_LAUNCHER_ANALYTICS_EVENTS.JOURNEY_NEXT_ACTIVITY}\n />\n ),\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 },\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: 'top',\n backgroundColor: 'PURPLE_4',\n tooltipItem: (\n <FlexView>\n <Text $renderAs={tooltipTextRenderAs}>\n Think in new ways & stay sharp. Solve 3 new puzzles everyday.\n </Text>\n </FlexView>\n ),\n tooltipXCoOrdinates: puzzleLabelDims.width / 2,\n tooltipYCoOrdinates: puzzleLabelDims.height + 10,\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: () => handleEndJourneyForPuzzle(puzzle, journeyId),\n }))}\n />\n ),\n indicator: {\n nudge: 'click',\n content: !isMobile && (\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 } else {\n setJourney(journeyId, lessonSteps);\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 (journeyId === JOURNEY_ID_STUDENT.CIRCLE_ACTIVITIES_INTRO_JOURNEY) {\n if (isLessonAvailable && lessonRefs.current) {\n goToNextCard(ActionEvent.SKILL_ACTIVITY, lessonRefs.current, 'BLUE_4', true, journeyId);\n } else {\n goToNextCard(ActionEvent.GAMES_ACTIVITY, gameRefs.current!, 'ORANGE_4', true, journeyId);\n }\n } else {\n lessonRefs.current?.startLabelAnimation('BLUE_4');\n const delayBeforeShowingNudge = setTimeout(() => {\n clearTimeout(delayBeforeShowingNudge);\n nextCoachmark(journeyId, true);\n }, SHOW_NUDGE_AFTER_MS);\n\n timerRefs.current.push(delayBeforeShowingNudge); // Store to cleanup later\n }\n },\n [\n carouselRefs,\n lessonRefs,\n tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n puzzleRefs,\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","lessonRefs","device","getTheme","isMobile","tooltipTextRenderAs","gameRefs","useRef","puzzleRefs","timerRefs","playButtonSound","useCircleSounds","nextCoachmark","setJourney","endJourney","useJourney","trackAnalytics","useUIContext","trackEventViewed","useCallback","step","AnalyticsLabel","trackEventCompleted","goToNextCard","analyticsLabelViewed","refOfNextSlide","color","isFirstSlide","journeyId","_b","_a","GO_TO_NEXT_SLIDE_AFTER_MS","animateLabelTimer","SHOW_LABEL_HIGHLIGHT_AFTER_MS","SHOW_NUDGE_AFTER_MS","handleEndJourneyForPuzzle","puzzlesData","ProjectType","ActionEvent","handleEndJourneyForLesson","lessonsData","startJourney","isLessonAvailable","isPuzzleAvailable","_c","_d","JOURNEY_ID_STUDENT","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","SegmentedGameCard","lesson","gameSteps","puzzleSteps","puzzle","_r","delayBeforeStart","SLIDE_TO_LESSON_MS","_s","delayBeforeShowingNudge","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;;;;AAoCO,MAAMA,KAAyB,CAAC;AAAA,EACrC,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,YAAAC;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,OAAW,UACtBG,IAAsBD,IAAW,aAAa,YAE9CE,IAAWC,EAA+B,IAAI,GAC9CC,IAAaD,EAA+B,IAAI,GAChDE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAG,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,IACxBC,MACG;;AACH,MAAKD,MACajB,MAChBmB,IAAA/B,EAAa,YAAb,QAAA+B,EAAsB,YAAUC,IAAAhC,EAAa,YAAb,gBAAAgC,EAAsB,gBAAe,IACvDlB,EAAAgB,GAAW,IAAOG,EAAyB,IAG3Db,EAAiBM,CAAoB;AAE/B,YAAAQ,IAAoB,WAAW,MAAM;AACzC,qBAAaA,CAAiB,GAC9BP,EAAe,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AW,SAAS,UAAU,IAAM2B,CAAS,IAEtFL,EAAae,EAAY,gBAAgBhC,EAAS,SAAU,YAAY,IAAMsB,CAAS;AAAA,WAEpF;AACM,SAAAqD,KAAAhF,EAAA,YAAA,QAAAgF,GAAS,oBAAoB;AAClC,cAAAC,IAA0B,WAAW,MAAM;AAC/C,uBAAaA,CAAuB,GACpCtE,EAAcgB,GAAW,EAAI;AAAA,WAC5BM,EAAmB;AAEZ,QAAAzB,EAAA,QAAQ,KAAKyE,CAAuB;AAAA,MAChD;AAAA,IACF;AAAA,IACA;AAAA,MACEpF;AAAA,MACAG;AAAA,MACAI;AAAA,MACAD;AAAA,MACAS;AAAA,MACAU;AAAA,MACAgB;AAAA,MACAJ;AAAA,MACAvB;AAAA,IACF;AAAA,EAAA,GAGIuE,KAAOC;AAAA,IACX,OAAO;AAAA,MACL,UAAA9E;AAAA,MACA,YAAAE;AAAA,MACA,cAAAiC;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA4C,GAAU,MACD,MAAM;AACX,IAAA5E,EAAU,QAAQ,QAAQ,CAAS6E,MAAA,aAAaA,CAAK,CAAC,GACtD7E,EAAU,UAAU;EAAC,GAEtB,CAACX,CAAY,CAAC,GAEVqF;AACT;"}
@@ -12,7 +12,7 @@ const _ = ({ selected: o, grades: s, onSelect: n, onNext: c }) => {
12
12
  }, [o]);
13
13
  const d = (e) => e === "13", u = (e) => {
14
14
  n == null || n(e);
15
- }, f = 6, k = s.reduce((e, a, r) => {
15
+ }, f = 7, k = s.reduce((e, a, r) => {
16
16
  var l;
17
17
  return r % f === 0 && e.push([]), (l = e[e.length - 1]) == null || l.push(a), e;
18
18
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"grade-input.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/grade-input/grade-input.tsx"],"sourcesContent":["import type { Grade, GradeKey, IGradeInputProps } from './grade-input-types';\n\nimport { useEffect, useState } from 'react';\n\nimport Next2Icon from '../../../../../assets/line-icons/icons/next2';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport Text from '../../../../ui/text/text';\nimport { WithGrade } from '../../../leaderboard/comps/with-grade/with-grade';\nimport * as S from './grade-input-styled';\n\nexport const GradeInput = ({ selected, grades, onSelect, onNext }: IGradeInputProps) => {\n const [active, setActive] = useState(selected);\n\n useEffect(() => {\n setActive(selected);\n }, [selected]);\n\n const isOutOfSchool = (gradeKey: GradeKey) => {\n return gradeKey === ('13' as GradeKey);\n };\n\n const handleGrade = (gradeInfo: Grade) => {\n onSelect?.(gradeInfo);\n };\n\n const maxNoOfRows = 6;\n\n // Group grades into rows\n const grade2d: Grade[][] = grades.reduce((acc: Grade[][], grade, index) => {\n if (index % maxNoOfRows === 0) acc.push([]);\n acc[acc.length - 1]?.push(grade);\n\n return acc;\n }, []);\n\n return (\n <S.GradeInputWrapper>\n {selected && (\n <S.NextButtonWrapper>\n <Clickable onClick={onNext} analyticsLabel=\"circle_signup_grade_next\" label=\"\">\n <Next2Icon height={28} width={28} />\n </Clickable>\n </S.NextButtonWrapper>\n )}\n\n <S.GradeInputContainer>\n {grade2d.map((row, rowIndex) => (\n <S.GradeRow key={rowIndex}>\n {row.map(g => (\n <S.GradeButton isActive={active === g.key} key={g.key} onClick={() => handleGrade(g)}>\n {isOutOfSchool(g.key) && (\n <WithGrade grade={g.key}>\n <Text\n $renderAs={active === g.key ? 'ab1-bold' : 'ab1'}\n $color={active === g.key ? 'WHITE' : 'BLACK'}\n >\n {g.label}\n </Text>\n </WithGrade>\n )}\n {!isOutOfSchool(g.key) && (\n <Text $renderAs={'ab1'} $color={active === g.key ? 'BLACK' : 'WHITE'}>\n {g.label}\n </Text>\n )}\n </S.GradeButton>\n ))}\n </S.GradeRow>\n ))}\n </S.GradeInputContainer>\n </S.GradeInputWrapper>\n );\n};\n"],"names":["GradeInput","selected","grades","onSelect","onNext","active","setActive","useState","useEffect","isOutOfSchool","gradeKey","handleGrade","gradeInfo","maxNoOfRows","grade2d","acc","grade","index","_a","jsxs","S.GradeInputWrapper","S.NextButtonWrapper","jsx","Clickable","Next2Icon","S.GradeInputContainer","row","rowIndex","S.GradeRow","g","S.GradeButton","WithGrade","Text"],"mappings":";;;;;;;AAUO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,UAAAC,GAAU,QAAAC,QAA+B;AACtF,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAASN,CAAQ;AAE7C,EAAAO,EAAU,MAAM;AACd,IAAAF,EAAUL,CAAQ;AAAA,EAAA,GACjB,CAACA,CAAQ,CAAC;AAEP,QAAAQ,IAAgB,CAACC,MACdA,MAAc,MAGjBC,IAAc,CAACC,MAAqB;AACxC,IAAAT,KAAA,QAAAA,EAAWS;AAAA,EAAS,GAGhBC,IAAc,GAGdC,IAAqBZ,EAAO,OAAO,CAACa,GAAgBC,GAAOC,MAAU;;AACzE,WAAIA,IAAQJ,MAAgB,KAAOE,EAAA,KAAK,CAAA,CAAE,IAC1CG,IAAAH,EAAIA,EAAI,SAAS,CAAC,MAAlB,QAAAG,EAAqB,KAAKF,IAEnBD;AAAA,EACT,GAAG,CAAE,CAAA;AAGH,SAAA,gBAAAI,EAACC,GAAA,EACE,UAAA;AAAA,IAAAnB,uBACEoB,GAAA,EACC,UAAC,gBAAAC,EAAAC,GAAA,EAAU,SAASnB,GAAQ,gBAAe,4BAA2B,OAAM,IAC1E,4BAACoB,GAAU,EAAA,QAAQ,IAAI,OAAO,IAAI,GACpC,EACF,CAAA;AAAA,IAGD,gBAAAF,EAAAG,GAAA,EACE,UAAQX,EAAA,IAAI,CAACY,GAAKC,MACjB,gBAAAL,EAACM,GAAA,EACE,UAAAF,EAAI,IAAI,CAAAG,MACN,gBAAAV,EAAAW,GAAA,EAAc,UAAUzB,MAAWwB,EAAE,KAAiB,SAAS,MAAMlB,EAAYkB,CAAC,GAChF,UAAA;AAAA,MAAApB,EAAcoB,EAAE,GAAG,uBACjBE,GAAU,EAAA,OAAOF,EAAE,KAClB,UAAA,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,WAAW3B,MAAWwB,EAAE,MAAM,aAAa;AAAA,UAC3C,QAAQxB,MAAWwB,EAAE,MAAM,UAAU;AAAA,UAEpC,UAAEA,EAAA;AAAA,QAAA;AAAA,MAAA,GAEP;AAAA,MAED,CAACpB,EAAcoB,EAAE,GAAG,uBAClBG,GAAK,EAAA,WAAW,OAAO,QAAQ3B,MAAWwB,EAAE,MAAM,UAAU,SAC1D,YAAE,OACL;AAAA,IAAA,EAAA,GAd4CA,EAAE,GAgBlD,CACD,EAnBc,GAAAF,CAoBjB,CACD,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"grade-input.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/grade-input/grade-input.tsx"],"sourcesContent":["import type { Grade, GradeKey, IGradeInputProps } from './grade-input-types';\n\nimport { useEffect, useState } from 'react';\n\nimport Next2Icon from '../../../../../assets/line-icons/icons/next2';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport Text from '../../../../ui/text/text';\nimport { WithGrade } from '../../../leaderboard/comps/with-grade/with-grade';\nimport * as S from './grade-input-styled';\n\nexport const GradeInput = ({ selected, grades, onSelect, onNext }: IGradeInputProps) => {\n const [active, setActive] = useState(selected);\n\n useEffect(() => {\n setActive(selected);\n }, [selected]);\n\n const isOutOfSchool = (gradeKey: GradeKey) => {\n return gradeKey === ('13' as GradeKey);\n };\n\n const handleGrade = (gradeInfo: Grade) => {\n onSelect?.(gradeInfo);\n };\n\n const maxNoOfRows = 7;\n\n // Group grades into rows\n const grade2d: Grade[][] = grades.reduce((acc: Grade[][], grade, index) => {\n if (index % maxNoOfRows === 0) acc.push([]);\n acc[acc.length - 1]?.push(grade);\n\n return acc;\n }, []);\n\n return (\n <S.GradeInputWrapper>\n {selected && (\n <S.NextButtonWrapper>\n <Clickable onClick={onNext} analyticsLabel=\"circle_signup_grade_next\" label=\"\">\n <Next2Icon height={28} width={28} />\n </Clickable>\n </S.NextButtonWrapper>\n )}\n\n <S.GradeInputContainer>\n {grade2d.map((row, rowIndex) => (\n <S.GradeRow key={rowIndex}>\n {row.map(g => (\n <S.GradeButton isActive={active === g.key} key={g.key} onClick={() => handleGrade(g)}>\n {isOutOfSchool(g.key) && (\n <WithGrade grade={g.key}>\n <Text\n $renderAs={active === g.key ? 'ab1-bold' : 'ab1'}\n $color={active === g.key ? 'WHITE' : 'BLACK'}\n >\n {g.label}\n </Text>\n </WithGrade>\n )}\n {!isOutOfSchool(g.key) && (\n <Text $renderAs={'ab1'} $color={active === g.key ? 'BLACK' : 'WHITE'}>\n {g.label}\n </Text>\n )}\n </S.GradeButton>\n ))}\n </S.GradeRow>\n ))}\n </S.GradeInputContainer>\n </S.GradeInputWrapper>\n );\n};\n"],"names":["GradeInput","selected","grades","onSelect","onNext","active","setActive","useState","useEffect","isOutOfSchool","gradeKey","handleGrade","gradeInfo","maxNoOfRows","grade2d","acc","grade","index","_a","jsxs","S.GradeInputWrapper","S.NextButtonWrapper","jsx","Clickable","Next2Icon","S.GradeInputContainer","row","rowIndex","S.GradeRow","g","S.GradeButton","WithGrade","Text"],"mappings":";;;;;;;AAUO,MAAMA,IAAa,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,UAAAC,GAAU,QAAAC,QAA+B;AACtF,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAASN,CAAQ;AAE7C,EAAAO,EAAU,MAAM;AACd,IAAAF,EAAUL,CAAQ;AAAA,EAAA,GACjB,CAACA,CAAQ,CAAC;AAEP,QAAAQ,IAAgB,CAACC,MACdA,MAAc,MAGjBC,IAAc,CAACC,MAAqB;AACxC,IAAAT,KAAA,QAAAA,EAAWS;AAAA,EAAS,GAGhBC,IAAc,GAGdC,IAAqBZ,EAAO,OAAO,CAACa,GAAgBC,GAAOC,MAAU;;AACzE,WAAIA,IAAQJ,MAAgB,KAAOE,EAAA,KAAK,CAAA,CAAE,IAC1CG,IAAAH,EAAIA,EAAI,SAAS,CAAC,MAAlB,QAAAG,EAAqB,KAAKF,IAEnBD;AAAA,EACT,GAAG,CAAE,CAAA;AAGH,SAAA,gBAAAI,EAACC,GAAA,EACE,UAAA;AAAA,IAAAnB,uBACEoB,GAAA,EACC,UAAC,gBAAAC,EAAAC,GAAA,EAAU,SAASnB,GAAQ,gBAAe,4BAA2B,OAAM,IAC1E,4BAACoB,GAAU,EAAA,QAAQ,IAAI,OAAO,IAAI,GACpC,EACF,CAAA;AAAA,IAGD,gBAAAF,EAAAG,GAAA,EACE,UAAQX,EAAA,IAAI,CAACY,GAAKC,MACjB,gBAAAL,EAACM,GAAA,EACE,UAAAF,EAAI,IAAI,CAAAG,MACN,gBAAAV,EAAAW,GAAA,EAAc,UAAUzB,MAAWwB,EAAE,KAAiB,SAAS,MAAMlB,EAAYkB,CAAC,GAChF,UAAA;AAAA,MAAApB,EAAcoB,EAAE,GAAG,uBACjBE,GAAU,EAAA,OAAOF,EAAE,KAClB,UAAA,gBAAAP;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,WAAW3B,MAAWwB,EAAE,MAAM,aAAa;AAAA,UAC3C,QAAQxB,MAAWwB,EAAE,MAAM,UAAU;AAAA,UAEpC,UAAEA,EAAA;AAAA,QAAA;AAAA,MAAA,GAEP;AAAA,MAED,CAACpB,EAAcoB,EAAE,GAAG,uBAClBG,GAAK,EAAA,WAAW,OAAO,QAAQ3B,MAAWwB,EAAE,MAAM,UAAU,SAC1D,YAAE,OACL;AAAA,IAAA,EAAA,GAd4CA,EAAE,GAgBlD,CACD,EAnBc,GAAAF,CAoBjB,CACD,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,5 +1,7 @@
1
1
  import { State as e } from "./sign-up-types.js";
2
2
  const h = [e.ACTIVE, e.PAUSED, e.PAID], i = [e.TRIAL, e.DEMO], p = [
3
+ { label: "KG", key: "0" },
4
+ { label: "1", key: "1", sup: "st" },
3
5
  { label: "2", key: "2", sup: "nd" },
4
6
  { label: "3", key: "3", sup: "rd" },
5
7
  { label: "4", key: "4", sup: "th" },
@@ -11,7 +13,7 @@ const h = [e.ACTIVE, e.PAUSED, e.PAID], i = [e.TRIAL, e.DEMO], p = [
11
13
  { label: "10", key: "10", sup: "th" },
12
14
  { label: "11", key: "11", sup: "th" },
13
15
  { label: "12", key: "12", sup: "th" }
14
- ], t = 440, s = 640, n = window.innerWidth / t, a = window.innerHeight / s, l = Math.min(n, a), u = Math.min(s * l, s), b = Math.min(t * l, t);
16
+ ], t = 440, s = 640, a = window.innerWidth / t, n = window.innerHeight / s, l = Math.min(a, n), u = Math.min(s * l, s), b = Math.min(t * l, t);
15
17
  export {
16
18
  s as ACTUAL_HEIGHT,
17
19
  t as ACTUAL_WIDTH,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/features/circle-games/sign-up/constants.ts"],"sourcesContent":["import type { Grade } from './comp/grade-input/grade-input-types';\n\nimport { State } from './sign-up-types';\n\nexport const userIsEnrolledCases = [State.ACTIVE, State.PAUSED, State.PAID];\nexport const userIsOnTrialCases = [State.TRIAL, State.DEMO];\n\nexport const GRADES: Grade[] = [\n { label: '2', key: '2', sup: 'nd' },\n { label: '3', key: '3', sup: 'rd' },\n { label: '4', key: '4', sup: 'th' },\n { label: '5', key: '5', sup: 'th' },\n { label: '6', key: '6', sup: 'th' },\n { label: '7', key: '7', sup: 'th' },\n { label: '8', key: '8', sup: 'th' },\n { label: '9', key: '9', sup: 'th' },\n { label: '10', key: '10', sup: 'th' },\n { label: '11', key: '11', sup: 'th' },\n { label: '12', key: '12', sup: 'th' },\n];\n\nexport const MIN_HEIGHT_TO_SUPPORT = 540;\nexport const ACTUAL_WIDTH = 440;\nexport const ACTUAL_HEIGHT = 640;\n\nconst widthRatio = window.innerWidth / ACTUAL_WIDTH;\nconst heightRatio = window.innerHeight / ACTUAL_HEIGHT;\nconst ratio = Math.min(widthRatio, heightRatio);\n\nexport const CONTAINER_HEIGHT = Math.min(ACTUAL_HEIGHT * ratio, ACTUAL_HEIGHT);\nexport const CONTAINER_WIDTH = Math.min(ACTUAL_WIDTH * ratio, ACTUAL_WIDTH);\n"],"names":["userIsEnrolledCases","State","userIsOnTrialCases","GRADES","ACTUAL_WIDTH","ACTUAL_HEIGHT","widthRatio","heightRatio","ratio","CONTAINER_HEIGHT","CONTAINER_WIDTH"],"mappings":";AAIO,MAAMA,IAAsB,CAACC,EAAM,QAAQA,EAAM,QAAQA,EAAM,IAAI,GAC7DC,IAAqB,CAACD,EAAM,OAAOA,EAAM,IAAI,GAE7CE,IAAkB;AAAA,EAC7B,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AAAA,EACpC,EAAE,OAAO,MAAM,KAAK,MAAM,KAAK,KAAK;AACtC,GAGaC,IAAe,KACfC,IAAgB,KAEvBC,IAAa,OAAO,aAAaF,GACjCG,IAAc,OAAO,cAAcF,GACnCG,IAAQ,KAAK,IAAIF,GAAYC,CAAW,GAEjCE,IAAmB,KAAK,IAAIJ,IAAgBG,GAAOH,CAAa,GAChEK,IAAkB,KAAK,IAAIN,IAAeI,GAAOJ,CAAY;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/features/circle-games/sign-up/constants.ts"],"sourcesContent":["import type { Grade } from './comp/grade-input/grade-input-types';\n\nimport { State } from './sign-up-types';\n\nexport const userIsEnrolledCases = [State.ACTIVE, State.PAUSED, State.PAID];\nexport const userIsOnTrialCases = [State.TRIAL, State.DEMO];\n\nexport const GRADES: Grade[] = [\n { label: 'KG', key: '0' },\n { label: '1', key: '1', sup: 'st' },\n { label: '2', key: '2', sup: 'nd' },\n { label: '3', key: '3', sup: 'rd' },\n { label: '4', key: '4', sup: 'th' },\n { label: '5', key: '5', sup: 'th' },\n { label: '6', key: '6', sup: 'th' },\n { label: '7', key: '7', sup: 'th' },\n { label: '8', key: '8', sup: 'th' },\n { label: '9', key: '9', sup: 'th' },\n { label: '10', key: '10', sup: 'th' },\n { label: '11', key: '11', sup: 'th' },\n { label: '12', key: '12', sup: 'th' },\n];\n\nexport const MIN_HEIGHT_TO_SUPPORT = 540;\nexport const ACTUAL_WIDTH = 440;\nexport const ACTUAL_HEIGHT = 640;\n\nconst widthRatio = window.innerWidth / ACTUAL_WIDTH;\nconst heightRatio = window.innerHeight / ACTUAL_HEIGHT;\nconst ratio = Math.min(widthRatio, heightRatio);\n\nexport const CONTAINER_HEIGHT = Math.min(ACTUAL_HEIGHT * ratio, ACTUAL_HEIGHT);\nexport const CONTAINER_WIDTH = Math.min(ACTUAL_WIDTH * ratio, ACTUAL_WIDTH);\n"],"names":["userIsEnrolledCases","State","userIsOnTrialCases","GRADES","ACTUAL_WIDTH","ACTUAL_HEIGHT","widthRatio","heightRatio","ratio","CONTAINER_HEIGHT","CONTAINER_WIDTH"],"mappings":";AAIO,MAAMA,IAAsB,CAACC,EAAM,QAAQA,EAAM,QAAQA,EAAM,IAAI,GAC7DC,IAAqB,CAACD,EAAM,OAAOA,EAAM,IAAI,GAE7CE,IAAkB;AAAA,EAC7B,EAAE,OAAO,MAAM,KAAK,IAAI;AAAA,EACxB,EAAE,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK;AAAA,EAClC,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_INTRO_JOURNEY", R.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", R.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", R))(E || {});
1
+ var E = /* @__PURE__ */ ((R) => (R.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", R.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", R.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", R.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", R.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", R.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", R.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", R.CIRCLE_LESSONS_INTRO_JOURNEY = "CIRCLE_LESSONS_INTRO_JOURNEY", R.CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY", R.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", R.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", R))(E || {});
2
2
  export {
3
3
  E as JOURNEY_ID_STUDENT
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n CIRCLE_STREAK_REDUCTION_JOURNEY = 'CIRCLE_STREAK_REDUCTION_JOURNEY',\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAC9BA,EAAA,gCAAgC,kCAGhCA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBAZbA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"journey-id-student.js","sources":["../../../../src/features/journey/journey-id/journey-id-student.ts"],"sourcesContent":["export enum JOURNEY_ID_STUDENT {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY',\n CIRCLE_LEADERBOARD_INTRO_JOURNEY = 'CIRCLE_LEADERBOARD_INTRO_JOURNEY',\n CIRCLE_POINTS_REWARD_JOURNEY = 'CIRCLE_POINTS_REWARD_JOURNEY',\n CIRCLE_STREAK_UPDATE_JOURNEY = 'CIRCLE_STREAK_UPDATE_JOURNEY',\n CIRCLE_TUTORIAL_JOURNEY = 'CIRCLE_TUTORIAL_JOURNEY',\n CIRCLE_TABLES_INTRO_JOURNEY = 'CIRCLE_TABLES_INTRO_JOURNEY',\n CIRCLE_TABLES_INFINTE_JOURNEY = 'CIRCLE_TABLES_INFINITE_JOURNEY',\n CIRCLE_LESSONS_INTRO_JOURNEY = 'CIRCLE_LESSONS_INTRO_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n CIRCLE_STREAK_REDUCTION_JOURNEY = 'CIRCLE_STREAK_REDUCTION_JOURNEY',\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,+BAA+B,gCAG/BA,EAAA,kCAAkC,mCAClCA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBAbbA,IAAAA,KAAA,CAAA,CAAA;"}
package/dist/index.d.ts CHANGED
@@ -2772,8 +2772,8 @@ export declare interface IProjectData extends IProjects {
2772
2772
  }
2773
2773
 
2774
2774
  export declare interface IProjects {
2775
- games: IProject<Game>;
2776
- puzzles: IProject<Puzzle>;
2775
+ games?: IProject<Game>;
2776
+ puzzles?: IProject<Puzzle>;
2777
2777
  lessons?: IProject<Lesson>;
2778
2778
  tables?: ITables;
2779
2779
  }
@@ -4133,6 +4133,7 @@ export declare enum JOURNEY_ID_STUDENT {
4133
4133
  CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY",
4134
4134
  CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY",
4135
4135
  CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY",
4136
+ CIRCLE_LESSONS_INTRO_JOURNEY = "CIRCLE_LESSONS_INTRO_JOURNEY",
4136
4137
  CIRCLE_STREAK_REDUCTION_JOURNEY = "CIRCLE_STREAK_REDUCTION_JOURNEY",
4137
4138
  HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY",
4138
4139
  CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.53",
3
+ "version": "3.1.54-akm-3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"