@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,35 +1,35 @@
1
+ import "../chunk-VA5YN2K3.mjs";
2
+ import "../chunk-ZZJSCYJK.mjs";
3
+ import "../chunk-HZMP7GXC.mjs";
4
+ import "../chunk-NPFJ2CN2.mjs";
5
+ import "../chunk-RKIRWZCH.mjs";
1
6
  import {
2
7
  SCHOOL_MIN_STUDENT_COUNT,
3
- isValidIrdNumber,
4
- normalizeUrl
5
- } from "../chunk-OHHJ3KJJ.mjs";
6
- import {
7
8
  dateFormat,
9
+ normalizeUrl,
8
10
  timeFormat
9
- } from "../chunk-NWWKI4PJ.mjs";
11
+ } from "../chunk-TAECMXM4.mjs";
10
12
  import {
11
- affiliateToFormData
12
- } from "../chunk-DDHECBJR.mjs";
13
- import "../chunk-RAYUJODN.mjs";
14
- import "../chunk-DATBGC2K.mjs";
15
- import "../chunk-TOEFAEF2.mjs";
13
+ EnumAdShowOn,
14
+ EnumAdStatus,
15
+ EnumAdStyle,
16
+ EnumAdType,
17
+ EnumPostContentType,
18
+ EnumPostType
19
+ } from "../chunk-MVQ3CFQR.mjs";
16
20
  import {
17
- AdShowOnEnum,
18
- AdStatusTypeEnum,
19
- AdStyleEnum,
20
- AdTypeEnum,
21
- AffiliateParticipantTypeEnum,
22
- EventDateStatusEnumType,
23
- EventEnumType,
24
- FoodFlavorEnumType,
25
- PartnerEnumType,
26
- PaymentMethodEnumType,
27
- PostContentEnum,
28
- PostTypeEnum,
29
- ResourceTypeEnum,
30
- SocialMediaEnumType,
31
- VendorEnumType
32
- } from "../chunk-INQCDU24.mjs";
21
+ EnumEventDateStatus,
22
+ EnumEventType,
23
+ EnumFoodFlavor,
24
+ EnumPartnerType,
25
+ EnumPaymentMethod,
26
+ EnumResourceType,
27
+ EnumSocialMedia,
28
+ EnumUserLicence,
29
+ EnumUserRole,
30
+ EnumVendorType
31
+ } from "../chunk-KZTOISPA.mjs";
32
+ import "../chunk-DWO35OY4.mjs";
33
33
 
34
34
  // src/hooks/useLocationSearch.ts
35
35
  var handleApiError = (error, message) => {
@@ -142,9 +142,10 @@ import customParseFormat from "dayjs/plugin/customParseFormat.js";
142
142
  import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
143
143
  import * as yup from "yup";
144
144
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
145
- var nzIrdNumberRegex = /^\d{3}-\d{3}-\d{2,3}$/;
146
145
  var nzbnRegex = /^94\d{11}$/;
147
146
  var normalizedUrlTransform = () => yup.string().trim().transform(
147
+ (value) => typeof value === "string" ? value.toLowerCase() : value
148
+ ).transform(
148
149
  (value) => typeof value === "string" ? normalizeUrl(value) : value
149
150
  );
150
151
  var noLeadingZeros = (fieldName, options = {}) => {
@@ -265,7 +266,7 @@ var startTimeCannotBeInPastTest = yup.string().test(
265
266
  }
266
267
  );
267
268
  var dateTimeSchema = yup.object().shape({
268
- dateStatus: yup.mixed().oneOf(Object.values(EventDateStatusEnumType)).required("Date status is required"),
269
+ dateStatus: yup.mixed().oneOf(Object.values(EnumEventDateStatus)).required("Date status is required"),
269
270
  endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
270
271
  endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
271
272
  startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
@@ -292,11 +293,7 @@ var locationSchema = yup.object().shape({
292
293
  2,
293
294
  "Coordinates must contain exactly two numbers (longitude, latitude)"
294
295
  ).required("Coordinates are required"),
295
- type: yup.string().test(
296
- "is-point",
297
- "Type must be 'Point'",
298
- (value) => value == null || value === "Point"
299
- ).default("Point").required("Type is required")
296
+ type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
300
297
  }),
301
298
  latitude: yup.number().label("Latitude").required("Latitude is required"),
302
299
  longitude: yup.number().label("Longitude").required("Longitude is required"),
@@ -304,7 +301,7 @@ var locationSchema = yup.object().shape({
304
301
  });
305
302
  var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
306
303
  var socialMediaSchema = yup.object({
307
- name: yup.mixed().oneOf(Object.values(SocialMediaEnumType)).label("Social Media Name").optional(),
304
+ name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
308
305
  link: yup.string().when("name", {
309
306
  is: (name) => !!name,
310
307
  // If name has a value
@@ -323,7 +320,19 @@ var globalResourceSchema = yup.object().shape({
323
320
  description: yup.string().label("Description").trim().min(50).required("Description is required"),
324
321
  name: yup.string().label("Name").trim().min(3).required("Name is required"),
325
322
  region: yup.string().label("Region").required("Region is required"),
326
- socialMedia: yup.array().of(socialMediaSchema).nullable().default(null)
323
+ socialMedia: yup.array().of(socialMediaSchema).nullable().default(null),
324
+ associates: yup.array().of(
325
+ yup.object().shape({
326
+ email: emailRequiredSchema,
327
+ resourceId: yup.string().label("Resource ID").required("Resource ID is required"),
328
+ resourceType: yup.mixed().oneOf(Object.values(EnumResourceType)).label("Resource Type").required("Resource Type is required"),
329
+ licence: yup.object({
330
+ expiryDate: yup.date().required("Expiry Date is required"),
331
+ issuedDate: yup.date().required("Issued Date is required"),
332
+ licenceType: yup.mixed().oneOf(Object.values(EnumUserLicence)).label("Licence Type").required("Licence Type is required")
333
+ })
334
+ })
335
+ ).nullable().default(null)
327
336
  });
328
337
  var categorySchema = yup.array().of(
329
338
  yup.object().shape({
@@ -364,7 +373,7 @@ var eventSchema = globalResourceSchema.shape({
364
373
  return true;
365
374
  }
366
375
  ),
367
- eventType: yup2.mixed().oneOf(Object.values(EventEnumType), "Please select a valid Event type").required("Please select an Event type"),
376
+ eventType: yup2.mixed().oneOf(Object.values(EnumEventType), "Please select a valid Event type").required("Please select an Event type"),
368
377
  location: locationSchema,
369
378
  nzbn: yup2.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
370
379
  rainOrShine: yup2.boolean().label("Rain or Shine").required("Please specify if the event is rain or shine"),
@@ -372,16 +381,16 @@ var eventSchema = globalResourceSchema.shape({
372
381
  });
373
382
  var paymentInfoSchema = yup2.object({
374
383
  paymentMethod: yup2.mixed().oneOf(
375
- Object.values(PaymentMethodEnumType),
384
+ Object.values(EnumPaymentMethod),
376
385
  "Please select a valid Payment method"
377
386
  ).required("Please select a Payment method"),
378
387
  accountHolderName: yup2.string().when("paymentMethod", {
379
- is: "bank_transfer" /* BankTransfer */,
388
+ is: "bank_transfer" /* BANK_TRANSFER */,
380
389
  then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
381
390
  otherwise: (schema) => schema.notRequired()
382
391
  }),
383
392
  accountNumber: yup2.string().when("paymentMethod", {
384
- is: "bank_transfer" /* BankTransfer */,
393
+ is: "bank_transfer" /* BANK_TRANSFER */,
385
394
  then: (schema) => schema.required("Account number is required for bank transfer").matches(
386
395
  nzBankAccountRegex,
387
396
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
@@ -389,7 +398,7 @@ var paymentInfoSchema = yup2.object({
389
398
  otherwise: (schema) => schema.notRequired()
390
399
  }),
391
400
  link: yup2.string().when("paymentMethod", {
392
- is: (val) => val === "paypal" /* Paypal */ || val === "stripe" /* Stripe */,
401
+ is: (val) => val === "paypal" /* PAYPAL */ || val === "stripe" /* STRIPE */,
393
402
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
394
403
  otherwise: (schema) => schema.notRequired()
395
404
  })
@@ -439,7 +448,7 @@ var vendorSchema = globalResourceSchema.shape({
439
448
  active: yup3.boolean().nullable().optional(),
440
449
  productsList: yup3.array().of(vendorMenuSchema).nullable().optional()
441
450
  }).nullable().optional(),
442
- vendorType: yup3.mixed().oneOf(Object.values(VendorEnumType)).required("Please select a Vendor type")
451
+ vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
443
452
  });
444
453
  var unregisteredVendorSchema = yup3.object().shape({
445
454
  categoryIds: yup3.array().of(yup3.string().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
@@ -452,14 +461,14 @@ var unregisteredVendorSchema = yup3.object().shape({
452
461
  var vendorInfoSchema = yup3.object().shape({
453
462
  product: yup3.object().shape({
454
463
  foodFlavors: yup3.array().of(
455
- yup3.mixed().oneOf(Object.values(FoodFlavorEnumType), "Invalid flavor selected").required("Flavor is required")
464
+ yup3.mixed().oneOf(Object.values(EnumFoodFlavor), "Invalid flavor selected").required("Flavor is required")
456
465
  ).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
457
466
  packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
458
467
  priceRange: yup3.object().shape({
459
468
  max: yup3.string().required("Max price is required").test(
460
469
  "is-number",
461
470
  "Max price must be a valid number",
462
- (value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
471
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
463
472
  ).test(
464
473
  "is-greater",
465
474
  "Max price must be greater than or equal to Min price",
@@ -468,14 +477,14 @@ var vendorInfoSchema = yup3.object().shape({
468
477
  if (!max || !min) return true;
469
478
  const maxNum = Number(max);
470
479
  const minNum = Number(min);
471
- if (Number.isNaN(maxNum) || Number.isNaN(minNum)) return true;
480
+ if (isNaN(maxNum) || isNaN(minNum)) return true;
472
481
  return maxNum >= minNum;
473
482
  }
474
483
  ),
475
484
  min: yup3.string().required("Min price is required").test(
476
485
  "is-number",
477
486
  "Min price must be a valid number",
478
- (value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
487
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
479
488
  )
480
489
  }),
481
490
  producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
@@ -517,7 +526,7 @@ var vendorInfoSchema = yup3.object().shape({
517
526
  depth: yup3.string().required("Depth is required").test(
518
527
  "is-number",
519
528
  "Depth must be a valid number",
520
- (value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
529
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
521
530
  ).test(
522
531
  "is-positive",
523
532
  "Depth must be greater than 0",
@@ -526,7 +535,7 @@ var vendorInfoSchema = yup3.object().shape({
526
535
  width: yup3.string().required("Width is required").test(
527
536
  "is-number",
528
537
  "Width must be a valid number",
529
- (value) => value !== void 0 && value !== "" && !Number.isNaN(Number(value))
538
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
530
539
  ).test(
531
540
  "is-positive",
532
541
  "Width must be greater than 0",
@@ -552,7 +561,8 @@ var userSchema = yup4.object().shape({
552
561
  // only necessary if password typed
553
562
  then: (schema) => schema.required("Confirm Password is required").oneOf([yup4.ref("password")], "Passwords must match"),
554
563
  otherwise: (schema) => schema.notRequired()
555
- })
564
+ }),
565
+ role: yup4.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
556
566
  });
557
567
 
558
568
  // src/yupSchema/auth.ts
@@ -587,13 +597,13 @@ import * as yup6 from "yup";
587
597
  var adResourceSchema = yup6.object({
588
598
  adDescription: yup6.string().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
589
599
  adImage: yup6.string().required("Ad image is required"),
590
- adStyle: yup6.mixed().oneOf(Object.values(AdStyleEnum), "Please select a valid ad style").required("Ad style is required"),
600
+ adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
591
601
  adTitle: yup6.string().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
592
- adType: yup6.mixed().oneOf(Object.values(AdTypeEnum), "Please select a valid ad type").required("Ad type is required"),
602
+ adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
593
603
  resourceId: yup6.string().required("Resource ID is required"),
594
604
  resourceName: yup6.string().required("Resource name is required"),
595
605
  resourceRegion: yup6.string().required("Resource region is required"),
596
- resourceType: yup6.mixed().oneOf(Object.values(ResourceTypeEnum), "Please select Event or Vendor").required("Resource type is required"),
606
+ resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required"),
597
607
  resourceSlug: yup6.string().required("Resource slug is required")
598
608
  });
599
609
  var adSchema = yup6.object().shape({
@@ -616,10 +626,10 @@ var adSchema = yup6.object().shape({
616
626
  )
617
627
  }),
618
628
  resource: adResourceSchema.required("Resource information is required"),
619
- showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(AdShowOnEnum)).required()).min(1, "At least one display location is required").required("Display location is required"),
620
- status: yup6.mixed().oneOf(Object.values(AdStatusTypeEnum)).required("Ad status is required"),
629
+ showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
630
+ status: yup6.mixed().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
621
631
  start: yup6.date().when("status", {
622
- is: (status) => status !== "Active" /* Active */,
632
+ is: (status) => status !== "Active" /* ACTIVE */,
623
633
  then: () => yup6.date().required("Start date is required").test("is-future-date", "Start date must be in the future", (value) => {
624
634
  if (!value) return false;
625
635
  return value > /* @__PURE__ */ new Date();
@@ -635,7 +645,7 @@ import * as yup7 from "yup";
635
645
  var partnerSchema = globalResourceSchema.shape({
636
646
  location: locationSchema,
637
647
  nzbn: yup7.string().required("NZBN is required").matches(nzbnRegex, "NZBN must be 13 digits and start with 94"),
638
- partnerType: yup7.mixed().oneOf(Object.values(PartnerEnumType), "Please select a valid Partner type").required("Please select a Partner type")
648
+ partnerType: yup7.mixed().oneOf(Object.values(EnumPartnerType), "Please select a valid Partner type").required("Please select a Partner type")
639
649
  });
640
650
 
641
651
  // src/yupSchema/post.ts
@@ -643,18 +653,18 @@ import * as yup8 from "yup";
643
653
  var postContentSchema = yup8.object().shape({
644
654
  contentData: yup8.mixed().optional().nullable(),
645
655
  contentOrder: yup8.number().nullable(),
646
- contentType: yup8.mixed().oneOf(Object.values(PostContentEnum)).nullable()
656
+ contentType: yup8.mixed().oneOf(Object.values(EnumPostContentType)).nullable()
647
657
  });
648
658
  var postSchema = yup8.object().shape({
649
659
  active: yup8.boolean().required(),
650
660
  caption: yup8.string().required(),
651
661
  content: yup8.array().of(postContentSchema).required(),
652
- postType: yup8.mixed().oneOf(Object.values(PostTypeEnum)).required(),
662
+ postType: yup8.mixed().oneOf(Object.values(EnumPostType)).required(),
653
663
  resource: yup8.object({
654
664
  resourceId: yup8.string().required(),
655
665
  resourceRegion: yup8.string().required(),
656
666
  resourceSlug: yup8.string().required(),
657
- resourceType: yup8.mixed().oneOf(Object.values(ResourceTypeEnum)).required()
667
+ resourceType: yup8.mixed().oneOf(Object.values(EnumResourceType)).required()
658
668
  }).nullable().optional(),
659
669
  tags: yup8.array().of(yup8.string().required()).nullable().optional(),
660
670
  title: yup8.string().required()
@@ -667,8 +677,7 @@ var appSettingsSchema = yup9.object({
667
677
  /^\d+\.\d+\.\d+$/,
668
678
  "App Version must be in the format X.Y.Z (e.g. 1.12.50)"
669
679
  ).required("App Version is required"),
670
- isOfflineMode: yup9.boolean().label("Is Offline Mode").required("Is Offline Mode is required"),
671
- minimumRedeemableAffiliatePoints: yup9.number().label("Minimum Redeemable Affiliate Points").min(0, "Minimum Redeemable Affiliate Points must be greater than 0").required("Minimum Redeemable Affiliate Points is required")
680
+ isOfflineMode: yup9.boolean().label("Is Offline Mode").required("Is Offline Mode is required")
672
681
  });
673
682
 
674
683
  // src/hooks/utils.ts
@@ -687,6 +696,7 @@ var defaultLocation = {
687
696
  };
688
697
  var globalDefaultValues = {
689
698
  active: false,
699
+ associates: null,
690
700
  contactDetails: {
691
701
  email: null,
692
702
  landlinePhone: null,
@@ -753,7 +763,7 @@ var defaultVendorFormValues = {
753
763
  foodTruck: false,
754
764
  products: null,
755
765
  unregisteredVendorId: null,
756
- vendorType: "Stallholder" /* Stallholder */
766
+ vendorType: "Stallholder" /* STALLHOLDER */
757
767
  };
758
768
  var defaultUnregisteredVendorFormValues = {
759
769
  categoryIds: [],
@@ -783,24 +793,11 @@ var defaultVendorInfoFormValues = {
783
793
  },
784
794
  vendorId: ""
785
795
  };
786
- var defaultAffiliateFormValues = {
787
- bankAccountDetails: {
788
- accountHolderName: "",
789
- accountNumber: ""
790
- },
791
- contactDetails: {
792
- mobilePhone: ""
793
- },
794
- irdNumber: "",
795
- location: defaultLocation,
796
- participantType: "",
797
- socialMedia: null,
798
- termsAgreement: null
799
- };
800
796
  function mapBaseResourceTypeToFormData(data) {
801
797
  return {
802
798
  _id: data._id,
803
799
  active: data.active,
800
+ associates: data.associates,
804
801
  contactDetails: data.contactDetails,
805
802
  cover: data.cover,
806
803
  coverUpload: data.coverUpload ?? null,
@@ -810,6 +807,7 @@ function mapBaseResourceTypeToFormData(data) {
810
807
  logo: data.logo,
811
808
  logoUpload: data.logoUpload ?? null,
812
809
  name: data.name,
810
+ owner: data.owner,
813
811
  promoCodes: data.promoCodes,
814
812
  region: data.region,
815
813
  socialMedia: data.socialMedia,
@@ -851,6 +849,7 @@ function useVendorForm(data) {
851
849
  const {
852
850
  _id,
853
851
  active,
852
+ associates,
854
853
  availability,
855
854
  calendar,
856
855
  categories,
@@ -865,6 +864,7 @@ function useVendorForm(data) {
865
864
  logo,
866
865
  logoUpload,
867
866
  name,
867
+ owner,
868
868
  products,
869
869
  promoCodes,
870
870
  region,
@@ -878,6 +878,7 @@ function useVendorForm(data) {
878
878
  fields: {
879
879
  _id,
880
880
  active,
881
+ associates,
881
882
  availability,
882
883
  calendar,
883
884
  categories,
@@ -892,6 +893,7 @@ function useVendorForm(data) {
892
893
  logo,
893
894
  logoUpload,
894
895
  name,
896
+ owner,
895
897
  products,
896
898
  promoCodes,
897
899
  region,
@@ -1062,6 +1064,7 @@ function useEventForm(data) {
1062
1064
  const {
1063
1065
  _id,
1064
1066
  active,
1067
+ associates,
1065
1068
  claimed,
1066
1069
  contactDetails,
1067
1070
  cover,
@@ -1077,6 +1080,7 @@ function useEventForm(data) {
1077
1080
  logoUpload,
1078
1081
  name,
1079
1082
  nzbn,
1083
+ owner,
1080
1084
  promoCodes,
1081
1085
  provider,
1082
1086
  rainOrShine,
@@ -1090,6 +1094,7 @@ function useEventForm(data) {
1090
1094
  fields: {
1091
1095
  _id,
1092
1096
  active,
1097
+ associates,
1093
1098
  claimed,
1094
1099
  contactDetails,
1095
1100
  cover,
@@ -1105,6 +1110,7 @@ function useEventForm(data) {
1105
1110
  logoUpload,
1106
1111
  name,
1107
1112
  nzbn,
1113
+ owner,
1108
1114
  promoCodes,
1109
1115
  provider,
1110
1116
  rainOrShine,
@@ -1204,7 +1210,8 @@ var defaultValues = {
1204
1210
  lastName: "",
1205
1211
  location: null,
1206
1212
  password: null,
1207
- preferredRegion: ""
1213
+ preferredRegion: "",
1214
+ role: "customer" /* CUSTOMER */
1208
1215
  };
1209
1216
  function useUserForm(data) {
1210
1217
  const {
@@ -1233,6 +1240,7 @@ function useUserForm(data) {
1233
1240
  location: data.location,
1234
1241
  password: data.password,
1235
1242
  preferredRegion: data.preferredRegion,
1243
+ role: data.role,
1236
1244
  termsAgreement: data.termsAgreement
1237
1245
  });
1238
1246
  } else {
@@ -1251,6 +1259,7 @@ function useUserForm(data) {
1251
1259
  location,
1252
1260
  password,
1253
1261
  preferredRegion,
1262
+ role,
1254
1263
  termsAgreement
1255
1264
  } = getValues();
1256
1265
  return {
@@ -1267,6 +1276,7 @@ function useUserForm(data) {
1267
1276
  location,
1268
1277
  password,
1269
1278
  preferredRegion,
1279
+ role,
1270
1280
  termsAgreement
1271
1281
  },
1272
1282
  formState,
@@ -1551,19 +1561,19 @@ var defaultValues8 = {
1551
1561
  resource: {
1552
1562
  adDescription: "",
1553
1563
  adImage: "",
1554
- adStyle: "",
1564
+ adStyle: "Bloom" /* BLOOM */,
1555
1565
  adTitle: "",
1556
- adType: "",
1566
+ adType: "Sponsored" /* SPONSORED */,
1557
1567
  resourceId: "",
1558
1568
  resourceName: "",
1559
1569
  resourceRegion: "",
1560
1570
  resourceSlug: "",
1561
- resourceType: ""
1571
+ resourceType: "event" /* EVENT */
1562
1572
  },
1563
- showOn: ["Front_page" /* FrontPage */],
1573
+ showOn: ["Front_page" /* FRONT_PAGE */],
1564
1574
  // `start` is only required (and must be future) when status !== ACTIVE.
1565
1575
  start: void 0,
1566
- status: "Active" /* Active */,
1576
+ status: "Active" /* ACTIVE */,
1567
1577
  targetRegion: []
1568
1578
  };
1569
1579
  function useAdForm(data) {
@@ -1647,6 +1657,7 @@ function usePartnerForm(data) {
1647
1657
  const {
1648
1658
  _id,
1649
1659
  active,
1660
+ associates,
1650
1661
  contactDetails,
1651
1662
  cover,
1652
1663
  coverUpload,
@@ -1658,6 +1669,7 @@ function usePartnerForm(data) {
1658
1669
  logoUpload,
1659
1670
  name,
1660
1671
  nzbn,
1672
+ owner,
1661
1673
  partnerType,
1662
1674
  promoCodes,
1663
1675
  region,
@@ -1669,6 +1681,7 @@ function usePartnerForm(data) {
1669
1681
  fields: {
1670
1682
  _id,
1671
1683
  active,
1684
+ associates,
1672
1685
  contactDetails,
1673
1686
  cover,
1674
1687
  coverUpload,
@@ -1680,6 +1693,7 @@ function usePartnerForm(data) {
1680
1693
  logoUpload,
1681
1694
  name,
1682
1695
  nzbn,
1696
+ owner,
1683
1697
  partnerType,
1684
1698
  promoCodes,
1685
1699
  region,
@@ -1779,8 +1793,7 @@ import React11 from "react";
1779
1793
  import { useForm as useForm16 } from "react-hook-form";
1780
1794
  var defaultValues10 = {
1781
1795
  appVersion: "",
1782
- isOfflineMode: false,
1783
- minimumRedeemableAffiliatePoints: 0
1796
+ isOfflineMode: false
1784
1797
  };
1785
1798
  function useAppSettingsForm(data) {
1786
1799
  const {
@@ -1799,20 +1812,18 @@ function useAppSettingsForm(data) {
1799
1812
  if (data) {
1800
1813
  reset({
1801
1814
  appVersion: data.appVersion,
1802
- isOfflineMode: data.isOfflineMode,
1803
- minimumRedeemableAffiliatePoints: data.minimumRedeemableAffiliatePoints
1815
+ isOfflineMode: data.isOfflineMode
1804
1816
  });
1805
1817
  } else {
1806
1818
  reset(defaultValues10);
1807
1819
  }
1808
1820
  }, [data]);
1809
- const { appVersion, isOfflineMode, minimumRedeemableAffiliatePoints } = getValues();
1821
+ const { appVersion, isOfflineMode } = getValues();
1810
1822
  return {
1811
1823
  control,
1812
1824
  fields: {
1813
1825
  appVersion,
1814
- isOfflineMode,
1815
- minimumRedeemableAffiliatePoints
1826
+ isOfflineMode
1816
1827
  },
1817
1828
  formState,
1818
1829
  getValues,
@@ -1925,110 +1936,7 @@ function useSchoolForm(data) {
1925
1936
  watch
1926
1937
  };
1927
1938
  }
1928
-
1929
- // src/hooks/useAffiliateForm.ts
1930
- import { yupResolver as yupResolver18 } from "@hookform/resolvers/yup";
1931
- import { useEffect as useEffect9 } from "react";
1932
- import { useForm as useForm18 } from "react-hook-form";
1933
-
1934
- // src/yupSchema/affiliate.ts
1935
- import * as yup12 from "yup";
1936
- var affiliateContactDetailsSchema = yup12.object({
1937
- mobilePhone: yup12.string().trim().required("Mobile phone is required").test(
1938
- "mobile-phone",
1939
- "Mobile must start with 02 and be 9\u201311 digits",
1940
- (value) => mobileRegex.test(value)
1941
- )
1942
- });
1943
- var bankAccountDetailsSchema = yup12.object({
1944
- accountHolderName: yup12.string().required("Account holder name is required"),
1945
- accountNumber: yup12.string().required("Account number is required for bank transfer").matches(
1946
- nzBankAccountRegex,
1947
- "Account number must be in format: XX-XXXX-XXXXXXX-XX"
1948
- ).trim()
1949
- });
1950
- var affiliateSchema = yup12.object().shape({
1951
- bankAccountDetails: bankAccountDetailsSchema.required(
1952
- "Bank account details are required"
1953
- ),
1954
- contactDetails: affiliateContactDetailsSchema.required(
1955
- "Contact details are required"
1956
- ),
1957
- irdNumber: yup12.string().trim().required("IRD number is required").matches(
1958
- nzIrdNumberRegex,
1959
- "IRD number must be in format: XXX-XXX-XX or XXX-XXX-XXX"
1960
- ).test(
1961
- "ird-number",
1962
- "Enter a valid IRD number",
1963
- (value) => !!value && isValidIrdNumber(value)
1964
- ),
1965
- location: locationSchema.required("Location is required"),
1966
- participantType: yup12.mixed().oneOf(
1967
- Object.values(AffiliateParticipantTypeEnum),
1968
- "Please select a valid participant type"
1969
- ).required("Participant type is required"),
1970
- socialMedia: yup12.array().of(socialMediaSchema).nullable().default(null)
1971
- });
1972
-
1973
- // src/hooks/useAffiliateForm.ts
1974
- function useAffiliateForm(data) {
1975
- const {
1976
- control,
1977
- formState,
1978
- getValues,
1979
- handleSubmit,
1980
- reset,
1981
- setValue,
1982
- watch
1983
- } = useForm18({
1984
- defaultValues: defaultAffiliateFormValues,
1985
- resolver: yupResolver18(affiliateSchema)
1986
- });
1987
- useEffect9(() => {
1988
- if (data) {
1989
- reset({
1990
- bankAccountDetails: data.bankAccountDetails,
1991
- contactDetails: data.contactDetails,
1992
- irdNumber: data.irdNumber,
1993
- location: data.location,
1994
- participantType: data.participantType,
1995
- socialMedia: data.socialMedia,
1996
- termsAgreement: data.termsAgreement
1997
- });
1998
- } else {
1999
- reset(defaultAffiliateFormValues);
2000
- }
2001
- }, [data]);
2002
- const {
2003
- bankAccountDetails,
2004
- contactDetails,
2005
- irdNumber,
2006
- location,
2007
- participantType,
2008
- socialMedia,
2009
- termsAgreement
2010
- } = getValues();
2011
- return {
2012
- control,
2013
- fields: {
2014
- bankAccountDetails,
2015
- contactDetails,
2016
- irdNumber,
2017
- location,
2018
- participantType,
2019
- socialMedia,
2020
- termsAgreement
2021
- },
2022
- formState,
2023
- getValues,
2024
- handleSubmit,
2025
- reset,
2026
- setValue,
2027
- watch
2028
- };
2029
- }
2030
1939
  export {
2031
- defaultAffiliateFormValues,
2032
1940
  defaultEventFormValues,
2033
1941
  defaultEventInfoFormValues,
2034
1942
  defaultLocation,
@@ -2037,10 +1945,8 @@ export {
2037
1945
  defaultVendorFormValues,
2038
1946
  defaultVendorInfoFormValues,
2039
1947
  globalDefaultValues,
2040
- affiliateToFormData as mapAffiliateToFormData,
2041
1948
  mapBaseResourceTypeToFormData,
2042
1949
  useAdForm,
2043
- useAffiliateForm,
2044
1950
  useAppSettingsForm,
2045
1951
  useContactUsForm,
2046
1952
  useEventForm,