@cuemath/leap 2.8.48-rj-beta-1 → 2.8.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/features/analytics-events/platform-events-student.js +5 -6
  2. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  3. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +24 -24
  4. package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
  5. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +58 -60
  6. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
  7. package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
  8. package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js +6 -6
  9. package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js.map +1 -1
  10. package/dist/features/circle-games/leaderboard/hooks/{use-intersection-observer/use-intersection-observer.tsx.js → useIntersectionObserver.js} +1 -1
  11. package/dist/features/circle-games/leaderboard/hooks/useIntersectionObserver.js.map +1 -0
  12. package/dist/features/circle-games/leaderboard/hooks/{use-timer/use-timer.js → useTimer.js} +1 -1
  13. package/dist/features/circle-games/leaderboard/hooks/useTimer.js.map +1 -0
  14. package/dist/features/circle-games/leaderboard/leaderboard-styled.js +16 -20
  15. package/dist/features/circle-games/leaderboard/leaderboard-styled.js.map +1 -1
  16. package/dist/features/circle-games/leaderboard/leaderboard.js +87 -96
  17. package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
  18. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  19. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  20. package/dist/features/milestone/create/milestone-create-styled.js +2 -3
  21. package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
  22. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +62 -56
  23. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  24. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +102 -98
  25. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  26. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +126 -117
  27. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
  28. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +104 -98
  29. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  30. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +1 -0
  31. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
  32. package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-cta.js +7 -7
  33. package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-cta.js.map +1 -1
  34. package/dist/features/milestone/milestone-tests/tests-list/tests-list.js +12 -12
  35. package/dist/features/milestone/milestone-tests/tests-list/tests-list.js.map +1 -1
  36. package/dist/features/sheets/resources-list/resource-item/resource-item.js +89 -87
  37. package/dist/features/sheets/resources-list/resource-item/resource-item.js.map +1 -1
  38. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +60 -61
  39. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
  40. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  41. package/dist/features/trial-session/trial-session-view.js +71 -73
  42. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  43. package/dist/index.d.ts +27 -36
  44. package/dist/index.js +231 -235
  45. package/dist/index.js.map +1 -1
  46. package/package.json +2 -3
  47. package/dist/features/circle-games/enum/circle-action-ids.js +0 -5
  48. package/dist/features/circle-games/enum/circle-action-ids.js.map +0 -1
  49. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js +0 -12
  50. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +0 -1
  51. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js +0 -11
  52. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +0 -1
  53. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar-constants.js +0 -5
  54. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar-constants.js.map +0 -1
  55. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +0 -41
  56. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +0 -1
  57. package/dist/features/circle-games/leaderboard/hooks/use-intersection-observer/use-intersection-observer.tsx.js.map +0 -1
  58. package/dist/features/circle-games/leaderboard/hooks/use-timer/use-timer.js.map +0 -1
  59. package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js +0 -25
  60. package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { PLUGINS as t } from "../../node_modules/@cuemath/analytics-v2/dist/constants.js";
2
- var i = /* @__PURE__ */ ((e) => (e.PAGE_VIEWED = "page_viewed", e.CUSTOM_TEST_SUBMITTED = "custom_test_submitted", e.ACTIVITY_STARTED = "activity_started", e.ACTIVITY_TUTORIAL_SEEN = "activity_tutorial_seen", e.STREAK_ICON_CLICKED = "streak_icon_clicked", e.LEADERBOARD_BUTTON_CLICKED = "leaderboard_button_clicked", e.ONBOARDING_STEP_VIEWED = "onboarding_step_viewed", e.ONBOARDING_STEP_COMPLETED = "onboarding_step_completed", e.COACHMARK_DISMISSED = "coachmark_dismissed", e))(i || {});
3
- const I = {
2
+ var _ = /* @__PURE__ */ ((e) => (e.PAGE_VIEWED = "page_viewed", e.CUSTOM_TEST_SUBMITTED = "custom_test_submitted", e.ACTIVITY_STARTED = "activity_started", e.ACTIVITY_TUTORIAL_SEEN = "activity_tutorial_seen", e.STREAK_ICON_CLICKED = "streak_icon_clicked", e.LEADERBOARD_BUTTON_CLICKED = "leaderboard_button_clicked", e.ONBOARDING_STEP_VIEWED = "onboarding_step_viewed", e.ONBOARDING_STEP_COMPLETED = "onboarding_step_completed", e))(_ || {});
3
+ const o = {
4
4
  page_viewed: [t.MIXPANEL],
5
5
  // circle on leap mixpanel events
6
6
  activity_started: [t.MIXPANEL],
@@ -8,11 +8,10 @@ const I = {
8
8
  streak_icon_clicked: [t.MIXPANEL],
9
9
  leaderboard_button_clicked: [t.MIXPANEL],
10
10
  onboarding_step_viewed: [t.MIXPANEL],
11
- onboarding_step_completed: [t.MIXPANEL],
12
- coachmark_dismissed: [t.MIXPANEL]
11
+ onboarding_step_completed: [t.MIXPANEL]
13
12
  };
14
13
  export {
15
- i as PLATFORM_EVENTS_STUDENT,
16
- I as PLATFORM_WHITELIST_EVENTS_STUDENT
14
+ _ as PLATFORM_EVENTS_STUDENT,
15
+ o as PLATFORM_WHITELIST_EVENTS_STUDENT
17
16
  };
18
17
  //# sourceMappingURL=platform-events-student.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-events-student.js","sources":["../../../src/features/analytics-events/platform-events-student.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\n/**\n ** Global/Platform specific events that needs to be tracked goes here\n ** Naming convention needs to be snake_case\n */\nexport enum PLATFORM_EVENTS_STUDENT {\n PAGE_VIEWED = 'page_viewed',\n CUSTOM_TEST_SUBMITTED = 'custom_test_submitted',\n\n // circle on leap mixpanel events\n ACTIVITY_STARTED = 'activity_started',\n ACTIVITY_TUTORIAL_SEEN = 'activity_tutorial_seen',\n STREAK_ICON_CLICKED = 'streak_icon_clicked',\n LEADERBOARD_BUTTON_CLICKED = 'leaderboard_button_clicked',\n ONBOARDING_STEP_VIEWED = 'onboarding_step_viewed',\n ONBOARDING_STEP_COMPLETED = 'onboarding_step_completed',\n COACHMARK_DISMISSED = 'coachmark_dismissed',\n}\n\n/**\n ** Events that need to be tracked at particular plugins\n ** Value will be array of strings.\n */\nexport const PLATFORM_WHITELIST_EVENTS_STUDENT = {\n [PLATFORM_EVENTS_STUDENT.PAGE_VIEWED]: [PLUGINS.MIXPANEL],\n\n // circle on leap mixpanel events\n [PLATFORM_EVENTS_STUDENT.ACTIVITY_STARTED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ACTIVITY_TUTORIAL_SEEN]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.STREAK_ICON_CLICKED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.LEADERBOARD_BUTTON_CLICKED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.COACHMARK_DISMISSED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PLATFORM_EVENTS_STUDENT","PLATFORM_WHITELIST_EVENTS_STUDENT","PLUGINS"],"mappings":";AAMY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,wBAAwB,yBAGxBA,EAAA,mBAAmB,oBACnBA,EAAA,yBAAyB,0BACzBA,EAAA,sBAAsB,uBACtBA,EAAA,6BAA6B,8BAC7BA,EAAA,yBAAyB,0BACzBA,EAAA,4BAA4B,6BAC5BA,EAAA,sBAAsB,uBAXZA,IAAAA,KAAA,CAAA,CAAA;AAkBL,MAAMC,IAAoC;AAAA,EAC9C,aAAsC,CAACC,EAAQ,QAAQ;AAAA;AAAA,EAGvD,kBAA2C,CAACA,EAAQ,QAAQ;AAAA,EAC5D,wBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,qBAA8C,CAACA,EAAQ,QAAQ;AAAA,EAC/D,4BAAqD,CAACA,EAAQ,QAAQ;AAAA,EACtE,wBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,2BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,qBAA8C,CAACA,EAAQ,QAAQ;AAClE;"}
1
+ {"version":3,"file":"platform-events-student.js","sources":["../../../src/features/analytics-events/platform-events-student.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\n/**\n ** Global/Platform specific events that needs to be tracked goes here\n ** Naming convention needs to be snake_case\n */\nexport enum PLATFORM_EVENTS_STUDENT {\n PAGE_VIEWED = 'page_viewed',\n CUSTOM_TEST_SUBMITTED = 'custom_test_submitted',\n\n // circle on leap mixpanel events\n ACTIVITY_STARTED = 'activity_started',\n ACTIVITY_TUTORIAL_SEEN = 'activity_tutorial_seen',\n STREAK_ICON_CLICKED = 'streak_icon_clicked',\n LEADERBOARD_BUTTON_CLICKED = 'leaderboard_button_clicked',\n ONBOARDING_STEP_VIEWED = 'onboarding_step_viewed',\n ONBOARDING_STEP_COMPLETED = 'onboarding_step_completed',\n}\n\n/**\n ** Events that need to be tracked at particular plugins\n ** Value will be array of strings.\n */\nexport const PLATFORM_WHITELIST_EVENTS_STUDENT = {\n [PLATFORM_EVENTS_STUDENT.PAGE_VIEWED]: [PLUGINS.MIXPANEL],\n\n // circle on leap mixpanel events\n [PLATFORM_EVENTS_STUDENT.ACTIVITY_STARTED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ACTIVITY_TUTORIAL_SEEN]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.STREAK_ICON_CLICKED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.LEADERBOARD_BUTTON_CLICKED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLATFORM_EVENTS_STUDENT.ONBOARDING_STEP_COMPLETED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PLATFORM_EVENTS_STUDENT","PLATFORM_WHITELIST_EVENTS_STUDENT","PLUGINS"],"mappings":";AAMY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,wBAAwB,yBAGxBA,EAAA,mBAAmB,oBACnBA,EAAA,yBAAyB,0BACzBA,EAAA,sBAAsB,uBACtBA,EAAA,6BAA6B,8BAC7BA,EAAA,yBAAyB,0BACzBA,EAAA,4BAA4B,6BAVlBA,IAAAA,KAAA,CAAA,CAAA;AAiBL,MAAMC,IAAoC;AAAA,EAC9C,aAAsC,CAACC,EAAQ,QAAQ;AAAA;AAAA,EAGvD,kBAA2C,CAACA,EAAQ,QAAQ;AAAA,EAC5D,wBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,qBAA8C,CAACA,EAAQ,QAAQ;AAAA,EAC/D,4BAAqD,CAACA,EAAQ,QAAQ;AAAA,EACtE,wBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,2BAAoD,CAACA,EAAQ,QAAQ;AACxE;"}
@@ -1,48 +1,48 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
2
  import { memo as C, useState as x, useRef as w, useCallback as T, useLayoutEffect as _ } from "react";
3
- import { useTheme as I } from "styled-components";
4
- import y from "../../../milestone/create/comps/milestone-progress-v2/milestone-progress-v2.js";
5
- import j from "../../../ui/arrow-tooltip/arrow-tooltip.js";
6
- import A from "../../../ui/layout/flex-view.js";
3
+ import { useTheme as y } from "styled-components";
4
+ import j from "../../../milestone/create/comps/milestone-progress-v2/milestone-progress-v2.js";
5
+ import A from "../../../ui/arrow-tooltip/arrow-tooltip.js";
6
+ import I from "../../../ui/layout/flex-view.js";
7
7
  import { ChapterItemWrapper as L, ChapterImage as b, ChapterName as H } from "./chapter-item-styled.js";
8
8
  const V = C(
9
- ({ milestoneId: s, userType: c, chapter: o, onChapterClick: i, itemIndex: l }) => {
10
- const p = I(), { gutter: t } = p.layout, f = !!((l + 1) % 2), { name: a, image_url: h, user_chapter_progress: n } = o, { total_core_sheets: u } = n, [d, g] = x(!1), e = w(null), $ = T(() => {
11
- i(o);
12
- }, [o, i]);
9
+ ({ milestoneId: t, userType: m, chapter: s, onChapterClick: a, itemIndex: i }) => {
10
+ const p = y(), { gutter: r } = p.layout, f = !!((i + 1) % 2), { name: l, image_url: h, user_chapter_progress: n } = s, { total_core_sheets: u } = n, [d, g] = x(!1), e = w(null), $ = T(() => {
11
+ a(s, t);
12
+ }, [s, t, a]);
13
13
  return _(() => {
14
14
  e.current && e.current.scrollHeight > e.current.clientHeight && g(!0);
15
- }, [e]), /* @__PURE__ */ m(
15
+ }, [e]), /* @__PURE__ */ c(
16
16
  L,
17
17
  {
18
18
  $justifyContent: "flex-start",
19
- $gap: t * 1.25,
20
- $gutter: t * 1.25,
19
+ $gap: r * 1.25,
20
+ $gutter: r * 1.25,
21
21
  $flexDirection: "row",
22
- $flexColumnGap: t,
22
+ $flexColumnGap: r,
23
23
  $shouldHaveLeftBorder: f,
24
24
  onClick: $,
25
- id: `milestone-chapter-${s}-${l}`,
25
+ id: `milestone-chapter-${t}-${i}`,
26
26
  className: "goal-widget-chapter-item",
27
27
  children: [
28
- /* @__PURE__ */ r(b, { src: h, alt: "Chapter Image" }),
29
- /* @__PURE__ */ m(A, { $justifyContent: "center", $flexRowGap: t * 0.75, children: [
30
- /* @__PURE__ */ r(
31
- j,
28
+ /* @__PURE__ */ o(b, { src: h, alt: "Chapter Image" }),
29
+ /* @__PURE__ */ c(I, { $justifyContent: "center", $flexRowGap: r * 0.75, children: [
30
+ /* @__PURE__ */ o(
31
+ A,
32
32
  {
33
33
  renderAs: "primary",
34
34
  position: "bottom",
35
- tooltipItem: a,
35
+ tooltipItem: l,
36
36
  hidden: !d,
37
37
  widthX: 21.75,
38
- children: /* @__PURE__ */ r(H, { ref: e, $renderAs: "ab2", $color: "BLACK_T_87", children: a })
38
+ children: /* @__PURE__ */ o(H, { ref: e, $renderAs: "ab2", $color: "BLACK_T_87", children: l })
39
39
  }
40
40
  ),
41
- !!u && /* @__PURE__ */ r(
42
- y,
41
+ !!u && /* @__PURE__ */ o(
42
+ j,
43
43
  {
44
- userType: c,
45
- milestoneId: s,
44
+ userType: m,
45
+ milestoneId: t,
46
46
  progressInfo: n
47
47
  }
48
48
  )
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport MilestoneProgressInfoV2 from '../../../milestone/create/comps/milestone-progress-v2/milestone-progress-v2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, userType, chapter, onChapterClick, itemIndex }) => {\n const theme = useTheme();\n const { gutter } = theme.layout;\n const isOddIndex = !!((itemIndex + 1) % 2);\n const { name, image_url: imageUrl, user_chapter_progress: chapterStats } = chapter;\n const { total_core_sheets: totalLessons } = chapterStats;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n\n const handleOnChapterClick = useCallback(() => {\n onChapterClick(chapter);\n }, [chapter, onChapterClick]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <Styled.ChapterItemWrapper\n $justifyContent={'flex-start'}\n $gap={gutter * 1.25}\n $gutter={gutter * 1.25}\n $flexDirection=\"row\"\n $flexColumnGap={gutter}\n $shouldHaveLeftBorder={isOddIndex}\n onClick={handleOnChapterClick}\n id={`milestone-chapter-${milestoneId}-${itemIndex}`}\n className=\"goal-widget-chapter-item\"\n >\n <Styled.ChapterImage src={imageUrl} alt=\"Chapter Image\" />\n <FlexView $justifyContent=\"center\" $flexRowGap={gutter * 0.75}>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ChapterName ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n {!!totalLessons && (\n <MilestoneProgressInfoV2\n userType={userType}\n milestoneId={milestoneId}\n progressInfo={chapterStats}\n />\n )}\n </FlexView>\n </Styled.ChapterItemWrapper>\n );\n },\n);\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","userType","chapter","onChapterClick","itemIndex","theme","useTheme","gutter","isOddIndex","name","imageUrl","chapterStats","totalLessons","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","handleOnChapterClick","useCallback","useLayoutEffect","jsxs","Styled.ChapterItemWrapper","jsx","Styled.ChapterImage","FlexView","ArrowTooltip","Styled.ChapterName","MilestoneProgressInfoV2"],"mappings":";;;;;;;AAWA,MAAMA,IAAqCC;AAAA,EACzC,CAAC,EAAE,aAAAC,GAAa,UAAAC,GAAU,SAAAC,GAAS,gBAAAC,GAAgB,WAAAC,QAAgB;AACjE,UAAMC,IAAQC,KACR,EAAE,QAAAC,EAAO,IAAIF,EAAM,QACnBG,IAAa,CAAC,GAAGJ,IAAY,KAAK,IAClC,EAAE,MAAAK,GAAM,WAAWC,GAAU,uBAAuBC,EAAiB,IAAAT,GACrE,EAAE,mBAAmBU,EAAiB,IAAAD,GACtC,CAACE,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAuBC,EAAY,MAAM;AAC7C,MAAAhB,EAAeD,CAAO;AAAA,IAAA,GACrB,CAACA,GAASC,CAAc,CAAC;AAE5B,WAAAiB,EAAgB,MAAM;AACpB,MACEJ,EAAa,WACbA,EAAa,QAAQ,eAAeA,EAAa,QAAQ,gBAEzDF,EAAoB,EAAI;AAAA,IAC1B,GACC,CAACE,CAAY,CAAC,GAGf,gBAAAK;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,iBAAiB;AAAA,QACjB,MAAMf,IAAS;AAAA,QACf,SAASA,IAAS;AAAA,QAClB,gBAAe;AAAA,QACf,gBAAgBA;AAAA,QAChB,uBAAuBC;AAAA,QACvB,SAASU;AAAA,QACT,IAAI,qBAAqBlB,CAAW,IAAII,CAAS;AAAA,QACjD,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAmB,EAACC,GAAA,EAAoB,KAAKd,GAAU,KAAI,iBAAgB;AAAA,4BACvDe,GAAS,EAAA,iBAAgB,UAAS,aAAalB,IAAS,MACvD,UAAA;AAAA,YAAA,gBAAAgB;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,UAAS;AAAA,gBACT,aAAajB;AAAA,gBACb,QAAQ,CAACI;AAAA,gBACT,QAAQ;AAAA,gBAER,UAAA,gBAAAU,EAACI,GAAA,EAAmB,KAAKX,GAAc,WAAU,OAAM,QAAO,cAC3D,UACHP,EAAA,CAAA;AAAA,cAAA;AAAA,YACF;AAAA,YACC,CAAC,CAACG,KACD,gBAAAW;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,UAAA3B;AAAA,gBACA,aAAAD;AAAA,gBACA,cAAcW;AAAA,cAAA;AAAA,YAChB;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport MilestoneProgressInfoV2 from '../../../milestone/create/comps/milestone-progress-v2/milestone-progress-v2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, userType, chapter, onChapterClick, itemIndex }) => {\n const theme = useTheme();\n const { gutter } = theme.layout;\n const isOddIndex = !!((itemIndex + 1) % 2);\n const { name, image_url: imageUrl, user_chapter_progress: chapterStats } = chapter;\n const { total_core_sheets: totalLessons } = chapterStats;\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n\n const handleOnChapterClick = useCallback(() => {\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <Styled.ChapterItemWrapper\n $justifyContent={'flex-start'}\n $gap={gutter * 1.25}\n $gutter={gutter * 1.25}\n $flexDirection=\"row\"\n $flexColumnGap={gutter}\n $shouldHaveLeftBorder={isOddIndex}\n onClick={handleOnChapterClick}\n id={`milestone-chapter-${milestoneId}-${itemIndex}`}\n className=\"goal-widget-chapter-item\"\n >\n <Styled.ChapterImage src={imageUrl} alt=\"Chapter Image\" />\n <FlexView $justifyContent=\"center\" $flexRowGap={gutter * 0.75}>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ChapterName ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n {!!totalLessons && (\n <MilestoneProgressInfoV2\n userType={userType}\n milestoneId={milestoneId}\n progressInfo={chapterStats}\n />\n )}\n </FlexView>\n </Styled.ChapterItemWrapper>\n );\n },\n);\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","userType","chapter","onChapterClick","itemIndex","theme","useTheme","gutter","isOddIndex","name","imageUrl","chapterStats","totalLessons","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","handleOnChapterClick","useCallback","useLayoutEffect","jsxs","Styled.ChapterItemWrapper","jsx","Styled.ChapterImage","FlexView","ArrowTooltip","Styled.ChapterName","MilestoneProgressInfoV2"],"mappings":";;;;;;;AAWA,MAAMA,IAAqCC;AAAA,EACzC,CAAC,EAAE,aAAAC,GAAa,UAAAC,GAAU,SAAAC,GAAS,gBAAAC,GAAgB,WAAAC,QAAgB;AACjE,UAAMC,IAAQC,KACR,EAAE,QAAAC,EAAO,IAAIF,EAAM,QACnBG,IAAa,CAAC,GAAGJ,IAAY,KAAK,IAClC,EAAE,MAAAK,GAAM,WAAWC,GAAU,uBAAuBC,EAAiB,IAAAT,GACrE,EAAE,mBAAmBU,EAAiB,IAAAD,GACtC,CAACE,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GACxDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAuBC,EAAY,MAAM;AAC7C,MAAAhB,EAAeD,GAASF,CAAW;AAAA,IAClC,GAAA,CAACE,GAASF,GAAaG,CAAc,CAAC;AAEzC,WAAAiB,EAAgB,MAAM;AACpB,MACEJ,EAAa,WACbA,EAAa,QAAQ,eAAeA,EAAa,QAAQ,gBAEzDF,EAAoB,EAAI;AAAA,IAC1B,GACC,CAACE,CAAY,CAAC,GAGf,gBAAAK;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,iBAAiB;AAAA,QACjB,MAAMf,IAAS;AAAA,QACf,SAASA,IAAS;AAAA,QAClB,gBAAe;AAAA,QACf,gBAAgBA;AAAA,QAChB,uBAAuBC;AAAA,QACvB,SAASU;AAAA,QACT,IAAI,qBAAqBlB,CAAW,IAAII,CAAS;AAAA,QACjD,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAmB,EAACC,GAAA,EAAoB,KAAKd,GAAU,KAAI,iBAAgB;AAAA,4BACvDe,GAAS,EAAA,iBAAgB,UAAS,aAAalB,IAAS,MACvD,UAAA;AAAA,YAAA,gBAAAgB;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,UAAS;AAAA,gBACT,aAAajB;AAAA,gBACb,QAAQ,CAACI;AAAA,gBACT,QAAQ;AAAA,gBAER,UAAA,gBAAAU,EAACI,GAAA,EAAmB,KAAKX,GAAc,WAAU,OAAM,QAAO,cAC3D,UACHP,EAAA,CAAA;AAAA,cAAA;AAAA,YACF;AAAA,YACC,CAAC,CAACG,KACD,gBAAAW;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,UAAA3B;AAAA,gBACA,aAAAD;AAAA,gBACA,cAAcW;AAAA,cAAA;AAAA,YAChB;AAAA,UAAA,GAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1,96 +1,94 @@
1
- import { useState as d, useCallback as R, useEffect as E } from "react";
1
+ import { useState as E, useCallback as R, useEffect as d } from "react";
2
2
  import { useGetCircleHomeAPI as p } from "../../api/get-content-for-today/get-circle-home-api.js";
3
3
  import { ProjectType as s } from "../../../games/web-view/enums/project-type-enum.js";
4
4
  const T = (r, o) => {
5
- const [n, _] = d(null), { data: t, get: c, isProcessed: i, ...m } = p(), l = R(
6
- (a) => {
5
+ const [n, _] = E(null), { data: a, get: c, isProcessed: i, ...m } = p(), l = R(
6
+ (e) => {
7
7
  c("", {
8
8
  user_id: r,
9
- country_code: a,
9
+ country_code: e,
10
10
  grade: o
11
11
  });
12
12
  },
13
13
  [c, r, o]
14
14
  );
15
- return E(() => {
16
- let a = null;
17
- i && t && (a = {
18
- points: t.points,
19
- streakDays: t.streak_days,
20
- streakReduction: t.streak_reduction,
21
- streakDaysBeforeReduction: t.streak_days_before_reduction,
22
- streakStatus: t.streak_status,
23
- tournamentRank: t.tournament_rank,
15
+ return d(() => {
16
+ let e = null;
17
+ i && a && (e = {
18
+ points: a.points,
19
+ streakDays: a.streak_days,
20
+ streakStatus: a.streak_status,
21
+ tournamentRank: a.tournament_rank,
24
22
  projects: {
25
23
  games: {
26
- label: t.projects.games.label,
24
+ label: a.projects.games.label,
27
25
  type: s.GAME,
28
26
  initialProgressValue: 0,
29
- data: t.projects.games.data.map((e) => ({
30
- id: e.id,
31
- name: e.name,
32
- cardLottie: e.card,
33
- tutorial: e.tutorial,
34
- variant: e.variant,
35
- isPlayed: e.played
27
+ data: a.projects.games.data.map((t) => ({
28
+ id: t.id,
29
+ name: t.name,
30
+ cardLottie: t.card,
31
+ tutorial: t.tutorial,
32
+ variant: t.variant,
33
+ isPlayed: t.played
36
34
  }))
37
35
  },
38
36
  puzzles: {
39
- label: t.projects.puzzles.label,
37
+ label: a.projects.puzzles.label,
40
38
  type: s.PUZZLE,
41
39
  initialProgressValue: 0,
42
- data: t.projects.puzzles.data.map((e) => ({
43
- id: e.id,
44
- name: e.name,
45
- cardLottie: e.card,
46
- tutorial: e.tutorial,
47
- variant: e.variant,
48
- question: e.question,
49
- isHintSeen: e.is_hint_seen,
50
- solved: e.solved
40
+ data: a.projects.puzzles.data.map((t) => ({
41
+ id: t.id,
42
+ name: t.name,
43
+ cardLottie: t.card,
44
+ tutorial: t.tutorial,
45
+ variant: t.variant,
46
+ question: t.question,
47
+ isHintSeen: t.is_hint_seen,
48
+ solved: t.solved
51
49
  }))
52
50
  }
53
51
  },
54
52
  timestamps: {
55
- startTimestamp: t.timestamps.start_timestamp,
56
- endTimestamp: t.timestamps.end_timestamp,
57
- current: t.timestamps.current
53
+ startTimestamp: a.timestamps.start_timestamp,
54
+ endTimestamp: a.timestamps.end_timestamp,
55
+ current: a.timestamps.current
58
56
  },
59
57
  coachmarkProgress: {
60
- CIRCLE_ACTIVITIES_INTRO_JOURNEY: t.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,
61
- CIRCLE_LEADERBOARD_INTRO_JOURNEY: t.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,
62
- CIRCLE_POINTS_REWARD_JOURNEY: t.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,
63
- CIRCLE_STREAK_UPDATE_JOURNEY: t.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
64
- CIRCLE_TUTORIAL_JOURNEY: t.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,
65
- CIRCLE_TABLES_INTRO_JOURNEY: t.coachmark_completion.CIRCLE_TABLES_INTRO_JOURNEY
58
+ CIRCLE_ACTIVITIES_INTRO_JOURNEY: a.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,
59
+ CIRCLE_LEADERBOARD_INTRO_JOURNEY: a.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,
60
+ CIRCLE_POINTS_REWARD_JOURNEY: a.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,
61
+ CIRCLE_STREAK_UPDATE_JOURNEY: a.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
62
+ CIRCLE_TUTORIAL_JOURNEY: a.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,
63
+ CIRCLE_TABLES_INTRO_JOURNEY: a.coachmark_completion.CIRCLE_TABLES_INTRO_JOURNEY
66
64
  }
67
- }, t.projects.lessons && (a.projects.lessons = {
68
- label: t.projects.lessons.label,
65
+ }, a.projects.lessons && (e.projects.lessons = {
66
+ label: a.projects.lessons.label,
69
67
  type: s.LESSON,
70
68
  initialProgressValue: 0,
71
- data: t.projects.lessons.data.map((e) => ({
72
- id: e.id,
73
- name: e.name,
74
- cardLottie: e.card,
75
- tutorial: e.tutorial,
76
- variant: e.variant,
77
- sessionId: e.session_id,
78
- miniGameIdentifier: e.mini_game_identifier,
79
- targetQuestions: e.target_questions,
80
- status: e.status
69
+ data: a.projects.lessons.data.map((t) => ({
70
+ id: t.id,
71
+ name: t.name,
72
+ cardLottie: t.card,
73
+ tutorial: t.tutorial,
74
+ variant: t.variant,
75
+ sessionId: t.session_id,
76
+ miniGameIdentifier: t.mini_game_identifier,
77
+ targetQuestions: t.target_questions,
78
+ status: t.status
81
79
  }))
82
- }), t.projects.tables && (a.projects.tables = {
83
- label: t.projects.tables.label,
80
+ }), a.projects.tables && (e.projects.tables = {
81
+ label: a.projects.tables.label,
84
82
  type: s.TABLE,
85
83
  data: {
86
- infiniteModeHighScore: t.projects.tables.data.infinite_mode_high_score,
87
- tableList: t.projects.tables.data.table_wise_details.map((e) => ({
88
- tableNumber: e.table_number,
89
- stars: e.stars
84
+ infiniteModeHighScore: a.projects.tables.data.infinite_mode_high_score,
85
+ tableList: a.projects.tables.data.table_wise_details.map((t) => ({
86
+ tableNumber: t.table_number,
87
+ stars: t.stars
90
88
  }))
91
89
  }
92
- })), _(a);
93
- }, [t, i]), { data: n, isProcessed: i, getCircleHomeDetails: l, ...m };
90
+ })), _(e);
91
+ }, [a, i]), { data: n, isProcessed: i, getCircleHomeDetails: l, ...m };
94
92
  };
95
93
  export {
96
94
  T as useGetCircleHomeDetailsDal
@@ -1 +1 @@
1
- {"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: (countryCode: string) => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(\n (countryCode: string) => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n },\n [getHomeDetails, userId, grade],\n );\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakReduction: data.streak_reduction,\n streakDaysBeforeReduction: data.streak_days_before_reduction,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n CIRCLE_TABLES_INTRO_JOURNEY: data.coachmark_completion.CIRCLE_TABLES_INTRO_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.TABLE,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","countryCode","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":"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"}
1
+ {"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type {\n ICircleHomeDetails,\n TStreakStatus,\n TTableMode,\n} from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: (countryCode: string) => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(\n (countryCode: string) => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n },\n [getHomeDetails, userId, grade],\n );\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n CIRCLE_TABLES_INTRO_JOURNEY: data.coachmark_completion.CIRCLE_TABLES_INTRO_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n\n if (data.projects.tables) {\n circleHomeDetails.projects.tables = {\n label: data.projects.tables.label,\n type: ProjectType.TABLE,\n data: {\n infiniteModeHighScore: data.projects.tables.data.infinite_mode_high_score,\n tableList: data.projects.tables.data.table_wise_details.map(table => ({\n tableNumber: table.table_number,\n stars: table.stars as TTableMode[],\n })),\n },\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","countryCode","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson","table"],"mappings":";;;AAWa,MAAAA,IAA6B,CACxCC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC;AAAA,IAC3B,CAACC,MAAwB;AACvB,MAAAN,EAAe,IAAI;AAAA,QACjB,SAASN;AAAA,QACT,cAAcY;AAAA,QACd,OAAAX;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACK,GAAgBN,GAAQC,CAAK;AAAA,EAAA;AAGhC,SAAAY,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIP,KAAeF,MACGS,IAAA;AAAA,MAClB,QAAQT,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMU,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMV,EAAK,SAAS,MAAM,KAAK,IAAI,CAASW,OAAA;AAAA,YAC1C,IAAIA,EAAK;AAAA,YACT,MAAMA,EAAK;AAAA,YACX,YAAYA,EAAK;AAAA,YACjB,UAAUA,EAAK;AAAA,YACf,SAASA,EAAK;AAAA,YACd,UAAUA,EAAK;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,QACA,SAAS;AAAA,UACP,OAAOX,EAAK,SAAS,QAAQ;AAAA,UAC7B,MAAMU,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMV,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWY,OAAA;AAAA,YAC9C,IAAIA,EAAO;AAAA,YACX,MAAMA,EAAO;AAAA,YACb,YAAYA,EAAO;AAAA,YACnB,UAAUA,EAAO;AAAA,YACjB,SAASA,EAAO;AAAA,YAChB,UAAUA,EAAO;AAAA,YACjB,YAAYA,EAAO;AAAA,YACnB,QAAQA,EAAO;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,gBAAgBZ,EAAK,WAAW;AAAA,QAChC,cAAcA,EAAK,WAAW;AAAA,QAC9B,SAASA,EAAK,WAAW;AAAA,MAC3B;AAAA,MACA,mBAAmB;AAAA,QACjB,iCACEA,EAAK,qBAAqB;AAAA,QAC5B,kCACEA,EAAK,qBAAqB;AAAA,QAC5B,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,yBAAyBA,EAAK,qBAAqB;AAAA,QACnD,6BAA6BA,EAAK,qBAAqB;AAAA,MACzD;AAAA,IAAA,GAGEA,EAAK,SAAS,YAChBS,EAAkB,SAAS,UAAU;AAAA,MACnC,OAAOT,EAAK,SAAS,QAAQ;AAAA,MAC7B,MAAMU,EAAY;AAAA,MAClB,sBAAsB;AAAA,MACtB,MAAMV,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWa,OAAA;AAAA,QAC9C,IAAIA,EAAO;AAAA,QACX,MAAMA,EAAO;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,IAIFb,EAAK,SAAS,WAChBS,EAAkB,SAAS,SAAS;AAAA,MAClC,OAAOT,EAAK,SAAS,OAAO;AAAA,MAC5B,MAAMU,EAAY;AAAA,MAClB,MAAM;AAAA,QACJ,uBAAuBV,EAAK,SAAS,OAAO,KAAK;AAAA,QACjD,WAAWA,EAAK,SAAS,OAAO,KAAK,mBAAmB,IAAI,CAAUc,OAAA;AAAA,UACpE,aAAaA,EAAM;AAAA,UACnB,OAAOA,EAAM;AAAA,QAAA,EACb;AAAA,MACJ;AAAA,IAAA,KAINhB,EAAmBW,CAAiB;AAAA,EAAA,GACnC,CAACT,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n countryCode: string;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n parentDomain: string;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { WebViewEvent, ProjectOutcome, ProjectType } from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface ISyncableWebGameProps {\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games and tables\n}\n\ninterface IBaseWebGameProps {\n projectId: string;\n variant: string;\n projectType: ProjectType;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n enablePlayerTurnIndicators?: boolean;\n}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {\n miniGameIdentifier: string;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface ITableWebGameProps extends IBaseWebGameProps {\n tableNumber: number;\n infiniteModeHighScore?: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n starEligibleTime?: number;\n starEligibleAccuracy?: number;\n starRewarded?: boolean;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails:\n | IMultiplayerWebGameProps\n | IPuzzleWebGameProps\n | ILessonWebGameProps\n | ITableWebGameProps;\n parentDomain: string;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAkDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { memo as f } from "react";
3
3
  import { ELeaderboardType as t } from "../../enums/leaderboard-type-enum.js";
4
- import { useIntersectionObserver as u } from "../../hooks/use-intersection-observer/use-intersection-observer.tsx.js";
5
- import { PlayerProgressListItem as E } from "../progress-list-item/progress-list-item.js";
6
- import { AnimatedItem as I } from "./leaderboard-item-styled.js";
4
+ import { PlayerProgressListItem as u } from "../progress-list-item/progress-list-item.js";
5
+ import { AnimatedItem as E } from "./leaderboard-item-styled.js";
6
+ import { useIntersectionObserver as I } from "../../hooks/useIntersectionObserver.js";
7
7
  const h = f(
8
8
  ({ player: e, rank: o, maxStreakDays: m, maxPoints: i, leaderboardType: r, isActive: a }) => {
9
- const { isVisible: n, elementRef: A } = u({
9
+ const { isVisible: n, elementRef: A } = I({
10
10
  threshold: 0.5
11
11
  }), L = r === t.ALL_TIME_STREAK ? m : i, d = r === t.ALL_TIME_STREAK ? e.streakDays : e.points;
12
- return /* @__PURE__ */ s(I, { isVisible: n, ref: A, children: /* @__PURE__ */ s(
13
- E,
12
+ return /* @__PURE__ */ s(E, { isVisible: n, ref: A, children: /* @__PURE__ */ s(
13
+ u,
14
14
  {
15
15
  index: o,
16
16
  maxValue: L,
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-item.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from '../../dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardItemProps } from './leaderboard-item-types';\n\nimport React, { memo } from 'react';\n\nimport { ELeaderboardType } from '../../enums/leaderboard-type-enum';\nimport { useIntersectionObserver } from '../../hooks/use-intersection-observer/use-intersection-observer.tsx';\nimport { PlayerProgressListItem } from '../progress-list-item/progress-list-item';\nimport * as Styled from './leaderboard-item-styled';\n\nexport const LeaderboardItemWithObserver: React.FC<ILeaderboardItemProps> = memo(\n ({ player, rank, maxStreakDays, maxPoints, leaderboardType, isActive }) => {\n const { isVisible, elementRef } = useIntersectionObserver<HTMLDivElement>({\n threshold: 0.5,\n });\n\n const maxValue =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? maxStreakDays : maxPoints;\n\n const value =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK\n ? (player as ILeaderboardPlayerWithStreak).streakDays\n : (player as ILeaderboardPlayerWithPoints).points;\n\n return (\n <Styled.AnimatedItem key={player.rank} isVisible={isVisible} ref={elementRef}>\n <PlayerProgressListItem\n index={rank}\n maxValue={maxValue}\n value={value}\n isActive={isActive}\n avatar={player.userAvatar}\n grade={player.grade}\n displayText={player.username}\n displayValueAs={\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? 'streak' : 'points'\n }\n />\n </Styled.AnimatedItem>\n );\n },\n);\n"],"names":["LeaderboardItemWithObserver","memo","player","rank","maxStreakDays","maxPoints","leaderboardType","isActive","isVisible","elementRef","useIntersectionObserver","maxValue","ELeaderboardType","value","Styled.AnimatedItem","jsx","PlayerProgressListItem"],"mappings":";;;;;;AAaO,MAAMA,IAA+DC;AAAA,EAC1E,CAAC,EAAE,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,GAAe,WAAAC,GAAW,iBAAAC,GAAiB,UAAAC,QAAe;AACzE,UAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAwC;AAAA,MACxE,WAAW;AAAA,IAAA,CACZ,GAEKC,IACJL,MAAoBM,EAAiB,kBAAkBR,IAAgBC,GAEnEQ,IACJP,MAAoBM,EAAiB,kBAChCV,EAAwC,aACxCA,EAAwC;AAE/C,6BACGY,GAAA,EAAsC,WAAAN,GAAsB,KAAKC,GAChE,UAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOb;AAAA,QACP,UAAAQ;AAAA,QACA,OAAAE;AAAA,QACA,UAAAN;AAAA,QACA,QAAQL,EAAO;AAAA,QACf,OAAOA,EAAO;AAAA,QACd,aAAaA,EAAO;AAAA,QACpB,gBACEI,MAAoBM,EAAiB,kBAAkB,WAAW;AAAA,MAAA;AAAA,IAAA,KAV9CV,EAAO,IAajC;AAAA,EAEJ;AACF;"}
1
+ {"version":3,"file":"leaderboard-item.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from '../../dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardItemProps } from './leaderboard-item-types';\n\nimport React, { memo } from 'react';\n\nimport { ELeaderboardType } from '../../enums/leaderboard-type-enum';\nimport { useIntersectionObserver } from '../../hooks';\nimport { PlayerProgressListItem } from '../progress-list-item/progress-list-item';\nimport * as Styled from './leaderboard-item-styled';\n\nexport const LeaderboardItemWithObserver: React.FC<ILeaderboardItemProps> = memo(\n ({ player, rank, maxStreakDays, maxPoints, leaderboardType, isActive }) => {\n const { isVisible, elementRef } = useIntersectionObserver<HTMLDivElement>({\n threshold: 0.5,\n });\n\n const maxValue =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? maxStreakDays : maxPoints;\n\n const value =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK\n ? (player as ILeaderboardPlayerWithStreak).streakDays\n : (player as ILeaderboardPlayerWithPoints).points;\n\n return (\n <Styled.AnimatedItem key={player.rank} isVisible={isVisible} ref={elementRef}>\n <PlayerProgressListItem\n index={rank}\n maxValue={maxValue}\n value={value}\n isActive={isActive}\n avatar={player.userAvatar}\n grade={player.grade}\n displayText={player.username}\n displayValueAs={\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? 'streak' : 'points'\n }\n />\n </Styled.AnimatedItem>\n );\n },\n);\n"],"names":["LeaderboardItemWithObserver","memo","player","rank","maxStreakDays","maxPoints","leaderboardType","isActive","isVisible","elementRef","useIntersectionObserver","maxValue","ELeaderboardType","value","Styled.AnimatedItem","jsx","PlayerProgressListItem"],"mappings":";;;;;;AAaO,MAAMA,IAA+DC;AAAA,EAC1E,CAAC,EAAE,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,GAAe,WAAAC,GAAW,iBAAAC,GAAiB,UAAAC,QAAe;AACzE,UAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAwC;AAAA,MACxE,WAAW;AAAA,IAAA,CACZ,GAEKC,IACJL,MAAoBM,EAAiB,kBAAkBR,IAAgBC,GAEnEQ,IACJP,MAAoBM,EAAiB,kBAChCV,EAAwC,aACxCA,EAAwC;AAE/C,6BACGY,GAAA,EAAsC,WAAAN,GAAsB,KAAKC,GAChE,UAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOb;AAAA,QACP,UAAAQ;AAAA,QACA,OAAAE;AAAA,QACA,UAAAN;AAAA,QACA,QAAQL,EAAO;AAAA,QACf,OAAOA,EAAO;AAAA,QACd,aAAaA,EAAO;AAAA,QACpB,gBACEI,MAAoBM,EAAiB,kBAAkB,WAAW;AAAA,MAAA;AAAA,IAAA,KAV9CV,EAAO,IAajC;AAAA,EAEJ;AACF;"}
@@ -16,4 +16,4 @@ const l = (s) => {
16
16
  export {
17
17
  l as useIntersectionObserver
18
18
  };
19
- //# sourceMappingURL=use-intersection-observer.tsx.js.map
19
+ //# sourceMappingURL=useIntersectionObserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIntersectionObserver.js","sources":["../../../../../src/features/circle-games/leaderboard/hooks/useIntersectionObserver.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\n\ninterface IntersectionObserverOptions {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\nexport const useIntersectionObserver = <T extends HTMLElement>(\n options?: IntersectionObserverOptions,\n) => {\n const [isVisible, setIsVisible] = useState(false);\n const elementRef = useRef<T | null>(null);\n\n useEffect(() => {\n const element = elementRef.current;\n\n if (!element) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => entry && setIsVisible(entry.isIntersecting),\n options,\n );\n\n observer.observe(element);\n\n return () => {\n if (element) observer.unobserve(element);\n };\n }, [options]);\n\n return { isVisible, elementRef };\n};\n"],"names":["useIntersectionObserver","options","isVisible","setIsVisible","useState","elementRef","useRef","useEffect","element","observer","entry"],"mappings":";AAQa,MAAAA,IAA0B,CACrCC,MACG;AACH,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAaC,EAAiB,IAAI;AAExC,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAUH,EAAW;AAE3B,QAAI,CAACG,EAAS;AAEd,UAAMC,IAAW,IAAI;AAAA,MACnB,CAAC,CAACC,CAAK,MAAMA,KAASP,EAAaO,EAAM,cAAc;AAAA,MACvDT;AAAA,IAAA;AAGF,WAAAQ,EAAS,QAAQD,CAAO,GAEjB,MAAM;AACP,MAAAA,KAAkBC,EAAA,UAAUD,CAAO;AAAA,IAAA;AAAA,EACzC,GACC,CAACP,CAAO,CAAC,GAEL,EAAE,WAAAC,GAAW,YAAAG;AACtB;"}
@@ -19,4 +19,4 @@ function f(s) {
19
19
  export {
20
20
  f as useTimer
21
21
  };
22
- //# sourceMappingURL=use-timer.js.map
22
+ //# sourceMappingURL=useTimer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTimer.js","sources":["../../../../../src/features/circle-games/leaderboard/hooks/useTimer.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from 'react';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nexport function useTimer(value: number) {\n const [timer, setTimer] = useState<number>(value);\n const timerId = useRef<ReturnType<typeof setInterval>>();\n\n const initTimer = useCallback(() => {\n timerId.current = setInterval(() => {\n setTimer(prev => prev + 1000);\n }, 1000);\n }, []);\n\n const clearTimer = useCallback(() => {\n clearInterval(timerId.current);\n }, []);\n\n useEffect(() => {\n initTimer();\n\n return () => {\n clearTimer();\n };\n }, [clearTimer, initTimer]);\n\n return [\n timer as number,\n setTimer as Dispatch<SetStateAction<number>>,\n initTimer,\n clearTimer,\n ] as const;\n}\n"],"names":["useTimer","value","timer","setTimer","useState","timerId","useRef","initTimer","useCallback","prev","clearTimer","useEffect"],"mappings":";AAIO,SAASA,EAASC,GAAe;AACtC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiBH,CAAK,GAC1CI,IAAUC,KAEVC,IAAYC,EAAY,MAAM;AAC1B,IAAAH,EAAA,UAAU,YAAY,MAAM;AACzB,MAAAF,EAAA,CAAAM,MAAQA,IAAO,GAAI;AAAA,OAC3B,GAAI;AAAA,EACT,GAAG,CAAE,CAAA,GAECC,IAAaF,EAAY,MAAM;AACnC,kBAAcH,EAAQ,OAAO;AAAA,EAC/B,GAAG,CAAE,CAAA;AAEL,SAAAM,EAAU,OACEJ,KAEH,MAAM;AACA,IAAAG;EAAA,IAEZ,CAACA,GAAYH,CAAS,CAAC,GAEnB;AAAA,IACLL;AAAA,IACAC;AAAA,IACAI;AAAA,IACAG;AAAA,EAAA;AAEJ;"}
@@ -1,33 +1,32 @@
1
1
  import t from "styled-components";
2
2
  import { ARC_BUTTON_BOTTOM_OFFSET as i } from "../../ui/arc-button/constants.js";
3
- import e from "../../ui/layout/flex-view.js";
4
- import { BANNER_HEIGHT as n } from "./comps/banner/constants.js";
5
- const s = t.div`
3
+ import { BANNER_HEIGHT as e } from "./comps/banner/constants.js";
4
+ const a = t.div`
6
5
  flex-direction: column;
7
6
  overflow: hidden;
8
7
  height: 100vh;
9
8
  max-height: 100%;
10
9
  position: relative;
11
- `, c = t.div`
10
+ `, p = t.div`
12
11
  background: ${({ theme: o }) => o.colors.BLACK_1};
13
12
  height: 100%;
14
13
  position: relative;
15
14
  width: 100%;
16
- `, h = t.div`
15
+ `, s = t.div`
17
16
  position: absolute;
18
17
  top: 0;
19
18
  width: 100%;
20
19
  z-index: 10;
21
- `, l = t.div`
20
+ `, c = t.div`
22
21
  background: transparent;
23
22
  position: absolute;
24
23
  overflow: auto;
25
24
  width: 100%;
26
25
  flex: 1;
27
26
  height: 100%;
28
- padding-top: ${n}px;
27
+ padding-top: ${e}px;
29
28
  padding-bottom: ${i}px;
30
- `, m = t.div`
29
+ `, h = t.div`
31
30
  position: absolute;
32
31
  display: flex;
33
32
  top: 5px;
@@ -36,7 +35,7 @@ const s = t.div`
36
35
  height: 100%;
37
36
  align-items: center;
38
37
  justify-content: center;
39
- `, x = t.div`
38
+ `, l = t.div`
40
39
  position: absolute;
41
40
  bottom: 0;
42
41
  width: 100%;
@@ -45,7 +44,7 @@ const s = t.div`
45
44
  justify-content: center;
46
45
  width: 150%;
47
46
  height: 150%;
48
- `, f = t.div`
47
+ `, m = t.div`
49
48
  background: ${({ theme: o }) => o.colors.YELLOW_6};
50
49
  min-height: 32px;
51
50
  width: 100%;
@@ -54,17 +53,14 @@ const s = t.div`
54
53
  align-items: center;
55
54
  justify-content: center;
56
55
  `;
57
- t(e)`
58
- padding: 16px;
59
- `;
60
56
  export {
61
- x as ActionButtonWrapper,
62
- f as Banner,
63
- h as BannerWrapper,
64
- l as ItemsWrapper,
65
- s as Leaderboard,
66
- c as LeaderboardContainer,
67
- m as TournamentBannerCustContainer,
57
+ l as ActionButtonWrapper,
58
+ m as Banner,
59
+ s as BannerWrapper,
60
+ c as ItemsWrapper,
61
+ a as Leaderboard,
62
+ p as LeaderboardContainer,
63
+ h as TournamentBannerCustContainer,
68
64
  g as TrophyWrapper
69
65
  };
70
66
  //# sourceMappingURL=leaderboard-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-styled.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { ARC_BUTTON_BOTTOM_OFFSET } from '../../ui/arc-button/constants';\nimport FlexView from '../../ui/layout/flex-view';\nimport { BANNER_HEIGHT } from './comps/banner/constants';\n\nexport const Leaderboard = styled.div`\n flex-direction: column;\n overflow: hidden;\n height: 100vh;\n max-height: 100%;\n position: relative;\n`;\n\nexport const LeaderboardContainer = styled.div`\n background: ${({ theme }) => theme.colors.BLACK_1};\n height: 100%;\n position: relative;\n width: 100%;\n`;\n\nexport const BannerWrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 10;\n`;\n\nexport const ItemsWrapper = styled.div<{ topInset: number }>`\n background: transparent;\n position: absolute;\n overflow: auto;\n width: 100%;\n flex: 1;\n height: 100%;\n padding-top: ${BANNER_HEIGHT}px;\n padding-bottom: ${ARC_BUTTON_BOTTOM_OFFSET}px;\n`;\n\nexport const TournamentBannerCustContainer = styled.div`\n position: absolute;\n display: flex;\n top: 5px;\n right: -2px;\n width: 200px;\n height: 100%;\n align-items: center;\n justify-content: center;\n`;\n\nexport const ActionButtonWrapper = styled.div`\n position: absolute;\n bottom: 0;\n width: 100%;\n`;\n\nexport const TrophyWrapper = styled.div`\n display: flex;\n justify-content: center;\n width: 150%;\n height: 150%;\n`;\n\nexport const Banner = styled.div`\n background: ${({ theme }) => theme.colors.YELLOW_6};\n min-height: 32px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n`;\n\nexport const InfoContainer = styled(FlexView)`\n padding: 16px;\n`;\n"],"names":["Leaderboard","styled","LeaderboardContainer","theme","BannerWrapper","ItemsWrapper","BANNER_HEIGHT","ARC_BUTTON_BOTTOM_OFFSET","TournamentBannerCustContainer","ActionButtonWrapper","TrophyWrapper","Banner","FlexView"],"mappings":";;;;AAMO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBC,IAAuBD,EAAO;AAAA,gBAC3B,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,GAMtCC,IAAgBH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBI,IAAeJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAOlBK,CAAa;AAAA,oBACVC,CAAwB;AAAA,GAG/BC,IAAgCP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWvCQ,IAAsBR,EAAO;AAAA;AAAA;AAAA;AAAA,GAM7BS,IAAgBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBU,IAASV,EAAO;AAAA,gBACb,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASvBF,EAAOW,CAAQ;AAAA;AAAA;"}
1
+ {"version":3,"file":"leaderboard-styled.js","sources":["../../../../src/features/circle-games/leaderboard/leaderboard-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport { ARC_BUTTON_BOTTOM_OFFSET } from '../../ui/arc-button/constants';\nimport { BANNER_HEIGHT } from './comps/banner/constants';\n\nexport const Leaderboard = styled.div`\n flex-direction: column;\n overflow: hidden;\n height: 100vh;\n max-height: 100%;\n position: relative;\n`;\n\nexport const LeaderboardContainer = styled.div`\n background: ${({ theme }) => theme.colors.BLACK_1};\n height: 100%;\n position: relative;\n width: 100%;\n`;\n\nexport const BannerWrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 10;\n`;\n\nexport const ItemsWrapper = styled.div<{ topInset: number }>`\n background: transparent;\n position: absolute;\n overflow: auto;\n width: 100%;\n flex: 1;\n height: 100%;\n padding-top: ${BANNER_HEIGHT}px;\n padding-bottom: ${ARC_BUTTON_BOTTOM_OFFSET}px;\n`;\n\nexport const TournamentBannerCustContainer = styled.div`\n position: absolute;\n display: flex;\n top: 5px;\n right: -2px;\n width: 200px;\n height: 100%;\n align-items: center;\n justify-content: center;\n`;\n\nexport const ActionButtonWrapper = styled.div`\n position: absolute;\n bottom: 0;\n width: 100%;\n`;\n\nexport const TrophyWrapper = styled.div`\n display: flex;\n justify-content: center;\n width: 150%;\n height: 150%;\n`;\n\nexport const Banner = styled.div`\n background: ${({ theme }) => theme.colors.YELLOW_6};\n min-height: 32px;\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n`;\n"],"names":["Leaderboard","styled","LeaderboardContainer","theme","BannerWrapper","ItemsWrapper","BANNER_HEIGHT","ARC_BUTTON_BOTTOM_OFFSET","TournamentBannerCustContainer","ActionButtonWrapper","TrophyWrapper","Banner"],"mappings":";;;AAKO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQrBC,IAAuBD,EAAO;AAAA,gBAC3B,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,GAMtCC,IAAgBH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBI,IAAeJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAOlBK,CAAa;AAAA,oBACVC,CAAwB;AAAA,GAG/BC,IAAgCP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWvCQ,IAAsBR,EAAO;AAAA;AAAA;AAAA;AAAA,GAM7BS,IAAgBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBU,IAASV,EAAO;AAAA,gBACb,CAAC,EAAE,OAAAE,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}