@timardex/cluemart-shared 1.6.130 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/ad-BUYzE6zx.d.ts +181 -0
  2. package/dist/ad-BhLoEul3.d.mts +181 -0
  3. package/dist/affiliate-BbtjeUP4.d.mts +73 -0
  4. package/dist/affiliate-C51nzKsw.d.ts +73 -0
  5. package/dist/apollo/index.d.mts +3 -3
  6. package/dist/apollo/index.d.ts +3 -3
  7. package/dist/auth/index.cjs +951 -2546
  8. package/dist/auth/index.cjs.map +1 -1
  9. package/dist/auth/index.d.mts +30 -28
  10. package/dist/auth/index.d.ts +30 -28
  11. package/dist/auth/index.mjs +25 -24
  12. package/dist/auth/index.mjs.map +1 -1
  13. package/dist/chunk-32MKHJTX.mjs +1207 -0
  14. package/dist/chunk-32MKHJTX.mjs.map +1 -0
  15. package/dist/chunk-AYO3E4DM.mjs +224 -0
  16. package/dist/chunk-AYO3E4DM.mjs.map +1 -0
  17. package/dist/chunk-BIJ5NDXW.mjs +962 -0
  18. package/dist/chunk-BIJ5NDXW.mjs.map +1 -0
  19. package/dist/chunk-DQ7ZHIXW.mjs +26 -0
  20. package/dist/chunk-DQ7ZHIXW.mjs.map +1 -0
  21. package/dist/chunk-ILILH7E2.mjs +219 -0
  22. package/dist/chunk-ILILH7E2.mjs.map +1 -0
  23. package/dist/{chunk-OHHJ3KJJ.mjs → chunk-LBEJECG3.mjs} +64 -71
  24. package/dist/chunk-LBEJECG3.mjs.map +1 -0
  25. package/dist/chunk-NPFJ2CN2.mjs +109 -0
  26. package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
  27. package/dist/chunk-R6PCFOYO.mjs +3650 -0
  28. package/dist/chunk-R6PCFOYO.mjs.map +1 -0
  29. package/dist/{chunk-NWWKI4PJ.mjs → chunk-SD42WIMV.mjs} +5 -5
  30. package/dist/chunk-SD42WIMV.mjs.map +1 -0
  31. package/dist/chunk-VA5YN2K3.mjs +48 -0
  32. package/dist/chunk-VA5YN2K3.mjs.map +1 -0
  33. package/dist/{chunk-DATBGC2K.mjs → chunk-VPANTTZI.mjs} +23 -108
  34. package/dist/chunk-VPANTTZI.mjs.map +1 -0
  35. package/dist/chunk-X3OLM35T.mjs +278 -0
  36. package/dist/chunk-X3OLM35T.mjs.map +1 -0
  37. package/dist/contactUs--NoohZBu.d.ts +11 -0
  38. package/dist/contactUs-CBWzefUS.d.mts +11 -0
  39. package/dist/enums/index.cjs +229 -2
  40. package/dist/enums/index.cjs.map +1 -1
  41. package/dist/enums/index.d.mts +170 -5
  42. package/dist/enums/index.d.ts +170 -5
  43. package/dist/enums/index.mjs +41 -1
  44. package/dist/formFields/index.cjs +112 -284
  45. package/dist/formFields/index.cjs.map +1 -1
  46. package/dist/formFields/index.d.mts +2 -4
  47. package/dist/formFields/index.d.ts +2 -4
  48. package/dist/formFields/index.mjs +50 -919
  49. package/dist/formFields/index.mjs.map +1 -1
  50. package/dist/global-CUYYxpy2.d.ts +699 -0
  51. package/dist/global-DePDtOFt.d.mts +699 -0
  52. package/dist/graphql/index.cjs +2304 -2872
  53. package/dist/graphql/index.cjs.map +1 -1
  54. package/dist/graphql/index.d.mts +469 -422
  55. package/dist/graphql/index.d.ts +469 -422
  56. package/dist/graphql/index.mjs +160 -2547
  57. package/dist/graphql/index.mjs.map +1 -1
  58. package/dist/hooks/index.cjs +3869 -534
  59. package/dist/hooks/index.cjs.map +1 -1
  60. package/dist/hooks/index.d.mts +9 -10
  61. package/dist/hooks/index.d.ts +9 -10
  62. package/dist/hooks/index.mjs +72 -54
  63. package/dist/hooks/index.mjs.map +1 -1
  64. package/dist/images/index.mjs +21 -86
  65. package/dist/images/index.mjs.map +1 -1
  66. package/dist/index.cjs +4477 -5723
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.d.mts +1679 -2539
  69. package/dist/index.d.ts +1679 -2539
  70. package/dist/index.mjs +4453 -5682
  71. package/dist/index.mjs.map +1 -1
  72. package/dist/map/index.d.mts +2 -3
  73. package/dist/map/index.d.ts +2 -3
  74. package/dist/resourceActivities-CMUcn2P7.d.ts +130 -0
  75. package/dist/resourceActivities-CwbJFGIp.d.mts +130 -0
  76. package/dist/sharing/index.cjs +19 -23
  77. package/dist/sharing/index.cjs.map +1 -1
  78. package/dist/sharing/index.d.mts +3 -16
  79. package/dist/sharing/index.d.ts +3 -16
  80. package/dist/sharing/index.mjs +29 -183
  81. package/dist/sharing/index.mjs.map +1 -1
  82. package/dist/subscription-BU8GvH2K.d.ts +12 -0
  83. package/dist/subscription-bmAdrnfi.d.mts +12 -0
  84. package/dist/theme/index.mjs +5 -41
  85. package/dist/theme/index.mjs.map +1 -1
  86. package/dist/types/index.cjs +123 -868
  87. package/dist/types/index.cjs.map +1 -1
  88. package/dist/types/index.d.mts +15 -234
  89. package/dist/types/index.d.ts +15 -234
  90. package/dist/types/index.mjs +31 -61
  91. package/dist/user-D47MLFyH.d.ts +134 -0
  92. package/dist/user-DE8edl3u.d.mts +134 -0
  93. package/dist/utils/index.cjs +117 -292
  94. package/dist/utils/index.cjs.map +1 -1
  95. package/dist/utils/index.d.mts +23 -25
  96. package/dist/utils/index.d.ts +23 -25
  97. package/dist/utils/index.mjs +5 -6
  98. package/package.json +3 -10
  99. package/dist/affiliate-Bqqlffw8.d.mts +0 -36
  100. package/dist/affiliate-Btlp5XUp.d.ts +0 -36
  101. package/dist/affiliateAdapters-BW3BY7c5.d.mts +0 -118
  102. package/dist/affiliateAdapters-C51ISmuA.d.ts +0 -118
  103. package/dist/auth-BOmAO53v.d.ts +0 -169
  104. package/dist/auth-CsITA95p.d.mts +0 -169
  105. package/dist/chunk-DATBGC2K.mjs.map +0 -1
  106. package/dist/chunk-DDHECBJR.mjs +0 -726
  107. package/dist/chunk-DDHECBJR.mjs.map +0 -1
  108. package/dist/chunk-INQCDU24.mjs +0 -139
  109. package/dist/chunk-INQCDU24.mjs.map +0 -1
  110. package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
  111. package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
  112. package/dist/chunk-TOEFAEF2.mjs +0 -69
  113. package/dist/chunk-TOEFAEF2.mjs.map +0 -1
  114. package/dist/chunk-UKW7NZEQ.mjs +0 -2813
  115. package/dist/chunk-UKW7NZEQ.mjs.map +0 -1
  116. package/dist/dailyClue-C6WXY73z.d.mts +0 -105
  117. package/dist/dailyClue-C6WXY73z.d.ts +0 -105
  118. package/dist/event-C9K7CSg4.d.ts +0 -53
  119. package/dist/event-W0NhL5Cd.d.mts +0 -53
  120. package/dist/global-BbSFfYdd.d.ts +0 -181
  121. package/dist/global-C6v9tRji.d.mts +0 -181
  122. package/dist/graphql-CDOfA79A.d.ts +0 -1253
  123. package/dist/graphql-CcvzTs9k.d.mts +0 -1253
  124. package/dist/resourceActivities-CS8YRIIL.d.mts +0 -89
  125. package/dist/resourceActivities-DOdNPkhW.d.ts +0 -89
  126. package/dist/subscription-Cj_qBA7u.d.mts +0 -20
  127. package/dist/subscription-OiJ50uJb.d.ts +0 -20
  128. package/dist/vendor-DmMi2qmx.d.mts +0 -73
  129. package/dist/vendor-M9hVZlni.d.ts +0 -73
@@ -1,726 +0,0 @@
1
- import {
2
- PROMO_CODE_PREFIX
3
- } from "./chunk-DATBGC2K.mjs";
4
- import {
5
- SocialMediaEnumType
6
- } from "./chunk-INQCDU24.mjs";
7
-
8
- // src/types/eventAdapters.ts
9
- function toPromoCodeType(code) {
10
- if (!code.startsWith(PROMO_CODE_PREFIX)) {
11
- throw new Error(`Invalid promo code from GraphQL: ${JSON.stringify(code)}`);
12
- }
13
- return code;
14
- }
15
- var REQUIREMENT_CATEGORIES = [
16
- "Food Safety",
17
- "Environment",
18
- "Operations",
19
- "Legal & Safety"
20
- ];
21
- var REFUND_CATEGORIES = [
22
- "Cancelled by Organiser",
23
- "Cancelled by Vendor"
24
- ];
25
- function isRequirementCategory(value) {
26
- return REQUIREMENT_CATEGORIES.includes(value);
27
- }
28
- function isRefundCategory(value) {
29
- return REFUND_CATEGORIES.includes(value);
30
- }
31
- function isSocialMediaName(value) {
32
- return Object.values(SocialMediaEnumType).includes(value);
33
- }
34
- function toFormSocialMedia(socialMedia) {
35
- if (socialMedia == null) {
36
- return null;
37
- }
38
- return socialMedia.map((item) => ({
39
- link: item.link,
40
- name: isSocialMediaName(item.name) ? item.name : void 0
41
- }));
42
- }
43
- function toFormRequirement(item) {
44
- if (!isRequirementCategory(item.category)) {
45
- throw new Error(
46
- `Invalid requirement category from GraphQL: ${JSON.stringify(item.category)}`
47
- );
48
- }
49
- return {
50
- category: item.category,
51
- label: item.label,
52
- value: item.value
53
- };
54
- }
55
- function toFormRefundPolicy(item) {
56
- if (!isRefundCategory(item.category)) {
57
- throw new Error(
58
- `Invalid refund-policy category from GraphQL: ${JSON.stringify(item.category)}`
59
- );
60
- }
61
- return {
62
- category: item.category,
63
- label: item.label,
64
- value: item.value
65
- };
66
- }
67
- function toFormStallType(stall) {
68
- return {
69
- label: stall.label,
70
- price: stall.price,
71
- stallCapacity: stall.stallCapacity
72
- };
73
- }
74
- function toFormDateTimeWithPrice(row) {
75
- return {
76
- dateStatus: row.dateStatus,
77
- endDate: row.endDate,
78
- endTime: row.endTime,
79
- stallTypes: row.stallTypes.map(toFormStallType),
80
- startDate: row.startDate,
81
- startTime: row.startTime
82
- };
83
- }
84
- function toFormPaymentInfo(item) {
85
- return {
86
- accountHolderName: item.accountHolderName ?? void 0,
87
- accountNumber: item.accountNumber ?? void 0,
88
- link: item.link ?? void 0,
89
- paymentMethod: item.paymentMethod
90
- };
91
- }
92
- function eventToEventListItem(event) {
93
- return {
94
- _id: event._id,
95
- active: event.active,
96
- approvedAt: event.approvedAt,
97
- claimed: event.claimed,
98
- cover: event.cover,
99
- createdAt: event.createdAt,
100
- dateTime: event.dateTime,
101
- deletedAt: event.deletedAt,
102
- description: event.description,
103
- eventType: event.eventType,
104
- googlePlaceId: event.googlePlaceId,
105
- images: event.images ?? void 0,
106
- location: event.location,
107
- logo: event.logo,
108
- name: event.name,
109
- rainOrShine: event.rainOrShine,
110
- rating: event.rating,
111
- region: event.region,
112
- relations: event.relations ?? void 0,
113
- reviewCount: event.reviewCount,
114
- slug: event.slug,
115
- updatedAt: event.updatedAt
116
- };
117
- }
118
- function eventToFormData(event) {
119
- return {
120
- _id: event._id,
121
- active: event.active,
122
- claimed: event.claimed,
123
- contactDetails: event.contactDetails ?? null,
124
- cover: event.cover,
125
- coverUpload: null,
126
- dateTime: event.dateTime,
127
- description: event.description,
128
- eventType: event.eventType,
129
- googlePlaceId: event.googlePlaceId ?? null,
130
- images: event.images ?? null,
131
- imagesUpload: null,
132
- location: event.location,
133
- logo: event.logo ?? null,
134
- logoUpload: null,
135
- name: event.name,
136
- nzbn: event.nzbn,
137
- promoCodes: (event.promoCodes ?? []).filter((code) => code != null).map(toPromoCodeType),
138
- provider: event.provider ?? null,
139
- rainOrShine: event.rainOrShine,
140
- region: event.region,
141
- socialMedia: toFormSocialMedia(event.socialMedia),
142
- tags: event.tags,
143
- termsAgreement: event.termsAgreement ? {
144
- appBuildNumber: event.termsAgreement.appBuildNumber,
145
- appId: event.termsAgreement.appId,
146
- appVersion: event.termsAgreement.appVersion,
147
- brand: event.termsAgreement.brand,
148
- deviceName: event.termsAgreement.deviceName,
149
- installationId: event.termsAgreement.installationId,
150
- manufacturer: event.termsAgreement.manufacturer,
151
- modelName: event.termsAgreement.modelName,
152
- osName: event.termsAgreement.osName,
153
- osVersion: event.termsAgreement.osVersion,
154
- termVersion: event.termsAgreement.termVersion,
155
- timestamp: event.termsAgreement.timestamp
156
- } : null
157
- };
158
- }
159
- function eventInfoToFormData(eventInfo, options = {}) {
160
- const savedRefund = eventInfo.refundPolicy.map(toFormRefundPolicy);
161
- const savedRequirements = (eventInfo.requirements ?? []).map(
162
- toFormRequirement
163
- );
164
- const refundPolicy = [
165
- ...savedRefund,
166
- ...(options.defaultRefundPolicy ?? []).filter(
167
- (option) => !savedRefund.some((saved) => saved.label === option.label)
168
- )
169
- ];
170
- const requirements = [
171
- ...savedRequirements,
172
- ...(options.defaultRequirements ?? []).filter(
173
- (option) => !savedRequirements.some((saved) => saved.label === option.label)
174
- )
175
- ];
176
- return {
177
- _id: eventInfo._id,
178
- applicationDeadlineHours: eventInfo.applicationDeadlineHours,
179
- dateTime: eventInfo.dateTime.map(toFormDateTimeWithPrice),
180
- eventId: eventInfo.eventId,
181
- packInTime: eventInfo.packInTime,
182
- paymentDueHours: eventInfo.paymentDueHours,
183
- paymentInfo: eventInfo.paymentInfo.map(toFormPaymentInfo),
184
- refundPolicy,
185
- requirements
186
- };
187
- }
188
- function eventToNewEventInfoFormData(event, options) {
189
- return {
190
- applicationDeadlineHours: 48,
191
- dateTime: event.dateTime.map((date) => ({
192
- dateStatus: date.dateStatus,
193
- endDate: date.endDate,
194
- endTime: date.endTime,
195
- stallTypes: [],
196
- startDate: date.startDate,
197
- startTime: date.startTime
198
- })),
199
- eventId: event._id,
200
- packInTime: 2,
201
- paymentDueHours: 24,
202
- paymentInfo: [],
203
- refundPolicy: options.defaultRefundPolicy,
204
- requirements: options.defaultRequirements
205
- };
206
- }
207
- function eventListItemToAdSelectableResource(event) {
208
- if (event.cover == null) {
209
- throw new Error(
210
- `EventListItem ${event._id} is missing cover; cannot build ad resource.`
211
- );
212
- }
213
- return {
214
- _id: event._id,
215
- cover: event.cover,
216
- description: event.description ?? "",
217
- images: event.images,
218
- logo: event.logo,
219
- name: event.name,
220
- region: event.region,
221
- slug: event.slug
222
- };
223
- }
224
- function eventListItemToResourceDetails(item, resourceType) {
225
- return {
226
- dateTime: item.dateTime,
227
- description: item.description ?? null,
228
- eventStatus: {
229
- claimed: item.claimed,
230
- eventType: item.eventType,
231
- googlePlaceId: item.googlePlaceId ?? null
232
- },
233
- location: item.location,
234
- resourceCover: item.cover ?? null,
235
- resourceId: item._id,
236
- resourceLogo: item.logo ?? null,
237
- resourceName: item.name,
238
- resourceType
239
- };
240
- }
241
- function eventListItemToCreateEventFormSeed(item, defaults) {
242
- return {
243
- ...defaults,
244
- active: item.active,
245
- claimed: item.claimed,
246
- dateTime: item.dateTime,
247
- description: item.description ?? "",
248
- eventType: item.eventType,
249
- googlePlaceId: item.googlePlaceId,
250
- location: { ...item.location },
251
- name: item.name,
252
- rainOrShine: item.rainOrShine,
253
- region: item.region
254
- };
255
- }
256
- function eventInfoDateTimeToDateTime(rows) {
257
- return rows.map((row) => ({
258
- dateStatus: row.dateStatus,
259
- endDate: row.endDate,
260
- endTime: row.endTime,
261
- startDate: row.startDate,
262
- startTime: row.startTime
263
- }));
264
- }
265
-
266
- // src/types/vendorAdapters.ts
267
- function toPromoCodeType2(code) {
268
- if (!code.startsWith(PROMO_CODE_PREFIX)) {
269
- throw new Error(`Invalid promo code from GraphQL: ${JSON.stringify(code)}`);
270
- }
271
- return code;
272
- }
273
- function toFormSubcategoryItem(item) {
274
- return {
275
- id: item.id ?? "",
276
- name: item.name ?? ""
277
- };
278
- }
279
- function toFormSubcategory(sub) {
280
- return {
281
- id: sub.id,
282
- items: (sub.items ?? []).map(toFormSubcategoryItem),
283
- name: sub.name ?? ""
284
- };
285
- }
286
- function toFormCategory(category) {
287
- return {
288
- id: category.id,
289
- name: category.name,
290
- subcategories: (category.subcategories ?? []).map(toFormSubcategory)
291
- };
292
- }
293
- function toFormVendorCalendarData(row) {
294
- const dateTime = row.dateTime;
295
- if (dateTime == null) {
296
- throw new Error(
297
- "Vendor calendar row is missing dateTime; cannot build form calendar entry."
298
- );
299
- }
300
- return {
301
- dateTime: {
302
- dateStatus: dateTime.dateStatus ?? "Upcoming" /* Upcoming */,
303
- endDate: dateTime.endDate ?? "",
304
- endTime: dateTime.endTime ?? "",
305
- startDate: dateTime.startDate ?? "",
306
- startTime: dateTime.startTime ?? ""
307
- },
308
- description: row.description ?? null,
309
- location: row.location ?? null,
310
- resourceCover: null,
311
- resourceId: "",
312
- resourceLogo: null,
313
- resourceName: "",
314
- resourceType: "vendor" /* Vendor */
315
- };
316
- }
317
- function toFormVendorAttributes(item) {
318
- return {
319
- details: item.details ?? null,
320
- isRequired: item.isRequired
321
- };
322
- }
323
- function vendorToFormData(vendor) {
324
- return {
325
- _id: vendor._id,
326
- active: vendor.active,
327
- availability: vendor.availability ? {
328
- corporate: vendor.availability.corporate,
329
- private: vendor.availability.private,
330
- school: vendor.availability.school
331
- } : void 0,
332
- calendar: vendor.calendar ? {
333
- active: vendor.calendar.active ?? null,
334
- calendarData: (vendor.calendar.calendarData ?? []).map(
335
- toFormVendorCalendarData
336
- )
337
- } : null,
338
- categories: vendor.categories.map(toFormCategory),
339
- claimed: vendor.claimed,
340
- contactDetails: vendor.contactDetails ?? null,
341
- cover: vendor.cover,
342
- coverUpload: null,
343
- description: vendor.description,
344
- foodTruck: vendor.foodTruck,
345
- images: vendor.images ?? null,
346
- imagesUpload: null,
347
- logo: vendor.logo ?? null,
348
- logoUpload: null,
349
- name: vendor.name,
350
- products: vendor.products ? {
351
- active: vendor.products.active ?? null,
352
- productsList: vendor.products.productsList ?? []
353
- } : null,
354
- promoCodes: (vendor.promoCodes ?? []).filter((code) => code != null).map(toPromoCodeType2),
355
- region: vendor.region,
356
- socialMedia: toFormSocialMedia(vendor.socialMedia),
357
- termsAgreement: vendor.termsAgreement ? {
358
- appBuildNumber: vendor.termsAgreement.appBuildNumber,
359
- appId: vendor.termsAgreement.appId,
360
- appVersion: vendor.termsAgreement.appVersion,
361
- brand: vendor.termsAgreement.brand,
362
- deviceName: vendor.termsAgreement.deviceName,
363
- installationId: vendor.termsAgreement.installationId,
364
- manufacturer: vendor.termsAgreement.manufacturer,
365
- modelName: vendor.termsAgreement.modelName,
366
- osName: vendor.termsAgreement.osName,
367
- osVersion: vendor.termsAgreement.osVersion,
368
- termVersion: vendor.termsAgreement.termVersion,
369
- timestamp: vendor.termsAgreement.timestamp
370
- } : null,
371
- unregisteredVendorId: vendor.unregisteredVendorId ?? null,
372
- vendorType: vendor.vendorType
373
- };
374
- }
375
- function vendorInfoToFormData(vendorInfo) {
376
- return {
377
- _id: vendorInfo._id,
378
- compliance: vendorInfo.compliance ? {
379
- foodBeverageLicense: vendorInfo.compliance.foodBeverageLicense,
380
- liabilityInsurance: vendorInfo.compliance.liabilityInsurance
381
- } : void 0,
382
- documents: vendorInfo.documents ?? null,
383
- documentsUpload: null,
384
- product: {
385
- foodFlavors: vendorInfo.product.foodFlavors,
386
- packaging: vendorInfo.product.packaging ?? [],
387
- priceRange: {
388
- max: vendorInfo.product.priceRange.max,
389
- min: vendorInfo.product.priceRange.min
390
- },
391
- producedIn: vendorInfo.product.producedIn ?? []
392
- },
393
- requirements: vendorInfo.requirements ? {
394
- electricity: toFormVendorAttributes(
395
- vendorInfo.requirements.electricity
396
- ),
397
- gazebo: toFormVendorAttributes(vendorInfo.requirements.gazebo),
398
- table: toFormVendorAttributes(vendorInfo.requirements.table)
399
- } : void 0,
400
- stallInfo: {
401
- size: {
402
- depth: vendorInfo.stallInfo.size.depth,
403
- width: vendorInfo.stallInfo.size.width
404
- }
405
- },
406
- vendorId: vendorInfo.vendorId
407
- };
408
- }
409
- function unregisteredVendorToFormData(vendor, options) {
410
- const invitation = options?.inviterId != null ? vendor.invitations.find((row) => row.inviterId === options.inviterId) : vendor.invitations[0];
411
- if (invitation == null) {
412
- throw new Error(
413
- `UnregisteredVendor ${vendor._id} has no invitation to hydrate form dateTime/inviterId.`
414
- );
415
- }
416
- return {
417
- categoryIds: vendor.categoryIds,
418
- dateTime: invitation.dateTime,
419
- email: vendor.email ?? null,
420
- inviterId: invitation.inviterId,
421
- name: vendor.name,
422
- region: vendor.region
423
- };
424
- }
425
- function vendorToAdSelectableResource(vendor) {
426
- return {
427
- _id: vendor._id,
428
- cover: vendor.cover,
429
- description: vendor.description,
430
- images: vendor.images,
431
- logo: vendor.logo,
432
- name: vendor.name,
433
- region: vendor.region,
434
- slug: vendor.slug
435
- };
436
- }
437
-
438
- // src/types/partnerAdapters.ts
439
- function toPromoCodeType3(code) {
440
- if (!code.startsWith(PROMO_CODE_PREFIX)) {
441
- throw new Error(`Invalid promo code from GraphQL: ${JSON.stringify(code)}`);
442
- }
443
- return code;
444
- }
445
- function partnerToFormData(partner) {
446
- return {
447
- _id: partner._id,
448
- active: partner.active,
449
- contactDetails: partner.contactDetails ?? null,
450
- cover: partner.cover,
451
- coverUpload: null,
452
- description: partner.description,
453
- images: partner.images ?? null,
454
- imagesUpload: null,
455
- location: partner.location,
456
- logo: partner.logo ?? null,
457
- logoUpload: null,
458
- name: partner.name,
459
- nzbn: partner.nzbn,
460
- partnerType: partner.partnerType,
461
- promoCodes: (partner.promoCodes ?? []).filter((code) => code != null).map(toPromoCodeType3),
462
- region: partner.region,
463
- socialMedia: toFormSocialMedia(partner.socialMedia),
464
- termsAgreement: partner.termsAgreement ? {
465
- appBuildNumber: partner.termsAgreement.appBuildNumber,
466
- appId: partner.termsAgreement.appId,
467
- appVersion: partner.termsAgreement.appVersion,
468
- brand: partner.termsAgreement.brand,
469
- deviceName: partner.termsAgreement.deviceName,
470
- installationId: partner.termsAgreement.installationId,
471
- manufacturer: partner.termsAgreement.manufacturer,
472
- modelName: partner.termsAgreement.modelName,
473
- osName: partner.termsAgreement.osName,
474
- osVersion: partner.termsAgreement.osVersion,
475
- termVersion: partner.termsAgreement.termVersion,
476
- timestamp: partner.termsAgreement.timestamp
477
- } : null
478
- };
479
- }
480
- function partnerToAdSelectableResource(partner) {
481
- return {
482
- _id: partner._id,
483
- cover: partner.cover,
484
- description: partner.description,
485
- images: partner.images,
486
- logo: partner.logo,
487
- name: partner.name,
488
- region: partner.region,
489
- slug: partner.slug
490
- };
491
- }
492
-
493
- // src/types/game/dailyClue.ts
494
- var OBJECT_ID_PATH_SEGMENT = "[a-f0-9]{24}";
495
- var OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;
496
- var gameScreenIdentifierList = [
497
- {
498
- clue: "Where your actions turn into a timeline.",
499
- id: "activities",
500
- match: "/profile/activities"
501
- },
502
- {
503
- clue: "Where conversations happen without speaking.",
504
- id: "chat",
505
- match: "/profile/chat"
506
- },
507
- {
508
- clue: "The place to redefine who you are.",
509
- id: "edit-profile",
510
- match: "/profile/edit-profile"
511
- },
512
- {
513
- clue: "A single moment worth showing up for.",
514
- id: "single-event",
515
- match: new RegExp(`^/events/${OBJECT_ID_PATH_SEGMENT_END}`)
516
- },
517
- {
518
- clue: "What\u2019s happening around you, right now.",
519
- id: "events-near-me",
520
- match: "/events/events-near-me"
521
- },
522
- {
523
- clue: "Where events appear as pins on a map.",
524
- id: "events-map",
525
- match: "/events/events-map"
526
- },
527
- {
528
- clue: "A collection of events worth attending.",
529
- id: "events",
530
- match: "/events"
531
- },
532
- {
533
- clue: "What\u2019s happening in a wider area \u2014 not just nearby.",
534
- id: "events-region",
535
- match: /^\/events\/region\/[^/]+$/
536
- },
537
- {
538
- clue: "Where fun becomes a challenge.",
539
- id: "games",
540
- match: "/games"
541
- },
542
- {
543
- clue: "Your starting point for everything.",
544
- id: "home",
545
- match: "/"
546
- },
547
- {
548
- clue: "Where the app whispers what you shouldn\u2019t miss.",
549
- id: "notifications",
550
- match: "/notifications"
551
- },
552
- {
553
- clue: "Where you fine-tune your experience.",
554
- id: "options",
555
- match: "/options"
556
- },
557
- {
558
- clue: "An organisation or creator supporting the community.",
559
- id: "single-partner",
560
- match: new RegExp(`^/partners/${OBJECT_ID_PATH_SEGMENT_END}`)
561
- },
562
- {
563
- clue: "Organisations and creators supporting the community.",
564
- id: "partners",
565
- match: "/partners"
566
- },
567
- {
568
- clue: "A single published post in full view.",
569
- id: "single-visitor-post",
570
- match: new RegExp(`^/visitors/post/${OBJECT_ID_PATH_SEGMENT_END}`)
571
- },
572
- {
573
- clue: "Your identity, on display.",
574
- id: "profile",
575
- match: "/profile"
576
- },
577
- {
578
- clue: "One stallholder offering something valuable.",
579
- id: "single-vendor",
580
- match: new RegExp(`^/vendors/${OBJECT_ID_PATH_SEGMENT_END}`)
581
- },
582
- {
583
- clue: "Where every stallholder waits under the right category.",
584
- id: "vendors",
585
- match: "/vendors"
586
- },
587
- {
588
- clue: "Where you browse articles and posts from around the platform.",
589
- id: "visitors",
590
- match: "/visitors"
591
- }
592
- ];
593
-
594
- // src/types/game/global.ts
595
- var gameTypeToDisplayName = {
596
- ["dailyClue" /* DailyClue */]: "Daily Clue",
597
- ["miniQuiz" /* MiniQuiz */]: "Mini Quiz",
598
- ["oddOneOut" /* OddOneOut */]: "Odd One Out"
599
- };
600
-
601
- // src/types/schoolAdapters.ts
602
- function toSchoolCode(code) {
603
- if (!code.startsWith(PROMO_CODE_PREFIX)) {
604
- throw new Error(
605
- `Invalid school code from GraphQL: ${JSON.stringify(code)}`
606
- );
607
- }
608
- return code;
609
- }
610
- function schoolCampaignDatesToJsDates(campaign) {
611
- return {
612
- endDate: new Date(campaign.endDate),
613
- name: campaign.name,
614
- startDate: new Date(campaign.startDate)
615
- };
616
- }
617
- function schoolToFormData(school) {
618
- return {
619
- _id: school._id,
620
- active: school.active,
621
- contactDetails: school.contactDetails ?? null,
622
- location: school.location,
623
- logo: school.logo ?? null,
624
- logoUpload: null,
625
- name: school.name,
626
- region: school.region,
627
- socialMedia: toFormSocialMedia(school.socialMedia),
628
- studentCount: school.studentCount,
629
- termsAgreement: school.termsAgreement ? {
630
- appBuildNumber: school.termsAgreement.appBuildNumber,
631
- appId: school.termsAgreement.appId,
632
- appVersion: school.termsAgreement.appVersion,
633
- brand: school.termsAgreement.brand,
634
- deviceName: school.termsAgreement.deviceName,
635
- installationId: school.termsAgreement.installationId,
636
- manufacturer: school.termsAgreement.manufacturer,
637
- modelName: school.termsAgreement.modelName,
638
- osName: school.termsAgreement.osName,
639
- osVersion: school.termsAgreement.osVersion,
640
- termVersion: school.termsAgreement.termVersion,
641
- timestamp: school.termsAgreement.timestamp
642
- } : null
643
- };
644
- }
645
-
646
- // src/types/affiliateAdapters.ts
647
- var emptyLocation = {
648
- city: "",
649
- country: "",
650
- fullAddress: "",
651
- geo: {
652
- coordinates: [0, 0],
653
- type: "Point"
654
- },
655
- latitude: 0,
656
- longitude: 0,
657
- region: ""
658
- };
659
- function toAffiliateCode(code) {
660
- if (!code.startsWith(PROMO_CODE_PREFIX)) {
661
- throw new Error(
662
- `Invalid affiliate code from GraphQL: ${JSON.stringify(code)}`
663
- );
664
- }
665
- return code;
666
- }
667
- function affiliateToFormData(affiliate) {
668
- const details = affiliate.affiliateDetails;
669
- return {
670
- bankAccountDetails: details?.bankAccountDetails ?? {
671
- accountHolderName: "",
672
- accountNumber: ""
673
- },
674
- contactDetails: details?.contactDetails ?? {
675
- mobilePhone: ""
676
- },
677
- irdNumber: details?.irdNumber ?? "",
678
- location: details?.location ?? emptyLocation,
679
- participantType: details?.participantType ?? "",
680
- socialMedia: toFormSocialMedia(details?.socialMedia),
681
- termsAgreement: details?.termsAgreement ? {
682
- appBuildNumber: details.termsAgreement.appBuildNumber,
683
- appId: details.termsAgreement.appId,
684
- appVersion: details.termsAgreement.appVersion,
685
- brand: details.termsAgreement.brand,
686
- deviceName: details.termsAgreement.deviceName,
687
- installationId: details.termsAgreement.installationId,
688
- manufacturer: details.termsAgreement.manufacturer,
689
- modelName: details.termsAgreement.modelName,
690
- osName: details.termsAgreement.osName,
691
- osVersion: details.termsAgreement.osVersion,
692
- termVersion: details.termsAgreement.termVersion,
693
- timestamp: details.termsAgreement.timestamp
694
- } : null
695
- };
696
- }
697
-
698
- export {
699
- gameScreenIdentifierList,
700
- toFormSocialMedia,
701
- toFormRequirement,
702
- toFormRefundPolicy,
703
- eventToEventListItem,
704
- eventToFormData,
705
- eventInfoToFormData,
706
- eventToNewEventInfoFormData,
707
- eventListItemToAdSelectableResource,
708
- eventListItemToResourceDetails,
709
- eventListItemToCreateEventFormSeed,
710
- eventInfoDateTimeToDateTime,
711
- toFormCategory,
712
- toFormVendorCalendarData,
713
- vendorToFormData,
714
- vendorInfoToFormData,
715
- unregisteredVendorToFormData,
716
- vendorToAdSelectableResource,
717
- partnerToFormData,
718
- partnerToAdSelectableResource,
719
- gameTypeToDisplayName,
720
- toSchoolCode,
721
- schoolCampaignDatesToJsDates,
722
- schoolToFormData,
723
- toAffiliateCode,
724
- affiliateToFormData
725
- };
726
- //# sourceMappingURL=chunk-DDHECBJR.mjs.map