@plurix/ecom-components 1.14.2-commerce.9 → 1.14.2

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 (32) hide show
  1. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -1
  2. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +78 -67
  3. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +6 -15
  4. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -4
  5. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +22 -21
  6. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  7. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -17
  8. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  9. package/dist/packages/Coupons/Coupons.js +67 -57
  10. package/dist/packages/Coupons/api/addCoupon.js +6 -6
  11. package/dist/packages/Coupons/api/getCoupons.js +5 -5
  12. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  13. package/dist/packages/Coupons/components/CouponCard.js +94 -83
  14. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  15. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  16. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +13 -10
  17. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  18. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  19. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  20. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  21. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  22. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  23. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  24. package/dist/packages/Regionalization/Regionalization.js +15 -13
  25. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  26. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  27. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  28. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  29. package/dist/styles/regionalization.global.css +1 -1
  30. package/dist/types/ProductCard.d.ts +13 -12
  31. package/dist/utils/changerOrderModal.js +13 -16
  32. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { SelectedItemProps } from './components/ProductSelected';
3
3
  import { SimilarProducts as SimilarProductsProps } from '../../types/ChangeOrderModal';
4
+ import { GetProductsSimilarsResponse } from './api/getProductsSimilars';
5
+ import { PostChangeOrderMutationResponse } from './api/postChangeOrder';
4
6
 
5
7
  export interface ChangeOrderModalProps {
6
8
  postalCode: string;
@@ -11,8 +13,17 @@ export interface ChangeOrderModalProps {
11
13
  isClubClient?: boolean;
12
14
  orderFormId: string;
13
15
  saveSelectedSimilarProduct?: (similarProduct: SimilarProductsProps | undefined) => void;
16
+ getOrderFormMutation?: (variables: {}) => Promise<CustomDataMutationResponse>;
17
+ getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
18
+ postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>;
19
+ }
20
+ interface CustomDataMutationResponse {
21
+ getOrderForm: {
22
+ data: string;
23
+ };
14
24
  }
15
25
  export interface idSubstitutionCriteriasProps {
16
26
  [key: string]: string;
17
27
  }
18
- export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct, getOrderFormMutation, getProductsSimilarsMutation, postChangeOrderMutation }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -1,105 +1,116 @@
1
- import { jsx as n, jsxs as j, Fragment as q } from "react/jsx-runtime";
2
- import { useState as e, useEffect as w } from "react";
3
- import { Modal as M } from "../Modal/Modal.js";
4
- import { ProductSelected as N } from "./components/ProductSelected.js";
5
- import { SimilarProducts as k } from "./components/SimilarProducts.js";
6
- import { ModalFooter as v } from "./components/ModalFooter.js";
7
- /* empty css */import { getProductsSimilars as A } from "./api/getProductsSimilars.js";
8
- import E from "../../hooks/useAnalitcsEvents.js";
9
- import { NoSimilarProduct as _ } from "./components/NoSimilarProduct.js";
10
- import { getOrderForm as J } from "./api/getOrderForm.js";
11
- import { postChangeOrder as L } from "./api/postChangeOrder.js";
12
- import { Skeleton as T } from "../Skeleton/index.js";
13
- const oo = ({
1
+ import { jsx as a, jsxs as E, Fragment as J } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as M } from "react";
3
+ import { Modal as _ } from "../Modal/Modal.js";
4
+ import { ProductSelected as v } from "./components/ProductSelected.js";
5
+ import { SimilarProducts as L } from "./components/SimilarProducts.js";
6
+ import { ModalFooter as T } from "./components/ModalFooter.js";
7
+ /* empty css */import { getProductsSimilars as $ } from "./api/getProductsSimilars.js";
8
+ import z from "../../hooks/useAnalitcsEvents.js";
9
+ import { NoSimilarProduct as B } from "./components/NoSimilarProduct.js";
10
+ import { getOrderForm as G } from "./api/getOrderForm.js";
11
+ import { postChangeOrder as H } from "./api/postChangeOrder.js";
12
+ import { Skeleton as K } from "../Skeleton/index.js";
13
+ const ao = ({
14
14
  selectedItem: o,
15
15
  postalCode: S,
16
- orderFormId: f,
17
- isClubClient: h,
16
+ orderFormId: d,
17
+ isClubClient: O,
18
18
  isOpen: y,
19
- environment: O,
20
- setIsOpen: l,
21
- saveSelectedSimilarProduct: m
19
+ environment: b,
20
+ setIsOpen: p,
21
+ saveSelectedSimilarProduct: c,
22
+ getOrderFormMutation: l,
23
+ getProductsSimilarsMutation: C,
24
+ postChangeOrderMutation: F
22
25
  }) => {
23
- const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = E(), [r, p] = e({ itemId: "" });
24
- return w(() => {
26
+ const [s, P] = f(), [x, m] = f(!1), r = b === "io", { genericTaggingEvent: N } = z(), [t, g] = f({ itemId: "" });
27
+ M(() => {
25
28
  (async () => {
26
- s(!0);
29
+ m(!0);
27
30
  try {
28
- const t = await A({
31
+ const i = await $({
29
32
  postalCode: S,
30
33
  selectedItem: o,
31
- isIO: a
32
- }), d = (t == null ? void 0 : t.products) || [];
33
- b(d);
34
+ isIO: r,
35
+ getProductsSimilarsMutation: C
36
+ }), u = (i == null ? void 0 : i.products) || [];
37
+ P(u);
34
38
  } finally {
35
- s(!1);
39
+ m(!1);
36
40
  }
37
41
  })(), (async () => {
38
- var t, d;
39
- s(!0);
42
+ var i, u;
43
+ m(!0);
40
44
  try {
41
- const c = await J(f, a), i = ((d = (t = c == null ? void 0 : c.customData) == null ? void 0 : t.customApps) == null ? void 0 : d.find(
42
- (x) => x.id === "janis"
45
+ const q = r && G(d, r), w = l && await l({
46
+ input: {
47
+ orderFormId: d
48
+ }
49
+ }) || { getOrderForm: { data: "" } }, e = r ? q : JSON.parse(w.getOrderForm.data), n = ((u = (i = e == null ? void 0 : e.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
50
+ (A) => A.id === "janis"
43
51
  )) || null;
44
- let g = {};
45
- i != null && i.fields.idSubstitutionCriterias && (g = JSON.parse(
46
- i == null ? void 0 : i.fields.idSubstitutionCriterias
52
+ let h = {};
53
+ n != null && n.fields.idSubstitutionCriterias && (h = JSON.parse(
54
+ n == null ? void 0 : n.fields.idSubstitutionCriterias
47
55
  ));
48
- const F = o == null ? void 0 : o.productOriginId;
49
- p({
50
- itemId: `${g[F]}`
56
+ const k = o == null ? void 0 : o.productOriginId;
57
+ g({
58
+ itemId: `${h[k]}`
51
59
  });
52
60
  } finally {
53
- s(!1);
61
+ m(!1);
54
62
  }
55
63
  })();
56
- }, []), /* @__PURE__ */ n(
57
- M,
64
+ }, []);
65
+ const j = () => {
66
+ H(
67
+ d,
68
+ r,
69
+ o.productOriginId,
70
+ t.itemId,
71
+ F
72
+ ), t && (c == null || c(t), N("salvar_substituto", {
73
+ name: o.name,
74
+ replacement_item: t == null ? void 0 : t.name
75
+ })), p(!1);
76
+ };
77
+ return /* @__PURE__ */ a(
78
+ _,
58
79
  {
59
80
  isOpen: y,
60
- setIsOpen: l,
81
+ setIsOpen: p,
61
82
  className: "change-order-modal",
62
83
  title: "Produto com estoque baixo",
63
- Footer: /* @__PURE__ */ n(
64
- v,
84
+ Footer: s && s.length > 0 && /* @__PURE__ */ a(
85
+ T,
65
86
  {
66
- saveSelectedSimilarProduct: () => {
67
- L(
68
- f,
69
- a,
70
- o.productOriginId,
71
- r.itemId
72
- ), r && (m == null || m(r), C("salvar_substituto", {
73
- name: o.name,
74
- replacement_item: r == null ? void 0 : r.name
75
- })), l(!1);
76
- }
87
+ saveSelectedSimilarProduct: j
77
88
  }
78
89
  ),
79
- children: P ? /* @__PURE__ */ n(
80
- T,
90
+ children: x ? /* @__PURE__ */ a(
91
+ K,
81
92
  {
82
- width: a ? "100%" : "90%",
83
- height: a ? 600 : 425,
93
+ width: r ? "100%" : "90%",
94
+ height: r ? 600 : 425,
84
95
  backgroundColor: "var(--color-grayScale-faded)",
85
96
  margin: "auto",
86
97
  animation: !0
87
98
  }
88
- ) : /* @__PURE__ */ j(q, { children: [
89
- o && /* @__PURE__ */ n(N, { selectedItem: o }),
90
- u && u.length > 0 ? /* @__PURE__ */ n(
91
- k,
99
+ ) : /* @__PURE__ */ E(J, { children: [
100
+ o && /* @__PURE__ */ a(v, { selectedItem: o }),
101
+ s && s.length > 0 ? /* @__PURE__ */ a(
102
+ L,
92
103
  {
93
- isClubClient: h,
94
- similarProductSelect: r,
95
- setSimilarProductSelect: p,
96
- products: u
104
+ isClubClient: O,
105
+ similarProductSelect: t,
106
+ setSimilarProductSelect: g,
107
+ products: s
97
108
  }
98
- ) : /* @__PURE__ */ n(_, {})
109
+ ) : /* @__PURE__ */ a(B, {})
99
110
  ] })
100
111
  }
101
112
  );
102
113
  };
103
114
  export {
104
- oo as ChangeOrderModal
115
+ ao as ChangeOrderModal
105
116
  };
@@ -1,21 +1,12 @@
1
- import o from "axios";
2
- const c = async (t, a) => {
1
+ import e from "axios";
2
+ const c = async (o, t) => {
3
3
  try {
4
- if (a) {
5
- const { data: e } = await o.post(
6
- `/api/checkout/pub/orderForm/${t}`
4
+ if (t) {
5
+ const { data: r } = await e.post(
6
+ `/api/checkout/pub/orderForm/${o}`
7
7
  );
8
- return e;
8
+ return r;
9
9
  }
10
- const { data: r } = await o.post("/_v/faststoreapi/proxy", {
11
- targetUrl: `/api/checkout/pub/orderForm/${t}`,
12
- method: "GET",
13
- headers: {
14
- "Content-Type": "application/json",
15
- Accept: "application/json"
16
- }
17
- });
18
- return r;
19
10
  } catch (r) {
20
11
  console.error("Error in Change Order Modal", r);
21
12
  }
@@ -4,9 +4,12 @@ interface GetProductsSimilarsProps {
4
4
  postalCode: string;
5
5
  isIO: boolean;
6
6
  selectedItem: SelectedItemProps;
7
+ getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
7
8
  }
8
- export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem }: GetProductsSimilarsProps) => Promise<{
9
- productOrigin: string;
10
- products: import('../../../main').SimilarProducts[];
11
- } | undefined>;
9
+ export interface GetProductsSimilarsResponse {
10
+ getProductsSimilars: {
11
+ data: string;
12
+ };
13
+ }
14
+ export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem, getProductsSimilarsMutation }: GetProductsSimilarsProps) => Promise<any>;
12
15
  export {};
@@ -1,33 +1,34 @@
1
- import n from "axios";
2
- const f = async ({
3
- postalCode: a,
4
- isIO: s,
5
- selectedItem: r
1
+ import c from "axios";
2
+ const P = async ({
3
+ postalCode: n,
4
+ isIO: u,
5
+ selectedItem: r,
6
+ getProductsSimilarsMutation: a
6
7
  }) => {
7
8
  try {
8
- if (s) {
9
- const { data: o } = await n.get(
10
- `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
11
- ), { similarProducts: u } = o;
12
- return u.find(
13
- (c) => c.productOrigin === (r == null ? void 0 : r.productOriginId)
9
+ if (u) {
10
+ const { data: o } = await c.get(
11
+ `/_v/commerce/products/productsSimilar?postalCode=${n}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
12
+ ), { similarProducts: p } = o;
13
+ return p.find(
14
+ (s) => s.productOrigin === (r == null ? void 0 : r.productOriginId)
14
15
  );
15
16
  }
16
- const { data: i } = await n.post("/_v/faststoreapi/proxy", {
17
- targetUrl: `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
18
- method: "GET",
19
- headers: {
20
- "Content-Type": "application/json",
21
- Accept: "application/json"
17
+ const i = a && await a({
18
+ input: {
19
+ postalCode: n,
20
+ productOriginId: r == null ? void 0 : r.productOriginId
22
21
  }
23
- }), { similarProducts: p } = i;
24
- return p.find(
22
+ });
23
+ return i ? JSON.parse(
24
+ i == null ? void 0 : i.getProductsSimilars.data
25
+ ).similarProducts.find(
25
26
  (o) => o.productOrigin === r.productOriginId
26
- );
27
+ ) : void 0;
27
28
  } catch (i) {
28
29
  console.error("Error in Change Order Modal", i);
29
30
  }
30
31
  };
31
32
  export {
32
- f as getProductsSimilars
33
+ P as getProductsSimilars
33
34
  };
@@ -1 +1,6 @@
1
- export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string) => Promise<any>;
1
+ export interface PostChangeOrderMutationResponse {
2
+ postChangeOrder: {
3
+ data: string;
4
+ };
5
+ }
6
+ export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string, postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>) => Promise<any>;
@@ -1,28 +1,22 @@
1
- import o from "axios";
2
- const p = async (e, t, a, n) => {
1
+ import s from "axios";
2
+ const p = async (o, e, n, c, t) => {
3
3
  try {
4
4
  const r = {
5
- orderFormId: e,
6
- skuId: a,
7
- substitutionId: n
5
+ orderFormId: o,
6
+ skuId: n,
7
+ substitutionId: c
8
8
  };
9
- if (t) {
10
- const { data: s } = await o.post(
9
+ if (e) {
10
+ const { data: d } = await s.post(
11
11
  "/_v/commerce/orderform/changeOrder",
12
12
  r
13
13
  );
14
- return s;
14
+ return d;
15
15
  }
16
- const { data: c } = await o.post("/_v/faststoreapi/proxy", {
17
- targetUrl: "/_v/commerce/orderform/changeOrder",
18
- method: "POST",
19
- headers: {
20
- "Content-Type": "application/json",
21
- Accept: "application/json"
22
- },
23
- body: r
16
+ const a = t && await t({
17
+ input: r
24
18
  });
25
- return c;
19
+ return a ? JSON.parse(a == null ? void 0 : a.postChangeOrder.data) : void 0;
26
20
  } catch (r) {
27
21
  console.error("Error in Change Order Modal", r);
28
22
  }
@@ -12,6 +12,9 @@ interface CouponsProps {
12
12
  disableFirstEmptyModal?: boolean;
13
13
  couponsList?: CouponType[];
14
14
  qtdCouponsView?: number;
15
+ getCouponsMutation?: any;
16
+ addCouponMutation?: any;
17
+ removeCouponMutation?: any;
15
18
  }
16
- export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView, getCouponsMutation, addCouponMutation, removeCouponMutation }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
17
20
  export {};
@@ -1,103 +1,113 @@
1
- import { jsx as t, jsxs as B } from "react/jsx-runtime";
2
- import { useState as e, useEffect as S } from "react";
3
- import { getCoupons as E } from "./api/getCoupons.js";
4
- import { LoadingView as G } from "./views/LoadingView.js";
5
- import { CouponsView as H } from "./views/CouponsView.js";
6
- import { RulesView as K } from "./views/RulesView.js";
7
- import { OverwriteView as P } from "./views/OverwriteView.js";
8
- import { EmptyCartView as Q } from "./views/EmptyCartView.js";
9
- /* empty css */const I = ({
10
- orderFormId: h,
11
- hasItemsInCart: a,
12
- builder: j,
13
- account: f,
1
+ import { jsx as t, jsxs as P } from "react/jsx-runtime";
2
+ import { useState as e, useEffect as j } from "react";
3
+ import { LoadingView as Q } from "./views/LoadingView.js";
4
+ import { CouponsView as U } from "./views/CouponsView.js";
5
+ import { RulesView as W } from "./views/RulesView.js";
6
+ import { OverwriteView as X } from "./views/OverwriteView.js";
7
+ import { EmptyCartView as Y } from "./views/EmptyCartView.js";
8
+ import { getCoupons as Z } from "./api/getCoupons.js";
9
+ /* empty css */const eo = ({
10
+ orderFormId: A,
11
+ hasItemsInCart: f,
12
+ builder: l,
13
+ account: w,
14
14
  isIO: o = !1,
15
15
  closeIOModal: r,
16
16
  activeOrderFormCoupon: n,
17
17
  genericTaggingEvent: s,
18
- disableFirstEmptyModal: A,
19
- couponsList: l,
20
- qtdCouponsView: w
18
+ disableFirstEmptyModal: J,
19
+ couponsList: p,
20
+ qtdCouponsView: C,
21
+ getCouponsMutation: q,
22
+ addCouponMutation: D,
23
+ removeCouponMutation: L
21
24
  }) => {
22
- const [L, C] = e(!0), [q, p] = e([]), [u, c] = e("coupons-view"), [D, y] = e(!1), [N, d] = e(!1), [v, R] = e(""), [m, V] = e(""), [J, x] = e(
23
- !A
24
- ), [b, k] = e();
25
- return S(() => {
26
- n && R(n);
27
- }, [n]), S(() => {
25
+ const [k, N] = e(!0), [z, a] = e([]), [u, c] = e("coupons-view"), [B, d] = e(!1), [y, v] = e(!1), [R, V] = e(""), [m, S] = e(""), [E, x] = e(
26
+ !J
27
+ ), [G, H] = e();
28
+ return j(() => {
29
+ n && V(n);
30
+ }, [n]), j(() => {
28
31
  (async () => {
29
- C(!0);
32
+ N(!0);
30
33
  try {
31
- const i = await E(f, j, l);
32
- if (w) {
33
- const z = i.slice(0, w);
34
- p(z);
34
+ const i = o ? await Z(w, l, p) : await q({
35
+ input: {
36
+ builder: l,
37
+ couponsList: p
38
+ }
39
+ }), h = o ? i : JSON.parse(i.getCoupons.data).coupons;
40
+ if (C) {
41
+ const K = h.slice(0, C);
42
+ a(K);
35
43
  return;
36
44
  }
37
- p(i);
45
+ a(h);
38
46
  return;
39
47
  } catch (i) {
40
- p([]);
48
+ a([]);
41
49
  } finally {
42
- C(!1);
50
+ N(!1);
43
51
  }
44
52
  })();
45
- }, [JSON.stringify(l)]), L ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
46
- G,
53
+ }, [JSON.stringify(p)]), k ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
54
+ Q,
47
55
  {
48
56
  isIO: o,
49
57
  closeIOModal: r,
50
58
  genericTaggingEvent: s
51
59
  }
52
- ) }) : /* @__PURE__ */ B("div", { className: "coupons-container", children: [
60
+ ) }) : /* @__PURE__ */ P("div", { className: "coupons-container", children: [
53
61
  (!o || o && u === "coupons-view") && /* @__PURE__ */ t(
54
- H,
62
+ U,
55
63
  {
56
- orderFormId: h,
57
- hasItemsInCart: a,
58
- account: f,
64
+ removeCouponMutation: L,
65
+ addCouponMutation: D,
66
+ orderFormId: A,
67
+ hasItemsInCart: f,
68
+ account: w,
59
69
  isIO: o,
60
70
  closeIOModal: r,
61
- coupons: q,
62
- firstCouponName: v,
71
+ coupons: z,
72
+ firstCouponName: R,
63
73
  secondCouponName: m,
64
- replaceCoupon: N,
74
+ replaceCoupon: y,
65
75
  setView: c,
66
- setFirstCouponName: R,
67
- setSecondCouponName: V,
68
- setActiveRule: y,
69
- setDataItem: k,
70
- setReplaceCoupon: d,
76
+ setFirstCouponName: V,
77
+ setSecondCouponName: S,
78
+ setActiveRule: d,
79
+ setDataItem: H,
80
+ setReplaceCoupon: v,
71
81
  setIsCloseModalEmpty: x,
72
82
  genericTaggingEvent: s
73
83
  }
74
84
  ),
75
- (!o || o && u === "rules-view") && D && /* @__PURE__ */ t(
76
- K,
85
+ (!o || o && u === "rules-view") && B && /* @__PURE__ */ t(
86
+ W,
77
87
  {
78
- dataItem: b,
79
- setActiveRule: y,
88
+ dataItem: G,
89
+ setActiveRule: d,
80
90
  setView: c,
81
91
  isIO: o,
82
92
  closeIOModal: r,
83
93
  genericTaggingEvent: s
84
94
  }
85
95
  ),
86
- (!o || o && u === "overwrite-view") && m && !N && /* @__PURE__ */ t(
87
- P,
96
+ (!o || o && u === "overwrite-view") && m && !y && /* @__PURE__ */ t(
97
+ X,
88
98
  {
89
- firstCouponName: v,
99
+ firstCouponName: R,
90
100
  secondCouponName: m,
91
101
  setView: c,
92
- setReplaceCoupon: d,
93
- setSecondCouponName: V,
102
+ setReplaceCoupon: v,
103
+ setSecondCouponName: S,
94
104
  isIO: o,
95
105
  closeIOModal: r,
96
106
  genericTaggingEvent: s
97
107
  }
98
108
  ),
99
- !a && J && /* @__PURE__ */ t(
100
- Q,
109
+ !f && E && /* @__PURE__ */ t(
110
+ Y,
101
111
  {
102
112
  setIsCloseModalEmpty: x,
103
113
  genericTaggingEvent: s
@@ -106,5 +116,5 @@ import { EmptyCartView as Q } from "./views/EmptyCartView.js";
106
116
  ] });
107
117
  };
108
118
  export {
109
- I as Coupons
119
+ eo as Coupons
110
120
  };
@@ -1,14 +1,14 @@
1
- import s from "axios";
2
- const n = async (o, t, a) => {
3
- const { data: r } = await s.post(
4
- `https://${o}.myvtex.com/_v/faststoreapi/coupon/order`,
1
+ import r from "axios";
2
+ const s = async (o, t, a) => {
3
+ const { data: p } = await r.post(
4
+ `https://${o}.vtex.app/api/coupon/order`,
5
5
  {
6
6
  orderFormId: t,
7
7
  couponId: a
8
8
  }
9
9
  );
10
- return r;
10
+ return p;
11
11
  };
12
12
  export {
13
- n as addCoupon
13
+ s as addCoupon
14
14
  };
@@ -1,8 +1,8 @@
1
- import a from "axios";
2
- const m = async (s, n, t) => {
3
- const o = `https://${s}.myvtex.com/_v/faststoreapi/coupon/list`, r = Math.random(), { data: p } = t ? await a.post(o, { couponsList: t }) : await a.get(o, { params: { builder: n, random: r } });
4
- return p.coupons;
1
+ import o from "axios";
2
+ const e = async (n, p, t) => {
3
+ const a = `https://${n}.vtex.app/api/coupon/list`, s = Math.random(), { data: r } = t ? await o.post(a, { couponsList: t }) : await o.get(a, { params: { builder: p, random: s } });
4
+ return r.coupons;
5
5
  };
6
6
  export {
7
- m as getCoupons
7
+ e as getCoupons
8
8
  };
@@ -21,5 +21,7 @@ export interface CouponCardProps {
21
21
  setType: (type: AlertType) => void;
22
22
  setIsCloseModalEmpty: (isCloseModalEmpty: boolean) => void;
23
23
  genericTaggingEvent?: (name: string, params: object) => void;
24
+ addCouponMutation?: any;
25
+ removeCouponMutation?: any;
24
26
  }
25
- export declare const CouponCard: ({ account, orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const CouponCard: ({ account, orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent, addCouponMutation, removeCouponMutation }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;