@instockng/storefront-ui 1.0.53 → 1.0.54

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 (103) hide show
  1. package/dist/components/Checkout.d.ts +2 -1
  2. package/dist/components/Checkout.d.ts.map +1 -1
  3. package/dist/components/ShoppingCart.d.ts +4 -1
  4. package/dist/components/ShoppingCart.d.ts.map +1 -1
  5. package/dist/index103.mjs +2 -2
  6. package/dist/index104.mjs +2 -2
  7. package/dist/index11.mjs +74 -67
  8. package/dist/index13.mjs +2 -2
  9. package/dist/index139.mjs +1 -1
  10. package/dist/index140.mjs +1 -1
  11. package/dist/index141.mjs +5 -5
  12. package/dist/index143.mjs +2 -2
  13. package/dist/index145.mjs +2 -2
  14. package/dist/index147.mjs +1 -1
  15. package/dist/index149.mjs +4 -4
  16. package/dist/index150.mjs +3 -3
  17. package/dist/index161.mjs +3 -3
  18. package/dist/index162.mjs +1 -1
  19. package/dist/index164.mjs +2 -2
  20. package/dist/index165.mjs +1 -1
  21. package/dist/index170.mjs +2 -2
  22. package/dist/index172.mjs +1 -1
  23. package/dist/index174.mjs +2 -2
  24. package/dist/index175.mjs +5 -5
  25. package/dist/index178.mjs +1 -1
  26. package/dist/index181.mjs +1 -1
  27. package/dist/index184.mjs +1 -1
  28. package/dist/index185.mjs +1 -1
  29. package/dist/index189.mjs +1 -1
  30. package/dist/index191.mjs +1 -1
  31. package/dist/index195.mjs +1 -1
  32. package/dist/index197.mjs +1 -1
  33. package/dist/index210.mjs +1 -1
  34. package/dist/index211.mjs +3 -3
  35. package/dist/index216.mjs +1 -1
  36. package/dist/index218.mjs +1 -1
  37. package/dist/index219.mjs +3 -3
  38. package/dist/index220.mjs +3 -3
  39. package/dist/index227.mjs +2 -2
  40. package/dist/index228.mjs +108 -2
  41. package/dist/index229.mjs +2 -2
  42. package/dist/index230.mjs +2 -108
  43. package/dist/index231.mjs +37 -2
  44. package/dist/index232.mjs +2 -2
  45. package/dist/index233.mjs +243 -36
  46. package/dist/index234.mjs +2 -2
  47. package/dist/index235.mjs +33 -2
  48. package/dist/index236.mjs +61 -240
  49. package/dist/index237.mjs +25 -2
  50. package/dist/index238.mjs +2 -33
  51. package/dist/index239.mjs +2 -65
  52. package/dist/index240.mjs +2 -25
  53. package/dist/index241.mjs +2 -2
  54. package/dist/index243.mjs +2 -2
  55. package/dist/index244.mjs +2 -2
  56. package/dist/index245.mjs +2 -2
  57. package/dist/index246.mjs +2 -2
  58. package/dist/index247.mjs +2 -2
  59. package/dist/index248.mjs +2 -2
  60. package/dist/index250.mjs +1 -1
  61. package/dist/index259.mjs +1 -1
  62. package/dist/index261.mjs +2 -2
  63. package/dist/index262.mjs +2 -18
  64. package/dist/index263.mjs +13 -42
  65. package/dist/index264.mjs +47 -2
  66. package/dist/index38.mjs +1 -1
  67. package/dist/index40.mjs +2 -2
  68. package/dist/index47.mjs +1 -1
  69. package/dist/index52.mjs +17 -17
  70. package/dist/index53.mjs +2 -2
  71. package/dist/index66.mjs +20 -21
  72. package/dist/index67.mjs +21 -150
  73. package/dist/index69.mjs +149 -19
  74. package/dist/index72.mjs +1 -1
  75. package/dist/index73.mjs +231 -30
  76. package/dist/index74.mjs +5 -42
  77. package/dist/index75.mjs +134 -2
  78. package/dist/index76.mjs +67 -5
  79. package/dist/index77.mjs +80 -1127
  80. package/dist/index78.mjs +28 -19
  81. package/dist/index79.mjs +8 -54
  82. package/dist/index80.mjs +72 -30
  83. package/dist/index81.mjs +4 -2
  84. package/dist/index82.mjs +2 -235
  85. package/dist/index83.mjs +82 -5
  86. package/dist/index84.mjs +50 -130
  87. package/dist/index85.mjs +4 -66
  88. package/dist/index86.mjs +4 -86
  89. package/dist/index87.mjs +176 -26
  90. package/dist/index88.mjs +52 -8
  91. package/dist/index89.mjs +69 -75
  92. package/dist/index90.mjs +34 -4
  93. package/dist/index91.mjs +43 -2
  94. package/dist/index92.mjs +2 -83
  95. package/dist/index93.mjs +4 -52
  96. package/dist/index94.mjs +1133 -5
  97. package/dist/index95.mjs +19 -4
  98. package/dist/index96.mjs +47 -171
  99. package/dist/index97.mjs +32 -52
  100. package/dist/index98.mjs +2 -69
  101. package/package.json +1 -1
  102. package/src/components/Checkout.tsx +3 -3
  103. package/src/components/ShoppingCart.tsx +10 -3
@@ -1,3 +1,4 @@
1
+ import type { Order } from '@instockng/api-client';
1
2
  export type PaymentMethod = 'cod' | 'online';
2
3
  export interface CheckoutFormData {
3
4
  firstName: string;
@@ -19,7 +20,7 @@ export interface CheckoutProps {
19
20
  /** Initial form data */
20
21
  initialData?: Partial<CheckoutFormData>;
21
22
  /** Callback on successful checkout */
22
- onSuccess?: (orderId: string) => void;
23
+ onSuccess?: (order: Order) => void;
23
24
  /** Callback on error */
24
25
  onError?: (error: Error) => void;
25
26
  /** Submit button text */
@@ -1 +1 @@
1
- {"version":3,"file":"Checkout.d.ts","sourceRoot":"","sources":["../../src/components/Checkout.tsx"],"names":[],"mappings":"AAgGA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,sCAAsC;IACtC,SAAS,CAAC,EAAE,CAAC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wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,sCAAsC;IACtC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACnC,wBAAwB;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,4BAA4B;IAC5B,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAID,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,OAAO,EACP,WAAW,EACX,SAAS,EACT,OAAO,EACP,gBAAgC,EAChC,YAAY,GACb,EAAE,aAAa,2CA83Bf"}
@@ -1,3 +1,4 @@
1
+ import type { Order } from '@instockng/api-client';
1
2
  export interface ShoppingCartProps {
2
3
  /** Whether the cart is open */
3
4
  isOpen: boolean;
@@ -7,6 +8,8 @@ export interface ShoppingCartProps {
7
8
  onCheckout?: () => void;
8
9
  /** Callback when continue shopping is clicked */
9
10
  onContinueShopping?: () => void;
11
+ /** Callback when purchase is successfully completed */
12
+ onPurchaseSuccess?: (order: Order) => void;
10
13
  /** Custom class name */
11
14
  className?: string;
12
15
  /** Show discount code input */
@@ -26,5 +29,5 @@ export interface ShoppingCartProps {
26
29
  /** Empty cart message */
27
30
  emptyMessage?: string;
28
31
  }
29
- export declare function ShoppingCart({ isOpen, onClose, onCheckout, onContinueShopping, className, showDiscountCode, showContinueShopping, checkoutButtonText, continueShoppingText, checkoutButtonClassName, continueShoppingButtonClassName, disableCheckout, emptyMessage, }: ShoppingCartProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare function ShoppingCart({ isOpen, onClose, onCheckout, onContinueShopping, onPurchaseSuccess, className, showDiscountCode, showContinueShopping, checkoutButtonText, continueShoppingText, checkoutButtonClassName, continueShoppingButtonClassName, disableCheckout, emptyMessage, }: ShoppingCartProps): import("react/jsx-runtime").JSX.Element;
30
33
  //# sourceMappingURL=ShoppingCart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShoppingCart.d.ts","sourceRoot":"","sources":["../../src/components/ShoppingCart.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oCAAoC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oCAAoC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uCAAuC;IACvC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,gDAAgD;IAChD,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,uBAAuB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,gBAAuB,EACvB,oBAA2B,EAC3B,kBAAwC,EACxC,oBAA0C,EAC1C,uBAAuB,EACvB,+B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pC,EAAE,iBAAiB,2CAoNnB"}
package/dist/index103.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import { __module as m } from "./index154.mjs";
3
- import "./index76.mjs";
3
+ import "./index93.mjs";
4
4
  import { __require as j } from "./index155.mjs";
5
5
  import { __require as V } from "./index156.mjs";
6
6
  import { __require as k } from "./index157.mjs";
7
7
  import { __require as G } from "./index158.mjs";
8
8
  import { __require as W } from "./index159.mjs";
9
- import { __exports as X } from "./index81.mjs";
9
+ import { __exports as X } from "./index98.mjs";
10
10
  var M;
11
11
  function ee() {
12
12
  return M ? m.exports : (M = 1, function(N, c) {
package/dist/index104.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __module as L } from "./index160.mjs";
3
- import "./index76.mjs";
3
+ import "./index93.mjs";
4
4
  import { __require as K } from "./index101.mjs";
5
5
  import F from "react/jsx-runtime";
6
6
  import J from "react-dom";
@@ -8,7 +8,7 @@ import N from "react";
8
8
  import { __require as B } from "./index161.mjs";
9
9
  import { __require as D } from "./index162.mjs";
10
10
  import { __require as G } from "./index157.mjs";
11
- import { __exports as Q } from "./index81.mjs";
11
+ import { __exports as Q } from "./index98.mjs";
12
12
  var w;
13
13
  function ie() {
14
14
  return w ? L.exports : (w = 1, function(x, o) {
package/dist/index11.mjs CHANGED
@@ -1,49 +1,51 @@
1
1
  'use client';
2
- import { jsxs as a, Fragment as N, jsx as e } from "react/jsx-runtime";
3
- import { useState as D, useEffect as F } from "react";
4
- import { useCart as Y } from "./index3.mjs";
5
- import { CartItem as q } from "./index10.mjs";
6
- import { Checkout as H } from "./index13.mjs";
7
- import { RecommendedProducts as T } from "./index41.mjs";
8
- import { Button as b } from "./index14.mjs";
9
- import { X, Loader2 as Z, Package as h } from "lucide-react";
2
+ import { jsxs as a, Fragment as b, jsx as e } from "react/jsx-runtime";
3
+ import { useState as H, useEffect as P } from "react";
4
+ import { useCart as T } from "./index3.mjs";
5
+ import { CartItem as X } from "./index10.mjs";
6
+ import { DiscountCodeInput as Z } from "./index12.mjs";
7
+ import { Checkout as A } from "./index13.mjs";
8
+ import { RecommendedProducts as G } from "./index41.mjs";
9
+ import { Button as v } from "./index14.mjs";
10
+ import { X as J, Loader2 as K, Package as h } from "lucide-react";
10
11
  import { cn as n, formatCurrency as c } from "./index20.mjs";
11
- import { useHideBodyOverflow as A } from "./index42.mjs";
12
- function ee({
13
- isOpen: i,
12
+ import { useHideBodyOverflow as M } from "./index42.mjs";
13
+ function ie({
14
+ isOpen: r,
14
15
  onClose: s,
15
16
  onCheckout: d,
16
17
  onContinueShopping: o,
17
- className: v,
18
- showDiscountCode: G = !0,
19
- showContinueShopping: w = !0,
20
- checkoutButtonText: k = "Complete Purchase",
21
- continueShoppingText: j = "Continue Shopping",
22
- checkoutButtonClassName: C,
23
- continueShoppingButtonClassName: E,
24
- disableCheckout: L = !1,
25
- emptyMessage: P = "Your cart is empty"
18
+ onPurchaseSuccess: m,
19
+ className: w,
20
+ showDiscountCode: k = !0,
21
+ showContinueShopping: j = !0,
22
+ checkoutButtonText: C = "Complete Purchase",
23
+ continueShoppingText: E = "Continue Shopping",
24
+ checkoutButtonClassName: I,
25
+ continueShoppingButtonClassName: L,
26
+ disableCheckout: z = !1,
27
+ emptyMessage: R = "Your cart is empty"
26
28
  }) {
27
- var p, x, g;
28
- const { cart: t, isLoading: l, error: m, trackCheckoutInitiated: z } = Y(), [I, f] = D(!1);
29
- A(i), F(() => {
30
- const r = (y) => {
31
- y.key === "Escape" && i && s();
29
+ var x, g, y;
30
+ const { cart: t, isLoading: l, error: f, trackCheckoutInitiated: B } = T(), [D, p] = H(!1);
31
+ M(r), P(() => {
32
+ const i = (N) => {
33
+ N.key === "Escape" && r && s();
32
34
  };
33
- return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
34
- }, [i, s]);
35
- const R = ((p = t == null ? void 0 : t.pricing) == null ? void 0 : p.subtotal) || 0, u = ((x = t == null ? void 0 : t.pricing.discount) == null ? void 0 : x.amount) || 0, S = () => {
36
- z(), f(!0), d == null || d();
37
- }, B = () => {
35
+ return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
36
+ }, [r, s]);
37
+ const F = ((x = t == null ? void 0 : t.pricing) == null ? void 0 : x.subtotal) || 0, u = ((g = t == null ? void 0 : t.pricing.discount) == null ? void 0 : g.amount) || 0, Y = () => {
38
+ B(), p(!0), d == null || d();
39
+ }, q = () => {
38
40
  o == null || o(), s();
39
41
  };
40
- return /* @__PURE__ */ a(N, { children: [
42
+ return /* @__PURE__ */ a(b, { children: [
41
43
  /* @__PURE__ */ e(
42
44
  "div",
43
45
  {
44
46
  className: n(
45
47
  "fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",
46
- i ? "opacity-100" : "pointer-events-none opacity-0"
48
+ r ? "opacity-100" : "pointer-events-none opacity-0"
47
49
  ),
48
50
  onClick: s,
49
51
  "aria-hidden": "true"
@@ -54,13 +56,13 @@ function ee({
54
56
  {
55
57
  className: n(
56
58
  "fixed right-0 top-0 z-50 h-full w-full bg-white shadow-2xl transition-transform duration-300 ease-in-out sm:w-[480px]",
57
- i ? "translate-x-0" : "translate-x-full",
58
- v
59
+ r ? "translate-x-0" : "translate-x-full",
60
+ w
59
61
  ),
60
62
  children: /* @__PURE__ */ a("div", { className: "flex h-full flex-col", children: [
61
63
  /* @__PURE__ */ e("div", { className: "border-b border-gray-300 px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
62
64
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
63
- /* @__PURE__ */ e("div", { className: "bg-accent-500 text-white px-2 py-1 rounded-full text-sm aspect-square flex items-center justify-center w-8 h-8", children: (g = t == null ? void 0 : t.items) == null ? void 0 : g.length }),
65
+ /* @__PURE__ */ e("div", { className: "bg-accent-500 text-white px-2 py-1 rounded-full text-sm aspect-square flex items-center justify-center w-8 h-8", children: (y = t == null ? void 0 : t.items) == null ? void 0 : y.length }),
64
66
  /* @__PURE__ */ e("h2", { className: "text-lg font-medium", children: "Your Cart" })
65
67
  ] }),
66
68
  /* @__PURE__ */ e(
@@ -69,39 +71,42 @@ function ee({
69
71
  onClick: s,
70
72
  className: "rounded-full p-2 transition-colors hover:bg-gray-100",
71
73
  "aria-label": "Close cart",
72
- children: /* @__PURE__ */ e(X, { className: "h-6 w-6" })
74
+ children: /* @__PURE__ */ e(J, { className: "h-6 w-6" })
73
75
  }
74
76
  )
75
77
  ] }) }),
76
78
  l && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
77
- /* @__PURE__ */ e(Z, { className: "mx-auto mb-4 h-12 w-12 animate-spin text-accent-500" }),
79
+ /* @__PURE__ */ e(K, { className: "mx-auto mb-4 h-12 w-12 animate-spin text-accent-500" }),
78
80
  /* @__PURE__ */ e("p", { className: "text-gray-600", children: "Loading cart..." })
79
81
  ] }) }),
80
- m && !l && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
82
+ f && !l && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
81
83
  /* @__PURE__ */ e(h, { className: "mx-auto mb-4 h-12 w-12 text-red-600" }),
82
84
  /* @__PURE__ */ e("p", { className: "text-red-600", children: "Failed to load cart. Please try again." })
83
85
  ] }) }),
84
- !l && !m && (!t || !t.items || t.items.length === 0) && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
86
+ !l && !f && (!t || !t.items || t.items.length === 0) && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
85
87
  /* @__PURE__ */ e(h, { className: "mx-auto mb-4 h-12 w-12 text-gray-400" }),
86
- /* @__PURE__ */ e("p", { className: "text-gray-600", children: P })
88
+ /* @__PURE__ */ e("p", { className: "text-gray-600", children: R })
87
89
  ] }) }),
88
- !l && !m && t && t.items && t.items.length > 0 && /* @__PURE__ */ a(N, { children: [
89
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "space-y-4 p-4", children: t.items.map((r, y) => /* @__PURE__ */ a("div", { children: [
90
- /* @__PURE__ */ e(
91
- q,
92
- {
93
- item: r
94
- }
95
- ),
96
- /* @__PURE__ */ e("hr", { className: "border-gray-200 mt-2" })
97
- ] }, r.id)) }) }),
98
- /* @__PURE__ */ e(T, { limit: 6, className: "border-t border-gray-200" }),
90
+ !l && !f && t && t.items && t.items.length > 0 && /* @__PURE__ */ a(b, { children: [
91
+ /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", children: [
92
+ /* @__PURE__ */ e("div", { className: "space-y-4 p-4", children: t.items.map((i, N) => /* @__PURE__ */ a("div", { children: [
93
+ /* @__PURE__ */ e(
94
+ X,
95
+ {
96
+ item: i
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e("hr", { className: "border-gray-200 mt-2" })
100
+ ] }, i.id)) }),
101
+ k && /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e(Z, {}) })
102
+ ] }),
103
+ /* @__PURE__ */ e(G, { limit: 6, className: "border-t border-gray-200" }),
99
104
  /* @__PURE__ */ a("div", { className: "border-t border-gray-300 bg-white", children: [
100
105
  /* @__PURE__ */ a("div", { className: " text-base", children: [
101
106
  /* @__PURE__ */ a("div", { className: "px-4 py-2 space-y-2", children: [
102
107
  /* @__PURE__ */ a("div", { className: "flex justify-between", children: [
103
108
  /* @__PURE__ */ e("span", { className: "text-gray-600", children: "Subtotal" }),
104
- /* @__PURE__ */ e("span", { className: "font-semibold", children: c(R) })
109
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: c(F) })
105
110
  ] }),
106
111
  u > 0 && /* @__PURE__ */ a("div", { className: "flex justify-between text-green-600", children: [
107
112
  /* @__PURE__ */ e("span", { children: "Discount" }),
@@ -122,26 +127,26 @@ function ee({
122
127
  ] }),
123
128
  /* @__PURE__ */ a("div", { className: "px-4 py-2 space-y-2 pt-0", children: [
124
129
  /* @__PURE__ */ a(
125
- b,
130
+ v,
126
131
  {
127
- onClick: S,
128
- disabled: L || t.items.length === 0,
129
- className: n("w-full bg-accent-500 text-white hover:bg-accent-600", C),
132
+ onClick: Y,
133
+ disabled: z || t.items.length === 0,
134
+ className: n("w-full bg-accent-500 text-white hover:bg-accent-600", I),
130
135
  size: "lg",
131
136
  children: [
132
137
  /* @__PURE__ */ e(h, { className: "h-5 w-5" }),
133
- k
138
+ C
134
139
  ]
135
140
  }
136
141
  ),
137
- w && /* @__PURE__ */ e(
138
- b,
142
+ j && /* @__PURE__ */ e(
143
+ v,
139
144
  {
140
- onClick: B,
145
+ onClick: q,
141
146
  variant: "outline",
142
- className: n("w-full border-gray-300 text-gray-600 hover:bg-gray-100", E),
147
+ className: n("w-full border-gray-300 text-gray-600 hover:bg-gray-100", L),
143
148
  size: "lg",
144
- children: j
149
+ children: E
145
150
  }
146
151
  )
147
152
  ] })
@@ -151,11 +156,13 @@ function ee({
151
156
  }
152
157
  ),
153
158
  /* @__PURE__ */ e(
154
- H,
159
+ A,
155
160
  {
156
- isOpen: I,
157
- onSuccess: () => s(),
158
- onClose: () => f(!1),
161
+ isOpen: D,
162
+ onSuccess: (i) => {
163
+ m == null || m(i), s();
164
+ },
165
+ onClose: () => p(!1),
159
166
  refundPolicy: {
160
167
  title: "🤔 Curious about Refunds?",
161
168
  policies: [
@@ -171,5 +178,5 @@ function ee({
171
178
  ] });
172
179
  }
173
180
  export {
174
- ee as ShoppingCart
181
+ ie as ShoppingCart
175
182
  };
package/dist/index13.mjs CHANGED
@@ -70,7 +70,7 @@ function ct({
70
70
  o == null || o(new Error((H == null ? void 0 : H.message) || "Checkout failed"));
71
71
  return;
72
72
  }
73
- B(x), J(), N == null || N(x.id);
73
+ B(x), J(), N == null || N(x);
74
74
  } catch (n) {
75
75
  o == null || o(n);
76
76
  }
@@ -221,7 +221,7 @@ function ct({
221
221
  o == null || o(new Error((x == null ? void 0 : x.message) || "Checkout failed"));
222
222
  return;
223
223
  }
224
- B(M), J(), N == null || N(M.id);
224
+ B(M), J(), N == null || N(M);
225
225
  } catch (t) {
226
226
  o == null || o(t);
227
227
  }
package/dist/index139.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import f from "./index82.mjs";
2
+ import f from "./index73.mjs";
3
3
  import d from "./index210.mjs";
4
4
  function l(e) {
5
5
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
package/dist/index140.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import n from "./index82.mjs";
2
+ import n from "./index73.mjs";
3
3
  class a {
4
4
  constructor() {
5
5
  this.handlers = [];
package/dist/index141.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import r from "./index211.mjs";
3
- import p from "./index90.mjs";
4
- import l from "./index86.mjs";
5
- import m from "./index88.mjs";
6
- import a from "./index96.mjs";
7
- import o from "./index97.mjs";
3
+ import p from "./index81.mjs";
4
+ import l from "./index77.mjs";
5
+ import m from "./index79.mjs";
6
+ import a from "./index87.mjs";
7
+ import o from "./index88.mjs";
8
8
  function d(e) {
9
9
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
10
10
  throw new m(null, e);
package/dist/index143.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { VERSION as w } from "./index91.mjs";
3
- import s from "./index93.mjs";
2
+ import { VERSION as w } from "./index82.mjs";
3
+ import s from "./index84.mjs";
4
4
  const l = {};
5
5
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
6
6
  l[n] = function(o) {
package/dist/index145.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import s from "./index82.mjs";
3
- import f from "./index92.mjs";
2
+ import s from "./index73.mjs";
3
+ import f from "./index83.mjs";
4
4
  import r from "./index146.mjs";
5
5
  function d(o, i) {
6
6
  return f(o, new r.classes.URLSearchParams(), {
package/dist/index147.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import n from "./index82.mjs";
2
+ import n from "./index73.mjs";
3
3
  const a = n.toObjectSet([
4
4
  "age",
5
5
  "authorization",
package/dist/index149.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use client';
2
- import H from "./index82.mjs";
2
+ import H from "./index73.mjs";
3
3
  import D from "./index216.mjs";
4
4
  import L from "./index144.mjs";
5
- import n from "./index93.mjs";
6
- import y from "./index88.mjs";
5
+ import n from "./index84.mjs";
6
+ import y from "./index79.mjs";
7
7
  import O from "./index217.mjs";
8
8
  import U from "./index146.mjs";
9
- import q from "./index96.mjs";
9
+ import q from "./index87.mjs";
10
10
  import { progressEventReducer as A } from "./index218.mjs";
11
11
  import v from "./index219.mjs";
12
12
  const N = typeof XMLHttpRequest < "u", Q = N && function(s) {
package/dist/index150.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import K from "./index146.mjs";
3
- import t from "./index82.mjs";
4
- import b from "./index93.mjs";
3
+ import t from "./index73.mjs";
4
+ import b from "./index84.mjs";
5
5
  import ee from "./index220.mjs";
6
6
  import { trackStream as z } from "./index221.mjs";
7
- import te from "./index96.mjs";
7
+ import te from "./index87.mjs";
8
8
  import { progressEventDecorator as I, progressEventReducer as M, asyncDecorator as j } from "./index218.mjs";
9
9
  import se from "./index219.mjs";
10
10
  import re from "./index216.mjs";
package/dist/index161.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { __exports as e } from "./index227.mjs";
3
- import "./index76.mjs";
2
+ import { __exports as e } from "./index247.mjs";
3
+ import "./index93.mjs";
4
4
  import n from "react";
5
- import { __exports as o } from "./index81.mjs";
5
+ import { __exports as o } from "./index98.mjs";
6
6
  var a;
7
7
  function c() {
8
8
  return a ? e : (a = 1, function(t) {
package/dist/index162.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __module as n } from "./index228.mjs";
2
+ import { __module as n } from "./index248.mjs";
3
3
  var a;
4
4
  function m() {
5
5
  return a ? n.exports : (a = 1, function(f, e) {
package/dist/index164.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { __exports as e } from "./index229.mjs";
3
- import { __require as f } from "./index230.mjs";
2
+ import { __exports as e } from "./index227.mjs";
3
+ import { __require as f } from "./index228.mjs";
4
4
  import { __require as _ } from "./index109.mjs";
5
5
  var i;
6
6
  function R() {
package/dist/index165.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as e } from "./index231.mjs";
2
+ import { __exports as e } from "./index229.mjs";
3
3
  var t;
4
4
  function u() {
5
5
  return t ? e : (t = 1, function(r) {
package/dist/index170.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { __exports as u } from "./index232.mjs";
3
- import { __require as d } from "./index233.mjs";
2
+ import { __exports as u } from "./index230.mjs";
3
+ import { __require as d } from "./index231.mjs";
4
4
  var a;
5
5
  function h() {
6
6
  return a ? u : (a = 1, function(c) {
package/dist/index172.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as i } from "./index234.mjs";
2
+ import { __exports as i } from "./index238.mjs";
3
3
  var a;
4
4
  function d() {
5
5
  return a ? i : (a = 1, function(f) {
package/dist/index174.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { __exports as n } from "./index235.mjs";
3
- import { __require as d } from "./index236.mjs";
2
+ import { __exports as n } from "./index232.mjs";
3
+ import { __require as d } from "./index233.mjs";
4
4
  var o;
5
5
  function p() {
6
6
  return o ? n : (o = 1, function(i) {
package/dist/index175.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use client';
2
- import { __exports as A } from "./index237.mjs";
3
- import { __require as T } from "./index236.mjs";
2
+ import { __exports as A } from "./index234.mjs";
3
+ import { __require as T } from "./index233.mjs";
4
4
  import { __require as L } from "./index178.mjs";
5
- import { __require as N } from "./index238.mjs";
5
+ import { __require as N } from "./index235.mjs";
6
6
  import { __require as U } from "./index170.mjs";
7
- import { __require as j } from "./index239.mjs";
8
- import { __require as v } from "./index240.mjs";
7
+ import { __require as j } from "./index236.mjs";
8
+ import { __require as v } from "./index237.mjs";
9
9
  var S;
10
10
  function W() {
11
11
  return S ? A : (S = 1, function(R) {
package/dist/index178.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as r } from "./index241.mjs";
2
+ import { __exports as r } from "./index239.mjs";
3
3
  var n;
4
4
  function i() {
5
5
  return n ? r : (n = 1, function(t) {
package/dist/index181.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as r } from "./index243.mjs";
2
+ import { __exports as r } from "./index240.mjs";
3
3
  var u;
4
4
  function D() {
5
5
  return u ? r : (u = 1, function(t) {
package/dist/index184.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __module as t } from "./index245.mjs";
2
+ import { __module as t } from "./index241.mjs";
3
3
  import { __require as _ } from "./index102.mjs";
4
4
  import { __require as d } from "./index116.mjs";
5
5
  var u;
package/dist/index185.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as t } from "./index246.mjs";
2
+ import { __exports as t } from "./index242.mjs";
3
3
  import { __require as _ } from "./index189.mjs";
4
4
  import { __require as c } from "./index191.mjs";
5
5
  var u;
package/dist/index189.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as r } from "./index247.mjs";
2
+ import { __exports as r } from "./index243.mjs";
3
3
  import { __require as o } from "./index116.mjs";
4
4
  var i;
5
5
  function _() {
package/dist/index191.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as e } from "./index242.mjs";
2
+ import { __exports as e } from "./index244.mjs";
3
3
  import { __require as f } from "./index116.mjs";
4
4
  var n;
5
5
  function p() {
package/dist/index195.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as t } from "./index244.mjs";
2
+ import { __exports as t } from "./index246.mjs";
3
3
  import { __require as a } from "./index191.mjs";
4
4
  var n;
5
5
  function h() {
package/dist/index197.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { __exports as r } from "./index248.mjs";
2
+ import { __exports as r } from "./index245.mjs";
3
3
  import { __require as s } from "./index116.mjs";
4
4
  var a;
5
5
  function _() {
package/dist/index210.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import p from "./index92.mjs";
2
+ import p from "./index83.mjs";
3
3
  function i(n) {
4
4
  const t = {
5
5
  "!": "%21",
package/dist/index211.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import i from "./index82.mjs";
3
- import m from "./index86.mjs";
4
- import s from "./index96.mjs";
2
+ import i from "./index73.mjs";
3
+ import m from "./index77.mjs";
4
+ import s from "./index87.mjs";
5
5
  function h(f, t) {
6
6
  const o = this || m, r = t || o, n = s.from(r.headers);
7
7
  let a = r.data;
package/dist/index216.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import a from "./index93.mjs";
2
+ import a from "./index84.mjs";
3
3
  function E(i, f, t) {
4
4
  const u = t.config.validateStatus;
5
5
  !t.status || !u || u(t.status) ? i(t) : f(new a(
package/dist/index218.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import i from "./index256.mjs";
3
3
  import m from "./index257.mjs";
4
- import f from "./index82.mjs";
4
+ import f from "./index73.mjs";
5
5
  const h = (t, o, a = 3) => {
6
6
  let r = 0;
7
7
  const c = i(50, 250);