@commercengine/checkout 0.1.0

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.
package/dist/react.js ADDED
@@ -0,0 +1,100 @@
1
+ import { a as subscribeToCheckout, i as initCheckout, n as destroyCheckout, r as getCheckout, t as checkoutStore } from "./store.js";
2
+ import { useStore } from "zustand";
3
+ import { useShallow } from "zustand/react/shallow";
4
+
5
+ //#region src/react.ts
6
+ /**
7
+ * Commerce Engine Checkout - React Binding
8
+ *
9
+ * React hook for checkout integration with automatic state synchronization.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * import { useCheckout, initCheckout } from "@commercengine/checkout/react";
14
+ *
15
+ * // Initialize once at app root
16
+ * function App() {
17
+ * useEffect(() => {
18
+ * initCheckout({
19
+ * storeId: "store_xxx",
20
+ * apiKey: "ak_xxx",
21
+ * onComplete: (order) => router.push("/thank-you"),
22
+ * });
23
+ * return () => destroyCheckout();
24
+ * }, []);
25
+ *
26
+ * return <>{children}</>;
27
+ * }
28
+ *
29
+ * // Use anywhere - no provider needed
30
+ * function Header() {
31
+ * const { cartCount, openCart, isReady } = useCheckout();
32
+ *
33
+ * return (
34
+ * <button onClick={openCart} disabled={!isReady}>
35
+ * Cart ({cartCount})
36
+ * </button>
37
+ * );
38
+ * }
39
+ * ```
40
+ *
41
+ * @packageDocumentation
42
+ */
43
+ /**
44
+ * React hook for checkout integration
45
+ *
46
+ * Provides reactive access to checkout state and methods.
47
+ * No provider required - works anywhere in your component tree.
48
+ *
49
+ * @returns Checkout state and methods
50
+ *
51
+ * @example Basic usage
52
+ * ```tsx
53
+ * function CartButton() {
54
+ * const { cartCount, openCart, isReady } = useCheckout();
55
+ *
56
+ * return (
57
+ * <button onClick={openCart} disabled={!isReady}>
58
+ * Cart ({cartCount})
59
+ * </button>
60
+ * );
61
+ * }
62
+ * ```
63
+ *
64
+ * @example Add to cart
65
+ * ```tsx
66
+ * function ProductCard({ product }) {
67
+ * const { addToCart } = useCheckout();
68
+ *
69
+ * return (
70
+ * <button onClick={() => addToCart(product.id, product.variantId, 1)}>
71
+ * Add to Cart
72
+ * </button>
73
+ * );
74
+ * }
75
+ * ```
76
+ */
77
+ function useCheckout() {
78
+ const state = useStore(checkoutStore, useShallow((s) => ({
79
+ isReady: s.isReady,
80
+ isOpen: s.isOpen,
81
+ cartCount: s.cartCount,
82
+ cartTotal: s.cartTotal,
83
+ cartCurrency: s.cartCurrency
84
+ })));
85
+ const actions = useStore(checkoutStore, useShallow((s) => ({
86
+ openCart: s.openCart,
87
+ openCheckout: s.openCheckout,
88
+ close: s.close,
89
+ addToCart: s.addToCart,
90
+ updateTokens: s.updateTokens
91
+ })));
92
+ return {
93
+ ...state,
94
+ ...actions
95
+ };
96
+ }
97
+
98
+ //#endregion
99
+ export { checkoutStore, destroyCheckout, getCheckout, initCheckout, subscribeToCheckout, useCheckout };
100
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","names":[],"sources":["../src/react.ts"],"sourcesContent":["/**\n * Commerce Engine Checkout - React Binding\n *\n * React hook for checkout integration with automatic state synchronization.\n *\n * @example\n * ```tsx\n * import { useCheckout, initCheckout } from \"@commercengine/checkout/react\";\n *\n * // Initialize once at app root\n * function App() {\n * useEffect(() => {\n * initCheckout({\n * storeId: \"store_xxx\",\n * apiKey: \"ak_xxx\",\n * onComplete: (order) => router.push(\"/thank-you\"),\n * });\n * return () => destroyCheckout();\n * }, []);\n *\n * return <>{children}</>;\n * }\n *\n * // Use anywhere - no provider needed\n * function Header() {\n * const { cartCount, openCart, isReady } = useCheckout();\n *\n * return (\n * <button onClick={openCart} disabled={!isReady}>\n * Cart ({cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\nimport { type CheckoutActions, type CheckoutState, checkoutStore } from \"./store\";\n\n// Re-export types from @commercengine/js\nexport type {\n AddToCartItem,\n AuthLoginData,\n AuthLogoutData,\n AuthMode,\n AuthRefreshData,\n CartData,\n Channel,\n CheckoutConfig,\n CheckoutEventType,\n Environment,\n ErrorData,\n LoginMethod,\n OrderData,\n QuickBuyConfig,\n SessionMode,\n UserInfo,\n} from \"@commercengine/js\";\n// Re-export everything from vanilla for convenience\nexport {\n type CheckoutActions,\n type CheckoutState,\n type CheckoutStore,\n checkoutStore,\n destroyCheckout,\n getCheckout,\n initCheckout,\n subscribeToCheckout,\n} from \"./store\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Return type from useCheckout hook\n */\nexport interface UseCheckoutReturn {\n /** Whether checkout is ready to use */\n isReady: boolean;\n /** Whether checkout overlay is currently open */\n isOpen: boolean;\n /** Number of items in cart */\n cartCount: number;\n /** Cart subtotal amount */\n cartTotal: number;\n /** Cart currency code */\n cartCurrency: string;\n /** Open the cart drawer */\n openCart: () => void;\n /** Open the checkout drawer directly */\n openCheckout: () => void;\n /** Close the checkout overlay */\n close: () => void;\n /** Add item to cart */\n addToCart: (productId: string, variantId: string | null, quantity?: number) => void;\n /** Update authentication tokens */\n updateTokens: (accessToken: string, refreshToken?: string) => void;\n}\n\n// =============================================================================\n// HOOK\n// =============================================================================\n\n/**\n * React hook for checkout integration\n *\n * Provides reactive access to checkout state and methods.\n * No provider required - works anywhere in your component tree.\n *\n * @returns Checkout state and methods\n *\n * @example Basic usage\n * ```tsx\n * function CartButton() {\n * const { cartCount, openCart, isReady } = useCheckout();\n *\n * return (\n * <button onClick={openCart} disabled={!isReady}>\n * Cart ({cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @example Add to cart\n * ```tsx\n * function ProductCard({ product }) {\n * const { addToCart } = useCheckout();\n *\n * return (\n * <button onClick={() => addToCart(product.id, product.variantId, 1)}>\n * Add to Cart\n * </button>\n * );\n * }\n * ```\n */\nexport function useCheckout(): UseCheckoutReturn {\n // Subscribe to state with shallow comparison to prevent unnecessary re-renders\n const state = useStore(\n checkoutStore,\n useShallow((s: CheckoutState) => ({\n isReady: s.isReady,\n isOpen: s.isOpen,\n cartCount: s.cartCount,\n cartTotal: s.cartTotal,\n cartCurrency: s.cartCurrency,\n }))\n );\n\n // Actions are stable references from the store\n const actions = useStore(\n checkoutStore,\n useShallow((s: CheckoutActions) => ({\n openCart: s.openCart,\n openCheckout: s.openCheckout,\n close: s.close,\n addToCart: s.addToCart,\n updateTokens: s.updateTokens,\n }))\n );\n\n return {\n ...state,\n ...actions,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6IA,SAAgB,cAAiC;CAE/C,MAAM,QAAQ,SACZ,eACA,YAAY,OAAsB;EAChC,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,WAAW,EAAE;EACb,WAAW,EAAE;EACb,cAAc,EAAE;EACjB,EAAE,CACJ;CAGD,MAAM,UAAU,SACd,eACA,YAAY,OAAwB;EAClC,UAAU,EAAE;EACZ,cAAc,EAAE;EAChB,OAAO,EAAE;EACT,WAAW,EAAE;EACb,cAAc,EAAE;EACjB,EAAE,CACJ;AAED,QAAO;EACL,GAAG;EACH,GAAG;EACJ"}
package/dist/solid.cjs ADDED
@@ -0,0 +1,162 @@
1
+ const require_store = require('./store.cjs');
2
+ let solid_js = require("solid-js");
3
+
4
+ //#region src/solid.ts
5
+ /**
6
+ * Commerce Engine Checkout - Solid Binding
7
+ *
8
+ * Solid.js primitive for checkout integration with fine-grained reactivity.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { useCheckout, initCheckout } from "@commercengine/checkout/solid";
13
+ * import { onMount, onCleanup } from "solid-js";
14
+ *
15
+ * // Initialize once at app root
16
+ * function App() {
17
+ * onMount(() => {
18
+ * initCheckout({
19
+ * storeId: "store_xxx",
20
+ * apiKey: "ak_xxx",
21
+ * });
22
+ * });
23
+ *
24
+ * return <>{props.children}</>;
25
+ * }
26
+ *
27
+ * // Use anywhere
28
+ * function Header() {
29
+ * const checkout = useCheckout();
30
+ *
31
+ * return (
32
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
33
+ * Cart ({checkout.cartCount})
34
+ * </button>
35
+ * );
36
+ * }
37
+ * ```
38
+ *
39
+ * @packageDocumentation
40
+ */
41
+ /**
42
+ * Solid.js primitive for checkout integration
43
+ *
44
+ * Returns an object with reactive getters for state and methods for actions.
45
+ * Uses Solid's fine-grained reactivity - components only re-render when
46
+ * accessed values change.
47
+ *
48
+ * @returns Checkout state (reactive getters) and methods
49
+ *
50
+ * @example Basic usage
51
+ * ```tsx
52
+ * function CartButton() {
53
+ * const checkout = useCheckout();
54
+ *
55
+ * return (
56
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
57
+ * Cart ({checkout.cartCount})
58
+ * </button>
59
+ * );
60
+ * }
61
+ * ```
62
+ *
63
+ * @example Add to cart
64
+ * ```tsx
65
+ * function ProductCard(props) {
66
+ * const checkout = useCheckout();
67
+ *
68
+ * return (
69
+ * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>
70
+ * Add to Cart
71
+ * </button>
72
+ * );
73
+ * }
74
+ * ```
75
+ */
76
+ function useCheckout() {
77
+ const initialState = require_store.checkoutStore.getState();
78
+ const [isReady, setIsReady] = (0, solid_js.createSignal)(initialState.isReady);
79
+ const [isOpen, setIsOpen] = (0, solid_js.createSignal)(initialState.isOpen);
80
+ const [cartCount, setCartCount] = (0, solid_js.createSignal)(initialState.cartCount);
81
+ const [cartTotal, setCartTotal] = (0, solid_js.createSignal)(initialState.cartTotal);
82
+ const [cartCurrency, setCartCurrency] = (0, solid_js.createSignal)(initialState.cartCurrency);
83
+ const unsubscribe = require_store.checkoutStore.subscribe((state) => {
84
+ setIsReady(state.isReady);
85
+ setIsOpen(state.isOpen);
86
+ setCartCount(state.cartCount);
87
+ setCartTotal(state.cartTotal);
88
+ setCartCurrency(state.cartCurrency);
89
+ });
90
+ (0, solid_js.onCleanup)(() => {
91
+ unsubscribe();
92
+ });
93
+ return {
94
+ get isReady() {
95
+ return isReady();
96
+ },
97
+ get isOpen() {
98
+ return isOpen();
99
+ },
100
+ get cartCount() {
101
+ return cartCount();
102
+ },
103
+ get cartTotal() {
104
+ return cartTotal();
105
+ },
106
+ get cartCurrency() {
107
+ return cartCurrency();
108
+ },
109
+ openCart: () => require_store.checkoutStore.getState().openCart(),
110
+ openCheckout: () => require_store.checkoutStore.getState().openCheckout(),
111
+ close: () => require_store.checkoutStore.getState().close(),
112
+ addToCart: (productId, variantId, quantity) => require_store.checkoutStore.getState().addToCart(productId, variantId, quantity),
113
+ updateTokens: (accessToken, refreshToken) => require_store.checkoutStore.getState().updateTokens(accessToken, refreshToken)
114
+ };
115
+ }
116
+ /**
117
+ * Create a reactive signal for cart count only
118
+ *
119
+ * Use this when you only need cart count and want minimal re-renders.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * function Badge() {
124
+ * const count = createCartCountSignal();
125
+ * return <span class="badge">{count()}</span>;
126
+ * }
127
+ * ```
128
+ */
129
+ function createCartCountSignal() {
130
+ const [cartCount, setCartCount] = (0, solid_js.createSignal)(require_store.checkoutStore.getState().cartCount);
131
+ const unsubscribe = require_store.checkoutStore.subscribe((state, prevState) => {
132
+ if (state.cartCount !== prevState.cartCount) setCartCount(state.cartCount);
133
+ });
134
+ (0, solid_js.onCleanup)(() => {
135
+ unsubscribe();
136
+ });
137
+ return cartCount;
138
+ }
139
+ /**
140
+ * Create a reactive signal for ready state only
141
+ */
142
+ function createIsReadySignal() {
143
+ const [isReady, setIsReady] = (0, solid_js.createSignal)(require_store.checkoutStore.getState().isReady);
144
+ const unsubscribe = require_store.checkoutStore.subscribe((state, prevState) => {
145
+ if (state.isReady !== prevState.isReady) setIsReady(state.isReady);
146
+ });
147
+ (0, solid_js.onCleanup)(() => {
148
+ unsubscribe();
149
+ });
150
+ return isReady;
151
+ }
152
+
153
+ //#endregion
154
+ exports.checkoutStore = require_store.checkoutStore;
155
+ exports.createCartCountSignal = createCartCountSignal;
156
+ exports.createIsReadySignal = createIsReadySignal;
157
+ exports.destroyCheckout = require_store.destroyCheckout;
158
+ exports.getCheckout = require_store.getCheckout;
159
+ exports.initCheckout = require_store.initCheckout;
160
+ exports.subscribeToCheckout = require_store.subscribeToCheckout;
161
+ exports.useCheckout = useCheckout;
162
+ //# sourceMappingURL=solid.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.cjs","names":["checkoutStore"],"sources":["../src/solid.ts"],"sourcesContent":["/**\n * Commerce Engine Checkout - Solid Binding\n *\n * Solid.js primitive for checkout integration with fine-grained reactivity.\n *\n * @example\n * ```tsx\n * import { useCheckout, initCheckout } from \"@commercengine/checkout/solid\";\n * import { onMount, onCleanup } from \"solid-js\";\n *\n * // Initialize once at app root\n * function App() {\n * onMount(() => {\n * initCheckout({\n * storeId: \"store_xxx\",\n * apiKey: \"ak_xxx\",\n * });\n * });\n *\n * return <>{props.children}</>;\n * }\n *\n * // Use anywhere\n * function Header() {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>\n * Cart ({checkout.cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { type Accessor, createSignal, onCleanup } from \"solid-js\";\nimport { checkoutStore } from \"./store\";\n\n// Re-export types from @commercengine/js\nexport type {\n AddToCartItem,\n AuthLoginData,\n AuthLogoutData,\n AuthMode,\n AuthRefreshData,\n CartData,\n Channel,\n CheckoutConfig,\n CheckoutEventType,\n Environment,\n ErrorData,\n LoginMethod,\n OrderData,\n QuickBuyConfig,\n SessionMode,\n UserInfo,\n} from \"@commercengine/js\";\n// Re-export everything from vanilla for convenience\nexport {\n type CheckoutActions,\n type CheckoutState,\n type CheckoutStore,\n checkoutStore,\n destroyCheckout,\n getCheckout,\n initCheckout,\n subscribeToCheckout,\n} from \"./store\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Return type from useCheckout\n *\n * State properties are getters that return reactive values.\n * Actions are regular functions.\n */\nexport interface UseCheckoutReturn {\n /** Whether checkout is ready to use (reactive getter) */\n readonly isReady: boolean;\n /** Whether checkout overlay is currently open (reactive getter) */\n readonly isOpen: boolean;\n /** Number of items in cart (reactive getter) */\n readonly cartCount: number;\n /** Cart subtotal amount (reactive getter) */\n readonly cartTotal: number;\n /** Cart currency code (reactive getter) */\n readonly cartCurrency: string;\n /** Open the cart drawer */\n openCart: () => void;\n /** Open the checkout drawer directly */\n openCheckout: () => void;\n /** Close the checkout overlay */\n close: () => void;\n /** Add item to cart */\n addToCart: (productId: string, variantId: string | null, quantity?: number) => void;\n /** Update authentication tokens */\n updateTokens: (accessToken: string, refreshToken?: string) => void;\n}\n\n// =============================================================================\n// PRIMITIVE\n// =============================================================================\n\n/**\n * Solid.js primitive for checkout integration\n *\n * Returns an object with reactive getters for state and methods for actions.\n * Uses Solid's fine-grained reactivity - components only re-render when\n * accessed values change.\n *\n * @returns Checkout state (reactive getters) and methods\n *\n * @example Basic usage\n * ```tsx\n * function CartButton() {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>\n * Cart ({checkout.cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @example Add to cart\n * ```tsx\n * function ProductCard(props) {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>\n * Add to Cart\n * </button>\n * );\n * }\n * ```\n */\nexport function useCheckout(): UseCheckoutReturn {\n // Create signals for each piece of state\n const initialState = checkoutStore.getState();\n\n const [isReady, setIsReady] = createSignal(initialState.isReady);\n const [isOpen, setIsOpen] = createSignal(initialState.isOpen);\n const [cartCount, setCartCount] = createSignal(initialState.cartCount);\n const [cartTotal, setCartTotal] = createSignal(initialState.cartTotal);\n const [cartCurrency, setCartCurrency] = createSignal(initialState.cartCurrency);\n\n // Subscribe to store changes\n const unsubscribe = checkoutStore.subscribe((state) => {\n setIsReady(state.isReady);\n setIsOpen(state.isOpen);\n setCartCount(state.cartCount);\n setCartTotal(state.cartTotal);\n setCartCurrency(state.cartCurrency);\n });\n\n // Cleanup on component unmount\n onCleanup(() => {\n unsubscribe();\n });\n\n // Return object with reactive getters\n return {\n get isReady() {\n return isReady();\n },\n get isOpen() {\n return isOpen();\n },\n get cartCount() {\n return cartCount();\n },\n get cartTotal() {\n return cartTotal();\n },\n get cartCurrency() {\n return cartCurrency();\n },\n openCart: () => checkoutStore.getState().openCart(),\n openCheckout: () => checkoutStore.getState().openCheckout(),\n close: () => checkoutStore.getState().close(),\n addToCart: (productId, variantId, quantity) =>\n checkoutStore.getState().addToCart(productId, variantId, quantity),\n updateTokens: (accessToken, refreshToken) =>\n checkoutStore.getState().updateTokens(accessToken, refreshToken),\n };\n}\n\n// =============================================================================\n// INDIVIDUAL SIGNALS (for fine-grained subscriptions)\n// =============================================================================\n\n/**\n * Create a reactive signal for cart count only\n *\n * Use this when you only need cart count and want minimal re-renders.\n *\n * @example\n * ```tsx\n * function Badge() {\n * const count = createCartCountSignal();\n * return <span class=\"badge\">{count()}</span>;\n * }\n * ```\n */\nexport function createCartCountSignal(): Accessor<number> {\n const [cartCount, setCartCount] = createSignal(checkoutStore.getState().cartCount);\n\n const unsubscribe = checkoutStore.subscribe((state, prevState) => {\n if (state.cartCount !== prevState.cartCount) {\n setCartCount(state.cartCount);\n }\n });\n\n onCleanup(() => {\n unsubscribe();\n });\n\n return cartCount;\n}\n\n/**\n * Create a reactive signal for ready state only\n */\nexport function createIsReadySignal(): Accessor<boolean> {\n const [isReady, setIsReady] = createSignal(checkoutStore.getState().isReady);\n\n const unsubscribe = checkoutStore.subscribe((state, prevState) => {\n if (state.isReady !== prevState.isReady) {\n setIsReady(state.isReady);\n }\n });\n\n onCleanup(() => {\n unsubscribe();\n });\n\n return isReady;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+IA,SAAgB,cAAiC;CAE/C,MAAM,eAAeA,4BAAc,UAAU;CAE7C,MAAM,CAAC,SAAS,yCAA2B,aAAa,QAAQ;CAChE,MAAM,CAAC,QAAQ,wCAA0B,aAAa,OAAO;CAC7D,MAAM,CAAC,WAAW,2CAA6B,aAAa,UAAU;CACtE,MAAM,CAAC,WAAW,2CAA6B,aAAa,UAAU;CACtE,MAAM,CAAC,cAAc,8CAAgC,aAAa,aAAa;CAG/E,MAAM,cAAcA,4BAAc,WAAW,UAAU;AACrD,aAAW,MAAM,QAAQ;AACzB,YAAU,MAAM,OAAO;AACvB,eAAa,MAAM,UAAU;AAC7B,eAAa,MAAM,UAAU;AAC7B,kBAAgB,MAAM,aAAa;GACnC;AAGF,+BAAgB;AACd,eAAa;GACb;AAGF,QAAO;EACL,IAAI,UAAU;AACZ,UAAO,SAAS;;EAElB,IAAI,SAAS;AACX,UAAO,QAAQ;;EAEjB,IAAI,YAAY;AACd,UAAO,WAAW;;EAEpB,IAAI,YAAY;AACd,UAAO,WAAW;;EAEpB,IAAI,eAAe;AACjB,UAAO,cAAc;;EAEvB,gBAAgBA,4BAAc,UAAU,CAAC,UAAU;EACnD,oBAAoBA,4BAAc,UAAU,CAAC,cAAc;EAC3D,aAAaA,4BAAc,UAAU,CAAC,OAAO;EAC7C,YAAY,WAAW,WAAW,aAChCA,4BAAc,UAAU,CAAC,UAAU,WAAW,WAAW,SAAS;EACpE,eAAe,aAAa,iBAC1BA,4BAAc,UAAU,CAAC,aAAa,aAAa,aAAa;EACnE;;;;;;;;;;;;;;;AAoBH,SAAgB,wBAA0C;CACxD,MAAM,CAAC,WAAW,2CAA6BA,4BAAc,UAAU,CAAC,UAAU;CAElF,MAAM,cAAcA,4BAAc,WAAW,OAAO,cAAc;AAChE,MAAI,MAAM,cAAc,UAAU,UAChC,cAAa,MAAM,UAAU;GAE/B;AAEF,+BAAgB;AACd,eAAa;GACb;AAEF,QAAO;;;;;AAMT,SAAgB,sBAAyC;CACvD,MAAM,CAAC,SAAS,yCAA2BA,4BAAc,UAAU,CAAC,QAAQ;CAE5E,MAAM,cAAcA,4BAAc,WAAW,OAAO,cAAc;AAChE,MAAI,MAAM,YAAY,UAAU,QAC9B,YAAW,MAAM,QAAQ;GAE3B;AAEF,+BAAgB;AACd,eAAa;GACb;AAEF,QAAO"}
@@ -0,0 +1,92 @@
1
+ import { a as destroyCheckout, c as subscribeToCheckout, i as checkoutStore, n as CheckoutState, o as getCheckout, r as CheckoutStore, s as initCheckout, t as CheckoutActions } from "./store.cjs";
2
+ import { AddToCartItem, AuthLoginData, AuthLogoutData, AuthMode, AuthRefreshData, CartData, Channel, CheckoutConfig, CheckoutEventType, Environment, ErrorData, LoginMethod, OrderData, QuickBuyConfig, SessionMode, UserInfo } from "@commercengine/js";
3
+ import { Accessor } from "solid-js";
4
+
5
+ //#region src/solid.d.ts
6
+
7
+ /**
8
+ * Return type from useCheckout
9
+ *
10
+ * State properties are getters that return reactive values.
11
+ * Actions are regular functions.
12
+ */
13
+ interface UseCheckoutReturn {
14
+ /** Whether checkout is ready to use (reactive getter) */
15
+ readonly isReady: boolean;
16
+ /** Whether checkout overlay is currently open (reactive getter) */
17
+ readonly isOpen: boolean;
18
+ /** Number of items in cart (reactive getter) */
19
+ readonly cartCount: number;
20
+ /** Cart subtotal amount (reactive getter) */
21
+ readonly cartTotal: number;
22
+ /** Cart currency code (reactive getter) */
23
+ readonly cartCurrency: string;
24
+ /** Open the cart drawer */
25
+ openCart: () => void;
26
+ /** Open the checkout drawer directly */
27
+ openCheckout: () => void;
28
+ /** Close the checkout overlay */
29
+ close: () => void;
30
+ /** Add item to cart */
31
+ addToCart: (productId: string, variantId: string | null, quantity?: number) => void;
32
+ /** Update authentication tokens */
33
+ updateTokens: (accessToken: string, refreshToken?: string) => void;
34
+ }
35
+ /**
36
+ * Solid.js primitive for checkout integration
37
+ *
38
+ * Returns an object with reactive getters for state and methods for actions.
39
+ * Uses Solid's fine-grained reactivity - components only re-render when
40
+ * accessed values change.
41
+ *
42
+ * @returns Checkout state (reactive getters) and methods
43
+ *
44
+ * @example Basic usage
45
+ * ```tsx
46
+ * function CartButton() {
47
+ * const checkout = useCheckout();
48
+ *
49
+ * return (
50
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
51
+ * Cart ({checkout.cartCount})
52
+ * </button>
53
+ * );
54
+ * }
55
+ * ```
56
+ *
57
+ * @example Add to cart
58
+ * ```tsx
59
+ * function ProductCard(props) {
60
+ * const checkout = useCheckout();
61
+ *
62
+ * return (
63
+ * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>
64
+ * Add to Cart
65
+ * </button>
66
+ * );
67
+ * }
68
+ * ```
69
+ */
70
+ declare function useCheckout(): UseCheckoutReturn;
71
+ /**
72
+ * Create a reactive signal for cart count only
73
+ *
74
+ * Use this when you only need cart count and want minimal re-renders.
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * function Badge() {
79
+ * const count = createCartCountSignal();
80
+ * return <span class="badge">{count()}</span>;
81
+ * }
82
+ * ```
83
+ */
84
+ declare function createCartCountSignal(): Accessor<number>;
85
+ /**
86
+ * Create a reactive signal for ready state only
87
+ */
88
+ declare function createIsReadySignal(): Accessor<boolean>;
89
+ //# sourceMappingURL=solid.d.ts.map
90
+ //#endregion
91
+ export { type AddToCartItem, type AuthLoginData, type AuthLogoutData, type AuthMode, type AuthRefreshData, type CartData, type Channel, type CheckoutActions, type CheckoutConfig, type CheckoutEventType, type CheckoutState, type CheckoutStore, type Environment, type ErrorData, type LoginMethod, type OrderData, type QuickBuyConfig, type SessionMode, UseCheckoutReturn, type UserInfo, checkoutStore, createCartCountSignal, createIsReadySignal, destroyCheckout, getCheckout, initCheckout, subscribeToCheckout, useCheckout };
92
+ //# sourceMappingURL=solid.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.d.cts","names":[],"sources":["../src/solid.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAiFiB,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DD,WAAA,CAAA,GAAe;;;;;;;;;;;;;;iBAoEf,qBAAA,CAAA,GAAyB;;;;iBAmBzB,mBAAA,CAAA,GAAuB"}
@@ -0,0 +1,92 @@
1
+ import { a as destroyCheckout, c as subscribeToCheckout, i as checkoutStore, n as CheckoutState, o as getCheckout, r as CheckoutStore, s as initCheckout, t as CheckoutActions } from "./store.js";
2
+ import { AddToCartItem, AuthLoginData, AuthLogoutData, AuthMode, AuthRefreshData, CartData, Channel, CheckoutConfig, CheckoutEventType, Environment, ErrorData, LoginMethod, OrderData, QuickBuyConfig, SessionMode, UserInfo } from "@commercengine/js";
3
+ import { Accessor } from "solid-js";
4
+
5
+ //#region src/solid.d.ts
6
+
7
+ /**
8
+ * Return type from useCheckout
9
+ *
10
+ * State properties are getters that return reactive values.
11
+ * Actions are regular functions.
12
+ */
13
+ interface UseCheckoutReturn {
14
+ /** Whether checkout is ready to use (reactive getter) */
15
+ readonly isReady: boolean;
16
+ /** Whether checkout overlay is currently open (reactive getter) */
17
+ readonly isOpen: boolean;
18
+ /** Number of items in cart (reactive getter) */
19
+ readonly cartCount: number;
20
+ /** Cart subtotal amount (reactive getter) */
21
+ readonly cartTotal: number;
22
+ /** Cart currency code (reactive getter) */
23
+ readonly cartCurrency: string;
24
+ /** Open the cart drawer */
25
+ openCart: () => void;
26
+ /** Open the checkout drawer directly */
27
+ openCheckout: () => void;
28
+ /** Close the checkout overlay */
29
+ close: () => void;
30
+ /** Add item to cart */
31
+ addToCart: (productId: string, variantId: string | null, quantity?: number) => void;
32
+ /** Update authentication tokens */
33
+ updateTokens: (accessToken: string, refreshToken?: string) => void;
34
+ }
35
+ /**
36
+ * Solid.js primitive for checkout integration
37
+ *
38
+ * Returns an object with reactive getters for state and methods for actions.
39
+ * Uses Solid's fine-grained reactivity - components only re-render when
40
+ * accessed values change.
41
+ *
42
+ * @returns Checkout state (reactive getters) and methods
43
+ *
44
+ * @example Basic usage
45
+ * ```tsx
46
+ * function CartButton() {
47
+ * const checkout = useCheckout();
48
+ *
49
+ * return (
50
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
51
+ * Cart ({checkout.cartCount})
52
+ * </button>
53
+ * );
54
+ * }
55
+ * ```
56
+ *
57
+ * @example Add to cart
58
+ * ```tsx
59
+ * function ProductCard(props) {
60
+ * const checkout = useCheckout();
61
+ *
62
+ * return (
63
+ * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>
64
+ * Add to Cart
65
+ * </button>
66
+ * );
67
+ * }
68
+ * ```
69
+ */
70
+ declare function useCheckout(): UseCheckoutReturn;
71
+ /**
72
+ * Create a reactive signal for cart count only
73
+ *
74
+ * Use this when you only need cart count and want minimal re-renders.
75
+ *
76
+ * @example
77
+ * ```tsx
78
+ * function Badge() {
79
+ * const count = createCartCountSignal();
80
+ * return <span class="badge">{count()}</span>;
81
+ * }
82
+ * ```
83
+ */
84
+ declare function createCartCountSignal(): Accessor<number>;
85
+ /**
86
+ * Create a reactive signal for ready state only
87
+ */
88
+ declare function createIsReadySignal(): Accessor<boolean>;
89
+ //# sourceMappingURL=solid.d.ts.map
90
+ //#endregion
91
+ export { type AddToCartItem, type AuthLoginData, type AuthLogoutData, type AuthMode, type AuthRefreshData, type CartData, type Channel, type CheckoutActions, type CheckoutConfig, type CheckoutEventType, type CheckoutState, type CheckoutStore, type Environment, type ErrorData, type LoginMethod, type OrderData, type QuickBuyConfig, type SessionMode, UseCheckoutReturn, type UserInfo, checkoutStore, createCartCountSignal, createIsReadySignal, destroyCheckout, getCheckout, initCheckout, subscribeToCheckout, useCheckout };
92
+ //# sourceMappingURL=solid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.d.ts","names":[],"sources":["../src/solid.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAiFiB,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DD,WAAA,CAAA,GAAe;;;;;;;;;;;;;;iBAoEf,qBAAA,CAAA,GAAyB;;;;iBAmBzB,mBAAA,CAAA,GAAuB"}
package/dist/solid.js ADDED
@@ -0,0 +1,155 @@
1
+ import { a as subscribeToCheckout, i as initCheckout, n as destroyCheckout, r as getCheckout, t as checkoutStore } from "./store.js";
2
+ import { createSignal, onCleanup } from "solid-js";
3
+
4
+ //#region src/solid.ts
5
+ /**
6
+ * Commerce Engine Checkout - Solid Binding
7
+ *
8
+ * Solid.js primitive for checkout integration with fine-grained reactivity.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { useCheckout, initCheckout } from "@commercengine/checkout/solid";
13
+ * import { onMount, onCleanup } from "solid-js";
14
+ *
15
+ * // Initialize once at app root
16
+ * function App() {
17
+ * onMount(() => {
18
+ * initCheckout({
19
+ * storeId: "store_xxx",
20
+ * apiKey: "ak_xxx",
21
+ * });
22
+ * });
23
+ *
24
+ * return <>{props.children}</>;
25
+ * }
26
+ *
27
+ * // Use anywhere
28
+ * function Header() {
29
+ * const checkout = useCheckout();
30
+ *
31
+ * return (
32
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
33
+ * Cart ({checkout.cartCount})
34
+ * </button>
35
+ * );
36
+ * }
37
+ * ```
38
+ *
39
+ * @packageDocumentation
40
+ */
41
+ /**
42
+ * Solid.js primitive for checkout integration
43
+ *
44
+ * Returns an object with reactive getters for state and methods for actions.
45
+ * Uses Solid's fine-grained reactivity - components only re-render when
46
+ * accessed values change.
47
+ *
48
+ * @returns Checkout state (reactive getters) and methods
49
+ *
50
+ * @example Basic usage
51
+ * ```tsx
52
+ * function CartButton() {
53
+ * const checkout = useCheckout();
54
+ *
55
+ * return (
56
+ * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>
57
+ * Cart ({checkout.cartCount})
58
+ * </button>
59
+ * );
60
+ * }
61
+ * ```
62
+ *
63
+ * @example Add to cart
64
+ * ```tsx
65
+ * function ProductCard(props) {
66
+ * const checkout = useCheckout();
67
+ *
68
+ * return (
69
+ * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>
70
+ * Add to Cart
71
+ * </button>
72
+ * );
73
+ * }
74
+ * ```
75
+ */
76
+ function useCheckout() {
77
+ const initialState = checkoutStore.getState();
78
+ const [isReady, setIsReady] = createSignal(initialState.isReady);
79
+ const [isOpen, setIsOpen] = createSignal(initialState.isOpen);
80
+ const [cartCount, setCartCount] = createSignal(initialState.cartCount);
81
+ const [cartTotal, setCartTotal] = createSignal(initialState.cartTotal);
82
+ const [cartCurrency, setCartCurrency] = createSignal(initialState.cartCurrency);
83
+ const unsubscribe = checkoutStore.subscribe((state) => {
84
+ setIsReady(state.isReady);
85
+ setIsOpen(state.isOpen);
86
+ setCartCount(state.cartCount);
87
+ setCartTotal(state.cartTotal);
88
+ setCartCurrency(state.cartCurrency);
89
+ });
90
+ onCleanup(() => {
91
+ unsubscribe();
92
+ });
93
+ return {
94
+ get isReady() {
95
+ return isReady();
96
+ },
97
+ get isOpen() {
98
+ return isOpen();
99
+ },
100
+ get cartCount() {
101
+ return cartCount();
102
+ },
103
+ get cartTotal() {
104
+ return cartTotal();
105
+ },
106
+ get cartCurrency() {
107
+ return cartCurrency();
108
+ },
109
+ openCart: () => checkoutStore.getState().openCart(),
110
+ openCheckout: () => checkoutStore.getState().openCheckout(),
111
+ close: () => checkoutStore.getState().close(),
112
+ addToCart: (productId, variantId, quantity) => checkoutStore.getState().addToCart(productId, variantId, quantity),
113
+ updateTokens: (accessToken, refreshToken) => checkoutStore.getState().updateTokens(accessToken, refreshToken)
114
+ };
115
+ }
116
+ /**
117
+ * Create a reactive signal for cart count only
118
+ *
119
+ * Use this when you only need cart count and want minimal re-renders.
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * function Badge() {
124
+ * const count = createCartCountSignal();
125
+ * return <span class="badge">{count()}</span>;
126
+ * }
127
+ * ```
128
+ */
129
+ function createCartCountSignal() {
130
+ const [cartCount, setCartCount] = createSignal(checkoutStore.getState().cartCount);
131
+ const unsubscribe = checkoutStore.subscribe((state, prevState) => {
132
+ if (state.cartCount !== prevState.cartCount) setCartCount(state.cartCount);
133
+ });
134
+ onCleanup(() => {
135
+ unsubscribe();
136
+ });
137
+ return cartCount;
138
+ }
139
+ /**
140
+ * Create a reactive signal for ready state only
141
+ */
142
+ function createIsReadySignal() {
143
+ const [isReady, setIsReady] = createSignal(checkoutStore.getState().isReady);
144
+ const unsubscribe = checkoutStore.subscribe((state, prevState) => {
145
+ if (state.isReady !== prevState.isReady) setIsReady(state.isReady);
146
+ });
147
+ onCleanup(() => {
148
+ unsubscribe();
149
+ });
150
+ return isReady;
151
+ }
152
+
153
+ //#endregion
154
+ export { checkoutStore, createCartCountSignal, createIsReadySignal, destroyCheckout, getCheckout, initCheckout, subscribeToCheckout, useCheckout };
155
+ //# sourceMappingURL=solid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid.js","names":[],"sources":["../src/solid.ts"],"sourcesContent":["/**\n * Commerce Engine Checkout - Solid Binding\n *\n * Solid.js primitive for checkout integration with fine-grained reactivity.\n *\n * @example\n * ```tsx\n * import { useCheckout, initCheckout } from \"@commercengine/checkout/solid\";\n * import { onMount, onCleanup } from \"solid-js\";\n *\n * // Initialize once at app root\n * function App() {\n * onMount(() => {\n * initCheckout({\n * storeId: \"store_xxx\",\n * apiKey: \"ak_xxx\",\n * });\n * });\n *\n * return <>{props.children}</>;\n * }\n *\n * // Use anywhere\n * function Header() {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>\n * Cart ({checkout.cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { type Accessor, createSignal, onCleanup } from \"solid-js\";\nimport { checkoutStore } from \"./store\";\n\n// Re-export types from @commercengine/js\nexport type {\n AddToCartItem,\n AuthLoginData,\n AuthLogoutData,\n AuthMode,\n AuthRefreshData,\n CartData,\n Channel,\n CheckoutConfig,\n CheckoutEventType,\n Environment,\n ErrorData,\n LoginMethod,\n OrderData,\n QuickBuyConfig,\n SessionMode,\n UserInfo,\n} from \"@commercengine/js\";\n// Re-export everything from vanilla for convenience\nexport {\n type CheckoutActions,\n type CheckoutState,\n type CheckoutStore,\n checkoutStore,\n destroyCheckout,\n getCheckout,\n initCheckout,\n subscribeToCheckout,\n} from \"./store\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Return type from useCheckout\n *\n * State properties are getters that return reactive values.\n * Actions are regular functions.\n */\nexport interface UseCheckoutReturn {\n /** Whether checkout is ready to use (reactive getter) */\n readonly isReady: boolean;\n /** Whether checkout overlay is currently open (reactive getter) */\n readonly isOpen: boolean;\n /** Number of items in cart (reactive getter) */\n readonly cartCount: number;\n /** Cart subtotal amount (reactive getter) */\n readonly cartTotal: number;\n /** Cart currency code (reactive getter) */\n readonly cartCurrency: string;\n /** Open the cart drawer */\n openCart: () => void;\n /** Open the checkout drawer directly */\n openCheckout: () => void;\n /** Close the checkout overlay */\n close: () => void;\n /** Add item to cart */\n addToCart: (productId: string, variantId: string | null, quantity?: number) => void;\n /** Update authentication tokens */\n updateTokens: (accessToken: string, refreshToken?: string) => void;\n}\n\n// =============================================================================\n// PRIMITIVE\n// =============================================================================\n\n/**\n * Solid.js primitive for checkout integration\n *\n * Returns an object with reactive getters for state and methods for actions.\n * Uses Solid's fine-grained reactivity - components only re-render when\n * accessed values change.\n *\n * @returns Checkout state (reactive getters) and methods\n *\n * @example Basic usage\n * ```tsx\n * function CartButton() {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.openCart()} disabled={!checkout.isReady}>\n * Cart ({checkout.cartCount})\n * </button>\n * );\n * }\n * ```\n *\n * @example Add to cart\n * ```tsx\n * function ProductCard(props) {\n * const checkout = useCheckout();\n *\n * return (\n * <button onClick={() => checkout.addToCart(props.product.id, props.product.variantId, 1)}>\n * Add to Cart\n * </button>\n * );\n * }\n * ```\n */\nexport function useCheckout(): UseCheckoutReturn {\n // Create signals for each piece of state\n const initialState = checkoutStore.getState();\n\n const [isReady, setIsReady] = createSignal(initialState.isReady);\n const [isOpen, setIsOpen] = createSignal(initialState.isOpen);\n const [cartCount, setCartCount] = createSignal(initialState.cartCount);\n const [cartTotal, setCartTotal] = createSignal(initialState.cartTotal);\n const [cartCurrency, setCartCurrency] = createSignal(initialState.cartCurrency);\n\n // Subscribe to store changes\n const unsubscribe = checkoutStore.subscribe((state) => {\n setIsReady(state.isReady);\n setIsOpen(state.isOpen);\n setCartCount(state.cartCount);\n setCartTotal(state.cartTotal);\n setCartCurrency(state.cartCurrency);\n });\n\n // Cleanup on component unmount\n onCleanup(() => {\n unsubscribe();\n });\n\n // Return object with reactive getters\n return {\n get isReady() {\n return isReady();\n },\n get isOpen() {\n return isOpen();\n },\n get cartCount() {\n return cartCount();\n },\n get cartTotal() {\n return cartTotal();\n },\n get cartCurrency() {\n return cartCurrency();\n },\n openCart: () => checkoutStore.getState().openCart(),\n openCheckout: () => checkoutStore.getState().openCheckout(),\n close: () => checkoutStore.getState().close(),\n addToCart: (productId, variantId, quantity) =>\n checkoutStore.getState().addToCart(productId, variantId, quantity),\n updateTokens: (accessToken, refreshToken) =>\n checkoutStore.getState().updateTokens(accessToken, refreshToken),\n };\n}\n\n// =============================================================================\n// INDIVIDUAL SIGNALS (for fine-grained subscriptions)\n// =============================================================================\n\n/**\n * Create a reactive signal for cart count only\n *\n * Use this when you only need cart count and want minimal re-renders.\n *\n * @example\n * ```tsx\n * function Badge() {\n * const count = createCartCountSignal();\n * return <span class=\"badge\">{count()}</span>;\n * }\n * ```\n */\nexport function createCartCountSignal(): Accessor<number> {\n const [cartCount, setCartCount] = createSignal(checkoutStore.getState().cartCount);\n\n const unsubscribe = checkoutStore.subscribe((state, prevState) => {\n if (state.cartCount !== prevState.cartCount) {\n setCartCount(state.cartCount);\n }\n });\n\n onCleanup(() => {\n unsubscribe();\n });\n\n return cartCount;\n}\n\n/**\n * Create a reactive signal for ready state only\n */\nexport function createIsReadySignal(): Accessor<boolean> {\n const [isReady, setIsReady] = createSignal(checkoutStore.getState().isReady);\n\n const unsubscribe = checkoutStore.subscribe((state, prevState) => {\n if (state.isReady !== prevState.isReady) {\n setIsReady(state.isReady);\n }\n });\n\n onCleanup(() => {\n unsubscribe();\n });\n\n return isReady;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+IA,SAAgB,cAAiC;CAE/C,MAAM,eAAe,cAAc,UAAU;CAE7C,MAAM,CAAC,SAAS,cAAc,aAAa,aAAa,QAAQ;CAChE,MAAM,CAAC,QAAQ,aAAa,aAAa,aAAa,OAAO;CAC7D,MAAM,CAAC,WAAW,gBAAgB,aAAa,aAAa,UAAU;CACtE,MAAM,CAAC,WAAW,gBAAgB,aAAa,aAAa,UAAU;CACtE,MAAM,CAAC,cAAc,mBAAmB,aAAa,aAAa,aAAa;CAG/E,MAAM,cAAc,cAAc,WAAW,UAAU;AACrD,aAAW,MAAM,QAAQ;AACzB,YAAU,MAAM,OAAO;AACvB,eAAa,MAAM,UAAU;AAC7B,eAAa,MAAM,UAAU;AAC7B,kBAAgB,MAAM,aAAa;GACnC;AAGF,iBAAgB;AACd,eAAa;GACb;AAGF,QAAO;EACL,IAAI,UAAU;AACZ,UAAO,SAAS;;EAElB,IAAI,SAAS;AACX,UAAO,QAAQ;;EAEjB,IAAI,YAAY;AACd,UAAO,WAAW;;EAEpB,IAAI,YAAY;AACd,UAAO,WAAW;;EAEpB,IAAI,eAAe;AACjB,UAAO,cAAc;;EAEvB,gBAAgB,cAAc,UAAU,CAAC,UAAU;EACnD,oBAAoB,cAAc,UAAU,CAAC,cAAc;EAC3D,aAAa,cAAc,UAAU,CAAC,OAAO;EAC7C,YAAY,WAAW,WAAW,aAChC,cAAc,UAAU,CAAC,UAAU,WAAW,WAAW,SAAS;EACpE,eAAe,aAAa,iBAC1B,cAAc,UAAU,CAAC,aAAa,aAAa,aAAa;EACnE;;;;;;;;;;;;;;;AAoBH,SAAgB,wBAA0C;CACxD,MAAM,CAAC,WAAW,gBAAgB,aAAa,cAAc,UAAU,CAAC,UAAU;CAElF,MAAM,cAAc,cAAc,WAAW,OAAO,cAAc;AAChE,MAAI,MAAM,cAAc,UAAU,UAChC,cAAa,MAAM,UAAU;GAE/B;AAEF,iBAAgB;AACd,eAAa;GACb;AAEF,QAAO;;;;;AAMT,SAAgB,sBAAyC;CACvD,MAAM,CAAC,SAAS,cAAc,aAAa,cAAc,UAAU,CAAC,QAAQ;CAE5E,MAAM,cAAc,cAAc,WAAW,OAAO,cAAc;AAChE,MAAI,MAAM,YAAY,UAAU,QAC9B,YAAW,MAAM,QAAQ;GAE3B;AAEF,iBAAgB;AACd,eAAa;GACb;AAEF,QAAO"}