@timardex/cluemart-shared 1.6.130 → 1.7.0

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 (168) hide show
  1. package/dist/ad-CVkVX_z5.d.ts +296 -0
  2. package/dist/ad-DA9ECAhK.d.mts +296 -0
  3. package/dist/affiliate-1RtkLnLP.d.ts +35 -0
  4. package/dist/affiliate-Cos2Syz5.d.mts +35 -0
  5. package/dist/chunk-HZMP7GXC.mjs +5330 -0
  6. package/dist/chunk-HZMP7GXC.mjs.map +1 -0
  7. package/dist/chunk-KZTOISPA.mjs +272 -0
  8. package/dist/chunk-KZTOISPA.mjs.map +1 -0
  9. package/dist/chunk-MVQ3CFQR.mjs +230 -0
  10. package/dist/chunk-MVQ3CFQR.mjs.map +1 -0
  11. package/dist/chunk-NPFJ2CN2.mjs +109 -0
  12. package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
  13. package/dist/chunk-RKIRWZCH.mjs +368 -0
  14. package/dist/chunk-RKIRWZCH.mjs.map +1 -0
  15. package/dist/{chunk-OHHJ3KJJ.mjs → chunk-TAECMXM4.mjs} +267 -304
  16. package/dist/chunk-TAECMXM4.mjs.map +1 -0
  17. package/dist/chunk-VA5YN2K3.mjs +48 -0
  18. package/dist/chunk-VA5YN2K3.mjs.map +1 -0
  19. package/dist/chunk-ZZJSCYJK.mjs +958 -0
  20. package/dist/chunk-ZZJSCYJK.mjs.map +1 -0
  21. package/dist/contactUs-DGrDzJaM.d.mts +11 -0
  22. package/dist/contactUs-H7799pWe.d.ts +11 -0
  23. package/dist/enums/index.cjs +223 -2
  24. package/dist/enums/index.cjs.map +1 -1
  25. package/dist/enums/index.d.mts +164 -5
  26. package/dist/enums/index.d.ts +164 -5
  27. package/dist/enums/index.mjs +41 -1
  28. package/dist/formFields/index.cjs +168 -403
  29. package/dist/formFields/index.cjs.map +1 -1
  30. package/dist/formFields/index.d.mts +3 -6
  31. package/dist/formFields/index.d.ts +3 -6
  32. package/dist/formFields/index.mjs +47 -921
  33. package/dist/formFields/index.mjs.map +1 -1
  34. package/dist/global-BUUfmCo7.d.mts +698 -0
  35. package/dist/global-fKbMmluy.d.ts +698 -0
  36. package/dist/graphql/index.cjs +3329 -3340
  37. package/dist/graphql/index.cjs.map +1 -1
  38. package/dist/graphql/index.d.mts +487 -690
  39. package/dist/graphql/index.d.ts +487 -690
  40. package/dist/graphql/index.mjs +153 -2552
  41. package/dist/graphql/index.mjs.map +1 -1
  42. package/dist/hooks/index.cjs +3478 -773
  43. package/dist/hooks/index.cjs.map +1 -1
  44. package/dist/hooks/index.d.mts +6 -13
  45. package/dist/hooks/index.d.ts +6 -13
  46. package/dist/hooks/index.mjs +99 -193
  47. package/dist/hooks/index.mjs.map +1 -1
  48. package/dist/images/apple-maps-icon.webp.d.ts +1 -8
  49. package/dist/images/banner-horizontal.webp.d.ts +1 -8
  50. package/dist/images/banner-vertical.webp.d.ts +1 -8
  51. package/dist/images/cluiTui.webp.d.ts +1 -8
  52. package/dist/images/corporate.webp.d.ts +1 -8
  53. package/dist/images/facebook.webp.d.ts +1 -8
  54. package/dist/images/gazebo-top.webp.d.ts +1 -8
  55. package/dist/images/google-maps-icon.webp.d.ts +1 -8
  56. package/dist/images/googleMaps-logo-dark.webp.d.ts +1 -8
  57. package/dist/images/googleMaps-logo-light.webp.d.ts +1 -8
  58. package/dist/images/index.mjs +21 -86
  59. package/dist/images/index.mjs.map +1 -1
  60. package/dist/images/instagram.webp.d.ts +1 -8
  61. package/dist/images/logo-atr.webp.d.ts +1 -8
  62. package/dist/images/logo-dark.webp.d.ts +1 -8
  63. package/dist/images/logo.webp.d.ts +1 -8
  64. package/dist/images/meet.webp.d.ts +1 -8
  65. package/dist/images/mini-market1.webp.d.ts +1 -8
  66. package/dist/images/mini-market2.webp.d.ts +1 -8
  67. package/dist/images/mini-market3.webp.d.ts +1 -8
  68. package/dist/images/mini-market4.webp.d.ts +1 -8
  69. package/dist/images/mini-market5.webp.d.ts +1 -8
  70. package/dist/images/poll.webp.d.ts +1 -8
  71. package/dist/images/poster1.webp.d.ts +1 -8
  72. package/dist/images/poster2.webp.d.ts +1 -8
  73. package/dist/images/poster3.webp.d.ts +1 -8
  74. package/dist/images/poster4.webp.d.ts +1 -8
  75. package/dist/images/private.webp.d.ts +1 -8
  76. package/dist/images/qr-code.webp.d.ts +1 -8
  77. package/dist/images/school.webp.d.ts +1 -8
  78. package/dist/images/sima.webp.d.ts +1 -8
  79. package/dist/images/store-android.webp.d.ts +1 -8
  80. package/dist/images/store-ios.webp.d.ts +1 -8
  81. package/dist/images/tablas.webp.d.ts +1 -8
  82. package/dist/images/telefonos.webp.d.ts +1 -8
  83. package/dist/images/tiktok.webp.d.ts +1 -8
  84. package/dist/images/tip.webp.d.ts +1 -8
  85. package/dist/images/ugralos.webp.d.ts +1 -8
  86. package/dist/images/waze-maps-icon.webp.d.ts +1 -8
  87. package/dist/images/website.webp.d.ts +1 -8
  88. package/dist/images/youtube.webp.d.ts +1 -8
  89. package/dist/index.cjs +5883 -7079
  90. package/dist/index.cjs.map +1 -1
  91. package/dist/index.d.mts +1692 -2966
  92. package/dist/index.d.ts +1692 -2966
  93. package/dist/index.mjs +5020 -6162
  94. package/dist/index.mjs.map +1 -1
  95. package/dist/map/index.cjs +9 -14
  96. package/dist/map/index.cjs.map +1 -1
  97. package/dist/map/index.d.mts +14 -18
  98. package/dist/map/index.d.ts +14 -18
  99. package/dist/map/index.mjs +9 -14
  100. package/dist/map/index.mjs.map +1 -1
  101. package/dist/resourceActivities-BL_12IAo.d.ts +125 -0
  102. package/dist/resourceActivities-zczOntNk.d.mts +125 -0
  103. package/dist/sharing/index.cjs +1272 -63
  104. package/dist/sharing/index.cjs.map +1 -1
  105. package/dist/sharing/index.d.mts +7 -32
  106. package/dist/sharing/index.d.ts +7 -32
  107. package/dist/sharing/index.mjs +30 -188
  108. package/dist/sharing/index.mjs.map +1 -1
  109. package/dist/theme/index.mjs +5 -41
  110. package/dist/theme/index.mjs.map +1 -1
  111. package/dist/types/index.cjs +110 -868
  112. package/dist/types/index.cjs.map +1 -1
  113. package/dist/types/index.d.mts +24 -230
  114. package/dist/types/index.d.ts +24 -230
  115. package/dist/types/index.mjs +27 -61
  116. package/dist/utils/index.cjs +214 -608
  117. package/dist/utils/index.cjs.map +1 -1
  118. package/dist/utils/index.d.mts +53 -107
  119. package/dist/utils/index.d.ts +53 -107
  120. package/dist/utils/index.mjs +15 -43
  121. package/package.json +12 -40
  122. package/dist/affiliate-Bqqlffw8.d.mts +0 -36
  123. package/dist/affiliate-Btlp5XUp.d.ts +0 -36
  124. package/dist/affiliateAdapters-BW3BY7c5.d.mts +0 -118
  125. package/dist/affiliateAdapters-C51ISmuA.d.ts +0 -118
  126. package/dist/apollo/index.cjs +0 -1383
  127. package/dist/apollo/index.cjs.map +0 -1
  128. package/dist/apollo/index.d.mts +0 -323
  129. package/dist/apollo/index.d.ts +0 -323
  130. package/dist/apollo/index.mjs +0 -1295
  131. package/dist/apollo/index.mjs.map +0 -1
  132. package/dist/auth/index.cjs +0 -3322
  133. package/dist/auth/index.cjs.map +0 -1
  134. package/dist/auth/index.d.mts +0 -164
  135. package/dist/auth/index.d.ts +0 -164
  136. package/dist/auth/index.mjs +0 -379
  137. package/dist/auth/index.mjs.map +0 -1
  138. package/dist/auth-BOmAO53v.d.ts +0 -169
  139. package/dist/auth-CsITA95p.d.mts +0 -169
  140. package/dist/chunk-DATBGC2K.mjs +0 -347
  141. package/dist/chunk-DATBGC2K.mjs.map +0 -1
  142. package/dist/chunk-DDHECBJR.mjs +0 -726
  143. package/dist/chunk-DDHECBJR.mjs.map +0 -1
  144. package/dist/chunk-INQCDU24.mjs +0 -139
  145. package/dist/chunk-INQCDU24.mjs.map +0 -1
  146. package/dist/chunk-NWWKI4PJ.mjs +0 -297
  147. package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
  148. package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
  149. package/dist/chunk-RAYUJODN.mjs +0 -45
  150. package/dist/chunk-RAYUJODN.mjs.map +0 -1
  151. package/dist/chunk-TOEFAEF2.mjs +0 -69
  152. package/dist/chunk-TOEFAEF2.mjs.map +0 -1
  153. package/dist/chunk-UKW7NZEQ.mjs +0 -2813
  154. package/dist/chunk-UKW7NZEQ.mjs.map +0 -1
  155. package/dist/dailyClue-C6WXY73z.d.mts +0 -105
  156. package/dist/dailyClue-C6WXY73z.d.ts +0 -105
  157. package/dist/event-C9K7CSg4.d.ts +0 -53
  158. package/dist/event-W0NhL5Cd.d.mts +0 -53
  159. package/dist/global-BbSFfYdd.d.ts +0 -181
  160. package/dist/global-C6v9tRji.d.mts +0 -181
  161. package/dist/graphql-CDOfA79A.d.ts +0 -1253
  162. package/dist/graphql-CcvzTs9k.d.mts +0 -1253
  163. package/dist/resourceActivities-CS8YRIIL.d.mts +0 -89
  164. package/dist/resourceActivities-DOdNPkhW.d.ts +0 -89
  165. package/dist/subscription-Cj_qBA7u.d.mts +0 -20
  166. package/dist/subscription-OiJ50uJb.d.ts +0 -20
  167. package/dist/vendor-DmMi2qmx.d.mts +0 -73
  168. 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