storyly-placement 1.16.0 → 1.17.0
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/{BaseStory-CYzLr9nq.js → BaseStory-Dp6ZPHfW.js} +19 -19
- package/dist/{create-product-feed-impl-DY8k3rv-.js → create-product-feed-impl-DZWD7TEs.js} +70 -69
- package/dist/{directions-CwnC3a_E.js → directions-CYrnCIsr.js} +1 -1
- package/dist/{impression-Cyq4TnV1.js → impression-D7bza-i1.js} +1 -1
- package/dist/{index-Cle6_VmW.js → index-B4sVwTts.js} +2 -2
- package/dist/{index-0pvHE7Wu.js → index-BDysZ6T0.js} +77 -63
- package/dist/{index-CGq62ZYq.js → index-BKrDAPj3.js} +1 -1
- package/dist/{index-DrDeJPCY.js → index-BOQkbWPT.js} +1 -1
- package/dist/{index-DX0vXov2.js → index-BaFJwG4g.js} +667 -653
- package/dist/{index-B6K9g2w6.js → index-ByIMLOKp.js} +6 -6
- package/dist/{index-B0HCD_CX.js → index-C1fn9AQg.js} +39 -20
- package/dist/{index-m_3R9vOw.js → index-C8U5qprH.js} +3 -3
- package/dist/{index-DqwsIsSl.js → index-CYo9buTd.js} +2 -2
- package/dist/{index-BUoSa-yy.js → index-CdwqtsHq.js} +3 -3
- package/dist/{index-DxGx5tX1.js → index-CyjCBEyP.js} +1 -1
- package/dist/{index-BAn-lwM1.js → index-D53y-xHp.js} +10 -9
- package/dist/{index-DIKtXa9n.js → index-DJp9Dcfo.js} +10 -9
- package/dist/{index-CjvoRgFg.js → index-DUF2iwAC.js} +2 -2
- package/dist/{index-B1g2jFTK.js → index-DVS4GjvO.js} +173 -161
- package/dist/{index-CCmzNuJt.js → index-DYeLhwYf.js} +6 -6
- package/dist/{index-CBr5Wz3q.js → index-Dj2Z2Wpc.js} +2 -2
- package/dist/{index-wakxYZ6u.js → index-Dpz5cxtJ.js} +7 -7
- package/dist/{index-C4dW1pqw.js → index-DqXTSvMa.js} +2 -2
- package/dist/{index-7dFV-4xE.js → index-DqpUbp6C.js} +2 -2
- package/dist/{index-rx0D-y8n.js → index-Dsgw9pGm.js} +3 -3
- package/dist/{index-jshOOKml.js → index-DtkbMJBy.js} +3 -3
- package/dist/{index-BnRkcr11.js → index-FKqJ98aT.js} +27 -16
- package/dist/{index-CgsKfExI.js → index-GhI0hjb1.js} +2 -2
- package/dist/{index-D6pJkk7f.js → index-H_0SdzVc.js} +19 -19
- package/dist/{index-sOArwfJA.js → index-WsVuu54O.js} +2 -2
- package/dist/{index-BurYE_Od.js → index-ZB3iR_0R.js} +3 -3
- package/dist/{index-VB84vh55.js → index-etd1gZ-J.js} +2 -2
- package/dist/{index-DCFTpn-q.js → index-fJIiqh6e.js} +6 -6
- package/dist/{index-CNoaiD9c.js → index-qhJuUVu6.js} +254 -245
- package/dist/{index-C1OlHTOJ.js → index-w6CilWA_.js} +2 -2
- package/dist/index.d.ts +29 -0
- package/dist/{nudge-story-groups-impl-BSQbx9HB.js → nudge-story-groups-impl-BN06697L.js} +1 -1
- package/dist/{ref-CBdAG3Tv.js → ref-p4rHSR93.js} +1 -1
- package/dist/{story-group-animation-impl-CJQDNc61.js → story-group-animation-impl-CZXDqc4v.js} +1 -1
- package/dist/storyly-placement.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as E, s as _, h as r, J as L, m as y, j as d, a1 as p, M as n, C as l, a2 as A, b as v, a3 as c, u as a, $ as h, P as u, o as S, _ as w, a4 as x, K as b, n as P, a5 as O, c as q, a6 as I, f as m, l as V } from "./index-
|
|
2
|
-
import { d as k } from "./directions-
|
|
3
|
-
import { H as W, C as B, r as g, A as R, S as G } from "./index-
|
|
1
|
+
import { S as E, s as _, h as r, J as L, m as y, j as d, a1 as p, M as n, C as l, a2 as A, b as v, a3 as c, u as a, $ as h, P as u, o as S, _ as w, a4 as x, K as b, n as P, a5 as O, c as q, a6 as I, f as m, l as V } from "./index-BaFJwG4g.js";
|
|
2
|
+
import { d as k } from "./directions-CYrnCIsr.js";
|
|
3
|
+
import { H as W, C as B, r as g, A as R, S as G } from "./index-C1fn9AQg.js";
|
|
4
4
|
class H {
|
|
5
5
|
constructor({
|
|
6
6
|
story: t,
|
|
@@ -92,7 +92,7 @@ class H {
|
|
|
92
92
|
height: this.videoAsset_.videoHeight,
|
|
93
93
|
width: this.videoAsset_.videoWidth
|
|
94
94
|
}), this.storyProgressRemain_ = this.videoAsset_.duration, this.storyProgressSecond_ = this.videoAsset_.duration, this.videoAsset_.duration >= 120 && !p(this.storyData_.video_type)) {
|
|
95
|
-
const t = await (await import("./index-
|
|
95
|
+
const t = await (await import("./index-BOQkbWPT.js")).default;
|
|
96
96
|
this.videoSeekbar_ = new t({
|
|
97
97
|
storyDom: this.storyDom_,
|
|
98
98
|
videoDom: this.videoAsset_,
|
|
@@ -179,26 +179,26 @@ class H {
|
|
|
179
179
|
};
|
|
180
180
|
if (t.is_bg && (t.bg_color || t.gradient_colors)) {
|
|
181
181
|
this.isBlankStory_ = !0;
|
|
182
|
-
const i = (await import("./index-
|
|
182
|
+
const i = (await import("./index-DqpUbp6C.js")).default;
|
|
183
183
|
e.instance = new i({ ...o });
|
|
184
184
|
}
|
|
185
185
|
if (t.type === a.EMOJI) {
|
|
186
|
-
const i = (await import("./index-
|
|
186
|
+
const i = (await import("./index-etd1gZ-J.js")).default;
|
|
187
187
|
e.instance = new i({ ...o });
|
|
188
188
|
} else if (t.type === a.POLL) {
|
|
189
|
-
const i = (await import("./index-
|
|
189
|
+
const i = (await import("./index-Dj2Z2Wpc.js")).default;
|
|
190
190
|
e.instance = new i({ ...o });
|
|
191
191
|
} else if (t.type === a.RATING) {
|
|
192
|
-
const i = (await import("./index-
|
|
192
|
+
const i = (await import("./index-CYo9buTd.js")).default;
|
|
193
193
|
e.instance = new i({ ...o });
|
|
194
194
|
} else if (t.type === a.QUIZ) {
|
|
195
|
-
const i = (await import("./index-
|
|
195
|
+
const i = (await import("./index-DUF2iwAC.js")).default;
|
|
196
196
|
e.instance = new i({ ...o });
|
|
197
197
|
} else if (t.type === a.COUNTDOWN) {
|
|
198
|
-
const i = (await import("./index-
|
|
198
|
+
const i = (await import("./index-w6CilWA_.js")).default;
|
|
199
199
|
e.instance = new i({ ...o });
|
|
200
200
|
} else if (t.type === a.IMAGE_CTA) {
|
|
201
|
-
const i = (await import("./index-
|
|
201
|
+
const i = (await import("./index-GhI0hjb1.js")).default;
|
|
202
202
|
e.instance = new i({
|
|
203
203
|
...o,
|
|
204
204
|
type: a.IMAGE_CTA
|
|
@@ -209,34 +209,34 @@ class H {
|
|
|
209
209
|
type: t.type === a.BUTTON ? a.BUTTON : a.SWIPE
|
|
210
210
|
}), e.instance = this.ctaLayer_;
|
|
211
211
|
else if ((t.image_path || t.video_path || t.image_url) && t.studio_component_type) {
|
|
212
|
-
const i = (await import("./index-
|
|
212
|
+
const i = (await import("./index-DqXTSvMa.js")).default;
|
|
213
213
|
e.instance = new i({
|
|
214
214
|
...o,
|
|
215
215
|
mediaHost: this.group_.media_host
|
|
216
216
|
});
|
|
217
217
|
} else if (t.type === a.TEXT) {
|
|
218
|
-
const i = (await import("./index-
|
|
218
|
+
const i = (await import("./index-B4sVwTts.js")).default;
|
|
219
219
|
e.instance = new i({ ...o });
|
|
220
220
|
} else if (t.type === a.PRODUCT_TAG) {
|
|
221
|
-
const i = (await import("./index-
|
|
221
|
+
const i = (await import("./index-ZB3iR_0R.js")).default;
|
|
222
222
|
e.instance = new i({ ...o });
|
|
223
223
|
} else if (t.type === a.PROMO_CODE) {
|
|
224
|
-
const i = (await import("./index-
|
|
224
|
+
const i = (await import("./index-DtkbMJBy.js")).default;
|
|
225
225
|
e.instance = new i({ ...o });
|
|
226
226
|
} else if (t.type === a.QUESTION) {
|
|
227
|
-
const i = (await import("./index-
|
|
227
|
+
const i = (await import("./index-CdwqtsHq.js")).default;
|
|
228
228
|
e.instance = new i({
|
|
229
229
|
...o,
|
|
230
230
|
storiesContainer: this.storiesContainer_
|
|
231
231
|
});
|
|
232
232
|
} else if (t.type === a.PRODUCT_CARD) {
|
|
233
|
-
const i = (await import("./index-
|
|
233
|
+
const i = (await import("./index-WsVuu54O.js")).default;
|
|
234
234
|
e.instance = new i({ ...o });
|
|
235
235
|
} else if (t.type === a.PRODUCT_CATALOG) {
|
|
236
|
-
const i = (await import("./index-
|
|
236
|
+
const i = (await import("./index-BDysZ6T0.js")).default;
|
|
237
237
|
e.instance = new i({ ...o });
|
|
238
238
|
} else if (t.type === a.IMAGE_QUIZ) {
|
|
239
|
-
const i = (await import("./index-
|
|
239
|
+
const i = (await import("./index-C8U5qprH.js")).default;
|
|
240
240
|
e.instance = new i({ ...o });
|
|
241
241
|
}
|
|
242
242
|
(e.start_time || e.end_time) && (e.instance.hideLayer(), this.timedLayers_.push(e));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Y as
|
|
2
|
-
function
|
|
3
|
-
const _ = /@{p_(\d).+?}/,
|
|
1
|
+
import { Y as L, X as D } from "./index-BaFJwG4g.js";
|
|
2
|
+
function F(g, U, I) {
|
|
3
|
+
const _ = /@{p_(\d).+?}/, i = Object.freeze({
|
|
4
4
|
TITLE: /@{p_\d_title}/,
|
|
5
5
|
IMAGE: /@{p_\d_image_\d}/,
|
|
6
6
|
DESCRIPTION: /@{p_\d_desc}/,
|
|
@@ -13,31 +13,31 @@ function v(g, D) {
|
|
|
13
13
|
PRODUCT_ID: /@{p_\d_pid}/,
|
|
14
14
|
DISCOUNT: /@{p_\d_discount}/,
|
|
15
15
|
CURRENCY: /@{p_\d_currency}/
|
|
16
|
-
}),
|
|
17
|
-
return
|
|
16
|
+
}), R = [], w = 8;
|
|
17
|
+
return U.forEach((h) => {
|
|
18
18
|
if (!g[h.name])
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (l.length ===
|
|
20
|
+
const S = g[h.name], l = [];
|
|
21
|
+
L(h.stories).forEach((f) => {
|
|
22
|
+
if (l.length === w)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
24
|
+
const O = Math.max(
|
|
25
25
|
...f.media.layers.flatMap((o) => Object.values(o)).filter(
|
|
26
26
|
(o) => typeof o == "string" && o.match(_)
|
|
27
27
|
).map((o) => +o.match(_)[1])
|
|
28
28
|
);
|
|
29
29
|
let m = structuredClone(f), C = 0;
|
|
30
30
|
const E = [];
|
|
31
|
-
|
|
32
|
-
if (C ===
|
|
31
|
+
S.filter((o) => !o.used).forEach((o, x) => {
|
|
32
|
+
if (C === O)
|
|
33
33
|
return;
|
|
34
|
-
const t = structuredClone(o),
|
|
34
|
+
const t = structuredClone(o), P = t.price, T = t.sales_price;
|
|
35
35
|
m.media.layers.forEach((e, u) => {
|
|
36
36
|
const d = e;
|
|
37
37
|
Object.keys(e).filter(
|
|
38
38
|
(c) => typeof e[c] == "string" && e[c].match(_) || c === "products"
|
|
39
39
|
).forEach((c) => {
|
|
40
|
-
var
|
|
40
|
+
var A;
|
|
41
41
|
if (c === "products") {
|
|
42
42
|
if (!t.product_id || !t.product_group_id)
|
|
43
43
|
return;
|
|
@@ -52,10 +52,10 @@ function v(g, D) {
|
|
|
52
52
|
product_group_id: t.product_group_id
|
|
53
53
|
}
|
|
54
54
|
], delete t.product_id, delete t.product_group_id);
|
|
55
|
-
else if (e[c].match(
|
|
56
|
-
const
|
|
55
|
+
else if (e[c].match(i.PRODUCTS)) {
|
|
56
|
+
const s = f.media.layers[u - 1], p = (A = Object.values(s).find(
|
|
57
57
|
(n) => typeof n == "string" && n.match(_)
|
|
58
|
-
)) == null ? void 0 :
|
|
58
|
+
)) == null ? void 0 : A.match(_), a = e[c].match(_);
|
|
59
59
|
if (!p || p[1] !== a[1]) {
|
|
60
60
|
d[c] = [
|
|
61
61
|
{
|
|
@@ -65,7 +65,7 @@ function v(g, D) {
|
|
|
65
65
|
}
|
|
66
66
|
];
|
|
67
67
|
for (let n = 1; n < 5; n += 1) {
|
|
68
|
-
const r =
|
|
68
|
+
const r = S[x + n];
|
|
69
69
|
r && (d[c].push({
|
|
70
70
|
id: r.id,
|
|
71
71
|
product_id: r.product_id,
|
|
@@ -85,98 +85,99 @@ function v(g, D) {
|
|
|
85
85
|
]);
|
|
86
86
|
delete t.product_id, delete t.product_group_id;
|
|
87
87
|
}
|
|
88
|
-
} else if (e[c].match(
|
|
89
|
-
const
|
|
90
|
-
|
|
88
|
+
} else if (e[c].match(i.TITLE) && t.title) {
|
|
89
|
+
const s = e[c].replace(
|
|
90
|
+
i.TITLE,
|
|
91
91
|
t.title
|
|
92
92
|
);
|
|
93
|
-
d[c] =
|
|
94
|
-
} else if (e[c].match(
|
|
95
|
-
const
|
|
96
|
-
|
|
93
|
+
d[c] = s, delete t.title;
|
|
94
|
+
} else if (e[c].match(i.CTA) && t.url) {
|
|
95
|
+
const s = e[c].replace(
|
|
96
|
+
i.CTA,
|
|
97
97
|
t.url
|
|
98
98
|
);
|
|
99
|
-
d[c] =
|
|
100
|
-
} else if (e[c].match(
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
`${
|
|
99
|
+
d[c] = s, delete t.url;
|
|
100
|
+
} else if (e[c].match(i.CTA_TEXT)) {
|
|
101
|
+
const s = t.cta_text ?? null, p = e[c].replace(
|
|
102
|
+
i.CTA_TEXT,
|
|
103
|
+
`${s}`
|
|
104
104
|
);
|
|
105
105
|
d[c] = p, delete t.cta_text;
|
|
106
|
-
} else if (e[c].match(
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
} else if (e[c].match(i.SALES_PRICE) && t.sales_price) {
|
|
107
|
+
const s = e[c].replace(
|
|
108
|
+
i.SALES_PRICE,
|
|
109
|
+
D(
|
|
110
110
|
t.sales_price,
|
|
111
|
-
t.price_currency
|
|
111
|
+
t.price_currency,
|
|
112
|
+
I
|
|
112
113
|
)
|
|
113
114
|
);
|
|
114
|
-
d[c] =
|
|
115
|
-
} else if (e[c].match(
|
|
116
|
-
const
|
|
115
|
+
d[c] = s, delete t.sales_price;
|
|
116
|
+
} else if (e[c].match(i.PRICE) && (t.price || t.sales_price)) {
|
|
117
|
+
const s = f.media.layers.some(
|
|
117
118
|
(n) => Object.values(n).some(
|
|
118
|
-
(r) => typeof r == "string" && r.match(
|
|
119
|
+
(r) => typeof r == "string" && r.match(i.SALES_PRICE)
|
|
119
120
|
)
|
|
120
121
|
);
|
|
121
122
|
let { price: p } = t;
|
|
122
|
-
!
|
|
123
|
+
!s && t.sales_price && (p = t.sales_price, delete t.sales_price);
|
|
123
124
|
const a = e[c].replace(
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
i.PRICE,
|
|
126
|
+
D(p, t.price_currency, I) || 0
|
|
126
127
|
);
|
|
127
128
|
d[c] = a, delete t.price;
|
|
128
|
-
} else if (e[c].match(
|
|
129
|
-
const
|
|
130
|
-
|
|
129
|
+
} else if (e[c].match(i.CURRENCY) && t.price_currency) {
|
|
130
|
+
const s = e[c].replace(
|
|
131
|
+
i.CURRENCY,
|
|
131
132
|
t.price_currency
|
|
132
133
|
);
|
|
133
|
-
d[c] =
|
|
134
|
-
} else if (e[c].match(
|
|
135
|
-
const
|
|
136
|
-
|
|
134
|
+
d[c] = s, delete t.price_currency;
|
|
135
|
+
} else if (e[c].match(i.PRODUCT_ID) && t.product_id) {
|
|
136
|
+
const s = e[c].replace(
|
|
137
|
+
i.PRODUCT_ID,
|
|
137
138
|
t.product_id
|
|
138
139
|
);
|
|
139
|
-
d[c] =
|
|
140
|
-
} else if (e[c].match(
|
|
141
|
-
const
|
|
142
|
-
(
|
|
140
|
+
d[c] = s, delete t.product_id;
|
|
141
|
+
} else if (e[c].match(i.DISCOUNT) && T && T < P) {
|
|
142
|
+
const s = Math.ceil(
|
|
143
|
+
(P - T) * 100 / P
|
|
143
144
|
), p = e[c].replace(
|
|
144
|
-
|
|
145
|
-
`${
|
|
145
|
+
i.DISCOUNT,
|
|
146
|
+
`${s}%`
|
|
146
147
|
);
|
|
147
148
|
d[c] = p;
|
|
148
|
-
} else if (e[c].match(
|
|
149
|
-
const
|
|
150
|
-
|
|
149
|
+
} else if (e[c].match(i.DESCRIPTION) && t.description) {
|
|
150
|
+
const s = e[c].replace(
|
|
151
|
+
i.DESCRIPTION,
|
|
151
152
|
t.description
|
|
152
153
|
);
|
|
153
|
-
d[c] =
|
|
154
|
-
} else if (e[c].match(
|
|
154
|
+
d[c] = s, delete t.description;
|
|
155
|
+
} else if (e[c].match(i.IMAGE) && t.image_urls) {
|
|
155
156
|
if (t.image_urls.length === 0)
|
|
156
157
|
return;
|
|
157
|
-
const
|
|
158
|
-
|
|
158
|
+
const s = e[c].replace(
|
|
159
|
+
i.IMAGE,
|
|
159
160
|
t.image_urls[0]
|
|
160
161
|
);
|
|
161
|
-
t.image_urls.length > 0 && t.image_urls.splice(0, 1), d[c] =
|
|
162
|
+
t.image_urls.length > 0 && t.image_urls.splice(0, 1), d[c] = s;
|
|
162
163
|
}
|
|
163
164
|
});
|
|
164
165
|
});
|
|
165
|
-
const
|
|
166
|
+
const N = m.media.layers.every(
|
|
166
167
|
(e) => Object.values(e).filter((u) => typeof u == "string").every((u) => !u.match(_))
|
|
167
|
-
),
|
|
168
|
+
), b = m.media.layers.some(
|
|
168
169
|
(e) => Object.values(e).filter((u) => typeof u == "string").some((u) => u == null ? void 0 : u.match(_))
|
|
169
170
|
);
|
|
170
|
-
|
|
171
|
+
N ? (C += 1, E.length > 0 && E.forEach((e) => {
|
|
171
172
|
e.used = !0;
|
|
172
|
-
}), o.used = !0, l.push(m), m = structuredClone(f)) :
|
|
173
|
+
}), o.used = !0, l.push(m), m = structuredClone(f)) : O > 1 && b && (C += 1, E.push(o));
|
|
173
174
|
});
|
|
174
|
-
}), l.length > 0 &&
|
|
175
|
+
}), l.length > 0 && R.push({
|
|
175
176
|
...h,
|
|
176
177
|
stories: l
|
|
177
178
|
});
|
|
178
|
-
}), Promise.resolve(
|
|
179
|
+
}), Promise.resolve(R);
|
|
179
180
|
}
|
|
180
181
|
export {
|
|
181
|
-
|
|
182
|
+
F as default
|
|
182
183
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u, aj as k, m as E, F as g, S as T, O as _, Z as x, M as C } from "./index-
|
|
2
|
-
import { a as w } from "./index-
|
|
1
|
+
import { u, aj as k, m as E, F as g, S as T, O as _, Z as x, M as C } from "./index-BaFJwG4g.js";
|
|
2
|
+
import { a as w } from "./index-C1fn9AQg.js";
|
|
3
3
|
class A {
|
|
4
4
|
constructor() {
|
|
5
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as L, b as x, w as
|
|
2
|
-
import { X as h, F as p, O as
|
|
1
|
+
import { a as L, b as x, w as E } from "./index-C1fn9AQg.js";
|
|
2
|
+
import { X as h, F as p, O as $, S as l, u as P, b as C, s as _, Z as f, L as m, M as b, ak as A, ae as D, E as v, af as y, A as S, Q as T, n as w } from "./index-BaFJwG4g.js";
|
|
3
3
|
const g = {
|
|
4
4
|
heart: (t) => `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="${t ?? "none"}"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.8931 3.07333C13.2054 2.38532 12.2725 1.99878 11.2998 1.99878C10.327 1.99878 9.3941 2.38532 8.70642 3.07333L7.99975 3.78L7.29309 3.07333C5.86083 1.64107 3.53868 1.64107 2.10642 3.07333C0.674162 4.50559 0.674162 6.82774 2.10642 8.26L2.81309 8.96666L7.99975 14.1533L13.1864 8.96666L13.8931 8.26C14.5811 7.57231 14.9676 6.63942 14.9676 5.66666C14.9676 4.6939 14.5811 3.76101 13.8931 3.07333Z" stroke="#242450" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
|
5
5
|
bookmark: (t) => `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="${t ?? "none"}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.6668 14L8.00016 10.6667L3.3335 14V3.33333C3.3335 2.59695 3.93045 2 4.66683 2H11.3335C12.0699 2 12.6668 2.59695 12.6668 3.33333V14Z" stroke="#242450" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,
|
|
6
6
|
star: (t) => `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="${t ?? "none"}"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.00016 1.33331L10.0602 5.50665L14.6668 6.17998L11.3335 9.42665L12.1202 14.0133L8.00016 11.8466L3.88016 14.0133L4.66683 9.42665L1.3335 6.17998L5.94016 5.50665L8.00016 1.33331Z" stroke="#242450" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`
|
|
7
|
-
}, k = (t, r) => {
|
|
8
|
-
var
|
|
7
|
+
}, k = (t, r, e) => {
|
|
8
|
+
var s;
|
|
9
9
|
return `
|
|
10
10
|
<div
|
|
11
11
|
class="product-card"
|
|
@@ -14,7 +14,7 @@ const g = {
|
|
|
14
14
|
tabindex="-1"
|
|
15
15
|
aria-hidden="true"
|
|
16
16
|
>
|
|
17
|
-
${(
|
|
17
|
+
${(s = t.image_urls) != null && s.length ? `<img class="product-card-media" src="${t.image_urls[0]}" alt="product" />` : ""}
|
|
18
18
|
<div class="product-card-right-container">
|
|
19
19
|
<div class="product-description-container ${t.is_title_visible ? "" : "no-description"} ${t.w_v ? "has-wishlist" : ""}">
|
|
20
20
|
${t.is_title_visible ? `<p class="product-card-right-container-description">${t.title}</p>` : ""}
|
|
@@ -24,27 +24,33 @@ const g = {
|
|
|
24
24
|
</div>
|
|
25
25
|
<div class="product-card-right-container-bottom-section">
|
|
26
26
|
<div class="product-card-price-container">
|
|
27
|
-
${t.is_price_visible && !t.sales_price ? `<span class="product-card-current-price">${
|
|
28
|
-
|
|
29
|
-
t.price_currency
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
t.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
${t.is_price_visible && !t.sales_price ? `<span class="product-card-current-price">${h(
|
|
28
|
+
t.price,
|
|
29
|
+
t.price_currency,
|
|
30
|
+
e
|
|
31
|
+
)}</span>` : ""}
|
|
32
|
+
${!t.is_price_visible && t.sales_price && t.is_s_price_visible ? `<span class="product-card-current-price">${h(
|
|
33
|
+
t.sales_price,
|
|
34
|
+
t.price_currency,
|
|
35
|
+
e
|
|
36
|
+
)}</span>` : ""}
|
|
37
|
+
${t.is_s_price_visible && t.sales_price && t.is_price_visible ? `<span class="product-card-current-price">${h(
|
|
38
|
+
t.sales_price,
|
|
39
|
+
t.price_currency,
|
|
40
|
+
e
|
|
41
|
+
)}</span>${t.lowest_price ? `<span class="product-card-old-price-container"><span class="product-card-old-lowest-price">${h(
|
|
39
42
|
t.lowest_price,
|
|
40
|
-
t.price_currency
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
t.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
t.price_currency,
|
|
44
|
+
e
|
|
45
|
+
)}</span><span class="product-card-old-price">${h(
|
|
46
|
+
t.price,
|
|
47
|
+
t.price_currency,
|
|
48
|
+
e
|
|
49
|
+
)}</span></span>` : `<span class="product-card-old-price">${h(
|
|
50
|
+
t.price,
|
|
51
|
+
t.price_currency,
|
|
52
|
+
e
|
|
53
|
+
)}</span>`}` : ""}
|
|
48
54
|
</div>
|
|
49
55
|
${t.c_b_text ? `<button
|
|
50
56
|
class="product-card-purchase-button"
|
|
@@ -76,10 +82,10 @@ const g = {
|
|
|
76
82
|
role="component"
|
|
77
83
|
data-group=""
|
|
78
84
|
data-story=""
|
|
79
|
-
style="font-family: ${
|
|
85
|
+
style="font-family: ${$({ instanceId: t, font: "" })};"
|
|
80
86
|
tabindex="-1"
|
|
81
87
|
aria-hidden="true"
|
|
82
|
-
dir="${((s = (e = (r =
|
|
88
|
+
dir="${((s = (e = (r = l.getContext(t)) == null ? void 0 : r.getState()) == null ? void 0 : e.placementConfig) == null ? void 0 : s.direction) ?? "ltr"}"
|
|
83
89
|
></div>
|
|
84
90
|
<div class="product-list-arrow left-arrow" hidden>
|
|
85
91
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" class="no-pointer-events"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.333 8H2.666M6.667 12l-4-4 4-4" class="no-pointer-events"/></svg>
|
|
@@ -91,7 +97,7 @@ const g = {
|
|
|
91
97
|
</div>
|
|
92
98
|
`;
|
|
93
99
|
};
|
|
94
|
-
class
|
|
100
|
+
class O extends L {
|
|
95
101
|
constructor({
|
|
96
102
|
layer: r,
|
|
97
103
|
group: e,
|
|
@@ -100,17 +106,17 @@ class N extends L {
|
|
|
100
106
|
instanceId: i
|
|
101
107
|
}) {
|
|
102
108
|
super({
|
|
103
|
-
type:
|
|
109
|
+
type: P.PRODUCT_CATALOG,
|
|
104
110
|
storyDom: s,
|
|
105
111
|
instanceId: i
|
|
106
112
|
}), this.story_ = o, this.group_ = e, this.rendered_ = !1, this.storyPaused_ = !1, this.cardListenersAttached_ = !1, this.instanceId = i, this.setLayerData({ ...r }), this.attachCallbacksToElement_(), this.generateComponentAndAppendToPage(
|
|
107
113
|
I(i)
|
|
108
114
|
).then((a) => {
|
|
109
|
-
var n,
|
|
110
|
-
this.dom_ = a, (
|
|
115
|
+
var n, d;
|
|
116
|
+
this.dom_ = a, (d = (n = l.getContext(this.instanceId)) == null ? void 0 : n.getState()) != null && d.isVideoFeed && (C() ? (_(
|
|
111
117
|
this.dom_.parentElement,
|
|
112
118
|
["video-feed-mobile-view"]
|
|
113
|
-
),
|
|
119
|
+
), _(this.dom_, "mask")) : _(
|
|
114
120
|
this.dom_.parentElement,
|
|
115
121
|
"video-feed-desktop-view"
|
|
116
122
|
)), this.init_(), this.storyObserver_(this.storyObserverCallback_);
|
|
@@ -159,7 +165,7 @@ class N extends L {
|
|
|
159
165
|
const e = Array.from(
|
|
160
166
|
this.dom_.querySelectorAll(".product-list-arrow")
|
|
161
167
|
), [s, o] = e;
|
|
162
|
-
|
|
168
|
+
l.getContext(this.instanceId).getState().layout === m.MODERN && e.forEach((i, a) => {
|
|
163
169
|
a === 1 && o.removeAttribute("hidden"), i.addEventListener(
|
|
164
170
|
"click",
|
|
165
171
|
(n) => this.onClickArrow_({ target: n.target })
|
|
@@ -167,9 +173,9 @@ class N extends L {
|
|
|
167
173
|
}), this.productCardsContainer_.addEventListener(
|
|
168
174
|
"scroll",
|
|
169
175
|
({ currentTarget: i }) => {
|
|
170
|
-
const { scrollLeft: a, clientWidth: n, scrollWidth:
|
|
171
|
-
if (this.storyPaused_ || b(this.dom_, "onPlayPause"),
|
|
172
|
-
if (a + n >=
|
|
176
|
+
const { scrollLeft: a, clientWidth: n, scrollWidth: d } = i;
|
|
177
|
+
if (this.storyPaused_ || b(this.dom_, "onPlayPause"), l.getContext(this.instanceId).getState().layout !== m.CLASSIC) {
|
|
178
|
+
if (a + n >= d - 1) {
|
|
173
179
|
o.setAttribute("hidden", "true");
|
|
174
180
|
return;
|
|
175
181
|
}
|
|
@@ -196,13 +202,13 @@ class N extends L {
|
|
|
196
202
|
*/
|
|
197
203
|
renderProducts_() {
|
|
198
204
|
if (this.rendered_) {
|
|
199
|
-
const { products: e, s_products: s } = this.layerData, o =
|
|
200
|
-
(
|
|
201
|
-
(
|
|
205
|
+
const { products: e, s_products: s } = this.layerData, o = l.getContext(this.instanceId), { storylyHydration: i } = o.getState() ?? {}, a = (i ?? []).filter(
|
|
206
|
+
(d) => (e || s).filter(
|
|
207
|
+
(u) => u.product_group_id === d.product_group_id
|
|
202
208
|
).length
|
|
203
209
|
);
|
|
204
210
|
if (!a.length) return this.productCardsContainer_;
|
|
205
|
-
if (
|
|
211
|
+
if (A(
|
|
206
212
|
a,
|
|
207
213
|
this.layerData.productVariants ?? []
|
|
208
214
|
)) return this.productCardsContainer_;
|
|
@@ -212,13 +218,13 @@ class N extends L {
|
|
|
212
218
|
const s = e.closest(".product-card");
|
|
213
219
|
if (this.handleEvent_(D.ProductCatalogClicked), this.layerData.s_products) {
|
|
214
220
|
const { productIndex: o } = s.dataset, i = this.layerData.s_products[+o], { url: a } = i;
|
|
215
|
-
if (
|
|
216
|
-
|
|
221
|
+
if (v.hasEvent(
|
|
222
|
+
y.ActionClicked,
|
|
217
223
|
this.instanceId
|
|
218
224
|
)) {
|
|
219
225
|
const n = this.group_.stories.findIndex(
|
|
220
|
-
(
|
|
221
|
-
),
|
|
226
|
+
(u) => u.story_id === this.story_.story_id
|
|
227
|
+
), d = {
|
|
222
228
|
id: this.story_.story_id,
|
|
223
229
|
title: this.story_.title ?? null,
|
|
224
230
|
name: this.story_.name ?? null,
|
|
@@ -228,13 +234,13 @@ class N extends L {
|
|
|
228
234
|
actionUrl: a,
|
|
229
235
|
products: [i]
|
|
230
236
|
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
v.runEvent(
|
|
238
|
+
y.ActionClicked,
|
|
239
|
+
d,
|
|
234
240
|
this.instanceId
|
|
235
|
-
),
|
|
241
|
+
), v.runEvent(
|
|
236
242
|
S.UserEvent,
|
|
237
|
-
{ event:
|
|
243
|
+
{ event: y.ActionClicked, ...d },
|
|
238
244
|
this.instanceId
|
|
239
245
|
);
|
|
240
246
|
return;
|
|
@@ -284,29 +290,29 @@ class N extends L {
|
|
|
284
290
|
return this.productCardsContainer_;
|
|
285
291
|
}
|
|
286
292
|
clickedWishlist_({ target: r }) {
|
|
287
|
-
const e = r.closest(".product-card"), { productId: s } = e.dataset, o =
|
|
293
|
+
const e = r.closest(".product-card"), { productId: s } = e.dataset, o = l.getContext(this.instanceId), { storylyHydration: i } = o.getState(), a = r.closest(".wishlist-wrapper"), n = i.find(
|
|
288
294
|
(c) => c.product_id === s
|
|
289
295
|
);
|
|
290
296
|
if (!n)
|
|
291
297
|
return;
|
|
292
|
-
const
|
|
298
|
+
const d = l.getContext(
|
|
293
299
|
this.instanceId
|
|
294
|
-
).getState().ToastComponent,
|
|
295
|
-
c === 0 ? (
|
|
300
|
+
).getState().ToastComponent, u = (c) => {
|
|
301
|
+
c === 0 ? (d.show(
|
|
296
302
|
`${g[this.layerData.w_i ?? "heart"]()} ${this.layerData.w_r_m}`
|
|
297
|
-
), this.handleWislistEvent_(n, w.WishlistRemoved), n.wishlist = !1) : c === 1 ? (
|
|
303
|
+
), this.handleWislistEvent_(n, w.WishlistRemoved), n.wishlist = !1) : c === 1 ? (d.show(
|
|
298
304
|
`${g[this.layerData.w_i ?? "heart"]("black")} ${this.layerData.w_a_m}`
|
|
299
|
-
), n.wishlist = !0, this.handleWislistEvent_(n, w.WishlistAdded)) : c && (
|
|
305
|
+
), n.wishlist = !0, this.handleWislistEvent_(n, w.WishlistAdded)) : c && (d.show(
|
|
300
306
|
`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.99967 14.6668C11.6816 14.6668 14.6663 11.6821 14.6663 8.00016C14.6663 4.31826 11.6816 1.3335 7.99967 1.3335C4.31778 1.3335 1.33301 4.31826 1.33301 8.00016C1.33301 11.6821 4.31778 14.6668 7.99967 14.6668Z" stroke="#212121" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 5.3335V8.00016" stroke="#212121" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="8" cy="11" r="1" fill="#212121"/></svg> ${c}`
|
|
301
307
|
), this.handleWislistEvent_(n, w.WishlistFailed));
|
|
302
308
|
};
|
|
303
|
-
|
|
309
|
+
E(
|
|
304
310
|
this.dom_,
|
|
305
311
|
n,
|
|
306
312
|
this.group_,
|
|
307
313
|
this.story_,
|
|
308
314
|
a,
|
|
309
|
-
|
|
315
|
+
u
|
|
310
316
|
);
|
|
311
317
|
}
|
|
312
318
|
/**
|
|
@@ -316,7 +322,11 @@ class N extends L {
|
|
|
316
322
|
var r;
|
|
317
323
|
this.layerData.s_products ? this.layerData.s_products.forEach((e, s) => {
|
|
318
324
|
const o = this.generateHtmlFromTemplate(
|
|
319
|
-
k(
|
|
325
|
+
k(
|
|
326
|
+
{ ...this.layerData, ...e },
|
|
327
|
+
s,
|
|
328
|
+
this.instanceId
|
|
329
|
+
)
|
|
320
330
|
);
|
|
321
331
|
this.productCardsContainer_.appendChild(o);
|
|
322
332
|
}) : (r = this.layerData.products) == null || r.forEach(({ product_id: e, product_group_id: s }) => {
|
|
@@ -325,10 +335,14 @@ class N extends L {
|
|
|
325
335
|
);
|
|
326
336
|
if (o) {
|
|
327
337
|
const i = this.generateHtmlFromTemplate(
|
|
328
|
-
k(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
338
|
+
k(
|
|
339
|
+
{
|
|
340
|
+
...this.layerData,
|
|
341
|
+
...o
|
|
342
|
+
},
|
|
343
|
+
void 0,
|
|
344
|
+
this.instanceId
|
|
345
|
+
)
|
|
332
346
|
);
|
|
333
347
|
this.productCardsContainer_.appendChild(i);
|
|
334
348
|
}
|
|
@@ -377,5 +391,5 @@ class N extends L {
|
|
|
377
391
|
}
|
|
378
392
|
}
|
|
379
393
|
export {
|
|
380
|
-
|
|
394
|
+
O as default
|
|
381
395
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as l, m as d, L as a, j as o, Z as c, M as n, b as _, s as m, f as g } from "./index-
|
|
1
|
+
import { S as l, m as d, L as a, j as o, Z as c, M as n, b as _, s as m, f as g } from "./index-BaFJwG4g.js";
|
|
2
2
|
const y = () => `
|
|
3
3
|
<div class="storyly__video-feed-video-seekbar show">
|
|
4
4
|
<div class="seekbar-time-wrapper">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as h, m as l, L as a, Z as d, M as c, j as r } from "./index-
|
|
1
|
+
import { S as h, m as l, L as a, Z as d, M as c, j as r } from "./index-BaFJwG4g.js";
|
|
2
2
|
const _ = () => `
|
|
3
3
|
<div class="storyly__default-video-seekbar show">
|
|
4
4
|
<div class="action-icon">
|