@plurix/ecom-components 1.14.2-commerce.8 → 1.14.2-shlo1445.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 (75) hide show
  1. package/dist/assets/svgs/ErrorIconV2.d.ts +1 -0
  2. package/dist/assets/svgs/ErrorIconV2.js +33 -0
  3. package/dist/assets/svgs/SuccessIconV2.d.ts +1 -0
  4. package/dist/assets/svgs/SuccessIconV2.js +30 -0
  5. package/dist/assets/svgs/WarningIconV2.d.ts +1 -0
  6. package/dist/assets/svgs/WarningIconV2.js +40 -0
  7. package/dist/hooks/useVerticalShelfCarouselProps.d.ts +4 -0
  8. package/dist/hooks/useVerticalShelfCarouselProps.js +14 -0
  9. package/dist/hooks/useWindowDimensions.d.ts +5 -0
  10. package/dist/hooks/useWindowDimensions.js +38 -0
  11. package/dist/main.d.ts +1 -0
  12. package/dist/main.js +19 -17
  13. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.d.ts +14 -0
  14. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.js +69 -0
  15. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -2
  16. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +79 -71
  17. package/dist/packages/ChangeOrderModal/api/getOrderForm.d.ts +1 -1
  18. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +7 -9
  19. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -5
  20. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +18 -11
  21. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  22. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -11
  23. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  24. package/dist/packages/Coupons/Coupons.js +67 -57
  25. package/dist/packages/Coupons/api/addCoupon.js +6 -6
  26. package/dist/packages/Coupons/api/getCoupons.js +5 -5
  27. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  28. package/dist/packages/Coupons/components/CouponCard.js +94 -83
  29. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  30. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  31. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +13 -10
  32. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  33. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  34. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  35. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  36. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  37. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  38. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  39. package/dist/packages/Regionalization/Regionalization.js +15 -13
  40. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  41. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  42. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  43. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  44. package/dist/packages/VouchersRedeemed/VouchersRedeemed.d.ts +22 -0
  45. package/dist/packages/VouchersRedeemed/VouchersRedeemed.js +121 -0
  46. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.d.ts +1 -0
  47. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.js +20 -0
  48. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.d.ts +12 -0
  49. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.js +27 -0
  50. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.d.ts +1 -0
  51. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.js +4 -0
  52. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.d.ts +17 -0
  53. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.js +37 -0
  54. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.d.ts +1 -0
  55. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.js +4 -0
  56. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.d.ts +14 -0
  57. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js +48 -0
  58. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.d.ts +1 -0
  59. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.js +4 -0
  60. package/dist/packages/VouchersRedeemed/data/validVouchers.d.ts +1 -0
  61. package/dist/packages/VouchersRedeemed/data/validVouchers.js +20 -0
  62. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.d.ts +1 -0
  63. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.js +8 -0
  64. package/dist/styles/adaptive-carousel.global.css +1 -0
  65. package/dist/styles/regionalization.global.css +1 -1
  66. package/dist/styles/vouchers-redeemed.global.css +1 -0
  67. package/dist/types/ProductCard.d.ts +13 -12
  68. package/dist/utils/carousel/carouselProps.d.ts +33 -0
  69. package/dist/utils/carousel/carouselProps.js +59 -0
  70. package/dist/utils/changerOrderModal.js +13 -16
  71. package/dist/utils/scroll/isScrollToEnd.d.ts +1 -0
  72. package/dist/utils/scroll/isScrollToEnd.js +4 -0
  73. package/dist/utils/setBoldTextParts.d.ts +1 -0
  74. package/dist/utils/setBoldTextParts.js +7 -0
  75. package/package.json +69 -69
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { useState as v } from "react";
3
3
  import { ProductCardUnavailable as O } from "../ProducCardUnavailable/index.js";
4
4
  import { ProductCardBadgeKg as M } from "../ProductCardBadge/ProductCardBadgeKg.js";
@@ -9,12 +9,12 @@ import { ProductCardName as U } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as b } from "../ProductCardPrice/index.js";
10
10
  const V = ({
11
11
  hasPlusFriendBadge: r,
12
- promotion: d,
12
+ promotion: f,
13
13
  product: i,
14
14
  hasPromotionalPrice: o,
15
- clubPrice: f,
15
+ clubPrice: d,
16
16
  outOfStock: P,
17
- variant: s,
17
+ variant: t,
18
18
  defaultScListPrice: a,
19
19
  isClubClient: c,
20
20
  hasClub: p,
@@ -31,23 +31,23 @@ const V = ({
31
31
  {
32
32
  image: (u = i.image) == null ? void 0 : u[0],
33
33
  name: i.name,
34
- variant: s
34
+ variant: t
35
35
  }
36
36
  );
37
37
  const n = c && i.hasClubPrice;
38
- return /* @__PURE__ */ t("div", { id: "product-card", children: [
39
- /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ t("div", { className: "product-card-container", onClick: C, children: [
38
+ return /* @__PURE__ */ s("div", { id: "product-card", children: [
39
+ /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: C, children: [
40
40
  /* @__PURE__ */ e(
41
41
  D,
42
42
  {
43
43
  isProductClubAndClient: n,
44
- variant: s,
44
+ variant: t,
45
45
  hasPlusFriendBadge: r,
46
- promotion: d,
46
+ promotion: f,
47
47
  image: (l = i.image) == null ? void 0 : l[0]
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ t(
50
+ /* @__PURE__ */ s(
51
51
  "div",
52
52
  {
53
53
  className: "product-card-description",
@@ -55,9 +55,9 @@ const V = ({
55
55
  backgroundColor: n ? "#FDF3DE" : "var(--color-grayScale-faded)"
56
56
  },
57
57
  children: [
58
- /* @__PURE__ */ t("div", { className: "product-card-section-name", children: [
58
+ /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
59
59
  /* @__PURE__ */ e(U, { name: i.name }),
60
- /* @__PURE__ */ t(
60
+ /* @__PURE__ */ s(
61
61
  "div",
62
62
  {
63
63
  className: "product-card-section-badge",
@@ -75,6 +75,7 @@ const V = ({
75
75
  /* @__PURE__ */ e(
76
76
  N,
77
77
  {
78
+ offers: i.offers,
78
79
  defaultScListPrice: a,
79
80
  nativeListPrice: i.customOffers.listPriceCustom,
80
81
  nativeSpotPrice: i.customOffers.spotPriceCustom,
@@ -101,10 +102,10 @@ const V = ({
101
102
  listPriceCustom: i.customOffers.listPriceCustom,
102
103
  hasDiscount: i.customOffers.hasDiscount,
103
104
  spotPriceCustom: i.customOffers.spotPriceCustom,
104
- spotPriceKg: i.customOffers.spotPriceCustom
105
+ spotPriceKg: i.customOffers.spotPriceKg
105
106
  },
106
107
  defaultScListPrice: a,
107
- clubPrice: f,
108
+ clubPrice: d,
108
109
  hasPlusFriendBadge: r
109
110
  }
110
111
  )
@@ -118,7 +119,7 @@ const V = ({
118
119
  addToCartAction: g,
119
120
  quantitySelectorAction: S,
120
121
  productInCart: h,
121
- layout: s
122
+ layout: t
122
123
  }
123
124
  )
124
125
  ] });
@@ -1,3 +1,3 @@
1
1
  import { RegionalizationProps } from './types/RegionalizationProps';
2
2
 
3
- export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup, disabledSearch }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { RegionalizationContextProvider as C } from "./context/RegionalizationContext.js";
3
- import { ViewsContainer as S } from "./views/ViewsContainer.js";
4
- /* empty css */const z = ({
2
+ import { RegionalizationContextProvider as S } from "./context/RegionalizationContext.js";
3
+ import { ViewsContainer as k } from "./views/ViewsContainer.js";
4
+ /* empty css */const H = ({
5
5
  setMethod: r,
6
6
  setPickupName: a,
7
7
  setCity: o,
@@ -22,9 +22,9 @@ import { ViewsContainer as S } from "./views/ViewsContainer.js";
22
22
  priceStockInformation: x = " Preços e estoque podem variar de acordo com a loja que irá te atender",
23
23
  moreInfosText: E = "Horários de atendimento e entrega",
24
24
  textBackButton: R = "Voltar",
25
- confirmButton: v = "Ok, Entendi",
26
- editAddress: P = "Alterar",
27
- delivery: f = {
25
+ confirmButton: f = "Ok, Entendi",
26
+ editAddress: v = "Alterar",
27
+ delivery: P = {
28
28
  title: "Receber em Casa",
29
29
  normalDelivery: "Entrega Agendada",
30
30
  expressDelivery: "Entrega Express",
@@ -57,9 +57,10 @@ import { ViewsContainer as S } from "./views/ViewsContainer.js";
57
57
  titleOk: "Retirar na Loja",
58
58
  labelAddress: "Retirar em:",
59
59
  confirmButton: "Retirar na loja"
60
- }
60
+ },
61
+ disabledSearch: C = !1
61
62
  }) => /* @__PURE__ */ e(
62
- C,
63
+ S,
63
64
  {
64
65
  priceStockInformation: x,
65
66
  setMethod: r,
@@ -76,18 +77,19 @@ import { ViewsContainer as S } from "./views/ViewsContainer.js";
76
77
  titleText: j,
77
78
  moreInfosText: E,
78
79
  textBackButton: R,
79
- editAddress: P,
80
+ editAddress: v,
80
81
  deliveryPrice: t,
81
- confirmButton: v,
82
+ confirmButton: f,
82
83
  pickupConfirmScreenText: b,
83
- delivery: f,
84
+ delivery: P,
84
85
  pickup: A,
85
86
  setStatus: u,
86
87
  status: p,
87
88
  regionalizeCatalog: h,
88
- children: /* @__PURE__ */ e(S, {})
89
+ disabledSearch: C,
90
+ children: /* @__PURE__ */ e(k, {})
89
91
  }
90
92
  );
91
93
  export {
92
- z as Regionalization
94
+ H as Regionalization
93
95
  };
@@ -1,4 +1,4 @@
1
1
  import { RegionalizationProps, ContextProps } from '../types';
2
2
 
3
- export declare const RegionalizationContextProvider: ({ setMethod, setPickupName, setCity, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, priceStockInformation, pickupPoints, titleText, moreInfosText, textBackButton, confirmButton, editAddress, delivery, deliveryPrice, pickup, regionalizeCatalog, pickupConfirmScreenText, children }: RegionalizationProps & ContextProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const RegionalizationContextProvider: ({ setMethod, setPickupName, setCity, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, priceStockInformation, pickupPoints, titleText, moreInfosText, textBackButton, confirmButton, editAddress, delivery, deliveryPrice, pickup, regionalizeCatalog, pickupConfirmScreenText, disabledSearch, children }: RegionalizationProps & ContextProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const useRegionalizationContext: () => RegionalizationProps & ContextProps;
@@ -1,8 +1,8 @@
1
- import { jsx as Z } from "react/jsx-runtime";
2
- import { createContext as _, useState as e, useEffect as M, useContext as ee } from "react";
3
- import { removeSpecialCharacter as oe } from "../utils/postalCode.js";
1
+ import { jsx as _ } from "react/jsx-runtime";
2
+ import { createContext as M, useState as e, useEffect as ee, useContext as oe } from "react";
3
+ import { removeSpecialCharacter as se } from "../utils/postalCode.js";
4
4
  import { getFullLocalStorage as c } from "../utils/localStorage.js";
5
- const v = _(null), ae = ({
5
+ const v = M(null), re = ({
6
6
  setMethod: o,
7
7
  setPickupName: C,
8
8
  setCity: p,
@@ -27,12 +27,13 @@ const v = _(null), ae = ({
27
27
  pickup: q,
28
28
  regionalizeCatalog: E,
29
29
  pickupConfirmScreenText: W,
30
- children: j
30
+ disabledSearch: j,
31
+ children: B
31
32
  }) => {
32
- const [B, u] = e(), [F, g] = e("InitialView"), [L, m] = e(""), [Q, $] = e(), [s, A] = e(), [G, f] = e(), [J, K] = e(), [N, O] = e(!1), U = {
33
+ const [F, u] = e(), [L, g] = e("InitialView"), [Q, m] = e(""), [$, A] = e(), [s, G] = e(), [J, f] = e(), [K, N] = e(), [O, U] = e(!1), X = {
33
34
  openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
34
35
  closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
35
- }, X = async () => {
36
+ }, Y = async () => {
36
37
  i({ loading: !0, message: "Carregando..." });
37
38
  const {
38
39
  isValid: n,
@@ -40,32 +41,32 @@ const v = _(null), ae = ({
40
41
  deliveryInfos: a,
41
42
  customShipping: r
42
43
  } = await d();
43
- n && (i({ loading: !1 }), u("delivery"), $(t), i({}), m(l), f(a), g("ConfirmScreen"), K(r));
44
- }, Y = () => {
44
+ n && (i({ loading: !1 }), u("delivery"), A(t), i({}), m(l), f(a), g("ConfirmScreen"), N(r));
45
+ }, Z = () => {
45
46
  /\d{8}$/.test(
46
- oe(l)
47
- ) ? X() : i({
47
+ se(l)
48
+ ) ? Y() : i({
48
49
  status: "failed",
49
50
  loading: !1,
50
51
  message: "Que Pena, ainda não entregamos na sua região."
51
52
  });
52
53
  };
53
- return M(() => {
54
+ return ee(() => {
54
55
  var n, t, a, r;
55
56
  m((t = (n = c()) == null ? void 0 : n.userAddressInfos) == null ? void 0 : t.postalCode), o == null || o((a = c()) == null ? void 0 : a.regionalized), f((r = c()) == null ? void 0 : r.deliveryInfos);
56
- }, []), /* @__PURE__ */ Z(
57
+ }, []), /* @__PURE__ */ _(
57
58
  v.Provider,
58
59
  {
59
60
  value: {
60
- backToDelivery: N,
61
- setBackToDelivery: O,
61
+ backToDelivery: O,
62
+ setBackToDelivery: U,
62
63
  setMethod: o,
63
64
  priceStockInformation: T,
64
65
  setPickupName: C,
65
66
  setCity: p,
66
67
  setUf: x,
67
68
  setPickupTimes: y,
68
- pickupTimes: U,
69
+ pickupTimes: X,
69
70
  pickupConfirmScreenText: W,
70
71
  pricesAndHours: R,
71
72
  setModalOpen: w,
@@ -77,30 +78,31 @@ const v = _(null), ae = ({
77
78
  pickupPoints: b,
78
79
  titleText: z,
79
80
  moreInfosText: P,
80
- customShippingData: J,
81
+ customShippingData: K,
81
82
  textBackButton: S,
82
83
  confirmButton: h,
83
84
  editAddress: H,
84
85
  delivery: V,
85
86
  pickup: q,
86
- view: F,
87
+ view: L,
87
88
  setView: g,
88
- postalCodeValidation: Y,
89
- address: Q,
89
+ postalCodeValidation: Z,
90
+ address: $,
90
91
  pickupAddress: s,
91
- setPickupAddress: A,
92
- deliveryRequestInfos: G,
93
- postalCode: L,
94
- internalMethod: B,
92
+ setPickupAddress: G,
93
+ deliveryRequestInfos: J,
94
+ postalCode: Q,
95
+ internalMethod: F,
95
96
  setInternalMethod: u,
96
97
  regionalizeCatalog: E,
98
+ disabledSearch: j,
97
99
  deliveryPrice: k
98
100
  },
99
- children: j
101
+ children: B
100
102
  }
101
103
  );
102
- }, re = () => {
103
- const o = ee(v);
104
+ }, le = () => {
105
+ const o = oe(v);
104
106
  if (!o)
105
107
  throw new Error(
106
108
  "useRegionalizationContext must be used within a RegionalizationContextProvider"
@@ -108,6 +110,6 @@ const v = _(null), ae = ({
108
110
  return o;
109
111
  };
110
112
  export {
111
- ae as RegionalizationContextProvider,
112
- re as useRegionalizationContext
113
+ re as RegionalizationContextProvider,
114
+ le as useRegionalizationContext
113
115
  };
@@ -78,6 +78,7 @@ export interface RegionalizationProps {
78
78
  confirmButton?: string;
79
79
  };
80
80
  regionalizeCatalog?: (postalCodeChoiced?: string) => void;
81
+ disabledSearch?: boolean;
81
82
  children?: ReactNode;
82
83
  }
83
84
  export interface Status {
@@ -1,15 +1,15 @@
1
- import { jsxs as o, Fragment as h, jsx as e } from "react/jsx-runtime";
2
- import { useRef as f, useState as v, useEffect as b } from "react";
3
- import { Title as S } from "../components/Title.js";
4
- import { PickupPoint as w } from "../components/PickupPoint.js";
5
- import { GlassIcon as x } from "../../../assets/svgs/GlassIcon.js";
6
- import { SetViewButton as N } from "../components/SetViewButton.js";
7
- import { ArrowIcon as u } from "../../../assets/svgs/ArrowIcon.js";
8
- import { useRegionalizationContext as C } from "../context/RegionalizationContext.js";
9
- const E = () => {
10
- const { pickup: r, pickupPoints: l, textBackButton: m } = C(), a = f(null), [n, s] = v(l), d = l.length > 0 ? l : [];
11
- b(() => {
12
- s(d);
1
+ import { jsxs as o, Fragment as f, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as v, useState as b, useEffect as S } from "react";
3
+ import { Title as w } from "../components/Title.js";
4
+ import { PickupPoint as x } from "../components/PickupPoint.js";
5
+ import { GlassIcon as N } from "../../../assets/svgs/GlassIcon.js";
6
+ import { SetViewButton as u } from "../components/SetViewButton.js";
7
+ import { ArrowIcon as C } from "../../../assets/svgs/ArrowIcon.js";
8
+ import { useRegionalizationContext as F } from "../context/RegionalizationContext.js";
9
+ const z = () => {
10
+ const { pickup: r, pickupPoints: l, textBackButton: d, disabledSearch: m } = F(), a = v(null), [n, s] = b(l), h = l.length > 0 ? l : [];
11
+ S(() => {
12
+ s(h);
13
13
  }, [l]);
14
14
  const i = () => {
15
15
  s(
@@ -21,9 +21,9 @@ const E = () => {
21
21
  )
22
22
  );
23
23
  };
24
- return /* @__PURE__ */ o(h, { children: [
25
- /* @__PURE__ */ e(S, { title: r == null ? void 0 : r.title }),
26
- /* @__PURE__ */ o("div", { className: "stores-filter", children: [
24
+ return /* @__PURE__ */ o(f, { children: [
25
+ /* @__PURE__ */ e(w, { title: r == null ? void 0 : r.title }),
26
+ !m && /* @__PURE__ */ o("div", { className: "stores-filter", children: [
27
27
  /* @__PURE__ */ e("p", { children: r == null ? void 0 : r.labelFilter }),
28
28
  /* @__PURE__ */ o("div", { children: [
29
29
  /* @__PURE__ */ e(
@@ -40,7 +40,7 @@ const E = () => {
40
40
  {
41
41
  className: "filter-ico-container",
42
42
  onClick: () => i(),
43
- children: /* @__PURE__ */ e(x, {})
43
+ children: /* @__PURE__ */ e(N, {})
44
44
  }
45
45
  )
46
46
  ] }),
@@ -48,7 +48,7 @@ const E = () => {
48
48
  ] }),
49
49
  /* @__PURE__ */ e("p", { className: "stores-label", children: r == null ? void 0 : r.labelStores }),
50
50
  /* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((t) => /* @__PURE__ */ e(
51
- w,
51
+ x,
52
52
  {
53
53
  pickupPointInfos: t
54
54
  },
@@ -56,18 +56,18 @@ const E = () => {
56
56
  )) }),
57
57
  /* @__PURE__ */ e("br", {}),
58
58
  /* @__PURE__ */ o(
59
- N,
59
+ u,
60
60
  {
61
61
  view: "PickupPointInfoScreen",
62
62
  className: "back-button-all-store",
63
63
  children: [
64
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(u, { color: "var(--color-main)" }) }),
65
- m
64
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(C, { color: "var(--color-main)" }) }),
65
+ d
66
66
  ]
67
67
  }
68
68
  )
69
69
  ] });
70
70
  };
71
71
  export {
72
- E as AllStoresScreen
72
+ z as AllStoresScreen
73
73
  };
@@ -0,0 +1,22 @@
1
+ import { ImageProps } from './components/VoucherRedeemedCard/VoucherRedeemedCard';
2
+ import { StatusMessageTryApplyProps } from './components/StatusMessageTryApply/StatusMessageTryApply';
3
+
4
+ interface VoucherRedeemedProps {
5
+ image: ImageProps;
6
+ }
7
+ interface DataCouponsCartonistProps {
8
+ isLoading: boolean;
9
+ couponsCartonist?: string[];
10
+ }
11
+ interface VouchersRedeemedProps {
12
+ brand: string;
13
+ voucher: VoucherRedeemedProps;
14
+ title: string;
15
+ text?: string;
16
+ dataCouponsCartonist: DataCouponsCartonistProps;
17
+ couponApplied?: string;
18
+ statusMessage?: StatusMessageTryApplyProps;
19
+ onClick?: (couponId: string) => void;
20
+ }
21
+ export declare function VouchersRedeemed({ brand, voucher, title, text, dataCouponsCartonist, couponApplied, statusMessage, onClick }: VouchersRedeemedProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export {};
@@ -0,0 +1,121 @@
1
+ var E = Object.defineProperty, H = Object.defineProperties;
2
+ var O = Object.getOwnPropertyDescriptors;
3
+ var k = Object.getOwnPropertySymbols;
4
+ var z = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
5
+ var P = (i, l, r) => l in i ? E(i, l, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[l] = r, U = (i, l) => {
6
+ for (var r in l || (l = {}))
7
+ z.call(l, r) && P(i, r, l[r]);
8
+ if (k)
9
+ for (var r of k(l))
10
+ R.call(l, r) && P(i, r, l[r]);
11
+ return i;
12
+ }, W = (i, l) => H(i, O(l));
13
+ import { jsx as y, jsxs as F } from "react/jsx-runtime";
14
+ /* empty css */import G from "../../hooks/useWindowDimensions.js";
15
+ import { AdaptiveCarousel as J } from "../AdaptiveCarousel/AdaptiveCarousel.js";
16
+ import { VoucherRedeemedCard as K } from "./components/VoucherRedeemedCard/VoucherRedeemedCard.js";
17
+ import { useState as Q, useEffect as X, useMemo as Y } from "react";
18
+ import { getCouponsClubCardByUser as Z } from "./api/getCouponsCartonistByUser.js";
19
+ import { getCouponPrice as v } from "./utils/getCouponPrice.js";
20
+ import { StatusMessageTryApply as e } from "./components/StatusMessageTryApply/StatusMessageTryApply.js";
21
+ import { VouchersRedeemedSkeleton as D } from "./components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js";
22
+ import { VALID_VOUCHERS as o } from "./data/validVouchers.js";
23
+ import { setBoldTextParts as A } from "../../utils/setBoldTextParts.js";
24
+ function dl({
25
+ brand: i,
26
+ voucher: l,
27
+ title: r,
28
+ text: I,
29
+ dataCouponsCartonist: T,
30
+ couponApplied: w,
31
+ statusMessage: x,
32
+ onClick: _
33
+ }) {
34
+ const [d, S] = Q(T), { width: b } = G(), B = b && b < 768;
35
+ X(() => {
36
+ async function f() {
37
+ var g;
38
+ if (d != null && d.isLoading)
39
+ return;
40
+ S({ isLoading: !0 });
41
+ const t = await Z();
42
+ S({
43
+ isLoading: !1,
44
+ couponsCartonist: (g = t == null ? void 0 : t.split("|")) != null ? g : void 0
45
+ });
46
+ }
47
+ const { couponsCartonist: L, isLoading: m } = T;
48
+ !m && !(L != null && L.length) && f();
49
+ }, [T]);
50
+ const n = Y(() => {
51
+ var f, L, m;
52
+ return d != null && d.isLoading ? null : (m = (L = (f = d == null ? void 0 : d.couponsCartonist) == null ? void 0 : f.map((g) => {
53
+ var N, $, j;
54
+ if (!((N = o) != null && N.includes(g)))
55
+ return;
56
+ const q = v(g);
57
+ return {
58
+ title: `Vale ${i} - Loja Online - ${q}`,
59
+ text: `${i} +amigo`,
60
+ informationText: `Código: ${g == null ? void 0 : g.toUpperCase()}`,
61
+ buttonText: "Aplicar no carrinho",
62
+ couponId: g == null ? void 0 : g.toLowerCase(),
63
+ image: {
64
+ src: ($ = l == null ? void 0 : l.image) == null ? void 0 : $.src,
65
+ alt: (j = l == null ? void 0 : l.image) == null ? void 0 : j.alt
66
+ }
67
+ };
68
+ })) == null ? void 0 : L.filter(Boolean)) != null ? m : [];
69
+ }, [T, i, l]);
70
+ return d != null && d.isLoading ? /* @__PURE__ */ y(
71
+ D,
72
+ {
73
+ sizeCard: {
74
+ desktop: { width: 193, height: 220 },
75
+ mobile: { width: 160, height: 208 }
76
+ }
77
+ }
78
+ ) : !r || !(n != null && n.length) ? null : /* @__PURE__ */ F("div", { id: "vouchersRedeemed", className: "club-card-vouchersRedeemed", children: [
79
+ /* @__PURE__ */ y("h2", { className: "vouchersRedeemed-title", children: r }),
80
+ I && /* @__PURE__ */ y(
81
+ "p",
82
+ {
83
+ className: "vouchersRedeemed-subtitle",
84
+ dangerouslySetInnerHTML: { __html: A(I) }
85
+ }
86
+ ),
87
+ /* @__PURE__ */ y(
88
+ J,
89
+ {
90
+ quantity: n == null ? void 0 : n.length,
91
+ quantityToCarousel: 6,
92
+ activeBlur: !1,
93
+ forceCarousel: !!B && (n == null ? void 0 : n.length) > 2,
94
+ propsCarousel: {
95
+ gapItems: 0,
96
+ itemWidthProp: B ? 160 : 193
97
+ },
98
+ isNewDots: !0,
99
+ children: n == null ? void 0 : n.map((f, L) => /* @__PURE__ */ y(
100
+ K,
101
+ W(U({}, f), {
102
+ onClick: _,
103
+ buttonText: (w == null ? void 0 : w.toLowerCase()) === (f == null ? void 0 : f.couponId) ? "Vale aplicado!" : f == null ? void 0 : f.buttonText,
104
+ statusButton: (w == null ? void 0 : w.toLowerCase()) === (f == null ? void 0 : f.couponId) ? "clicked" : void 0
105
+ }),
106
+ L
107
+ ))
108
+ }
109
+ ),
110
+ x && /* @__PURE__ */ y(
111
+ e,
112
+ {
113
+ type: x == null ? void 0 : x.type,
114
+ text: x == null ? void 0 : x.text
115
+ }
116
+ )
117
+ ] });
118
+ }
119
+ export {
120
+ dl as VouchersRedeemed
121
+ };
@@ -0,0 +1 @@
1
+ export declare const getCouponsClubCardByUser: () => Promise<any>;
@@ -0,0 +1,20 @@
1
+ const n = async () => {
2
+ try {
3
+ return await fetch(
4
+ "/api/io/safedata/CL/documents/search?_fields=couponCartonist",
5
+ {
6
+ method: "GET",
7
+ headers: {
8
+ "Content-Type": "application/json",
9
+ Accept: "application/json"
10
+ }
11
+ }
12
+ ).then((t) => t.json());
13
+ } catch (o) {
14
+ console.error("Error getCouponsClubCardByUser");
15
+ return;
16
+ }
17
+ };
18
+ export {
19
+ n as getCouponsClubCardByUser
20
+ };
@@ -0,0 +1,12 @@
1
+
2
+ export interface StatusMessageTryApplyProps {
3
+ type: keyof typeof messages;
4
+ text: React.ReactNode;
5
+ }
6
+ declare const messages: {
7
+ success: (text: React.ReactNode) => import("react/jsx-runtime").JSX.Element;
8
+ warning: (text: React.ReactNode) => import("react/jsx-runtime").JSX.Element;
9
+ error: (text: React.ReactNode) => import("react/jsx-runtime").JSX.Element;
10
+ };
11
+ export declare const StatusMessageTryApply: ({ type, text }: StatusMessageTryApplyProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as n, jsxs as c, Fragment as e } from "react/jsx-runtime";
2
+ import { ErrorIconV2 as t } from "../../../../assets/svgs/ErrorIconV2.js";
3
+ import { SuccessIconV2 as p } from "../../../../assets/svgs/SuccessIconV2.js";
4
+ import { WarningIconV2 as l } from "../../../../assets/svgs/WarningIconV2.js";
5
+ /* empty css */const i = {
6
+ success: (r) => /* @__PURE__ */ c(e, { children: [
7
+ /* @__PURE__ */ n(p, {}),
8
+ /* @__PURE__ */ n("p", { children: r })
9
+ ] }),
10
+ warning: (r) => /* @__PURE__ */ c(e, { children: [
11
+ /* @__PURE__ */ n(l, {}),
12
+ /* @__PURE__ */ n("p", { children: r })
13
+ ] }),
14
+ error: (r) => /* @__PURE__ */ c(e, { children: [
15
+ /* @__PURE__ */ n(t, {}),
16
+ /* @__PURE__ */ n("p", { children: r })
17
+ ] })
18
+ }, f = ({
19
+ type: r,
20
+ text: s
21
+ }) => {
22
+ const o = i == null ? void 0 : i[r];
23
+ return /* @__PURE__ */ n("div", { className: `points-redeemed-statusMessageTryApply ${r}`, children: o == null ? void 0 : o(s) });
24
+ };
25
+ export {
26
+ f as StatusMessageTryApply
27
+ };
@@ -0,0 +1 @@
1
+ export { StatusMessageTryApply } from './StatusMessageTryApply';
@@ -0,0 +1,4 @@
1
+ import { StatusMessageTryApply as r } from "./StatusMessageTryApply.js";
2
+ export {
3
+ r as StatusMessageTryApply
4
+ };
@@ -0,0 +1,17 @@
1
+
2
+ export interface ImageProps {
3
+ src: string;
4
+ alt: string;
5
+ }
6
+ interface VoucherCardProps {
7
+ title: string;
8
+ text: string;
9
+ informationText: string;
10
+ image: ImageProps;
11
+ buttonText: string;
12
+ couponId: string;
13
+ onClick?: (couponId: string) => void;
14
+ statusButton?: 'clicked' | 'default';
15
+ }
16
+ export declare const VoucherRedeemedCard: ({ title, text, informationText, image, buttonText, couponId, onClick, statusButton }: VoucherCardProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,37 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ /* empty css */import { useState as p } from "react";
3
+ const C = ({
4
+ title: o,
5
+ text: t,
6
+ informationText: i,
7
+ image: d,
8
+ buttonText: h,
9
+ couponId: n,
10
+ onClick: r,
11
+ statusButton: a = "default"
12
+ }) => {
13
+ const [s, l] = p(!1), v = async () => {
14
+ s || (l(!0), await (r == null ? void 0 : r(n)), l(!1));
15
+ };
16
+ return /* @__PURE__ */ c("div", { className: "points-redeemed-voucherCard", children: [
17
+ /* @__PURE__ */ c("div", { className: "voucherCard-top", children: [
18
+ /* @__PURE__ */ e("div", { className: "voucherCard-top-image", children: /* @__PURE__ */ e("img", { alt: d == null ? void 0 : d.alt, src: d == null ? void 0 : d.src, width: 56, height: 56 }) }),
19
+ /* @__PURE__ */ c("div", { children: [
20
+ /* @__PURE__ */ e("h2", { className: "voucherCard-top-title", children: o }),
21
+ /* @__PURE__ */ e("p", { className: "voucherCard-top-description", children: t })
22
+ ] }),
23
+ /* @__PURE__ */ e("div", { className: "voucherCard-top-infoRedeemed", children: /* @__PURE__ */ e("p", { children: i }) })
24
+ ] }),
25
+ /* @__PURE__ */ e("div", { className: "voucherCard-bottom", children: /* @__PURE__ */ e(
26
+ "button",
27
+ {
28
+ onClick: a === "default" ? () => v() : void 0,
29
+ className: s ? "loading" : a,
30
+ children: h
31
+ }
32
+ ) })
33
+ ] });
34
+ };
35
+ export {
36
+ C as VoucherRedeemedCard
37
+ };
@@ -0,0 +1 @@
1
+ export { VoucherRedeemedCard } from './VoucherRedeemedCard';