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