@cuemath/leap 2.8.48-rj-1 → 2.8.48-rj-xx
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/analytics-events/platform-events-student.js +5 -6
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +4 -3
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +74 -68
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js +6 -6
- package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js.map +1 -1
- package/dist/features/circle-games/leaderboard/hooks/{use-intersection-observer/use-intersection-observer.tsx.js → useIntersectionObserver.js} +1 -1
- package/dist/features/circle-games/leaderboard/hooks/useIntersectionObserver.js.map +1 -0
- package/dist/features/circle-games/leaderboard/hooks/{use-timer/use-timer.js → useTimer.js} +1 -1
- package/dist/features/circle-games/leaderboard/hooks/useTimer.js.map +1 -0
- package/dist/features/circle-games/leaderboard/leaderboard-styled.js +16 -20
- package/dist/features/circle-games/leaderboard/leaderboard-styled.js.map +1 -1
- package/dist/features/circle-games/leaderboard/leaderboard.js +87 -96
- package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-helpers.js +23 -19
- package/dist/features/cue-canvas/cue-canvas-helpers.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/trial-session/comps/trial-circle-game/trial-circle-game.js +60 -61
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +71 -73
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/index.d.ts +5 -38
- package/dist/index.js +225 -231
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/circle-games/enum/circle-action-ids.js +0 -5
- package/dist/features/circle-games/enum/circle-action-ids.js.map +0 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js +0 -12
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +0 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js +0 -11
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +0 -1
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js +0 -5
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js.map +0 -1
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +0 -50
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +0 -1
- package/dist/features/circle-games/leaderboard/hooks/use-intersection-observer/use-intersection-observer.tsx.js.map +0 -1
- package/dist/features/circle-games/leaderboard/hooks/use-timer/use-timer.js.map +0 -1
- package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js +0 -25
- package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js.map +0 -1
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"circle-action-ids.js","sources":["../../../../src/features/circle-games/enum/circle-action-ids.ts"],"sourcesContent":["export enum CIRCLE_ACTION_IDS {\n STREAK_DECREASED = 'streak_decreased',\n}\n"],"names":["CIRCLE_ACTION_IDS"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,mBAAmB,oBADTA,IAAAA,KAAA,CAAA,CAAA;"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import r from "styled-components";
|
2
|
-
import o from "../../../../ui/layout/flex-view.js";
|
3
|
-
const d = r(o)`
|
4
|
-
padding: 16px;
|
5
|
-
margin: 16px;
|
6
|
-
border-width: 1px;
|
7
|
-
border-style: solid;
|
8
|
-
`;
|
9
|
-
export {
|
10
|
-
d as InfoBarWrapper
|
11
|
-
};
|
12
|
-
//# sourceMappingURL=info-bar-styled.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { useMemo as m } from "react";
|
3
|
-
import { InfoBarWrapper as c } from "./info-bar-styled.js";
|
4
|
-
const p = (o) => ({ backgroundColor: `${o}_6`, borderColor: `${o}_4` }), l = ({ children: o, hue: r }) => {
|
5
|
-
const { backgroundColor: n, borderColor: t } = m(() => p(r), [r]);
|
6
|
-
return /* @__PURE__ */ e(c, { $background: n, $borderColor: t, children: o });
|
7
|
-
};
|
8
|
-
export {
|
9
|
-
l as InfoBar
|
10
|
-
};
|
11
|
-
//# sourceMappingURL=info-bar.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.ts"],"sourcesContent":["export const STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP =\n 'STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP';\n"],"names":["STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP"],"mappings":"AAAO,MAAMA,IACX;"}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
-
import { useState as l, useEffect as m, useCallback as I } from "react";
|
3
|
-
import k from "../../../../../assets/line-icons/icons/cross.js";
|
4
|
-
import d from "../../../../ui/layout/flex-view.js";
|
5
|
-
import n from "../../../../ui/text/text.js";
|
6
|
-
import { StreakReductionLocalStorageUtil as t } from "../../../utils/streak-reduction-localstorage-util.js";
|
7
|
-
import { InfoBar as E } from "../info-bar/info-bar.js";
|
8
|
-
import { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP as c } from "./constants.js";
|
9
|
-
const B = ({
|
10
|
-
startTimestampToday: e,
|
11
|
-
streakReduction: o
|
12
|
-
}) => {
|
13
|
-
const [f, i] = l(
|
14
|
-
t.showStreakReduction(
|
15
|
-
c,
|
16
|
-
e
|
17
|
-
)
|
18
|
-
), [s, u] = l(o > 0);
|
19
|
-
m(() => {
|
20
|
-
u(o > 0), i(
|
21
|
-
t.showStreakReduction(
|
22
|
-
c,
|
23
|
-
e
|
24
|
-
)
|
25
|
-
);
|
26
|
-
}, [e, o]);
|
27
|
-
const h = I(() => {
|
28
|
-
t.markStreakReductionDismissed(
|
29
|
-
c,
|
30
|
-
e
|
31
|
-
), i(!1);
|
32
|
-
}, [e]);
|
33
|
-
return f ? /* @__PURE__ */ r(
|
34
|
-
E,
|
35
|
-
{
|
36
|
-
children: /* @__PURE__ */ a(d, { $flexDirection: "row", $alignItems: "center", $justifyContent: "space-between", children: [
|
37
|
-
s ? /* @__PURE__ */ a(d, { children: [
|
38
|
-
/* @__PURE__ */ r(n, { $renderAs: "ab2", $color: "WHITE_T_87", children: "Keep building your streak by completing an activity each day." }),
|
39
|
-
/* @__PURE__ */ r(n, { $renderAs: "ab2", $color: "WHITE_T_87", children: "For each day missed, your streak reduces by 1." })
|
40
|
-
] }) : /* @__PURE__ */ r(n, { $renderAs: "ab2", $color: "WHITE_T_87", children: "Streak saved for the day! Come back tomorrow to keep increasing it." }),
|
41
|
-
/* @__PURE__ */ r(k, { cursor: "pointer", color: "WHITE", onClick: h })
|
42
|
-
] }),
|
43
|
-
hue: s ? "YELLOW" : "GREEN"
|
44
|
-
}
|
45
|
-
) : null;
|
46
|
-
};
|
47
|
-
export {
|
48
|
-
B as StreakReductionInfoBar
|
49
|
-
};
|
50
|
-
//# sourceMappingURL=streak-reduction-infobar.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IUseStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { StreakReductionLocalStorageUtil } from '../../../utils/streak-reduction-localstorage-util';\nimport { InfoBar } from '../info-bar/info-bar';\nimport { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP } from './constants';\n\nexport const StreakReductionInfoBar = ({\n startTimestampToday,\n streakReduction,\n}: IUseStreakReductionLeaderboard) => {\n const [showInfoBar, setShowInfoBar] = useState(\n StreakReductionLocalStorageUtil.showStreakReduction(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n ),\n );\n\n const [hasStreakReduced, setHasStreakReduced] = useState(streakReduction > 0);\n\n // On Props Change Rerender\n useEffect(() => {\n setHasStreakReduced(streakReduction > 0);\n setShowInfoBar(\n StreakReductionLocalStorageUtil.showStreakReduction(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n ),\n );\n }, [startTimestampToday, streakReduction]);\n\n const onInfoBarClose = useCallback(() => {\n StreakReductionLocalStorageUtil.markStreakReductionDismissed(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n );\n setShowInfoBar(false);\n }, [startTimestampToday]);\n\n if (!showInfoBar) {\n return null;\n }\n\n return (\n <InfoBar\n children={\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n {hasStreakReduced ? (\n <FlexView>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Keep building your streak by completing an activity each day.\n </Text>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n For each day missed, your streak reduces by 1.\n </Text>\n </FlexView>\n ) : (\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Streak saved for the day! Come back tomorrow to keep increasing it.\n </Text>\n )}\n <CrossIcon cursor={'pointer'} color=\"WHITE\" onClick={onInfoBarClose} />\n </FlexView>\n }\n hue={hasStreakReduced ? 'YELLOW' : 'GREEN'}\n />\n );\n};\n"],"names":["StreakReductionInfoBar","startTimestampToday","streakReduction","showInfoBar","setShowInfoBar","useState","StreakReductionLocalStorageUtil","STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP","hasStreakReduced","setHasStreakReduced","useEffect","onInfoBarClose","useCallback","jsx","InfoBar","FlexView","Text","CrossIcon"],"mappings":";;;;;;;;AAWO,MAAMA,IAAyB,CAAC;AAAA,EACrC,qBAAAC;AAAA,EACA,iBAAAC;AACF,MAAsC;AAC9B,QAAA,CAACC,GAAaC,CAAc,IAAIC;AAAA,IACpCC,EAAgC;AAAA,MAC9BC;AAAA,MACAN;AAAA,IACF;AAAA,EAAA,GAGI,CAACO,GAAkBC,CAAmB,IAAIJ,EAASH,IAAkB,CAAC;AAG5E,EAAAQ,EAAU,MAAM;AACd,IAAAD,EAAoBP,IAAkB,CAAC,GACvCE;AAAA,MACEE,EAAgC;AAAA,QAC9BC;AAAA,QACAN;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACC,CAACA,GAAqBC,CAAe,CAAC;AAEnC,QAAAS,IAAiBC,EAAY,MAAM;AACP,IAAAN,EAAA;AAAA,MAC9BC;AAAA,MACAN;AAAA,IAAA,GAEFG,EAAe,EAAK;AAAA,EAAA,GACnB,CAACH,CAAmB,CAAC;AAExB,SAAKE,IAKH,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,iBAAgB,iBACjE,UAAA;AAAA,QAAAP,sBACEO,GACC,EAAA,UAAA;AAAA,UAAA,gBAAAF,EAACG,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,iEAAA;AAAA,4BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,kDAAA;AAAA,QAAA,EAAA,CACF,IAEC,gBAAAH,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,cAAa,UAE1C,uEAAA;AAAA,0BAEDC,GAAU,EAAA,QAAQ,WAAW,OAAM,SAAQ,SAASN,GAAgB;AAAA,MAAA,GACvE;AAAA,MAEF,KAAKH,IAAmB,WAAW;AAAA,IAAA;AAAA,EAAA,IAxB9B;AA2BX;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"use-intersection-observer.tsx.js","sources":["../../../../../../src/features/circle-games/leaderboard/hooks/use-intersection-observer/use-intersection-observer.tsx.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;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"use-timer.js","sources":["../../../../../../src/features/circle-games/leaderboard/hooks/use-timer/use-timer.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,25 +0,0 @@
|
|
1
|
-
class s {
|
2
|
-
/**
|
3
|
-
* Determines whether the streak reduction should be shown today.
|
4
|
-
*/
|
5
|
-
static showStreakReduction(e, t) {
|
6
|
-
try {
|
7
|
-
if (!t)
|
8
|
-
return !1;
|
9
|
-
const r = localStorage.getItem(e);
|
10
|
-
return !r || !(r === `${t}`);
|
11
|
-
} catch {
|
12
|
-
return !0;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
/**
|
16
|
-
* Call this when the user has dismissed the streak reduction.
|
17
|
-
*/
|
18
|
-
static markStreakReductionDismissed(e, t) {
|
19
|
-
localStorage.setItem(e, t.toString());
|
20
|
-
}
|
21
|
-
}
|
22
|
-
export {
|
23
|
-
s as StreakReductionLocalStorageUtil
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=streak-reduction-localstorage-util.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"streak-reduction-localstorage-util.js","sources":["../../../../src/features/circle-games/utils/streak-reduction-localstorage-util.ts"],"sourcesContent":["export class StreakReductionLocalStorageUtil {\n /**\n * Determines whether the streak reduction should be shown today.\n */\n static showStreakReduction(storeKey: string, startTimestamp: number): boolean {\n try {\n if (!startTimestamp) {\n return false;\n }\n\n const storedTimestamp = localStorage.getItem(storeKey);\n\n // If there's no stored timestamp, show the button\n if (!storedTimestamp) return true;\n\n // If stored timestamp is not from today, show the button\n const isSameDay = storedTimestamp === `${startTimestamp}`;\n\n if (!isSameDay) {\n return true;\n }\n\n return false;\n } catch (error) {\n return true;\n }\n }\n\n /**\n * Call this when the user has dismissed the streak reduction.\n */\n static markStreakReductionDismissed(storeKey: string, startTimestamp: number): void {\n localStorage.setItem(storeKey, startTimestamp.toString());\n }\n}\n"],"names":["StreakReductionLocalStorageUtil","storeKey","startTimestamp","storedTimestamp"],"mappings":"AAAO,MAAMA,EAAgC;AAAA;AAAA;AAAA;AAAA,EAI3C,OAAO,oBAAoBC,GAAkBC,GAAiC;AACxE,QAAA;AACF,UAAI,CAACA;AACI,eAAA;AAGH,YAAAC,IAAkB,aAAa,QAAQF,CAAQ;AAQrD,aALI,CAACE,KAKD,EAFcA,MAAoB,GAAGD,CAAc;AAAA,YAOzC;AACP,aAAA;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,6BAA6BD,GAAkBC,GAA8B;AAClF,iBAAa,QAAQD,GAAUC,EAAe,SAAU,CAAA;AAAA,EAC1D;AACF;"}
|