storyly-placement 1.18.0 → 1.19.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-nHR84MRD.js → BaseStory-DV0lz5A8.js} +114 -73
- package/dist/{create-product-feed-impl-Cb2l2Q0W.js → create-product-feed-impl-UrlWWXz7.js} +1 -1
- package/dist/{directions-e67mS9V0.js → directions-gLJkHcCQ.js} +1 -1
- package/dist/{impression-CUXBnMk8.js → impression-CW-s-afq.js} +1 -1
- package/dist/{index-D6xw-ZiC.js → index--DOURGJ9.js} +3 -3
- package/dist/{index-D4a2T0Us.js → index-2vWsLAJ8.js} +3 -3
- package/dist/{index-BaYtoeyj.js → index-B5oHrVQX.js} +6 -6
- package/dist/{index-t8kM13yP.js → index-BIDDDJ_W.js} +757 -684
- package/dist/{index-CWdcljZC.js → index-BPVOUZlM.js} +2 -2
- package/dist/{index-Bnhuqyt-.js → index-BTjdmUrx.js} +3 -3
- package/dist/{index-RC4PPgm9.js → index-Bet7-CZw.js} +2 -2
- package/dist/{index-BtTq688c.js → index-BmSfIzL8.js} +19 -19
- package/dist/{index-BnoYsHZ-.js → index-Bnwd_UvX.js} +2 -2
- package/dist/{index-MKCmhWdw.js → index-BpPG9Hkl.js} +3 -3
- package/dist/{index-DuuhVMDq.js → index-BtCETCtE.js} +2 -2
- package/dist/{index-yTnn0dOM.js → index-BumLZ3s0.js} +1 -1
- package/dist/{index-CViNuw6U.js → index-CGDKSBwJ.js} +2 -2
- package/dist/{index-CP0ea88j.js → index-CLHjU_i4.js} +2 -2
- package/dist/{index-DSLoKNBd.js → index-CYeIaL5T.js} +3 -3
- package/dist/{index-DW8m-ny5.js → index-CblREiw3.js} +79 -72
- package/dist/{index-DUBETu5h.js → index-CecdozAb.js} +2 -2
- package/dist/{index-sWSUhkq0.js → index-D7zkRFYR.js} +1060 -1031
- package/dist/{index-C33h8RBI.js → index-DEO7eBUy.js} +1 -1
- package/dist/{index-D28GtpFp.js → index-DOfnNGa5.js} +78 -70
- package/dist/{index-BUoDQvaC.js → index-Dh5-g9go.js} +392 -343
- package/dist/{index-Da-NaqbP.js → index-DwTjbMJC.js} +2 -2
- package/dist/{index-8xdF7D6e.js → index-MCjotVPF.js} +2 -2
- package/dist/{index-B3kyoAn_.js → index-NfJP10SK.js} +2 -2
- package/dist/{index-BWQwvV9f.js → index-Nrttyf29.js} +2 -2
- package/dist/{index-Bgrg6oY-.js → index-Oms8IdVN.js} +3 -3
- package/dist/{index-C4oZe231.js → index-Z2xbbPNk.js} +4 -4
- package/dist/{index-CHLi1h1t.js → index-bjmKVOTa.js} +3 -3
- package/dist/{index-Ln7VIKbD.js → index-ejC4BUqD.js} +16 -16
- package/dist/{index-DPam8qTT.js → index-l5qEWd8G.js} +2 -2
- package/dist/{index-BbF6_WDf.js → index-thLjSh2o.js} +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/{nudge-story-groups-impl-BYIQzMeh.js → nudge-story-groups-impl-BhUIlCer.js} +1 -1
- package/dist/{ref-Zjkh_JJN.js → ref--B7BspUL.js} +1 -1
- package/dist/{story-group-animation-impl-CvbDg0yw.js → story-group-animation-impl-CpwuBQ87.js} +1460 -1461
- package/dist/storyly-placement.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,53 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { d as
|
|
3
|
-
import { H as
|
|
4
|
-
|
|
1
|
+
import { S as q, n as y, Q as c, N as n, $ as I, s as u, h as r, K as V, j as _, a2 as A, C as p, a3 as C, b as T, a4 as m, v as a, a0 as l, p as E, a5 as W, M as L, o as w, a6 as k, c as B, a7 as R, f as v, m as G } from "./index-D7zkRFYR.js";
|
|
2
|
+
import { d as N } from "./directions-gLJkHcCQ.js";
|
|
3
|
+
import { H as M, C as U, r as S, A as F, S as H } from "./index-bjmKVOTa.js";
|
|
4
|
+
import { d as Q, n as z, q as P, s as $ } from "./story-group-animation-impl-CpwuBQ87.js";
|
|
5
|
+
const Y = (d) => {
|
|
6
|
+
var t;
|
|
7
|
+
return (t = d == null ? void 0 : d.stories) != null && t.some(P) ? `<button type="button" class="ai-wrapper" tabindex="16" hidden><span class="ai-icon" aria-hidden="true">${Q()}</span><span class="ai-tag"></span><span class="s-icon" aria-hidden="true">${z()}</span></button>` : "";
|
|
8
|
+
}, tt = ({ headerDom: d, group: t, groupWrapper: s, instanceId: e }) => {
|
|
9
|
+
var D;
|
|
10
|
+
const o = d.querySelector(".ai-wrapper");
|
|
11
|
+
if (!o) return;
|
|
12
|
+
const i = (D = q.getContext(e)) == null ? void 0 : D.getState(), h = $(t, i == null ? void 0 : i.widgetStyles, i == null ? void 0 : i.languageJSON);
|
|
13
|
+
o.querySelector(".ai-tag").textContent = h.text ?? "", h.backgroundColor && o.style.setProperty("--ai-p-bg", h.backgroundColor), h.textColor && o.style.setProperty("--ai-p-t-c", h.textColor);
|
|
14
|
+
const g = document.createElement("span");
|
|
15
|
+
g.textContent = h.text ?? "";
|
|
16
|
+
const f = y(
|
|
17
|
+
'<div style="font-size: 14px; padding: 16px; color: #000 !important;"></div>'
|
|
18
|
+
);
|
|
19
|
+
f.textContent = h.description ?? "";
|
|
20
|
+
const b = y('<span style="display: none"></span>');
|
|
21
|
+
c(o, (O) => {
|
|
22
|
+
O.stopPropagation(), n(s, I(e), {
|
|
23
|
+
header: g,
|
|
24
|
+
body: f,
|
|
25
|
+
rerender: !1,
|
|
26
|
+
footer: b
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}, J = ({ groupWrapper: d, story: t, rotate: s }) => {
|
|
30
|
+
const e = d.querySelector(".st-label-row"), o = e == null ? void 0 : e.querySelector(".ai-wrapper");
|
|
31
|
+
if (!o) return;
|
|
32
|
+
const i = P(t);
|
|
33
|
+
o.hidden = !i, e.removeAttribute("paused"), e.classList.remove("rotating"), i && s && e.querySelector(".s-wrapper") && (e.getBoundingClientRect(), e.classList.add("rotating"));
|
|
34
|
+
}, x = (d, t) => {
|
|
35
|
+
const s = d.querySelector(".st-label-row");
|
|
36
|
+
s && (t ? s.setAttribute("paused", "") : s.removeAttribute("paused"));
|
|
37
|
+
};
|
|
38
|
+
class st {
|
|
5
39
|
constructor({
|
|
6
40
|
story: t,
|
|
7
41
|
key: s,
|
|
8
42
|
group: e,
|
|
9
43
|
storiesContainer: o,
|
|
10
44
|
groupWrapper: i,
|
|
11
|
-
progressDoms:
|
|
12
|
-
instanceId:
|
|
13
|
-
condition:
|
|
14
|
-
getActiveStory:
|
|
45
|
+
progressDoms: h,
|
|
46
|
+
instanceId: g,
|
|
47
|
+
condition: f,
|
|
48
|
+
getActiveStory: b
|
|
15
49
|
}) {
|
|
16
|
-
this.storyDom_ = null, this.layersContainer_ = document.createElement("div"), this.story_ = t, this.storyData_ = {}, this.layers_ = [], this.group_ = e, this.key_ = s, this.storiesContainer_ = o, this.groupWrapper_ = i, this.progressDoms_ = new Proxy(
|
|
50
|
+
this.storyDom_ = null, this.layersContainer_ = document.createElement("div"), this.story_ = t, this.storyData_ = {}, this.layers_ = [], this.group_ = e, this.key_ = s, this.storiesContainer_ = o, this.groupWrapper_ = i, this.progressDoms_ = new Proxy(h, []), this.storyProgressSecond_ = 7, this.progressPaused_ = !0, this.imageAsset_ = null, this.videoAsset_ = null, this.videoAssetLoadingStarted_ = !1, this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, this.isBlankStory_ = !1, this.imageAssetLoaded_ = !1, this.instanceId_ = g, this.timedLayers_ = [], this.condition_ = f, this.getActiveStory = b, this.storylyContext = q.getContext(this.instanceId_), this.isSharing_ = !1, u(this.layersContainer_, "layers-container"), r(this.layersContainer_, "dir", N.LTR), this.attachCallbacksToElement_();
|
|
17
51
|
}
|
|
18
52
|
/**
|
|
19
53
|
* Attaches callbacks to the DOM element for them to be used by publishers.
|
|
@@ -33,7 +67,7 @@ class H {
|
|
|
33
67
|
* @param {Function} StoryTemplate
|
|
34
68
|
*/
|
|
35
69
|
render(t) {
|
|
36
|
-
const { storyData: s, layers: e, storyBg: o } =
|
|
70
|
+
const { storyData: s, layers: e, storyBg: o } = V(
|
|
37
71
|
this.story_.media.layers
|
|
38
72
|
);
|
|
39
73
|
this.storyData_ = s, this.layers_ = [...e];
|
|
@@ -51,8 +85,8 @@ class H {
|
|
|
51
85
|
once: !0
|
|
52
86
|
});
|
|
53
87
|
else if (this.isBlankStory_) {
|
|
54
|
-
const
|
|
55
|
-
|
|
88
|
+
const h = this.storyDom_.querySelector(".story-image");
|
|
89
|
+
_(h, ["opacity", "0"]);
|
|
56
90
|
}
|
|
57
91
|
return this.setCustomEvents_(), this.handleStoryEvent_(), Promise.resolve(this.storyDom_);
|
|
58
92
|
}
|
|
@@ -71,7 +105,7 @@ class H {
|
|
|
71
105
|
* @private
|
|
72
106
|
*/
|
|
73
107
|
setStoryClassByAsset_({ width: t, height: s }) {
|
|
74
|
-
+(s * 56.25 / t).toFixed(2) < 100 &&
|
|
108
|
+
+(s * 56.25 / t).toFixed(2) < 100 && u(this.storyDom_, "story-9_16");
|
|
75
109
|
}
|
|
76
110
|
/**
|
|
77
111
|
* handle video events listener
|
|
@@ -91,8 +125,8 @@ class H {
|
|
|
91
125
|
if (this.videoAssetLoaded_ = !0, this.setStoryClassByAsset_({
|
|
92
126
|
height: this.videoAsset_.videoHeight,
|
|
93
127
|
width: this.videoAsset_.videoWidth
|
|
94
|
-
}), this.storyProgressRemain_ = this.videoAsset_.duration, this.storyProgressSecond_ = this.videoAsset_.duration, this.videoAsset_.duration >= 120 && !
|
|
95
|
-
const t = await (await import("./index-
|
|
128
|
+
}), this.storyProgressRemain_ = this.videoAsset_.duration, this.storyProgressSecond_ = this.videoAsset_.duration, this.videoAsset_.duration >= 120 && !A(this.storyData_.video_type)) {
|
|
129
|
+
const t = await (await import("./index-BumLZ3s0.js")).default;
|
|
96
130
|
this.videoSeekbar_ = new t({
|
|
97
131
|
storyDom: this.storyDom_,
|
|
98
132
|
videoDom: this.videoAsset_,
|
|
@@ -115,7 +149,7 @@ class H {
|
|
|
115
149
|
* @private
|
|
116
150
|
*/
|
|
117
151
|
onVideoEnded_() {
|
|
118
|
-
this.storylyContext.getState().accessibility || n(this.storyDom_,
|
|
152
|
+
this.storylyContext.getState().accessibility || n(this.storyDom_, p.nextStory);
|
|
119
153
|
}
|
|
120
154
|
/**
|
|
121
155
|
* on video waiting event
|
|
@@ -134,7 +168,7 @@ class H {
|
|
|
134
168
|
const s = this.groupWrapper_.querySelector(
|
|
135
169
|
".storyly__story-actions"
|
|
136
170
|
).querySelector('button[data-type="sound"]');
|
|
137
|
-
|
|
171
|
+
C(this.videoAsset_) || (this.soundOn_ = !1, s.classList.replace("sound-on", "sound-off")), this.soundOn_ ? this.soundOn() : this.soundOff(), this.progressPaused_ = !1, this.handleProgressBar_();
|
|
138
172
|
}
|
|
139
173
|
/**
|
|
140
174
|
* handles video load and play events when story active
|
|
@@ -142,7 +176,7 @@ class H {
|
|
|
142
176
|
*/
|
|
143
177
|
async onVideoShown_() {
|
|
144
178
|
const t = this.videoAsset_.querySelector("source"), s = this.videoAsset_.querySelector("source").dataset.src;
|
|
145
|
-
|
|
179
|
+
A(this.storyData_.video_type) ? this.hls_ = await M({
|
|
146
180
|
source: s,
|
|
147
181
|
tag: this.videoAsset_,
|
|
148
182
|
thumbnail: this.storyData_.thumbnail_url
|
|
@@ -162,7 +196,7 @@ class H {
|
|
|
162
196
|
), s = t.querySelector('button[data-type="sound"]'), e = t.querySelector('button[data-type="share"]'), o = t.querySelector('button[data-type="close"]'), i = t.querySelector(
|
|
163
197
|
'button[data-type="transcript"]'
|
|
164
198
|
);
|
|
165
|
-
this.playPauseAction_ && !
|
|
199
|
+
this.playPauseAction_ && !T() && m(this.playPauseAction_, this.playAndPauseStory), o && !o.hasAttribute("hidden") && m(o, this.handleCloseGroup_), m(s, this.handleSoundStory_), m(e, this.renderShareWidget), m(i, this.handleTranscript_);
|
|
166
200
|
}
|
|
167
201
|
/**
|
|
168
202
|
* load layers of story
|
|
@@ -179,64 +213,64 @@ class H {
|
|
|
179
213
|
};
|
|
180
214
|
if (t.is_bg && (t.bg_color || t.gradient_colors)) {
|
|
181
215
|
this.isBlankStory_ = !0;
|
|
182
|
-
const i = (await import("./index-
|
|
216
|
+
const i = (await import("./index-NfJP10SK.js")).default;
|
|
183
217
|
e.instance = new i({ ...o });
|
|
184
218
|
}
|
|
185
219
|
if (t.type === a.EMOJI) {
|
|
186
|
-
const i = (await import("./index-
|
|
220
|
+
const i = (await import("./index-BPVOUZlM.js")).default;
|
|
187
221
|
e.instance = new i({ ...o });
|
|
188
222
|
} else if (t.type === a.POLL) {
|
|
189
|
-
const i = (await import("./index-
|
|
223
|
+
const i = (await import("./index-CGDKSBwJ.js")).default;
|
|
190
224
|
e.instance = new i({ ...o });
|
|
191
225
|
} else if (t.type === a.RATING) {
|
|
192
|
-
const i = (await import("./index-
|
|
226
|
+
const i = (await import("./index-BtCETCtE.js")).default;
|
|
193
227
|
e.instance = new i({ ...o });
|
|
194
228
|
} else if (t.type === a.QUIZ) {
|
|
195
|
-
const i = (await import("./index-
|
|
229
|
+
const i = (await import("./index-Bet7-CZw.js")).default;
|
|
196
230
|
e.instance = new i({ ...o });
|
|
197
231
|
} else if (t.type === a.COUNTDOWN) {
|
|
198
|
-
const i = (await import("./index-
|
|
232
|
+
const i = (await import("./index-CecdozAb.js")).default;
|
|
199
233
|
e.instance = new i({ ...o });
|
|
200
234
|
} else if (t.type === a.IMAGE_CTA) {
|
|
201
|
-
const i = (await import("./index-
|
|
235
|
+
const i = (await import("./index-DwTjbMJC.js")).default;
|
|
202
236
|
e.instance = new i({
|
|
203
237
|
...o,
|
|
204
238
|
type: a.IMAGE_CTA
|
|
205
239
|
});
|
|
206
240
|
} else if (t.type === a.BUTTON || t.type === a.SWIPE)
|
|
207
|
-
this.ctaLayer_ = new
|
|
241
|
+
this.ctaLayer_ = new U({
|
|
208
242
|
...o,
|
|
209
243
|
type: t.type === a.BUTTON ? a.BUTTON : a.SWIPE
|
|
210
244
|
}), e.instance = this.ctaLayer_;
|
|
211
245
|
else if ((t.image_path || t.video_path || t.image_url) && t.studio_component_type) {
|
|
212
|
-
const i = (await import("./index-
|
|
246
|
+
const i = (await import("./index-MCjotVPF.js")).default;
|
|
213
247
|
e.instance = new i({
|
|
214
248
|
...o,
|
|
215
249
|
mediaHost: this.group_.media_host
|
|
216
250
|
});
|
|
217
251
|
} else if (t.type === a.TEXT) {
|
|
218
|
-
const i = (await import("./index-
|
|
252
|
+
const i = (await import("./index-l5qEWd8G.js")).default;
|
|
219
253
|
e.instance = new i({ ...o });
|
|
220
254
|
} else if (t.type === a.PRODUCT_TAG) {
|
|
221
|
-
const i = (await import("./index-
|
|
255
|
+
const i = (await import("./index-CYeIaL5T.js")).default;
|
|
222
256
|
e.instance = new i({ ...o });
|
|
223
257
|
} else if (t.type === a.PROMO_CODE) {
|
|
224
|
-
const i = (await import("./index-
|
|
258
|
+
const i = (await import("./index-Oms8IdVN.js")).default;
|
|
225
259
|
e.instance = new i({ ...o });
|
|
226
260
|
} else if (t.type === a.QUESTION) {
|
|
227
|
-
const i = (await import("./index
|
|
261
|
+
const i = (await import("./index--DOURGJ9.js")).default;
|
|
228
262
|
e.instance = new i({
|
|
229
263
|
...o,
|
|
230
264
|
storiesContainer: this.storiesContainer_
|
|
231
265
|
});
|
|
232
266
|
} else if (t.type === a.PRODUCT_CARD) {
|
|
233
|
-
const i = (await import("./index-
|
|
267
|
+
const i = (await import("./index-Nrttyf29.js")).default;
|
|
234
268
|
e.instance = new i({ ...o });
|
|
235
269
|
} else if (t.type === a.PRODUCT_CATALOG) {
|
|
236
|
-
const i = (await import("./index-
|
|
270
|
+
const i = (await import("./index-Bnwd_UvX.js")).default;
|
|
237
271
|
e.instance = new i({ ...o });
|
|
238
272
|
} else if (t.type === a.IMAGE_QUIZ) {
|
|
239
|
-
const i = (await import("./index-
|
|
273
|
+
const i = (await import("./index-2vWsLAJ8.js")).default;
|
|
240
274
|
e.instance = new i({ ...o });
|
|
241
275
|
}
|
|
242
276
|
(e.start_time || e.end_time) && (e.instance.hideLayer(), this.timedLayers_.push(e));
|
|
@@ -252,12 +286,12 @@ class H {
|
|
|
252
286
|
return;
|
|
253
287
|
this.progressCount_ = 0;
|
|
254
288
|
const t = this.progressDoms_[this.key_].querySelector("span");
|
|
255
|
-
if (
|
|
256
|
-
this.progressCount_ = 100,
|
|
289
|
+
if (A(this.storyData_.video_type)) {
|
|
290
|
+
this.progressCount_ = 100, _(t, ["width", `${this.progressCount_}%`]);
|
|
257
291
|
return;
|
|
258
292
|
}
|
|
259
293
|
this.progressInterval_ = setInterval(() => {
|
|
260
|
-
this.progressPaused_ || (this.progressTime_ += 0.1, this.storyProgressRemain_ -= 0.1, this.videoAsset_ ? this.play() : (this.handleLayersVisibility_(), this.handleProgress_()), this.progressCount_ = this.progressTime_ * 100 / this.storyProgressSecond_, this.progressCount_ <= 100 &&
|
|
294
|
+
this.progressPaused_ || (this.progressTime_ += 0.1, this.storyProgressRemain_ -= 0.1, this.videoAsset_ ? this.play() : (this.handleLayersVisibility_(), this.handleProgress_()), this.progressCount_ = this.progressTime_ * 100 / this.storyProgressSecond_, this.progressCount_ <= 100 && _(t, ["width", `${this.progressCount_}%`]));
|
|
261
295
|
}, 100);
|
|
262
296
|
}
|
|
263
297
|
/**
|
|
@@ -278,7 +312,7 @@ class H {
|
|
|
278
312
|
* @private
|
|
279
313
|
*/
|
|
280
314
|
handleProgress_() {
|
|
281
|
-
this.storyProgressRemain_ <= 0 && !this.storylyContext.getState().accessibility && (n(this.storyDom_,
|
|
315
|
+
this.storyProgressRemain_ <= 0 && !this.storylyContext.getState().accessibility && (n(this.storyDom_, p.nextStory), clearInterval(this.progressInterval_));
|
|
282
316
|
}
|
|
283
317
|
/**
|
|
284
318
|
* handle story actions(play, sound)
|
|
@@ -292,7 +326,7 @@ class H {
|
|
|
292
326
|
);
|
|
293
327
|
this.playPauseAction_ = t.querySelector(
|
|
294
328
|
'button[data-type="play-pause"]'
|
|
295
|
-
), o && (
|
|
329
|
+
), o && (l(o, "hidden"), c(o, this.handleCloseGroup_)), T() ? (r(this.playPauseAction_, "hidden", !0), this.accessibilityAction_ = this.storiesContainer_.querySelector(
|
|
296
330
|
".accessibility-switch-button"
|
|
297
331
|
), this.accessibilityAction_ && (this.accessibilityAction_.addEventListener(
|
|
298
332
|
"pointerdown",
|
|
@@ -301,7 +335,7 @@ class H {
|
|
|
301
335
|
accessibilityEnabled: !0
|
|
302
336
|
})) : (this.accessibilityAction_.setAttribute("data-pressed", "false"), n(this.storyDom_, "onAccessibilityTriggered", {
|
|
303
337
|
accessibilityEnabled: !1
|
|
304
|
-
})))) : (
|
|
338
|
+
})))) : (l(this.playPauseAction_, "hidden"), this.playPauseAction_.classList.replace("play", "pause"), c(this.playPauseAction_, this.playAndPauseStory)), this.videoAsset_ ? (l(s, "hidden"), c(s, this.handleSoundStory_), this.story_.alt_text && (l(i, "hidden"), c(i, this.handleTranscript_))) : (r(s, "hidden", !0), r(i, "hidden", !0)), this.storylyContext.getState().videoMuted === !1 && this.videoAsset_ ? (this.videoAsset_.muted = !1, this.soundOn_ = !0, s.classList.replace("sound-off", "sound-on")) : this.videoAsset_ && (this.videoAsset_.muted = !0, this.soundOn_ = !1, s.classList.replace("sound-on", "sound-off")), this.story_.is_sharable && (l(e, "hidden"), c(e, this.renderShareWidget));
|
|
305
339
|
}
|
|
306
340
|
/**
|
|
307
341
|
* @param {PointerEvent} e
|
|
@@ -309,19 +343,19 @@ class H {
|
|
|
309
343
|
*/
|
|
310
344
|
handleAccessibilityOnOff_(t) {
|
|
311
345
|
const { target: s } = t, e = s.getAttribute("data-pressed") === "true";
|
|
312
|
-
t.target.setAttribute("data-pressed", String(!e)), this.storylyContext.getState().accessibility ? (this.storyDom_.hasAttribute("paused") ? this.play() : this.handleProgressBar_(),
|
|
346
|
+
t.target.setAttribute("data-pressed", String(!e)), this.storylyContext.getState().accessibility ? (this.storyDom_.hasAttribute("paused") ? this.play() : this.handleProgressBar_(), S(this.storyDom_, "Accessibility is off"), s.setAttribute(
|
|
313
347
|
"aria-label",
|
|
314
348
|
this.storylyContext.getState().languageJSON.a11y_dtap_enable_accessibility
|
|
315
|
-
),
|
|
349
|
+
), E.setItemToGlobal("accessibility", !1), this.storylyContext.setState({
|
|
316
350
|
accessibility: !1
|
|
317
351
|
}), n(this.storyDom_, "onAccessibilityTriggered", {
|
|
318
352
|
accessibilityEnabled: !1
|
|
319
353
|
})) : (this.storylyContext.setState({
|
|
320
354
|
accessibility: !0
|
|
321
|
-
}),
|
|
355
|
+
}), S(this.storyDom_, "Accessibility is on"), this.pause(), s.setAttribute(
|
|
322
356
|
"aria-label",
|
|
323
357
|
this.storylyContext.getState().languageJSON.a11y_disable_accessibility
|
|
324
|
-
),
|
|
358
|
+
), E.setItemToGlobal("accessibility", !0), n(this.storyDom_, "onAccessibilityTriggered", {
|
|
325
359
|
accessibilityEnabled: !0
|
|
326
360
|
}));
|
|
327
361
|
}
|
|
@@ -338,7 +372,7 @@ class H {
|
|
|
338
372
|
);
|
|
339
373
|
n(
|
|
340
374
|
this.storyDom_,
|
|
341
|
-
|
|
375
|
+
I(this.instanceId_),
|
|
342
376
|
{
|
|
343
377
|
header: s,
|
|
344
378
|
body: t,
|
|
@@ -361,8 +395,8 @@ class H {
|
|
|
361
395
|
* @private
|
|
362
396
|
*/
|
|
363
397
|
handleSoundStory_(t) {
|
|
364
|
-
if (!
|
|
365
|
-
const i = y(
|
|
398
|
+
if (!C(this.videoAsset_)) {
|
|
399
|
+
const i = y(F);
|
|
366
400
|
this.storyDom_.append(i), setTimeout(() => {
|
|
367
401
|
this.storyDom_.removeChild(i);
|
|
368
402
|
}, 1e3);
|
|
@@ -370,9 +404,9 @@ class H {
|
|
|
370
404
|
}
|
|
371
405
|
const { target: s } = t;
|
|
372
406
|
let e = "sound-on", o = "sound-off";
|
|
373
|
-
s.classList.contains("sound-off") ? (
|
|
407
|
+
s.classList.contains("sound-off") ? (S(this.storyDom_, "Story Unmuted"), s.setAttribute("aria-pressed", "false"), this.soundOn_ = !0, this.soundOn(), this.storylyContext.setState({
|
|
374
408
|
videoMuted: !1
|
|
375
|
-
})) : (
|
|
409
|
+
})) : (S(this.storyDom_, "Story Muted"), s.setAttribute("aria-pressed", "true"), this.soundOn_ = !1, this.soundOff(), e = "sound-off", o = "sound-on", this.storylyContext.setState({
|
|
376
410
|
videoMuted: !0
|
|
377
411
|
})), s.classList.replace(o, e);
|
|
378
412
|
}
|
|
@@ -398,13 +432,13 @@ class H {
|
|
|
398
432
|
hideAccessibilityElements_() {
|
|
399
433
|
const t = this.storyDom_.getRootNode().activeElement;
|
|
400
434
|
t && this.storyDom_.contains(t) && t.blur(), r(this.storyDom_, "aria-hidden", "true"), this.storyDom_.querySelectorAll(".cta-button").forEach((s) => {
|
|
401
|
-
|
|
435
|
+
l(s, "tabindex"), r(s, "aria-hidden", "true");
|
|
402
436
|
}), this.storyDom_.querySelectorAll(".swipe-up-button").forEach((s) => {
|
|
403
|
-
|
|
437
|
+
l(s, "tabindex"), r(s, "aria-hidden", "true");
|
|
404
438
|
}), this.storyDom_.querySelectorAll(".product-tag-tooltip").forEach((s) => {
|
|
405
|
-
|
|
439
|
+
l(s, "tabindex"), r(s, "aria-hidden", "true");
|
|
406
440
|
}), this.storyDom_.querySelectorAll(".poll-component").forEach((s) => {
|
|
407
|
-
s.querySelectorAll("button").forEach((e) =>
|
|
441
|
+
s.querySelectorAll("button").forEach((e) => l(e, "tabindex")), l(s, "tabindex"), r(s, "aria-hidden", "true");
|
|
408
442
|
});
|
|
409
443
|
}
|
|
410
444
|
/**
|
|
@@ -412,7 +446,7 @@ class H {
|
|
|
412
446
|
* @public
|
|
413
447
|
*/
|
|
414
448
|
async renderShareWidget() {
|
|
415
|
-
this.isSharing_ || (this.isSharing_ = !0, this.shareWidget_ = await
|
|
449
|
+
this.isSharing_ || (this.isSharing_ = !0, this.shareWidget_ = await H({
|
|
416
450
|
dom: this.storyDom_,
|
|
417
451
|
group: this.group_,
|
|
418
452
|
story: this.story_,
|
|
@@ -444,7 +478,7 @@ class H {
|
|
|
444
478
|
* @public
|
|
445
479
|
*/
|
|
446
480
|
pause(t = !1) {
|
|
447
|
-
t && this.hideShareWidget(), this.progressPaused_ = !0, this.storyDom_.setAttribute("paused", ""), this.videoAsset_ && (this.videoPlayedPromise_ ? this.videoPlayedPromise_.then(() => {
|
|
481
|
+
t && this.hideShareWidget(), this.progressPaused_ = !0, this.storyDom_.setAttribute("paused", ""), this.storyDom_.hasAttribute("show") && x(this.groupWrapper_, !0), this.videoAsset_ && (this.videoPlayedPromise_ ? this.videoPlayedPromise_.then(() => {
|
|
448
482
|
this.videoPausedPromise_ = this.videoAsset_.pause();
|
|
449
483
|
}) : this.videoPausedPromise_ = this.videoAsset_.pause());
|
|
450
484
|
}
|
|
@@ -454,7 +488,7 @@ class H {
|
|
|
454
488
|
* @public
|
|
455
489
|
*/
|
|
456
490
|
play(t = !1) {
|
|
457
|
-
t && this.playPauseAction_.classList.contains("play") && this.playPauseAction_.classList.replace("play", "pause"), this.progressPaused_ = !1, this.storyDom_.removeAttribute("paused"), this.videoAsset_ && !
|
|
491
|
+
t && this.playPauseAction_.classList.contains("play") && this.playPauseAction_.classList.replace("play", "pause"), this.progressPaused_ = !1, this.storyDom_.removeAttribute("paused"), this.storyDom_.hasAttribute("show") && x(this.groupWrapper_, !1), this.videoAsset_ && !W(this.videoAsset_) && (this.videoPausedPromise_ ? this.videoPausedPromise_.then(() => {
|
|
458
492
|
this.videoPlayedPromise_ = this.videoAsset_.play();
|
|
459
493
|
}) : this.videoPlayedPromise_ = this.videoAsset_.play());
|
|
460
494
|
}
|
|
@@ -464,9 +498,9 @@ class H {
|
|
|
464
498
|
* @public
|
|
465
499
|
*/
|
|
466
500
|
setVideoStoryAsset() {
|
|
467
|
-
if (this.storyData_.type !== "video" && !this.story_.media.thumbnail_url ||
|
|
501
|
+
if (this.storyData_.type !== "video" && !this.story_.media.thumbnail_url || A(this.storyData_.video_type))
|
|
468
502
|
return;
|
|
469
|
-
const t =
|
|
503
|
+
const t = L({
|
|
470
504
|
host: this.group_.media_host,
|
|
471
505
|
path: this.story_.media.thumbnail_url,
|
|
472
506
|
story: this.storyData_
|
|
@@ -482,9 +516,9 @@ class H {
|
|
|
482
516
|
if (this.storylyContext.getState().accessibility || this.isSharing_) return;
|
|
483
517
|
let t = "play", s = "pause";
|
|
484
518
|
this.playPauseAction_.classList.contains("pause") ? (this.pause(), this.playPauseAction_.setAttribute("aria-pressed", "true"), n(this.storyDom_, "onPlayPauseEvent", {
|
|
485
|
-
eventType:
|
|
519
|
+
eventType: w.Paused
|
|
486
520
|
})) : (this.play(), this.playPauseAction_.setAttribute("aria-pressed", "false"), n(this.storyDom_, "onPlayPauseEvent", {
|
|
487
|
-
eventType:
|
|
521
|
+
eventType: w.Resumed
|
|
488
522
|
}), t = "pause", s = "play"), this.playPauseAction_.classList.replace(s, t);
|
|
489
523
|
}
|
|
490
524
|
/**
|
|
@@ -493,7 +527,7 @@ class H {
|
|
|
493
527
|
sendStoryViewedEvent_() {
|
|
494
528
|
const t = { ...this.getStoryData() };
|
|
495
529
|
n(this.storyDom_, "onCustomerEvent", {
|
|
496
|
-
eventName:
|
|
530
|
+
eventName: p.storyViewed,
|
|
497
531
|
params: t
|
|
498
532
|
});
|
|
499
533
|
}
|
|
@@ -529,7 +563,7 @@ class H {
|
|
|
529
563
|
}
|
|
530
564
|
};
|
|
531
565
|
n(this.storyDom_, "onCustomerEvent", {
|
|
532
|
-
eventName:
|
|
566
|
+
eventName: k,
|
|
533
567
|
params: s
|
|
534
568
|
});
|
|
535
569
|
});
|
|
@@ -539,17 +573,21 @@ class H {
|
|
|
539
573
|
* @public
|
|
540
574
|
*/
|
|
541
575
|
show() {
|
|
542
|
-
if (this.group_.type ===
|
|
576
|
+
if (this.group_.type === B.REDIRECT) {
|
|
543
577
|
this.ctaLayer_.handleUrlForRedirectGroup();
|
|
544
578
|
return;
|
|
545
579
|
}
|
|
546
580
|
this.storyDom_.setAttribute("show", ""), n(this.storyDom_, "storyChange", {
|
|
547
581
|
asset: this.isBlankStory_ ? "" : this.imageAsset_ ?? this.videoAsset_
|
|
548
|
-
}),
|
|
582
|
+
}), R(
|
|
549
583
|
this.group_.group_id,
|
|
550
584
|
this.story_.story_id,
|
|
551
585
|
this.storylyContext.getState().shareParams
|
|
552
|
-
), this.handleStoryActions_(), this.handleStoryTitleOnChange_(),
|
|
586
|
+
), this.handleStoryActions_(), this.handleStoryTitleOnChange_(), J({
|
|
587
|
+
groupWrapper: this.groupWrapper_,
|
|
588
|
+
story: this.story_,
|
|
589
|
+
rotate: !this.storylyContext.getState().accessibility
|
|
590
|
+
}), this.progressPaused_ = !1, this.storyDom_.removeAttribute("paused"), this.storyProgressRemain_ = this.storyProgressSecond_, this.progressTime_ = 0, v(this.progressDoms_[this.key_], "seen"), this.videoAsset_ ? this.onVideoShown_() : this.isBlankStory_ || this.imageAssetLoaded_ ? this.handleProgressBar_() : this.imageAsset_.style.paddingBottom = "0.5px", this.storylyContext.getState().accessibility && _(this.playPauseAction_, ["display", "none"]), this.exposeAccessibilityElements_(), u(this.progressDoms_[this.key_], "active"), u(this.storyDom_, "active"), clearTimeout(this.storyFocusTimeout_), this.storyFocusTimeout_ = setTimeout(() => {
|
|
553
591
|
this.storyFocusTimeout_ = null, this.storyDom_.getAttribute("aria-hidden") !== "true" && this.storyDom_.focus();
|
|
554
592
|
}, 500), this.sendStoryViewedEvent_(), n(this.storyDom_, "onShortcut", {
|
|
555
593
|
is_sharable: this.story_.is_sharable
|
|
@@ -572,7 +610,7 @@ class H {
|
|
|
572
610
|
}
|
|
573
611
|
this.videoAsset_.querySelector("source").src = "", this.videoAsset_.load();
|
|
574
612
|
}
|
|
575
|
-
this.removeEvents_(), this.progressPaused_ = !0,
|
|
613
|
+
this.removeEvents_(), this.progressPaused_ = !0, v(this.progressDoms_[this.key_], "active"), s || v(this.storyDom_, "active"), G(this.progressDoms_[this.key_].querySelector("span"), ["width"]), t ? v(this.progressDoms_[this.key_], "seen") : u(this.progressDoms_[this.key_], "seen"), (e = this.shareWidget_) == null || e.hide(), this.timedLayers_.forEach((o) => o.instance.hideLayer());
|
|
576
614
|
}
|
|
577
615
|
/**
|
|
578
616
|
* get story watch length
|
|
@@ -596,7 +634,7 @@ class H {
|
|
|
596
634
|
* @returns {Object}
|
|
597
635
|
*/
|
|
598
636
|
getStoryData() {
|
|
599
|
-
const t =
|
|
637
|
+
const t = L({
|
|
600
638
|
host: this.group_.media_host,
|
|
601
639
|
story: this.storyData_
|
|
602
640
|
});
|
|
@@ -606,7 +644,8 @@ class H {
|
|
|
606
644
|
group: this.group_,
|
|
607
645
|
index: this.key_,
|
|
608
646
|
title: this.story_.title,
|
|
609
|
-
name: this.story_.name
|
|
647
|
+
name: this.story_.name,
|
|
648
|
+
aiLabel: P(this.story_)
|
|
610
649
|
};
|
|
611
650
|
}
|
|
612
651
|
/**
|
|
@@ -618,7 +657,7 @@ class H {
|
|
|
618
657
|
...this.getStoryData()
|
|
619
658
|
};
|
|
620
659
|
n(this.storyDom_, "onCustomerEvent", {
|
|
621
|
-
eventName: t === "next" ?
|
|
660
|
+
eventName: t === "next" ? p.nextStory : p.previousStory,
|
|
622
661
|
params: s
|
|
623
662
|
});
|
|
624
663
|
}
|
|
@@ -641,7 +680,7 @@ class H {
|
|
|
641
680
|
* @public
|
|
642
681
|
*/
|
|
643
682
|
pauseByTouch() {
|
|
644
|
-
this.pause(),
|
|
683
|
+
this.pause(), _(this.storiesContainer_.querySelector(".storyly__story-header"), [
|
|
645
684
|
"opacity",
|
|
646
685
|
0
|
|
647
686
|
]);
|
|
@@ -651,7 +690,7 @@ class H {
|
|
|
651
690
|
* @public
|
|
652
691
|
*/
|
|
653
692
|
playAfterTouch() {
|
|
654
|
-
|
|
693
|
+
_(this.storiesContainer_.querySelector(".storyly__story-header"), [
|
|
655
694
|
"opacity",
|
|
656
695
|
1
|
|
657
696
|
]), this.play();
|
|
@@ -664,5 +703,7 @@ class H {
|
|
|
664
703
|
}
|
|
665
704
|
}
|
|
666
705
|
export {
|
|
667
|
-
|
|
706
|
+
st as B,
|
|
707
|
+
Y as a,
|
|
708
|
+
tt as s
|
|
668
709
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as r, ak as f, S as h, P as c, v as u, a1 as g, Q as b, B as x, b as o, _ as n, N as l, ah as v } from "./index-
|
|
2
|
-
import { a as p, o as k } from "./index-
|
|
3
|
-
import {
|
|
1
|
+
import { G as r, ak as f, S as h, P as c, v as u, a1 as g, Q as b, B as x, b as o, _ as n, N as l, ah as v } from "./index-D7zkRFYR.js";
|
|
2
|
+
import { a as p, o as k } from "./index-bjmKVOTa.js";
|
|
3
|
+
import { G as _, H as C, I as $ } from "./story-group-animation-impl-CpwuBQ87.js";
|
|
4
4
|
const S = (t) => {
|
|
5
5
|
const i = {
|
|
6
6
|
w: 100,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as u } from "./index-
|
|
2
|
-
import { ak as y, v as h, _ as d, Q as m, N as c, ah as f } from "./index-
|
|
3
|
-
import { x as g,
|
|
1
|
+
import { a as u } from "./index-bjmKVOTa.js";
|
|
2
|
+
import { ak as y, v as h, _ as d, Q as m, N as c, ah as f } from "./index-D7zkRFYR.js";
|
|
3
|
+
import { x as g, I as D } from "./story-group-animation-impl-CpwuBQ87.js";
|
|
4
4
|
const w = (a) => {
|
|
5
5
|
const e = {
|
|
6
6
|
w: 100,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as E } from "./directions-
|
|
2
|
-
import { M as D, p as u, S as $, P as M, a1 as q, s as S, h as x, L as O, j as P, n as g, u as V, _ as y, N as h, $ as R, U as f, A as C, f as w, C as v, Q as k, b as j } from "./index-
|
|
3
|
-
import { B as U, g as L, I as N, C as H } from "./index-
|
|
4
|
-
import { x as Y,
|
|
5
|
-
import { B as J } from "./index-
|
|
1
|
+
import { d as E } from "./directions-gLJkHcCQ.js";
|
|
2
|
+
import { M as D, p as u, S as $, P as M, a1 as q, s as S, h as x, L as O, j as P, n as g, u as V, _ as y, N as h, $ as R, U as f, A as C, f as w, C as v, Q as k, b as j } from "./index-D7zkRFYR.js";
|
|
3
|
+
import { B as U, g as L, I as N, C as H } from "./index-BmSfIzL8.js";
|
|
4
|
+
import { x as Y, m as z, n as Z, o as K, P as W } from "./story-group-animation-impl-CpwuBQ87.js";
|
|
5
|
+
import { B as J } from "./index-bjmKVOTa.js";
|
|
6
6
|
const Q = ({ story: _, type: t, mediaHost: e, altText: s, storyBg: r } = { story: {} }) => {
|
|
7
7
|
const { sizing: i, position: o, thumbnail_url: a } = _, n = D({ host: e, story: _ });
|
|
8
8
|
let d;
|
|
@@ -227,7 +227,7 @@ class st {
|
|
|
227
227
|
*/
|
|
228
228
|
async renderProductCart_() {
|
|
229
229
|
if (V(this.group_).length && this.storylyContext_.getState().placementConfig.isStorylyCartActive) {
|
|
230
|
-
const e = await (await import("./index-
|
|
230
|
+
const e = await (await import("./index-BpPG9Hkl.js")).default;
|
|
231
231
|
this.storylyCart = new e({
|
|
232
232
|
instanceId: this.instanceId_,
|
|
233
233
|
parentDom: this.groupWrapper_
|