@instockng/storefront-ui 1.0.27 → 1.0.29

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 (231) hide show
  1. package/dist/components/Checkout.d.ts.map +1 -1
  2. package/dist/components/ShoppingCart.d.ts +3 -1
  3. package/dist/components/ShoppingCart.d.ts.map +1 -1
  4. package/dist/contexts/CartContext.d.ts.map +1 -1
  5. package/dist/index10.mjs +39 -38
  6. package/dist/index100.mjs +13 -15
  7. package/dist/index101.mjs +16 -27
  8. package/dist/index102.mjs +26 -20
  9. package/dist/index103.mjs +151 -14
  10. package/dist/index104.mjs +13 -14
  11. package/dist/index105.mjs +23 -39
  12. package/dist/index106.mjs +76 -15
  13. package/dist/index107.mjs +33 -263
  14. package/dist/index108.mjs +138 -63
  15. package/dist/index109.mjs +54 -7
  16. package/dist/index110.mjs +23 -2
  17. package/dist/index111.mjs +27 -2
  18. package/dist/index112.mjs +19 -29
  19. package/dist/index113.mjs +25 -2
  20. package/dist/index114.mjs +18 -232
  21. package/dist/index115.mjs +21 -5
  22. package/dist/index116.mjs +17 -130
  23. package/dist/index117.mjs +64 -67
  24. package/dist/index118.mjs +16 -85
  25. package/dist/index119.mjs +38 -28
  26. package/dist/index12.mjs +171 -167
  27. package/dist/index120.mjs +23 -8
  28. package/dist/index121.mjs +31 -72
  29. package/dist/index122.mjs +26 -3
  30. package/dist/index123.mjs +19 -2
  31. package/dist/index124.mjs +19 -81
  32. package/dist/index125.mjs +46 -53
  33. package/dist/index126.mjs +22 -5
  34. package/dist/index127.mjs +267 -4
  35. package/dist/index128.mjs +62 -171
  36. package/dist/index129.mjs +8 -53
  37. package/dist/index130.mjs +2 -69
  38. package/dist/index131.mjs +2 -34
  39. package/dist/index132.mjs +32 -42
  40. package/dist/index133.mjs +2 -2
  41. package/dist/index134.mjs +21 -2
  42. package/dist/index135.mjs +56 -2
  43. package/dist/index136.mjs +29 -2
  44. package/dist/index137.mjs +7 -2
  45. package/dist/index138.mjs +50 -16
  46. package/dist/index139.mjs +6 -32
  47. package/dist/index140.mjs +11 -37
  48. package/dist/index141.mjs +7 -18
  49. package/dist/index142.mjs +28 -18
  50. package/dist/index143.mjs +2 -2
  51. package/dist/index144.mjs +70 -20
  52. package/dist/index145.mjs +163 -42
  53. package/dist/index147.mjs +2 -30
  54. package/dist/index148.mjs +2 -18
  55. package/dist/index149.mjs +2 -2
  56. package/dist/index150.mjs +18 -2
  57. package/dist/index151.mjs +32 -2
  58. package/dist/index152.mjs +38 -2
  59. package/dist/index153.mjs +13 -67
  60. package/dist/index154.mjs +18 -2
  61. package/dist/index155.mjs +2 -53
  62. package/dist/index156.mjs +20 -2
  63. package/dist/index157.mjs +39 -29
  64. package/dist/index158.mjs +2 -152
  65. package/dist/index159.mjs +30 -2
  66. package/dist/index160.mjs +18 -2
  67. package/dist/index161.mjs +2 -19
  68. package/dist/index162.mjs +2 -2
  69. package/dist/index163.mjs +2 -2
  70. package/dist/index164.mjs +2 -26
  71. package/dist/index165.mjs +72 -2
  72. package/dist/index166.mjs +2 -2
  73. package/dist/index167.mjs +49 -20
  74. package/dist/index168.mjs +2 -23
  75. package/dist/index169.mjs +36 -2
  76. package/dist/index170.mjs +152 -2
  77. package/dist/index171.mjs +2 -2
  78. package/dist/index172.mjs +2 -23
  79. package/dist/index173.mjs +19 -2
  80. package/dist/index174.mjs +2 -23
  81. package/dist/index176.mjs +26 -2
  82. package/dist/index177.mjs +2 -2
  83. package/dist/index178.mjs +2 -23
  84. package/dist/index179.mjs +24 -2
  85. package/dist/index180.mjs +15 -15
  86. package/dist/index181.mjs +2 -2
  87. package/dist/index182.mjs +2 -2
  88. package/dist/index183.mjs +2 -2
  89. package/dist/index184.mjs +23 -2
  90. package/dist/index185.mjs +2 -2
  91. package/dist/index186.mjs +23 -2
  92. package/dist/index187.mjs +2 -2
  93. package/dist/index188.mjs +2 -2
  94. package/dist/index189.mjs +2 -127
  95. package/dist/index19.mjs +26 -13
  96. package/dist/index190.mjs +23 -2
  97. package/dist/index191.mjs +2 -74
  98. package/dist/index192.mjs +20 -71
  99. package/dist/index193.mjs +2 -21
  100. package/dist/index194.mjs +2 -56
  101. package/dist/index195.mjs +2 -29
  102. package/dist/index196.mjs +2 -7
  103. package/dist/index197.mjs +2 -52
  104. package/dist/index198.mjs +2 -6
  105. package/dist/index199.mjs +2 -12
  106. package/dist/index200.mjs +2 -7
  107. package/dist/index201.mjs +127 -28
  108. package/dist/index202.mjs +2 -2
  109. package/dist/index203.mjs +73 -69
  110. package/dist/index204.mjs +71 -164
  111. package/dist/index205.mjs +31 -2
  112. package/dist/index206.mjs +11 -2
  113. package/dist/index207.mjs +4 -2
  114. package/dist/index208.mjs +4 -2
  115. package/dist/index209.mjs +13 -108
  116. package/dist/index210.mjs +7 -2
  117. package/dist/index211.mjs +12 -2
  118. package/dist/index212.mjs +5 -2
  119. package/dist/index213.mjs +33 -2
  120. package/dist/index214.mjs +31 -2
  121. package/dist/index215.mjs +28 -2
  122. package/dist/index216.mjs +61 -2
  123. package/dist/index217.mjs +2 -244
  124. package/dist/index218.mjs +2 -2
  125. package/dist/index219.mjs +2 -33
  126. package/dist/index220.mjs +2 -65
  127. package/dist/index221.mjs +2 -25
  128. package/dist/index223.mjs +2 -37
  129. package/dist/index225.mjs +37 -2
  130. package/dist/index226.mjs +2 -2
  131. package/dist/index227.mjs +108 -2
  132. package/dist/index229.mjs +2 -2
  133. package/dist/index232.mjs +244 -2
  134. package/dist/index233.mjs +2 -4
  135. package/dist/index234.mjs +33 -2
  136. package/dist/index235.mjs +65 -2
  137. package/dist/index236.mjs +25 -13
  138. package/dist/index237.mjs +2 -7
  139. package/dist/index238.mjs +2 -31
  140. package/dist/index239.mjs +2 -11
  141. package/dist/index240.mjs +2 -4
  142. package/dist/index241.mjs +2 -4
  143. package/dist/index242.mjs +2 -12
  144. package/dist/index243.mjs +2 -5
  145. package/dist/index244.mjs +2 -33
  146. package/dist/index245.mjs +2 -31
  147. package/dist/index246.mjs +2 -28
  148. package/dist/index247.mjs +4 -61
  149. package/dist/index248.mjs +3 -2
  150. package/dist/index249.mjs +2 -2
  151. package/dist/index250.mjs +2 -2
  152. package/dist/index251.mjs +16 -17
  153. package/dist/index252.mjs +12 -46
  154. package/dist/index253.mjs +6 -2
  155. package/dist/index254.mjs +30 -2
  156. package/dist/index255.mjs +2 -2
  157. package/dist/index256.mjs +16 -89
  158. package/dist/index257.mjs +47 -2
  159. package/dist/index258.mjs +2 -3
  160. package/dist/index259.mjs +2 -2
  161. package/dist/index260.mjs +2 -2
  162. package/dist/index261.mjs +2 -17
  163. package/dist/index262.mjs +2 -13
  164. package/dist/index263.mjs +91 -6
  165. package/dist/index264.mjs +2 -30
  166. package/dist/index3.mjs +95 -105
  167. package/dist/index32.mjs +1 -1
  168. package/dist/index33.mjs +1 -1
  169. package/dist/index34.mjs +1 -1
  170. package/dist/index35.mjs +1 -1
  171. package/dist/index36.mjs +1 -1
  172. package/dist/index37.mjs +1 -1
  173. package/dist/index38.mjs +2 -2
  174. package/dist/index39.mjs +3 -3
  175. package/dist/index42.mjs +1 -1
  176. package/dist/index47.mjs +17 -17
  177. package/dist/index48.mjs +2 -2
  178. package/dist/index49.mjs +1 -1
  179. package/dist/index50.mjs +1 -1
  180. package/dist/index51.mjs +1 -1
  181. package/dist/index52.mjs +1 -1
  182. package/dist/index53.mjs +1 -1
  183. package/dist/index54.mjs +1 -1
  184. package/dist/index55.mjs +1 -1
  185. package/dist/index56.mjs +1 -1
  186. package/dist/index57.mjs +1 -1
  187. package/dist/index58.mjs +1 -1
  188. package/dist/index59.mjs +1 -1
  189. package/dist/index60.mjs +20 -21
  190. package/dist/index61.mjs +21 -150
  191. package/dist/index63.mjs +149 -19
  192. package/dist/index64.mjs +4 -74
  193. package/dist/index65.mjs +74 -14
  194. package/dist/index66.mjs +14 -62
  195. package/dist/index67.mjs +62 -4
  196. package/dist/index70.mjs +35 -35
  197. package/dist/index71.mjs +1 -1
  198. package/dist/index72.mjs +2 -2
  199. package/dist/index73.mjs +2 -2
  200. package/dist/index75.mjs +235 -2
  201. package/dist/index76.mjs +5 -27
  202. package/dist/index77.mjs +130 -14
  203. package/dist/index78.mjs +67 -214
  204. package/dist/index79.mjs +82 -175
  205. package/dist/index80.mjs +28 -21
  206. package/dist/index81.mjs +8 -22
  207. package/dist/index82.mjs +72 -30
  208. package/dist/index83.mjs +3 -155
  209. package/dist/index84.mjs +2 -20
  210. package/dist/index85.mjs +81 -29
  211. package/dist/index86.mjs +53 -83
  212. package/dist/index87.mjs +5 -37
  213. package/dist/index88.mjs +4 -144
  214. package/dist/index89.mjs +173 -49
  215. package/dist/index90.mjs +53 -23
  216. package/dist/index91.mjs +69 -27
  217. package/dist/index92.mjs +34 -23
  218. package/dist/index93.mjs +42 -24
  219. package/dist/index94.mjs +2 -21
  220. package/dist/index95.mjs +2 -22
  221. package/dist/index96.mjs +26 -19
  222. package/dist/index97.mjs +11 -58
  223. package/dist/index98.mjs +210 -13
  224. package/dist/index99.mjs +173 -32
  225. package/dist/lib/utils.d.ts +8 -0
  226. package/dist/lib/utils.d.ts.map +1 -1
  227. package/package.json +1 -1
  228. package/src/components/Checkout.tsx +11 -1
  229. package/src/components/ShoppingCart.tsx +5 -2
  230. package/src/contexts/CartContext.tsx +2 -20
  231. package/src/lib/utils.ts +20 -0
package/dist/index263.mjs CHANGED
@@ -1,9 +1,94 @@
1
1
  'use client';
2
- import o from "./index200.mjs";
3
- const n = o.hasStandardBrowserEnv ? /* @__PURE__ */ ((r, e) => (t) => (t = new URL(t, o.origin), r.protocol === t.protocol && r.host === t.host && (e || r.port === t.port)))(
4
- new URL(o.origin),
5
- o.navigator && /(msie|trident)/i.test(o.navigator.userAgent)
6
- ) : () => !0;
2
+ import { __module as c } from "./index267.mjs";
3
+ var l;
4
+ function T() {
5
+ return l ? c.exports : (l = 1, (() => {
6
+ typeof __nccwpck_require__ < "u" && (__nccwpck_require__.ab = __dirname + "/");
7
+ var m = {};
8
+ (() => {
9
+ var v = m;
10
+ /*!
11
+ * cookie
12
+ * Copyright(c) 2012-2014 Roman Shtylman
13
+ * Copyright(c) 2015 Douglas Christopher Wilson
14
+ * MIT Licensed
15
+ */
16
+ v.parse = S, v.serialize = x;
17
+ var w = decodeURIComponent, h = encodeURIComponent, y = /; */, f = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
18
+ function S(i, n) {
19
+ if (typeof i != "string")
20
+ throw new TypeError("argument str must be a string");
21
+ for (var a = {}, e = n || {}, o = i.split(y), s = e.decode || w, r = 0; r < o.length; r++) {
22
+ var t = o[r], p = t.indexOf("=");
23
+ if (!(p < 0)) {
24
+ var d = t.substr(0, p).trim(), u = t.substr(++p, t.length).trim();
25
+ u[0] == '"' && (u = u.slice(1, -1)), a[d] == null && (a[d] = _(u, s));
26
+ }
27
+ }
28
+ return a;
29
+ }
30
+ function x(i, n, a) {
31
+ var e = a || {}, o = e.encode || h;
32
+ if (typeof o != "function")
33
+ throw new TypeError("option encode is invalid");
34
+ if (!f.test(i))
35
+ throw new TypeError("argument name is invalid");
36
+ var s = o(n);
37
+ if (s && !f.test(s))
38
+ throw new TypeError("argument val is invalid");
39
+ var r = i + "=" + s;
40
+ if (e.maxAge != null) {
41
+ var t = e.maxAge - 0;
42
+ if (isNaN(t) || !isFinite(t))
43
+ throw new TypeError("option maxAge is invalid");
44
+ r += "; Max-Age=" + Math.floor(t);
45
+ }
46
+ if (e.domain) {
47
+ if (!f.test(e.domain))
48
+ throw new TypeError("option domain is invalid");
49
+ r += "; Domain=" + e.domain;
50
+ }
51
+ if (e.path) {
52
+ if (!f.test(e.path))
53
+ throw new TypeError("option path is invalid");
54
+ r += "; Path=" + e.path;
55
+ }
56
+ if (e.expires) {
57
+ if (typeof e.expires.toUTCString != "function")
58
+ throw new TypeError("option expires is invalid");
59
+ r += "; Expires=" + e.expires.toUTCString();
60
+ }
61
+ if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite) {
62
+ var p = typeof e.sameSite == "string" ? e.sameSite.toLowerCase() : e.sameSite;
63
+ switch (p) {
64
+ case !0:
65
+ r += "; SameSite=Strict";
66
+ break;
67
+ case "lax":
68
+ r += "; SameSite=Lax";
69
+ break;
70
+ case "strict":
71
+ r += "; SameSite=Strict";
72
+ break;
73
+ case "none":
74
+ r += "; SameSite=None";
75
+ break;
76
+ default:
77
+ throw new TypeError("option sameSite is invalid");
78
+ }
79
+ }
80
+ return r;
81
+ }
82
+ function _(i, n) {
83
+ try {
84
+ return n(i);
85
+ } catch {
86
+ return i;
87
+ }
88
+ }
89
+ })(), c.exports = m;
90
+ })(), c.exports);
91
+ }
7
92
  export {
8
- n as default
93
+ T as __require
9
94
  };
package/dist/index264.mjs CHANGED
@@ -1,33 +1,5 @@
1
1
  'use client';
2
- import r from "./index114.mjs";
3
- import c from "./index200.mjs";
4
- const p = c.hasStandardBrowserEnv ? (
5
- // Standard browser envs support document.cookie
6
- {
7
- write(e, t, n, i, s, u) {
8
- const o = [e + "=" + encodeURIComponent(t)];
9
- r.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), r.isString(i) && o.push("path=" + i), r.isString(s) && o.push("domain=" + s), u === !0 && o.push("secure"), document.cookie = o.join("; ");
10
- },
11
- read(e) {
12
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
13
- return t ? decodeURIComponent(t[3]) : null;
14
- },
15
- remove(e) {
16
- this.write(e, "", Date.now() - 864e5);
17
- }
18
- }
19
- ) : (
20
- // Non-standard browser env (web workers, react-native) lack needed support.
21
- {
22
- write() {
23
- },
24
- read() {
25
- return null;
26
- },
27
- remove() {
28
- }
29
- }
30
- );
2
+ const e = {};
31
3
  export {
32
- p as default
4
+ e as default
33
5
  };
package/dist/index3.mjs CHANGED
@@ -1,170 +1,160 @@
1
1
  'use client';
2
- import { jsxs as nt, jsx as ct } from "react/jsx-runtime";
3
- import { createContext as st, useState as k, useRef as S, useCallback as o, useEffect as d, useContext as at } from "react";
2
+ import { jsxs as ot, jsx as nt } from "react/jsx-runtime";
3
+ import { createContext as ct, useState as A, useRef as M, useEffect as f, useCallback as o, useContext as st } from "react";
4
4
  import "./index20.mjs";
5
- import { useGetCart as ut, useCreateCart as it, useAddCartItem as ft, useUpdateCartItem as dt, useRemoveCartItem as mt, useApplyDiscount as lt, useRemoveDiscount as pt, useUpdateCart as Ct, useCheckoutCart as wt } from "./index32.mjs";
5
+ import { useGetCart as at, useCreateCart as ut, useAddCartItem as it, useUpdateCartItem as mt, useRemoveCartItem as ft, useApplyDiscount as dt, useRemoveDiscount as lt, useUpdateCart as Ct, useCheckoutCart as wt } from "./index32.mjs";
6
6
  import "@tanstack/react-query";
7
7
  import { ShoppingCart as It } from "./index10.mjs";
8
- import { useMetaPixel as ht } from "./index4.mjs";
9
- const m = "oms_cart_id", U = st(null);
10
- function Mt({ children: l, brandSlug: u, initialCartId: p, shoppingCartProps: L }) {
11
- const [t, i] = k(p || null), [A, M] = k(!1), [j, O] = k(!1), _ = S(!1), E = S(!1), I = S(!1), { trackAddToCart: h, trackInitiateCheckout: b } = ht(), x = o(() => {
12
- if (typeof document > "u") return { fbc: void 0, fbp: void 0 };
13
- const e = (r) => {
14
- var n;
15
- const s = `; ${document.cookie}`.split(`; ${r}=`);
16
- if (s.length === 2) return (n = s.pop()) == null ? void 0 : n.split(";").shift();
17
- };
18
- return {
19
- fbc: e("_fbc"),
20
- fbp: e("_fbp")
21
- };
22
- }, []);
23
- d(() => {
24
- O(!0);
25
- }, []), d(() => {
26
- if (p || _.current) return;
27
- _.current = !0;
8
+ import { useMetaPixel as pt } from "./index4.mjs";
9
+ import { getFbCookies as ht } from "./index19.mjs";
10
+ const d = "oms_cart_id", b = ct(null);
11
+ function Et({ children: l, brandSlug: a, initialCartId: C, shoppingCartProps: L }) {
12
+ const [t, u] = A(C || null), [g, k] = A(!1), [$, j] = A(!1), E = M(!1), _ = M(!1), p = M(!1), { trackAddToCart: h, trackInitiateCheckout: x } = pt();
13
+ f(() => {
14
+ j(!0);
15
+ }, []), f(() => {
16
+ if (C || E.current) return;
17
+ E.current = !0;
28
18
  const r = new URLSearchParams(window.location.search).get("cartId");
29
19
  if (r) {
30
- i(r);
20
+ u(r);
31
21
  return;
32
22
  }
33
- const c = localStorage.getItem(m);
34
- c && i(c);
35
- }, [p]);
36
- const { data: f, isLoading: G, error: C, refetch: a } = ut(t || "", {
23
+ const c = localStorage.getItem(d);
24
+ c && u(c);
25
+ }, [C]);
26
+ const { data: i, isLoading: O, error: w, refetch: n } = at(t || "", {
37
27
  enabled: !!t,
38
28
  retry: !1
39
29
  // Don't retry on failure - cart might be invalid/expired
40
- }), v = it({
30
+ }), y = ut({
41
31
  onSuccess: (e) => {
42
32
  if ("error" in e) {
43
33
  console.error("Failed to create cart:", e.error);
44
34
  return;
45
35
  }
46
- i(e.id);
36
+ u(e.id);
47
37
  },
48
38
  onError: (e) => {
49
39
  console.error("Failed to create cart:", e);
50
40
  },
51
41
  retry: 10
52
42
  });
53
- d(() => {
54
- if (E.current) return;
55
- E.current = !0;
43
+ f(() => {
44
+ if (_.current) return;
45
+ _.current = !0;
56
46
  const e = setTimeout(() => {
57
- !(typeof window < "u" ? localStorage.getItem(m) : null) && !p && v.mutate(u);
47
+ !(typeof window < "u" ? localStorage.getItem(d) : null) && !C && y.mutate(a);
58
48
  }, 150);
59
49
  return () => clearTimeout(e);
60
- }, []), d(() => {
61
- C && t && !I.current && (I.current = !0, console.warn("Cart fetch failed, creating new cart:", C), i(null), typeof window < "u" && localStorage.removeItem(m), setTimeout(() => {
62
- v.mutate(u), I.current = !1;
50
+ }, []), f(() => {
51
+ w && t && !p.current && (p.current = !0, console.warn("Cart fetch failed, creating new cart:", w), u(null), typeof window < "u" && localStorage.removeItem(d), setTimeout(() => {
52
+ y.mutate(a), p.current = !1;
63
53
  }, 100));
64
- }, [C, t, u]);
65
- const H = ft(t || "", {
66
- onSuccess: () => a()
67
- }), K = dt(t || "", {
68
- onSuccess: () => a()
69
- }), Y = mt(t || "", {
70
- onSuccess: () => a()
54
+ }, [w, t, a]);
55
+ const G = it(t || "", {
56
+ onSuccess: () => n()
57
+ }), H = mt(t || "", {
58
+ onSuccess: () => n()
59
+ }), K = ft(t || "", {
60
+ onSuccess: () => n()
61
+ }), Y = dt(t || "", {
62
+ onSuccess: () => n()
71
63
  }), z = lt(t || "", {
72
- onSuccess: () => a()
73
- }), B = pt(t || "", {
74
- onSuccess: () => a()
75
- }), J = Ct(t || "", {
76
- onSuccess: () => a(),
64
+ onSuccess: () => n()
65
+ }), B = Ct(t || "", {
66
+ onSuccess: () => n(),
77
67
  retry: 3
78
- }), Q = wt(t || "", {
68
+ }), J = wt(t || "", {
79
69
  onSuccess: () => {
80
70
  }
81
71
  });
82
- d(() => {
83
- t && typeof window < "u" && localStorage.setItem(m, t);
72
+ f(() => {
73
+ t && typeof window < "u" && localStorage.setItem(d, t);
84
74
  }, [t]);
85
- const V = o(
86
- async (e, r, c, s, n) => {
75
+ const Q = o(
76
+ async (e, r, c, m, s) => {
87
77
  var F;
88
78
  if (!t) throw new Error("No cart ID");
89
- const { fbc: y, fbp: D } = x(), N = await H.mutateAsync({ sku: s, quantity: n, fbc: y, fbp: D });
79
+ const { fbc: v, fbp: D } = ht(), N = await G.mutateAsync({ sku: m, quantity: s, fbc: v, fbp: D });
90
80
  if ("error" in N) return;
91
- const w = (F = N.items) == null ? void 0 : F.filter(
92
- (g) => {
93
- var $;
94
- return (($ = g.variant) == null ? void 0 : $.sku) === s;
81
+ const I = (F = N.items) == null ? void 0 : F.filter(
82
+ (S) => {
83
+ var U;
84
+ return ((U = S.variant) == null ? void 0 : U.sku) === m;
95
85
  }
96
- ), T = w == null ? void 0 : w[w.length - 1];
86
+ ), T = I == null ? void 0 : I[I.length - 1];
97
87
  if (T) {
98
- const g = `cart_${t}_item_${T.id}`;
99
- h(e, r, c, n, g);
88
+ const S = `cart_${t}_item_${T.id}`;
89
+ h(e, r, c, s, S);
100
90
  } else
101
- h(e, r, c, n);
91
+ h(e, r, c, s);
102
92
  },
103
93
  // eslint-disable-next-line react-hooks/exhaustive-deps
104
- [t, h, x]
105
- ), W = o(
94
+ [t, h]
95
+ ), V = o(
106
96
  async (e, r) => {
107
97
  if (!t) throw new Error("No cart ID");
108
- await K.mutateAsync({ itemId: e, quantity: r });
98
+ await H.mutateAsync({ itemId: e, quantity: r });
109
99
  },
110
100
  // eslint-disable-next-line react-hooks/exhaustive-deps
111
101
  [t]
112
- ), X = o(
102
+ ), W = o(
113
103
  async (e) => {
114
104
  if (!t) throw new Error("No cart ID");
115
- await Y.mutateAsync(e);
105
+ await K.mutateAsync(e);
116
106
  },
117
107
  // eslint-disable-next-line react-hooks/exhaustive-deps
118
108
  [t]
119
- ), Z = o(
109
+ ), X = o(
120
110
  async (e) => {
121
111
  if (!t) throw new Error("No cart ID");
122
- await z.mutateAsync({ code: e });
112
+ await Y.mutateAsync({ code: e });
123
113
  },
124
114
  // eslint-disable-next-line react-hooks/exhaustive-deps
125
115
  [t]
126
- ), q = o(async () => {
116
+ ), Z = o(async () => {
127
117
  if (!t) throw new Error("No cart ID");
128
- await B.mutateAsync();
118
+ await z.mutateAsync();
129
119
  }, [t]), R = o(() => {
130
- i(null), typeof window < "u" && localStorage.removeItem(m);
131
- }, []), tt = o(() => {
132
- R(), v.mutate(u);
133
- }, [u]), et = o(() => {
134
- M(!0);
120
+ u(null), typeof window < "u" && localStorage.removeItem(d);
121
+ }, []), q = o(() => {
122
+ R(), y.mutate(a);
123
+ }, [a]), tt = o(() => {
124
+ k(!0);
135
125
  }, []), P = o(() => {
136
- M(!1);
137
- }, []), rt = o(() => {
138
- var s, n;
139
- if (!f || !t) return;
140
- const e = Number(((s = f.pricing) == null ? void 0 : s.total) || 0), r = ((n = f.items) == null ? void 0 : n.reduce((y, D) => y + D.quantity, 0)) || 0, c = `cart_${t}_checkout`;
141
- b(e, r, c);
142
- }, [f, t, b]), ot = {
143
- cart: f || null,
126
+ k(!1);
127
+ }, []), et = o(() => {
128
+ var m, s;
129
+ if (!i || !t) return;
130
+ const e = Number(((m = i.pricing) == null ? void 0 : m.total) || 0), r = ((s = i.items) == null ? void 0 : s.reduce((v, D) => v + D.quantity, 0)) || 0, c = `cart_${t}_checkout`;
131
+ x(e, r, c);
132
+ }, [i, t, x]), rt = {
133
+ cart: i || null,
144
134
  cartId: t,
145
- isLoading: G,
146
- error: C,
147
- updateCartMutation: J,
148
- checkoutMutation: Q,
149
- addItem: V,
150
- updateItem: W,
151
- removeItem: X,
152
- applyDiscount: Z,
153
- removeDiscount: q,
154
- trackCheckoutInitiated: rt,
135
+ isLoading: O,
136
+ error: w,
137
+ updateCartMutation: B,
138
+ checkoutMutation: J,
139
+ addItem: Q,
140
+ updateItem: V,
141
+ removeItem: W,
142
+ applyDiscount: X,
143
+ removeDiscount: Z,
144
+ trackCheckoutInitiated: et,
155
145
  clearCart: R,
156
- clearAndCreateNewCart: tt,
157
- refetch: a,
158
- isOpen: A,
159
- open: et,
146
+ clearAndCreateNewCart: q,
147
+ refetch: n,
148
+ isOpen: g,
149
+ open: tt,
160
150
  close: P
161
151
  };
162
- return /* @__PURE__ */ nt(U.Provider, { value: ot, children: [
152
+ return /* @__PURE__ */ ot(b.Provider, { value: rt, children: [
163
153
  l,
164
- j && /* @__PURE__ */ ct(
154
+ $ && /* @__PURE__ */ nt(
165
155
  It,
166
156
  {
167
- isOpen: A,
157
+ isOpen: g,
168
158
  onClose: P,
169
159
  ...L
170
160
  }
@@ -172,13 +162,13 @@ function Mt({ children: l, brandSlug: u, initialCartId: p, shoppingCartProps: L
172
162
  ] });
173
163
  }
174
164
  function _t() {
175
- const l = at(U);
165
+ const l = st(b);
176
166
  if (!l)
177
167
  throw new Error("useCart must be used within CartProvider");
178
168
  return l;
179
169
  }
180
170
  export {
181
- U as CartContext,
182
- Mt as CartProvider,
171
+ b as CartContext,
172
+ Et as CartProvider,
183
173
  _t as useCart
184
174
  };
package/dist/index32.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as a } from "./index67.mjs";
3
+ import { useQueryUnwrapped as a } from "./index64.mjs";
4
4
  import { queryKeys as r } from "./index29.mjs";
5
5
  import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as p, updateCartItem as C, removeCartItem as q, checkoutCart as f, fetchCart as d } from "./index25.mjs";
6
6
  function Q(e, t) {
package/dist/index33.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useMutation as t } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as u } from "./index67.mjs";
3
+ import { useQueryUnwrapped as u } from "./index64.mjs";
4
4
  import { queryKeys as n } from "./index29.mjs";
5
5
  import { confirmOrder as i, fetchOrder as m } from "./index26.mjs";
6
6
  function y(e, r, o) {
package/dist/index34.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as u } from "./index67.mjs";
2
+ import { useQueryUnwrapped as u } from "./index64.mjs";
3
3
  import { queryKeys as t } from "./index29.mjs";
4
4
  import { fetchProductsByBrand as o, fetchProductBySlug as c } from "./index24.mjs";
5
5
  function n(r, e) {
package/dist/index35.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as o } from "./index67.mjs";
2
+ import { useQueryUnwrapped as o } from "./index64.mjs";
3
3
  import { queryKeys as i } from "./index29.mjs";
4
4
  import { fetchDeliveryZones as t } from "./index27.mjs";
5
5
  function p(e, r) {
package/dist/index36.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as t } from "./index67.mjs";
2
+ import { useQueryUnwrapped as t } from "./index64.mjs";
3
3
  import { queryKeys as u } from "./index29.mjs";
4
4
  import { fetchBrandBySlug as n } from "./index28.mjs";
5
5
  function i(r, e) {
package/dist/index37.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { getDefaultExportFromCjs as x } from "./index60.mjs";
2
+ import { getDefaultExportFromCjs as x } from "./index61.mjs";
3
3
  import { __module as q } from "./index62.mjs";
4
4
  function S(b, p) {
5
5
  for (var s = 0; s < p.length; s++) {
package/dist/index38.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { getDefaultExportFromCjs as n } from "./index60.mjs";
3
- import { __require as i } from "./index61.mjs";
2
+ import { getDefaultExportFromCjs as n } from "./index61.mjs";
3
+ import { __require as i } from "./index63.mjs";
4
4
  function s(t, a) {
5
5
  for (var o = 0; o < a.length; o++) {
6
6
  const e = a[o];
package/dist/index39.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import { p as S } from "./index64.mjs";
3
- import { t as U } from "./index65.mjs";
4
- import he from "./index66.mjs";
2
+ import { p as S } from "./index65.mjs";
3
+ import { t as U } from "./index66.mjs";
4
+ import he from "./index67.mjs";
5
5
  const fe = Object.prototype.toString, de = Error.prototype.toString, pe = RegExp.prototype.toString, me = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", ye = /^Symbol\((.*)\)(.*)$/;
6
6
  function ge(n) {
7
7
  return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
package/dist/index42.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as l from "react";
3
- import { composeRefs as m } from "./index63.mjs";
3
+ import { composeRefs as m } from "./index60.mjs";
4
4
  import { jsx as u } from "react/jsx-runtime";
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function y(e) {
package/dist/index47.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  'use client';
2
- import a from "./index114.mjs";
3
- import p from "./index115.mjs";
4
- import m from "./index116.mjs";
5
- import i from "./index117.mjs";
6
- import f from "./index118.mjs";
7
- import l from "./index119.mjs";
8
- import c from "./index120.mjs";
9
- import d from "./index121.mjs";
10
- import u from "./index122.mjs";
11
- import { VERSION as x } from "./index123.mjs";
12
- import C from "./index124.mjs";
13
- import A from "./index125.mjs";
14
- import E from "./index126.mjs";
15
- import O from "./index127.mjs";
16
- import S from "./index128.mjs";
17
- import H from "./index129.mjs";
18
- import T from "./index130.mjs";
2
+ import a from "./index75.mjs";
3
+ import p from "./index76.mjs";
4
+ import m from "./index77.mjs";
5
+ import i from "./index78.mjs";
6
+ import f from "./index79.mjs";
7
+ import l from "./index80.mjs";
8
+ import c from "./index81.mjs";
9
+ import d from "./index82.mjs";
10
+ import u from "./index83.mjs";
11
+ import { VERSION as x } from "./index84.mjs";
12
+ import C from "./index85.mjs";
13
+ import A from "./index86.mjs";
14
+ import E from "./index87.mjs";
15
+ import O from "./index88.mjs";
16
+ import S from "./index89.mjs";
17
+ import H from "./index90.mjs";
18
+ import T from "./index91.mjs";
19
19
  function n(o) {
20
20
  const t = new m(o), e = p(m.prototype.request, t);
21
21
  return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
package/dist/index48.mjs CHANGED
@@ -2,8 +2,8 @@
2
2
  var p = Object.defineProperty;
3
3
  var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
4
4
  var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
5
- import { serialize as j } from "./index131.mjs";
6
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index132.mjs";
5
+ import { serialize as j } from "./index92.mjs";
6
+ import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index93.mjs";
7
7
  var v = (r, e) => new Proxy(() => {
8
8
  }, {
9
9
  get(t, s) {
package/dist/index49.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as m, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as p } from "./index67.mjs";
3
+ import { useQueryUnwrapped as p } from "./index64.mjs";
4
4
  import { createAdminRpcClients as d, authHeaders as l } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as y } from "./index21.mjs";
package/dist/index50.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as m, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as b } from "./index67.mjs";
3
+ import { useQueryUnwrapped as b } from "./index64.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index51.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as w } from "./index67.mjs";
3
+ import { useQueryUnwrapped as w } from "./index64.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as a } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index52.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as v, useMutation as m } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as w } from "./index67.mjs";
3
+ import { useQueryUnwrapped as w } from "./index64.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as o } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index53.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as d } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index67.mjs";
3
+ import { useQueryUnwrapped as m } from "./index64.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as l } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as w } from "./index21.mjs";
package/dist/index54.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as w, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as d } from "./index67.mjs";
3
+ import { useQueryUnwrapped as d } from "./index64.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as y } from "./index23.mjs";
5
5
  import { queryKeys as i } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index55.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as n } from "./index67.mjs";
2
+ import { useQueryUnwrapped as n } from "./index64.mjs";
3
3
  import { createAdminRpcClients as u, authHeaders as a } from "./index23.mjs";
4
4
  import { queryKeys as c } from "./index29.mjs";
5
5
  import { useApiConfig as m } from "./index21.mjs";
package/dist/index56.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as i } from "./index67.mjs";
2
+ import { useQueryUnwrapped as i } from "./index64.mjs";
3
3
  import { createAdminRpcClients as u, authHeaders as c } from "./index23.mjs";
4
4
  import { queryKeys as a } from "./index29.mjs";
5
5
  import { useApiConfig as d } from "./index21.mjs";
package/dist/index57.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as b } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as l } from "./index67.mjs";
3
+ import { useQueryUnwrapped as l } from "./index64.mjs";
4
4
  import { createAdminRpcClients as r, authHeaders as i } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as d } from "./index21.mjs";
package/dist/index58.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as C } from "./index67.mjs";
3
+ import { useQueryUnwrapped as C } from "./index64.mjs";
4
4
  import { createAdminRpcClients as a, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as r } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";