@useinsider/guido 3.6.0 → 3.7.0-beta.04f8814
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 +14 -0
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +75 -72
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +9 -9
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
- package/dist/composables/useActionsApi.js +16 -15
- package/dist/composables/useHtmlCompiler.js +40 -22
- package/dist/composables/useRecommendation.js +34 -33
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +127 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +51 -47
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +46 -46
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +35 -29
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -28
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +56 -49
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -17
- package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/src/utils/ampErrorFilter.d.ts +2 -0
- package/dist/src/utils/ampErrorFilter.test.d.ts +1 -0
- package/dist/src/utils/templatePreparation.d.ts +16 -0
- package/dist/src/utils/templatePreparation.test.d.ts +1 -0
- package/dist/utils/ampErrorFilter.js +8 -0
- package/dist/utils/templatePreparation.js +59 -58
- package/package.json +1 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { RecommendationBlockId as
|
|
2
|
-
import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
1
|
+
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
2
|
+
import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as $, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
|
|
3
|
+
import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
|
|
4
4
|
import { formatPrice as C } from "../../utils/priceFormatter.js";
|
|
5
5
|
import { CUSTOM_CELL_HTML as R, sanitizeImageUrl as O } from "../utils.js";
|
|
6
|
-
const
|
|
6
|
+
const s = "0 5px", a = "attribute-cell";
|
|
7
|
+
function S(t, e = s) {
|
|
8
|
+
return `<td class="${a}" style="padding: ${e};" width="${t}%"></td>`;
|
|
9
|
+
}
|
|
7
10
|
function g() {
|
|
8
|
-
const t =
|
|
11
|
+
const t = x(), { currencySettings: e } = t.recommendationConfigs;
|
|
9
12
|
return {
|
|
10
13
|
code: e.value,
|
|
11
14
|
symbol: e.symbol,
|
|
@@ -22,9 +25,9 @@ function i(t, e = "price") {
|
|
|
22
25
|
currency: o
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
|
-
const
|
|
26
|
-
[
|
|
27
|
-
<td class="${
|
|
28
|
+
const A = {
|
|
29
|
+
[_]: (t) => `
|
|
30
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
28
31
|
<table
|
|
29
32
|
class="product-card-segment"
|
|
30
33
|
width="100%"
|
|
@@ -37,7 +40,7 @@ const S = {
|
|
|
37
40
|
<td
|
|
38
41
|
class="esd-block-image product-image"
|
|
39
42
|
align="center"
|
|
40
|
-
esd-extension-block-id="${
|
|
43
|
+
esd-extension-block-id="${l.IMAGE}">
|
|
41
44
|
<a target="_blank" href="${t.url}" class="${p}">
|
|
42
45
|
<img
|
|
43
46
|
src="${O(t.image_url)}"
|
|
@@ -51,8 +54,8 @@ const S = {
|
|
|
51
54
|
</table>
|
|
52
55
|
</td>
|
|
53
56
|
`,
|
|
54
|
-
[
|
|
55
|
-
<td class="${
|
|
57
|
+
[$]: (t) => `
|
|
58
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
|
|
56
59
|
<table
|
|
57
60
|
class="product-card-segment"
|
|
58
61
|
width="100%"
|
|
@@ -66,7 +69,7 @@ const S = {
|
|
|
66
69
|
<td
|
|
67
70
|
class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
|
|
68
71
|
align="center"
|
|
69
|
-
esd-extension-block-id="${
|
|
72
|
+
esd-extension-block-id="${l.NAME}">
|
|
70
73
|
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
71
74
|
<strong>${t.name}</strong>
|
|
72
75
|
</p>
|
|
@@ -77,7 +80,7 @@ const S = {
|
|
|
77
80
|
</td>
|
|
78
81
|
`,
|
|
79
82
|
[f]: (t) => `
|
|
80
|
-
<td class="${
|
|
83
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
81
84
|
<table
|
|
82
85
|
class="product-card-segment"
|
|
83
86
|
width="100%"
|
|
@@ -90,7 +93,7 @@ const S = {
|
|
|
90
93
|
<td
|
|
91
94
|
class="esd-block-text product-price es-p15l es-p15r"
|
|
92
95
|
align="center"
|
|
93
|
-
esd-extension-block-id="${
|
|
96
|
+
esd-extension-block-id="${l.PRICE}">
|
|
94
97
|
<p contenteditable="false" style="font-size: 16px; color: #333333;">
|
|
95
98
|
<strong>${i(t, "price")}</strong>
|
|
96
99
|
</p>
|
|
@@ -101,7 +104,7 @@ const S = {
|
|
|
101
104
|
</td>
|
|
102
105
|
`,
|
|
103
106
|
[T]: (t) => `
|
|
104
|
-
<td class="${
|
|
107
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
105
108
|
<table
|
|
106
109
|
class="product-card-segment"
|
|
107
110
|
width="100%"
|
|
@@ -114,9 +117,11 @@ const S = {
|
|
|
114
117
|
<td
|
|
115
118
|
class="esd-block-text product-old-price es-p15l es-p15r"
|
|
116
119
|
align="center"
|
|
117
|
-
esd-extension-block-id="${
|
|
118
|
-
<p
|
|
119
|
-
|
|
120
|
+
esd-extension-block-id="${l.OLD_PRICE}">
|
|
121
|
+
<p
|
|
122
|
+
contenteditable="false"
|
|
123
|
+
style="font-size: 14px; color: #999999;">
|
|
124
|
+
<s><strong>${i(t, "original_price")}</strong></s>
|
|
120
125
|
</p>
|
|
121
126
|
</td>
|
|
122
127
|
</tr>
|
|
@@ -125,7 +130,7 @@ const S = {
|
|
|
125
130
|
</td>
|
|
126
131
|
`,
|
|
127
132
|
[y]: (t) => `
|
|
128
|
-
<td class="${
|
|
133
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
129
134
|
<table
|
|
130
135
|
class="product-card-segment"
|
|
131
136
|
width="100%"
|
|
@@ -140,7 +145,7 @@ const S = {
|
|
|
140
145
|
align="center"
|
|
141
146
|
data-text-before="Lowest 30-day price: "
|
|
142
147
|
data-text-after=""
|
|
143
|
-
esd-extension-block-id="${
|
|
148
|
+
esd-extension-block-id="${l.OMNIBUS_PRICE}">
|
|
144
149
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
145
150
|
<span class="omnibus-text-before">Lowest 30-day price: </span>
|
|
146
151
|
<span class="omnibus-price-value">${i(t, "original_price")}</span>
|
|
@@ -156,7 +161,7 @@ const S = {
|
|
|
156
161
|
var r, c;
|
|
157
162
|
const e = g(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
|
|
158
163
|
return `
|
|
159
|
-
<td class="${
|
|
164
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
160
165
|
<table
|
|
161
166
|
class="product-card-segment"
|
|
162
167
|
width="100%"
|
|
@@ -171,7 +176,7 @@ const S = {
|
|
|
171
176
|
align="center"
|
|
172
177
|
data-text-before=""
|
|
173
178
|
data-text-after=""
|
|
174
|
-
esd-extension-block-id="${
|
|
179
|
+
esd-extension-block-id="${l.OMNIBUS_DISCOUNT}">
|
|
175
180
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">
|
|
176
181
|
<span class="omnibus-text-before"></span>
|
|
177
182
|
<span class="omnibus-discount-value">${b}</span>
|
|
@@ -185,7 +190,7 @@ const S = {
|
|
|
185
190
|
`;
|
|
186
191
|
},
|
|
187
192
|
[m]: () => `
|
|
188
|
-
<td class="${
|
|
193
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
|
|
189
194
|
<table
|
|
190
195
|
class="product-card-segment"
|
|
191
196
|
width="100%"
|
|
@@ -198,7 +203,7 @@ const S = {
|
|
|
198
203
|
<td
|
|
199
204
|
class="esd-block-button product-button es-p10t es-p10b"
|
|
200
205
|
align="center"
|
|
201
|
-
esd-extension-block-id="${
|
|
206
|
+
esd-extension-block-id="${l.BUTTON}">
|
|
202
207
|
<span
|
|
203
208
|
class="es-button-border"
|
|
204
209
|
style="
|
|
@@ -237,7 +242,7 @@ const S = {
|
|
|
237
242
|
* @param content - Display content for the cell
|
|
238
243
|
*/
|
|
239
244
|
[R]: (t, e) => `
|
|
240
|
-
<td class="${
|
|
245
|
+
<td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
|
|
241
246
|
<table
|
|
242
247
|
class="product-card-segment"
|
|
243
248
|
width="100%"
|
|
@@ -252,7 +257,7 @@ const S = {
|
|
|
252
257
|
${u}="${t}"
|
|
253
258
|
class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
|
|
254
259
|
align="center"
|
|
255
|
-
esd-extension-block-id="${
|
|
260
|
+
esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}">
|
|
256
261
|
<p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
|
|
257
262
|
</td>
|
|
258
263
|
</tr>
|
|
@@ -262,7 +267,8 @@ const S = {
|
|
|
262
267
|
`
|
|
263
268
|
};
|
|
264
269
|
export {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
S as
|
|
270
|
+
a as ATTRIBUTE_CELL_CLASS,
|
|
271
|
+
s as DEFAULT_CELL_PADDING,
|
|
272
|
+
S as buildFillerCell,
|
|
273
|
+
A as gridElementRenderer
|
|
268
274
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEFAULT_PRODUCTS_PER_ROW as
|
|
2
|
-
import { getDefaultProducts as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { DEFAULT_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
|
|
2
|
+
import { getDefaultProducts as I, DEFAULTS as b, createBlockTemplate as E, DEFAULT_CARD_COMPOSITION as L, spacer as S, buildElementRenderer as _, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
|
|
3
|
+
import { buildFillerCell as w, gridElementRenderer as A } from "./elementRenderer.js";
|
|
4
|
+
const D = `
|
|
5
5
|
<tr class="recommendation-product-row">
|
|
6
6
|
<td>
|
|
7
7
|
<table
|
|
@@ -18,7 +18,7 @@ const O = `
|
|
|
18
18
|
</table>
|
|
19
19
|
</td>
|
|
20
20
|
</tr>
|
|
21
|
-
`,
|
|
21
|
+
`, C = `
|
|
22
22
|
<tr
|
|
23
23
|
class="recommendation-attribute-row"
|
|
24
24
|
data-attribute-type="{-{-ATTR_TYPE-}-}"
|
|
@@ -27,38 +27,38 @@ const O = `
|
|
|
27
27
|
{-{-CELLS-}-}
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return r.filter((
|
|
33
|
-
const
|
|
34
|
-
return
|
|
30
|
+
function O(t, e, n, r = L, c = {}) {
|
|
31
|
+
const a = (100 / e).toFixed(2), s = e - t.length, l = s > 0 ? w(a).repeat(s) : "", i = _(n, r, c);
|
|
32
|
+
return r.filter((o) => i[o]).map((o) => {
|
|
33
|
+
const p = f[o] ?? !0, u = p ? "" : 'style="display: none;"', T = t.map((R) => i[o](R).replace("<td", `<td width="${a}%"`)).join("");
|
|
34
|
+
return C.replace("{-{-ATTR_TYPE-}-}", o).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", T + l);
|
|
35
35
|
}).join("");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
37
|
+
function g(t, e, n, r, c = {}) {
|
|
38
|
+
const a = [];
|
|
39
39
|
for (let l = 0; l < t.length; l += e)
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
const
|
|
40
|
+
a.push(t.slice(l, l + e));
|
|
41
|
+
return a.map((l, i) => {
|
|
42
|
+
const d = O(
|
|
43
43
|
l,
|
|
44
44
|
e,
|
|
45
|
-
|
|
45
|
+
n,
|
|
46
46
|
r,
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
return
|
|
47
|
+
c
|
|
48
|
+
), o = D.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
|
|
49
|
+
return i > 0 ? S + o : o;
|
|
50
50
|
}).join("");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
52
|
+
function P(t, e, n, r = {}) {
|
|
53
|
+
return g(t, e, A, n, r);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const e = t ? `ins-recommendation-v3-block-${t}` : void 0,
|
|
57
|
-
return
|
|
55
|
+
function B(t) {
|
|
56
|
+
const e = t ? `ins-recommendation-v3-block-${t}` : void 0, n = E("grid", e), r = I(), c = P(r, m);
|
|
57
|
+
return n.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
B as getDefaultTemplate,
|
|
61
|
+
O as prepareGridAttributeRows,
|
|
62
|
+
g as prepareGridProductRows,
|
|
63
|
+
P as prepareProductRows
|
|
64
64
|
};
|
|
@@ -14,10 +14,10 @@ function b() {
|
|
|
14
14
|
thousandSeparator: e.thousandSeparator
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const n = b(),
|
|
17
|
+
function r(t, e = "price") {
|
|
18
|
+
const n = b(), s = t[e], a = (s == null ? void 0 : s[n.code]) ?? Object.values(s ?? {})[0] ?? 0;
|
|
19
19
|
return R({
|
|
20
|
-
price:
|
|
20
|
+
price: a,
|
|
21
21
|
currency: n
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -69,7 +69,7 @@ const I = {
|
|
|
69
69
|
esd-extension-block-id="${o.PRICE}"
|
|
70
70
|
align="left">
|
|
71
71
|
<p contenteditable="false" style="font-size: 16px; color: #333333; font-weight: bold; margin: 0;">
|
|
72
|
-
<strong>${
|
|
72
|
+
<strong>${r(t, "price")}</strong>
|
|
73
73
|
</p>
|
|
74
74
|
</td>
|
|
75
75
|
</tr>
|
|
@@ -85,8 +85,8 @@ const I = {
|
|
|
85
85
|
align="left">
|
|
86
86
|
<p
|
|
87
87
|
contenteditable="false"
|
|
88
|
-
style="font-size: 14px; color: #999999;
|
|
89
|
-
<strong>${
|
|
88
|
+
style="font-size: 14px; color: #999999; margin: 0;">
|
|
89
|
+
<s><strong>${r(t, "original_price")}</strong></s>
|
|
90
90
|
</p>
|
|
91
91
|
</td>
|
|
92
92
|
</tr>
|
|
@@ -104,7 +104,7 @@ const I = {
|
|
|
104
104
|
align="left">
|
|
105
105
|
<p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
|
|
106
106
|
<span class="omnibus-text-before">Lowest 30-day price: </span>
|
|
107
|
-
<span class="omnibus-price-value">${
|
|
107
|
+
<span class="omnibus-price-value">${r(t, "original_price")}</span>
|
|
108
108
|
<span class="omnibus-text-after"></span>
|
|
109
109
|
</p>
|
|
110
110
|
</td>
|
|
@@ -115,7 +115,7 @@ const I = {
|
|
|
115
115
|
*/
|
|
116
116
|
[g]: (t) => {
|
|
117
117
|
var i, l;
|
|
118
|
-
const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0,
|
|
118
|
+
const e = b(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, s = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - s) / n * 100) : 0, m = a > 0 ? `-${a}%` : "0%";
|
|
119
119
|
return `
|
|
120
120
|
<tr>
|
|
121
121
|
<td
|
|
@@ -1,60 +1,66 @@
|
|
|
1
|
-
import { ATTR_CUSTOM_PREFIX as
|
|
2
|
-
function
|
|
1
|
+
import { ATTR_CUSTOM_PREFIX as d, ATTR_PRODUCT_IMAGE as u, ATTR_PRODUCT_NAME as p, ATTR_PRODUCT_OLD_PRICE as m, ATTR_PRODUCT_PRICE as b, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OMNIBUS_DISCOUNT as _, ATTR_PRODUCT_BUTTON as g } from "../constants/selectors.js";
|
|
2
|
+
function y(t) {
|
|
3
3
|
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function U(t) {
|
|
6
|
+
const e = Array.isArray(t) ? t[t.length - 1] : t;
|
|
7
|
+
if (typeof e == "string")
|
|
8
|
+
return e;
|
|
9
|
+
if (typeof e == "number")
|
|
10
|
+
return String(e);
|
|
11
|
+
}
|
|
12
|
+
function C(t, e) {
|
|
6
13
|
const n = Object.values(e).find((r) => r.attributeName === t);
|
|
7
14
|
return (n == null ? void 0 : n.type) === "defaultAttribute";
|
|
8
15
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
16
|
+
function h(t, e) {
|
|
17
|
+
return C(t, e) ? t : `product_attribute.${t}`;
|
|
11
18
|
}
|
|
12
19
|
const P = Symbol("customCellHtml");
|
|
13
|
-
function
|
|
20
|
+
function L(t, e, n = {}) {
|
|
14
21
|
const r = t[P];
|
|
15
22
|
if (!r)
|
|
16
23
|
return { ...t };
|
|
17
|
-
const
|
|
18
|
-
return e.filter((o) => o.startsWith(
|
|
19
|
-
const s = o.substring(
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
|
|
24
|
+
const i = { ...t };
|
|
25
|
+
return e.filter((o) => o.startsWith(d) && !i[o]).forEach((o) => {
|
|
26
|
+
const s = o.substring(d.length), l = y(s), A = h(s, n), R = C(s, n);
|
|
27
|
+
i[o] = (c) => {
|
|
28
|
+
var a;
|
|
29
|
+
const D = R ? c[s] : (a = c.product_attributes) == null ? void 0 : a[s], O = U(D) ?? l;
|
|
30
|
+
return r(A, O);
|
|
25
31
|
};
|
|
26
|
-
}),
|
|
32
|
+
}), i;
|
|
27
33
|
}
|
|
28
|
-
const
|
|
34
|
+
const M = {
|
|
29
35
|
TITLE: "You May Also Like!"
|
|
30
|
-
},
|
|
36
|
+
}, $ = [
|
|
37
|
+
u,
|
|
38
|
+
p,
|
|
31
39
|
m,
|
|
32
40
|
b,
|
|
33
41
|
T,
|
|
34
42
|
_,
|
|
35
|
-
g
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
],
|
|
39
|
-
[m]: !0,
|
|
43
|
+
g
|
|
44
|
+
], w = {
|
|
45
|
+
[u]: !0,
|
|
46
|
+
[p]: !0,
|
|
40
47
|
[b]: !0,
|
|
41
|
-
[
|
|
42
|
-
[T]: !
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
|
|
46
|
-
}, h = `
|
|
48
|
+
[m]: !0,
|
|
49
|
+
[T]: !1,
|
|
50
|
+
[_]: !1,
|
|
51
|
+
[g]: !0
|
|
52
|
+
}, I = `
|
|
47
53
|
<tr>
|
|
48
54
|
<td class="spacer" style="height: 10px;"></td>
|
|
49
55
|
</tr>
|
|
50
|
-
`,
|
|
51
|
-
function
|
|
52
|
-
return !t || typeof t != "string" || t.trim() === "" ?
|
|
56
|
+
`, f = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
|
|
57
|
+
function N(t) {
|
|
58
|
+
return !t || typeof t != "string" || t.trim() === "" ? f : t.startsWith("http://") ? t.replace("http://", "https://") : t;
|
|
53
59
|
}
|
|
54
|
-
function
|
|
60
|
+
function E(t) {
|
|
55
61
|
return {
|
|
56
62
|
name: "Product Name",
|
|
57
|
-
image_url:
|
|
63
|
+
image_url: f,
|
|
58
64
|
price: { USD: 18 },
|
|
59
65
|
original_price: { USD: 20 },
|
|
60
66
|
discount: { USD: 2 },
|
|
@@ -66,13 +72,13 @@ function I(t) {
|
|
|
66
72
|
category: []
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
|
-
function
|
|
75
|
+
function k(t = 6) {
|
|
70
76
|
return Array.from(
|
|
71
77
|
{ length: t },
|
|
72
|
-
(e, n) =>
|
|
78
|
+
(e, n) => E(String(n + 1))
|
|
73
79
|
);
|
|
74
80
|
}
|
|
75
|
-
function
|
|
81
|
+
function x(t = "grid", e) {
|
|
76
82
|
const n = t === "list" ? `
|
|
77
83
|
data-layout="list"` : "", r = e ? ` ${e}` : "";
|
|
78
84
|
return `
|
|
@@ -110,7 +116,7 @@ function k(t = "grid", e) {
|
|
|
110
116
|
</table>
|
|
111
117
|
</td>
|
|
112
118
|
</tr>
|
|
113
|
-
${
|
|
119
|
+
${I}
|
|
114
120
|
<tr>
|
|
115
121
|
<td>
|
|
116
122
|
<table
|
|
@@ -150,16 +156,17 @@ function k(t = "grid", e) {
|
|
|
150
156
|
}
|
|
151
157
|
export {
|
|
152
158
|
P as CUSTOM_CELL_HTML,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
M as DEFAULTS,
|
|
160
|
+
$ as DEFAULT_CARD_COMPOSITION,
|
|
161
|
+
w as DEFAULT_CARD_VISIBILITY,
|
|
162
|
+
f as PLACEHOLDER_IMAGE,
|
|
163
|
+
L as buildElementRenderer,
|
|
164
|
+
x as createBlockTemplate,
|
|
165
|
+
k as getDefaultProducts,
|
|
166
|
+
C as isDefaultAttribute,
|
|
167
|
+
h as resolveProductAttrValue,
|
|
168
|
+
N as sanitizeImageUrl,
|
|
169
|
+
I as spacer,
|
|
170
|
+
y as toDisplayName,
|
|
171
|
+
U as toDisplayableAttributeValue
|
|
165
172
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const i = [
|
|
2
|
+
"ozonebg",
|
|
3
|
+
"ozonehr",
|
|
4
|
+
"ozonero",
|
|
5
|
+
"ozoneinfo",
|
|
6
|
+
"babybg",
|
|
7
|
+
"ozongr",
|
|
8
|
+
"iboodat",
|
|
9
|
+
"iboodbe",
|
|
10
|
+
"iboodde",
|
|
11
|
+
"iboodfr",
|
|
12
|
+
"iboodnl",
|
|
13
|
+
"iboodpl"
|
|
14
|
+
], r = ["interencheres", "interencherespreprod"], d = ["lodenfrey", "lodenfreyuat"], c = "manualMerchandising";
|
|
15
|
+
function s(e, n) {
|
|
16
|
+
const o = {};
|
|
17
|
+
return i.includes(e) && (o.excludePurchaseDay = "30", o.userId = "{user_id}"), r.includes(e) && (o.hp = "1"), d.includes(e) && n === c && (o.includeOutOfStockItems = "true"), o;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
s as getPartnerRecommendationParams
|
|
21
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
function d(
|
|
2
|
-
const { thousandSeparator:
|
|
1
|
+
function d(c, t) {
|
|
2
|
+
const { thousandSeparator: i, decimalSeparator: e, decimalCount: r } = t, [u, o = ""] = String(c).split("."), n = o.slice(0, r).padEnd(r, "0"), a = u.replace(
|
|
3
3
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
return r > 0 &&
|
|
4
|
+
i
|
|
5
|
+
);
|
|
6
|
+
return r > 0 && n ? `${a}${e}${n}` : a;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const { price: t, currency:
|
|
8
|
+
function f(c) {
|
|
9
|
+
const { price: t, currency: i } = c, {
|
|
10
10
|
symbol: e,
|
|
11
11
|
alignment: r,
|
|
12
12
|
thousandSeparator: u,
|
|
13
|
-
decimalSeparator:
|
|
14
|
-
decimalCount:
|
|
15
|
-
} =
|
|
13
|
+
decimalSeparator: o,
|
|
14
|
+
decimalCount: n
|
|
15
|
+
} = i;
|
|
16
16
|
if (typeof t != "number" || Number.isNaN(t)) {
|
|
17
|
-
const
|
|
18
|
-
return r === "before" ? `${e} ${
|
|
17
|
+
const s = "0".repeat(n), m = `0${o}${s}`;
|
|
18
|
+
return r === "before" ? `${e} ${m}` : `${m} ${e}`;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const a = d(t, {
|
|
21
21
|
thousandSeparator: u,
|
|
22
|
-
decimalSeparator:
|
|
23
|
-
decimalCount:
|
|
22
|
+
decimalSeparator: o,
|
|
23
|
+
decimalCount: n
|
|
24
24
|
});
|
|
25
|
-
return r === "before" ? `${e} ${
|
|
25
|
+
return r === "before" ? `${e} ${a}` : `${a} ${e}`;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
f as formatPrice
|
|
29
29
|
};
|