@useinsider/guido 3.9.0 → 3.9.1
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/config/compiler/utils/recommendationCompilerUtils.js +118 -110
- package/dist/config/migrator/itemsBlockMigrator.js +159 -114
- package/dist/config/migrator/unsubscribeMigrator.js +89 -67
- package/dist/extensions/Blocks/Items/block.js +57 -37
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +17 -18
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +67 -78
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +13 -9
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +26 -14
- package/dist/extensions/Blocks/Items/template.js +245 -247
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +53 -45
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +15 -15
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +9 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +7 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +12 -0
- package/package.json +2 -2
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import j from "./
|
|
6
|
-
import q from "./layouts/
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { escapeHtml as A } from "../../../utils/htmlEscape.js";
|
|
2
|
+
import { BlockType as O, BlockAttr as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { ItemsBlockId as I } from "./enums/controlEnums.js";
|
|
4
|
+
import { productPairs as R, templateFirstLine as Y } from "./enums/productEnums.js";
|
|
5
|
+
import { ItemInCartOptions as j, SETTINGS_ENUMS as m, DefaultConfigValues as M } from "./enums/settingsEnums.js";
|
|
6
|
+
import q from "./layouts/horizontal.html.js";
|
|
7
|
+
import J from "./layouts/vertical.html.js";
|
|
8
|
+
import { deriveItemNumber as Z, escapeReplacement as X } from "./utils/nodeConfigUtils.js";
|
|
9
|
+
let [V] = R.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = R.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [S] = R.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = R.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [g] = R.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
10
|
+
const k = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), D = (a) => k(a, "text-align"), w = (a, t) => {
|
|
11
|
+
const l = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), s = a.match(l);
|
|
12
|
+
return s ? s[1].trim() : null;
|
|
13
|
+
}, G = (a, t, l) => new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi").test(a) ? a.replace(
|
|
14
|
+
new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi"),
|
|
15
|
+
`$1${l}`
|
|
16
|
+
) : a, x = (a) => `<tr>${a}</tr>`, tt = (a, t, l, s) => {
|
|
17
|
+
const n = l || M.productImageHeight, o = (s == null ? void 0 : s.imageVisible) === !1 ? "display: none; " : "";
|
|
18
|
+
return x(`
|
|
18
19
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
19
20
|
align="center"
|
|
20
|
-
esd-extension-block-id="${
|
|
21
|
+
esd-extension-block-id="${I.IMAGE}"
|
|
21
22
|
data-slot-1=""
|
|
22
23
|
product-attr="imageSrc"
|
|
23
|
-
data-type="${
|
|
24
|
-
data-number="${
|
|
25
|
-
style="${
|
|
24
|
+
data-type="${a}"
|
|
25
|
+
data-number="${t}"
|
|
26
|
+
style="${o}font-size: 0px;">
|
|
26
27
|
<a class="document-node-component ng-star-inserted"
|
|
27
28
|
target="_blank"
|
|
28
29
|
href="#!">
|
|
29
30
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
30
31
|
style="object-fit: contain;"
|
|
31
|
-
src="${
|
|
32
|
-
alt="${
|
|
33
|
-
width="${
|
|
34
|
-
height="${
|
|
32
|
+
src="${V}"
|
|
33
|
+
alt="${F}"
|
|
34
|
+
width="${n}"
|
|
35
|
+
height="${n}">
|
|
35
36
|
</a>
|
|
36
37
|
</td>
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
<${
|
|
40
|
-
${N.BLOCK_IMAGE.src}="${
|
|
41
|
-
${N.BLOCK_IMAGE.alt}="${
|
|
38
|
+
`);
|
|
39
|
+
}, et = (a, t) => `
|
|
40
|
+
<${O.BLOCK_IMAGE}
|
|
41
|
+
${N.BLOCK_IMAGE.src}="${V}"
|
|
42
|
+
${N.BLOCK_IMAGE.alt}="${F}"
|
|
42
43
|
${N.BLOCK_IMAGE.href}="#!"
|
|
43
|
-
${N.BLOCK_IMAGE.width}="${
|
|
44
|
-
${N.BLOCK_IMAGE.height}="${
|
|
45
|
-
esd-extension-block-id="${
|
|
44
|
+
${N.BLOCK_IMAGE.width}="${M.productImageWidth}"
|
|
45
|
+
${N.BLOCK_IMAGE.height}="${M.productImageWidth}"
|
|
46
|
+
esd-extension-block-id="${I.IMAGE}"
|
|
46
47
|
data-slot-1
|
|
47
48
|
product-attr="imageSrc"
|
|
48
|
-
data-type="${
|
|
49
|
-
data-number="${
|
|
49
|
+
data-type="${a}"
|
|
50
|
+
data-number="${t}"
|
|
50
51
|
/>
|
|
51
|
-
`,
|
|
52
|
-
const
|
|
52
|
+
`, at = (a, t, l, s) => {
|
|
53
|
+
const n = `
|
|
53
54
|
text-decoration:none;
|
|
54
55
|
font-size: inherit;
|
|
55
56
|
font-weight: inherit;
|
|
@@ -59,50 +60,52 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
59
60
|
display: block;
|
|
60
61
|
word-wrap:break-word;
|
|
61
62
|
white-space: nowrap;
|
|
62
|
-
width:
|
|
63
|
+
width: 100%;
|
|
63
64
|
overflow: hidden;
|
|
64
65
|
text-overflow: ellipsis;
|
|
65
66
|
`;
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
if (t) {
|
|
68
|
+
const o = w(l || "", "text-align") || "center", i = D(l || n), c = w(i, "color"), r = w(i, "font-size"), $ = w(i, "font-family"), e = w(i, "font-weight"), E = w(i, "font-style"), _ = e === "bold" || e === "700", u = E === "italic", b = [
|
|
69
|
+
c ? `color: ${c}` : "",
|
|
70
|
+
r ? `font-size: ${r}` : "",
|
|
71
|
+
$ ? `font-family: ${$}` : ""
|
|
71
72
|
].filter(Boolean).join("; ");
|
|
72
|
-
let
|
|
73
|
-
|
|
73
|
+
let p = G(
|
|
74
|
+
G(i, "color", "inherit"),
|
|
74
75
|
"font-size",
|
|
75
76
|
"inherit"
|
|
76
77
|
);
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
let
|
|
78
|
+
p = k(p, "font-weight"), p = k(p, "font-style");
|
|
79
|
+
const P = (s == null ? void 0 : s.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
80
|
+
let d = `<a
|
|
80
81
|
href="#!"
|
|
81
|
-
style="${
|
|
82
|
+
style="${A(p)}"
|
|
82
83
|
product-attr="name"
|
|
83
84
|
data-slot-2
|
|
84
85
|
width="100%">
|
|
85
|
-
${
|
|
86
|
+
${F}
|
|
86
87
|
</a>`;
|
|
87
|
-
return
|
|
88
|
+
return _ && (d = `<strong>${d}</strong>`), u && (d = `<em>${d}</em>`), x(`
|
|
88
89
|
<td class="esd-block-text es-p10"
|
|
89
|
-
align="${
|
|
90
|
+
align="${o}"
|
|
90
91
|
width="100%"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
colspan="2"
|
|
93
|
+
data-type="${a}"
|
|
94
|
+
esd-extension-block-id="${I.NAME}"
|
|
95
|
+
style="${P}">
|
|
96
|
+
<p contenteditable="false" path="1"${b ? ` style="${A(b)}"` : ""}>
|
|
97
|
+
${d}
|
|
96
98
|
</p>
|
|
97
99
|
</td>
|
|
98
|
-
|
|
100
|
+
`);
|
|
99
101
|
}
|
|
100
|
-
return `<${
|
|
101
|
-
width="100%"
|
|
102
|
-
align="center"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
return `<${O.BLOCK_TEXT}
|
|
103
|
+
width="100%"
|
|
104
|
+
align="center"
|
|
105
|
+
colspan="2"
|
|
106
|
+
class="es-p10"
|
|
107
|
+
data-type="${a}"
|
|
108
|
+
esd-extension-block-id="${I.NAME}"
|
|
106
109
|
>
|
|
107
110
|
<p contenteditable="false">
|
|
108
111
|
<a
|
|
@@ -114,54 +117,55 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
114
117
|
line-height: inherit;
|
|
115
118
|
font-family: inherit;
|
|
116
119
|
color: inherit;
|
|
117
|
-
display: block;
|
|
118
|
-
word-wrap:break-word;
|
|
120
|
+
display: block;
|
|
121
|
+
word-wrap:break-word;
|
|
119
122
|
white-space: nowrap;
|
|
120
|
-
width:
|
|
123
|
+
width: 100%;
|
|
121
124
|
overflow: hidden;
|
|
122
125
|
text-overflow: ellipsis;
|
|
123
126
|
"
|
|
124
127
|
product-attr="name"
|
|
125
128
|
data-slot-2
|
|
126
129
|
width="100%">
|
|
127
|
-
${
|
|
130
|
+
${F}
|
|
128
131
|
</a>
|
|
129
132
|
</p>
|
|
130
|
-
</${
|
|
133
|
+
</${O.BLOCK_TEXT}>
|
|
131
134
|
`;
|
|
132
|
-
},
|
|
133
|
-
let
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
|
|
135
|
+
}, st = (a, t, l, s, n, o, i, c, r, $) => {
|
|
136
|
+
let e = S;
|
|
137
|
+
if (s && s.trim()) {
|
|
138
|
+
const d = `${s.trim()}`;
|
|
139
|
+
e = (n || "0") === "1" ? `${S} ${d}` : `${d} ${S}`;
|
|
137
140
|
}
|
|
138
|
-
const E =
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
return `
|
|
142
|
-
<td class="esd-block-text items-block-price${
|
|
141
|
+
const E = n === "1" ? "after" : "before", _ = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${E}"`, b = s ? `data-currency_symbol="${s}"` : "", p = `data-single_price="${c ? "true" : "false"}"`, T = r === m.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
142
|
+
if (o) {
|
|
143
|
+
const h = D(i || "color: #060606; white-space: nowrap; font-size: 20px;"), y = $ ? "" : ' style="display: none;"';
|
|
144
|
+
return x(`
|
|
145
|
+
<td class="esd-block-text items-block-price${T}"
|
|
143
146
|
align="center"
|
|
144
|
-
esd-extension-block-id="${
|
|
147
|
+
esd-extension-block-id="${I.PRICE}"
|
|
145
148
|
width="100%"
|
|
146
|
-
${
|
|
149
|
+
${y}>
|
|
147
150
|
<p product-attr="price"
|
|
148
151
|
contenteditable="false"
|
|
149
152
|
data-slot-4
|
|
150
|
-
data-type="${
|
|
151
|
-
data-number="${
|
|
153
|
+
data-type="${a}"
|
|
154
|
+
data-number="${t}"
|
|
152
155
|
${_}
|
|
153
156
|
${u}
|
|
154
|
-
${
|
|
157
|
+
${b}
|
|
155
158
|
${p}
|
|
156
|
-
style="${
|
|
157
|
-
${
|
|
159
|
+
style="${A(h)}">
|
|
160
|
+
${e}
|
|
158
161
|
</p>
|
|
159
|
-
</td
|
|
162
|
+
</td>
|
|
163
|
+
`);
|
|
160
164
|
}
|
|
161
165
|
return `
|
|
162
|
-
<${
|
|
163
|
-
esd-extension-block-id="${
|
|
164
|
-
class="items-block-price ${
|
|
166
|
+
<${O.BLOCK_TEXT}
|
|
167
|
+
esd-extension-block-id="${I.PRICE}"
|
|
168
|
+
class="items-block-price ${T}"
|
|
165
169
|
width="100%"
|
|
166
170
|
align="center"
|
|
167
171
|
>
|
|
@@ -169,281 +173,275 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
169
173
|
product-attr="price"
|
|
170
174
|
contenteditable="false"
|
|
171
175
|
data-slot-4
|
|
172
|
-
data-type="${
|
|
173
|
-
data-number="${
|
|
176
|
+
data-type="${a}"
|
|
177
|
+
data-number="${t}"
|
|
174
178
|
${_}
|
|
175
179
|
${u}
|
|
176
|
-
${
|
|
180
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
177
181
|
${p}
|
|
178
182
|
>
|
|
179
|
-
${
|
|
183
|
+
${e}
|
|
180
184
|
</p>
|
|
181
|
-
</${
|
|
185
|
+
</${O.BLOCK_TEXT}>
|
|
182
186
|
`;
|
|
183
|
-
},
|
|
184
|
-
let
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
|
|
187
|
+
}, lt = (a, t, l, s, n, o, i = !0, c, r, $) => {
|
|
188
|
+
let e = L;
|
|
189
|
+
if (s && s.trim()) {
|
|
190
|
+
const d = `${s.trim()}`;
|
|
191
|
+
e = (n || "0") === "1" ? `${L} ${d}` : `${d} ${L}`;
|
|
188
192
|
}
|
|
189
|
-
const E =
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
192
|
-
return `
|
|
193
|
-
<td class="esd-block-text items-block-price${
|
|
194
|
-
esd-extension-block-id="${
|
|
193
|
+
const E = n === "1" ? "after" : "before", _ = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${E}"`, b = i ? "" : ' style="display: none;"', p = `data-single_price="${r ? "true" : "false"}"`, T = $ === m.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
194
|
+
if (o) {
|
|
195
|
+
const h = D(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
196
|
+
return x(`
|
|
197
|
+
<td class="esd-block-text items-block-price${T}"
|
|
198
|
+
esd-extension-block-id="${I.ORIGINAL_PRICE}"
|
|
195
199
|
width="100%"
|
|
196
|
-
align="center"${
|
|
200
|
+
align="center"${b}>
|
|
197
201
|
<p
|
|
198
202
|
product-attr="originalPrice"
|
|
199
203
|
contenteditable="false"
|
|
200
204
|
data-slot-5
|
|
201
|
-
data-type="${
|
|
202
|
-
data-number="${
|
|
205
|
+
data-type="${a}"
|
|
206
|
+
data-number="${t}"
|
|
203
207
|
${_}
|
|
204
208
|
${u}
|
|
205
|
-
${
|
|
209
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
206
210
|
${p}
|
|
207
|
-
style="${
|
|
208
|
-
<s>${
|
|
211
|
+
style="${A(h)}">
|
|
212
|
+
<s>${e}</s>
|
|
209
213
|
</p>
|
|
210
214
|
</td>
|
|
211
|
-
|
|
215
|
+
`);
|
|
212
216
|
}
|
|
213
217
|
return `
|
|
214
|
-
<${
|
|
215
|
-
class="items-block-price ${
|
|
216
|
-
esd-extension-block-id="${
|
|
218
|
+
<${O.BLOCK_TEXT}
|
|
219
|
+
class="items-block-price ${T}"
|
|
220
|
+
esd-extension-block-id="${I.ORIGINAL_PRICE}"
|
|
217
221
|
width="100%"
|
|
218
222
|
align="center"
|
|
219
|
-
${
|
|
223
|
+
${i ? "" : 'style="display: none;"'}
|
|
220
224
|
>
|
|
221
225
|
<p
|
|
222
226
|
product-attr="originalPrice"
|
|
223
227
|
contenteditable="false"
|
|
224
228
|
data-slot-5
|
|
225
229
|
style="color: #cc0000"
|
|
226
|
-
data-type="${
|
|
227
|
-
data-number="${
|
|
230
|
+
data-type="${a}"
|
|
231
|
+
data-number="${t}"
|
|
228
232
|
${_}
|
|
229
233
|
${u}
|
|
230
|
-
${
|
|
234
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
231
235
|
${p}
|
|
232
236
|
>
|
|
233
|
-
<s>${
|
|
237
|
+
<s>${e}</s>
|
|
234
238
|
</p>
|
|
235
|
-
</${
|
|
239
|
+
</${O.BLOCK_TEXT}>
|
|
236
240
|
`;
|
|
237
|
-
},
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
const
|
|
241
|
-
return `
|
|
241
|
+
}, rt = (a = !0, t, l) => {
|
|
242
|
+
const s = a ? "" : 'style="display: none;"';
|
|
243
|
+
if (t) {
|
|
244
|
+
const n = "font-size: 14px;", o = w(l || "", "text-align") || "center", i = D(l || n);
|
|
245
|
+
return x(`
|
|
242
246
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
243
|
-
width="100%" align="${
|
|
244
|
-
esd-extension-block-id="${
|
|
245
|
-
${
|
|
247
|
+
width="100%" align="${o}"
|
|
248
|
+
esd-extension-block-id="${I.QUANTITY}"
|
|
249
|
+
${s}>
|
|
246
250
|
<p product-attr="quantity"
|
|
247
251
|
data-slot-3=""
|
|
248
252
|
contenteditable="false"
|
|
249
253
|
width="100%"
|
|
250
254
|
path="1"
|
|
251
|
-
style="${
|
|
252
|
-
${
|
|
255
|
+
style="${A(i)}">
|
|
256
|
+
${g}
|
|
253
257
|
</p>
|
|
254
|
-
</td
|
|
258
|
+
</td>
|
|
259
|
+
`);
|
|
255
260
|
}
|
|
256
261
|
return `
|
|
257
|
-
<${
|
|
262
|
+
<${O.BLOCK_TEXT}
|
|
258
263
|
width="100%"
|
|
259
264
|
align="center"
|
|
260
265
|
class="es-p10"
|
|
261
|
-
esd-extension-block-id="${
|
|
262
|
-
${
|
|
266
|
+
esd-extension-block-id="${I.QUANTITY}"
|
|
267
|
+
${a ? "" : 'style="display: none;"'}
|
|
263
268
|
>
|
|
264
269
|
<p
|
|
265
270
|
product-attr="quantity"
|
|
266
271
|
data-slot-3
|
|
267
272
|
contenteditable="false"
|
|
268
273
|
width="100%">
|
|
269
|
-
${
|
|
274
|
+
${g}
|
|
270
275
|
</p>
|
|
271
|
-
</${
|
|
276
|
+
</${O.BLOCK_TEXT}>
|
|
272
277
|
`;
|
|
273
|
-
},
|
|
274
|
-
if (
|
|
275
|
-
const c = w(
|
|
276
|
-
return `
|
|
278
|
+
}, it = (a, t, l = "Buy", s, n, o = !0, i = !0) => {
|
|
279
|
+
if (s) {
|
|
280
|
+
const c = w(n || "", "background") || w(n || "", "background-color"), r = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", $ = o ? "es-fw" : "es-il", e = (n || "").replace("border-width: 0;", "");
|
|
281
|
+
return x(`
|
|
277
282
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
278
|
-
align="center" width="100%" name="buy-button" caption="${
|
|
279
|
-
esd-extension-block-id="${
|
|
280
|
-
product-attr="button" data-slot-6="" data-type="${
|
|
281
|
-
${
|
|
282
|
-
<span class="es-button-border ${$}" style="${
|
|
283
|
-
<a
|
|
284
|
-
class="es-button"
|
|
285
|
-
href="#!"
|
|
286
|
-
target="_blank"
|
|
287
|
-
style="${
|
|
288
|
-
${
|
|
283
|
+
align="center" width="100%" name="buy-button" caption="${l}"
|
|
284
|
+
esd-extension-block-id="${I.BUTTON}"
|
|
285
|
+
product-attr="button" data-slot-6="" data-type="${a}" data-number="${t}"
|
|
286
|
+
${i ? "" : ' style="display: none;"'}>
|
|
287
|
+
<span class="es-button-border ${$}" style="${A(r)}">
|
|
288
|
+
<a
|
|
289
|
+
class="es-button"
|
|
290
|
+
href="#!"
|
|
291
|
+
target="_blank"
|
|
292
|
+
style="${A(e)} padding: 5px 12px;">
|
|
293
|
+
${l}
|
|
289
294
|
</a>
|
|
290
295
|
</span>
|
|
291
|
-
</td
|
|
296
|
+
</td>
|
|
297
|
+
`);
|
|
292
298
|
}
|
|
293
299
|
return `
|
|
294
|
-
<${
|
|
300
|
+
<${O.BLOCK_BUTTON}
|
|
295
301
|
width="100%"
|
|
296
302
|
class="ins-button"
|
|
297
303
|
name="buy-button"
|
|
298
|
-
caption="${
|
|
304
|
+
caption="${l}"
|
|
299
305
|
align="center"
|
|
300
|
-
esd-extension-block-id="${
|
|
306
|
+
esd-extension-block-id="${I.BUTTON}"
|
|
301
307
|
product-attr="button"
|
|
302
308
|
data-slot-6
|
|
303
|
-
data-type="${
|
|
304
|
-
data-number="${
|
|
305
|
-
>${
|
|
306
|
-
</${
|
|
309
|
+
data-type="${a}"
|
|
310
|
+
data-number="${t}"
|
|
311
|
+
>${l}
|
|
312
|
+
</${O.BLOCK_BUTTON}>
|
|
307
313
|
`;
|
|
308
|
-
},
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
const c = !
|
|
312
|
-
let
|
|
314
|
+
}, ct = (a, t, l, s = !0, n = !0) => {
|
|
315
|
+
const o = t === m.ORIENTATION.VERTICAL, i = l === "horizontal";
|
|
316
|
+
if (o) {
|
|
317
|
+
const c = !i, r = c || !n ? "100%" : "50%", $ = c || !s ? "100%" : "50%";
|
|
318
|
+
let e = a.replace(
|
|
313
319
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
314
|
-
(E) => E.replace(/width="[^"]*"/gi, `width="${
|
|
320
|
+
(E) => E.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
|
|
315
321
|
);
|
|
316
|
-
return
|
|
322
|
+
return e = e.replace(
|
|
317
323
|
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
318
324
|
(E) => E.replace(/width="[^"]*"/gi, `width="${$}"`).replace(/width:\s*[^;]+;/gi, `width: ${$};`)
|
|
319
|
-
),
|
|
325
|
+
), e;
|
|
320
326
|
}
|
|
321
|
-
return
|
|
327
|
+
return i ? a : a.replace(
|
|
322
328
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
323
329
|
(c) => /style\s*=\s*"/i.test(c) ? c.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : c.replace(/>$/, ' style="display: none;">')
|
|
324
330
|
).replace(
|
|
325
331
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
326
332
|
(c) => c.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
327
333
|
);
|
|
328
|
-
},
|
|
329
|
-
esd-extension-block-id="items-block"
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const h = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"`, y = s.replace(
|
|
333
|
-
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
334
|
-
`<td$1 ${h}>`
|
|
335
|
-
), X = l == null ? void 0 : l["data-product_image_control_image-height"], G = n ? Z(e, r, X, t) : J(e, r), K = (t == null ? void 0 : t.buttonLabel) || "Buy", B = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, W = e === x.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", k = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", f = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", H = y.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(n)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", tt(e, n, a, E, t)).replaceAll(
|
|
334
|
+
}, nt = (a) => a ? `<td align="center"
|
|
335
|
+
esd-extension-block-id="items-block"
|
|
336
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : Y, z = (a, t, l, s, n, o, i, c, r, $, e, E, _, u = "horizontal", b, p, P, T) => {
|
|
337
|
+
const y = `${`data-type="${t}" data-number="${l}"`} data-orientation="${s}"`, U = r == null ? void 0 : r["data-product_image_control_image-height"], K = o ? tt(t, l, U, e) : et(t, l), B = (e == null ? void 0 : e.buttonLabel) || "Buy", W = (e == null ? void 0 : e.buttonFullWidth) !== void 0 ? e.buttonFullWidth : !0, Q = t === m.ITEMS_TYPE.BROWSED_ITEMS ? !1 : e == null ? void 0 : e.quantityControlEnabled, C = (e == null ? void 0 : e.buttonVisible) !== void 0 ? e.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", f = (e == null ? void 0 : e.priceVisible) !== void 0 ? e.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", v = (e == null ? void 0 : e.originalPriceVisible) !== void 0 ? e.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", H = a.replace("{-{-TEMPLATE_FIRST_LINE-}-}", nt(o)).replace("{-{-PRODUCT_IMAGE-}-}", K).replace("{-{-PRODUCT_NAME-}-}", at(t, o, E, e)).replaceAll(
|
|
336
338
|
"{-{-PRODUCT_PRICE-}-}",
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
X(st(
|
|
340
|
+
t,
|
|
341
|
+
l,
|
|
342
|
+
n,
|
|
340
343
|
i,
|
|
341
|
-
o,
|
|
342
344
|
c,
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
o,
|
|
346
|
+
b,
|
|
347
|
+
T,
|
|
348
|
+
s,
|
|
349
|
+
f
|
|
348
350
|
))
|
|
349
351
|
).replaceAll(
|
|
350
352
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
353
|
+
X(lt(
|
|
354
|
+
t,
|
|
355
|
+
l,
|
|
356
|
+
n,
|
|
354
357
|
i,
|
|
355
|
-
o,
|
|
356
358
|
c,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
+
o,
|
|
360
|
+
v,
|
|
359
361
|
p,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
T,
|
|
363
|
+
s
|
|
362
364
|
))
|
|
363
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
365
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", rt(Q, o, P)).replace(
|
|
364
366
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
365
|
-
|
|
367
|
+
it(t, l, B, o, _, W, C)
|
|
368
|
+
).replace(
|
|
369
|
+
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
370
|
+
`<td$1 ${y}>`
|
|
366
371
|
);
|
|
367
|
-
return
|
|
372
|
+
return ct(
|
|
368
373
|
H,
|
|
369
|
-
|
|
374
|
+
s,
|
|
370
375
|
u,
|
|
371
|
-
|
|
372
|
-
|
|
376
|
+
f,
|
|
377
|
+
v
|
|
373
378
|
);
|
|
374
379
|
};
|
|
375
|
-
function
|
|
376
|
-
orientation:
|
|
377
|
-
itemsType:
|
|
378
|
-
itemId:
|
|
379
|
-
currencySymbol:
|
|
380
|
-
currencyLocation:
|
|
381
|
-
migrate:
|
|
382
|
-
formattedPrice:
|
|
380
|
+
function ht({
|
|
381
|
+
orientation: a,
|
|
382
|
+
itemsType: t = m.ITEMS_TYPE.CART_ITEMS,
|
|
383
|
+
itemId: l,
|
|
384
|
+
currencySymbol: s,
|
|
385
|
+
currencyLocation: n,
|
|
386
|
+
migrate: o = !1,
|
|
387
|
+
formattedPrice: i = !0,
|
|
383
388
|
configBlockAttributes: c,
|
|
384
|
-
nodeConfig:
|
|
389
|
+
nodeConfig: r,
|
|
385
390
|
nameStyles: $,
|
|
386
|
-
buttonStyles:
|
|
391
|
+
buttonStyles: e,
|
|
387
392
|
priceStyles: E,
|
|
388
393
|
originalPriceStyles: _,
|
|
389
394
|
quantityStyles: u,
|
|
390
|
-
priceOrientation:
|
|
395
|
+
priceOrientation: b
|
|
391
396
|
}) {
|
|
392
|
-
const p =
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
g = A.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[p >= 0 ? p : 0], L = A.PAIRS_FOR_EXTENSION.name[e].DEFAULT[p >= 0 ? p : 0];
|
|
402
|
-
const T = A.PAIRS_FOR_EXTENSION.price[e], I = A.PAIRS_FOR_EXTENSION.originalPrice[e];
|
|
403
|
-
d ? (m = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, S = o ? I.DEFAULT_SINGLE_PRICE_FORMATTED : I.DEFAULT_SINGLE_PRICE) : (m = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, S = o ? I.DEFAULT_PRICE_FORMATTED : I.DEFAULT_PRICE), M = A.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
404
|
-
const h = P || (l == null ? void 0 : l.priceOrientation) || "horizontal";
|
|
405
|
-
return s === x.ORIENTATION.VERTICAL ? z(
|
|
406
|
-
q,
|
|
407
|
-
e,
|
|
408
|
-
R,
|
|
409
|
-
s,
|
|
410
|
-
o,
|
|
411
|
-
n,
|
|
397
|
+
const p = j[t].findIndex((U) => U.value === l), P = Z(l, t), T = (r == null ? void 0 : r.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
398
|
+
V = R.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[p >= 0 ? p : 0], F = R.PAIRS_FOR_EXTENSION.name[t].DEFAULT[p >= 0 ? p : 0];
|
|
399
|
+
const d = R.PAIRS_FOR_EXTENSION.price[t], h = R.PAIRS_FOR_EXTENSION.originalPrice[t];
|
|
400
|
+
T ? (S = i ? d.DEFAULT_SINGLE_PRICE_FORMATTED : d.DEFAULT_SINGLE_PRICE, L = i ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (S = i ? d.DEFAULT_PRICE_FORMATTED : d.DEFAULT_PRICE, L = i ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), g = R.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
|
|
401
|
+
const y = b || (r == null ? void 0 : r.priceOrientation) || "horizontal";
|
|
402
|
+
return a === m.ORIENTATION.VERTICAL ? z(
|
|
403
|
+
J,
|
|
404
|
+
t,
|
|
405
|
+
P,
|
|
412
406
|
a,
|
|
413
407
|
i,
|
|
408
|
+
o,
|
|
409
|
+
s,
|
|
410
|
+
n,
|
|
414
411
|
c,
|
|
415
412
|
void 0,
|
|
416
413
|
// nodup
|
|
417
|
-
|
|
414
|
+
r,
|
|
418
415
|
$,
|
|
419
|
-
|
|
420
|
-
|
|
416
|
+
e,
|
|
417
|
+
y,
|
|
421
418
|
E,
|
|
422
419
|
_,
|
|
423
420
|
u,
|
|
424
|
-
|
|
421
|
+
T
|
|
425
422
|
) : z(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
s,
|
|
430
|
-
o,
|
|
431
|
-
n,
|
|
423
|
+
q,
|
|
424
|
+
t,
|
|
425
|
+
P,
|
|
432
426
|
a,
|
|
433
427
|
i,
|
|
428
|
+
o,
|
|
429
|
+
s,
|
|
430
|
+
n,
|
|
434
431
|
c,
|
|
435
432
|
void 0,
|
|
436
433
|
// nodup
|
|
437
|
-
|
|
434
|
+
r,
|
|
438
435
|
$,
|
|
439
|
-
|
|
440
|
-
|
|
436
|
+
e,
|
|
437
|
+
y,
|
|
441
438
|
E,
|
|
442
439
|
_,
|
|
443
440
|
u,
|
|
444
|
-
|
|
441
|
+
T
|
|
445
442
|
);
|
|
446
443
|
}
|
|
447
444
|
export {
|
|
448
|
-
|
|
445
|
+
ht as getDefaultTemplate,
|
|
446
|
+
x as wrapInTableRow
|
|
449
447
|
};
|