@useinsider/guido 3.17.0-beta.77567eb → 3.17.0-beta.a51375c

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