@useinsider/guido 3.18.1-beta.12053dd → 3.18.1-beta.178a3ec

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