@timardex/cluemart-shared 1.5.504 → 1.5.506
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/{chunk-XNMKWMNF.mjs → chunk-4H2QFRNE.mjs} +23 -6
- package/dist/chunk-4H2QFRNE.mjs.map +1 -0
- package/dist/{chunk-A3BCQJII.mjs → chunk-K4J6EBAJ.mjs} +2 -2
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +23 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +22 -5
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +23 -5
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +3 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.mjs +3 -1
- package/package.json +1 -1
- package/dist/chunk-XNMKWMNF.mjs.map +0 -1
- /package/dist/{chunk-A3BCQJII.mjs.map → chunk-K4J6EBAJ.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-K4J6EBAJ.mjs";
|
|
2
2
|
import "../chunk-RQDZX76B.mjs";
|
|
3
3
|
import "../chunk-DWO35OY4.mjs";
|
|
4
4
|
import "../chunk-I7WE3EBR.mjs";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
dateFormat,
|
|
15
15
|
normalizeUrl,
|
|
16
16
|
timeFormat
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-4H2QFRNE.mjs";
|
|
18
18
|
import {
|
|
19
19
|
EnumEventDateStatus,
|
|
20
20
|
EnumEventType,
|
package/dist/index.cjs
CHANGED
|
@@ -109,6 +109,7 @@ __export(index_exports, {
|
|
|
109
109
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
110
110
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
111
111
|
normalizeUrl: () => normalizeUrl,
|
|
112
|
+
nzStartOfDay: () => nzStartOfDay,
|
|
112
113
|
packagingOptions: () => packagingOptions,
|
|
113
114
|
partnerBasicInfoFields: () => partnerBasicInfoFields,
|
|
114
115
|
paymentMethodOptions: () => paymentMethodOptions,
|
|
@@ -857,6 +858,12 @@ var NZ_TZ = "Pacific/Auckland";
|
|
|
857
858
|
function toNZTime(date3) {
|
|
858
859
|
return date3 ? (0, import_dayjs.default)(date3).tz(NZ_TZ) : (0, import_dayjs.default)().tz(NZ_TZ);
|
|
859
860
|
}
|
|
861
|
+
function nzStartOfDay(input) {
|
|
862
|
+
if (input == null) {
|
|
863
|
+
return (0, import_dayjs.default)().tz(NZ_TZ).startOf("day");
|
|
864
|
+
}
|
|
865
|
+
return (0, import_dayjs.default)(input).tz(NZ_TZ).startOf("day");
|
|
866
|
+
}
|
|
860
867
|
var formatDate = (dateStr, display = "datetime", timeStr) => {
|
|
861
868
|
const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
|
|
862
869
|
const dateTime = timeStr ? (0, import_dayjs.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs.default)(dateStr, dateFormat);
|
|
@@ -944,9 +951,9 @@ function getDayIndex(start, today) {
|
|
|
944
951
|
function computeDailyClueState(dailyClue) {
|
|
945
952
|
const { startDate, endDate } = dailyClue.gameFields.gameDate;
|
|
946
953
|
const { shuffled, collected } = dailyClue.letterInfo;
|
|
947
|
-
const today =
|
|
948
|
-
const start =
|
|
949
|
-
const end =
|
|
954
|
+
const today = nzStartOfDay();
|
|
955
|
+
const start = nzStartOfDay(startDate);
|
|
956
|
+
const end = nzStartOfDay(endDate);
|
|
950
957
|
const shuffledPlacements = seededShuffle(
|
|
951
958
|
gameScreenIdentifierList,
|
|
952
959
|
start.toISOString()
|
|
@@ -969,8 +976,18 @@ function computeDailyClueState(dailyClue) {
|
|
|
969
976
|
}
|
|
970
977
|
const index = getDayIndex(start, today);
|
|
971
978
|
if (index < 0 || index >= shuffled.length) return null;
|
|
972
|
-
|
|
973
|
-
|
|
979
|
+
const letterToday = shuffled[index]?.trim().toLowerCase();
|
|
980
|
+
if (!letterToday) return null;
|
|
981
|
+
const alreadyHaveTodaysSlot = (collected ?? []).some(
|
|
982
|
+
(l) => l.trim().toLowerCase() === letterToday
|
|
983
|
+
);
|
|
984
|
+
if (alreadyHaveTodaysSlot) {
|
|
985
|
+
return {
|
|
986
|
+
gameHistory: null,
|
|
987
|
+
todaysClue: null,
|
|
988
|
+
todaysLetter: null,
|
|
989
|
+
todaysPlacement: null
|
|
990
|
+
};
|
|
974
991
|
}
|
|
975
992
|
return {
|
|
976
993
|
gameHistory: null,
|
|
@@ -8296,6 +8313,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
8296
8313
|
mapArrayToOptions,
|
|
8297
8314
|
mapBaseResourceTypeToFormData,
|
|
8298
8315
|
normalizeUrl,
|
|
8316
|
+
nzStartOfDay,
|
|
8299
8317
|
packagingOptions,
|
|
8300
8318
|
partnerBasicInfoFields,
|
|
8301
8319
|
paymentMethodOptions,
|