@cuemath/leap 3.4.8 → 3.4.9-akm-2
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 +7 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +3 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +1 -1
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +31 -16
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +22 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/circle-games/{game-launcher → game-launcher-v2}/api/get-content-for-today/constants.js +1 -1
- package/dist/features/circle-games/game-launcher-v2/api/get-content-for-today/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/api/get-content-for-today/get-circle-home-api.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/card-container-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/card-container.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/constants.js +11 -0
- package/dist/features/circle-games/game-launcher-v2/comps/card-container/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel-styled.js +121 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel.js +106 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/carousel.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/constants.js +9 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge-style.js +20 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge-style.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge.js +17 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-single-badge.js +20 -0
- package/dist/features/circle-games/game-launcher-v2/comps/carousel-badge/carousel-single-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card-styled.js +66 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card.js +81 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/circular-game-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/constants.js +8 -0
- package/dist/features/circle-games/game-launcher-v2/comps/circular-game-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/constants.js +6 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content-styled.js +57 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content.js +9 -0
- package/dist/features/circle-games/game-launcher-v2/comps/game-card-content/game-card-content.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/segmented-game-card/constants.js +7 -0
- package/dist/features/circle-games/game-launcher-v2/comps/segmented-game-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card-styled.js +14 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card.js +24 -0
- package/dist/features/circle-games/game-launcher-v2/comps/swipable-card/swipeable-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/infinite-button/infinite-mode-launcher-button.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text-style.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text-types.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/spl-events-text/spl-events-text.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode/table-mode-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode/table-mode.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/tables-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/comps/tables-card/tables-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/helper.js +94 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/helper.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-analytics-events.js +13 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-analytics-events.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-v2.js +321 -0
- package/dist/features/circle-games/game-launcher-v2/game-launcher-v2.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/helpers.js +8 -0
- package/dist/features/circle-games/game-launcher-v2/helpers.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.js +6 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/use-game-launcher-journey.js +160 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/constants.js +5 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +92 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.js +10 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/use-table-launcher-journey.js +159 -0
- package/dist/features/circle-games/game-launcher-v2/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js +13 -10
- package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
- package/dist/features/circle-games/games/tutorial/tutorial.js +53 -65
- package/dist/features/circle-games/games/tutorial/tutorial.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/journey/use-journey/constants.js +7 -5
- package/dist/features/journey/use-journey/constants.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +84 -72
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +2 -2
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +2 -2
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/constants.js +1 -1
- package/dist/features/post-game-stats/digital-meter/constants.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter-styled.js.map +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js +1 -1
- package/dist/features/post-game-stats/digital-meter/digital-meter.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +5 -4
- package/dist/features/post-game-stats/points/points.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +9 -8
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +107 -105
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/post-game-stats/score/score-styled.js +2 -2
- package/dist/features/post-game-stats/score/score-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/constants.js +1 -1
- package/dist/features/post-game-stats/streak/constants.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +2 -2
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +14 -13
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/index.d.ts +69 -7
- package/dist/index.js +5 -5
- package/dist/static/accuracy-badge.2e161f00.svg +1 -0
- package/dist/static/clock-badge.0adb4ba6.svg +1 -0
- package/dist/static/daily-work-out-complete.eaffdd2b.json +1 -0
- package/dist/static/down-arrow-badge.f462f615.svg +1 -0
- package/dist/static/green-tick.43b94c3a.svg +1 -0
- package/dist/static/nudge-swipe.3b97c01a.json +1 -0
- package/dist/static/pill-tick.c06f606d.json +1 -0
- package/dist/static/points-badge.96bdecc9.svg +1 -0
- package/dist/static/star-badge.5450c267.svg +1 -0
- package/dist/static/up-arrow-badge.71fe7ad1.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/carat-left.js +0 -26
- package/dist/assets/line-icons/icons/carat-left.js.map +0 -1
- package/dist/assets/line-icons/icons/carat-right.js +0 -26
- package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/card-container.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js +0 -7
- package/dist/features/circle-games/game-launcher/comps/card-container/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +0 -39
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +0 -85
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +0 -12
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +0 -138
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +0 -105
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-mode-launcher-button.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text-style.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text-types.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/spl-events-text/spl-events-text.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +0 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js +0 -73
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js.map +0 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +0 -1
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js +0 -12
- package/dist/features/circle-games/game-launcher/game-launcher-analytics-events.js.map +0 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +0 -219
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +0 -8
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +0 -286
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js +0 -10
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +0 -137
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +0 -14
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +0 -230
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +0 -1
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/api/get-content-for-today/get-circle-home-api.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/card-container/card-container-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/card-container/card-container.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/infinite-button/infinite-mode-launcher-button.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text-style.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text-types.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/spl-events-text/spl-events-text.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode/table-mode-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode/table-mode.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/constants.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/table-mode-star-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-mode-star/table-mode-star.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-segment-star/table-segment-star-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/table-segment-star/table-segment-star.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/tables-card-styled.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/comps/tables-card/tables-card.js +0 -0
- /package/dist/features/circle-games/{game-launcher → game-launcher-v2}/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +0 -0
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "styled-components";
|
|
2
2
|
import { HEADER_HEIGHT as t } from "./constants.js";
|
|
3
|
-
const n =
|
|
3
|
+
const n = o.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
height: 100%;
|
|
7
7
|
min-height: 250px;
|
|
8
|
-
background: ${({ theme:
|
|
8
|
+
background: ${({ theme: i }) => i.colors.BLACK_1};
|
|
9
9
|
position: relative;
|
|
10
10
|
width: inherit;
|
|
11
|
-
`,
|
|
11
|
+
`, p = o.div`
|
|
12
|
+
padding: 30px 10px 10px 10px;
|
|
13
|
+
`, a = o.div`
|
|
12
14
|
height: ${t}px;
|
|
13
15
|
padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;
|
|
14
16
|
width: 100%;
|
|
15
|
-
background: ${({ theme:
|
|
17
|
+
background: ${({ theme: i }) => i.colors.WHITE_T_03};
|
|
16
18
|
backdrop-filter: blur(40px);
|
|
17
19
|
position: relative;
|
|
18
20
|
flex-shrink: 0;
|
|
19
|
-
`, d =
|
|
21
|
+
`, d = o.div`
|
|
20
22
|
position: absolute;
|
|
21
23
|
right: 16px;
|
|
22
24
|
top: ${(window.ReactNativeTopInset || 0) + 22}px;
|
|
23
25
|
z-index: 1;
|
|
24
26
|
&:hover {
|
|
25
|
-
background: ${({ theme:
|
|
27
|
+
background: ${({ theme: i }) => i.colors.BLACK_4};
|
|
26
28
|
cursor: pointer;
|
|
27
29
|
}
|
|
28
|
-
`, l =
|
|
30
|
+
`, l = o.div`
|
|
29
31
|
display: flex;
|
|
30
32
|
flex-direction: column;
|
|
31
33
|
/* overflow: hidden; */
|
|
32
34
|
flex-grow: 1;
|
|
33
35
|
position: relative;
|
|
34
|
-
`,
|
|
36
|
+
`, s = o.div`
|
|
35
37
|
display: flex;
|
|
36
38
|
justify-content: center;
|
|
37
39
|
align-items: center;
|
|
@@ -50,6 +52,7 @@ export {
|
|
|
50
52
|
a as GameTutorialHeader,
|
|
51
53
|
n as GameTutorialWrapper,
|
|
52
54
|
d as HeaderIconContainer,
|
|
53
|
-
p as
|
|
55
|
+
p as TextWrapper,
|
|
56
|
+
s as VideoContainer
|
|
54
57
|
};
|
|
55
58
|
//# sourceMappingURL=tutorial-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: ${(window.ReactNativeTopInset || 0) + 22}px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n height: 100%;\n width: auto;\n }\n`;\n"],"names":["GameTutorialWrapper","styled","theme","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,
|
|
1
|
+
{"version":3,"file":"tutorial-styled.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { HEADER_HEIGHT } from './constants';\n\nexport const GameTutorialWrapper = styled.div`\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 250px;\n background: ${({ theme }) => theme.colors.BLACK_1};\n position: relative;\n width: inherit;\n`;\n\nexport const TextWrapper = styled.div`\n padding: 30px 10px 10px 10px;\n`;\n\nexport const GameTutorialHeader = styled.div`\n height: ${HEADER_HEIGHT}px;\n padding-top: ${(window.ReactNativeTopInset || 0) + 24}px;\n width: 100%;\n background: ${({ theme }) => theme.colors.WHITE_T_03};\n backdrop-filter: blur(40px);\n position: relative;\n flex-shrink: 0;\n`;\n\nexport const HeaderIconContainer = styled.div`\n position: absolute;\n right: 16px;\n top: ${(window.ReactNativeTopInset || 0) + 22}px;\n z-index: 1;\n &:hover {\n background: ${({ theme }) => theme.colors.BLACK_4};\n cursor: pointer;\n }\n`;\n\nexport const GameTutorialContainer = styled.div`\n display: flex;\n flex-direction: column;\n /* overflow: hidden; */\n flex-grow: 1;\n position: relative;\n`;\n\nexport const VideoContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n & video {\n height: 100%;\n width: auto;\n }\n`;\n"],"names":["GameTutorialWrapper","styled","theme","TextWrapper","GameTutorialHeader","HEADER_HEIGHT","HeaderIconContainer","GameTutorialContainer","VideoContainer"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAK1B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKtCC,IAAcF,EAAO;AAAA;AAAA,GAIrBG,IAAqBH,EAAO;AAAA,YAC7BI,CAAa;AAAA,kBACP,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA,gBAEvC,CAAC,EAAE,OAAAH,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,GAMzCI,IAAsBL,EAAO;AAAA;AAAA;AAAA,UAGhC,OAAO,uBAAuB,KAAK,EAAE;AAAA;AAAA;AAAA,kBAG7B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,GAKxCK,IAAwBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ/BO,IAAiBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,70 +1,58 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as m, useState as
|
|
3
|
-
import
|
|
2
|
+
import { forwardRef as P, useRef as m, useState as n, useImperativeHandle as y, useCallback as f } from "react";
|
|
3
|
+
import A from "../../../../assets/line-icons/icons/cross.js";
|
|
4
4
|
import p from "../../../ui/text/text.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
g && e && /* @__PURE__ */ r(
|
|
56
|
-
j,
|
|
57
|
-
{
|
|
58
|
-
ref: e,
|
|
59
|
-
progress: I,
|
|
60
|
-
duration: W,
|
|
61
|
-
setProgress: d,
|
|
62
|
-
videoWidth: T || 0
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
] });
|
|
66
|
-
};
|
|
5
|
+
import { GameTutorialWrapper as E, GameTutorialHeader as G, HeaderIconContainer as R, GameTutorialContainer as j, VideoContainer as k, TextWrapper as w } from "./tutorial-styled.js";
|
|
6
|
+
import { VideoProgressBar as _ } from "./video-progress-bar/video-progress-bar.js";
|
|
7
|
+
const B = P(
|
|
8
|
+
({ src: h, title: o, onCross: i, showProgress: g = !0, onTutorialPlayedOnce: t, isJourneyActive: T }, W) => {
|
|
9
|
+
const e = m(null), a = m(!1), [I, c] = n(0), [$, b] = n(0), [v, V] = n(null);
|
|
10
|
+
y(W, () => e.current, []);
|
|
11
|
+
const x = f(
|
|
12
|
+
(s) => {
|
|
13
|
+
const C = s.target.currentTime || 0, d = s.target.duration || 1, u = C / d * 100;
|
|
14
|
+
u >= 90 && !a.current && (a.current = !0, t == null || t()), c(u), b(d);
|
|
15
|
+
},
|
|
16
|
+
[t]
|
|
17
|
+
), H = f(() => {
|
|
18
|
+
e.current && V(e.current.clientWidth);
|
|
19
|
+
}, []);
|
|
20
|
+
return /* @__PURE__ */ l(E, { children: [
|
|
21
|
+
(o || i) && /* @__PURE__ */ l(G, { children: [
|
|
22
|
+
o && /* @__PURE__ */ r(p, { $renderAs: "ac3", $color: "WHITE", $align: "center", children: o }),
|
|
23
|
+
i && /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(A, { color: "#fff", onClick: i }) })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(k, { children: /* @__PURE__ */ r(
|
|
26
|
+
"video",
|
|
27
|
+
{
|
|
28
|
+
ref: e,
|
|
29
|
+
onPlay: H,
|
|
30
|
+
loop: !0,
|
|
31
|
+
autoPlay: !0,
|
|
32
|
+
muted: !0,
|
|
33
|
+
src: h,
|
|
34
|
+
onTimeUpdate: x,
|
|
35
|
+
disablePictureInPicture: !0,
|
|
36
|
+
itemType: "video/mp4",
|
|
37
|
+
playsInline: !0
|
|
38
|
+
}
|
|
39
|
+
) }) }),
|
|
40
|
+
g && /* @__PURE__ */ r(
|
|
41
|
+
_,
|
|
42
|
+
{
|
|
43
|
+
ref: e,
|
|
44
|
+
progress: I,
|
|
45
|
+
duration: $,
|
|
46
|
+
setProgress: c,
|
|
47
|
+
videoWidth: v || 0
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
T && /* @__PURE__ */ r(w, { children: /* @__PURE__ */ r(p, { $renderOnMobileAs: "ub3", $renderAs: "ub2", $color: "WHITE_T_87", $align: "center", children: "Please watch the tutorial for each activity before you start." }) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
B.displayName = "Tutorial";
|
|
67
55
|
export {
|
|
68
|
-
|
|
56
|
+
B as Tutorial
|
|
69
57
|
};
|
|
70
58
|
//# sourceMappingURL=tutorial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ChangeEvent } from 'react';\nimport { useCallback, useRef, useState } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport
|
|
1
|
+
{"version":3,"file":"tutorial.js","sources":["../../../../../src/features/circle-games/games/tutorial/tutorial.tsx"],"sourcesContent":["import type { ChangeEvent, ForwardedRef } from 'react';\nimport { forwardRef, useCallback, useRef, useState, useImperativeHandle } from 'react';\n\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './tutorial-styled';\nimport type { ITutorialProps } from './tutorial-types';\nimport { VideoProgressBar } from './video-progress-bar/video-progress-bar';\n\nexport const Tutorial = forwardRef<HTMLVideoElement, ITutorialProps>(\n (\n { src, title, onCross, showProgress = true, onTutorialPlayedOnce, isJourneyActive },\n ref: ForwardedRef<HTMLVideoElement>,\n ) => {\n const internalVideoRef = useRef<HTMLVideoElement | null>(null);\n const hasVideoEnded = useRef(false);\n const [progress, setProgress] = useState(0);\n const [duration, setDuration] = useState(0);\n const [videoWidth, setVideoWidth] = useState<number | null>(null);\n\n // Forward the internal ref to the outside\n useImperativeHandle(ref, () => internalVideoRef.current as HTMLVideoElement, []);\n\n const onProgress = useCallback(\n (e: ChangeEvent<HTMLVideoElement>) => {\n const current = e.target.currentTime || 0;\n const dur = e.target.duration || 1;\n const p = (current / dur) * 100;\n\n if (p >= 90 && !hasVideoEnded.current) {\n hasVideoEnded.current = true;\n onTutorialPlayedOnce?.();\n }\n\n setProgress(p);\n setDuration(dur);\n },\n [onTutorialPlayedOnce],\n );\n\n const onVideoPlay = useCallback(() => {\n if (internalVideoRef.current) {\n setVideoWidth(internalVideoRef.current.clientWidth);\n }\n }, []);\n\n return (\n <Styled.GameTutorialWrapper>\n {(title || onCross) && (\n <Styled.GameTutorialHeader>\n {title && (\n <Text $renderAs=\"ac3\" $color=\"WHITE\" $align=\"center\">\n {title}\n </Text>\n )}\n {onCross && (\n <Styled.HeaderIconContainer>\n <CrossIcon color=\"#fff\" onClick={onCross} />\n </Styled.HeaderIconContainer>\n )}\n </Styled.GameTutorialHeader>\n )}\n\n <Styled.GameTutorialContainer>\n <Styled.VideoContainer>\n <video\n ref={internalVideoRef}\n onPlay={onVideoPlay}\n loop\n autoPlay\n muted\n src={src}\n onTimeUpdate={onProgress}\n disablePictureInPicture\n itemType=\"video/mp4\"\n playsInline\n />\n </Styled.VideoContainer>\n </Styled.GameTutorialContainer>\n {showProgress && (\n <VideoProgressBar\n ref={internalVideoRef}\n progress={progress}\n duration={duration}\n setProgress={setProgress}\n videoWidth={videoWidth || 0}\n />\n )}\n\n {isJourneyActive && (\n <Styled.TextWrapper>\n <Text $renderOnMobileAs=\"ub3\" $renderAs=\"ub2\" $color=\"WHITE_T_87\" $align=\"center\">\n Please watch the tutorial for each activity before you start.\n </Text>\n </Styled.TextWrapper>\n )}\n </Styled.GameTutorialWrapper>\n );\n },\n);\n\nTutorial.displayName = 'Tutorial';\n"],"names":["Tutorial","forwardRef","src","title","onCross","showProgress","onTutorialPlayedOnce","isJourneyActive","ref","internalVideoRef","useRef","hasVideoEnded","progress","setProgress","useState","duration","setDuration","videoWidth","setVideoWidth","useImperativeHandle","onProgress","useCallback","e","current","dur","p","onVideoPlay","jsxs","Styled.GameTutorialWrapper","Styled.GameTutorialHeader","jsx","Text","Styled.HeaderIconContainer","CrossIcon","Styled.GameTutorialContainer","Styled.VideoContainer","VideoProgressBar","Styled.TextWrapper"],"mappings":";;;;;;AASO,MAAMA,IAAWC;AAAA,EACtB,CACE,EAAE,KAAAC,GAAK,OAAAC,GAAO,SAAAC,GAAS,cAAAC,IAAe,IAAM,sBAAAC,GAAsB,iBAAAC,EAAgB,GAClFC,MACG;AACG,UAAAC,IAAmBC,EAAgC,IAAI,GACvDC,IAAgBD,EAAO,EAAK,GAC5B,CAACE,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,CAAC,GACpC,CAACG,GAAYC,CAAa,IAAIJ,EAAwB,IAAI;AAGhE,IAAAK,EAAoBX,GAAK,MAAMC,EAAiB,SAA6B,CAAE,CAAA;AAE/E,UAAMW,IAAaC;AAAA,MACjB,CAACC,MAAqC;AAC9B,cAAAC,IAAUD,EAAE,OAAO,eAAe,GAClCE,IAAMF,EAAE,OAAO,YAAY,GAC3BG,IAAKF,IAAUC,IAAO;AAE5B,QAAIC,KAAK,MAAM,CAACd,EAAc,YAC5BA,EAAc,UAAU,IACDL,KAAA,QAAAA,MAGzBO,EAAYY,CAAC,GACbT,EAAYQ,CAAG;AAAA,MACjB;AAAA,MACA,CAAClB,CAAoB;AAAA,IAAA,GA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INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", E.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", E.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", E.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", E.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", E.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", E.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", E.PLA_SWITCH_USER_JOURNEY = "PLA_SWITCH_USER_JOURNEY", E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.PUZZLE_ATTEMPT_JOURNEY = "PUZZLE_ATTEMPT_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.DOWNLOAD_NODE_JOURNEY = "DOWNLOAD_NODE_JOURNEY", E.DOWNLOAD_BLOCK_JOURNEY = "DOWNLOAD_BLOCK_JOURNEY", E.PUZZLE_ASSIGNED_JOURNEY = "PUZZLE_ASSIGNED_JOURNEY", E.PUZZLE_DASHBOARD_JOURNEY = "PUZZLE_DASHBOARD_JOURNEY", E))(R || {});
|
|
1
|
+
var R = /* @__PURE__ */ ((E) => (E.CIRCLE_ACTIVITIES_INTRO_JOURNEY = "CIRCLE_ACTIVITIES_INTRO_JOURNEY", E.CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2 = "CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2", E.CIRCLE_LEADERBOARD_INTRO_JOURNEY = "CIRCLE_LEADERBOARD_INTRO_JOURNEY", E.CIRCLE_POINTS_REWARD_JOURNEY = "CIRCLE_POINTS_REWARD_JOURNEY", E.CIRCLE_STREAK_UPDATE_JOURNEY = "CIRCLE_STREAK_UPDATE_JOURNEY", E.CIRCLE_TUTORIAL_JOURNEY = "CIRCLE_TUTORIAL_JOURNEY", E.CIRCLE_TABLES_INTRO_JOURNEY = "CIRCLE_TABLES_INTRO_JOURNEY", E.CIRCLE_TABLES_INFINTE_JOURNEY = "CIRCLE_TABLES_INFINITE_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY", E.CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2 = "CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2", E.PLA_SWITCH_USER_JOURNEY = "PLA_SWITCH_USER_JOURNEY", E.HOMEPAGE_JOURNEY = "HOMEPAGE_JOURNEY", E.CHAPTER_PAGE_JOURNEY = "CHAPTER_PAGE_JOURNEY", E.PUZZLE_ATTEMPT_JOURNEY = "PUZZLE_ATTEMPT_JOURNEY", E.CHALLENGE_ARENA_JOURNEY = "CHALLENGE_ARENA_JOURNEY", E.DOWNLOAD_NODE_JOURNEY = "DOWNLOAD_NODE_JOURNEY", E.DOWNLOAD_BLOCK_JOURNEY = "DOWNLOAD_BLOCK_JOURNEY", E.PUZZLE_ASSIGNED_JOURNEY = "PUZZLE_ASSIGNED_JOURNEY", E.PUZZLE_DASHBOARD_JOURNEY = "PUZZLE_DASHBOARD_JOURNEY", E))(R || {});
|
|
2
2
|
export {
|
|
3
3
|
R 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 CIRCLE_LESSONS_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY',\n PLA_SWITCH_USER_JOURNEY = 'PLA_SWITCH_USER_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n PUZZLE_ATTEMPT_JOURNEY = 'PUZZLE_ATTEMPT_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n DOWNLOAD_NODE_JOURNEY = 'DOWNLOAD_NODE_JOURNEY',\n DOWNLOAD_BLOCK_JOURNEY = 'DOWNLOAD_BLOCK_JOURNEY',\n PUZZLE_ASSIGNED_JOURNEY = 'PUZZLE_ASSIGNED_JOURNEY',\n PUZZLE_DASHBOARD_JOURNEY = 'PUZZLE_DASHBOARD_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,mCAAmC,oCACnCA,EAAA,0BAA0B,2BAG1BA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,wBAAwB,yBACxBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,2BAA2B,
|
|
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_ACTIVITIES_INTRO_JOURNEY_V2 = 'CIRCLE_ACTIVITIES_INTRO_JOURNEY_V2',\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_K_1_INTRO_JOURNEY = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY',\n CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2 = 'CIRCLE_LESSONS_K_1_INTRO_JOURNEY_V2',\n PLA_SWITCH_USER_JOURNEY = 'PLA_SWITCH_USER_JOURNEY',\n\n // TODO: Deprecate bottom journeys, they are not actually journeys\n HOMEPAGE_JOURNEY = 'HOMEPAGE_JOURNEY',\n CHAPTER_PAGE_JOURNEY = 'CHAPTER_PAGE_JOURNEY',\n PUZZLE_ATTEMPT_JOURNEY = 'PUZZLE_ATTEMPT_JOURNEY',\n CHALLENGE_ARENA_JOURNEY = 'CHALLENGE_ARENA_JOURNEY',\n DOWNLOAD_NODE_JOURNEY = 'DOWNLOAD_NODE_JOURNEY',\n DOWNLOAD_BLOCK_JOURNEY = 'DOWNLOAD_BLOCK_JOURNEY',\n PUZZLE_ASSIGNED_JOURNEY = 'PUZZLE_ASSIGNED_JOURNEY',\n PUZZLE_DASHBOARD_JOURNEY = 'PUZZLE_DASHBOARD_JOURNEY',\n}\n"],"names":["JOURNEY_ID_STUDENT"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kCAAkC,mCAClCA,EAAA,qCAAqC,sCACrCA,EAAA,mCAAmC,oCACnCA,EAAA,+BAA+B,gCAC/BA,EAAA,+BAA+B,gCAC/BA,EAAA,0BAA0B,2BAC1BA,EAAA,8BAA8B,+BAC9BA,EAAA,gCAAgC,kCAChCA,EAAA,mCAAmC,oCACnCA,EAAA,sCAAsC,uCACtCA,EAAA,0BAA0B,2BAG1BA,EAAA,mBAAmB,oBACnBA,EAAA,uBAAuB,wBACvBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,wBAAwB,yBACxBA,EAAA,yBAAyB,0BACzBA,EAAA,0BAA0B,2BAC1BA,EAAA,2BAA2B,4BArBjBA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.TOOLTIP = "tooltip", e.NUDGE = "nudge", e))(r || {});
|
|
2
|
+
const o = {
|
|
3
3
|
nextCoachmark: () => {
|
|
4
4
|
},
|
|
5
5
|
setJourney: () => {
|
|
@@ -12,10 +12,12 @@ const r = {
|
|
|
12
12
|
},
|
|
13
13
|
coachmarks: [],
|
|
14
14
|
userCompletedJourneyIds: [],
|
|
15
|
-
isJourneyActive: !1
|
|
15
|
+
isJourneyActive: !1,
|
|
16
|
+
trackView: () => {
|
|
17
|
+
}
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
r as IndicatorType,
|
|
21
|
+
o as baseJourneyContext
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["import type { IJourneyContext } from './journey-context-types';\n\nexport enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\n\nexport const baseJourneyContext: IJourneyContext = {\n nextCoachmark: () => {},\n setJourney: () => {},\n addCoachmark: () => {},\n clearJourney: () => {},\n endJourney: () => {},\n coachmarks: [],\n userCompletedJourneyIds: [],\n isJourneyActive: false,\n};\n"],"names":["IndicatorType","baseJourneyContext"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;AAKL,MAAMC,IAAsC;AAAA,EACjD,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,YAAY,CAAC;AAAA,EACb,yBAAyB,CAAC;AAAA,EAC1B,iBAAiB;
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["import type { IJourneyContext } from './journey-context-types';\n\nexport enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\n\nexport const baseJourneyContext: IJourneyContext = {\n nextCoachmark: () => {},\n setJourney: () => {},\n addCoachmark: () => {},\n clearJourney: () => {},\n endJourney: () => {},\n coachmarks: [],\n userCompletedJourneyIds: [],\n isJourneyActive: false,\n trackView: () => {},\n};\n"],"names":["IndicatorType","baseJourneyContext"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;AAKL,MAAMC,IAAsC;AAAA,EACjD,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,YAAY,CAAC;AAAA,EACb,yBAAyB,CAAC;AAAA,EAC1B,iBAAiB;AAAA,EACjB,WAAW,MAAM;AAAA,EAAC;AACpB;"}
|
|
@@ -1,55 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { Coachmark as
|
|
4
|
-
import { usePostUserJourney as
|
|
5
|
-
import { Overlay as
|
|
6
|
-
const
|
|
7
|
-
const [
|
|
1
|
+
import { jsxs as W, jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as M, useState as s, useRef as v, useCallback as c, useMemo as G, useEffect as b } from "react";
|
|
3
|
+
import { Coachmark as F } from "../comps/coachmark/coachmark.js";
|
|
4
|
+
import { usePostUserJourney as I, useGetUserJourney as K } from "../user-journey-api/user-journey-api.js";
|
|
5
|
+
import { Overlay as Q } from "./journey-styled.js";
|
|
6
|
+
const X = M(null), ne = ({ children: U, appId: l, userId: i }) => {
|
|
7
|
+
const [q, z] = s(!0), [D, H] = s(!1), [p, x] = s(null), [y, d] = s([]), [f, A] = s(!1), m = v(-1), t = v(void 0), w = v([]), [L, N] = s(!1), [$, R] = s({
|
|
8
8
|
height: window.innerHeight,
|
|
9
9
|
width: window.innerWidth
|
|
10
|
-
}), { post:
|
|
10
|
+
}), { post: _ } = I(), { data: g = null, get: P } = K(), J = c(
|
|
11
|
+
(e) => {
|
|
12
|
+
_({
|
|
13
|
+
app_id: l,
|
|
14
|
+
user_id: i,
|
|
15
|
+
journey_id: e,
|
|
16
|
+
journey_status: "COMPLETED"
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
[l, _, i]
|
|
20
|
+
), B = c(
|
|
11
21
|
(e, r, o, C = !0) => {
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
22
|
+
var h, n;
|
|
23
|
+
if (y.length > 0) {
|
|
14
24
|
console.error(
|
|
15
25
|
`setJourney: Other Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}`
|
|
16
26
|
);
|
|
17
27
|
return;
|
|
18
28
|
}
|
|
19
|
-
|
|
29
|
+
A(!0), z(C), t.current = e, m.current = -1, d(
|
|
20
30
|
r.map((u) => ({
|
|
21
31
|
...u,
|
|
22
32
|
isActive: !1
|
|
23
33
|
// New coachmarks are inactive by default
|
|
24
34
|
}))
|
|
25
|
-
), o && (
|
|
26
|
-
height: ((
|
|
35
|
+
), o && (R({
|
|
36
|
+
height: ((h = o.current) == null ? void 0 : h.clientHeight) || window.innerHeight,
|
|
27
37
|
width: ((n = o.current) == null ? void 0 : n.clientWidth) || window.innerWidth
|
|
28
|
-
}),
|
|
38
|
+
}), N(!0));
|
|
29
39
|
},
|
|
30
|
-
[
|
|
31
|
-
),
|
|
32
|
-
|
|
40
|
+
[y.length]
|
|
41
|
+
), a = c(() => {
|
|
42
|
+
w.current.forEach((e) => {
|
|
33
43
|
clearTimeout(e);
|
|
34
|
-
}),
|
|
35
|
-
}, []), E =
|
|
44
|
+
}), w.current = [], t.current = void 0, m.current = -1, d([]), A(!1);
|
|
45
|
+
}, []), E = c(
|
|
36
46
|
(e) => {
|
|
37
|
-
|
|
38
|
-
app_id: a,
|
|
39
|
-
user_id: c,
|
|
40
|
-
journey_id: e,
|
|
41
|
-
journey_status: "COMPLETED"
|
|
42
|
-
});
|
|
47
|
+
a(), x((r) => r && !r.includes(e) ? [...r, e] : r), J(e);
|
|
43
48
|
},
|
|
44
|
-
[a,
|
|
45
|
-
),
|
|
49
|
+
[a, J]
|
|
50
|
+
), S = c((e, r) => {
|
|
46
51
|
if (!t.current || e !== t.current) {
|
|
47
52
|
console.error(
|
|
48
53
|
t.current ? `A Journey is already active, Current Journey: ${t.current}, New Journey Request: ${e}` : "addCoachmark was called before setJourney and Journey ID is undefined"
|
|
49
54
|
);
|
|
50
55
|
return;
|
|
51
56
|
}
|
|
52
|
-
|
|
57
|
+
d((o) => [
|
|
53
58
|
...o,
|
|
54
59
|
{
|
|
55
60
|
...r,
|
|
@@ -57,7 +62,7 @@ const K = W(null), re = ({ children: T, appId: a, userId: c }) => {
|
|
|
57
62
|
// New coachmarks are inactive by default
|
|
58
63
|
}
|
|
59
64
|
]);
|
|
60
|
-
}, []),
|
|
65
|
+
}, []), j = c(
|
|
61
66
|
(e, r = !1, o = 0, C = !1) => {
|
|
62
67
|
if (!t.current || e !== t.current) {
|
|
63
68
|
console.error(
|
|
@@ -65,79 +70,86 @@ const K = W(null), re = ({ children: T, appId: a, userId: c }) => {
|
|
|
65
70
|
);
|
|
66
71
|
return;
|
|
67
72
|
}
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
clearTimeout(
|
|
73
|
+
H(C), o !== 0 && d((n) => n.map((u) => ({ ...u, isActive: !1 })));
|
|
74
|
+
const h = setTimeout(() => {
|
|
75
|
+
clearTimeout(h);
|
|
71
76
|
const n = m.current + 1;
|
|
72
|
-
|
|
77
|
+
d((u) => {
|
|
73
78
|
if (n >= u.length || u.length === 0)
|
|
74
|
-
return
|
|
79
|
+
return a(), [];
|
|
75
80
|
m.current = n;
|
|
76
|
-
const
|
|
77
|
-
return
|
|
81
|
+
const k = [...u];
|
|
82
|
+
return k[n].isActive = !0, n > 0 && (k[n - 1].isActive = r), k;
|
|
78
83
|
});
|
|
79
84
|
}, o);
|
|
80
|
-
|
|
85
|
+
w.current.push(h);
|
|
86
|
+
},
|
|
87
|
+
[a]
|
|
88
|
+
), O = c(
|
|
89
|
+
(e) => {
|
|
90
|
+
J(e);
|
|
81
91
|
},
|
|
82
|
-
[
|
|
83
|
-
),
|
|
92
|
+
[J]
|
|
93
|
+
), V = G(
|
|
84
94
|
() => ({
|
|
85
|
-
nextCoachmark:
|
|
95
|
+
nextCoachmark: j,
|
|
86
96
|
setJourney: B,
|
|
87
|
-
addCoachmark:
|
|
88
|
-
clearJourney:
|
|
97
|
+
addCoachmark: S,
|
|
98
|
+
clearJourney: a,
|
|
89
99
|
endJourney: E,
|
|
90
|
-
coachmarks:
|
|
91
|
-
userCompletedJourneyIds:
|
|
92
|
-
isJourneyActive:
|
|
100
|
+
coachmarks: y,
|
|
101
|
+
userCompletedJourneyIds: p,
|
|
102
|
+
isJourneyActive: f,
|
|
103
|
+
trackView: O
|
|
93
104
|
}),
|
|
94
105
|
[
|
|
95
|
-
|
|
106
|
+
j,
|
|
96
107
|
B,
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
S,
|
|
109
|
+
a,
|
|
99
110
|
E,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
y,
|
|
112
|
+
p,
|
|
113
|
+
f,
|
|
114
|
+
O
|
|
103
115
|
]
|
|
104
116
|
);
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
app_id:
|
|
108
|
-
user_id:
|
|
117
|
+
return b(() => {
|
|
118
|
+
l && i && P(i, {
|
|
119
|
+
app_id: l,
|
|
120
|
+
user_id: i,
|
|
109
121
|
journey_status: "COMPLETED"
|
|
110
122
|
});
|
|
111
|
-
}, [
|
|
112
|
-
if (
|
|
113
|
-
const e =
|
|
114
|
-
|
|
123
|
+
}, [l, P, i]), b(() => {
|
|
124
|
+
if (g) {
|
|
125
|
+
const e = g.map((r) => r.journey_id);
|
|
126
|
+
x(e);
|
|
115
127
|
}
|
|
116
|
-
}, [
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
}, [g]), /* @__PURE__ */ W(X.Provider, { value: V, children: [
|
|
129
|
+
f && /* @__PURE__ */ T(
|
|
130
|
+
Q,
|
|
119
131
|
{
|
|
120
132
|
about: "journey-overlay",
|
|
121
|
-
height:
|
|
122
|
-
width:
|
|
123
|
-
$isJourneyBlurred:
|
|
124
|
-
$isBlockingJourney:
|
|
133
|
+
height: $.height,
|
|
134
|
+
width: $.width,
|
|
135
|
+
$isJourneyBlurred: D,
|
|
136
|
+
$isBlockingJourney: q,
|
|
125
137
|
"data-testid": t.current,
|
|
126
|
-
children:
|
|
127
|
-
|
|
138
|
+
children: y.map((e, r) => /* @__PURE__ */ T(
|
|
139
|
+
F,
|
|
128
140
|
{
|
|
129
141
|
coachmark: e,
|
|
130
|
-
isInsideScrollView:
|
|
142
|
+
isInsideScrollView: L
|
|
131
143
|
},
|
|
132
144
|
`coachmark-${r}`
|
|
133
145
|
))
|
|
134
146
|
}
|
|
135
147
|
),
|
|
136
|
-
|
|
148
|
+
U
|
|
137
149
|
] });
|
|
138
150
|
};
|
|
139
151
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
152
|
+
X as JourneyContext,
|
|
153
|
+
ne as JourneyProvider
|
|
142
154
|
};
|
|
143
155
|
//# sourceMappingURL=journey-context-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { FC, RefObject } from 'react';\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isBlockingJourney, setIsBlockingJourney] = useState<boolean>(true);\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n isBlocking: boolean = true,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n setIsBlockingJourney(isBlocking);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: TCoachmarkJourneyProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n $isBlockingJourney={isBlockingJourney}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isBlockingJourney","setIsBlockingJourney","useState","isJourneyBlurred","setIsJourneyBlurred","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","scrollableContRef","isBlocking","item","_a","_b","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,KAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAI,GAClE,CAACC,GAAkBC,CAAmB,IAAIF,EAAkB,EAAK,GACjE,CAACG,GAAyBC,CAA0B,IAAIJ,EAA8B,IAAI,GAC1F,CAACK,GAAeC,CAAgB,IAAIN,EAA4B,CAAE,CAAA,GAClE,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK,GACtDS,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,EAA+B,MAAS,GAC3DE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,CAACG,GAAqBC,CAAsB,IAAId,EAAkB,EAAK,GACvE,CAACe,GAAaC,CAAc,IAAIhB,EAAS;AAAA,IAC7C,QAAQ,OAAO;AAAA,IACf,OAAO,OAAO;AAAA,EAAA,CACf,GAEK,EAAE,MAAMiB,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CACEC,GACAC,GACAC,GACAC,IAAsB,OACnB;;AACC,UAAAtB,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEM,EAAiB,OAAO,0BAA0Ba,CAAE;AAAA,QAAA;AAGvH;AAAA,MACF;AACA,MAAAhB,EAAmB,EAAI,GACvBT,EAAqB4B,CAAU,GAC/BhB,EAAiB,UAAUa,GAC3Bf,EAAa,UAAU,IACvBH;AAAA,QACEmB,EAAW,IAAI,C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,MACAE;AAAA,MACA5B;AAAA,MACAF;AAAA,MACAI;AAAA,IACF;AAAA,EAAA;AAIF,SAAAwC,EAAU,MAAM;AACd,IAAInD,KAASC,KACXuB,EAAmBvB,GAAQ;AAAA,MACzB,QAAQD;AAAA,MACR,SAASC;AAAA,MACT,gBAAgB;AAAA,IAAA,CACjB;AAAA,EAEF,GAAA,CAACD,GAAOwB,GAAoBvB,CAAM,CAAC,GAGtCkD,EAAU,MAAM;AACd,QAAI5B,GAAuB;AACzB,YAAM6B,IAA2B7B,EAAsB,IAAI,CAAA8B,MAAWA,EAAQ,UAAU;AAExF,MAAA7C,EAA2B4C,CAAwB;AAAA,IACrD;AAAA,EAAA,GACC,CAAC7B,CAAqB,CAAC,GAGvB,gBAAA+B,EAAA1D,EAAe,UAAf,EAAwB,OAAOqD,GAC7B,UAAA;AAAA,IACCtC,KAAA,gBAAA4C;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,QAAQrC,EAAY;AAAA,QACpB,OAAOA,EAAY;AAAA,QACnB,mBAAmBd;AAAA,QACnB,oBAAoBH;AAAA,QACpB,eAAaa,EAAiB;AAAA,QAE7B,UAAcN,EAAA,IAAI,CAACgC,GAAWgB,MAC7B,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,WAAAjB;AAAA,YACA,oBAAoBxB;AAAA,UAAA;AAAA,UAFf,aAAawC,CAAK;AAAA,QAAA,CAI1B;AAAA,MAAA;AAAA,IACH;AAAA,IAED1D;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { FC, RefObject } from 'react';\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type { TTrackingId } from '../tracking-id/tracking-id-types';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n TCoachmarkJourneyProps,\n} from './journey-context-types';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isBlockingJourney, setIsBlockingJourney] = useState<boolean>(true);\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>(undefined);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const [isScrollableJourney, setIsScrollableJourney] = useState<boolean>(false);\n const [overlaySize, setOverlaySize] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const saveProgress = useCallback(\n (journeyId: TJourneyId | TTrackingId) => {\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, postJourneyCompletion, userId],\n );\n\n const setJourney = useCallback(\n (\n id: TJourneyId,\n coachmarks: TCoachmarkJourneyProps[],\n scrollableContRef?: RefObject<HTMLDivElement | null>,\n isBlocking: boolean = true,\n ) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n setIsBlockingJourney(isBlocking);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList(\n coachmarks.map((item: TCoachmarkJourneyProps) => {\n return {\n ...item,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps;\n }),\n );\n if (scrollableContRef) {\n setOverlaySize({\n height: scrollableContRef.current?.clientHeight || window.innerHeight,\n width: scrollableContRef.current?.clientWidth || window.innerWidth,\n });\n setIsScrollableJourney(true);\n }\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n saveProgress(journeyId);\n },\n [clearJourney, saveProgress],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: TCoachmarkJourneyProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [\n ...prev,\n {\n ...coachmark,\n isActive: false, // New coachmarks are inactive by default\n } as ICoachmarkProps,\n ]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: TCoachmarkJourneyProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const trackView = useCallback(\n (viewId: TTrackingId) => {\n saveProgress(viewId);\n },\n [saveProgress],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n trackView,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n height={overlaySize.height}\n width={overlaySize.width}\n $isJourneyBlurred={isJourneyBlurred}\n $isBlockingJourney={isBlockingJourney}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark\n key={`coachmark-${index}`}\n coachmark={coachmark}\n isInsideScrollView={isScrollableJourney}\n />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isBlockingJourney","setIsBlockingJourney","useState","isJourneyBlurred","setIsJourneyBlurred","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","isScrollableJourney","setIsScrollableJourney","overlaySize","setOverlaySize","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","saveProgress","useCallback","journeyId","setJourney","id","coachmarks","scrollableContRef","isBlocking","item","_a","_b","clearJourney","timer","endJourney","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","currIndex","updatedCoachmarkList","trackView","viewId","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAgBa,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,KAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAI,GAClE,CAACC,GAAkBC,CAAmB,IAAIF,EAAkB,EAAK,GACjE,CAACG,GAAyBC,CAA0B,IAAIJ,EAA8B,IAAI,GAC1F,CAACK,GAAeC,CAAgB,IAAIN,EAA4B,CAAE,CAAA,GAClE,CAACO,GAAiBC,CAAkB,IAAIR,EAAS,EAAK,GACtDS,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,EAA+B,MAAS,GAC3DE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,CAACG,GAAqBC,CAAsB,IAAId,EAAkB,EAAK,GACvE,CAACe,GAAaC,CAAc,IAAIhB,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UAAf,EAAwB,OAAOwD,GAC7B,UAAA;AAAA,IACCzC,KAAA,gBAAA+C;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,QAAQxC,EAAY;AAAA,QACpB,OAAOA,EAAY;AAAA,QACnB,mBAAmBd;AAAA,QACnB,oBAAoBH;AAAA,QACpB,eAAaa,EAAiB;AAAA,QAE7B,UAAcN,EAAA,IAAI,CAACiC,GAAWkB,MAC7B,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YAEC,WAAAnB;AAAA,YACA,oBAAoBzB;AAAA,UAAA;AAAA,UAFf,aAAa2C,CAAK;AAAA,QAAA,CAI1B;AAAA,MAAA;AAAA,IACH;AAAA,IAED7D;AAAA,EACH,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o, { keyframes as r, css as s } from "styled-components";
|
|
2
|
-
import { GAME_LAUNCHER_SIZE as t } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
|
3
|
-
import { GAME_LAUNCHER_ASSET_PADDING as a } from "../../circle-games/game-launcher/comps/
|
|
2
|
+
import { GAME_LAUNCHER_SIZE as t } from "../../circle-games/game-launcher-v2/comps/card-container/constants.js";
|
|
3
|
+
import { GAME_LAUNCHER_ASSET_PADDING as a } from "../../circle-games/game-launcher-v2/comps/circular-game-card/constants.js";
|
|
4
4
|
const p = 50 * 84 / 100, c = r`
|
|
5
5
|
0%{
|
|
6
6
|
opacity: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accuracy-styled.js","sources":["../../../../src/features/post-game-stats/accuracy/accuracy-styled.tsx"],"sourcesContent":["import styled, { keyframes, css } from 'styled-components';\n\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING } from '../../circle-games/game-launcher/comps/
|
|
1
|
+
{"version":3,"file":"accuracy-styled.js","sources":["../../../../src/features/post-game-stats/accuracy/accuracy-styled.tsx"],"sourcesContent":["import styled, { keyframes, css } from 'styled-components';\n\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher-v2/comps/card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING } from '../../circle-games/game-launcher-v2/comps/circular-game-card/constants';\n\nconst MASK_PADDING = (50 * 84) / 100;\n\nconst fadeIn = keyframes`\n 0%{\n opacity: 0;\n }\n 100%{\n opacity: 1;\n }\n`;\n\nconst fadeOut = keyframes`\n 0%{\n opacity: 1;\n }\n 100%{\n opacity: 0;\n }\n`;\n\nexport const Accuracy = styled.div`\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n`;\n\nexport const AccuracyMeterLottie = styled.div`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n position: absolute;\n flex: 1;\n z-index: 1;\n`;\n\nexport const AnimatedAccuracyNeedleContainer = styled.div<{\n $translateX?: number;\n $translateY?: number;\n $rotate?: number;\n}>`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n position: absolute;\n z-index: 2;\n transform: ${({ $translateX = 0, $translateY = 0, $rotate = 0 }) =>\n `translateX(${$translateX}px) translateY(${$translateY}px) rotate(${$rotate}deg)`};\n`;\n\nexport const AccuracyNeedleLottie = styled.div`\n height: 100%;\n width: 100%;\n`;\n\nexport const TextWrapper = styled.div<{\n $duration: number;\n $delay: number;\n $animationType: 'fadein' | 'fadeout';\n}>`\n z-index: 2;\n opacity: 0;\n position: absolute;\n animation: ${({ $animationType, $duration, $delay }) => css`\n ${$animationType === 'fadein' ? fadeIn : fadeOut} ${$duration}ms ${$delay}ms ease forwards\n `};\n transform: translateY(${((GAME_LAUNCHER_SIZE + MASK_PADDING) * 84) / 200 + 25}px);\n`;\n\nexport const PercentTextWrapper = styled.div<{\n $animationType?: 'fadein' | 'fadeout';\n $duration?: number;\n}>`\n position: absolute;\n z-index: 20;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n\n ${({ $animationType, $duration }) =>\n $animationType &&\n $duration &&\n css`\n animation: ${$animationType === 'fadein' ? fadeIn : fadeOut} ${$duration}ms linear forwards;\n `}\n`;\n"],"names":["MASK_PADDING","fadeIn","keyframes","fadeOut","Accuracy","styled","GAME_LAUNCHER_SIZE","AccuracyMeterLottie","GAME_LAUNCHER_ASSET_PADDING","AnimatedAccuracyNeedleContainer","$translateX","$translateY","$rotate","AccuracyNeedleLottie","TextWrapper","$animationType","$duration","$delay","css","PercentTextWrapper"],"mappings":";;;AAKA,MAAMA,IAAgB,KAAK,KAAM,KAE3BC,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAUD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASHE,IAAWC,EAAO;AAAA,YACnBC,CAAkB;AAAA,WACnBA,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQhBC,IAAsBF,EAAO;AAAA,YAC9BC,IAAqBE,CAA2B;AAAA,WACjDF,IAAqBE,CAA2B;AAAA;AAAA;AAAA;AAAA,GAM9CC,IAAkCJ,EAAO;AAAA,YAK1CC,IAAqBE,CAA2B;AAAA,WACjDF,IAAqBE,CAA2B;AAAA;AAAA;AAAA,eAG5C,CAAC,EAAE,aAAAE,IAAc,GAAG,aAAAC,IAAc,GAAG,SAAAC,IAAU,EAAE,MAC5D,cAAcF,CAAW,kBAAkBC,CAAW,cAAcC,CAAO,MAAM;AAAA,GAGxEC,IAAuBR,EAAO;AAAA;AAAA;AAAA,GAK9BS,IAAcT,EAAO;AAAA;AAAA;AAAA;AAAA,eAQnB,CAAC,EAAE,gBAAAU,GAAgB,WAAAC,GAAW,QAAAC,QAAaC;AAAA,MACpDH,MAAmB,WAAWd,IAASE,CAAO,IAAIa,CAAS,MAAMC,CAAM;AAAA,GAC1E;AAAA,2BACyBX,IAAqBN,KAAgB,KAAM,MAAM,EAAE;AAAA,GAGlEmB,IAAqBd,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUrC,CAAC,EAAE,gBAAAU,GAAgB,WAAAC,EAAU,MAC7BD,KACAC,KACAE;AAAA,mBACeH,MAAmB,WAAWd,IAASE,CAAO,IAAIa,CAAS;AAAA,KACzE;AAAA;"}
|