@disconetwork/shopify 0.0.2 → 0.0.4
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/README.md +2 -12
- package/dist/{DiscoRecommendations-C-89x_hF.js → DiscoRecommendations-BeqZ2x4q.js} +379 -133
- package/dist/DiscoRecommendations-BeqZ2x4q.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/package.json +3 -3
- package/dist/DiscoRecommendations-C-89x_hF.js.map +0 -1
|
@@ -1,14 +1,224 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
2
2
|
import { createContext } from "preact";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cloneElement, createContext as createContext$1, createElement, isValidElement, useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useState as useState$1 } from "preact/compat";
|
|
4
|
+
import { withImpressionDedupe } from "@disconetwork/core";
|
|
5
|
+
import { jsx } from "preact/jsx-runtime";
|
|
6
|
+
import { INTERNAL_BASE_URL, InternalDiscoClient, parseScreens } from "@disconetwork/core/internal";
|
|
7
|
+
import { Fragment, jsx as jsx$1, jsxs } from "preact/jsx-runtime";
|
|
5
8
|
import { useApi, useBillingAddress, useCartLines, useCheckoutToken, useCustomer, useDiscountCodes, useEmail, usePhone, usePurchasingCompany, useShippingAddress, useShop, useSubscription, useTotalAmount } from "@shopify/ui-extensions/checkout/preact";
|
|
6
9
|
import { useApi as useApi$1, useBillingAddress as useBillingAddress$1, useCartLines as useCartLines$1, useCustomer as useCustomer$1, useDiscountCodes as useDiscountCodes$1, useEmail as useEmail$1, useOrder, usePhone as usePhone$1, usePurchasingCompany as usePurchasingCompany$1, useShippingAddress as useShippingAddress$1, useShop as useShop$1, useSubscription as useSubscription$1, useTotalAmount as useTotalAmount$1 } from "@shopify/ui-extensions/customer-account/preact";
|
|
7
|
-
|
|
10
|
+
//#region ../react-shared/dist/createHeadlessBindings-CPuF5wZQ.js
|
|
11
|
+
/**
|
|
12
|
+
* Build a self-contained set of headless React bindings for one client type.
|
|
13
|
+
*
|
|
14
|
+
* Returns the client context (for a backing-specific `DiscoProvider` to provide
|
|
15
|
+
* into), the `useDiscoClient` accessor, the `Disco.Root` controller, and the
|
|
16
|
+
* `useDiscoRecommendations` / `useDiscoTracker` / `useFetchRecommendations`
|
|
17
|
+
* hooks — all concretely typed to `TRequest` / `TResponse`. Call this once per
|
|
18
|
+
* backing at module load; the returned components/hooks are stable references.
|
|
19
|
+
*/
|
|
20
|
+
function createHeadlessBindings() {
|
|
21
|
+
/**
|
|
22
|
+
* Holds the client built by the backing's `<DiscoProvider>`. Read it with
|
|
23
|
+
* `useDiscoClient` to fetch recommendations or create trackers.
|
|
24
|
+
*/
|
|
25
|
+
const DiscoClientContext = createContext$1(null);
|
|
26
|
+
/**
|
|
27
|
+
* Read the client configured by the surrounding `<DiscoProvider>`.
|
|
28
|
+
*
|
|
29
|
+
* Returns the single, stable, provider-configured instance — use this rather
|
|
30
|
+
* than constructing a client in a component (which would create a new one each
|
|
31
|
+
* render and risk drifting from the provider's auth/env). Throws if used
|
|
32
|
+
* outside a provider.
|
|
33
|
+
*/
|
|
34
|
+
function useDiscoClient() {
|
|
35
|
+
const client = useContext$1(DiscoClientContext);
|
|
36
|
+
if (!client) throw new Error("useDiscoClient must be used inside a <DiscoProvider>.");
|
|
37
|
+
return client;
|
|
38
|
+
}
|
|
39
|
+
const LOADING = {
|
|
40
|
+
status: "loading",
|
|
41
|
+
data: void 0,
|
|
42
|
+
error: void 0
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Fetch-on-mount state machine for a recommendations surface.
|
|
46
|
+
*
|
|
47
|
+
* Owns the request lifecycle — fetch on mount, refetch when the request
|
|
48
|
+
* changes or `refetch` is called, abort in-flight requests on unmount/change —
|
|
49
|
+
* and derives the session-bound tracker from each response. Renders nothing and
|
|
50
|
+
* knows nothing about the `Disco.*` contexts; `<Disco.Root>` adapts its result.
|
|
51
|
+
*
|
|
52
|
+
* Exported from each backing's `/headless` entry as the shared fetch
|
|
53
|
+
* primitive: `<Disco.Root>` builds on it. Reach for it directly only when
|
|
54
|
+
* building a custom surface that needs the fetch lifecycle without the
|
|
55
|
+
* `Disco.*` contexts.
|
|
56
|
+
*/
|
|
57
|
+
function useFetchRecommendations(request) {
|
|
58
|
+
const client = useDiscoClient();
|
|
59
|
+
const [state, setState] = useState$1(LOADING);
|
|
60
|
+
const [tracker, setTracker] = useState$1(null);
|
|
61
|
+
const requestKey = useMemo$1(() => JSON.stringify(request), [request]);
|
|
62
|
+
const [reloadCount, setReloadCount] = useState$1(0);
|
|
63
|
+
const refetch = useCallback$1(() => setReloadCount((n) => n + 1), []);
|
|
64
|
+
useEffect$1(() => {
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
setState(LOADING);
|
|
67
|
+
setTracker(null);
|
|
68
|
+
client.getRecommendationsWithTracker(request, { signal: controller.signal }).then(({ data, tracker }) => {
|
|
69
|
+
if (controller.signal.aborted) return;
|
|
70
|
+
setState({
|
|
71
|
+
status: "success",
|
|
72
|
+
data,
|
|
73
|
+
error: void 0
|
|
74
|
+
});
|
|
75
|
+
setTracker(withImpressionDedupe(tracker));
|
|
76
|
+
}).catch((error) => {
|
|
77
|
+
if (controller.signal.aborted) return;
|
|
78
|
+
setState({
|
|
79
|
+
status: "error",
|
|
80
|
+
data: void 0,
|
|
81
|
+
error
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return () => controller.abort();
|
|
85
|
+
}, [
|
|
86
|
+
client,
|
|
87
|
+
requestKey,
|
|
88
|
+
reloadCount
|
|
89
|
+
]);
|
|
90
|
+
return {
|
|
91
|
+
state,
|
|
92
|
+
tracker,
|
|
93
|
+
refetch
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const DiscoContext = createContext$1(null);
|
|
97
|
+
/**
|
|
98
|
+
* Read the recommendations fetch state, the session-bound tracker, and
|
|
99
|
+
* `refetch` from the surrounding `<Disco.Root>`. The tracker is non-null only
|
|
100
|
+
* once `status === "success"`; for consumers that only need the tracker and
|
|
101
|
+
* render inside a success branch, {@link useDiscoTracker} returns a non-null
|
|
102
|
+
* tracker and throws if used before success. Throws if used outside a
|
|
103
|
+
* `<Disco.Root>`.
|
|
104
|
+
*/
|
|
105
|
+
function useDiscoRecommendations() {
|
|
106
|
+
const ctx = useContext$1(DiscoContext);
|
|
107
|
+
if (!ctx) throw new Error("useDiscoRecommendations must be used inside a <Disco.Root>.");
|
|
108
|
+
return ctx;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Read the session-bound {@link EventTracker} for the surrounding
|
|
112
|
+
* `<Disco.Root>`.
|
|
113
|
+
*
|
|
114
|
+
* The tracker exists only once recommendations have loaded (its session comes
|
|
115
|
+
* from the response). Render tracking UI inside the `success` branch and this
|
|
116
|
+
* hook returns a ready tracker; it throws if used before `success`, surfacing
|
|
117
|
+
* misuse loudly rather than silently dropping events. Throws if used outside a
|
|
118
|
+
* `<Disco.Root>`.
|
|
119
|
+
*/
|
|
120
|
+
function useDiscoTracker() {
|
|
121
|
+
const ctx = useContext$1(DiscoContext);
|
|
122
|
+
if (!ctx) throw new Error("useDiscoTracker must be used inside a <Disco.Root>.");
|
|
123
|
+
if (!ctx.tracker) throw new Error("useDiscoTracker is only available after recommendations have loaded — render tracking UI inside the <Disco.Root> success branch.");
|
|
124
|
+
return ctx.tracker;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Headless controller for a Disco recommendations surface — the root of the
|
|
128
|
+
* `Disco.*` compound. Fetches via `useFetchRecommendations` and provides the
|
|
129
|
+
* fetch state (read with `useDiscoRecommendations`) and the session-bound
|
|
130
|
+
* tracker (read with `useDiscoTracker`) to its subtree. Renders no UI of its
|
|
131
|
+
* own; aborts in-flight requests on unmount or request change.
|
|
132
|
+
*/
|
|
133
|
+
function DiscoRoot({ request, children }) {
|
|
134
|
+
const { state, tracker, refetch } = useFetchRecommendations(request);
|
|
135
|
+
const value = useMemo$1(() => ({
|
|
136
|
+
...state,
|
|
137
|
+
tracker,
|
|
138
|
+
refetch
|
|
139
|
+
}), [
|
|
140
|
+
state,
|
|
141
|
+
tracker,
|
|
142
|
+
refetch
|
|
143
|
+
]);
|
|
144
|
+
return /* @__PURE__ */ jsx(DiscoContext.Provider, {
|
|
145
|
+
value,
|
|
146
|
+
children
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
DiscoClientContext,
|
|
151
|
+
useDiscoClient,
|
|
152
|
+
useDiscoRecommendations,
|
|
153
|
+
useDiscoTracker,
|
|
154
|
+
useFetchRecommendations,
|
|
155
|
+
DiscoRoot
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../react-shared/dist/bindings-D-XXI0bV.js
|
|
160
|
+
const bindings = createHeadlessBindings();
|
|
161
|
+
const DiscoClientContext = bindings.DiscoClientContext;
|
|
162
|
+
const useDiscoClient = bindings.useDiscoClient;
|
|
163
|
+
bindings.DiscoRoot;
|
|
164
|
+
const useFetchRecommendations = bindings.useFetchRecommendations;
|
|
165
|
+
bindings.useDiscoRecommendations;
|
|
166
|
+
bindings.useDiscoTracker;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../react-shared/dist/headless-C9iZrlrk.js
|
|
169
|
+
const RendererContext = createContext$1(null);
|
|
170
|
+
function useRendererContext() {
|
|
171
|
+
const ctx = useContext$1(RendererContext);
|
|
172
|
+
if (!ctx) throw new Error("useRendererContext must be used within a ScreensRenderer");
|
|
173
|
+
return ctx;
|
|
174
|
+
}
|
|
175
|
+
function generateNodes({ nodes, path, renderers }) {
|
|
176
|
+
return nodes.map((node, idx) => {
|
|
177
|
+
const generator = renderers[node.type];
|
|
178
|
+
if (!generator) throw new Error(`No renderer found for node type: "${node.type}"`);
|
|
179
|
+
const nodePath = `${path}.${node.type}.${idx}`;
|
|
180
|
+
const reactNode = generator({
|
|
181
|
+
node,
|
|
182
|
+
nodesToJSX: (args) => generateNodes({
|
|
183
|
+
nodes: args.nodes,
|
|
184
|
+
path: nodePath,
|
|
185
|
+
renderers
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
if (isValidElement(reactNode)) return cloneElement(reactNode, { key: nodePath });
|
|
189
|
+
return reactNode;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function ScreensRenderer({ jsonContent, renderers, fallback = null }) {
|
|
193
|
+
const screens = useMemo$1(() => parseScreens(jsonContent), [jsonContent]);
|
|
194
|
+
if (!screens) return fallback;
|
|
195
|
+
return createElement(ScreensNavigator, {
|
|
196
|
+
screens,
|
|
197
|
+
renderers
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function ScreensNavigator({ screens, renderers }) {
|
|
201
|
+
const [currentScreenId, setCurrentScreenId] = useState$1(() => screens[0]?.id ?? "default");
|
|
202
|
+
useEffect$1(() => {
|
|
203
|
+
setCurrentScreenId(screens[0]?.id ?? "default");
|
|
204
|
+
}, [screens]);
|
|
205
|
+
const activeScreen = screens.find((screen) => screen.id === currentScreenId) ?? screens[0];
|
|
206
|
+
if (!activeScreen) return null;
|
|
207
|
+
return createElement(RendererContext.Provider, { value: {
|
|
208
|
+
screens,
|
|
209
|
+
currentScreenId: activeScreen.id,
|
|
210
|
+
setCurrentScreenId
|
|
211
|
+
} }, generateNodes({
|
|
212
|
+
nodes: activeScreen.children,
|
|
213
|
+
path: activeScreen.id,
|
|
214
|
+
renderers
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
8
218
|
//#region src/managers/RecommendationsTrackingManager/index.tsx
|
|
9
219
|
const RecommendationsTrackingManagerContext = createContext(null);
|
|
10
220
|
function RecommendationsTrackingManager({ children, tracker }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(RecommendationsTrackingManagerContext.Provider, {
|
|
221
|
+
return /* @__PURE__ */ jsx$1(RecommendationsTrackingManagerContext.Provider, {
|
|
12
222
|
value: tracker,
|
|
13
223
|
children
|
|
14
224
|
});
|
|
@@ -64,7 +274,7 @@ const getRecommendationsRequest = ({ payload }) => {
|
|
|
64
274
|
//#endregion
|
|
65
275
|
//#region src/components/CardContainer.tsx
|
|
66
276
|
const CardContainer = ({ children, ...rest }) => {
|
|
67
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
277
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
68
278
|
border: "base",
|
|
69
279
|
borderWidth: "base",
|
|
70
280
|
borderRadius: "large",
|
|
@@ -83,16 +293,16 @@ const DummyDiscoFeedRow = () => {
|
|
|
83
293
|
direction: "inline",
|
|
84
294
|
gap: "small-200",
|
|
85
295
|
alignItems: "center",
|
|
86
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
296
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
87
297
|
blockSize: "18px",
|
|
88
298
|
inlineSize: "18px",
|
|
89
299
|
background: "subdued",
|
|
90
300
|
borderRadius: "base"
|
|
91
|
-
}), /* @__PURE__ */ jsx("s-skeleton-paragraph", { content: "Brand" })]
|
|
92
|
-
}), /* @__PURE__ */ jsx("s-scroll-box", { children: /* @__PURE__ */ jsx("s-grid", {
|
|
301
|
+
}), /* @__PURE__ */ jsx$1("s-skeleton-paragraph", { content: "Brand" })]
|
|
302
|
+
}), /* @__PURE__ */ jsx$1("s-scroll-box", { children: /* @__PURE__ */ jsx$1("s-grid", {
|
|
93
303
|
gridTemplateColumns: `repeat(10, ${productSize}px)`,
|
|
94
304
|
gap: "small-200",
|
|
95
|
-
children: Array.from({ length: 10 }, (_, index) => /* @__PURE__ */ jsx("s-box", {
|
|
305
|
+
children: Array.from({ length: 10 }, (_, index) => /* @__PURE__ */ jsx$1("s-box", {
|
|
96
306
|
blockSize: `${productSize}px`,
|
|
97
307
|
inlineSize: `${productSize}px`,
|
|
98
308
|
background: "subdued",
|
|
@@ -104,22 +314,58 @@ const DummyDiscoFeedRow = () => {
|
|
|
104
314
|
const DummyDiscoFeedContent = ({ isPadded = false, brandCount = 3, showHeading = false }) => /* @__PURE__ */ jsxs("s-stack", {
|
|
105
315
|
padding: isPadded ? DISCO_FEED_CARD_PADDING : void 0,
|
|
106
316
|
gap: "large-500",
|
|
107
|
-
children: [showHeading && /* @__PURE__ */ jsx("s-skeleton-paragraph", { content: "Recommendations" }), Array.from({ length: brandCount }, (_, index) => /* @__PURE__ */ jsx(DummyDiscoFeedRow, {}, index))]
|
|
317
|
+
children: [showHeading && /* @__PURE__ */ jsx$1("s-skeleton-paragraph", { content: "Recommendations" }), Array.from({ length: brandCount }, (_, index) => /* @__PURE__ */ jsx$1(DummyDiscoFeedRow, {}, index))]
|
|
108
318
|
});
|
|
109
|
-
const DummyDiscoFeed = () => /* @__PURE__ */ jsx(CardContainer, {
|
|
319
|
+
const DummyDiscoFeed = () => /* @__PURE__ */ jsx$1(CardContainer, {
|
|
110
320
|
background: "base",
|
|
111
|
-
children: /* @__PURE__ */ jsx(DummyDiscoFeedContent, {
|
|
321
|
+
children: /* @__PURE__ */ jsx$1(DummyDiscoFeedContent, {
|
|
112
322
|
brandCount: 4,
|
|
113
323
|
showHeading: true,
|
|
114
324
|
isPadded: true
|
|
115
325
|
})
|
|
116
326
|
});
|
|
117
327
|
//#endregion
|
|
328
|
+
//#region src/sdkIdentity.ts
|
|
329
|
+
const SDK_IDENTITY = {
|
|
330
|
+
name: "@disconetwork/shopify",
|
|
331
|
+
version: "0.0.4"
|
|
332
|
+
};
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region ../react-shared/dist/sdk-internals.js
|
|
335
|
+
/** @internal Bind SDK identity to a provider using the legacy backend proxy. */
|
|
336
|
+
function createProxySdkProvider(sdk) {
|
|
337
|
+
return function ProxySdkProvider({ children, ...auth }) {
|
|
338
|
+
const apiKey = "apiKey" in auth ? auth.apiKey : void 0;
|
|
339
|
+
const surface = "surface" in auth ? auth.surface : void 0;
|
|
340
|
+
const shopGid = "shopGid" in auth ? auth.shopGid : void 0;
|
|
341
|
+
const env = "env" in auth ? auth.env : void 0;
|
|
342
|
+
const client = useMemo$1(() => apiKey !== void 0 ? new InternalDiscoClient({
|
|
343
|
+
apiKey,
|
|
344
|
+
surface,
|
|
345
|
+
sdk
|
|
346
|
+
}) : new InternalDiscoClient({
|
|
347
|
+
shopGid,
|
|
348
|
+
env,
|
|
349
|
+
sdk
|
|
350
|
+
}), [
|
|
351
|
+
apiKey,
|
|
352
|
+
surface,
|
|
353
|
+
shopGid,
|
|
354
|
+
env
|
|
355
|
+
]);
|
|
356
|
+
return /* @__PURE__ */ jsx(DiscoClientContext.Provider, {
|
|
357
|
+
value: client,
|
|
358
|
+
children
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
118
363
|
//#region src/managers/DataManager.tsx
|
|
364
|
+
const ShopifySdkProvider = createProxySdkProvider(SDK_IDENTITY);
|
|
119
365
|
const MIN_LOADING_VIEW_HEIGHT = 800;
|
|
120
366
|
const DataManager = ({ auth, children }) => {
|
|
121
367
|
const payload = usePayload();
|
|
122
|
-
return /* @__PURE__ */ jsx(
|
|
368
|
+
return /* @__PURE__ */ jsx$1(ShopifySdkProvider, {
|
|
123
369
|
..."apiKey" in auth ? {
|
|
124
370
|
apiKey: auth.apiKey,
|
|
125
371
|
surface: "shopify"
|
|
@@ -127,7 +373,7 @@ const DataManager = ({ auth, children }) => {
|
|
|
127
373
|
shopGid: payload.shopGid,
|
|
128
374
|
env: auth.env
|
|
129
375
|
},
|
|
130
|
-
children: /* @__PURE__ */ jsx(RecommendationsContent, {
|
|
376
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsContent, {
|
|
131
377
|
request: getRecommendationsRequest({ payload }),
|
|
132
378
|
children
|
|
133
379
|
})
|
|
@@ -136,13 +382,13 @@ const DataManager = ({ auth, children }) => {
|
|
|
136
382
|
const RecommendationsContent = ({ children, request }) => {
|
|
137
383
|
const { state: recommendations, tracker } = useFetchRecommendations(request);
|
|
138
384
|
if (recommendations.status === "error") return null;
|
|
139
|
-
if (recommendations.status === "loading" || !tracker) return /* @__PURE__ */ jsx("s-box", {
|
|
385
|
+
if (recommendations.status === "loading" || !tracker) return /* @__PURE__ */ jsx$1("s-box", {
|
|
140
386
|
minBlockSize: `${MIN_LOADING_VIEW_HEIGHT}px`,
|
|
141
|
-
children: /* @__PURE__ */ jsx(DummyDiscoFeed, {}, "dummy-feed")
|
|
387
|
+
children: /* @__PURE__ */ jsx$1(DummyDiscoFeed, {}, "dummy-feed")
|
|
142
388
|
});
|
|
143
|
-
return /* @__PURE__ */ jsx(RecommendationsDataContext.Provider, {
|
|
389
|
+
return /* @__PURE__ */ jsx$1(RecommendationsDataContext.Provider, {
|
|
144
390
|
value: recommendations.data,
|
|
145
|
-
children: /* @__PURE__ */ jsx(RecommendationsTrackingManager, {
|
|
391
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsTrackingManager, {
|
|
146
392
|
tracker,
|
|
147
393
|
children
|
|
148
394
|
})
|
|
@@ -156,7 +402,7 @@ const GenericPayloadProvider = ({ target, children, payload, additionalPayload,
|
|
|
156
402
|
throw new Error("[Disco]: Disabling for B2B purchase");
|
|
157
403
|
}, [isB2BPurchase]);
|
|
158
404
|
if (isB2BPurchase) return null;
|
|
159
|
-
return /* @__PURE__ */ jsx(PayloadContext.Provider, {
|
|
405
|
+
return /* @__PURE__ */ jsx$1(PayloadContext.Provider, {
|
|
160
406
|
value: {
|
|
161
407
|
...payload,
|
|
162
408
|
...additionalPayload || {},
|
|
@@ -207,7 +453,7 @@ const ThankYouPayloadManager = ({ children }) => {
|
|
|
207
453
|
const api = useApi();
|
|
208
454
|
const orderId = useSubscription(api.orderConfirmation).order.id.split("/").pop();
|
|
209
455
|
if (!orderId) console.warn("[Disco]: Order ID not found in thank you page");
|
|
210
|
-
return /* @__PURE__ */ jsx(GenericPayloadProvider, {
|
|
456
|
+
return /* @__PURE__ */ jsx$1(GenericPayloadProvider, {
|
|
211
457
|
target,
|
|
212
458
|
payload: createGenericPayload({
|
|
213
459
|
buyerPhone,
|
|
@@ -244,7 +490,7 @@ const OrderStatusPayloadManager = ({ children }) => {
|
|
|
244
490
|
const shop = useShop$1();
|
|
245
491
|
const order = useOrder();
|
|
246
492
|
const api = useApi$1();
|
|
247
|
-
return /* @__PURE__ */ jsx(GenericPayloadProvider, {
|
|
493
|
+
return /* @__PURE__ */ jsx$1(GenericPayloadProvider, {
|
|
248
494
|
target,
|
|
249
495
|
payload: createGenericPayload({
|
|
250
496
|
buyerPhone,
|
|
@@ -281,8 +527,8 @@ const getExtensionTarget = () => globalThis.shopify?.extension?.target;
|
|
|
281
527
|
const PayloadManager = ({ children }) => {
|
|
282
528
|
const extensionTarget = getExtensionTarget();
|
|
283
529
|
const target = extensionTarget && EXTENSION_TARGETS[extensionTarget];
|
|
284
|
-
if (target === PAYLOAD_MANAGER_TARGET.THANK_YOU) return /* @__PURE__ */ jsx(ThankYouPayloadManager, { children });
|
|
285
|
-
if (target === PAYLOAD_MANAGER_TARGET.ORDER_STATUS) return /* @__PURE__ */ jsx(OrderStatusPayloadManager, { children });
|
|
530
|
+
if (target === PAYLOAD_MANAGER_TARGET.THANK_YOU) return /* @__PURE__ */ jsx$1(ThankYouPayloadManager, { children });
|
|
531
|
+
if (target === PAYLOAD_MANAGER_TARGET.ORDER_STATUS) return /* @__PURE__ */ jsx$1(OrderStatusPayloadManager, { children });
|
|
286
532
|
throw new Error(`[Disco]: Unsupported extension target ${extensionTarget ?? "(none)"}`);
|
|
287
533
|
};
|
|
288
534
|
//#endregion
|
|
@@ -298,7 +544,7 @@ const UserManager = ({ children }) => {
|
|
|
298
544
|
extrapolatedFirstName
|
|
299
545
|
});
|
|
300
546
|
const hasIdentity = useMemo(() => !!user?.email, [user]);
|
|
301
|
-
return /* @__PURE__ */ jsx(UserContext.Provider, {
|
|
547
|
+
return /* @__PURE__ */ jsx$1(UserContext.Provider, {
|
|
302
548
|
value: {
|
|
303
549
|
user,
|
|
304
550
|
setUser,
|
|
@@ -379,7 +625,7 @@ const HeroOfferProvider = ({ children, recommendationGroup, loop }) => {
|
|
|
379
625
|
claimedOffers,
|
|
380
626
|
recommendations
|
|
381
627
|
};
|
|
382
|
-
return /* @__PURE__ */ jsx(HeroContext.Provider, {
|
|
628
|
+
return /* @__PURE__ */ jsx$1(HeroContext.Provider, {
|
|
383
629
|
value,
|
|
384
630
|
children
|
|
385
631
|
});
|
|
@@ -394,7 +640,7 @@ const useHeroOffer = () => {
|
|
|
394
640
|
const ScrollableSlotContext = createContext(null);
|
|
395
641
|
const ScrollableSlotProvider = ({ children, scrollableRecommendationGroup }) => {
|
|
396
642
|
const value = { hasScrollableSlot: !!scrollableRecommendationGroup };
|
|
397
|
-
return /* @__PURE__ */ jsx(ScrollableSlotContext.Provider, {
|
|
643
|
+
return /* @__PURE__ */ jsx$1(ScrollableSlotContext.Provider, {
|
|
398
644
|
value,
|
|
399
645
|
children
|
|
400
646
|
});
|
|
@@ -531,7 +777,7 @@ const useDiscoEnv = () => useDiscoClient().env;
|
|
|
531
777
|
//#region src/components/Essential/generation/LinkGenerator.tsx
|
|
532
778
|
function InternalLink({ targetScreenId, children }) {
|
|
533
779
|
const ctx = useRendererContext();
|
|
534
|
-
return /* @__PURE__ */ jsx("s-link", {
|
|
780
|
+
return /* @__PURE__ */ jsx$1("s-link", {
|
|
535
781
|
tone: "neutral",
|
|
536
782
|
onClick: () => ctx.setCurrentScreenId(targetScreenId),
|
|
537
783
|
children
|
|
@@ -539,13 +785,13 @@ function InternalLink({ targetScreenId, children }) {
|
|
|
539
785
|
}
|
|
540
786
|
const LinkGenerator = { link: ({ node, nodesToJSX }) => {
|
|
541
787
|
const children = nodesToJSX({ nodes: node.children });
|
|
542
|
-
if ("targetScreenId" in node.attributes) return /* @__PURE__ */ jsx(InternalLink, {
|
|
788
|
+
if ("targetScreenId" in node.attributes) return /* @__PURE__ */ jsx$1(InternalLink, {
|
|
543
789
|
targetScreenId: node.attributes.targetScreenId,
|
|
544
790
|
children
|
|
545
791
|
});
|
|
546
792
|
const href = node.attributes.to;
|
|
547
793
|
const external = node.attributes.external;
|
|
548
|
-
return /* @__PURE__ */ jsx("s-link", {
|
|
794
|
+
return /* @__PURE__ */ jsx$1("s-link", {
|
|
549
795
|
tone: "neutral",
|
|
550
796
|
href,
|
|
551
797
|
target: external ? "_blank" : "auto",
|
|
@@ -555,9 +801,9 @@ const LinkGenerator = { link: ({ node, nodesToJSX }) => {
|
|
|
555
801
|
//#endregion
|
|
556
802
|
//#region src/components/Essential/generation/ParagraphGenerator.tsx
|
|
557
803
|
const ParagraphGenerator = { paragraph: ({ node, nodesToJSX }) => {
|
|
558
|
-
return /* @__PURE__ */ jsx("s-paragraph", {
|
|
804
|
+
return /* @__PURE__ */ jsx$1("s-paragraph", {
|
|
559
805
|
color: "subdued",
|
|
560
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
806
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
561
807
|
type: "strong",
|
|
562
808
|
children: nodesToJSX({ nodes: node.children })
|
|
563
809
|
})
|
|
@@ -568,7 +814,7 @@ const ParagraphGenerator = { paragraph: ({ node, nodesToJSX }) => {
|
|
|
568
814
|
const DEFAULT_MAX_BLOCK_SIZE = 300;
|
|
569
815
|
const ScrollViewGenerator = { scrollview: ({ node, nodesToJSX }) => {
|
|
570
816
|
const children = nodesToJSX({ nodes: node.children });
|
|
571
|
-
return /* @__PURE__ */ jsx("s-scroll-box", {
|
|
817
|
+
return /* @__PURE__ */ jsx$1("s-scroll-box", {
|
|
572
818
|
maxBlockSize: `${node.attributes?.maxBlockSize ?? DEFAULT_MAX_BLOCK_SIZE}px`,
|
|
573
819
|
children
|
|
574
820
|
});
|
|
@@ -586,12 +832,12 @@ const renderers = {
|
|
|
586
832
|
const EssentialOfferContent = ({ heading: offerHeading, subheading: offerSubheading, jsonContent: incentiveJson }) => {
|
|
587
833
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
588
834
|
gap: "small-200",
|
|
589
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: offerHeading }), /* @__PURE__ */ jsx(ScreensRenderer, {
|
|
835
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: offerHeading }), /* @__PURE__ */ jsx$1(ScreensRenderer, {
|
|
590
836
|
jsonContent: incentiveJson,
|
|
591
837
|
renderers,
|
|
592
|
-
fallback: /* @__PURE__ */ jsx("s-paragraph", {
|
|
838
|
+
fallback: /* @__PURE__ */ jsx$1("s-paragraph", {
|
|
593
839
|
color: "subdued",
|
|
594
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
840
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
595
841
|
type: "strong",
|
|
596
842
|
children: offerSubheading || ""
|
|
597
843
|
})
|
|
@@ -604,43 +850,43 @@ const EssentialOfferContent = ({ heading: offerHeading, subheading: offerSubhead
|
|
|
604
850
|
const EssentialLayoutType = ({ onLastOffer, compact }) => {
|
|
605
851
|
const { isFirstOffer, activeRecommendation: recommendation } = useHeroOffer();
|
|
606
852
|
const renderBrandLogo = recommendation.offer.metadata.layoutType === "FEATURED_IMAGE";
|
|
607
|
-
return /* @__PURE__ */ jsx("s-query-container", { children: /* @__PURE__ */ jsx("s-box", {
|
|
853
|
+
return /* @__PURE__ */ jsx$1("s-query-container", { children: /* @__PURE__ */ jsx$1("s-box", {
|
|
608
854
|
padding: compact ? "none" : "base",
|
|
609
855
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
610
856
|
gap: "small-400",
|
|
611
857
|
children: [
|
|
612
|
-
renderBrandLogo && /* @__PURE__ */ jsx("s-box", {
|
|
858
|
+
renderBrandLogo && /* @__PURE__ */ jsx$1("s-box", {
|
|
613
859
|
display: "@container (inline-size > 450px) none, auto",
|
|
614
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
860
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
615
861
|
alignItems: "center",
|
|
616
|
-
children: /* @__PURE__ */ jsx(AdvertiserLogo, { recommendation })
|
|
862
|
+
children: /* @__PURE__ */ jsx$1(AdvertiserLogo, { recommendation })
|
|
617
863
|
})
|
|
618
864
|
}),
|
|
619
|
-
isFirstOffer && !compact && /* @__PURE__ */ jsx(FirstOfferHeading, {}),
|
|
865
|
+
isFirstOffer && !compact && /* @__PURE__ */ jsx$1(FirstOfferHeading, {}),
|
|
620
866
|
/* @__PURE__ */ jsxs("s-grid", {
|
|
621
867
|
gridTemplateColumns: renderBrandLogo ? "@container (inline-size > 450px) 1fr auto, 1fr" : "1fr",
|
|
622
868
|
gap: "base",
|
|
623
869
|
alignItems: "center",
|
|
624
870
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
625
871
|
gap: "base",
|
|
626
|
-
children: [/* @__PURE__ */ jsx(EssentialOfferContent, {
|
|
872
|
+
children: [/* @__PURE__ */ jsx$1(EssentialOfferContent, {
|
|
627
873
|
heading: recommendation.offer.heading || "",
|
|
628
874
|
subheading: recommendation.offer.subheading || "",
|
|
629
875
|
jsonContent: recommendation.offer.jsonContent
|
|
630
876
|
}), /* @__PURE__ */ jsxs("s-stack", {
|
|
631
877
|
direction: "@container (inline-size > 450px) inline, block",
|
|
632
878
|
gap: "base",
|
|
633
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
879
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
634
880
|
inlineSize: "@container (inline-size > 450px) auto, 100%",
|
|
635
|
-
children: /* @__PURE__ */ jsx(PrimaryButton, {})
|
|
636
|
-
}), /* @__PURE__ */ jsx("s-box", {
|
|
881
|
+
children: /* @__PURE__ */ jsx$1(PrimaryButton, {})
|
|
882
|
+
}), /* @__PURE__ */ jsx$1("s-box", {
|
|
637
883
|
inlineSize: "@container (inline-size > 450px) auto, 100%",
|
|
638
|
-
children: /* @__PURE__ */ jsx(SecondaryButton, { onLastOffer })
|
|
884
|
+
children: /* @__PURE__ */ jsx$1(SecondaryButton, { onLastOffer })
|
|
639
885
|
})]
|
|
640
886
|
})]
|
|
641
|
-
}), renderBrandLogo && /* @__PURE__ */ jsx("s-box", {
|
|
887
|
+
}), renderBrandLogo && /* @__PURE__ */ jsx$1("s-box", {
|
|
642
888
|
display: "@container (inline-size > 450px) auto, none",
|
|
643
|
-
children: /* @__PURE__ */ jsx(AdvertiserLogo, { recommendation })
|
|
889
|
+
children: /* @__PURE__ */ jsx$1(AdvertiserLogo, { recommendation })
|
|
644
890
|
})]
|
|
645
891
|
})
|
|
646
892
|
]
|
|
@@ -655,10 +901,10 @@ function AdvertiserLogo({ recommendation }) {
|
|
|
655
901
|
env,
|
|
656
902
|
size: imageSize
|
|
657
903
|
});
|
|
658
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
904
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
659
905
|
blockSize: `${imageSize}px`,
|
|
660
906
|
inlineSize: `${imageSize}px`,
|
|
661
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
907
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
662
908
|
aspectRatio: "1",
|
|
663
909
|
src: image.src,
|
|
664
910
|
srcSet: image.srcSet,
|
|
@@ -682,7 +928,7 @@ function PrimaryButton() {
|
|
|
682
928
|
});
|
|
683
929
|
handleOfferClaim();
|
|
684
930
|
};
|
|
685
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
931
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
686
932
|
href: recommendation.offer.targetUrl,
|
|
687
933
|
target: "_blank",
|
|
688
934
|
inlineSize: "fill",
|
|
@@ -712,7 +958,7 @@ function SecondaryButton({ onLastOffer }) {
|
|
|
712
958
|
nextOffer();
|
|
713
959
|
};
|
|
714
960
|
const buttonText = isOfferClaimed ? isLastOffer ? hasScrollableSlot ? "See more" : "Close" : "Next offer" : recommendation.offer.ctaDetails.declineCopy || "No thanks";
|
|
715
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
961
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
716
962
|
inlineSize: "fill",
|
|
717
963
|
variant: isOfferClaimed ? "primary" : "secondary",
|
|
718
964
|
onClick: handleClick,
|
|
@@ -720,7 +966,7 @@ function SecondaryButton({ onLastOffer }) {
|
|
|
720
966
|
});
|
|
721
967
|
}
|
|
722
968
|
function FirstOfferHeading() {
|
|
723
|
-
return /* @__PURE__ */ jsx("s-text", {
|
|
969
|
+
return /* @__PURE__ */ jsx$1("s-text", {
|
|
724
970
|
tone: "info",
|
|
725
971
|
children: useFirstOfferHeading()
|
|
726
972
|
});
|
|
@@ -729,13 +975,13 @@ function FirstOfferHeading() {
|
|
|
729
975
|
//#region src/components/RecommendationsWidget/DotIndicators.tsx
|
|
730
976
|
const DotIndicators = ({ totalCount, activeIndex }) => {
|
|
731
977
|
if (totalCount <= 1) return null;
|
|
732
|
-
return /* @__PURE__ */ jsx("s-stack", {
|
|
978
|
+
return /* @__PURE__ */ jsx$1("s-stack", {
|
|
733
979
|
padding: "small-200 none",
|
|
734
980
|
alignItems: "center",
|
|
735
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
981
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
736
982
|
direction: "inline",
|
|
737
983
|
gap: "small-200",
|
|
738
|
-
children: Array.from({ length: totalCount }, (_, i) => /* @__PURE__ */ jsx("s-badge", {
|
|
984
|
+
children: Array.from({ length: totalCount }, (_, i) => /* @__PURE__ */ jsx$1("s-badge", {
|
|
739
985
|
size: "small",
|
|
740
986
|
color: i === activeIndex ? "base" : "subdued",
|
|
741
987
|
children: `${i + 1}`
|
|
@@ -750,9 +996,9 @@ const PRIVACY_POLICY_URL = "https://www.disconetwork.com/privacy-policy";
|
|
|
750
996
|
//#endregion
|
|
751
997
|
//#region src/components/PrivacyLink.tsx
|
|
752
998
|
const PrivacyLink = ({ onPress }) => {
|
|
753
|
-
return /* @__PURE__ */ jsx("s-text", {
|
|
999
|
+
return /* @__PURE__ */ jsx$1("s-text", {
|
|
754
1000
|
color: "subdued",
|
|
755
|
-
children: /* @__PURE__ */ jsx("s-link", {
|
|
1001
|
+
children: /* @__PURE__ */ jsx$1("s-link", {
|
|
756
1002
|
href: PRIVACY_POLICY_URL,
|
|
757
1003
|
target: "_blank",
|
|
758
1004
|
tone: "neutral",
|
|
@@ -771,10 +1017,10 @@ function Footer() {
|
|
|
771
1017
|
target: "INLINE_FOOTER_PRIVACY"
|
|
772
1018
|
});
|
|
773
1019
|
};
|
|
774
|
-
return /* @__PURE__ */ jsx("s-stack", {
|
|
1020
|
+
return /* @__PURE__ */ jsx$1("s-stack", {
|
|
775
1021
|
padding: "small-200 base",
|
|
776
1022
|
alignItems: "end",
|
|
777
|
-
children: /* @__PURE__ */ jsx(PrivacyLink, { onPress: handlePrivacyClick })
|
|
1023
|
+
children: /* @__PURE__ */ jsx$1(PrivacyLink, { onPress: handlePrivacyClick })
|
|
778
1024
|
});
|
|
779
1025
|
}
|
|
780
1026
|
//#endregion
|
|
@@ -784,10 +1030,10 @@ const CoverRecommendationsWidget = ({ heroRecommendationGroup }) => {
|
|
|
784
1030
|
useEffect(() => {
|
|
785
1031
|
track({ type: "WIDGET_LOAD" });
|
|
786
1032
|
}, [track]);
|
|
787
|
-
return /* @__PURE__ */ jsx(HeroOfferProvider, {
|
|
1033
|
+
return /* @__PURE__ */ jsx$1(HeroOfferProvider, {
|
|
788
1034
|
recommendationGroup: heroRecommendationGroup,
|
|
789
1035
|
loop: true,
|
|
790
|
-
children: /* @__PURE__ */ jsx(CoverRecommendationsWidgetContent, {})
|
|
1036
|
+
children: /* @__PURE__ */ jsx$1(CoverRecommendationsWidgetContent, {})
|
|
791
1037
|
});
|
|
792
1038
|
};
|
|
793
1039
|
const CoverRecommendationsWidgetContent = () => {
|
|
@@ -816,19 +1062,19 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
816
1062
|
advertiser.id
|
|
817
1063
|
]);
|
|
818
1064
|
const subtitle = `You've unlocked ${TOTAL_NUM_OFFERS} exclusive offer${TOTAL_NUM_OFFERS !== 1 ? "s" : ""} with your purchase — don't let them go to waste!`;
|
|
819
|
-
return /* @__PURE__ */ jsx(CardContainer, {
|
|
1065
|
+
return /* @__PURE__ */ jsx$1(CardContainer, {
|
|
820
1066
|
background: "transparent",
|
|
821
|
-
children: /* @__PURE__ */ jsx("s-box", {
|
|
1067
|
+
children: /* @__PURE__ */ jsx$1("s-box", {
|
|
822
1068
|
padding: "base",
|
|
823
1069
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
824
1070
|
gap: "base",
|
|
825
1071
|
children: [
|
|
826
|
-
/* @__PURE__ */ jsx("s-heading", { children: "Your purchase comes with rewards!" }),
|
|
827
|
-
/* @__PURE__ */ jsx("s-text", {
|
|
1072
|
+
/* @__PURE__ */ jsx$1("s-heading", { children: "Your purchase comes with rewards!" }),
|
|
1073
|
+
/* @__PURE__ */ jsx$1("s-text", {
|
|
828
1074
|
color: "subdued",
|
|
829
1075
|
children: subtitle
|
|
830
1076
|
}),
|
|
831
|
-
/* @__PURE__ */ jsx("s-button", {
|
|
1077
|
+
/* @__PURE__ */ jsx$1("s-button", {
|
|
832
1078
|
variant: "primary",
|
|
833
1079
|
command: "--show",
|
|
834
1080
|
commandFor: "cover-modal",
|
|
@@ -855,16 +1101,16 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
855
1101
|
});
|
|
856
1102
|
},
|
|
857
1103
|
children: [
|
|
858
|
-
/* @__PURE__ */ jsx(ScrollableSlotProvider, { children: /* @__PURE__ */ jsx(EssentialLayoutType, {
|
|
1104
|
+
/* @__PURE__ */ jsx$1(ScrollableSlotProvider, { children: /* @__PURE__ */ jsx$1(EssentialLayoutType, {
|
|
859
1105
|
onLastOffer: nextOffer,
|
|
860
1106
|
compact: true
|
|
861
1107
|
}) }),
|
|
862
|
-
/* @__PURE__ */ jsx(DotIndicators, {
|
|
1108
|
+
/* @__PURE__ */ jsx$1(DotIndicators, {
|
|
863
1109
|
totalCount: TOTAL_NUM_OFFERS,
|
|
864
1110
|
activeIndex: activeOfferIndex
|
|
865
1111
|
}),
|
|
866
|
-
/* @__PURE__ */ jsx("s-divider", {}),
|
|
867
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1112
|
+
/* @__PURE__ */ jsx$1("s-divider", {}),
|
|
1113
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
868
1114
|
]
|
|
869
1115
|
})
|
|
870
1116
|
]
|
|
@@ -875,19 +1121,19 @@ const CoverRecommendationsWidgetContent = () => {
|
|
|
875
1121
|
//#endregion
|
|
876
1122
|
//#region src/components/DiscoFeed/DiscoFeedProduct.tsx
|
|
877
1123
|
function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
878
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
1124
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
879
1125
|
inlineSize: "100%",
|
|
880
1126
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
881
1127
|
alignItems: "stretch",
|
|
882
1128
|
gap: "none",
|
|
883
|
-
children: [/* @__PURE__ */ jsx("s-link", {
|
|
1129
|
+
children: [/* @__PURE__ */ jsx$1("s-link", {
|
|
884
1130
|
target: "_blank",
|
|
885
1131
|
tone: "neutral",
|
|
886
1132
|
href: targetUrl,
|
|
887
1133
|
onClick: trackClick,
|
|
888
|
-
children: /* @__PURE__ */ jsx("s-box", {
|
|
1134
|
+
children: /* @__PURE__ */ jsx$1("s-box", {
|
|
889
1135
|
inlineSize: "100%",
|
|
890
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
1136
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
891
1137
|
aspectRatio: "1",
|
|
892
1138
|
src: image.src,
|
|
893
1139
|
srcSet: image.srcSet,
|
|
@@ -897,15 +1143,15 @@ function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
|
897
1143
|
borderRadius: "small"
|
|
898
1144
|
})
|
|
899
1145
|
})
|
|
900
|
-
}), /* @__PURE__ */ jsx("s-stack", {
|
|
1146
|
+
}), /* @__PURE__ */ jsx$1("s-stack", {
|
|
901
1147
|
maxBlockSize: "50px",
|
|
902
1148
|
maxInlineSize: "100%",
|
|
903
1149
|
padding: "small-400 none none none",
|
|
904
1150
|
overflow: "hidden",
|
|
905
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
1151
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
906
1152
|
type: "strong",
|
|
907
1153
|
color: "subdued",
|
|
908
|
-
children: /* @__PURE__ */ jsx("s-link", {
|
|
1154
|
+
children: /* @__PURE__ */ jsx$1("s-link", {
|
|
909
1155
|
target: "_blank",
|
|
910
1156
|
tone: "neutral",
|
|
911
1157
|
href: targetUrl,
|
|
@@ -922,7 +1168,7 @@ function ProductTile({ targetUrl, trackClick, image, productName }) {
|
|
|
922
1168
|
const PAGE_SIZE = 4;
|
|
923
1169
|
const PRODUCT_IMAGE_SOURCE_SIZE = 256;
|
|
924
1170
|
const RecommendationsOfferRow = ({ recommendations, padding }) => {
|
|
925
|
-
return /* @__PURE__ */ jsx(RecommendationsPager, {
|
|
1171
|
+
return /* @__PURE__ */ jsx$1(RecommendationsPager, {
|
|
926
1172
|
recommendations: recommendations.filter((recommendation) => recommendation.offer.assets.length > 0),
|
|
927
1173
|
padding
|
|
928
1174
|
});
|
|
@@ -936,16 +1182,16 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
936
1182
|
if (page !== currentPage) setPage(currentPage);
|
|
937
1183
|
}, [page, currentPage]);
|
|
938
1184
|
if (pageRecommendations.length === 0) return null;
|
|
939
|
-
return /* @__PURE__ */ jsx("s-box", {
|
|
1185
|
+
return /* @__PURE__ */ jsx$1("s-box", {
|
|
940
1186
|
padding,
|
|
941
1187
|
children: /* @__PURE__ */ jsxs("s-stack", {
|
|
942
1188
|
gap: "base",
|
|
943
|
-
children: [/* @__PURE__ */ jsx("s-grid", {
|
|
1189
|
+
children: [/* @__PURE__ */ jsx$1("s-grid", {
|
|
944
1190
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
|
|
945
1191
|
gap: "small-200",
|
|
946
|
-
children: pageRecommendations.map((recommendation) => /* @__PURE__ */ jsx("s-box", {
|
|
1192
|
+
children: pageRecommendations.map((recommendation) => /* @__PURE__ */ jsx$1("s-box", {
|
|
947
1193
|
inlineSize: "100%",
|
|
948
|
-
children: /* @__PURE__ */ jsx(RecommendationsOfferRowTile, { recommendation })
|
|
1194
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsOfferRowTile, { recommendation })
|
|
949
1195
|
}, recommendation.id))
|
|
950
1196
|
}), pageCount > 1 && /* @__PURE__ */ jsxs("s-stack", {
|
|
951
1197
|
direction: "inline",
|
|
@@ -953,7 +1199,7 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
953
1199
|
alignItems: "center",
|
|
954
1200
|
gap: "small-200",
|
|
955
1201
|
children: [
|
|
956
|
-
/* @__PURE__ */ jsx("s-clickable", {
|
|
1202
|
+
/* @__PURE__ */ jsx$1("s-clickable", {
|
|
957
1203
|
accessibilityLabel: "Previous recommendations page",
|
|
958
1204
|
disabled: currentPage === 0,
|
|
959
1205
|
inlineSize: "32px",
|
|
@@ -961,11 +1207,11 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
961
1207
|
border: "base",
|
|
962
1208
|
borderRadius: "base",
|
|
963
1209
|
onClick: () => setPage(currentPage - 1),
|
|
964
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
1210
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
965
1211
|
blockSize: "100%",
|
|
966
1212
|
alignItems: "center",
|
|
967
1213
|
justifyContent: "center",
|
|
968
|
-
children: /* @__PURE__ */ jsx("s-icon", {
|
|
1214
|
+
children: /* @__PURE__ */ jsx$1("s-icon", {
|
|
969
1215
|
type: "chevron-left",
|
|
970
1216
|
size: "small",
|
|
971
1217
|
tone: currentPage === 0 ? "neutral" : "auto"
|
|
@@ -982,7 +1228,7 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
982
1228
|
pageCount
|
|
983
1229
|
]
|
|
984
1230
|
}),
|
|
985
|
-
/* @__PURE__ */ jsx("s-clickable", {
|
|
1231
|
+
/* @__PURE__ */ jsx$1("s-clickable", {
|
|
986
1232
|
accessibilityLabel: "Next recommendations page",
|
|
987
1233
|
disabled: currentPage === pageCount - 1,
|
|
988
1234
|
inlineSize: "32px",
|
|
@@ -990,11 +1236,11 @@ function RecommendationsPager({ recommendations, padding }) {
|
|
|
990
1236
|
border: "base",
|
|
991
1237
|
borderRadius: "base",
|
|
992
1238
|
onClick: () => setPage(currentPage + 1),
|
|
993
|
-
children: /* @__PURE__ */ jsx("s-stack", {
|
|
1239
|
+
children: /* @__PURE__ */ jsx$1("s-stack", {
|
|
994
1240
|
blockSize: "100%",
|
|
995
1241
|
alignItems: "center",
|
|
996
1242
|
justifyContent: "center",
|
|
997
|
-
children: /* @__PURE__ */ jsx("s-icon", {
|
|
1243
|
+
children: /* @__PURE__ */ jsx$1("s-icon", {
|
|
998
1244
|
type: "chevron-right",
|
|
999
1245
|
size: "small",
|
|
1000
1246
|
tone: currentPage === pageCount - 1 ? "neutral" : "auto"
|
|
@@ -1043,7 +1289,7 @@ function RecommendationsOfferRowTile({ recommendation }) {
|
|
|
1043
1289
|
const productName = `${recommendation.offer.heading} ${recommendation.offer.subheading}`;
|
|
1044
1290
|
const offerImageAsset = recommendation.offer.assets[0];
|
|
1045
1291
|
if (!offerImageAsset) return null;
|
|
1046
|
-
return /* @__PURE__ */ jsx(ProductTile, {
|
|
1292
|
+
return /* @__PURE__ */ jsx$1(ProductTile, {
|
|
1047
1293
|
targetUrl,
|
|
1048
1294
|
trackClick,
|
|
1049
1295
|
image: getImageSources(offerImageAsset.imageUrl, {
|
|
@@ -1066,32 +1312,32 @@ const EssentialRecommendationsWidget = ({ heroRecommendationGroup, scrollableRec
|
|
|
1066
1312
|
const hideOfferSlot = () => setShowOfferSlot(false);
|
|
1067
1313
|
const heading = applyCustomizationOrFallback("widget_bottom_slot_heading", "Trending brands we think you'll love");
|
|
1068
1314
|
if (!showOfferSlot && !scrollableRecommendationGroup) return null;
|
|
1069
|
-
return /* @__PURE__ */ jsx(ScrollableSlotProvider, {
|
|
1315
|
+
return /* @__PURE__ */ jsx$1(ScrollableSlotProvider, {
|
|
1070
1316
|
scrollableRecommendationGroup,
|
|
1071
1317
|
children: /* @__PURE__ */ jsxs(CardContainer, {
|
|
1072
1318
|
background: "base",
|
|
1073
1319
|
children: [
|
|
1074
|
-
showOfferSlot && heroRecommendationGroup ? /* @__PURE__ */ jsx("s-box", {
|
|
1320
|
+
showOfferSlot && heroRecommendationGroup ? /* @__PURE__ */ jsx$1("s-box", {
|
|
1075
1321
|
border: "base",
|
|
1076
1322
|
borderWidth: "none none base none",
|
|
1077
|
-
children: /* @__PURE__ */ jsx(HeroOfferProvider, {
|
|
1323
|
+
children: /* @__PURE__ */ jsx$1(HeroOfferProvider, {
|
|
1078
1324
|
recommendationGroup: heroRecommendationGroup,
|
|
1079
|
-
children: /* @__PURE__ */ jsx(TrackedEssentialLayout, { onLastOffer: hideOfferSlot })
|
|
1325
|
+
children: /* @__PURE__ */ jsx$1(TrackedEssentialLayout, { onLastOffer: hideOfferSlot })
|
|
1080
1326
|
})
|
|
1081
|
-
}) : /* @__PURE__ */ jsx("s-box", {
|
|
1327
|
+
}) : /* @__PURE__ */ jsx$1("s-box", {
|
|
1082
1328
|
padding: "base base none base",
|
|
1083
|
-
children: /* @__PURE__ */ jsx("s-heading", { children: heading })
|
|
1329
|
+
children: /* @__PURE__ */ jsx$1("s-heading", { children: heading })
|
|
1084
1330
|
}),
|
|
1085
|
-
scrollableRecommendationGroup && /* @__PURE__ */ jsx("s-box", {
|
|
1331
|
+
scrollableRecommendationGroup && /* @__PURE__ */ jsx$1("s-box", {
|
|
1086
1332
|
padding: "base none",
|
|
1087
1333
|
border: "base",
|
|
1088
1334
|
borderWidth: "none none base none",
|
|
1089
|
-
children: /* @__PURE__ */ jsx(RecommendationsOfferRow, {
|
|
1335
|
+
children: /* @__PURE__ */ jsx$1(RecommendationsOfferRow, {
|
|
1090
1336
|
recommendations: scrollableRecommendationGroup.recommendations,
|
|
1091
1337
|
padding: "none base"
|
|
1092
1338
|
})
|
|
1093
1339
|
}),
|
|
1094
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1340
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
1095
1341
|
]
|
|
1096
1342
|
})
|
|
1097
1343
|
});
|
|
@@ -1116,7 +1362,7 @@ const TrackedEssentialLayout = ({ onLastOffer }) => {
|
|
|
1116
1362
|
offer.id,
|
|
1117
1363
|
advertiser.id
|
|
1118
1364
|
]);
|
|
1119
|
-
return /* @__PURE__ */ jsx(EssentialLayoutType, { onLastOffer });
|
|
1365
|
+
return /* @__PURE__ */ jsx$1(EssentialLayoutType, { onLastOffer });
|
|
1120
1366
|
};
|
|
1121
1367
|
//#endregion
|
|
1122
1368
|
//#region src/components/RecommendationsWidget/LeadGen/LeadGenHeader.tsx
|
|
@@ -1129,7 +1375,7 @@ const LeadGenHeader = () => {
|
|
|
1129
1375
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
1130
1376
|
gap: "none",
|
|
1131
1377
|
padding: "large-200",
|
|
1132
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: heading }), /* @__PURE__ */ jsx("s-text", {
|
|
1378
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: heading }), /* @__PURE__ */ jsx$1("s-text", {
|
|
1133
1379
|
color: "subdued",
|
|
1134
1380
|
children: subheading
|
|
1135
1381
|
})]
|
|
@@ -1143,7 +1389,7 @@ const LeadGenAssetTile = ({ asset }) => {
|
|
|
1143
1389
|
env,
|
|
1144
1390
|
size: 400
|
|
1145
1391
|
});
|
|
1146
|
-
return /* @__PURE__ */ jsx("s-image", {
|
|
1392
|
+
return /* @__PURE__ */ jsx$1("s-image", {
|
|
1147
1393
|
aspectRatio: "1",
|
|
1148
1394
|
src: image.src,
|
|
1149
1395
|
srcSet: image.srcSet,
|
|
@@ -1158,10 +1404,10 @@ const LeadGenBrandProducts = () => {
|
|
|
1158
1404
|
const { activeRecommendation } = useHeroOffer();
|
|
1159
1405
|
const assets = activeRecommendation.offer.assets.slice(0, 4);
|
|
1160
1406
|
if (assets.length === 0) return null;
|
|
1161
|
-
return /* @__PURE__ */ jsx("s-query-container", { children: /* @__PURE__ */ jsx("s-grid", {
|
|
1407
|
+
return /* @__PURE__ */ jsx$1("s-query-container", { children: /* @__PURE__ */ jsx$1("s-grid", {
|
|
1162
1408
|
gridTemplateColumns: "@container (inline-size > 450px) repeat(4, 1fr), repeat(3, 1fr)",
|
|
1163
1409
|
gap: "small-200",
|
|
1164
|
-
children: assets.map((asset) => /* @__PURE__ */ jsx(LeadGenAssetTile, { asset }, asset.id))
|
|
1410
|
+
children: assets.map((asset) => /* @__PURE__ */ jsx$1(LeadGenAssetTile, { asset }, asset.id))
|
|
1165
1411
|
}) });
|
|
1166
1412
|
};
|
|
1167
1413
|
const LeadGenBrand = () => {
|
|
@@ -1182,14 +1428,14 @@ const LeadGenBrand = () => {
|
|
|
1182
1428
|
alignItems: "start",
|
|
1183
1429
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
1184
1430
|
gap: "none",
|
|
1185
|
-
children: [/* @__PURE__ */ jsx("s-text", {
|
|
1431
|
+
children: [/* @__PURE__ */ jsx$1("s-text", {
|
|
1186
1432
|
type: "strong",
|
|
1187
1433
|
children: advertiser.name
|
|
1188
|
-
}), /* @__PURE__ */ jsx("s-paragraph", { children: advertiser.description })]
|
|
1189
|
-
}), /* @__PURE__ */ jsx("s-box", {
|
|
1434
|
+
}), /* @__PURE__ */ jsx$1("s-paragraph", { children: advertiser.description })]
|
|
1435
|
+
}), /* @__PURE__ */ jsx$1("s-box", {
|
|
1190
1436
|
inlineSize: `${logoSize}px`,
|
|
1191
1437
|
blockSize: `${logoSize}px`,
|
|
1192
|
-
children: /* @__PURE__ */ jsx("s-image", {
|
|
1438
|
+
children: /* @__PURE__ */ jsx$1("s-image", {
|
|
1193
1439
|
aspectRatio: "1",
|
|
1194
1440
|
src: logo.src,
|
|
1195
1441
|
srcSet: logo.srcSet,
|
|
@@ -1199,7 +1445,7 @@ const LeadGenBrand = () => {
|
|
|
1199
1445
|
borderRadius: "max"
|
|
1200
1446
|
})
|
|
1201
1447
|
})]
|
|
1202
|
-
}), /* @__PURE__ */ jsx(LeadGenBrandProducts, {})]
|
|
1448
|
+
}), /* @__PURE__ */ jsx$1(LeadGenBrandProducts, {})]
|
|
1203
1449
|
});
|
|
1204
1450
|
};
|
|
1205
1451
|
//#endregion
|
|
@@ -1352,7 +1598,7 @@ function LeadGenActionButton() {
|
|
|
1352
1598
|
if (payload.buyerEmail) sendOfferEmail();
|
|
1353
1599
|
handleOfferClaim();
|
|
1354
1600
|
};
|
|
1355
|
-
return /* @__PURE__ */ jsx("s-button", {
|
|
1601
|
+
return /* @__PURE__ */ jsx$1("s-button", {
|
|
1356
1602
|
href: activeRecommendation.offer.targetUrl,
|
|
1357
1603
|
target: "_blank",
|
|
1358
1604
|
inlineSize: "fill",
|
|
@@ -1378,13 +1624,13 @@ const LeadGenOfferRow = ({ recommendations }) => {
|
|
|
1378
1624
|
return /* @__PURE__ */ jsxs("s-stack", {
|
|
1379
1625
|
gap: "small-200",
|
|
1380
1626
|
padding: "base none",
|
|
1381
|
-
children: [/* @__PURE__ */ jsx("s-box", {
|
|
1627
|
+
children: [/* @__PURE__ */ jsx$1("s-box", {
|
|
1382
1628
|
padding: "none large-200",
|
|
1383
|
-
children: /* @__PURE__ */ jsx("s-text", {
|
|
1629
|
+
children: /* @__PURE__ */ jsx$1("s-text", {
|
|
1384
1630
|
type: "strong",
|
|
1385
1631
|
children: applyCustomizationOrFallback("widget_bottom_slot_heading", "Trending brands we think you'll love")
|
|
1386
1632
|
})
|
|
1387
|
-
}), /* @__PURE__ */ jsx(RecommendationsOfferRow, {
|
|
1633
|
+
}), /* @__PURE__ */ jsx$1(RecommendationsOfferRow, {
|
|
1388
1634
|
recommendations,
|
|
1389
1635
|
padding: "small-400 large-200"
|
|
1390
1636
|
})]
|
|
@@ -1405,22 +1651,22 @@ const LeadGen = ({ heroRecommendationGroup, scrollableRecommendationGroup }) =>
|
|
|
1405
1651
|
heroRecommendationGroup && /* @__PURE__ */ jsxs(HeroOfferProvider, {
|
|
1406
1652
|
recommendationGroup: heroRecommendationGroup,
|
|
1407
1653
|
children: [
|
|
1408
|
-
/* @__PURE__ */ jsx(LeadGenHeader, {}),
|
|
1409
|
-
/* @__PURE__ */ jsx("s-divider", {}),
|
|
1410
|
-
/* @__PURE__ */ jsx("s-box", {
|
|
1654
|
+
/* @__PURE__ */ jsx$1(LeadGenHeader, {}),
|
|
1655
|
+
/* @__PURE__ */ jsx$1("s-divider", {}),
|
|
1656
|
+
/* @__PURE__ */ jsx$1("s-box", {
|
|
1411
1657
|
minBlockSize: "230px",
|
|
1412
|
-
children: /* @__PURE__ */ jsx(LeadGenBrand, {})
|
|
1658
|
+
children: /* @__PURE__ */ jsx$1(LeadGenBrand, {})
|
|
1413
1659
|
}),
|
|
1414
1660
|
/* @__PURE__ */ jsxs("s-stack", {
|
|
1415
1661
|
padding: "none large-200 large-200 large-200",
|
|
1416
1662
|
gap: "base",
|
|
1417
|
-
children: [/* @__PURE__ */ jsx(LeadGenActionOffer, {}), /* @__PURE__ */ jsx(LeadGenActionNav, {})]
|
|
1663
|
+
children: [/* @__PURE__ */ jsx$1(LeadGenActionOffer, {}), /* @__PURE__ */ jsx$1(LeadGenActionNav, {})]
|
|
1418
1664
|
}),
|
|
1419
|
-
/* @__PURE__ */ jsx("s-divider", {})
|
|
1665
|
+
/* @__PURE__ */ jsx$1("s-divider", {})
|
|
1420
1666
|
]
|
|
1421
1667
|
}),
|
|
1422
|
-
scrollableRecommendationGroup && /* @__PURE__ */ jsx(LeadGenOfferRow, { recommendations: scrollableRecommendationGroup.recommendations }),
|
|
1423
|
-
/* @__PURE__ */ jsx(Footer, {})
|
|
1668
|
+
scrollableRecommendationGroup && /* @__PURE__ */ jsx$1(LeadGenOfferRow, { recommendations: scrollableRecommendationGroup.recommendations }),
|
|
1669
|
+
/* @__PURE__ */ jsx$1(Footer, {})
|
|
1424
1670
|
]
|
|
1425
1671
|
});
|
|
1426
1672
|
};
|
|
@@ -1428,7 +1674,7 @@ function LeadGenActionOffer() {
|
|
|
1428
1674
|
const { activeRecommendation, isOfferClaimed } = useHeroOffer();
|
|
1429
1675
|
const { heading, subheading, metadata } = activeRecommendation.offer;
|
|
1430
1676
|
const primaryHeading = isOfferClaimed ? `You've got ${heading}` : heading;
|
|
1431
|
-
const secondaryHeading = isOfferClaimed && metadata.type === "PROMO_CODE" ? /* @__PURE__ */ jsxs(Fragment, { children: ["Use code: ", /* @__PURE__ */ jsx("s-text", {
|
|
1677
|
+
const secondaryHeading = isOfferClaimed && metadata.type === "PROMO_CODE" ? /* @__PURE__ */ jsxs(Fragment, { children: ["Use code: ", /* @__PURE__ */ jsx$1("s-text", {
|
|
1432
1678
|
type: "strong",
|
|
1433
1679
|
children: metadata.code
|
|
1434
1680
|
})] }) : subheading || "On your next purchase";
|
|
@@ -1440,8 +1686,8 @@ function LeadGenActionOffer() {
|
|
|
1440
1686
|
gap: "base",
|
|
1441
1687
|
children: [/* @__PURE__ */ jsxs("s-stack", {
|
|
1442
1688
|
gap: "none",
|
|
1443
|
-
children: [/* @__PURE__ */ jsx("s-heading", { children: primaryHeading }), /* @__PURE__ */ jsx("s-text", { children: secondaryHeading })]
|
|
1444
|
-
}), /* @__PURE__ */ jsx(LeadGenActionButton, {})]
|
|
1689
|
+
children: [/* @__PURE__ */ jsx$1("s-heading", { children: primaryHeading }), /* @__PURE__ */ jsx$1("s-text", { children: secondaryHeading })]
|
|
1690
|
+
}), /* @__PURE__ */ jsx$1(LeadGenActionButton, {})]
|
|
1445
1691
|
});
|
|
1446
1692
|
}
|
|
1447
1693
|
function LeadGenActionNav() {
|
|
@@ -1477,13 +1723,13 @@ function LeadGenActionNav() {
|
|
|
1477
1723
|
gridTemplateColumns: hasSingleButton ? "1fr" : "1fr 11px 1fr",
|
|
1478
1724
|
gap: "base",
|
|
1479
1725
|
children: [
|
|
1480
|
-
showPrevious && /* @__PURE__ */ jsx("s-button", {
|
|
1726
|
+
showPrevious && /* @__PURE__ */ jsx$1("s-button", {
|
|
1481
1727
|
variant: !isOfferClaimed || showNext ? "secondary" : "primary",
|
|
1482
1728
|
onClick: handlePrevious,
|
|
1483
1729
|
children: applyCustomizationOrFallback("widget_nav_backward_cta_text", "Previous offer")
|
|
1484
1730
|
}),
|
|
1485
|
-
!hasSingleButton && /* @__PURE__ */ jsx("s-box", {}),
|
|
1486
|
-
showNext && /* @__PURE__ */ jsx("s-button", {
|
|
1731
|
+
!hasSingleButton && /* @__PURE__ */ jsx$1("s-box", {}),
|
|
1732
|
+
showNext && /* @__PURE__ */ jsx$1("s-button", {
|
|
1487
1733
|
variant: isOfferClaimed ? "primary" : "secondary",
|
|
1488
1734
|
onClick: handleNext,
|
|
1489
1735
|
children: applyCustomizationOrFallback("widget_nav_forward_cta_text", showPrevious ? "Next offer" : "No thanks")
|
|
@@ -1500,15 +1746,15 @@ const Widget = () => {
|
|
|
1500
1746
|
const scrollableRecommendationGroup = recommendationsData.recommendationGroups.find((group) => group.slotContext === "SCROLLABLE");
|
|
1501
1747
|
if (!heroRecommendationGroup && !scrollableRecommendationGroup) return null;
|
|
1502
1748
|
const layoutId = recommendationsData.layoutId;
|
|
1503
|
-
if (ESSENTIAL_LAYOUT_IDS.includes(layoutId)) return /* @__PURE__ */ jsx(EssentialRecommendationsWidget, {
|
|
1749
|
+
if (ESSENTIAL_LAYOUT_IDS.includes(layoutId)) return /* @__PURE__ */ jsx$1(EssentialRecommendationsWidget, {
|
|
1504
1750
|
heroRecommendationGroup,
|
|
1505
1751
|
scrollableRecommendationGroup
|
|
1506
1752
|
});
|
|
1507
1753
|
if (layoutId === "SHOPIFY_NATIVE_COVER") {
|
|
1508
1754
|
if (!heroRecommendationGroup) return null;
|
|
1509
|
-
return /* @__PURE__ */ jsx(CoverRecommendationsWidget, { heroRecommendationGroup });
|
|
1755
|
+
return /* @__PURE__ */ jsx$1(CoverRecommendationsWidget, { heroRecommendationGroup });
|
|
1510
1756
|
}
|
|
1511
|
-
return /* @__PURE__ */ jsx(LeadGen, {
|
|
1757
|
+
return /* @__PURE__ */ jsx$1(LeadGen, {
|
|
1512
1758
|
heroRecommendationGroup,
|
|
1513
1759
|
scrollableRecommendationGroup
|
|
1514
1760
|
});
|
|
@@ -1523,19 +1769,19 @@ const Widget = () => {
|
|
|
1523
1769
|
* details are read from that target's API.
|
|
1524
1770
|
*/
|
|
1525
1771
|
function DiscoRecommendations({ apiKey }) {
|
|
1526
|
-
return /* @__PURE__ */ jsx(Recommendations, { auth: { apiKey } });
|
|
1772
|
+
return /* @__PURE__ */ jsx$1(Recommendations, { auth: { apiKey } });
|
|
1527
1773
|
}
|
|
1528
1774
|
/**
|
|
1529
1775
|
* The widget tree shared by the public (`apiKey`) and internal (`shop_gid`)
|
|
1530
1776
|
* entry points.
|
|
1531
1777
|
*/
|
|
1532
1778
|
function Recommendations({ auth }) {
|
|
1533
|
-
return /* @__PURE__ */ jsx(PayloadManager, { children: /* @__PURE__ */ jsx(DataManager, {
|
|
1779
|
+
return /* @__PURE__ */ jsx$1(PayloadManager, { children: /* @__PURE__ */ jsx$1(DataManager, {
|
|
1534
1780
|
auth,
|
|
1535
|
-
children: /* @__PURE__ */ jsx(UserManager, { children: /* @__PURE__ */ jsx(Widget, {}) })
|
|
1781
|
+
children: /* @__PURE__ */ jsx$1(UserManager, { children: /* @__PURE__ */ jsx$1(Widget, {}) })
|
|
1536
1782
|
}) });
|
|
1537
1783
|
}
|
|
1538
1784
|
//#endregion
|
|
1539
1785
|
export { Recommendations as n, DiscoRecommendations as t };
|
|
1540
1786
|
|
|
1541
|
-
//# sourceMappingURL=DiscoRecommendations-
|
|
1787
|
+
//# sourceMappingURL=DiscoRecommendations-BeqZ2x4q.js.map
|