@hopeplayer/core 1.6.0 → 1.7.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/HopePlayerElement.d.ts +23 -0
- package/dist/HopePlayerElement.d.ts.map +1 -1
- package/dist/chunks/{adTriggers-BIAWe8o4.js → adTriggers-DVqgm92F.js} +94 -93
- package/dist/chunks/{adTriggers-BIAWe8o4.js.map → adTriggers-DVqgm92F.js.map} +1 -1
- package/dist/chunks/{ads-DlpHPpR9.js → ads-eSKyiH1o.js} +2 -2
- package/dist/chunks/{ads-DlpHPpR9.js.map → ads-eSKyiH1o.js.map} +1 -1
- package/dist/chunks/audioDescription-cpprKeB-.js +146 -0
- package/dist/chunks/audioDescription-cpprKeB-.js.map +1 -0
- package/dist/chunks/{cast-vHyi7oV_.js → cast-DEowHmqA.js} +29 -28
- package/dist/chunks/{cast-vHyi7oV_.js.map → cast-DEowHmqA.js.map} +1 -1
- package/dist/chunks/{docPip-wybMVP1H.js → docPip-Bh6BWPk-.js} +30 -20
- package/dist/chunks/docPip-Bh6BWPk-.js.map +1 -0
- package/dist/chunks/heatmap-Bz_EMQFk.js +117 -0
- package/dist/chunks/heatmap-Bz_EMQFk.js.map +1 -0
- package/dist/chunks/{history-CwqLXiZi.js → history-ZSdDDsRF.js} +35 -34
- package/dist/chunks/{history-CwqLXiZi.js.map → history-ZSdDDsRF.js.map} +1 -1
- package/dist/chunks/interactive-ClJC5Vyo.js +213 -0
- package/dist/chunks/interactive-ClJC5Vyo.js.map +1 -0
- package/dist/chunks/{markers-L69W3kj6.js → markers-D32rI-x-.js} +2 -2
- package/dist/chunks/{markers-L69W3kj6.js.map → markers-D32rI-x-.js.map} +1 -1
- package/dist/chunks/multiview-CL1WfJKt.js +295 -0
- package/dist/chunks/multiview-CL1WfJKt.js.map +1 -0
- package/dist/chunks/{pauseAd-BQQe21X4.js → pauseAd-DF7KGwUs.js} +32 -31
- package/dist/chunks/{pauseAd-BQQe21X4.js.map → pauseAd-DF7KGwUs.js.map} +1 -1
- package/dist/chunks/{player-D2_HRzot.js → player-B7mYS--8.js} +754 -682
- package/dist/chunks/player-B7mYS--8.js.map +1 -0
- package/dist/chunks/{playlist-CHfStNbQ.js → playlist-BkhIOfCy.js} +2 -2
- package/dist/chunks/{playlist-CHfStNbQ.js.map → playlist-BkhIOfCy.js.map} +1 -1
- package/dist/chunks/{pluginHost-cN2uGFeG.js → pluginHost-CXqkjNV1.js} +2 -2
- package/dist/chunks/{pluginHost-cN2uGFeG.js.map → pluginHost-CXqkjNV1.js.map} +1 -1
- package/dist/chunks/{redirectScreen-TIqLdvBY.js → redirectScreen-DgmjFVJH.js} +51 -39
- package/dist/chunks/redirectScreen-DgmjFVJH.js.map +1 -0
- package/dist/chunks/rewardedUnlock-BL97P5ht.js +265 -0
- package/dist/chunks/{rewardedUnlock-DUqYwXTr.js.map → rewardedUnlock-BL97P5ht.js.map} +1 -1
- package/dist/chunks/{segments-Ds-c1b5e.js → segments-CuQQEIAX.js} +2 -2
- package/dist/chunks/{segments-Ds-c1b5e.js.map → segments-CuQQEIAX.js.map} +1 -1
- package/dist/chunks/share-BdqQ8sGE.js +216 -0
- package/dist/chunks/share-BdqQ8sGE.js.map +1 -0
- package/dist/chunks/{skipSegments-ByNoF1qZ.js → skipSegments-BbepQ4Y6.js} +2 -2
- package/dist/chunks/{skipSegments-ByNoF1qZ.js.map → skipSegments-BbepQ4Y6.js.map} +1 -1
- package/dist/chunks/sponsorship-DoAZBbHE.js +241 -0
- package/dist/chunks/{sponsorship-BT21uwN5.js.map → sponsorship-DoAZBbHE.js.map} +1 -1
- package/dist/chunks/{spriteThumbnails-Cr9UmkM9.js → spriteThumbnails-BYg-DHx4.js} +2 -2
- package/dist/chunks/{spriteThumbnails-Cr9UmkM9.js.map → spriteThumbnails-BYg-DHx4.js.map} +1 -1
- package/dist/chunks/{story-CodA2dfn.js → story-DcBG6jUg.js} +2 -2
- package/dist/chunks/{story-CodA2dfn.js.map → story-DcBG6jUg.js.map} +1 -1
- package/dist/chunks/{transcript-LG7E9UYE.js → transcript-CHPQ6S6E.js} +33 -13
- package/dist/chunks/transcript-CHPQ6S6E.js.map +1 -0
- package/dist/controls/SeekBar.d.ts.map +1 -1
- package/dist/hls/SourceManager.d.ts +2 -0
- package/dist/hls/SourceManager.d.ts.map +1 -1
- package/dist/hope-player.js +3 -3
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en.d.ts +2 -2
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/tr.d.ts +2 -2
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/types.d.ts +27 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugins/ad-triggers/index.d.ts.map +1 -1
- package/dist/plugins/audio-description/AudioDescription.d.ts +52 -0
- package/dist/plugins/audio-description/AudioDescription.d.ts.map +1 -0
- package/dist/plugins/audio-description/index.d.ts +6 -0
- package/dist/plugins/audio-description/index.d.ts.map +1 -0
- package/dist/plugins/audio-description/strings.d.ts +8 -0
- package/dist/plugins/audio-description/strings.d.ts.map +1 -0
- package/dist/plugins/cast/index.d.ts.map +1 -1
- package/dist/plugins/doc-pip/index.d.ts.map +1 -1
- package/dist/plugins/doc-pip/strings.d.ts +8 -0
- package/dist/plugins/doc-pip/strings.d.ts.map +1 -0
- package/dist/plugins/heatmap/Heatmap.d.ts +8 -0
- package/dist/plugins/heatmap/Heatmap.d.ts.map +1 -1
- package/dist/plugins/heatmap/index.d.ts.map +1 -1
- package/dist/plugins/heatmap/strings.d.ts +8 -0
- package/dist/plugins/heatmap/strings.d.ts.map +1 -0
- package/dist/plugins/history/index.d.ts.map +1 -1
- package/dist/plugins/interactive/index.d.ts.map +1 -1
- package/dist/plugins/interactive/strings.d.ts +8 -0
- package/dist/plugins/interactive/strings.d.ts.map +1 -0
- package/dist/plugins/multiview/Multiview.d.ts +92 -0
- package/dist/plugins/multiview/Multiview.d.ts.map +1 -0
- package/dist/plugins/multiview/index.d.ts +6 -0
- package/dist/plugins/multiview/index.d.ts.map +1 -0
- package/dist/plugins/multiview/strings.d.ts +8 -0
- package/dist/plugins/multiview/strings.d.ts.map +1 -0
- package/dist/plugins/pause-ad/index.d.ts.map +1 -1
- package/dist/plugins/redirect-screen/index.d.ts.map +1 -1
- package/dist/plugins/redirect-screen/strings.d.ts +8 -0
- package/dist/plugins/redirect-screen/strings.d.ts.map +1 -0
- package/dist/plugins/rewarded/index.d.ts.map +1 -1
- package/dist/plugins/share/Share.d.ts +45 -0
- package/dist/plugins/share/Share.d.ts.map +1 -0
- package/dist/plugins/share/index.d.ts +6 -0
- package/dist/plugins/share/index.d.ts.map +1 -0
- package/dist/plugins/share/strings.d.ts +8 -0
- package/dist/plugins/share/strings.d.ts.map +1 -0
- package/dist/plugins/skip-segments/index.d.ts.map +1 -1
- package/dist/plugins/sponsorship/index.d.ts.map +1 -1
- package/dist/plugins/transcript/index.d.ts.map +1 -1
- package/dist/plugins/transcript/strings.d.ts +8 -0
- package/dist/plugins/transcript/strings.d.ts.map +1 -0
- package/dist/types/index.d.ts +93 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/docPip-wybMVP1H.js.map +0 -1
- package/dist/chunks/heatmap-Bb7neaYU.js +0 -92
- package/dist/chunks/heatmap-Bb7neaYU.js.map +0 -1
- package/dist/chunks/interactive-CgltIneu.js +0 -189
- package/dist/chunks/interactive-CgltIneu.js.map +0 -1
- package/dist/chunks/player-D2_HRzot.js.map +0 -1
- package/dist/chunks/redirectScreen-TIqLdvBY.js.map +0 -1
- package/dist/chunks/rewardedUnlock-DUqYwXTr.js +0 -264
- package/dist/chunks/sponsorship-BT21uwN5.js +0 -240
- package/dist/chunks/transcript-LG7E9UYE.js.map +0 -1
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
var A = Object.defineProperty;
|
|
2
|
-
var z = (p, t, i) => t in p ? A(p, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[t] = i;
|
|
3
|
-
var d = (p, t, i) => z(p, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
-
import { c as L } from "./player-D2_HRzot.js";
|
|
5
|
-
import { a as S } from "./plugin-style-CPJELe-i.js";
|
|
6
|
-
const q = '.hp-ia{position:absolute;z-index:24;width:min(320px,calc(100% - 24px));max-height:calc(100% - 100px);overflow-y:auto;box-sizing:border-box;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:#0e0e12e0;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fff;box-shadow:0 16px 36px -14px #000000d9;font:13px/1.4 system-ui,-apple-system,sans-serif;animation:hp-redirect-in .3s cubic-bezier(.2,.8,.2,1)}.hp-ia[data-position=top-right]{top:12px;right:12px}.hp-ia[data-position=top-left]{top:12px;left:12px}.hp-ia[data-position=bottom-right]{right:12px;bottom:76px}.hp-ia[data-position=bottom-left]{left:12px;bottom:76px}.hp-ia[data-position=center]{top:50%;left:50%;transform:translate(-50%,-50%);animation:hp-redirect-fade .25s ease-out}.video-area[data-chrome-hidden] .hp-ia[data-position^=bottom]{bottom:12px}.video-area[data-compact] .hp-ia{width:calc(100% - 16px);max-height:calc(100% - 64px);padding:10px}.video-area[data-compact] .hp-ia[data-position$=right],.video-area[data-compact] .hp-ia[data-position$=left]{left:8px;right:8px}.video-area[data-compact] .hp-ia[data-position^=top]{top:8px}.video-area[data-compact] .hp-ia[data-position^=bottom]{bottom:56px}.hp-ia-close{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:999px;background:#ffffff1f;color:#fff;font-size:12px;cursor:pointer}.hp-ia-close:hover{background:#ffffff3d}.hp-ia-label{display:block;margin-bottom:4px;color:var(--hp-color-accent, #fff);font:700 10px/1.2 system-ui,-apple-system,sans-serif;letter-spacing:.1em;text-transform:uppercase}.hp-ia-question{margin:0 28px 10px 0;font-weight:600;font-size:14px}.hp-ia-choices{display:grid;gap:6px}.hp-ia-choice{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;overflow:hidden;padding:8px 10px;border:1px solid rgba(255,255,255,.16);border-radius:8px;background:#ffffff0f;color:#fff;font:inherit;text-align:start;cursor:pointer;transition:background .15s,border-color .15s}.hp-ia-choice:hover:not(:disabled){background:#ffffff24}.hp-ia-choice:disabled{cursor:default}.hp-ia-choice[data-result]:before{content:"";position:absolute;inset:0 auto 0 0;width:var(--hp-ia-pct, 0%);background:#ffffff24;transition:width .6s cubic-bezier(.2,.8,.2,1)}.hp-ia-choice>span{position:relative}.hp-ia-choice[data-picked]{border-color:var(--hp-color-accent, #fff)}.hp-ia-choice[data-correct]{border-color:#2fbf71;background:#2fbf7138}.hp-ia-choice[data-wrong]{border-color:#e5484d;background:#e5484d38}.hp-ia-pct{flex:none;font-weight:600;font-variant-numeric:tabular-nums}.hp-ia-status{margin:8px 0 0;font-size:12.5px;opacity:.85}.hp-ia-status:empty{display:none}.hp-ia[data-type=product],.hp-ia[data-type=link]{padding:0}.hp-ia-card{display:flex;gap:10px;padding:8px 34px 8px 8px;color:#fff;text-decoration:none}.hp-ia-image{flex:none;width:72px;height:72px;border-radius:8px;object-fit:cover;background:#111}.hp-ia-body{display:flex;flex-direction:column;gap:2px;min-width:0}.hp-ia-body .hp-ia-label{margin-bottom:0}.hp-ia-title{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-weight:600}.hp-ia-sub{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:.7;font-size:12px}.hp-ia-price{display:flex;gap:6px;align-items:baseline}.hp-ia-price s{opacity:.55;font-size:12px}.hp-ia-cta{align-self:flex-start;margin-top:4px;padding:5px 12px;border-radius:999px;background:var(--hp-color-accent, #fff);color:var(--hp-color-on-accent, #000);font-weight:600;font-size:12px}.hp-ia-card:hover .hp-ia-cta{filter:brightness(.92)}.hp-ia-choice:focus-visible,.hp-ia-close:focus-visible,.hp-ia-card:focus-visible{outline:2px solid var(--hp-color-accent, #fff);outline-offset:2px}.hp-seek-marker.hp-ia-marker{background:var(--hp-ia-marker-color, #f5c518)}@media(prefers-reduced-motion:reduce){.hp-ia,.hp-ia-choice[data-result]:before{animation:none;transition:none}}', E = "hp-interactive:", C = 1.5;
|
|
7
|
-
function T(p, t) {
|
|
8
|
-
return typeof p == "string" ? { id: String(t), text: p } : { id: p.id ?? String(t), text: p.text };
|
|
9
|
-
}
|
|
10
|
-
function n(p, t, i) {
|
|
11
|
-
const e = document.createElement(p);
|
|
12
|
-
return e.className = t, i !== void 0 && (e.textContent = i), e;
|
|
13
|
-
}
|
|
14
|
-
class $ {
|
|
15
|
-
constructor(t, i) {
|
|
16
|
-
d(this, "entries", []);
|
|
17
|
-
d(this, "active", null);
|
|
18
|
-
d(this, "markers", []);
|
|
19
|
-
d(this, "closeTimer", null);
|
|
20
|
-
d(this, "drawMarkers", () => {
|
|
21
|
-
for (const i of this.markers) i.remove();
|
|
22
|
-
this.markers = [];
|
|
23
|
-
const t = this.ctx.videoEl.duration;
|
|
24
|
-
if (!(this.options.markers === !1 || !Number.isFinite(t) || t <= 0))
|
|
25
|
-
for (const i of this.entries) {
|
|
26
|
-
if (i.item.time < 0 || i.item.time > t) continue;
|
|
27
|
-
const e = this.ctx.addSeekBarMarker(i.item.time / t, "hp-ia-marker", "question" in i.item ? i.item.question : i.item.title), o = i.item.markerColor ?? this.options.markerColor;
|
|
28
|
-
o && (e.style.backgroundColor = o), this.markers.push(e);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
/** Yeni kaynak: oturum durumu sıfırlanır. */
|
|
32
|
-
d(this, "onEmptied", () => {
|
|
33
|
-
this.hide(null);
|
|
34
|
-
for (const t of this.entries) t.done = !1;
|
|
35
|
-
});
|
|
36
|
-
d(this, "onAdStart", () => {
|
|
37
|
-
this.active && !this.active.answered && this.hide("timeout");
|
|
38
|
-
});
|
|
39
|
-
/** Geri sarınca sonraki öğeler yeniden gösterilebilir (cevaplanmış anket / quiz yine sorulmaz). */
|
|
40
|
-
d(this, "onSeeked", () => {
|
|
41
|
-
var i;
|
|
42
|
-
const t = this.ctx.videoEl.currentTime;
|
|
43
|
-
for (const e of this.entries) e.item.time > t + 0.1 && e !== ((i = this.active) == null ? void 0 : i.entry) && (e.done = !1);
|
|
44
|
-
this.onTime();
|
|
45
|
-
});
|
|
46
|
-
d(this, "onTime", () => {
|
|
47
|
-
const t = this.ctx.videoEl.currentTime, i = this.active;
|
|
48
|
-
if (i)
|
|
49
|
-
if (t < i.entry.item.time - 0.5) this.hide("seek");
|
|
50
|
-
else if (!i.answered && t >= i.shownAt + this.duration(i.entry.item)) this.hide("timeout");
|
|
51
|
-
else if (i.answered && this.entries.some((e) => !e.done && t >= e.item.time && t - e.item.time <= C)) this.hide(null);
|
|
52
|
-
else return;
|
|
53
|
-
if (!this.ctx.isAdActive()) {
|
|
54
|
-
for (const e of this.entries)
|
|
55
|
-
if (!(e.done || t < e.item.time) && (e.done = !0, !(t - e.item.time > C || this.remembered(e)))) {
|
|
56
|
-
this.show(e, t);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
this.ctx = t, this.options = i, S(t.overlayEl, "interactive", q), this.entries = i.items.map((o, s) => ({ item: o, id: o.id ?? `i${s}`, done: !1 }));
|
|
62
|
-
const e = t.videoEl;
|
|
63
|
-
e.addEventListener("timeupdate", this.onTime), e.addEventListener("seeked", this.onSeeked), e.addEventListener("loadedmetadata", this.drawMarkers), e.addEventListener("emptied", this.onEmptied), t.hostEl.addEventListener("hp:adstart", this.onAdStart), e.readyState >= 1 && this.drawMarkers();
|
|
64
|
-
}
|
|
65
|
-
/** Yalnızca fonksiyonlar değişti (ör. React'te her render'da yeni onAnswer). */
|
|
66
|
-
setOptions(t) {
|
|
67
|
-
this.options = t;
|
|
68
|
-
}
|
|
69
|
-
refreshLabels() {
|
|
70
|
-
var t, i;
|
|
71
|
-
(i = (t = this.active) == null ? void 0 : t.el.querySelector(".hp-ia-close")) == null || i.setAttribute("aria-label", this.ctx.i18n.interactiveClose);
|
|
72
|
-
}
|
|
73
|
-
destroy() {
|
|
74
|
-
const t = this.ctx.videoEl;
|
|
75
|
-
t.removeEventListener("timeupdate", this.onTime), t.removeEventListener("seeked", this.onSeeked), t.removeEventListener("loadedmetadata", this.drawMarkers), t.removeEventListener("emptied", this.onEmptied), this.ctx.hostEl.removeEventListener("hp:adstart", this.onAdStart), this.hide(null);
|
|
76
|
-
for (const i of this.markers) i.remove();
|
|
77
|
-
this.markers = [];
|
|
78
|
-
}
|
|
79
|
-
emit(t, i, e = {}) {
|
|
80
|
-
return this.ctx.hostEl.dispatchEvent(
|
|
81
|
-
new CustomEvent("hp:interactive", { detail: { state: t, id: i.id, type: i.item.type, ...e }, cancelable: t === "click" })
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
remembered(t) {
|
|
85
|
-
if (this.options.rememberAnswers === !1 || t.item.type !== "poll" && t.item.type !== "quiz") return !1;
|
|
86
|
-
try {
|
|
87
|
-
return localStorage.getItem(E + t.id) !== null;
|
|
88
|
-
} catch {
|
|
89
|
-
return !1;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
remember(t, i) {
|
|
93
|
-
if (this.options.rememberAnswers !== !1)
|
|
94
|
-
try {
|
|
95
|
-
localStorage.setItem(E + t.id, String(i));
|
|
96
|
-
} catch {
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
duration(t) {
|
|
100
|
-
return t.duration ?? (t.type === "poll" || t.type === "quiz" ? 15 : 8);
|
|
101
|
-
}
|
|
102
|
-
show(t, i) {
|
|
103
|
-
const e = t.item, o = n("div", "hp-ia");
|
|
104
|
-
o.setAttribute("part", `interactive interactive-${e.type}`), o.setAttribute("data-type", e.type), o.setAttribute("data-position", e.position ?? (e.type === "poll" || e.type === "quiz" ? "top-right" : "bottom-right")), o.setAttribute("role", "group");
|
|
105
|
-
for (const a of ["pointerdown", "click", "dblclick"]) o.addEventListener(a, (f) => f.stopPropagation());
|
|
106
|
-
if (o.addEventListener("keydown", (a) => a.stopPropagation()), e.dismissible !== !1) {
|
|
107
|
-
const a = n("button", "hp-ia-close");
|
|
108
|
-
a.type = "button", a.setAttribute("aria-label", this.ctx.i18n.interactiveClose), a.appendChild(L("close")), a.addEventListener("click", () => this.hide("user")), o.appendChild(a);
|
|
109
|
-
}
|
|
110
|
-
e.type === "poll" || e.type === "quiz" ? this.buildQuestion(o, t) : this.buildCard(o, t, e), this.ctx.overlayEl.appendChild(o);
|
|
111
|
-
const s = this.ctx.videoEl, r = !!e.pause && !s.paused;
|
|
112
|
-
r && s.pause(), this.active = { entry: t, el: o, shownAt: i, pausedByUs: r, answered: !1 }, this.emit("shown", t);
|
|
113
|
-
}
|
|
114
|
-
buildQuestion(t, i) {
|
|
115
|
-
const e = i.item, o = this.ctx.i18n;
|
|
116
|
-
t.appendChild(n("span", "hp-ia-label", e.type === "poll" ? o.interactivePoll : o.interactiveQuiz));
|
|
117
|
-
const s = n("p", "hp-ia-question", e.question);
|
|
118
|
-
s.id = `hp-ia-q-${i.id}`, t.setAttribute("aria-labelledby", s.id), t.appendChild(s);
|
|
119
|
-
const r = n("div", "hp-ia-choices"), a = e.choices.map(T), f = a.map((v, u) => {
|
|
120
|
-
const c = n("button", "hp-ia-choice");
|
|
121
|
-
return c.type = "button", c.appendChild(n("span", "hp-ia-choice-text", v.text)), c.addEventListener("click", () => void this.answer(i, u, a[u].id, f)), r.appendChild(c), c;
|
|
122
|
-
});
|
|
123
|
-
t.appendChild(r);
|
|
124
|
-
const l = n("p", "hp-ia-status");
|
|
125
|
-
l.setAttribute("aria-live", "polite"), t.appendChild(l);
|
|
126
|
-
}
|
|
127
|
-
async answer(t, i, e, o) {
|
|
128
|
-
var v, u, c, g, y, k;
|
|
129
|
-
const s = this.active;
|
|
130
|
-
if (!s || s.entry !== t || s.answered) return;
|
|
131
|
-
s.answered = !0;
|
|
132
|
-
const r = t.item, a = r.type === "quiz" ? i === r.answer : void 0;
|
|
133
|
-
this.remember(t, i);
|
|
134
|
-
for (const m of o) m.disabled = !0;
|
|
135
|
-
(v = o[i]) == null || v.setAttribute("data-picked", "");
|
|
136
|
-
const f = s.el.querySelector(".hp-ia-status");
|
|
137
|
-
this.emit("answer", t, { choice: i, choiceId: e, ...a !== void 0 ? { correct: a } : {} });
|
|
138
|
-
let l;
|
|
139
|
-
try {
|
|
140
|
-
l = await ((c = (u = this.options).onAnswer) == null ? void 0 : c.call(u, { item: r, id: t.id, choice: i, choiceId: e, correct: a }));
|
|
141
|
-
} catch {
|
|
142
|
-
l = void 0;
|
|
143
|
-
}
|
|
144
|
-
if (((g = this.active) == null ? void 0 : g.entry) === t) {
|
|
145
|
-
if (r.type === "quiz")
|
|
146
|
-
(y = o[r.answer]) == null || y.setAttribute("data-correct", ""), a || (k = o[i]) == null || k.setAttribute("data-wrong", ""), f && (f.textContent = `${a ? this.ctx.i18n.interactiveCorrect : this.ctx.i18n.interactiveWrong}${r.explanation ? ` ${r.explanation}` : ""}`);
|
|
147
|
-
else {
|
|
148
|
-
const m = Array.isArray(l) ? l : r.results ? r.results.map((x, h) => x + (h === i ? 1 : 0)) : null;
|
|
149
|
-
if (m) {
|
|
150
|
-
const x = m.reduce((h, b) => h + (Number.isFinite(b) && b > 0 ? b : 0), 0) || 1;
|
|
151
|
-
o.forEach((h, b) => {
|
|
152
|
-
const w = Math.round((m[b] ?? 0) / x * 100);
|
|
153
|
-
h.style.setProperty("--hp-ia-pct", `${w}%`), h.setAttribute("data-result", ""), h.appendChild(n("span", "hp-ia-pct", this.ctx.i18n.interactiveVotes(w)));
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
this.closeTimer = setTimeout(() => this.hide(null), r.type === "quiz" ? 5e3 : 3500);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
buildCard(t, i, e) {
|
|
161
|
-
const o = this.ctx.i18n, s = n("a", "hp-ia-card");
|
|
162
|
-
if (s.href = e.url, e.newTab !== !1 && (s.target = "_blank", s.rel = "noopener"), e.image) {
|
|
163
|
-
const a = n("img", "hp-ia-image");
|
|
164
|
-
a.src = e.image, a.alt = "", a.decoding = "async", a.addEventListener("error", () => a.remove()), s.appendChild(a);
|
|
165
|
-
}
|
|
166
|
-
const r = n("span", "hp-ia-body");
|
|
167
|
-
if (e.sponsored && r.appendChild(n("span", "hp-ia-label", o.interactiveSponsored)), r.appendChild(n("span", "hp-ia-title", e.title)), e.subtitle && r.appendChild(n("span", "hp-ia-sub", e.subtitle)), e.price || e.oldPrice) {
|
|
168
|
-
const a = n("span", "hp-ia-price");
|
|
169
|
-
e.price && a.appendChild(n("strong", "", e.price)), e.oldPrice && a.appendChild(n("s", "", e.oldPrice)), r.appendChild(a);
|
|
170
|
-
}
|
|
171
|
-
r.appendChild(n("span", "hp-ia-cta", e.cta ?? (e.type === "product" ? o.interactiveBuy : o.interactiveGo))), s.appendChild(r), s.addEventListener("click", (a) => {
|
|
172
|
-
this.emit("click", i, { url: e.url }) || a.preventDefault();
|
|
173
|
-
}), t.setAttribute("aria-label", e.title), t.appendChild(s);
|
|
174
|
-
}
|
|
175
|
-
hide(t) {
|
|
176
|
-
this.closeTimer && clearTimeout(this.closeTimer), this.closeTimer = null;
|
|
177
|
-
const i = this.active;
|
|
178
|
-
i && (this.active = null, i.el.remove(), t && this.emit("dismiss", i.entry, { reason: t }), i.pausedByUs && t !== "seek" && this.ctx.videoEl.play().catch(() => {
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function I(p, t) {
|
|
183
|
-
return new $(p, t);
|
|
184
|
-
}
|
|
185
|
-
export {
|
|
186
|
-
$ as Interactive,
|
|
187
|
-
I as installInteractive
|
|
188
|
-
};
|
|
189
|
-
//# sourceMappingURL=interactive-CgltIneu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-CgltIneu.js","sources":["../../src/plugins/interactive/Interactive.ts","../../src/plugins/interactive/index.ts"],"sourcesContent":["import type { InteractiveCard, InteractiveChoice, InteractiveItem, InteractiveOptions } from '../../types';\nimport type { HopeLocaleStrings } from '../../i18n/types';\nimport { createIcon } from '../../icons/Icon';\nimport { adoptStyle } from '../../utils/plugin-style';\nimport css from './interactive.css?inline';\n\nexport interface InteractivePlayerContext {\n hostEl: HTMLElement;\n videoEl: HTMLVideoElement;\n overlayEl: HTMLElement;\n i18n: HopeLocaleStrings;\n isAdActive(): boolean;\n addSeekBarMarker(ratio: number, extraClass?: string, label?: string): HTMLElement;\n}\n\ninterface Entry {\n item: InteractiveItem;\n id: string;\n /** Bu oturumda gösterildi (ileri geri sarınca tekrar sorulmaz). */\n done: boolean;\n}\n\nconst STORE = 'hp-interactive:';\n/** Bu kadar saniye geç kalınırsa (ileri sarma) öğe atlanır. */\nconst LATE = 1.5;\n\nfunction choiceOf(c: string | InteractiveChoice, i: number): { id: string; text: string } {\n return typeof c === 'string' ? { id: String(i), text: c } : { id: c.id ?? String(i), text: c.text };\n}\n\nfunction el<K extends keyof HTMLElementTagNameMap>(tag: K, className: string, text?: string): HTMLElementTagNameMap[K] {\n const e = document.createElement(tag);\n e.className = className;\n if (text !== undefined) e.textContent = text;\n return e;\n}\n\n/**\n * Etkileşimli içerik: belirli saniyelerde anket, quiz, ürün ya da bağlantı kartı. Zamanlama videonun zamanıyla\n * işler (duraklatınca süre durur); ileri sarılıp geçilen öğe gösterilmez. Cevaplanan anket / quiz izleyiciye bir daha\n * sorulmaz (localStorage). Reklam oynarken gizlenir.\n */\nexport class Interactive {\n private entries: Entry[] = [];\n private active: { entry: Entry; el: HTMLElement; shownAt: number; pausedByUs: boolean; answered: boolean } | null = null;\n private markers: HTMLElement[] = [];\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor(\n private readonly ctx: InteractivePlayerContext,\n private options: InteractiveOptions\n ) {\n adoptStyle(ctx.overlayEl, 'interactive', css);\n this.entries = options.items.map((item, i) => ({ item, id: item.id ?? `i${i}`, done: false }));\n const v = ctx.videoEl;\n v.addEventListener('timeupdate', this.onTime);\n v.addEventListener('seeked', this.onSeeked);\n v.addEventListener('loadedmetadata', this.drawMarkers);\n v.addEventListener('emptied', this.onEmptied);\n ctx.hostEl.addEventListener('hp:adstart', this.onAdStart);\n if (v.readyState >= 1) this.drawMarkers();\n }\n\n /** Yalnızca fonksiyonlar değişti (ör. React'te her render'da yeni onAnswer). */\n setOptions(options: InteractiveOptions): void {\n this.options = options;\n }\n\n refreshLabels(): void {\n // Açık öğenin metinleri bir sonraki gösterimde dilden okunur; açık olanın kapat etiketi güncellenir.\n this.active?.el.querySelector('.hp-ia-close')?.setAttribute('aria-label', this.ctx.i18n.interactiveClose);\n }\n\n destroy(): void {\n const v = this.ctx.videoEl;\n v.removeEventListener('timeupdate', this.onTime);\n v.removeEventListener('seeked', this.onSeeked);\n v.removeEventListener('loadedmetadata', this.drawMarkers);\n v.removeEventListener('emptied', this.onEmptied);\n this.ctx.hostEl.removeEventListener('hp:adstart', this.onAdStart);\n this.hide(null);\n for (const m of this.markers) m.remove();\n this.markers = [];\n }\n\n private emit(state: 'shown' | 'answer' | 'click' | 'dismiss', entry: Entry, extra: Record<string, unknown> = {}): boolean {\n return this.ctx.hostEl.dispatchEvent(\n new CustomEvent('hp:interactive', { detail: { state, id: entry.id, type: entry.item.type, ...extra }, cancelable: state === 'click' })\n );\n }\n\n private readonly drawMarkers = (): void => {\n for (const m of this.markers) m.remove();\n this.markers = [];\n const d = this.ctx.videoEl.duration;\n if (this.options.markers === false || !Number.isFinite(d) || d <= 0) return;\n for (const e of this.entries) {\n if (e.item.time < 0 || e.item.time > d) continue;\n const m = this.ctx.addSeekBarMarker(e.item.time / d, 'hp-ia-marker', 'question' in e.item ? e.item.question : e.item.title);\n const color = e.item.markerColor ?? this.options.markerColor;\n if (color) m.style.backgroundColor = color;\n this.markers.push(m);\n }\n };\n\n /** Yeni kaynak: oturum durumu sıfırlanır. */\n private readonly onEmptied = (): void => {\n this.hide(null);\n for (const e of this.entries) e.done = false;\n };\n\n private readonly onAdStart = (): void => {\n // Reklam açık öğeyi örtmesin — kapat, reklamdan sonra tekrar gösterilmez.\n if (this.active && !this.active.answered) this.hide('timeout');\n };\n\n private remembered(entry: Entry): boolean {\n if (this.options.rememberAnswers === false || (entry.item.type !== 'poll' && entry.item.type !== 'quiz')) return false;\n try {\n return localStorage.getItem(STORE + entry.id) !== null;\n } catch {\n return false;\n }\n }\n\n private remember(entry: Entry, choice: number): void {\n if (this.options.rememberAnswers === false) return;\n try {\n localStorage.setItem(STORE + entry.id, String(choice));\n } catch {\n /* depolama kapalı */\n }\n }\n\n private duration(item: InteractiveItem): number {\n return item.duration ?? (item.type === 'poll' || item.type === 'quiz' ? 15 : 8);\n }\n\n /** Geri sarınca sonraki öğeler yeniden gösterilebilir (cevaplanmış anket / quiz yine sorulmaz). */\n private readonly onSeeked = (): void => {\n const t = this.ctx.videoEl.currentTime;\n for (const e of this.entries) if (e.item.time > t + 0.1 && e !== this.active?.entry) e.done = false;\n this.onTime();\n };\n\n private readonly onTime = (): void => {\n const t = this.ctx.videoEl.currentTime;\n const a = this.active;\n if (a) {\n // Geri sarıldı ya da süresi doldu (cevaplanmış anket sonucu kendi zamanlayıcısıyla kapanır).\n if (t < a.entry.item.time - 0.5) this.hide('seek');\n else if (!a.answered && t >= a.shownAt + this.duration(a.entry.item)) this.hide('timeout');\n // Sonuç gösterilirken sıradaki öğenin zamanı geldi — sonucu kapat, yenisini göster.\n else if (a.answered && this.entries.some((e) => !e.done && t >= e.item.time && t - e.item.time <= LATE)) this.hide(null);\n else return;\n }\n if (this.ctx.isAdActive()) return;\n for (const e of this.entries) {\n if (e.done || t < e.item.time) continue;\n e.done = true;\n // İleri sarılıp geçildiyse ya da daha önce cevaplandıysa gösterme.\n if (t - e.item.time > LATE || this.remembered(e)) continue;\n this.show(e, t);\n return;\n }\n };\n\n private show(entry: Entry, t: number): void {\n const item = entry.item;\n const box = el('div', 'hp-ia');\n box.setAttribute('part', `interactive interactive-${item.type}`);\n box.setAttribute('data-type', item.type);\n box.setAttribute('data-position', item.position ?? (item.type === 'poll' || item.type === 'quiz' ? 'top-right' : 'bottom-right'));\n box.setAttribute('role', 'group');\n for (const ev of ['pointerdown', 'click', 'dblclick'] as const) box.addEventListener(ev, (e) => e.stopPropagation());\n box.addEventListener('keydown', (e) => e.stopPropagation());\n\n if (item.dismissible !== false) {\n const close = el('button', 'hp-ia-close');\n close.type = 'button';\n close.setAttribute('aria-label', this.ctx.i18n.interactiveClose);\n close.appendChild(createIcon('close'));\n close.addEventListener('click', () => this.hide('user'));\n box.appendChild(close);\n }\n\n if (item.type === 'poll' || item.type === 'quiz') this.buildQuestion(box, entry);\n else this.buildCard(box, entry, item);\n\n this.ctx.overlayEl.appendChild(box);\n const v = this.ctx.videoEl;\n const pausedByUs = !!item.pause && !v.paused;\n if (pausedByUs) v.pause();\n this.active = { entry, el: box, shownAt: t, pausedByUs, answered: false };\n this.emit('shown', entry);\n }\n\n private buildQuestion(box: HTMLElement, entry: Entry): void {\n const item = entry.item as Extract<InteractiveItem, { type: 'poll' | 'quiz' }>;\n const i18n = this.ctx.i18n;\n box.appendChild(el('span', 'hp-ia-label', item.type === 'poll' ? i18n.interactivePoll : i18n.interactiveQuiz));\n const q = el('p', 'hp-ia-question', item.question);\n q.id = `hp-ia-q-${entry.id}`;\n box.setAttribute('aria-labelledby', q.id);\n box.appendChild(q);\n const list = el('div', 'hp-ia-choices');\n const choices = item.choices.map(choiceOf);\n const buttons = choices.map((c, i) => {\n const b = el('button', 'hp-ia-choice');\n b.type = 'button';\n b.appendChild(el('span', 'hp-ia-choice-text', c.text));\n b.addEventListener('click', () => void this.answer(entry, i, choices[i]!.id, buttons));\n list.appendChild(b);\n return b;\n });\n box.appendChild(list);\n const status = el('p', 'hp-ia-status');\n status.setAttribute('aria-live', 'polite');\n box.appendChild(status);\n }\n\n private async answer(entry: Entry, choice: number, choiceId: string, buttons: HTMLButtonElement[]): Promise<void> {\n const a = this.active;\n if (!a || a.entry !== entry || a.answered) return;\n a.answered = true;\n const item = entry.item as Extract<InteractiveItem, { type: 'poll' | 'quiz' }>;\n const correct = item.type === 'quiz' ? choice === item.answer : undefined;\n this.remember(entry, choice);\n for (const b of buttons) b.disabled = true;\n buttons[choice]?.setAttribute('data-picked', '');\n const status = a.el.querySelector<HTMLElement>('.hp-ia-status');\n this.emit('answer', entry, { choice, choiceId, ...(correct !== undefined ? { correct } : {}) });\n\n let results: number[] | void | undefined;\n try {\n results = await this.options.onAnswer?.({ item, id: entry.id, choice, choiceId, correct });\n } catch {\n results = undefined;\n }\n if (this.active?.entry !== entry) return;\n\n if (item.type === 'quiz') {\n buttons[item.answer]?.setAttribute('data-correct', '');\n if (!correct) buttons[choice]?.setAttribute('data-wrong', '');\n if (status) status.textContent = `${correct ? this.ctx.i18n.interactiveCorrect : this.ctx.i18n.interactiveWrong}${item.explanation ? ` ${item.explanation}` : ''}`;\n } else {\n // Sonuç: onAnswer'ın döndürdüğü, yoksa verilen dağılım + bu oy.\n const base = Array.isArray(results) ? results : item.results ? item.results.map((n, i) => n + (i === choice ? 1 : 0)) : null;\n if (base) {\n const total = base.reduce((s, n) => s + (Number.isFinite(n) && n > 0 ? n : 0), 0) || 1;\n buttons.forEach((b, i) => {\n const pct = Math.round(((base[i] ?? 0) / total) * 100);\n b.style.setProperty('--hp-ia-pct', `${pct}%`);\n b.setAttribute('data-result', '');\n b.appendChild(el('span', 'hp-ia-pct', this.ctx.i18n.interactiveVotes(pct)));\n });\n }\n }\n // Sonuç birkaç saniye görünür, sonra kapanır (duraklattıysak oynatma devam eder).\n this.closeTimer = setTimeout(() => this.hide(null), item.type === 'quiz' ? 5000 : 3500);\n }\n\n private buildCard(box: HTMLElement, entry: Entry, item: InteractiveCard): void {\n const i18n = this.ctx.i18n;\n const link = el('a', 'hp-ia-card');\n link.href = item.url;\n if (item.newTab !== false) {\n link.target = '_blank';\n link.rel = 'noopener';\n }\n if (item.image) {\n const img = el('img', 'hp-ia-image');\n img.src = item.image;\n img.alt = '';\n img.decoding = 'async';\n img.addEventListener('error', () => img.remove());\n link.appendChild(img);\n }\n const body = el('span', 'hp-ia-body');\n if (item.sponsored) body.appendChild(el('span', 'hp-ia-label', i18n.interactiveSponsored));\n body.appendChild(el('span', 'hp-ia-title', item.title));\n if (item.subtitle) body.appendChild(el('span', 'hp-ia-sub', item.subtitle));\n if (item.price || item.oldPrice) {\n const price = el('span', 'hp-ia-price');\n if (item.price) price.appendChild(el('strong', '', item.price));\n if (item.oldPrice) price.appendChild(el('s', '', item.oldPrice));\n body.appendChild(price);\n }\n body.appendChild(el('span', 'hp-ia-cta', item.cta ?? (item.type === 'product' ? i18n.interactiveBuy : i18n.interactiveGo)));\n link.appendChild(body);\n link.addEventListener('click', (e) => {\n // preventDefault → entegratör kendisi açar (sepete ekle, SPA router).\n if (!this.emit('click', entry, { url: item.url })) e.preventDefault();\n });\n box.setAttribute('aria-label', item.title);\n box.appendChild(link);\n }\n\n private hide(reason: 'user' | 'timeout' | 'seek' | null): void {\n if (this.closeTimer) clearTimeout(this.closeTimer);\n this.closeTimer = null;\n const a = this.active;\n if (!a) return;\n this.active = null;\n a.el.remove();\n if (reason) this.emit('dismiss', a.entry, { reason });\n if (a.pausedByUs && reason !== 'seek') void this.ctx.videoEl.play().catch(() => {});\n }\n}\n","import { Interactive, type InteractivePlayerContext } from './Interactive';\nimport type { InteractiveOptions } from '../../types';\n\nexport function installInteractive(ctx: InteractivePlayerContext, options: InteractiveOptions): Interactive {\n return new Interactive(ctx, options);\n}\n\nexport { Interactive };\nexport type { InteractivePlayerContext };\n"],"names":["STORE","LATE","choiceOf","c","i","el","tag","className","text","Interactive","ctx","options","__publicField","m","d","e","color","_a","a","adoptStyle","css","item","v","_b","state","entry","extra","choice","t","box","ev","close","createIcon","pausedByUs","i18n","q","list","choices","buttons","b","status","choiceId","correct","results","_c","_d","_e","_f","base","n","total","s","pct","link","img","body","price","reason","installInteractive"],"mappings":";;;;;s5HAsBMA,IAAQ,mBAERC,IAAO;AAEb,SAASC,EAASC,GAA+BC,GAAyC;AACtF,SAAO,OAAOD,KAAM,WAAW,EAAE,IAAI,OAAOC,CAAC,GAAG,MAAMD,EAAA,IAAM,EAAE,IAAIA,EAAE,MAAM,OAAOC,CAAC,GAAG,MAAMD,EAAE,KAAA;AACjG;AAEA,SAASE,EAA0CC,GAAQC,GAAmBC,GAAyC;AACnH,QAAM,IAAI,SAAS,cAAcF,CAAG;AACpC,WAAE,YAAYC,GACVC,MAAS,WAAW,EAAE,cAAcA,IACjC;AACX;AAOO,MAAMC,EAAY;AAAA,EAMrB,YACqBC,GACTC,GACV;AARM,IAAAC,EAAA,iBAAmB,CAAA;AACnB,IAAAA,EAAA,gBAA4G;AAC5G,IAAAA,EAAA,iBAAyB,CAAA;AACzB,IAAAA,EAAA,oBAAmD;AA6C1C,IAAAA,EAAA,qBAAc,MAAY;AACvC,iBAAWC,KAAK,KAAK,QAAS,CAAAA,EAAE,OAAA;AAChC,WAAK,UAAU,CAAA;AACf,YAAMC,IAAI,KAAK,IAAI,QAAQ;AAC3B,UAAI,OAAK,QAAQ,YAAY,MAAS,CAAC,OAAO,SAASA,CAAC,KAAKA,KAAK;AAClE,mBAAWC,KAAK,KAAK,SAAS;AAC1B,cAAIA,EAAE,KAAK,OAAO,KAAKA,EAAE,KAAK,OAAOD,EAAG;AACxC,gBAAMD,IAAI,KAAK,IAAI,iBAAiBE,EAAE,KAAK,OAAOD,GAAG,gBAAgB,cAAcC,EAAE,OAAOA,EAAE,KAAK,WAAWA,EAAE,KAAK,KAAK,GACpHC,IAAQD,EAAE,KAAK,eAAe,KAAK,QAAQ;AACjD,UAAIC,MAAOH,EAAE,MAAM,kBAAkBG,IACrC,KAAK,QAAQ,KAAKH,CAAC;AAAA,QACvB;AAAA,IACJ;AAGiB;AAA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