@plurix/ecom-components 1.16.0-commerce.0 → 1.16.1-commerce

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 (85) hide show
  1. package/dist/assets/svgs/CheckMarkBoxIcon.d.ts +1 -0
  2. package/dist/assets/svgs/CheckMarkBoxIcon.js +30 -0
  3. package/dist/assets/svgs/CheckMarkIcon.d.ts +1 -0
  4. package/dist/assets/svgs/CheckMarkIcon.js +23 -0
  5. package/dist/assets/svgs/CouponIcon.d.ts +1 -4
  6. package/dist/assets/svgs/CouponIcon.js +50 -14
  7. package/dist/assets/svgs/ErrorIcon.d.ts +1 -5
  8. package/dist/assets/svgs/ErrorIcon.js +26 -14
  9. package/dist/assets/svgs/ErrorIconV2.d.ts +1 -0
  10. package/dist/assets/svgs/ErrorIconV2.js +33 -0
  11. package/dist/assets/svgs/SuccessIconV2.d.ts +1 -0
  12. package/dist/assets/svgs/SuccessIconV2.js +30 -0
  13. package/dist/assets/svgs/WarningIconV2.d.ts +1 -0
  14. package/dist/assets/svgs/WarningIconV2.js +40 -0
  15. package/dist/hooks/useVerticalShelfCarouselProps.d.ts +4 -0
  16. package/dist/hooks/useVerticalShelfCarouselProps.js +14 -0
  17. package/dist/hooks/useWindowDimensions.d.ts +5 -0
  18. package/dist/hooks/useWindowDimensions.js +38 -0
  19. package/dist/main.d.ts +1 -0
  20. package/dist/main.js +19 -17
  21. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.d.ts +14 -0
  22. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.js +69 -0
  23. package/dist/packages/Coupons/Coupons.d.ts +3 -17
  24. package/dist/packages/Coupons/Coupons.js +76 -114
  25. package/dist/packages/Coupons/components/Alert.d.ts +4 -2
  26. package/dist/packages/Coupons/components/Alert.js +10 -10
  27. package/dist/packages/Coupons/components/CouponCard.d.ts +5 -22
  28. package/dist/packages/Coupons/components/CouponCard.js +79 -133
  29. package/dist/packages/Coupons/components/NoCoupons.js +7 -7
  30. package/dist/packages/Coupons/hooks/useCoupons.d.ts +33 -0
  31. package/dist/packages/Coupons/hooks/useCoupons.js +108 -0
  32. package/dist/packages/Coupons/types/CouponType.d.ts +1 -1
  33. package/dist/packages/VouchersRedeemed/VouchersRedeemed.d.ts +24 -0
  34. package/dist/packages/VouchersRedeemed/VouchersRedeemed.js +145 -0
  35. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.d.ts +1 -0
  36. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.js +20 -0
  37. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.d.ts +12 -0
  38. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.js +27 -0
  39. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.d.ts +1 -0
  40. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.js +4 -0
  41. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.d.ts +17 -0
  42. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.js +37 -0
  43. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.d.ts +1 -0
  44. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.js +4 -0
  45. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.d.ts +15 -0
  46. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js +49 -0
  47. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.d.ts +1 -0
  48. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.js +4 -0
  49. package/dist/packages/VouchersRedeemed/data/validVouchers.d.ts +1 -0
  50. package/dist/packages/VouchersRedeemed/data/validVouchers.js +20 -0
  51. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.d.ts +1 -0
  52. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.js +8 -0
  53. package/dist/styles/adaptive-carousel.global.css +1 -0
  54. package/dist/styles/coupons.global.css +1 -1
  55. package/dist/styles/regionalization.global.css +1 -1
  56. package/dist/styles/vouchers-redeemed.global.css +1 -0
  57. package/dist/utils/carousel/carouselProps.d.ts +33 -0
  58. package/dist/utils/carousel/carouselProps.js +59 -0
  59. package/dist/utils/scroll/isScrollToEnd.d.ts +1 -0
  60. package/dist/utils/scroll/isScrollToEnd.js +4 -0
  61. package/dist/utils/setBoldTextParts.d.ts +1 -0
  62. package/dist/utils/setBoldTextParts.js +7 -0
  63. package/package.json +1 -1
  64. package/dist/packages/Coupons/components/Breadcrumb.d.ts +0 -6
  65. package/dist/packages/Coupons/components/Breadcrumb.js +0 -33
  66. package/dist/packages/Coupons/components/Modal.d.ts +0 -8
  67. package/dist/packages/Coupons/components/Modal.js +0 -62
  68. package/dist/packages/Coupons/components/ModalFooter.d.ts +0 -9
  69. package/dist/packages/Coupons/components/ModalFooter.js +0 -25
  70. package/dist/packages/Coupons/components/ModalHeader.d.ts +0 -6
  71. package/dist/packages/Coupons/components/ModalHeader.js +0 -25
  72. package/dist/packages/Coupons/types/Views.d.ts +0 -1
  73. package/dist/packages/Coupons/types/Views.js +0 -1
  74. package/dist/packages/Coupons/views/CouponsView.d.ts +0 -15
  75. package/dist/packages/Coupons/views/CouponsView.js +0 -131
  76. package/dist/packages/Coupons/views/EmptyCartView.d.ts +0 -6
  77. package/dist/packages/Coupons/views/EmptyCartView.js +0 -36
  78. package/dist/packages/Coupons/views/LoadingView.d.ts +0 -7
  79. package/dist/packages/Coupons/views/LoadingView.js +0 -39
  80. package/dist/packages/Coupons/views/OverwriteView.d.ts +0 -14
  81. package/dist/packages/Coupons/views/OverwriteView.js +0 -58
  82. package/dist/packages/Coupons/views/RulesView.d.ts +0 -13
  83. package/dist/packages/Coupons/views/RulesView.js +0 -49
  84. package/dist/packages/Coupons/views/index.d.ts +0 -5
  85. package/dist/packages/Coupons/views/index.js +0 -12
@@ -0,0 +1,108 @@
1
+ import { useState as u, useEffect as B } from "react";
2
+ import { addCoupon as H } from "../api/addCoupon.js";
3
+ import { removeCoupon as K } from "../api/removeCoupon.js";
4
+ import { getCoupons as P } from "../api/getCoupons.js";
5
+ function Y({
6
+ orderFormId: f,
7
+ hasItemsInCart: D,
8
+ builder: I,
9
+ isIO: O = !1,
10
+ activeOrderFormCoupon: c,
11
+ genericTaggingEvent: s,
12
+ couponsList: e,
13
+ qtdCouponsView: J,
14
+ getCouponsMutation: n,
15
+ addCouponMutation: w,
16
+ removeCouponMutation: h
17
+ }) {
18
+ const [R, L] = u(!0), [b, m] = u([]), [d, C] = u(""), [j, _] = u(!1), [y, q] = u(""), [x, l] = u(!1), [z, S] = u("");
19
+ function k(o) {
20
+ o.preventDefault(), q(o.target.value);
21
+ }
22
+ async function G(o) {
23
+ if (o.preventDefault(), !y) {
24
+ l(!0);
25
+ return;
26
+ }
27
+ await $({
28
+ couponName: y,
29
+ isAdding: !0,
30
+ isFromForm: !0
31
+ });
32
+ }
33
+ async function $({
34
+ couponName: o,
35
+ isAdding: t,
36
+ isFromForm: a
37
+ }) {
38
+ if (S(""), l(!1), t && !D) {
39
+ s == null || s("discount_coupon", {
40
+ name: "Alerta de carrinho vazio acionado"
41
+ }), S("warning");
42
+ return;
43
+ }
44
+ try {
45
+ _(!0);
46
+ let r;
47
+ if (t) {
48
+ const p = w ? await w({
49
+ input: { orderFormId: f, couponId: o }
50
+ }) : await H(f, o);
51
+ r = w ? JSON.parse(p.addCoupon.data) : p;
52
+ } else {
53
+ const p = h ? await h({ input: { orderFormId: f } }) : await K(f);
54
+ r = h ? JSON.parse(p.removeCoupon.data) : p;
55
+ }
56
+ r.error.length <= 0 ? (s == null || s("discount_coupon", {
57
+ name: `Cupom ${t ? "aplicado" : "removido"}`,
58
+ couponName: o
59
+ }), C(t ? o : ""), S(t ? "applied" : ""), O && window.location.reload()) : (s == null || s("discount_coupon", {
60
+ name: `Erro ao ${t ? "aplicar" : "remover"} cupom`,
61
+ couponName: o,
62
+ objectError: r.error
63
+ }), C(t ? "" : o), a && l(!0));
64
+ } catch (r) {
65
+ s == null || s("discount_coupon", {
66
+ name: `Erro ao ${t ? "aplicar" : "remover"} cupom`,
67
+ couponName: o
68
+ }), a && l(!0);
69
+ } finally {
70
+ _(!1);
71
+ }
72
+ }
73
+ return B(() => {
74
+ c && C(c);
75
+ }, [c]), B(() => {
76
+ (async () => {
77
+ L(!0);
78
+ try {
79
+ const t = n ? await n({ input: { builder: I, couponsList: e } }) : await P(I, e), a = n ? JSON.parse(t.getCoupons.data).coupons : t;
80
+ if (J) {
81
+ const r = a.slice(0, J);
82
+ m(r);
83
+ return;
84
+ }
85
+ m(a);
86
+ return;
87
+ } catch (t) {
88
+ m([]);
89
+ } finally {
90
+ L(!1);
91
+ }
92
+ })();
93
+ }, [JSON.stringify(e)]), {
94
+ isLoadingCouponList: R,
95
+ coupons: b,
96
+ currentCoupon: d,
97
+ isLoadingButton: j,
98
+ inputCoupon: y,
99
+ isInputError: x,
100
+ showAlert: z,
101
+ handleSubmit: G,
102
+ handleChangeInput: k,
103
+ changeCoupon: $
104
+ };
105
+ }
106
+ export {
107
+ Y as useCoupons
108
+ };
@@ -1,6 +1,6 @@
1
1
  export interface CouponType {
2
2
  couponName: string;
3
- couponValue: string;
3
+ couponValue?: string;
4
4
  couponDescription: string;
5
5
  couponRules: Array<string>;
6
6
  couponInitialDate: string;
@@ -0,0 +1,24 @@
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
+ availableAreaSizeToCarouselByItem?: number;
21
+ isShowEmpty?: boolean;
22
+ }
23
+ export declare function VouchersRedeemed({ brand, voucher, title, text, dataCouponsCartonist, couponApplied, statusMessage, onClick, availableAreaSizeToCarouselByItem, isShowEmpty }: VouchersRedeemedProps): import("react/jsx-runtime").JSX.Element | null;
24
+ export {};
@@ -0,0 +1,145 @@
1
+ var U = Object.defineProperty, W = Object.defineProperties;
2
+ var B = Object.getOwnPropertyDescriptors;
3
+ var v = Object.getOwnPropertySymbols;
4
+ var O = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
5
+ var R = (n, l, f) => l in n ? U(n, l, { enumerable: !0, configurable: !0, writable: !0, value: f }) : n[l] = f, S = (n, l) => {
6
+ for (var f in l || (l = {}))
7
+ O.call(l, f) && R(n, f, l[f]);
8
+ if (v)
9
+ for (var f of v(l))
10
+ F.call(l, f) && R(n, f, l[f]);
11
+ return n;
12
+ }, $ = (n, l) => W(n, B(l));
13
+ import { jsx as d, jsxs as j } 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 k, useMemo as X } from "react";
18
+ import { getCouponsClubCardByUser as Y } from "./api/getCouponsCartonistByUser.js";
19
+ import { getCouponPrice as Z } from "./utils/getCouponPrice.js";
20
+ import { StatusMessageTryApply as h } from "./components/StatusMessageTryApply/StatusMessageTryApply.js";
21
+ import { VouchersRedeemedSkeleton as o } from "./components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js";
22
+ import { VALID_VOUCHERS as z } from "./data/validVouchers.js";
23
+ import { setBoldTextParts as q } from "../../utils/setBoldTextParts.js";
24
+ function dl({
25
+ brand: n,
26
+ voucher: l,
27
+ title: f,
28
+ text: w,
29
+ dataCouponsCartonist: e,
30
+ couponApplied: s,
31
+ statusMessage: L,
32
+ onClick: E,
33
+ availableAreaSizeToCarouselByItem: N,
34
+ isShowEmpty: H
35
+ }) {
36
+ var I;
37
+ const [m, x] = Q({
38
+ isLoading: !e,
39
+ couponsCartonist: (I = e == null ? void 0 : e.couponsCartonist) != null ? I : []
40
+ }), { width: T } = G(), t = T && T < 768;
41
+ k(() => {
42
+ e && x(e);
43
+ }, [e]), k(() => {
44
+ async function r() {
45
+ var y;
46
+ try {
47
+ x({ isLoading: !0, couponsCartonist: [] });
48
+ const c = await Y();
49
+ x({
50
+ isLoading: !1,
51
+ couponsCartonist: (y = c == null ? void 0 : c.split("|")) != null ? y : []
52
+ });
53
+ } catch (c) {
54
+ x({ isLoading: !1, couponsCartonist: [] });
55
+ }
56
+ }
57
+ e || r();
58
+ }, [e]);
59
+ const i = X(() => {
60
+ var c;
61
+ if (m != null && m.isLoading)
62
+ return;
63
+ const r = m.couponsCartonist;
64
+ return r != null && r.length ? (c = r == null ? void 0 : r.map((g) => {
65
+ var _, b;
66
+ if (!z.includes(g))
67
+ return;
68
+ const P = Z(g);
69
+ return {
70
+ title: `Vale ${n} - Loja Online - ${P}`,
71
+ text: `${n} +amigo`,
72
+ informationText: `Código: ${g == null ? void 0 : g.toUpperCase()}`,
73
+ buttonText: "Aplicar no carrinho",
74
+ couponId: g == null ? void 0 : g.toLowerCase(),
75
+ image: {
76
+ src: (_ = l == null ? void 0 : l.image) == null ? void 0 : _.src,
77
+ alt: (b = l == null ? void 0 : l.image) == null ? void 0 : b.alt
78
+ }
79
+ };
80
+ })) == null ? void 0 : c.filter(Boolean) : [];
81
+ }, [m, n, l]);
82
+ return m != null && m.isLoading ? /* @__PURE__ */ d(
83
+ o,
84
+ {
85
+ sizeCard: {
86
+ desktop: { width: 193, height: 220 },
87
+ mobile: { width: 160, height: 208 }
88
+ },
89
+ availableAreaSizeToCarouselByItem: N
90
+ }
91
+ ) : H && !(i != null && i.length) ? /* @__PURE__ */ j("div", { id: "vouchersRedeemed", className: "club-card-vouchersRedeemed isEmpty", children: [
92
+ /* @__PURE__ */ d("h2", { className: "vouchersRedeemed-title", children: f }),
93
+ w && /* @__PURE__ */ d(
94
+ "p",
95
+ {
96
+ className: "vouchersRedeemed-subtitle",
97
+ dangerouslySetInnerHTML: { __html: q(w) }
98
+ }
99
+ ),
100
+ /* @__PURE__ */ d("div", { className: "vouchersRedeemed-empty", children: /* @__PURE__ */ d("p", { children: "Não há vales-compras disponíveis no momento" }) })
101
+ ] }) : !f || !(i != null && i.length) ? null : /* @__PURE__ */ j("div", { id: "vouchersRedeemed", className: "club-card-vouchersRedeemed", children: [
102
+ /* @__PURE__ */ d("h2", { className: "vouchersRedeemed-title", children: f }),
103
+ w && /* @__PURE__ */ d(
104
+ "p",
105
+ {
106
+ className: "vouchersRedeemed-subtitle",
107
+ dangerouslySetInnerHTML: { __html: q(w) }
108
+ }
109
+ ),
110
+ /* @__PURE__ */ d(
111
+ J,
112
+ {
113
+ quantity: i == null ? void 0 : i.length,
114
+ quantityToCarousel: N ? N + 1 : 6,
115
+ activeBlur: !1,
116
+ forceCarousel: !!t && (i == null ? void 0 : i.length) > 1,
117
+ propsCarousel: {
118
+ gapItems: 0,
119
+ itemWidthProp: t ? 160 : 193,
120
+ qtyItems: N
121
+ },
122
+ isNewDots: !0,
123
+ children: i == null ? void 0 : i.map((r, y) => /* @__PURE__ */ d(
124
+ K,
125
+ $(S({}, r), {
126
+ onClick: E,
127
+ buttonText: (s == null ? void 0 : s.toLowerCase()) === (r == null ? void 0 : r.couponId) ? "Vale aplicado!" : r == null ? void 0 : r.buttonText,
128
+ statusButton: (s == null ? void 0 : s.toLowerCase()) === (r == null ? void 0 : r.couponId) ? "clicked" : void 0
129
+ }),
130
+ y
131
+ ))
132
+ }
133
+ ),
134
+ L && /* @__PURE__ */ d(
135
+ h,
136
+ {
137
+ type: L == null ? void 0 : L.type,
138
+ text: L == null ? void 0 : L.text
139
+ }
140
+ )
141
+ ] });
142
+ }
143
+ export {
144
+ dl as VouchersRedeemed
145
+ };
@@ -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';
@@ -0,0 +1,4 @@
1
+ import { VoucherRedeemedCard as d } from "./VoucherRedeemedCard.js";
2
+ export {
3
+ d as VoucherRedeemedCard
4
+ };
@@ -0,0 +1,15 @@
1
+ interface VouchersRedeemedSkeletonProps {
2
+ sizeCard: {
3
+ mobile: {
4
+ width: number;
5
+ height: number;
6
+ };
7
+ desktop: {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ };
12
+ availableAreaSizeToCarouselByItem?: number;
13
+ }
14
+ export declare const VouchersRedeemedSkeleton: ({ sizeCard, availableAreaSizeToCarouselByItem }: VouchersRedeemedSkeletonProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,49 @@
1
+ import { jsxs as b, jsx as h } from "react/jsx-runtime";
2
+ import v from "../../../../hooks/useWindowDimensions.js";
3
+ import { Skeleton as m } from "../../../Skeleton/index.js";
4
+ const r = ({
5
+ sizeCard: o,
6
+ availableAreaSizeToCarouselByItem: c
7
+ }) => {
8
+ var g, l, p;
9
+ const { width: t } = v(), n = t && t < 768;
10
+ return /* @__PURE__ */ b("div", { id: "vouchersRedeemed", className: "club-card-vouchersRedeemed isLoading", children: [
11
+ /* @__PURE__ */ h(
12
+ m,
13
+ {
14
+ width: "100%",
15
+ height: 32,
16
+ backgroundColor: "var(--color-grayScale-faded)"
17
+ }
18
+ ),
19
+ /* @__PURE__ */ h(
20
+ m,
21
+ {
22
+ width: "100%",
23
+ height: 26,
24
+ backgroundColor: "var(--color-grayScale-faded)"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ h("div", { className: "adaptiveCarousel-container", children: (p = Array.from({
28
+ length: c != null ? c : Math.floor(
29
+ Math.min(t != null ? t : 1280, 1280) / (n ? (g = o == null ? void 0 : o.mobile) == null ? void 0 : g.width : (l = o == null ? void 0 : o.desktop) == null ? void 0 : l.width)
30
+ )
31
+ })) == null ? void 0 : p.map((R, w) => {
32
+ var f, k, d, u;
33
+ return /* @__PURE__ */ h(
34
+ m,
35
+ {
36
+ width: n ? (f = o == null ? void 0 : o.mobile) == null ? void 0 : f.width : (k = o == null ? void 0 : o.desktop) == null ? void 0 : k.width,
37
+ height: n ? (d = o == null ? void 0 : o.mobile) == null ? void 0 : d.height : (u = o == null ? void 0 : o.desktop) == null ? void 0 : u.height,
38
+ backgroundColor: "var(--color-grayScale-faded)",
39
+ borderRadius: 8,
40
+ margin: 0
41
+ },
42
+ w
43
+ );
44
+ }) })
45
+ ] });
46
+ };
47
+ export {
48
+ r as VouchersRedeemedSkeleton
49
+ };
@@ -0,0 +1 @@
1
+ export { VouchersRedeemedSkeleton } from './VouchersRedeemedSkeleton';
@@ -0,0 +1,4 @@
1
+ import { VouchersRedeemedSkeleton as r } from "./VouchersRedeemedSkeleton.js";
2
+ export {
3
+ r as VouchersRedeemedSkeleton
4
+ };
@@ -0,0 +1 @@
1
+ export declare const VALID_VOUCHERS: string[];
@@ -0,0 +1,20 @@
1
+ const e = [
2
+ "spoe5",
3
+ "spoe10",
4
+ "spoe15",
5
+ "boae5",
6
+ "boae10",
7
+ "boae15",
8
+ "cmae5",
9
+ "cmae10",
10
+ "cmae15",
11
+ "avne5",
12
+ "avne10",
13
+ "avne15",
14
+ "amge5",
15
+ "amge10",
16
+ "amge15"
17
+ ];
18
+ export {
19
+ e as VALID_VOUCHERS
20
+ };
@@ -0,0 +1 @@
1
+ export declare const getCouponPrice: (coupon: string) => string | null;
@@ -0,0 +1,8 @@
1
+ import { formatBrazilianPrice as e } from "../../../utils/changerOrderModal.js";
2
+ const a = (t) => {
3
+ const r = t == null ? void 0 : t.match(/\d+$/);
4
+ return r ? e(parseInt(r == null ? void 0 : r[0], 10)) : null;
5
+ };
6
+ export {
7
+ a as getCouponPrice
8
+ };
@@ -0,0 +1 @@
1
+ .adaptiveCarousel-container{position:relative;display:flex;flex-direction:row;overflow-x:scroll;scroll-behavior:smooth;width:100%;scrollbar-width:none;gap:20px;justify-content:center}.adaptiveCarousel-container .carousel-container{scrollbar-width:none}.adaptiveCarousel-container.isCarousel{display:block}.adaptiveCarousel-container.isCarousel .carousel-arrow-button-prev{margin-right:20px}.adaptiveCarousel-container.isCarousel .carousel-arrow-button-next{margin-left:20px}.adaptiveCarousel-container.isCarousel .carousel-arrow-button-prev button,.adaptiveCarousel-container.isCarousel .carousel-arrow-button-next button{margin:0!important}.adaptiveCarousel-container.isCarousel .bullets-container{margin-top:8px}.adaptiveCarousel-container .background-blur-left,.adaptiveCarousel-container .background-blur-right{position:absolute;width:50px;height:100%;background:linear-gradient(90deg,transparent 0%,var(--color-grayScale-white) 100%);right:0;top:0;z-index:1}.adaptiveCarousel-container .background-blur-left{background:linear-gradient(270deg,transparent 0%,var(--color-grayScale-white) 100%);right:auto;left:60px}.adaptiveCarousel-container.isNewDots .bullets-container{gap:8px}.adaptiveCarousel-container.isNewDots .bullets-container button{height:4px!important;border-radius:8px!important;width:56px!important;border:none!important;margin:0!important}.adaptiveCarousel-container.isNewDots .bullets-container button[data-active=false]{width:21px!important;background-color:#c6c6c6!important}@media (min-width: 768px){.adaptiveCarousel-container.isNewDots .bullets-container button[data-active=false]{background-color:#c6c6c6!important}}@media (min-width: 1280px){.adaptiveCarousel-container .background-blur-left,.adaptiveCarousel-container .background-blur-right{right:60px}}
@@ -1 +1 @@
1
- .coupons-container *{box-sizing:border-box;font-family:DM Sans,sans-serif}.coupons-container h1,.coupons-container h3,.coupons-container h4,.coupons-container p{margin:0}.coupons-container ul{list-style:none;margin:0;padding:0}.coupons-container .modal-title-container{display:flex;align-items:center;justify-content:space-between}.coupons-container .modal-title{margin:0;color:var(--color-grayScale);font-size:16px;font-weight:700;line-height:20px}@media (min-width: 640px){.coupons-container .modal-title{font-size:24px;line-height:28px}}.coupons-container .modal-close-icon{display:flex;outline:0;border:0;margin-left:10px;padding:0;background-color:transparent;cursor:pointer}@media (min-width: 640px){.coupons-container .modal-close-icon{margin-left:16px}}.coupons-container .breadcrumb-container{margin-top:16px;margin-bottom:8px}.coupons-container .breadcrumb-container .breadcrumb-content-container{align-items:center;display:flex;margin-bottom:16px;font-size:14px;line-height:18px}.coupons-container .breadcrumb-container .breadcrumb-content-container button{outline:0;border:0;background-color:transparent;color:var(--color-grayScale-darkest);font-size:14px;line-height:18px;cursor:pointer}.coupons-container .breadcrumb-container .breadcrumb-content-container svg{margin:0 10px}.coupons-container .breadcrumb-container .breadcrumb-content-container span{color:var(--color-main);font-weight:700}.coupons-container .breadcrumb-container .breadcrumb-back-button{display:flex;justify-content:center;align-items:center;outline:0;border:0;background-color:transparent;cursor:pointer;color:var(--color-support-links);font-size:14px;line-height:18px;text-decoration:underline}.coupons-container .breadcrumb-container .breadcrumb-back-button svg{margin-right:10px}.coupons-container .modal-footer-container{margin-top:24px;background-color:var(--color-grayScale-white)}.coupons-container .modal-footer-container.floating{box-shadow:0 -4px 4px 0 var(--color-support-shadow);position:absolute;bottom:0;left:0;width:100%;padding:16px}.coupons-container .modal-confirm-button{display:flex;justify-content:center;width:100%;outline:0;border:1px solid var(--color-main);border-radius:2px;margin-bottom:16px;padding:8px 16px;background-color:var(--color-main);cursor:pointer;color:var(--color-assistant-main);font-size:16px;font-weight:500;line-height:20px}.redirection-club-button{margin-top:16px;margin-bottom:0!important}.coupons-container .modal-cancel-button{display:flex;justify-content:center;width:100%;outline:0;border:1px solid var(--color-main);border-radius:2px;padding:8px 16px;background-color:transparent;cursor:pointer;color:var(--color-main);font-size:16px;font-weight:500;line-height:20px}.coupons-container .form-coupons form{display:flex;flex-direction:column;margin:24px 0}.coupons-container .form-coupons input{padding:8px;margin-bottom:8px;border-radius:2px;border:1px solid var(--color-grayScale-light);background:var(--color-grayScale-white);font-size:16px;line-height:20px}.coupons-container .form-coupons button{display:flex;justify-content:center;padding:8px;font-weight:500;line-height:20px;cursor:pointer;color:var(--color-grayScale-dark);border:1px solid var(--color-grayScale-dark);background-color:var(--color-grayScale-white)}.coupons-container .form-coupons button:disabled{cursor:wait;color:var(--color-grayScale-lightest);background-color:var(--color-grayScale-darkest)}.coupons-container .cart-empty-coupons-label{max-width:500px;margin:1rem 0rem}.coupons-container .cart-empty-coupons-label span{margin-right:16px}.coupons-container .cart-empty-coupons-label p{display:flex;flex-direction:row;padding:8px 16px;margin-top:24px;border-radius:4px;line-height:1rem;font-size:16px;color:var(--color-infoFeedback-dark);background-color:var(--color-infoFeedback-faded)}.coupons-container .container-title-coupons h2{margin-bottom:16px;color:var(--color-grayScale);font-size:16px;font-weight:700;line-height:20px}.coupons-container .container-title-coupons .container-coupons{width:100%;display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:16px}.coupons-container .container-card-coupon{width:100%;display:flex;flex-direction:row;justify-content:space-between;padding:1rem;gap:8px;border-radius:8px;border:1px solid var(--color-grayScale-faded);background:var(--color-grayScale-white);box-shadow:4px 4px 8px 0 var(--color-support-shadow)}.coupons-container .container-card-coupon.active{border:1.5px solid var(--color-positiveFeedback)}.coupons-container .container-card-coupon .text-container{flex:1;display:flex;flex-direction:column;align-self:center;align-items:flex-start;gap:8px}.coupons-container .container-card-coupon .text-container .container-title{display:flex;flex-direction:row}.coupons-container .container-card-coupon .text-container .container-title .title{margin-left:.5rem;line-height:20px;font-weight:700;color:var(--color-grayScale);font-size:16px}.coupons-container .container-card-coupon .text-container .price-badge{border-radius:2rem;padding:.25rem 1rem;font-weight:700;font-size:20px;color:var(--color-badge-secondary);background-color:var(--color-badge-main)}.coupons-container .container-card-coupon .text-container .subtitle{font-weight:400;line-height:20px;font-size:16px;color:var(--color-grayScale-darkest)}.coupons-container .container-card-coupon .vertical-line{border-right:2px dashed var(--color-grayScale-light)}.coupons-container .container-card-coupon .buttons-container{display:flex;flex-direction:column;align-items:center;justify-content:center}.coupons-container .container-card-coupon .buttons-container .applied-coupon{display:flex;align-items:center;width:110px;height:34px;padding:16px 8px;border:unset;border-radius:2px;line-height:20px;font-weight:500;font-size:16px;color:var(--color-main);background:var(--color-positiveFeedback-faded)}.coupons-container .container-card-coupon .buttons-container .applied-coupon span,.coupons-container .container-card-coupon .buttons-container .success-icon{margin-right:8px}.coupons-container .container-card-coupon .buttons-container .apply-coupon{width:110px;height:34px;padding:8px 16px;border:unset;border-radius:2px;color:var(--color-assistant-main);background:var(--color-main);cursor:pointer}.coupons-container .container-card-coupon .buttons-container .apply-coupon:disabled{cursor:wait;color:var(--color-grayScale-lightest);background-color:var(--color-grayScale-darkest)}.coupons-container .container-card-coupon .buttons-container .remove-coupon{width:110px;height:34px;margin-top:16px;padding:8px 16px;border-radius:2px;font-weight:500;line-height:20px;color:var(--color-main);border:1px solid var(--color-main);background:var(--color-grayScale-white);cursor:pointer}.coupons-container .container-card-coupon .buttons-container a{width:110px;margin-top:16px;text-decoration-line:underline;text-align:center;font-weight:400;line-height:20px;font-size:16px;color:var(--color-support-links);cursor:pointer}.coupons-container .modal-rule-coupon-external .modal-rule-coupon-internal .cartEmptyCoupon-h3{font-size:16px;font-weight:700;line-height:20px;color:#1c1c1c;margin:1.5rem 0rem}.coupons-container .modal-rule-coupon-external .modal-rule-coupon-internal #cartEmptyCoupon-p{line-height:1rem}.coupons-container .modal-rule-coupon-external .modal-rule-coupon-internal .cartEmptyCoupon-svg{display:flex;justify-content:center}.coupons-container .modal-rule-coupon-external .modal-rule-coupon-internal .modal-rule-coupon-children span{margin-right:16px}.coupons-container .modal-rule-coupon-external .modal-rule-coupon-internal .modal-rule-coupon-children p{display:flex;flex-direction:row;padding:8px 16px;border-radius:4px;line-height:2.5rem;font-size:16px;color:var(--color-infoFeedback-dark);background-color:var(--color-infoFeedback-faded)}.coupons-container .applied-coupon-badge{display:flex;position:fixed;width:fit-content;justify-content:flex-start;align-items:center;padding:1rem;z-index:10;bottom:40px;left:50%;transform:translate(-50%);border-radius:4px;box-shadow:4px 4px 8px var(--color-support-shadow)}.coupons-container .applied-coupon-badge span{margin-right:8px}.coupons-container .error-coupon{background-color:var(--color-negativeFeedback-faded)}.coupons-container .success-coupon{background-color:var(--color-positiveFeedback-faded)}.coupons-container .noCoupons{display:flex;flex-direction:column;align-items:center}.coupons-container .noCoupons .noCoupons-h1{font-weight:700}.coupons-container .noCoupons .noCoupons-p{margin-bottom:24px;color:var(--color-grayScale-darkest)}
1
+ .coupons-container *{box-sizing:border-box;font-family:DM Sans,sans-serif}.coupons-container h1,.coupons-container h3,.coupons-container h4,.coupons-container p{margin:0}.coupons-container ul{list-style:none;margin:0;padding:0}.coupons-container .form-coupons p{margin-bottom:16px;color:var(--color-grayScale-darkest);font-size:16px;line-height:18px;font-weight:400}.coupons-container .form-coupons form{position:relative;display:flex;gap:8px;justify-content:center;align-items:center;margin-bottom:34px}.coupons-container .form-coupons input{flex:1;outline:none;border:1px solid var(--color-grayScale-light);border-radius:2px;height:40px;padding:8px;background-color:var(--color-grayScale-white);color:var(--color-grayScale-darkest)!important;font-family:DM Sans,sans-serif;font-size:14px;line-height:14px;font-weight:400}.coupons-container .form-coupons input::placeholder{color:var(--color-grayScale-dark)}.coupons-container .form-coupons input.error{border-color:var(--color-negativeFeedback-dark)}.coupons-container .form-coupons .error-message{position:absolute;left:0;bottom:-20px;display:flex;align-items:center;margin:0;color:var(--color-negativeFeedback-dark);font-family:DM Sans,sans-serif;font-size:12px;line-height:16px;font-weight:400}.coupons-container .form-coupons .error-message svg{width:12px;height:12px;margin-right:4px}.coupons-container .form-coupons button{cursor:pointer;display:flex;height:40px;padding:8px 16px;justify-content:center;align-items:center;border:1px solid var(--color-main);border-radius:2px;background:var(--color-grayScale-white);color:var(--color-main);font-family:DM Sans,sans-serif;font-size:14px;line-height:18px;font-weight:500;transition:all ease .5s}.coupons-container .form-coupons button:disabled{cursor:wait}@media (min-width: 640px){.coupons-container .form-coupons button{width:206px}}.coupons-container .container-title-coupons .container-main-title{margin-bottom:8px;color:var(--color-main);font-size:16px;line-height:20px;font-weight:700}@media (min-width: 640px){.coupons-container .container-title-coupons .container-main-title{font-size:24px;line-height:28px}}.coupons-container .container-title-coupons .container-main-subtitle{margin-bottom:16px;color:var(--color-grayScale-darkest);font-size:16px;line-height:18px;font-weight:400}@media (min-width: 640px){.coupons-container .container-title-coupons .container-main-subtitle{font-size:20px;line-height:20px}}.coupons-container .container-title-coupons .alert{display:flex;align-items:center;gap:8px;margin-top:16px;padding:4px 8px;color:var(--color-grayScale-darkest);font-size:14px;line-height:18px;font-weight:400}.coupons-container .container-title-coupons .alert.warning{background-color:var(--color-warning-faded)}.coupons-container .container-title-coupons .alert.applied{background-color:var(--color-positiveFeedback-faded)}.coupons-container .container-title-coupons .container-coupons{width:100%;display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:8px}@media (min-width: 640px){.coupons-container .container-title-coupons .container-coupons{grid-template-columns:repeat(2,minmax(0,1fr))}}.coupons-container .container-title-coupons .coupon-wrapper{overflow:hidden}.coupons-container .container-card-coupon{width:100%;height:100%;padding:16px 0 8px;border-radius:8px;box-shadow:inset 0 0 0 1px var(--color-grayScale-light);background:var(--color-grayScale-white)}.coupons-container .container-card-coupon.active{background-color:var(--color-main-faded);box-shadow:inset 0 0 0 2px var(--color-main-light)}.coupons-container .container-card-coupon .card-coupon-content{position:relative;border-bottom:2px dashed var(--color-grayScale-light)}.coupons-container .container-card-coupon.active .card-coupon-content{border-bottom-color:var(--color-main-light)}.container-card-coupon .card-coupon-content .ellipse{position:absolute;bottom:-6px;width:11.51px;height:12px;background-color:var(--color-grayScale-white);box-shadow:inset 0 0 0 1px var(--color-grayScale-light);border-radius:50%}.container-card-coupon .card-coupon-content .ellipse.left{left:-5.755px}.container-card-coupon .card-coupon-content .ellipse.right{right:-5.755px}.container-card-coupon .card-coupon-content .ellipse.applied{box-shadow:inset 0 0 0 2px var(--color-main-light)}.coupons-container .container-card-coupon .text-container{flex:1;display:flex;justify-content:space-between;align-items:flex-start;gap:4px;margin-bottom:30px;padding:0 16px}.coupons-container .container-card-coupon .text-container>div{flex:1;display:flex;flex-direction:column;gap:4px}.coupons-container .container-card-coupon .text-container .select-coupon{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;outline:none;border:2px solid var(--color-grayScale-light);border-radius:50%;padding:0;background-color:var(--color-grayScale-white);cursor:pointer}.coupons-container .container-card-coupon .text-container .select-coupon:disabled{cursor:wait}.coupons-container .container-card-coupon .text-container .select-coupon.applied{border-color:var(--color-main);background:var(--color-main)}.coupons-container .container-card-coupon .text-container .container-title{display:flex;flex-direction:row;align-items:center;gap:4px;margin-bottom:20px}.coupons-container .container-card-coupon .text-container .container-title .title{font-size:16px;line-height:16px;font-weight:700;color:var(--color-grayScale-darkest)}.coupons-container .container-card-coupon .text-container .price-badge{border-radius:24px;padding:3px 9px;background-color:var(--color-badge-main);color:var(--color-badge-secondary);font-size:14px;line-height:18px;font-weight:700}.coupons-container .container-card-coupon .text-container .subtitle{color:var(--color-grayScale-darkest);font-size:14px;line-height:18px;font-weight:400;overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.coupons-container .see-rules{display:flex;align-items:center;justify-content:center;border:none;outline:none;background-color:transparent;padding:12px 16px 0;color:var(--color-main);font-size:12px;line-height:16px;font-weight:500;text-decoration:underline;cursor:pointer}.coupons-container .tooltip-rules{position:absolute;z-index:1;border-radius:8px;padding:16px;background-color:var(--color-infoFeedback-faded)}.coupons-container .tooltip-rules:before{content:"";position:absolute;bottom:100%;left:18px;border-width:8px;border-style:solid;border-color:transparent transparent var(--color-infoFeedback-faded) transparent}.coupons-container .tooltip-rules .tooltip-rules-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.coupons-container .tooltip-rules .tooltip-rules-header h4{color:var(--color-grayScale-darkest);font-size:16px;line-height:24px;font-weight:700}.coupons-container .tooltip-rules .tooltip-rules-header button{display:flex;align-items:center;justify-content:center;outline:none;border:none;padding:0;background-color:transparent;cursor:pointer}.coupons-container .tooltip-rules p{margin-bottom:8px;color:var(--color-grayScale-darkest);font-size:14px;line-height:14px;font-weight:600}.coupons-container .tooltip-rules ul li{color:var(--color-grayScale-darkest);font-size:14px;line-height:16px;font-weight:400}.coupons-container .tooltip-rules ul li:last-child{font-weight:600}.coupons-container .noCoupons{display:flex;flex-direction:column;align-items:center;max-width:400px;justify-self:center}.coupons-container .noCoupons .noCoupons-h3{margin-bottom:24px;color:var(--color-grayScale-darkest);text-align:center;font-weight:700}.coupons-container .noCoupons .noCoupons-p{margin-top:16px;margin-bottom:24px;color:var(--color-grayScale-darkest);text-align:center}