@cuemath/leap 3.2.1-pd-1 → 3.2.1
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.
- package/dist/assets/illustrations/illustrations.js +0 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +0 -6
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js +56 -59
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +84 -82
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +204 -157
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +100 -87
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -53
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -89
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +25 -29
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -97
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +163 -166
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +34 -34
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +309 -303
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +16 -17
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +6 -38
- package/dist/index.js +27 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -45
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -30
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -84
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/static/arm-mechanical.7561628e.json +0 -4428
- package/dist/static/cent-emoji.3a07ef13.json +0 -5576
- package/dist/static/clap-emoji.aa0b824b.json +0 -12684
- package/dist/static/gem-stone.8c91431a.json +0 -6716
- package/dist/static/partyball.e19caed6.json +0 -11578
- package/dist/static/partypopper.9f7992e8.json +0 -6416
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
- package/dist/static/slotmachine.ba8014dd.json +0 -7779
- package/dist/static/super-emoji.7fad19f6.json +0 -3720
- package/dist/static/victory-emoji.2ca41d92.json +0 -9959
|
@@ -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,gB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B5B,KAAA,gBAAAA,EAAM,SAAS,CAAC,EAACA,KAAA,QAAAA,EAAM,QAAO;AAE5D;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,MACAQ;AAAA,MACAP;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,QAAQO;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBqC,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
|
+
{"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 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 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_K_1_INTRO_JOURNEY)\n ) {\n startLessonPuzzleGamesJourney(journeyId, data?.puzzles, data?.lessons);\n\n return; // CIRCLE_ACTIVITIES_INTRO_JOURNEY / CIRCLE_LESSONS_K_1_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,GACzCC,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,GA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AAA;AAAA,QACC,KAAKzC;AAAA,QACL,OAAA6B;AAAA,QACA,cAAA/B;AAAA,QACA,QAAQO;AAAA,QACR,QAAQA;AAAA,QACR,eAAe;AAAA,UACb,gBAAgBqC,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,270 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import { PLATFORM_EVENTS_STUDENT as
|
|
5
|
-
import { JOURNEY_ID_STUDENT as
|
|
6
|
-
import { IndicatorType as
|
|
7
|
-
import { useJourney as
|
|
8
|
-
import
|
|
9
|
-
import { useUIContext as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { getTheme as
|
|
13
|
-
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as
|
|
14
|
-
import { useCircleSounds as
|
|
15
|
-
import { SegmentedGameCard as
|
|
16
|
-
import { GAME_LAUNCHER_ANALYTICS_EVENTS as
|
|
17
|
-
import { GO_TO_NEXT_SLIDE_AFTER_MS as
|
|
18
|
-
import { ProjectType as
|
|
19
|
-
const
|
|
1
|
+
import { jsx as t, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as H, useCallback as g, useMemo as pe, useEffect as _e } from "react";
|
|
3
|
+
import ae from "../../../../../assets/line-icons/icons/carat-right.js";
|
|
4
|
+
import { PLATFORM_EVENTS_STUDENT as ce } from "../../../../analytics-events/platform-events-student.js";
|
|
5
|
+
import { JOURNEY_ID_STUDENT as U } from "../../../../journey/journey-id/journey-id-student.js";
|
|
6
|
+
import { IndicatorType as d } from "../../../../journey/use-journey/constants.js";
|
|
7
|
+
import { useJourney as fe } from "../../../../journey/use-journey/use-journey.js";
|
|
8
|
+
import de from "../../../../ui/buttons/icon-button/icon-button.js";
|
|
9
|
+
import { useUIContext as Ae } from "../../../../ui/context/context.js";
|
|
10
|
+
import G from "../../../../ui/layout/flex-view.js";
|
|
11
|
+
import s from "../../../../ui/text/text.js";
|
|
12
|
+
import { getTheme as Ie } from "../../../../ui/theme/get-theme.js";
|
|
13
|
+
import { CIRCLE_ONBOARDING_ANALYTICS_STEPS as m } from "../../../enum/circle-onboarding-steps.js";
|
|
14
|
+
import { useCircleSounds as Ce } from "../../../hooks/use-circle-sounds/use-circle-sounds.js";
|
|
15
|
+
import { SegmentedGameCard as se } from "../../comps/segmented-game-card/segmented-game-card.js";
|
|
16
|
+
import { GAME_LAUNCHER_ANALYTICS_EVENTS as Te } from "../../game-launcher-analytics-events.js";
|
|
17
|
+
import { GO_TO_NEXT_SLIDE_AFTER_MS as Le, SHOW_LABEL_HIGHLIGHT_AFTER_MS as Re, SHOW_NUDGE_AFTER_MS as he, SLIDE_TO_LESSON_MS as Oe } from "./constants.js";
|
|
18
|
+
import { ProjectType as ge } from "../../../games/web-view/enums/project-type-enum.js";
|
|
19
|
+
const $e = ({
|
|
20
20
|
carouselRefs: n,
|
|
21
|
-
onSegmentClick:
|
|
22
|
-
onJourneyComplete:
|
|
21
|
+
onSegmentClick: I,
|
|
22
|
+
onJourneyComplete: C
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
24
|
+
const { device: me } = Ie(), T = me === "mobile", L = T ? "ab3-bold" : "ab2-bold", i = H(null), l = H(null), a = H(null), u = H([]), { playButtonSound: B } = Ce(), { nextCoachmark: h, setJourney: Y, endJourney: R } = fe(), { onEvent: O } = Ae(), k = g(
|
|
25
25
|
(e) => {
|
|
26
|
-
|
|
26
|
+
O(ce.ONBOARDING_STEP_VIEWED, {
|
|
27
27
|
step: e
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
|
-
[
|
|
31
|
-
),
|
|
30
|
+
[O]
|
|
31
|
+
), N = g(
|
|
32
32
|
(e) => {
|
|
33
|
-
|
|
33
|
+
O(ce.ONBOARDING_STEP_COMPLETED, {
|
|
34
34
|
step: e
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
(e,
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
clearTimeout(
|
|
44
|
-
},
|
|
45
|
-
|
|
37
|
+
[O]
|
|
38
|
+
), E = g(
|
|
39
|
+
(e, r, c, S = !1, b) => {
|
|
40
|
+
var _, f;
|
|
41
|
+
S || (B(), (f = n.current) == null || f.goToIndex(((_ = n.current) == null ? void 0 : _.currentIndex) + 1), h(b, !1, Le)), k(e);
|
|
42
|
+
const p = setTimeout(() => {
|
|
43
|
+
clearTimeout(p), r.startLabelAnimation(c);
|
|
44
|
+
}, Re);
|
|
45
|
+
u.current.push(p), h(b, !0, he);
|
|
46
46
|
},
|
|
47
|
-
[n,
|
|
48
|
-
),
|
|
49
|
-
(e) => {
|
|
50
|
-
|
|
47
|
+
[n, h, B, k]
|
|
48
|
+
), w = g(
|
|
49
|
+
(e, r) => {
|
|
50
|
+
I(e, ge.PUZZLE), N(m.PUZZLE_ACTIVITY), R(r), C(r);
|
|
51
|
+
},
|
|
52
|
+
[R, C, I, N]
|
|
53
|
+
), x = g(
|
|
54
|
+
(e, r) => {
|
|
55
|
+
I(e, ge.LESSON), N(m.SKILL_ACTIVITY), R(r), C(r);
|
|
51
56
|
},
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
(e,
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
+
[R, C, I, N]
|
|
58
|
+
), y = g(
|
|
59
|
+
(e, r, c) => {
|
|
60
|
+
var M, W, $, D, X, F, Z, K, q, Q, z, j, ee, te, re, ie, ne, oe, le;
|
|
61
|
+
const S = !!c, b = !!r;
|
|
62
|
+
if (!((M = i == null ? void 0 : i.current) != null && M.segmentedCardWrapperRef.current) || (!((W = n == null ? void 0 : n.current) != null && W.nextBtnRef.current) || !(($ = l == null ? void 0 : l.current) != null && $.labelRef.current) || !((D = a == null ? void 0 : a.current) != null && D.labelRef.current) || !r) && e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
|
|
57
63
|
return;
|
|
58
|
-
const
|
|
64
|
+
const p = ((Z = (F = (X = i.current) == null ? void 0 : X.labelRef) == null ? void 0 : F.current) == null ? void 0 : Z.getBoundingClientRect()) || {
|
|
59
65
|
height: 0,
|
|
60
66
|
width: 0
|
|
61
|
-
},
|
|
67
|
+
}, _ = ((Q = (q = (K = l.current) == null ? void 0 : K.labelRef) == null ? void 0 : q.current) == null ? void 0 : Q.getBoundingClientRect()) || {
|
|
62
68
|
height: 0,
|
|
63
69
|
width: 0
|
|
64
|
-
},
|
|
70
|
+
}, f = ((ee = (j = (z = a.current) == null ? void 0 : z.labelRef) == null ? void 0 : j.current) == null ? void 0 : ee.getBoundingClientRect()) || {
|
|
65
71
|
height: 0,
|
|
66
72
|
width: 0
|
|
67
|
-
},
|
|
73
|
+
}, P = ((ie = (re = (te = i.current) == null ? void 0 : te.segmentedCardWrapperRef) == null ? void 0 : re.current) == null ? void 0 : ie.getBoundingClientRect()) || {
|
|
68
74
|
height: 0,
|
|
69
75
|
width: 0
|
|
70
76
|
};
|
|
71
|
-
let
|
|
72
|
-
|
|
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 = [
|
|
77
|
+
let V = [];
|
|
78
|
+
if (S && i.current && (V = [
|
|
112
79
|
{
|
|
113
80
|
originalElementToHighlightRef: i.current.labelRef,
|
|
114
81
|
isActive: !1,
|
|
115
|
-
type:
|
|
116
|
-
elementToHighlight: /* @__PURE__ */ t(
|
|
82
|
+
type: d.TOOLTIP,
|
|
83
|
+
elementToHighlight: /* @__PURE__ */ t(v, {}),
|
|
117
84
|
indicator: {
|
|
118
85
|
position: "top",
|
|
119
|
-
backgroundColor: "
|
|
120
|
-
tooltipItem: /* @__PURE__ */ t(
|
|
121
|
-
tooltipXCoOrdinates:
|
|
122
|
-
tooltipYCoOrdinates:
|
|
86
|
+
backgroundColor: "BLUE_4",
|
|
87
|
+
tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(s, { $renderAs: L, children: "Get faster & stay ahead in school. Practice 3 new skills everyday." }) }),
|
|
88
|
+
tooltipXCoOrdinates: p.width / 2,
|
|
89
|
+
tooltipYCoOrdinates: p.height + 10
|
|
123
90
|
}
|
|
124
91
|
},
|
|
125
|
-
{
|
|
126
|
-
originalElementToHighlightRef: n.current.nextBtnRef,
|
|
92
|
+
e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY ? {
|
|
93
|
+
originalElementToHighlightRef: (ne = n.current) == null ? void 0 : ne.nextBtnRef,
|
|
127
94
|
isActive: !1,
|
|
128
|
-
type:
|
|
95
|
+
type: d.NUDGE,
|
|
129
96
|
elementToHighlight: /* @__PURE__ */ t(
|
|
130
|
-
|
|
97
|
+
de,
|
|
131
98
|
{
|
|
132
99
|
renderAs: "secondary",
|
|
133
|
-
Icon:
|
|
134
|
-
onClick: () =>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
100
|
+
Icon: ae,
|
|
101
|
+
onClick: () => E(
|
|
102
|
+
m.GAMES_ACTIVITY,
|
|
103
|
+
l.current,
|
|
104
|
+
"ORANGE_4",
|
|
105
|
+
!1,
|
|
106
|
+
e
|
|
138
107
|
),
|
|
139
|
-
analyticsLabel:
|
|
108
|
+
analyticsLabel: Te.JOURNEY_NEXT_ACTIVITY
|
|
140
109
|
}
|
|
141
110
|
),
|
|
142
111
|
indicator: {
|
|
143
112
|
nudge: "click",
|
|
144
|
-
content: !
|
|
113
|
+
content: !T && /* @__PURE__ */ t(s, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
|
145
114
|
nudgePointerX: 0,
|
|
146
115
|
nudgePointerY: 0
|
|
147
116
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
originalElementToHighlightRef: r.current.labelRef,
|
|
117
|
+
} : {
|
|
118
|
+
originalElementToHighlightRef: i.current.segmentedCardWrapperRef,
|
|
152
119
|
isActive: !1,
|
|
153
|
-
type:
|
|
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,
|
|
120
|
+
type: d.NUDGE,
|
|
167
121
|
elementToHighlight: /* @__PURE__ */ t(
|
|
168
|
-
|
|
122
|
+
se,
|
|
169
123
|
{
|
|
170
124
|
label: "",
|
|
171
|
-
value:
|
|
172
|
-
maxValue:
|
|
173
|
-
initialValue:
|
|
174
|
-
data:
|
|
175
|
-
card:
|
|
125
|
+
value: c.data.filter((o) => o.status === "pending").length,
|
|
126
|
+
maxValue: c.data.length,
|
|
127
|
+
initialValue: c.initialProgressValue,
|
|
128
|
+
data: c.data.map((o) => ({
|
|
129
|
+
card: o.cardLottie,
|
|
176
130
|
name: "",
|
|
177
131
|
// We dont want to show the name of the puzzle in onboarding
|
|
178
|
-
isCompleted:
|
|
179
|
-
onPress: () =>
|
|
132
|
+
isCompleted: o.status === "completed",
|
|
133
|
+
onPress: () => x(o, e)
|
|
180
134
|
}))
|
|
181
135
|
}
|
|
182
136
|
),
|
|
183
137
|
indicator: {
|
|
184
138
|
nudge: "click",
|
|
185
|
-
content: !
|
|
186
|
-
nudgePointerX:
|
|
187
|
-
nudgePointerY:
|
|
139
|
+
content: !T && /* @__PURE__ */ t(s, { $renderAs: "ab1", $color: "WHITE", children: "Tap here to get started" }),
|
|
140
|
+
nudgePointerX: P.width * 0.6,
|
|
141
|
+
nudgePointerY: P.height * 0.4
|
|
188
142
|
}
|
|
189
143
|
}
|
|
190
|
-
]
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
144
|
+
]), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY && l.current && a.current && b) {
|
|
145
|
+
const o = [
|
|
146
|
+
{
|
|
147
|
+
originalElementToHighlightRef: l.current.labelRef,
|
|
148
|
+
isActive: !1,
|
|
149
|
+
type: d.TOOLTIP,
|
|
150
|
+
elementToHighlight: /* @__PURE__ */ t(v, {}),
|
|
151
|
+
indicator: {
|
|
152
|
+
position: "top",
|
|
153
|
+
backgroundColor: "ORANGE_4",
|
|
154
|
+
tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(s, { $renderAs: L, children: "Train to think deeper & plan ahead. Play 3 new games everyday." }) }),
|
|
155
|
+
tooltipXCoOrdinates: _.width / 2,
|
|
156
|
+
tooltipYCoOrdinates: _.height + 10
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
originalElementToHighlightRef: n.current.nextBtnRef,
|
|
161
|
+
isActive: !1,
|
|
162
|
+
type: d.NUDGE,
|
|
163
|
+
elementToHighlight: /* @__PURE__ */ t(
|
|
164
|
+
de,
|
|
165
|
+
{
|
|
166
|
+
renderAs: "secondary",
|
|
167
|
+
Icon: ae,
|
|
168
|
+
onClick: () => E(
|
|
169
|
+
m.PUZZLE_ACTIVITY,
|
|
170
|
+
a.current,
|
|
171
|
+
"PURPLE_4",
|
|
172
|
+
!1,
|
|
173
|
+
e
|
|
174
|
+
),
|
|
175
|
+
analyticsLabel: Te.JOURNEY_NEXT_ACTIVITY
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
indicator: {
|
|
179
|
+
nudge: "click",
|
|
180
|
+
content: !T && /* @__PURE__ */ t(s, { $renderAs: "ab1", $color: "WHITE", children: "Click to proceed" }),
|
|
181
|
+
nudgePointerX: 0,
|
|
182
|
+
nudgePointerY: 0
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
], Ee = [
|
|
186
|
+
{
|
|
187
|
+
originalElementToHighlightRef: a.current.labelRef,
|
|
188
|
+
isActive: !1,
|
|
189
|
+
type: d.TOOLTIP,
|
|
190
|
+
elementToHighlight: /* @__PURE__ */ t(v, {}),
|
|
191
|
+
indicator: {
|
|
192
|
+
position: "top",
|
|
193
|
+
backgroundColor: "PURPLE_4",
|
|
194
|
+
tooltipItem: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(s, { $renderAs: L, children: "Think in new ways & stay sharp. Solve 3 new puzzles everyday." }) }),
|
|
195
|
+
tooltipXCoOrdinates: f.width / 2,
|
|
196
|
+
tooltipYCoOrdinates: f.height + 10
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
originalElementToHighlightRef: a.current.segmentedCardWrapperRef,
|
|
201
|
+
isActive: !1,
|
|
202
|
+
type: d.NUDGE,
|
|
203
|
+
elementToHighlight: /* @__PURE__ */ t(
|
|
204
|
+
se,
|
|
205
|
+
{
|
|
206
|
+
label: "",
|
|
207
|
+
value: r.data.filter((A) => A.solved).length,
|
|
208
|
+
maxValue: r.data.length,
|
|
209
|
+
initialValue: r.initialProgressValue,
|
|
210
|
+
data: r.data.map((A) => ({
|
|
211
|
+
card: A.cardLottie,
|
|
212
|
+
name: "",
|
|
213
|
+
// We dont want to show the name of the puzzle in onboarding
|
|
214
|
+
isCompleted: A.solved,
|
|
215
|
+
onPress: () => w(A, e)
|
|
216
|
+
}))
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
indicator: {
|
|
220
|
+
nudge: "click",
|
|
221
|
+
content: !T && /* @__PURE__ */ t(s, { $renderAs: "ab1", $color: "WHITE", children: "Click to solve a puzzle" }),
|
|
222
|
+
nudgePointerX: P.width * 0.6,
|
|
223
|
+
nudgePointerY: P.height * 0.4
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
];
|
|
227
|
+
Y(e, [...V, ...o, ...Ee]);
|
|
228
|
+
} else
|
|
229
|
+
Y(e, V);
|
|
230
|
+
(oe = n.current) == null || oe.goToIndex(0);
|
|
231
|
+
const J = setTimeout(() => {
|
|
232
|
+
clearTimeout(J), h(e);
|
|
233
|
+
}, Oe);
|
|
234
|
+
if (u.current.push(J), e === U.CIRCLE_ACTIVITIES_INTRO_JOURNEY)
|
|
235
|
+
S && i.current ? E(m.SKILL_ACTIVITY, i.current, "BLUE_4", !0, e) : E(m.GAMES_ACTIVITY, l.current, "ORANGE_4", !0, e);
|
|
236
|
+
else {
|
|
237
|
+
(le = i.current) == null || le.startLabelAnimation("BLUE_4");
|
|
238
|
+
const o = setTimeout(() => {
|
|
239
|
+
clearTimeout(o), h(e, !0);
|
|
240
|
+
}, he);
|
|
241
|
+
u.current.push(o);
|
|
242
|
+
}
|
|
196
243
|
},
|
|
197
244
|
[
|
|
198
245
|
n,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
P,
|
|
202
|
-
o,
|
|
203
|
-
m,
|
|
246
|
+
L,
|
|
247
|
+
T,
|
|
204
248
|
Y,
|
|
205
|
-
|
|
249
|
+
E,
|
|
250
|
+
x,
|
|
251
|
+
w,
|
|
252
|
+
h
|
|
206
253
|
]
|
|
207
|
-
),
|
|
254
|
+
), ue = pe(
|
|
208
255
|
() => ({
|
|
209
|
-
gameRefs:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
startJourney:
|
|
256
|
+
gameRefs: l,
|
|
257
|
+
lessonRefs: i,
|
|
258
|
+
puzzleRefs: a,
|
|
259
|
+
startJourney: y
|
|
213
260
|
}),
|
|
214
|
-
[
|
|
261
|
+
[y]
|
|
215
262
|
);
|
|
216
|
-
return
|
|
217
|
-
|
|
218
|
-
}, [n]),
|
|
263
|
+
return _e(() => () => {
|
|
264
|
+
u.current.forEach((e) => clearTimeout(e)), u.current = [];
|
|
265
|
+
}, [n]), ue;
|
|
219
266
|
};
|
|
220
267
|
export {
|
|
221
|
-
|
|
268
|
+
$e as useGameLauncherJourney
|
|
222
269
|
};
|
|
223
270
|
//# 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,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MACA,YAAAC;AAAA,MACA,cAAA8B;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAAuC,GAAU,MACD,MAAM;AACX,IAAApE,EAAU,QAAQ,QAAQ,CAASqE,MAAA,aAAaA,CAAK,CAAC,GACtDrE,EAAU,UAAU;EAAC,GAEtB,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}: IUseGameLauncherJourneyProps) => {\n const { device } = getTheme();\n const isMobile = device === 'mobile';\n const tooltipTextRenderAs = isMobile ? 'ab3-bold' : 'ab2-bold';\n\n const lessonRefs = useRef<ISegmentedGameCardRefs>(null);\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 (!lessonRefs?.current?.segmentedCardWrapperRef.current) return;\n\n if (\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 tooltipTextRenderAs,\n isMobile,\n setJourney,\n goToNextCard,\n handleEndJourneyForLesson,\n handleEndJourneyForPuzzle,\n nextCoachmark,\n ],\n );\n\n const data = useMemo(\n () => ({\n gameRefs,\n lessonRefs,\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","device","getTheme","isMobile","tooltipTextRenderAs","lessonRefs","useRef","gameRefs","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;AACF,MAAoC;AAC5B,QAAA,EAAE,QAAAC,OAAWC,MACbC,IAAWF,OAAW,UACtBG,IAAsBD,IAAW,aAAa,YAE9CE,IAAaC,EAA+B,IAAI,GAChDC,IAAWD,EAA+B,IAAI,GAC9CE,IAAaF,EAA+B,IAAI,GAChDG,IAAYH,EAAwC,CAAA,CAAE,GAEtD,EAAE,iBAAAI,MAAoBC,MACtB,EAAE,eAAAC,GAAe,YAAAC,GAAY,YAAAC,MAAeC,GAAW,GACvD,EAAE,SAASC,EAAe,IAAIC,GAAa,GAE3CC,IAAmBC;AAAA,IACvB,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,wBAAwB;AAAA,QACpD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAEXM,IAAsBH;AAAA,IAC1B,CAACC,MAAsB;AACrB,MAAAJ,EAAeK,GAAe,2BAA2B;AAAA,QACvD,MAAAD;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACJ,CAAc;AAAA,EAAA,GAGXO,IAAeJ;AAAA,IACnB,CACEK,GACAC,GACAC,GACAC,IAAwB,IACxBC,MACG;;AACH,MAAKD,MACajB,MAChBmB,IAAA/B,EAAa,YAAb,QAAA+B,EAAsB,YAAUC,IAAAhC,EAAa,YAA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