Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

10168 lines
336 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 7e519410fdb8d8cd.424e721e83.js
* Module id: 113492
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
let t, i;
var a,
r,
n,
o,
s,
l,
d,
u,
c,
h,
m,
p,
v,
b,
g,
f,
E,
w,
y,
x,
A,
k,
I,
C,
T,
M,
_,
S,
L,
R,
D,
N,
P,
j,
O,
U,
H,
V,
W,
$,
B,
F,
z,
G,
q,
Q,
K,
Y,
X,
Z,
J,
ee,
et,
ei,
ea,
er,
en,
eo,
es,
el,
ed,
eu,
ec,
eh,
em,
ep,
ev,
eb,
eg,
ef,
eE,
ew,
ey,
ex,
eA,
ek,
eI,
eC,
eT,
eM,
e_,
eS,
eL,
eR,
eD,
eN,
eP,
ej,
eO,
eU,
eH,
eV,
eW,
e$,
eB,
eF,
ez,
eG,
eq,
eQ,
eK,
eY,
eX,
eZ,
eJ,
e0,
e1,
e2,
e3,
e5,
e6,
e4,
e8,
e7,
e9,
te,
tt,
ti,
ta,
tr,
tn,
to,
ts,
tl,
td,
tu,
tc,
th,
tm,
tp,
tv,
tb,
tg,
tf,
tE,
tw,
ty,
tx,
tA,
tk,
tI,
tC,
tT,
tM,
t_,
tS,
tL,
tR,
tD,
tN,
tP,
tj = e.i(462214),
tO = e.i(358379),
tU = e.i(403094),
tH = e.i(734911),
tV = e.i(820748),
tW = e.i(247232),
t$ = e.i(41671),
tB = e.i(111558);
let tF = new Set([
"style",
"children",
"ref",
"key",
"suppressContentEditableWarning",
"suppressHydrationWarning",
"dangerouslySetInnerHTML",
]),
tz = { className: "class", htmlFor: "for" };
function tG(e) {
return e.toLowerCase();
}
function tq(e) {
return "boolean" == typeof e
? e
? ""
: void 0
: "function" == typeof e
? void 0
: "object" != typeof e || null === e
? e
: void 0;
}
function tQ({
react: e,
tagName: t,
elementClass: i,
events: a,
displayName: r,
defaultProps: n,
toAttributeName: o = tG,
toAttributeValue: s = tq,
}) {
let l = Number.parseInt(e.version) >= 19,
d = e.forwardRef((r, d) => {
let u = e.useRef(null),
c = e.useRef(new Map()),
h = {},
m = {},
p = {},
v = {};
for (let [e, t] of Object.entries(r)) {
if (tF.has(e)) {
p[e] = t;
continue;
}
let a = o(tz[e] ?? e);
if (
i.prototype &&
e in i.prototype &&
!(e in (globalThis.HTMLElement?.prototype ?? {})) &&
!i.observedAttributes?.some((e) => e === a)
) {
v[e] = t;
continue;
}
if (e.startsWith("on")) {
h[e] = t;
continue;
}
let r = s(t);
a && null != r && ((m[a] = String(r)), l || (p[a] = r)),
a && l && (r !== tq(t) ? (p[a] = r) : (p[a] = t));
}
if ("u" > typeof window) {
for (let t in h) {
let i = h[t],
r = t.endsWith("Capture"),
n = (a?.[t] ?? t.slice(2).toLowerCase()).slice(
0,
r ? -7 : void 0,
);
e.useLayoutEffect(() => {
let e = u?.current;
if (e && "function" == typeof i)
return (
e.addEventListener(n, i, r),
() => {
e.removeEventListener(n, i, r);
}
);
}, [u?.current, i]);
}
e.useLayoutEffect(() => {
if (null === u.current) return;
let e = new Map();
for (let t in v)
tK(u.current, t, v[t]), c.current.delete(t), e.set(t, v[t]);
for (let [e, t] of c.current) tK(u.current, e, void 0);
c.current = e;
});
}
if (
"u" < typeof window &&
i?.getTemplateHTML &&
i?.shadowRootOptions
) {
let { mode: t, delegatesFocus: a } = i.shadowRootOptions;
p.children = [
e.createElement("template", {
shadowrootmode: t,
shadowrootdelegatesfocus: a,
dangerouslySetInnerHTML: { __html: i.getTemplateHTML(m, r) },
key: "ce-la-react-ssr-template-shadow-root",
}),
p.children,
];
}
return e.createElement(
t,
{
...n,
...p,
ref: e.useCallback(
(e) => {
(u.current = e),
"function" == typeof d
? d(e)
: null !== d && (d.current = e);
},
[d],
),
},
p.children,
);
});
return (d.displayName = r ?? i.name), d;
}
function tK(e, t, i) {
(e[t] = i),
null == i &&
t in (globalThis.HTMLElement?.prototype ?? {}) &&
e.removeAttribute(t);
}
let tY = {
MEDIA_PLAY_REQUEST: "mediaplayrequest",
MEDIA_PAUSE_REQUEST: "mediapauserequest",
MEDIA_MUTE_REQUEST: "mediamuterequest",
MEDIA_UNMUTE_REQUEST: "mediaunmuterequest",
MEDIA_LOOP_REQUEST: "medialooprequest",
MEDIA_VOLUME_REQUEST: "mediavolumerequest",
MEDIA_SEEK_REQUEST: "mediaseekrequest",
MEDIA_AIRPLAY_REQUEST: "mediaairplayrequest",
MEDIA_ENTER_FULLSCREEN_REQUEST: "mediaenterfullscreenrequest",
MEDIA_EXIT_FULLSCREEN_REQUEST: "mediaexitfullscreenrequest",
MEDIA_PREVIEW_REQUEST: "mediapreviewrequest",
MEDIA_ENTER_PIP_REQUEST: "mediaenterpiprequest",
MEDIA_EXIT_PIP_REQUEST: "mediaexitpiprequest",
MEDIA_ENTER_CAST_REQUEST: "mediaentercastrequest",
MEDIA_EXIT_CAST_REQUEST: "mediaexitcastrequest",
MEDIA_SHOW_TEXT_TRACKS_REQUEST: "mediashowtexttracksrequest",
MEDIA_HIDE_TEXT_TRACKS_REQUEST: "mediahidetexttracksrequest",
MEDIA_SHOW_SUBTITLES_REQUEST: "mediashowsubtitlesrequest",
MEDIA_DISABLE_SUBTITLES_REQUEST: "mediadisablesubtitlesrequest",
MEDIA_TOGGLE_SUBTITLES_REQUEST: "mediatogglesubtitlesrequest",
MEDIA_PLAYBACK_RATE_REQUEST: "mediaplaybackraterequest",
MEDIA_RENDITION_REQUEST: "mediarenditionrequest",
MEDIA_AUDIO_TRACK_REQUEST: "mediaaudiotrackrequest",
MEDIA_SEEK_TO_LIVE_REQUEST: "mediaseektoliverequest",
REGISTER_MEDIA_STATE_RECEIVER: "registermediastatereceiver",
UNREGISTER_MEDIA_STATE_RECEIVER: "unregistermediastatereceiver",
},
tX = {
MEDIA_CHROME_ATTRIBUTES: "mediachromeattributes",
MEDIA_CONTROLLER: "mediacontroller",
},
tZ = {
MEDIA_AIRPLAY_UNAVAILABLE: "mediaAirplayUnavailable",
MEDIA_AUDIO_TRACK_ENABLED: "mediaAudioTrackEnabled",
MEDIA_AUDIO_TRACK_LIST: "mediaAudioTrackList",
MEDIA_AUDIO_TRACK_UNAVAILABLE: "mediaAudioTrackUnavailable",
MEDIA_BUFFERED: "mediaBuffered",
MEDIA_CAST_UNAVAILABLE: "mediaCastUnavailable",
MEDIA_CHAPTERS_CUES: "mediaChaptersCues",
MEDIA_CURRENT_TIME: "mediaCurrentTime",
MEDIA_DURATION: "mediaDuration",
MEDIA_ENDED: "mediaEnded",
MEDIA_ERROR: "mediaError",
MEDIA_ERROR_CODE: "mediaErrorCode",
MEDIA_ERROR_MESSAGE: "mediaErrorMessage",
MEDIA_FULLSCREEN_UNAVAILABLE: "mediaFullscreenUnavailable",
MEDIA_HAS_PLAYED: "mediaHasPlayed",
MEDIA_HEIGHT: "mediaHeight",
MEDIA_IS_AIRPLAYING: "mediaIsAirplaying",
MEDIA_IS_CASTING: "mediaIsCasting",
MEDIA_IS_FULLSCREEN: "mediaIsFullscreen",
MEDIA_IS_PIP: "mediaIsPip",
MEDIA_LOADING: "mediaLoading",
MEDIA_MUTED: "mediaMuted",
MEDIA_LOOP: "mediaLoop",
MEDIA_PAUSED: "mediaPaused",
MEDIA_PIP_UNAVAILABLE: "mediaPipUnavailable",
MEDIA_PLAYBACK_RATE: "mediaPlaybackRate",
MEDIA_PREVIEW_CHAPTER: "mediaPreviewChapter",
MEDIA_PREVIEW_COORDS: "mediaPreviewCoords",
MEDIA_PREVIEW_IMAGE: "mediaPreviewImage",
MEDIA_PREVIEW_TIME: "mediaPreviewTime",
MEDIA_RENDITION_LIST: "mediaRenditionList",
MEDIA_RENDITION_SELECTED: "mediaRenditionSelected",
MEDIA_RENDITION_UNAVAILABLE: "mediaRenditionUnavailable",
MEDIA_SEEKABLE: "mediaSeekable",
MEDIA_STREAM_TYPE: "mediaStreamType",
MEDIA_SUBTITLES_LIST: "mediaSubtitlesList",
MEDIA_SUBTITLES_SHOWING: "mediaSubtitlesShowing",
MEDIA_TARGET_LIVE_WINDOW: "mediaTargetLiveWindow",
MEDIA_TIME_IS_LIVE: "mediaTimeIsLive",
MEDIA_VOLUME: "mediaVolume",
MEDIA_VOLUME_LEVEL: "mediaVolumeLevel",
MEDIA_VOLUME_UNAVAILABLE: "mediaVolumeUnavailable",
MEDIA_LANG: "mediaLang",
MEDIA_WIDTH: "mediaWidth",
},
tJ = Object.entries(tZ),
t0 = tJ.reduce((e, [t, i]) => ((e[t] = i.toLowerCase()), e), {}),
t1 = tJ.reduce((e, [t, i]) => ((e[t] = i.toLowerCase()), e), {
USER_INACTIVE_CHANGE: "userinactivechange",
BREAKPOINTS_CHANGE: "breakpointchange",
BREAKPOINTS_COMPUTED: "breakpointscomputed",
}),
t2 = Object.entries(t1).reduce(
(e, [t, i]) => {
let a = t0[t];
return a && (e[i] = a), e;
},
{ userinactivechange: "userinactive" },
),
t3 = Object.entries(t0).reduce(
(e, [t, i]) => {
let a = t1[t];
return a && (e[i] = a), e;
},
{ userinactive: "userinactivechange" },
),
t5 = {
SUBTITLES: "subtitles",
CAPTIONS: "captions",
DESCRIPTIONS: "descriptions",
CHAPTERS: "chapters",
METADATA: "metadata",
},
t6 = { DISABLED: "disabled", HIDDEN: "hidden", SHOWING: "showing" },
t4 = {
HAVE_NOTHING: 0,
HAVE_METADATA: 1,
HAVE_CURRENT_DATA: 2,
HAVE_FUTURE_DATA: 3,
HAVE_ENOUGH_DATA: 4,
},
t8 = { MOUSE: "mouse", PEN: "pen", TOUCH: "touch" },
t7 = { UNAVAILABLE: "unavailable", UNSUPPORTED: "unsupported" },
t9 = { LIVE: "live", ON_DEMAND: "on-demand", UNKNOWN: "unknown" },
ie = { HIGH: "high", MEDIUM: "medium", LOW: "low", OFF: "off" },
it = {
INLINE: "inline",
FULLSCREEN: "fullscreen",
PICTURE_IN_PICTURE: "picture-in-picture",
};
function ii(e) {
if (e) {
let { id: t, width: i, height: a } = e;
return [t, i, a].filter((e) => null != e).join(":");
}
}
function ia(e) {
if (e) {
let { id: t, kind: i, language: a, label: r } = e;
return [t, i, a, r].filter((e) => null != e).join(":");
}
}
function ir(e) {
return "number" == typeof e && !Number.isNaN(e) && Number.isFinite(e);
}
e.s(
[
"AttributeToStateChangeEventMap",
() => t3,
"AvailabilityStates",
() => t7,
"MediaStateChangeEvents",
() => t1,
"MediaStateReceiverAttributes",
() => tX,
"MediaUIAttributes",
() => t0,
"MediaUIEvents",
() => tY,
"MediaUIProps",
() => tZ,
"PointerTypes",
() => t8,
"ReadyStates",
() => t4,
"StateChangeEventToAttributeMap",
() => t2,
"StreamTypes",
() => t9,
"TextTrackKinds",
() => t5,
"TextTrackModes",
() => t6,
"VolumeLevels",
() => ie,
"WebkitPresentationModes",
() => it,
],
713344,
),
e.i(713344);
let io = (e) => new Promise((t) => setTimeout(t, e)),
is = {
en: {
"Start airplay": "Start airplay",
"Stop airplay": "Stop airplay",
Audio: "Audio",
Captions: "Captions",
"Enable captions": "Enable captions",
"Disable captions": "Disable captions",
"Start casting": "Start casting",
"Stop casting": "Stop casting",
"Enter fullscreen mode": "Enter fullscreen mode",
"Exit fullscreen mode": "Exit fullscreen mode",
Mute: "Mute",
Unmute: "Unmute",
Loop: "Loop",
"Enter picture in picture mode": "Enter picture in picture mode",
"Exit picture in picture mode": "Exit picture in picture mode",
Play: "Play",
Pause: "Pause",
"Playback rate": "Playback rate",
"Playback rate {playbackRate}": "Playback rate {playbackRate}",
Quality: "Quality",
"Seek backward": "Seek backward",
"Seek forward": "Seek forward",
Settings: "Settings",
Auto: "Auto",
"audio player": "audio player",
"video player": "video player",
volume: "volume",
seek: "seek",
"closed captions": "closed captions",
"current playback rate": "current playback rate",
"playback time": "playback time",
"media loading": "media loading",
settings: "settings",
"audio tracks": "audio tracks",
quality: "quality",
play: "play",
pause: "pause",
mute: "mute",
unmute: "unmute",
"chapter: {chapterName}": "chapter: {chapterName}",
live: "live",
Off: "Off",
"start airplay": "start airplay",
"stop airplay": "stop airplay",
"start casting": "start casting",
"stop casting": "stop casting",
"enter fullscreen mode": "enter fullscreen mode",
"exit fullscreen mode": "exit fullscreen mode",
"enter picture in picture mode": "enter picture in picture mode",
"exit picture in picture mode": "exit picture in picture mode",
"seek to live": "seek to live",
"playing live": "playing live",
"seek back {seekOffset} seconds": "seek back {seekOffset} seconds",
"seek forward {seekOffset} seconds":
"seek forward {seekOffset} seconds",
"Network Error": "Network Error",
"Decode Error": "Decode Error",
"Source Not Supported": "Source Not Supported",
"Encryption Error": "Encryption Error",
"A network error caused the media download to fail.":
"A network error caused the media download to fail.",
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",
"An unsupported error occurred. The server or network failed, or your browser does not support this format.":
"An unsupported error occurred. The server or network failed, or your browser does not support this format.",
"The media is encrypted and there are no keys to decrypt it.":
"The media is encrypted and there are no keys to decrypt it.",
hour: "hour",
hours: "hours",
minute: "minute",
minutes: "minutes",
second: "second",
seconds: "seconds",
"{time} remaining": "{time} remaining",
"{currentTime} of {totalTime}": "{currentTime} of {totalTime}",
"video not loaded, unknown time.": "video not loaded, unknown time.",
},
},
il = (null == (a = globalThis.navigator) ? void 0 : a.language) || "en",
id = (e, t = {}) =>
((e) => {
var t, i, a;
let [r] = il.split("-");
return (
(null == (t = is[il]) ? void 0 : t[e]) ||
(null == (i = is[r]) ? void 0 : i[e]) ||
(null == (a = is.en) ? void 0 : a[e]) ||
e
);
})(e).replace(/\{(\w+)\}/g, (e, i) =>
i in t ? String(t[i]) : `{${i}}`,
),
iu = [
{ singular: "hour", plural: "hours" },
{ singular: "minute", plural: "minutes" },
{ singular: "second", plural: "seconds" },
],
ic = (e) => {
if (!ir(e)) return "";
let t = Math.abs(e),
i = t !== e,
a = new Date(0, 0, 0, 0, 0, t, 0),
r = [a.getHours(), a.getMinutes(), a.getSeconds()]
.map((e, t) => {
let i;
return (
e &&
((i = 1 === e ? id(iu[t].singular) : id(iu[t].plural)),
`${e} ${i}`)
);
})
.filter((e) => e)
.join(", ");
return i ? id("{time} remaining", { time: r }) : r;
};
function ih(e, t) {
let i = !1;
e < 0 && ((i = !0), (e = 0 - e));
let a = Math.floor((e = e < 0 ? 0 : e) % 60),
r = Math.floor((e / 60) % 60),
n = Math.floor(e / 3600),
o = Math.floor((t / 60) % 60),
s = Math.floor(t / 3600);
return (
(isNaN(e) || e === 1 / 0) && (n = r = a = "0"),
(r =
(((n = n > 0 || s > 0 ? n + ":" : "") || o >= 10) && r < 10
? "0" + r
: r) + ":"),
(i ? "-" : "") + n + r + (a = a < 10 ? "0" + a : a)
);
}
let im = Object.freeze({
length: 0,
start(e) {
let t = e >>> 0;
if (t >= this.length)
throw new DOMException(
`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`,
);
return 0;
},
end(e) {
let t = e >>> 0;
if (t >= this.length)
throw new DOMException(
`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`,
);
return 0;
},
});
function ip(e = im) {
return Array.from(e)
.map((t, i) =>
[Number(e.start(i).toFixed(3)), Number(e.end(i).toFixed(3))].join(
":",
),
)
.join(" ");
}
e.s(
[
"emptyTimeRanges",
() => im,
"formatAsTimePhrase",
() => ic,
"formatTime",
() => ih,
"serializeTimeRanges",
() => ip,
],
198297,
),
e.i(198297);
class iv {
addEventListener() {}
removeEventListener() {}
dispatchEvent() {
return !0;
}
}
class ib extends iv {}
class ig extends ib {
constructor() {
super(...arguments), (this.role = null);
}
}
let iE = {
createElement: function () {
return new iw.HTMLElement();
},
createElementNS: function () {
return new iw.HTMLElement();
},
addEventListener() {},
removeEventListener() {},
dispatchEvent: (e) => !1,
},
iw = {
ResizeObserver: class {
observe() {}
unobserve() {}
disconnect() {}
},
document: iE,
Node: ib,
Element: ig,
HTMLElement: class extends ig {
constructor() {
super(...arguments), (this.innerHTML = "");
}
get content() {
return new iw.DocumentFragment();
}
},
DocumentFragment: class extends iv {},
customElements: {
get: function () {},
define: function () {},
whenDefined: function () {},
},
localStorage: {
getItem: (e) => null,
setItem(e, t) {},
removeItem(e) {},
},
CustomEvent: function () {},
getComputedStyle: function () {},
navigator: {
languages: [],
get userAgent() {
return "";
},
},
matchMedia: (e) => ({ matches: !1, media: e }),
DOMParser: class {
parseFromString(e, t) {
return { body: { textContent: e } };
}
},
},
iy =
("global" in globalThis &&
(null == globalThis ? void 0 : globalThis.global) === globalThis) ||
"u" < typeof window ||
void 0 === window.customElements,
ix = Object.keys(iw).every((e) => e in globalThis),
iA = iy && !ix ? iw : globalThis,
ik = iy && !ix ? iE : globalThis.document,
iI = new WeakMap(),
iC = (e) => {
let t = iI.get(e);
return t || iI.set(e, (t = new Set())), t;
},
iT = new iA.ResizeObserver((e) => {
for (let t of e) for (let e of iC(t.target)) e(t);
});
function iM(e, t) {
iC(e).add(t), iT.observe(e);
}
function i_(e, t) {
let i = iC(e);
i.delete(t), i.size || iT.unobserve(e);
}
function iS(e) {
let t = {};
for (let i of e) t[i.name] = i.value;
return t;
}
let iL = (e, t, i = ".value") => {
let a = e.querySelector(i);
a && (a.textContent = t);
},
iR = (e, t) => {
let i, a;
return ((i = `slot[name="${t}"]`),
!(a = e.shadowRoot.querySelector(i)) ? [] : a.children)[0];
},
iD = (e, t) =>
!!e &&
!!t &&
((null != e && !!e.contains(t)) || iD(e, t.getRootNode().host)),
iN = (e, t) => {
if (!e) return null;
let i = e.closest(t);
return i || iN(e.getRootNode().host, t);
};
function iP(
e,
{ depth: t = 3, checkOpacity: i = !0, checkVisibilityCSS: a = !0 } = {},
) {
if (e.checkVisibility)
return e.checkVisibility({ checkOpacity: i, checkVisibilityCSS: a });
let r = e;
for (; r && t > 0; ) {
let e = getComputedStyle(r);
if (
(i && "0" === e.opacity) ||
(a && "hidden" === e.visibility) ||
"none" === e.display
)
return !1;
(r = r.parentElement), t--;
}
return !0;
}
function ij(e, t) {
let i = (function (e, t) {
var i, a;
let r;
for (r of null != (i = e.querySelectorAll("style:not([media])"))
? i
: []) {
let e;
try {
e = null == (a = r.sheet) ? void 0 : a.cssRules;
} catch {
continue;
}
for (let i of null != e ? e : []) if (t(i.selectorText)) return i;
}
})(e, (e) => e === t);
return i || iO(e, t);
}
function iO(e, t) {
var i, a;
let r = null != (i = e.querySelectorAll("style:not([media])")) ? i : [],
n = null == r ? void 0 : r[r.length - 1];
if (!(null == n ? void 0 : n.sheet))
return (
console.warn("Media Chrome: No style sheet found on style tag of", e),
{
style: {
setProperty: () => {},
removeProperty: () => "",
getPropertyValue: () => "",
},
}
);
let o =
null == n
? void 0
: n.sheet.insertRule(`${t}{}`, n.sheet.cssRules.length);
return null == (a = n.sheet.cssRules) ? void 0 : a[o];
}
function iU(e, t, i = NaN) {
let a = e.getAttribute(t);
return null != a ? +a : i;
}
function iH(e, t, i) {
let a = +i;
if (null == i || Number.isNaN(a)) {
e.hasAttribute(t) && e.removeAttribute(t);
return;
}
iU(e, t, void 0) !== a && e.setAttribute(t, `${a}`);
}
function iV(e, t) {
return e.hasAttribute(t);
}
function iW(e, t, i) {
if (null == i) {
e.hasAttribute(t) && e.removeAttribute(t);
return;
}
iV(e, t) != i && e.toggleAttribute(t, i);
}
function i$(e, t, i = null) {
var a;
return null != (a = e.getAttribute(t)) ? a : i;
}
function iB(e, t, i) {
if (null == i) {
e.hasAttribute(t) && e.removeAttribute(t);
return;
}
let a = `${i}`;
i$(e, t, void 0) !== a && e.setAttribute(t, a);
}
var iF = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
iz = (e, t, i) => (
iF(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
iG = (e, t, i, a) => (
iF(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class iq extends iA.HTMLElement {
constructor() {
if (
(super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, r, void 0),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
}
static get observedAttributes() {
return [tX.MEDIA_CONTROLLER, t0.MEDIA_PAUSED];
}
attributeChangedCallback(e, t, i) {
var a, n, o, s, l;
e === tX.MEDIA_CONTROLLER &&
(t &&
(null ==
(n = null == (a = iz(this, r)) ? void 0 : a.unassociateElement) ||
n.call(a, this),
iG(this, r, null)),
i &&
this.isConnected &&
(iG(
this,
r,
null == (o = this.getRootNode()) ? void 0 : o.getElementById(i),
),
null ==
(l = null == (s = iz(this, r)) ? void 0 : s.associateElement) ||
l.call(s, this)));
}
connectedCallback() {
var e, t, i, a;
let n;
(this.tabIndex = -1),
this.setAttribute("aria-hidden", "true"),
iG(
this,
r,
((i = this),
(n = i.getAttribute(tX.MEDIA_CONTROLLER))
? null == (a = i.getRootNode())
? void 0
: a.getElementById(n)
: iN(i, "media-controller")),
),
this.getAttribute(tX.MEDIA_CONTROLLER) &&
(null ==
(t = null == (e = iz(this, r)) ? void 0 : e.associateElement) ||
t.call(e, this)),
iz(this, r) &&
(iz(this, r).addEventListener("pointerdown", this),
iz(this, r).addEventListener("click", this),
iz(this, r).hasAttribute("tabindex") || (iz(this, r).tabIndex = 0));
}
disconnectedCallback() {
var e, t, i, a;
this.getAttribute(tX.MEDIA_CONTROLLER) &&
(null ==
(t = null == (e = iz(this, r)) ? void 0 : e.unassociateElement) ||
t.call(e, this)),
null == (i = iz(this, r)) ||
i.removeEventListener("pointerdown", this),
null == (a = iz(this, r)) || a.removeEventListener("click", this),
iG(this, r, null);
}
handleEvent(e) {
var t;
let i = null == (t = e.composedPath()) ? void 0 : t[0];
if (
["video", "media-controller"].includes(
null == i ? void 0 : i.localName,
)
) {
if ("pointerdown" === e.type) this._pointerType = e.pointerType;
else if ("click" === e.type) {
let { clientX: t, clientY: i } = e,
{
left: a,
top: r,
width: n,
height: o,
} = this.getBoundingClientRect(),
s = t - a,
l = i - r;
if (s < 0 || l < 0 || s > n || l > o || (0 === n && 0 === o))
return;
let d = this._pointerType || "mouse";
if (((this._pointerType = void 0), d === t8.TOUCH))
return void this.handleTap(e);
if (d === t8.MOUSE || d === t8.PEN)
return void this.handleMouseClick(e);
}
}
}
get mediaPaused() {
return iV(this, t0.MEDIA_PAUSED);
}
set mediaPaused(e) {
iW(this, t0.MEDIA_PAUSED, e);
}
handleTap(e) {}
handleMouseClick(e) {
let t = this.mediaPaused
? tY.MEDIA_PLAY_REQUEST
: tY.MEDIA_PAUSE_REQUEST;
this.dispatchEvent(
new iA.CustomEvent(t, { composed: !0, bubbles: !0 }),
);
}
}
(r = new WeakMap()),
(iq.shadowRootOptions = { mode: "open" }),
(iq.getTemplateHTML = function (e) {
return `
<style>
:host {
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
box-sizing: border-box;
}
</style>
`;
}),
iA.customElements.get("media-gesture-receiver") ||
iA.customElements.define("media-gesture-receiver", iq);
var iQ = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
iK = (e, t, i) => (
iQ(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
iY = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
iX = (e, t, i, a) => (
iQ(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
iZ = (e, t, i) => (iQ(e, t, "access private method"), i);
let iJ = "audio",
i0 = "autohide",
i1 = "breakpoints",
i2 = "gesturesdisabled",
i3 = "keyboardcontrol",
i5 = "noautohide",
i6 = "userinactive",
i4 = "autohideovercontrols",
i8 = Object.values(t0);
function i7(e, t) {
var i, a, r;
if (!e.isConnected) return;
let n = Object.fromEntries(
(null != (i = e.getAttribute(i1)) ? i : "sm:384 md:576 lg:768 xl:960")
.split(/\s+/)
.map((e) => e.split(":")),
),
o =
((a = n), (r = t), Object.keys(a).filter((e) => r >= parseInt(a[e]))),
s = !1;
if (
(Object.keys(n).forEach((t) => {
if (o.includes(t)) {
e.hasAttribute(`breakpoint${t}`) ||
(e.setAttribute(`breakpoint${t}`, ""), (s = !0));
return;
}
e.hasAttribute(`breakpoint${t}`) &&
(e.removeAttribute(`breakpoint${t}`), (s = !0));
}),
s)
) {
let t = new CustomEvent(t1.BREAKPOINTS_CHANGE, { detail: o });
e.dispatchEvent(t);
}
e.breakpointsComputed ||
((e.breakpointsComputed = !0),
e.dispatchEvent(
new CustomEvent(t1.BREAKPOINTS_COMPUTED, {
bubbles: !0,
composed: !0,
}),
));
}
class i9 extends iA.HTMLElement {
constructor() {
if (
(super(),
iY(this, m),
iY(this, v),
iY(this, g),
iY(this, E),
iY(this, y),
iY(this, n, void 0),
iY(this, o, 0),
iY(this, s, null),
iY(this, l, null),
iY(this, d, void 0),
(this.breakpointsComputed = !1),
iY(this, u, (e) => {
let t = this.media;
for (let i of e)
if ("childList" === i.type) {
for (let e of i.removedNodes) {
if ("media" != e.slot || i.target != this) continue;
let a =
i.previousSibling &&
i.previousSibling.previousElementSibling;
if (a && t) {
let t = "media" !== a.slot;
for (; null !== (a = a.previousSibling); )
"media" == a.slot && (t = !1);
t && this.mediaUnsetCallback(e);
} else this.mediaUnsetCallback(e);
}
if (t)
for (let e of i.addedNodes)
e === t && this.handleMediaUpdated(t);
}
}),
iY(this, c, !1),
iY(this, h, (e) => {
iK(this, c) ||
(setTimeout(() => {
i7(e.target, e.contentRect.width), iX(this, c, !1);
}, 0),
iX(this, c, !0));
}),
iY(this, A, void 0),
iY(this, k, () => {
if (!iK(this, A).assignedElements({ flatten: !0 }).length) {
iK(this, s) && this.mediaUnsetCallback(iK(this, s));
return;
}
this.handleMediaUpdated(this.media);
}),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes),
t = this.constructor.getTemplateHTML(e);
this.shadowRoot.setHTMLUnsafe
? this.shadowRoot.setHTMLUnsafe(t)
: (this.shadowRoot.innerHTML = t);
}
iX(this, n, new MutationObserver(iK(this, u)));
}
static get observedAttributes() {
return [i0, i2]
.concat(i8)
.filter(
(e) =>
![
t0.MEDIA_RENDITION_LIST,
t0.MEDIA_AUDIO_TRACK_LIST,
t0.MEDIA_CHAPTERS_CUES,
t0.MEDIA_WIDTH,
t0.MEDIA_HEIGHT,
t0.MEDIA_ERROR,
t0.MEDIA_ERROR_MESSAGE,
].includes(e),
);
}
attributeChangedCallback(e, t, i) {
e.toLowerCase() == i0 && (this.autohide = i);
}
get media() {
let e = this.querySelector(":scope > [slot=media]");
return (
(null == e ? void 0 : e.nodeName) == "SLOT" &&
(e = e.assignedElements({ flatten: !0 })[0]),
e
);
}
async handleMediaUpdated(e) {
e &&
(iX(this, s, e),
e.localName.includes("-") &&
(await iA.customElements.whenDefined(e.localName)),
this.mediaSetCallback(e));
}
connectedCallback() {
var e;
iK(this, n).observe(this, { childList: !0, subtree: !0 }),
iM(this, iK(this, h));
let t =
null != this.getAttribute(iJ)
? id("audio player")
: id("video player");
this.setAttribute("role", "region"),
this.setAttribute("aria-label", t),
this.handleMediaUpdated(this.media),
this.setAttribute(i6, ""),
i7(this, this.getBoundingClientRect().width);
let i = this.querySelector(":scope > slot[slot=media]");
i &&
(iX(this, A, i),
iK(this, A).addEventListener("slotchange", iK(this, k))),
this.addEventListener("pointerdown", this),
this.addEventListener("pointermove", this),
this.addEventListener("pointerup", this),
this.addEventListener("mouseleave", this),
this.addEventListener("keyup", this),
null == (e = iA.window) || e.addEventListener("mouseup", this);
}
disconnectedCallback() {
var e;
i_(this, iK(this, h)),
clearTimeout(iK(this, l)),
iK(this, n).disconnect(),
this.media && this.mediaUnsetCallback(this.media),
null == (e = iA.window) || e.removeEventListener("mouseup", this),
this.removeEventListener("pointerdown", this),
this.removeEventListener("pointermove", this),
this.removeEventListener("pointerup", this),
this.removeEventListener("mouseleave", this),
this.removeEventListener("keyup", this),
iK(this, A) &&
(iK(this, A).removeEventListener("slotchange", iK(this, k)),
iX(this, A, null)),
iX(this, c, !1);
}
mediaSetCallback(e) {}
mediaUnsetCallback(e) {
iX(this, s, null);
}
handleEvent(e) {
switch (e.type) {
case "pointerdown":
iX(this, o, e.timeStamp);
break;
case "pointermove":
iZ(this, m, p).call(this, e);
break;
case "pointerup":
iZ(this, v, b).call(this, e);
break;
case "mouseleave":
iZ(this, g, f).call(this);
break;
case "mouseup":
this.removeAttribute(i3);
break;
case "keyup":
iZ(this, y, x).call(this), this.setAttribute(i3, "");
}
}
set autohide(e) {
let t = Number(e);
iX(this, d, isNaN(t) ? 0 : t);
}
get autohide() {
return (void 0 === iK(this, d) ? 2 : iK(this, d)).toString();
}
get breakpoints() {
return i$(this, i1);
}
set breakpoints(e) {
iB(this, i1, e);
}
get audio() {
return iV(this, iJ);
}
set audio(e) {
iW(this, iJ, e);
}
get gesturesDisabled() {
return iV(this, i2);
}
set gesturesDisabled(e) {
iW(this, i2, e);
}
get keyboardControl() {
return iV(this, i3);
}
set keyboardControl(e) {
iW(this, i3, e);
}
get noAutohide() {
return iV(this, i5);
}
set noAutohide(e) {
iW(this, i5, e);
}
get autohideOverControls() {
return iV(this, i4);
}
set autohideOverControls(e) {
iW(this, i4, e);
}
get userInteractive() {
return iV(this, i6);
}
set userInteractive(e) {
iW(this, i6, e);
}
}
(n = new WeakMap()),
(o = new WeakMap()),
(s = new WeakMap()),
(l = new WeakMap()),
(d = new WeakMap()),
(u = new WeakMap()),
(c = new WeakMap()),
(h = new WeakMap()),
(m = new WeakSet()),
(p = function (e) {
if ("mouse" !== e.pointerType && e.timeStamp - iK(this, o) < 250)
return;
iZ(this, E, w).call(this), clearTimeout(iK(this, l));
let t = this.hasAttribute(i4);
([this, this.media].includes(e.target) || t) &&
iZ(this, y, x).call(this);
}),
(v = new WeakSet()),
(b = function (e) {
if ("touch" === e.pointerType) {
let t = !this.hasAttribute(i6);
[this, this.media].includes(e.target) && t
? iZ(this, g, f).call(this)
: iZ(this, y, x).call(this);
} else
e
.composedPath()
.some((e) =>
["media-play-button", "media-fullscreen-button"].includes(
null == e ? void 0 : e.localName,
),
) && iZ(this, y, x).call(this);
}),
(g = new WeakSet()),
(f = function () {
if (0 > iK(this, d) || this.hasAttribute(i6)) return;
this.setAttribute(i6, "");
let e = new iA.CustomEvent(t1.USER_INACTIVE_CHANGE, {
composed: !0,
bubbles: !0,
detail: !0,
});
this.dispatchEvent(e);
}),
(E = new WeakSet()),
(w = function () {
if (!this.hasAttribute(i6)) return;
this.removeAttribute(i6);
let e = new iA.CustomEvent(t1.USER_INACTIVE_CHANGE, {
composed: !0,
bubbles: !0,
detail: !1,
});
this.dispatchEvent(e);
}),
(y = new WeakSet()),
(x = function () {
iZ(this, E, w).call(this), clearTimeout(iK(this, l));
let e = parseInt(this.autohide);
e < 0 ||
iX(
this,
l,
setTimeout(() => {
iZ(this, g, f).call(this);
}, 1e3 * e),
);
}),
(A = new WeakMap()),
(k = new WeakMap()),
(i9.shadowRootOptions = { mode: "open" }),
(i9.getTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
outline: none;
}
:host {
box-sizing: border-box;
position: relative;
display: inline-block;
line-height: 0;
background-color: var(--media-background-color, #000);
overflow: hidden;
}
:host(:not([${iJ}])) [part~=layer]:not([part~=media-layer]) {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
display: flex;
flex-flow: column nowrap;
align-items: start;
pointer-events: none;
background: none;
}
slot[name=media] {
display: var(--media-slot-display, contents);
}
:host([${iJ}]) slot[name=media] {
display: var(--media-slot-display, none);
}
:host([${iJ}]) [part~=layer][part~=gesture-layer] {
height: 0;
display: block;
}
:host(:not([${iJ}])[${i2}]) ::slotted([slot=gestures-chrome]),
:host(:not([${iJ}])[${i2}]) media-gesture-receiver[slot=gestures-chrome] {
display: none;
}
::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([role=dialog]):not([hidden])) {
pointer-events: auto;
}
:host(:not([${iJ}])) *[part~=layer][part~=centered-layer] {
align-items: center;
justify-content: center;
}
:host(:not([${iJ}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
:host(:not([${iJ}])) media-gesture-receiver[slot=gestures-chrome] {
align-self: stretch;
flex-grow: 1;
}
slot[name=middle-chrome] {
display: inline;
flex-grow: 1;
pointer-events: none;
background: none;
}
::slotted([slot=media]),
::slotted([slot=poster]) {
width: 100%;
height: 100%;
}
:host(:not([${iJ}])) .spacer {
flex-grow: 1;
}
:host(:-webkit-full-screen) {
width: 100% !important;
height: 100% !important;
}
::slotted(:not([slot=media]):not([slot=poster]):not([${i5}]):not([hidden]):not([role=dialog])) {
opacity: 1;
transition: var(--media-control-transition-in, opacity 0.25s);
}
:host([${i6}]:not([${t0.MEDIA_PAUSED}]):not([${t0.MEDIA_IS_AIRPLAYING}]):not([${t0.MEDIA_IS_CASTING}]):not([${iJ}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${i5}]):not([role=dialog])) {
opacity: 0;
transition: var(--media-control-transition-out, opacity 1s);
}
:host([${i6}]:not([${i5}]):not([${t0.MEDIA_PAUSED}]):not([${t0.MEDIA_IS_CASTING}]):not([${iJ}])) ::slotted([slot=media]) {
cursor: none;
}
:host([${i6}][${i4}]:not([${i5}]):not([${t0.MEDIA_PAUSED}]):not([${t0.MEDIA_IS_CASTING}]):not([${iJ}])) * {
--media-cursor: none;
cursor: none;
}
::slotted(media-control-bar) {
align-self: stretch;
}
:host(:not([${iJ}])[${t0.MEDIA_HAS_PLAYED}]) slot[name=poster] {
display: none;
}
::slotted([role=dialog]) {
width: 100%;
height: 100%;
align-self: center;
}
::slotted([role=menu]) {
align-self: end;
}
</style>
<slot name="media" part="layer media-layer"></slot>
<slot name="poster" part="layer poster-layer"></slot>
<slot name="gestures-chrome" part="layer gesture-layer">
<media-gesture-receiver slot="gestures-chrome">
<template shadowrootmode="${iq.shadowRootOptions.mode}">
${iq.getTemplateHTML({})}
</template>
</media-gesture-receiver>
</slot>
<span part="layer vertical-layer">
<slot name="top-chrome" part="top chrome"></slot>
<slot name="middle-chrome" part="middle chrome"></slot>
<slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>
<slot part="bottom chrome"></slot>
</span>
<slot name="dialog" part="layer dialog-layer"></slot>
`;
}),
iA.customElements.get("media-container") ||
iA.customElements.define("media-container", i9);
var ae = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
at = (e, t, i) => (
ae(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
ai = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
aa = (e, t, i, a) => (
ae(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class ar {
constructor(e, t, { defaultValue: i } = { defaultValue: void 0 }) {
ai(this, _),
ai(this, I, void 0),
ai(this, C, void 0),
ai(this, T, void 0),
ai(this, M, new Set()),
aa(this, I, e),
aa(this, C, t),
aa(this, T, new Set(i));
}
[Symbol.iterator]() {
return at(this, _, S).values();
}
get length() {
return at(this, _, S).size;
}
get value() {
var e;
return null != (e = [...at(this, _, S)].join(" ")) ? e : "";
}
set value(e) {
var t;
e !== this.value &&
(aa(this, M, new Set()),
this.add(
...(null != (t = null == e ? void 0 : e.split(" ")) ? t : []),
));
}
toString() {
return this.value;
}
item(e) {
return [...at(this, _, S)][e];
}
values() {
return at(this, _, S).values();
}
forEach(e, t) {
at(this, _, S).forEach(e, t);
}
add(...e) {
var t, i;
e.forEach((e) => at(this, M).add(e)),
("" !== this.value ||
(null == (t = at(this, I))
? void 0
: t.hasAttribute(`${at(this, C)}`))) &&
(null == (i = at(this, I)) ||
i.setAttribute(`${at(this, C)}`, `${this.value}`));
}
remove(...e) {
var t;
e.forEach((e) => at(this, M).delete(e)),
null == (t = at(this, I)) ||
t.setAttribute(`${at(this, C)}`, `${this.value}`);
}
contains(e) {
return at(this, _, S).has(e);
}
toggle(e, t) {
if (void 0 !== t)
if (t) return this.add(e), !0;
else return this.remove(e), !1;
return this.contains(e) ? (this.remove(e), !1) : (this.add(e), !0);
}
replace(e, t) {
return this.remove(e), this.add(t), e === t;
}
}
(I = new WeakMap()),
(C = new WeakMap()),
(T = new WeakMap()),
(M = new WeakMap()),
(_ = new WeakSet()),
(S = function () {
return at(this, M).size ? at(this, M) : at(this, T);
});
let an = (e = "") => {
let [t, i, a] = e.split(":"),
r = a ? decodeURIComponent(a) : void 0;
return {
kind: "cc" === t ? t5.CAPTIONS : t5.SUBTITLES,
language: i,
label: r,
};
},
ao = (e = "", t = {}) =>
((e = "") => e.split(/\s+/))(e).map((e) => {
let i = an(e);
return { ...t, ...i };
}),
as = (e) =>
e
? Array.isArray(e)
? e.map((e) => ("string" == typeof e ? an(e) : e))
: "string" == typeof e
? ao(e)
: [e]
: [],
al = ({ kind: e, label: t, language: i } = { kind: "subtitles" }) =>
t
? `${"captions" === e ? "cc" : "sb"}:${i}:${encodeURIComponent(t)}`
: i,
ad = (e = []) => Array.prototype.map.call(e, al).join(" "),
au = (e) => {
let t = Object.entries(e).map(
([e, t]) =>
(i) =>
i[e] === t,
);
return (e) => t.every((t) => t(e));
},
ac = (e, t = [], i = []) => {
let a = as(i).map(au);
Array.from(t)
.filter((e) => a.some((t) => t(e)))
.forEach((t) => {
t.mode = e;
});
},
ah = (e, t = () => !0) => {
if (!(null == e ? void 0 : e.textTracks)) return [];
let i = "function" == typeof t ? t : au(t);
return Array.from(e.textTracks).filter(i);
},
am =
"exitFullscreen" in ik
? "exitFullscreen"
: "webkitExitFullscreen" in ik
? "webkitExitFullscreen"
: "webkitCancelFullScreen" in ik
? "webkitCancelFullScreen"
: void 0,
ap =
"fullscreenElement" in ik
? "fullscreenElement"
: "webkitFullscreenElement" in ik
? "webkitFullscreenElement"
: void 0,
av =
"fullscreenEnabled" in ik
? "fullscreenEnabled"
: "webkitFullscreenEnabled" in ik
? "webkitFullscreenEnabled"
: void 0,
ab = () => {
var e;
return (
t ||
(t =
null == (e = null == ik ? void 0 : ik.createElement)
? void 0
: e.call(ik, "video"))
);
},
ag = async (e = ab()) => {
if (!e) return !1;
let t = e.volume;
e.volume = t / 2 + 0.1;
let i = new AbortController(),
a = await Promise.race([af(e, i.signal), aE(e, t)]);
return i.abort(), a;
},
af = (e, t) =>
new Promise((i) => {
e.addEventListener("volumechange", () => i(!0), { signal: t });
}),
aE = async (e, t) => {
for (let i = 0; i < 10; i++) {
if (e.volume === t) return !1;
await io(10);
}
return e.volume !== t;
},
aw = /.*Version\/.*Safari\/.*/.test(iA.navigator.userAgent),
ay = (e = ab()) =>
(!iA.matchMedia("(display-mode: standalone)").matches || !aw) &&
"function" == typeof (null == e ? void 0 : e.requestPictureInPicture),
ax = (e = ab()) =>
((e) => {
let { documentElement: t, media: i } = e;
return (
!!(null == t ? void 0 : t[av]) ||
(i && "webkitSupportsFullscreen" in i)
);
})({ documentElement: ik, media: e }),
aA = ax(),
ak = ay(),
aI = !!iA.WebKitPlaybackTargetAvailabilityEvent,
aC = !!iA.chrome,
aT = (e) =>
ah(e.media, (e) => [t5.SUBTITLES, t5.CAPTIONS].includes(e.kind)).sort(
(e, t) => (e.kind >= t.kind ? 1 : -1),
),
aM = (e) =>
ah(
e.media,
(e) =>
e.mode === t6.SHOWING &&
[t5.SUBTITLES, t5.CAPTIONS].includes(e.kind),
),
a_ = (e, t) => {
let i = aT(e),
a = aM(e),
r = !!a.length;
if (i.length) {
if (!1 === t || (r && !0 !== t)) ac(t6.DISABLED, i, a);
else if (!0 === t || (!r && !1 !== t)) {
let t = i[0],
{ options: r } = e;
if (!(null == r ? void 0 : r.noSubtitlesLangPref)) {
let e = iA.localStorage.getItem(
"media-chrome-pref-subtitles-lang",
),
a = e ? [e, ...iA.navigator.languages] : iA.navigator.languages,
r = i
.filter((e) =>
a.some((t) =>
e.language.toLowerCase().startsWith(t.split("-")[0]),
),
)
.sort(
(e, t) =>
a.findIndex((t) =>
e.language.toLowerCase().startsWith(t.split("-")[0]),
) -
a.findIndex((e) =>
t.language.toLowerCase().startsWith(e.split("-")[0]),
),
);
r[0] && (t = r[0]);
}
let { language: n, label: o, kind: s } = t;
ac(t6.DISABLED, i, a),
ac(t6.SHOWING, i, [{ language: n, label: o, kind: s }]);
}
}
},
aS = (e, t) =>
e === t ||
(null != e &&
null != t &&
typeof e == typeof t &&
(!!("number" == typeof e && Number.isNaN(e) && Number.isNaN(t)) ||
("object" == typeof e &&
(Array.isArray(e)
? aL(e, t)
: Object.entries(e).every(
([e, i]) => e in t && aS(i, t[e]),
))))),
aL = (e, t) => {
let i = Array.isArray(e),
a = Array.isArray(t);
return (
i === a &&
((!i && !a) ||
(e.length === t.length && e.every((e, i) => aS(e, t[i]))))
);
},
aR = Object.values(t9),
aD = ag().then((e) => (i = e)),
aN = async (...e) => {
await Promise.all(
e
.filter((e) => e)
.map(async (e) => {
if (!("localName" in e && e instanceof iA.HTMLElement)) return;
let t = e.localName;
if (!t.includes("-")) return;
let i = iA.customElements.get(t);
(i && e instanceof i) ||
(await iA.customElements.whenDefined(t),
iA.customElements.upgrade(e));
}),
);
},
aP = new iA.DOMParser(),
aj = {
mediaError: {
get(e, t) {
let { media: i } = e;
if ((null == t ? void 0 : t.type) !== "playing")
return null == i ? void 0 : i.error;
},
mediaEvents: ["emptied", "error", "playing"],
},
mediaErrorCode: {
get(e, t) {
var i;
let { media: a } = e;
if ((null == t ? void 0 : t.type) !== "playing")
return null == (i = null == a ? void 0 : a.error)
? void 0
: i.code;
},
mediaEvents: ["emptied", "error", "playing"],
},
mediaErrorMessage: {
get(e, t) {
var i, a;
let { media: r } = e;
if ((null == t ? void 0 : t.type) !== "playing")
return null !=
(a =
null == (i = null == r ? void 0 : r.error)
? void 0
: i.message)
? a
: "";
},
mediaEvents: ["emptied", "error", "playing"],
},
mediaWidth: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.videoWidth) ? t : 0;
},
mediaEvents: ["resize"],
},
mediaHeight: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.videoHeight) ? t : 0;
},
mediaEvents: ["resize"],
},
mediaPaused: {
get(e) {
var t;
let { media: i } = e;
return null == (t = null == i ? void 0 : i.paused) || t;
},
set(e, t) {
var i;
let { media: a } = t;
a && (e ? a.pause() : null == (i = a.play()) || i.catch(() => {}));
},
mediaEvents: ["play", "playing", "pause", "emptied"],
},
mediaHasPlayed: {
get(e, t) {
let { media: i } = e;
return !!i && (t ? "playing" === t.type : !i.paused);
},
mediaEvents: ["playing", "emptied"],
},
mediaEnded: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.ended) && t;
},
mediaEvents: ["seeked", "ended", "emptied"],
},
mediaPlaybackRate: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.playbackRate) ? t : 1;
},
set(e, t) {
let { media: i } = t;
!i || (Number.isFinite(+e) && (i.playbackRate = +e));
},
mediaEvents: ["ratechange", "loadstart"],
},
mediaMuted: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.muted) && t;
},
set(e, t) {
let { media: i, options: { noMutedPref: a } = {} } = t;
if (i) {
i.muted = e;
try {
let t =
null !== iA.localStorage.getItem("media-chrome-pref-muted"),
r = i.hasAttribute("muted");
if (a) {
t && iA.localStorage.removeItem("media-chrome-pref-muted");
return;
}
if (r && !t) return;
iA.localStorage.setItem(
"media-chrome-pref-muted",
e ? "true" : "false",
);
} catch (e) {
console.debug("Error setting muted pref", e);
}
}
},
mediaEvents: ["volumechange"],
stateOwnersUpdateHandlers: [
(e, t) => {
let {
options: { noMutedPref: i },
} = t,
{ media: a } = t;
if (a && !a.muted && !i)
try {
let i =
"true" ===
iA.localStorage.getItem("media-chrome-pref-muted");
aj.mediaMuted.set(i, t), e(i);
} catch (e) {
console.debug("Error getting muted pref", e);
}
},
],
},
mediaLoop: {
get(e) {
let { media: t } = e;
return null == t ? void 0 : t.loop;
},
set(e, t) {
let { media: i } = t;
i && (i.loop = e);
},
mediaEvents: ["medialooprequest"],
},
mediaVolume: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.volume) ? t : 1;
},
set(e, t) {
let { media: i, options: { noVolumePref: a } = {} } = t;
if (i) {
try {
null == e
? iA.localStorage.removeItem("media-chrome-pref-volume")
: i.hasAttribute("muted") ||
a ||
iA.localStorage.setItem(
"media-chrome-pref-volume",
e.toString(),
);
} catch (e) {
console.debug("Error setting volume pref", e);
}
Number.isFinite(+e) && (i.volume = +e);
}
},
mediaEvents: ["volumechange"],
stateOwnersUpdateHandlers: [
(e, t) => {
let {
options: { noVolumePref: i },
} = t;
if (!i)
try {
let { media: i } = t;
if (!i) return;
let a = iA.localStorage.getItem("media-chrome-pref-volume");
if (null == a) return;
aj.mediaVolume.set(+a, t), e(+a);
} catch (e) {
console.debug("Error getting volume pref", e);
}
},
],
},
mediaVolumeLevel: {
get(e) {
let { media: t } = e;
return void 0 === (null == t ? void 0 : t.volume)
? "high"
: t.muted || 0 === t.volume
? "off"
: t.volume < 0.5
? "low"
: t.volume < 0.75
? "medium"
: "high";
},
mediaEvents: ["volumechange"],
},
mediaCurrentTime: {
get(e) {
var t;
let { media: i } = e;
return null != (t = null == i ? void 0 : i.currentTime) ? t : 0;
},
set(e, t) {
let { media: i } = t;
i && ir(e) && (i.currentTime = e);
},
mediaEvents: ["timeupdate", "loadedmetadata"],
},
mediaDuration: {
get(e) {
let { media: t, options: { defaultDuration: i } = {} } = e;
return i &&
(!t ||
!t.duration ||
Number.isNaN(t.duration) ||
!Number.isFinite(t.duration))
? i
: Number.isFinite(null == t ? void 0 : t.duration)
? t.duration
: NaN;
},
mediaEvents: ["durationchange", "loadedmetadata", "emptied"],
},
mediaLoading: {
get(e) {
let { media: t } = e;
return (null == t ? void 0 : t.readyState) < 3;
},
mediaEvents: ["waiting", "playing", "emptied"],
},
mediaSeekable: {
get(e) {
var t;
let { media: i } = e;
if (
!(null == (t = null == i ? void 0 : i.seekable)
? void 0
: t.length)
)
return;
let a = i.seekable.start(0),
r = i.seekable.end(i.seekable.length - 1);
if (a || r) return [Number(a.toFixed(3)), Number(r.toFixed(3))];
},
mediaEvents: [
"loadedmetadata",
"emptied",
"progress",
"seekablechange",
],
},
mediaBuffered: {
get(e) {
var t;
let { media: i } = e,
a = null != (t = null == i ? void 0 : i.buffered) ? t : [];
return Array.from(a).map((e, t) => [
Number(a.start(t).toFixed(3)),
Number(a.end(t).toFixed(3)),
]);
},
mediaEvents: ["progress", "emptied"],
},
mediaStreamType: {
get(e) {
let { media: t, options: { defaultStreamType: i } = {} } = e,
a = [t9.LIVE, t9.ON_DEMAND].includes(i) ? i : void 0;
if (!t) return a;
let { streamType: r } = t;
if (aR.includes(r)) return r === t9.UNKNOWN ? a : r;
let n = t.duration;
return n === 1 / 0
? t9.LIVE
: Number.isFinite(n)
? t9.ON_DEMAND
: a;
},
mediaEvents: [
"emptied",
"durationchange",
"loadedmetadata",
"streamtypechange",
],
},
mediaTargetLiveWindow: {
get(e) {
let { media: t } = e;
if (!t) return NaN;
let { targetLiveWindow: i } = t,
a = aj.mediaStreamType.get(e);
return (null == i || Number.isNaN(i)) && a === t9.LIVE ? 0 : i;
},
mediaEvents: [
"emptied",
"durationchange",
"loadedmetadata",
"streamtypechange",
"targetlivewindowchange",
],
},
mediaTimeIsLive: {
get(e) {
let { media: t, options: { liveEdgeOffset: i = 10 } = {} } = e;
if (!t) return !1;
if ("number" == typeof t.liveEdgeStart)
return (
!Number.isNaN(t.liveEdgeStart) &&
t.currentTime >= t.liveEdgeStart
);
if (aj.mediaStreamType.get(e) !== t9.LIVE) return !1;
let a = t.seekable;
if (!a) return !0;
if (!a.length) return !1;
let r = a.end(a.length - 1) - i;
return t.currentTime >= r;
},
mediaEvents: [
"playing",
"timeupdate",
"progress",
"waiting",
"emptied",
],
},
mediaSubtitlesList: {
get: (e) =>
aT(e).map(({ kind: e, label: t, language: i }) => ({
kind: e,
label: t,
language: i,
})),
mediaEvents: ["loadstart"],
textTracksEvents: ["addtrack", "removetrack"],
},
mediaSubtitlesShowing: {
get: (e) =>
aM(e).map(({ kind: e, label: t, language: i }) => ({
kind: e,
label: t,
language: i,
})),
mediaEvents: ["loadstart"],
textTracksEvents: ["addtrack", "removetrack", "change"],
stateOwnersUpdateHandlers: [
(e, t) => {
var i, a;
let { media: r, options: n } = t;
if (!r) return;
let o = (e) => {
var i;
n.defaultSubtitles &&
((e &&
![t5.CAPTIONS, t5.SUBTITLES].includes(
null == (i = null == e ? void 0 : e.track)
? void 0
: i.kind,
)) ||
a_(t, !0));
};
return (
r.addEventListener("loadstart", o),
null == (i = r.textTracks) || i.addEventListener("addtrack", o),
null == (a = r.textTracks) ||
a.addEventListener("removetrack", o),
() => {
var e, t;
r.removeEventListener("loadstart", o),
null == (e = r.textTracks) ||
e.removeEventListener("addtrack", o),
null == (t = r.textTracks) ||
t.removeEventListener("removetrack", o);
}
);
},
],
},
mediaChaptersCues: {
get(e) {
var t;
let { media: i } = e;
if (!i) return [];
let [a] = ah(i, { kind: t5.CHAPTERS });
return Array.from(
null != (t = null == a ? void 0 : a.cues) ? t : [],
).map(({ text: e, startTime: t, endTime: i }) => ({
text:
(e && aP.parseFromString(e, "text/html").body.textContent) || e,
startTime: t,
endTime: i,
}));
},
mediaEvents: ["loadstart", "loadedmetadata"],
textTracksEvents: ["addtrack", "removetrack", "change"],
stateOwnersUpdateHandlers: [
(e, t) => {
var i;
let { media: a } = t;
if (!a) return;
let r = a.querySelector('track[kind="chapters"][default][src]'),
n =
null == (i = a.shadowRoot)
? void 0
: i.querySelector(
':is(video,audio) > track[kind="chapters"][default][src]',
);
return (
null == r || r.addEventListener("load", e),
null == n || n.addEventListener("load", e),
() => {
null == r || r.removeEventListener("load", e),
null == n || n.removeEventListener("load", e);
}
);
},
],
},
mediaIsPip: {
get(e) {
var t, i;
let { media: a, documentElement: r } = e;
if (!a || !r || !r.pictureInPictureElement) return !1;
if (r.pictureInPictureElement === a) return !0;
if (r.pictureInPictureElement instanceof HTMLMediaElement)
return (
!!(null == (t = a.localName) ? void 0 : t.includes("-")) &&
iD(a, r.pictureInPictureElement)
);
if (r.pictureInPictureElement.localName.includes("-")) {
let e = r.pictureInPictureElement.shadowRoot;
for (; null == e ? void 0 : e.pictureInPictureElement; ) {
if (e.pictureInPictureElement === a) return !0;
e =
null == (i = e.pictureInPictureElement)
? void 0
: i.shadowRoot;
}
}
return !1;
},
set(e, t) {
let { media: i } = t;
if (i)
if (e) {
if (!ik.pictureInPictureEnabled)
return void console.warn(
"MediaChrome: Picture-in-picture is not enabled",
);
if (!i.requestPictureInPicture)
return void console.warn(
"MediaChrome: The current media does not support picture-in-picture",
);
let e = () => {
console.warn(
"MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.",
);
};
i.requestPictureInPicture().catch((t) => {
if (11 === t.code) {
if (!i.src)
return void console.warn(
"MediaChrome: The media is not ready for picture-in-picture. It must have a src set.",
);
if (0 === i.readyState && "none" === i.preload) {
let t = () => {
i.removeEventListener("loadedmetadata", a),
(i.preload = "none");
},
a = () => {
i.requestPictureInPicture().catch(e), t();
};
i.addEventListener("loadedmetadata", a),
(i.preload = "metadata"),
setTimeout(() => {
0 === i.readyState && e(), t();
}, 1e3);
} else throw t;
} else throw t;
});
} else ik.pictureInPictureElement && ik.exitPictureInPicture();
},
mediaEvents: ["enterpictureinpicture", "leavepictureinpicture"],
},
mediaRenditionList: {
get(e) {
var t;
let { media: i } = e;
return [
...(null != (t = null == i ? void 0 : i.videoRenditions)
? t
: []),
].map((e) => ({ ...e }));
},
mediaEvents: ["emptied", "loadstart"],
videoRenditionsEvents: ["addrendition", "removerendition"],
},
mediaRenditionSelected: {
get(e) {
var t, i, a;
let { media: r } = e;
return null ==
(a =
null == (i = null == r ? void 0 : r.videoRenditions)
? void 0
: i[
null == (t = r.videoRenditions) ? void 0 : t.selectedIndex
])
? void 0
: a.id;
},
set(e, t) {
let { media: i } = t;
if (!(null == i ? void 0 : i.videoRenditions))
return void console.warn(
"MediaController: Rendition selection not supported by this media.",
);
let a = Array.prototype.findIndex.call(
i.videoRenditions,
(t) => t.id == e,
);
i.videoRenditions.selectedIndex != a &&
(i.videoRenditions.selectedIndex = a);
},
mediaEvents: ["emptied"],
videoRenditionsEvents: ["addrendition", "removerendition", "change"],
},
mediaAudioTrackList: {
get(e) {
var t;
let { media: i } = e;
return [
...(null != (t = null == i ? void 0 : i.audioTracks) ? t : []),
];
},
mediaEvents: ["emptied", "loadstart"],
audioTracksEvents: ["addtrack", "removetrack"],
},
mediaAudioTrackEnabled: {
get(e) {
var t, i;
let { media: a } = e;
return null ==
(i = [
...(null != (t = null == a ? void 0 : a.audioTracks) ? t : []),
].find((e) => e.enabled))
? void 0
: i.id;
},
set(e, t) {
let { media: i } = t;
if (!(null == i ? void 0 : i.audioTracks))
return void console.warn(
"MediaChrome: Audio track selection not supported by this media.",
);
for (let t of i.audioTracks) t.enabled = e == t.id;
},
mediaEvents: ["emptied"],
audioTracksEvents: ["addtrack", "removetrack", "change"],
},
mediaIsFullscreen: {
get: (e) =>
((e) => {
var t;
let {
media: i,
documentElement: a,
fullscreenElement: r = i,
} = e;
if (!i || !a) return !1;
let n = ((e) => {
let { documentElement: t, media: i } = e,
a = null == t ? void 0 : t[ap];
return !a &&
"webkitDisplayingFullscreen" in i &&
"webkitPresentationMode" in i &&
i.webkitDisplayingFullscreen &&
i.webkitPresentationMode === it.FULLSCREEN
? i
: a;
})(e);
if (!n) return !1;
if (n === r || n === i) return !0;
if (n.localName.includes("-")) {
let e = n.shadowRoot;
if (!(ap in e)) return iD(n, r);
for (; null == e ? void 0 : e[ap]; ) {
if (e[ap] === r) return !0;
e = null == (t = e[ap]) ? void 0 : t.shadowRoot;
}
}
return !1;
})(e),
set(e, t, i) {
var a, r;
e
? (((e) => {
var t;
let { media: i, fullscreenElement: a } = e;
try {
let e =
a && "requestFullscreen" in a
? "requestFullscreen"
: a && "webkitRequestFullScreen" in a
? "webkitRequestFullScreen"
: void 0;
if (e) {
let i = null == (t = a[e]) ? void 0 : t.call(a);
if (i instanceof Promise) return i.catch(() => {});
} else
(null == i ? void 0 : i.webkitEnterFullscreen)
? i.webkitEnterFullscreen()
: (null == i ? void 0 : i.requestFullscreen) &&
i.requestFullscreen();
} catch (e) {
console.error(e);
}
})(t),
!i.detail ||
(null == (a = t.media) ? void 0 : a.inert) ||
null == (r = t.media) ||
r.focus())
: ((e) => {
var t;
let { documentElement: i } = e;
if (am) {
let e =
null == (t = null == i ? void 0 : i[am])
? void 0
: t.call(i);
if (e instanceof Promise) return e.catch(() => {});
}
})(t);
},
rootEvents: ["fullscreenchange", "webkitfullscreenchange"],
mediaEvents: [
"webkitbeginfullscreen",
"webkitendfullscreen",
"webkitpresentationmodechanged",
],
},
mediaIsCasting: {
get(e) {
var t;
let { media: i } = e;
return (
!!(null == i ? void 0 : i.remote) &&
(null == (t = i.remote) ? void 0 : t.state) !== "disconnected" &&
!!i.remote.state
);
},
set(e, t) {
var i, a;
let { media: r } = t;
if (
r &&
(!e ||
(null == (i = r.remote) ? void 0 : i.state) ===
"disconnected") &&
(e || (null == (a = r.remote) ? void 0 : a.state) === "connected")
) {
if ("function" != typeof r.remote.prompt)
return void console.warn(
"MediaChrome: Casting is not supported in this environment",
);
r.remote.prompt().catch(() => {});
}
},
remoteEvents: ["connect", "connecting", "disconnect"],
},
mediaIsAirplaying: {
get: () => !1,
set(e, t) {
let { media: i } = t;
if (i) {
if (
!(
i.webkitShowPlaybackTargetPicker &&
iA.WebKitPlaybackTargetAvailabilityEvent
)
)
return void console.error(
"MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment",
);
i.webkitShowPlaybackTargetPicker();
}
},
mediaEvents: ["webkitcurrentplaybacktargetiswirelesschanged"],
},
mediaFullscreenUnavailable: {
get(e) {
let { media: t } = e;
if (!aA || !ax(t)) return t7.UNSUPPORTED;
},
},
mediaPipUnavailable: {
get(e) {
let { media: t } = e;
return ak && ay(t)
? (null == t ? void 0 : t.disablePictureInPicture)
? t7.UNAVAILABLE
: void 0
: t7.UNSUPPORTED;
},
},
mediaVolumeUnavailable: {
get(e) {
let { media: t } = e;
if (!1 === i || (null == t ? void 0 : t.volume) == void 0)
return t7.UNSUPPORTED;
},
stateOwnersUpdateHandlers: [
(e) => {
null == i && aD.then((t) => e(t ? void 0 : t7.UNSUPPORTED));
},
],
},
mediaCastUnavailable: {
get(e, { availability: t = "not-available" } = {}) {
var i;
let { media: a } = e;
return aC &&
(null == (i = null == a ? void 0 : a.remote) ? void 0 : i.state)
? null != t && "available" !== t
? t7.UNAVAILABLE
: void 0
: t7.UNSUPPORTED;
},
stateOwnersUpdateHandlers: [
(e, t) => {
var i;
let { media: a } = t;
if (a)
return (
a.disableRemotePlayback ||
a.hasAttribute("disableremoteplayback") ||
null == (i = null == a ? void 0 : a.remote) ||
i
.watchAvailability((t) => {
e({ availability: t ? "available" : "not-available" });
})
.catch((t) => {
"NotSupportedError" === t.name
? e({ availability: null })
: e({ availability: "not-available" });
}),
() => {
var e;
null == (e = null == a ? void 0 : a.remote) ||
e.cancelWatchAvailability().catch(() => {});
}
);
},
],
},
mediaAirplayUnavailable: {
get: (e, t) =>
aI
? (null == t ? void 0 : t.availability) === "not-available"
? t7.UNAVAILABLE
: void 0
: t7.UNSUPPORTED,
mediaEvents: ["webkitplaybacktargetavailabilitychanged"],
stateOwnersUpdateHandlers: [
(e, t) => {
var i;
let { media: a } = t;
if (a)
return (
a.disableRemotePlayback ||
a.hasAttribute("disableremoteplayback") ||
null == (i = null == a ? void 0 : a.remote) ||
i
.watchAvailability((t) => {
e({ availability: t ? "available" : "not-available" });
})
.catch((t) => {
"NotSupportedError" === t.name
? e({ availability: null })
: e({ availability: "not-available" });
}),
() => {
var e;
null == (e = null == a ? void 0 : a.remote) ||
e.cancelWatchAvailability().catch(() => {});
}
);
},
],
},
mediaRenditionUnavailable: {
get(e) {
var t;
let { media: i } = e;
return (null == i ? void 0 : i.videoRenditions)
? (null == (t = i.videoRenditions) ? void 0 : t.length)
? void 0
: t7.UNAVAILABLE
: t7.UNSUPPORTED;
},
mediaEvents: ["emptied", "loadstart"],
videoRenditionsEvents: ["addrendition", "removerendition"],
},
mediaAudioTrackUnavailable: {
get(e) {
var t, i;
let { media: a } = e;
return (null == a ? void 0 : a.audioTracks)
? (null != (i = null == (t = a.audioTracks) ? void 0 : t.length)
? i
: 0) <= 1
? t7.UNAVAILABLE
: void 0
: t7.UNSUPPORTED;
},
mediaEvents: ["emptied", "loadstart"],
audioTracksEvents: ["addtrack", "removetrack"],
},
mediaLang: {
get(e) {
let { options: { mediaLang: t } = {} } = e;
return null != t ? t : "en";
},
},
},
aO = {
[tY.MEDIA_PREVIEW_REQUEST](e, t, { detail: i }) {
var a, r, n;
let o,
s,
{ media: l } = t,
d = null != i ? i : void 0;
if (l && null != d) {
let [e] = ah(l, { kind: t5.METADATA, label: "thumbnails" }),
t = Array.prototype.find.call(
null != (a = null == e ? void 0 : e.cues) ? a : [],
(e, t, i) =>
0 === t
? e.endTime > d
: t === i.length - 1
? e.startTime <= d
: e.startTime <= d && e.endTime > d,
);
if (t) {
let e =
/'^(?:[a-z]+:)?\/\//i.test(t.text) ||
null ==
(r =
null == l
? void 0
: l.querySelector('track[label="thumbnails"]'))
? void 0
: r.src,
i = new URL(t.text, e);
(s = new URLSearchParams(i.hash)
.get("#xywh")
.split(",")
.map((e) => +e)),
(o = i.href);
}
}
let u = e.mediaDuration.get(t),
c =
null ==
(n = e.mediaChaptersCues
.get(t)
.find((e, t, i) =>
t === i.length - 1 && u === e.endTime
? e.startTime <= d && e.endTime >= d
: e.startTime <= d && e.endTime > d,
))
? void 0
: n.text;
return (
null != i && null == c && (c = ""),
{
mediaPreviewTime: d,
mediaPreviewImage: o,
mediaPreviewCoords: s,
mediaPreviewChapter: c,
}
);
},
[tY.MEDIA_PAUSE_REQUEST](e, t) {
e.mediaPaused.set(!0, t);
},
[tY.MEDIA_PLAY_REQUEST](e, t) {
var i, a, r, n;
let o = e.mediaStreamType.get(t) === t9.LIVE,
s = !(null == (i = t.options) ? void 0 : i.noAutoSeekToLive),
l = e.mediaTargetLiveWindow.get(t) > 0;
if (o && s && !l) {
let i = null == (a = e.mediaSeekable.get(t)) ? void 0 : a[1];
if (i) {
let a =
null !=
(n = null == (r = t.options) ? void 0 : r.seekToLiveOffset)
? n
: 0;
e.mediaCurrentTime.set(i - a, t);
}
}
e.mediaPaused.set(!1, t);
},
[tY.MEDIA_PLAYBACK_RATE_REQUEST](e, t, { detail: i }) {
e.mediaPlaybackRate.set(i, t);
},
[tY.MEDIA_MUTE_REQUEST](e, t) {
e.mediaMuted.set(!0, t);
},
[tY.MEDIA_UNMUTE_REQUEST](e, t) {
e.mediaVolume.get(t) || e.mediaVolume.set(0.25, t),
e.mediaMuted.set(!1, t);
},
[tY.MEDIA_LOOP_REQUEST](e, t, { detail: i }) {
let a = !!i;
return e.mediaLoop.set(a, t), { mediaLoop: a };
},
[tY.MEDIA_VOLUME_REQUEST](e, t, { detail: i }) {
i && e.mediaMuted.get(t) && e.mediaMuted.set(!1, t),
e.mediaVolume.set(i, t);
},
[tY.MEDIA_SEEK_REQUEST](e, t, { detail: i }) {
e.mediaCurrentTime.set(i, t);
},
[tY.MEDIA_SEEK_TO_LIVE_REQUEST](e, t) {
var i, a, r;
let n = null == (i = e.mediaSeekable.get(t)) ? void 0 : i[1];
if (Number.isNaN(Number(n))) return;
let o =
null != (r = null == (a = t.options) ? void 0 : a.seekToLiveOffset)
? r
: 0;
e.mediaCurrentTime.set(n - o, t);
},
[tY.MEDIA_SHOW_SUBTITLES_REQUEST](e, t, { detail: i }) {
var a;
let { options: r } = t,
n = aT(t),
o = as(i),
s = null == (a = o[0]) ? void 0 : a.language;
s &&
!r.noSubtitlesLangPref &&
iA.localStorage.setItem("media-chrome-pref-subtitles-lang", s),
ac(t6.SHOWING, n, o);
},
[tY.MEDIA_DISABLE_SUBTITLES_REQUEST](e, t, { detail: i }) {
let a = aT(t);
ac(t6.DISABLED, a, null != i ? i : []);
},
[tY.MEDIA_TOGGLE_SUBTITLES_REQUEST](e, t, { detail: i }) {
a_(t, i);
},
[tY.MEDIA_RENDITION_REQUEST](e, t, { detail: i }) {
e.mediaRenditionSelected.set(i, t);
},
[tY.MEDIA_AUDIO_TRACK_REQUEST](e, t, { detail: i }) {
e.mediaAudioTrackEnabled.set(i, t);
},
[tY.MEDIA_ENTER_PIP_REQUEST](e, t) {
e.mediaIsFullscreen.get(t) && e.mediaIsFullscreen.set(!1, t),
e.mediaIsPip.set(!0, t);
},
[tY.MEDIA_EXIT_PIP_REQUEST](e, t) {
e.mediaIsPip.set(!1, t);
},
[tY.MEDIA_ENTER_FULLSCREEN_REQUEST](e, t, i) {
e.mediaIsPip.get(t) && e.mediaIsPip.set(!1, t),
e.mediaIsFullscreen.set(!0, t, i);
},
[tY.MEDIA_EXIT_FULLSCREEN_REQUEST](e, t) {
e.mediaIsFullscreen.set(!1, t);
},
[tY.MEDIA_ENTER_CAST_REQUEST](e, t) {
e.mediaIsFullscreen.get(t) && e.mediaIsFullscreen.set(!1, t),
e.mediaIsCasting.set(!0, t);
},
[tY.MEDIA_EXIT_CAST_REQUEST](e, t) {
e.mediaIsCasting.set(!1, t);
},
[tY.MEDIA_AIRPLAY_REQUEST](e, t) {
e.mediaIsAirplaying.set(!0, t);
},
};
var aU = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
aH = (e, t, i) => (
aU(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
aV = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
aW = (e, t, i, a) => (
aU(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
a$ = (e, t, i) => (aU(e, t, "access private method"), i);
let aB = [
"ArrowLeft",
"ArrowRight",
"ArrowUp",
"ArrowDown",
"Enter",
" ",
"f",
"m",
"k",
"c",
"l",
"j",
">",
"<",
"p",
],
aF = "defaultsubtitles",
az = "defaultstreamtype",
aG = "defaultduration",
aq = "fullscreenelement",
aQ = "hotkeys",
aK = "keyboardbackwardseekoffset",
aY = "keyboardforwardseekoffset",
aX = "keyboarddownvolumestep",
aZ = "keyboardupvolumestep",
aJ = "keysused",
a0 = "lang",
a1 = "loop",
a2 = "liveedgeoffset",
a3 = "noautoseektolive",
a5 = "nodefaultstore",
a6 = "nohotkeys",
a4 = "nomutedpref",
a8 = "nosubtitleslangpref",
a7 = "novolumepref",
a9 = "seektoliveoffset";
class re extends i9 {
constructor() {
super(),
aV(this, H),
aV(this, $),
aV(this, F),
(this.mediaStateReceivers = []),
(this.associatedElementSubscriptions = new Map()),
aV(this, L, new ar(this, aQ)),
aV(this, R, void 0),
aV(this, D, void 0),
aV(this, N, null),
aV(this, P, void 0),
aV(this, j, void 0),
aV(this, O, (e) => {
var t;
null == (t = aH(this, D)) || t.dispatch(e);
}),
aV(this, U, void 0),
aV(this, W, (e) => {
let { key: t, shiftKey: i } = e;
(i && ("/" === t || "?" === t)) || aB.includes(t)
? this.keyboardShortcutHandler(e)
: this.removeEventListener("keyup", aH(this, W));
}),
this.associateElement(this);
let e = {};
aW(this, P, (t) => {
Object.entries(t).forEach(([t, i]) => {
if (t in e && e[t] === i) return;
this.propagateMediaState(t, i);
let a = t.toLowerCase(),
r = new iA.CustomEvent(t3[a], { composed: !0, detail: i });
this.dispatchEvent(r);
}),
(e = t);
});
}
static get observedAttributes() {
return super.observedAttributes.concat(
a6,
aQ,
az,
aF,
aG,
a4,
a7,
a0,
a1,
a2,
a9,
a3,
);
}
get mediaStore() {
return aH(this, D);
}
set mediaStore(e) {
var t, i;
(aH(this, D) &&
(null == (t = aH(this, j)) || t.call(this), aW(this, j, void 0)),
aW(this, D, e),
aH(this, D) || this.hasAttribute(a5))
? aW(
this,
j,
null == (i = aH(this, D)) ? void 0 : i.subscribe(aH(this, P)),
)
: a$(this, H, V).call(this);
}
get fullscreenElement() {
var e;
return null != (e = aH(this, R)) ? e : this;
}
set fullscreenElement(e) {
var t;
this.hasAttribute(aq) && this.removeAttribute(aq),
aW(this, R, e),
null == (t = aH(this, D)) ||
t.dispatch({
type: "fullscreenelementchangerequest",
detail: this.fullscreenElement,
});
}
get defaultSubtitles() {
return iV(this, aF);
}
set defaultSubtitles(e) {
iW(this, aF, e);
}
get defaultStreamType() {
return i$(this, az);
}
set defaultStreamType(e) {
iB(this, az, e);
}
get defaultDuration() {
return iU(this, aG);
}
set defaultDuration(e) {
iH(this, aG, e);
}
get noHotkeys() {
return iV(this, a6);
}
set noHotkeys(e) {
iW(this, a6, e);
}
get keysUsed() {
return i$(this, aJ);
}
set keysUsed(e) {
iB(this, aJ, e);
}
get liveEdgeOffset() {
return iU(this, a2);
}
set liveEdgeOffset(e) {
iH(this, a2, e);
}
get noAutoSeekToLive() {
return iV(this, a3);
}
set noAutoSeekToLive(e) {
iW(this, a3, e);
}
get noVolumePref() {
return iV(this, a7);
}
set noVolumePref(e) {
iW(this, a7, e);
}
get noMutedPref() {
return iV(this, a4);
}
set noMutedPref(e) {
iW(this, a4, e);
}
get noSubtitlesLangPref() {
return iV(this, a8);
}
set noSubtitlesLangPref(e) {
iW(this, a8, e);
}
get noDefaultStore() {
return iV(this, a5);
}
set noDefaultStore(e) {
iW(this, a5, e);
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s, l, d, u, c, h, m, p;
if ((super.attributeChangedCallback(e, t, i), e === a6))
i !== t && "" === i
? (this.hasAttribute(aQ) &&
console.warn(
"Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled.",
),
this.disableHotkeys())
: i !== t && null === i && this.enableHotkeys();
else if (e === aQ) aH(this, L).value = i;
else if (e === aF && i !== t)
null == (a = aH(this, D)) ||
a.dispatch({
type: "optionschangerequest",
detail: { defaultSubtitles: this.hasAttribute(aF) },
});
else if (e === az)
null == (n = aH(this, D)) ||
n.dispatch({
type: "optionschangerequest",
detail: {
defaultStreamType:
null != (r = this.getAttribute(az)) ? r : void 0,
},
});
else if (e === a2 && i !== t)
null == (o = aH(this, D)) ||
o.dispatch({
type: "optionschangerequest",
detail: {
liveEdgeOffset: this.hasAttribute(a2)
? +this.getAttribute(a2)
: void 0,
seekToLiveOffset: this.hasAttribute(a9)
? +this.getAttribute(a9)
: this.hasAttribute(a2)
? +this.getAttribute(a2)
: void 0,
},
});
else if (e === a9 && i !== t)
null == (s = aH(this, D)) ||
s.dispatch({
type: "optionschangerequest",
detail: {
seekToLiveOffset: this.hasAttribute(a9)
? +this.getAttribute(a9)
: this.hasAttribute(a2)
? +this.getAttribute(a2)
: void 0,
},
});
else if (e === a3)
null == (l = aH(this, D)) ||
l.dispatch({
type: "optionschangerequest",
detail: { noAutoSeekToLive: this.hasAttribute(a3) },
});
else if (e === aq) {
let e = i
? null == (d = this.getRootNode())
? void 0
: d.getElementById(i)
: void 0;
aW(this, R, e),
null == (u = aH(this, D)) ||
u.dispatch({
type: "fullscreenelementchangerequest",
detail: this.fullscreenElement,
});
} else
e === a0 && i !== t
? ((il = i),
null == (c = aH(this, D)) ||
c.dispatch({
type: "optionschangerequest",
detail: { mediaLang: i },
}))
: e === a1 && i !== t
? null == (h = aH(this, D)) ||
h.dispatch({ type: tY.MEDIA_LOOP_REQUEST, detail: null != i })
: e === a7 && i !== t
? null == (m = aH(this, D)) ||
m.dispatch({
type: "optionschangerequest",
detail: { noVolumePref: this.hasAttribute(a7) },
})
: e === a4 &&
i !== t &&
(null == (p = aH(this, D)) ||
p.dispatch({
type: "optionschangerequest",
detail: { noMutedPref: this.hasAttribute(a4) },
}));
}
connectedCallback() {
var e, t, i;
this.associateElement(this),
aH(this, D) || this.hasAttribute(a5) || a$(this, H, V).call(this),
null == (e = aH(this, D)) ||
e.dispatch({ type: "documentelementchangerequest", detail: ik }),
null == (t = aH(this, D)) ||
t.dispatch({
type: "fullscreenelementchangerequest",
detail: this.fullscreenElement,
}),
super.connectedCallback(),
aH(this, D) &&
!aH(this, j) &&
aW(
this,
j,
null == (i = aH(this, D)) ? void 0 : i.subscribe(aH(this, P)),
),
void 0 !== aH(this, U) &&
aH(this, D) &&
this.media &&
setTimeout(() => {
var e, t, i;
(null == (t = null == (e = this.media) ? void 0 : e.textTracks)
? void 0
: t.length) &&
(null == (i = aH(this, D)) ||
i.dispatch({
type: tY.MEDIA_TOGGLE_SUBTITLES_REQUEST,
detail: aH(this, U),
}));
}, 0),
this.hasAttribute(a6) ? this.disableHotkeys() : this.enableHotkeys();
}
disconnectedCallback() {
var e, t, i, a, r, n;
if (
(null == (e = super.disconnectedCallback) || e.call(this),
this.disableHotkeys(),
aH(this, D))
) {
let e = aH(this, D).getState();
aW(
this,
U,
!!(null == (t = e.mediaSubtitlesShowing) ? void 0 : t.length),
),
null == (i = aH(this, D)) ||
i.dispatch({
type: "fullscreenelementchangerequest",
detail: void 0,
}),
null == (a = aH(this, D)) ||
a.dispatch({
type: "documentelementchangerequest",
detail: void 0,
}),
null == (r = aH(this, D)) ||
r.dispatch({
type: tY.MEDIA_TOGGLE_SUBTITLES_REQUEST,
detail: !1,
});
}
aH(this, j) &&
(null == (n = aH(this, j)) || n.call(this), aW(this, j, void 0)),
this.unassociateElement(this),
aH(this, N) && (aH(this, N).remove(), aW(this, N, null));
}
mediaSetCallback(e) {
var t;
super.mediaSetCallback(e),
null == (t = aH(this, D)) ||
t.dispatch({ type: "mediaelementchangerequest", detail: e }),
e.hasAttribute("tabindex") || (e.tabIndex = -1);
}
mediaUnsetCallback(e) {
var t;
super.mediaUnsetCallback(e),
null == (t = aH(this, D)) ||
t.dispatch({ type: "mediaelementchangerequest", detail: void 0 });
}
propagateMediaState(e, t) {
rd(this.mediaStateReceivers, e, t);
}
associateElement(e) {
if (!e) return;
let { associatedElementSubscriptions: t } = this;
if (t.has(e)) return;
let i = ru(
e,
this.registerMediaStateReceiver.bind(this),
this.unregisterMediaStateReceiver.bind(this),
);
Object.values(tY).forEach((t) => {
e.addEventListener(t, aH(this, O));
}),
t.set(e, i);
}
unassociateElement(e) {
if (!e) return;
let { associatedElementSubscriptions: t } = this;
t.has(e) &&
(t.get(e)(),
t.delete(e),
Object.values(tY).forEach((t) => {
e.removeEventListener(t, aH(this, O));
}));
}
registerMediaStateReceiver(e) {
if (!e) return;
let t = this.mediaStateReceivers;
!(t.indexOf(e) > -1) &&
(t.push(e),
aH(this, D) &&
Object.entries(aH(this, D).getState()).forEach(([t, i]) => {
rd([e], t, i);
}));
}
unregisterMediaStateReceiver(e) {
let t = this.mediaStateReceivers,
i = t.indexOf(e);
i < 0 || t.splice(i, 1);
}
enableHotkeys() {
this.addEventListener("keydown", a$(this, $, B));
}
disableHotkeys() {
this.removeEventListener("keydown", a$(this, $, B)),
this.removeEventListener("keyup", aH(this, W));
}
get hotkeys() {
return aH(this, L);
}
set hotkeys(e) {
iB(this, aQ, e);
}
keyboardShortcutHandler(e) {
var t, i, a, r, n, o, s, l, d;
let u,
c,
h,
m = e.target;
if (
!(
(null !=
(a =
null !=
(i = null == (t = m.getAttribute(aJ)) ? void 0 : t.split(" "))
? i
: null == m
? void 0
: m.keysUsed)
? a
: []
)
.map((e) => ("Space" === e ? " " : e))
.filter(Boolean)
.includes(e.key) ||
aH(this, L).contains(`no${e.key.toLowerCase()}`) ||
(" " === e.key && aH(this, L).contains("nospace"))
) &&
!(
e.shiftKey &&
("/" === e.key || "?" === e.key) &&
aH(this, L).contains("noshift+/")
)
)
switch (e.key) {
case " ":
case "k":
(u = aH(this, D).getState().mediaPaused
? tY.MEDIA_PLAY_REQUEST
: tY.MEDIA_PAUSE_REQUEST),
this.dispatchEvent(
new iA.CustomEvent(u, { composed: !0, bubbles: !0 }),
);
break;
case "m":
(u =
"off" === this.mediaStore.getState().mediaVolumeLevel
? tY.MEDIA_UNMUTE_REQUEST
: tY.MEDIA_MUTE_REQUEST),
this.dispatchEvent(
new iA.CustomEvent(u, { composed: !0, bubbles: !0 }),
);
break;
case "f":
(u = this.mediaStore.getState().mediaIsFullscreen
? tY.MEDIA_EXIT_FULLSCREEN_REQUEST
: tY.MEDIA_ENTER_FULLSCREEN_REQUEST),
this.dispatchEvent(
new iA.CustomEvent(u, { composed: !0, bubbles: !0 }),
);
break;
case "c":
this.dispatchEvent(
new iA.CustomEvent(tY.MEDIA_TOGGLE_SUBTITLES_REQUEST, {
composed: !0,
bubbles: !0,
}),
);
break;
case "ArrowLeft":
case "j": {
let e = this.hasAttribute(aK) ? +this.getAttribute(aK) : 10;
(c = Math.max(
(null != (r = this.mediaStore.getState().mediaCurrentTime)
? r
: 0) - e,
0,
)),
(h = new iA.CustomEvent(tY.MEDIA_SEEK_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
}
case "ArrowRight":
case "l": {
let e = this.hasAttribute(aY) ? +this.getAttribute(aY) : 10;
(c = Math.max(
(null != (n = this.mediaStore.getState().mediaCurrentTime)
? n
: 0) + e,
0,
)),
(h = new iA.CustomEvent(tY.MEDIA_SEEK_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
}
case "ArrowUp": {
let e = this.hasAttribute(aZ) ? +this.getAttribute(aZ) : 0.025;
(c = Math.min(
(null != (o = this.mediaStore.getState().mediaVolume) ? o : 1) +
e,
1,
)),
(h = new iA.CustomEvent(tY.MEDIA_VOLUME_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
}
case "ArrowDown": {
let e = this.hasAttribute(aX) ? +this.getAttribute(aX) : 0.025;
(c = Math.max(
(null != (s = this.mediaStore.getState().mediaVolume) ? s : 1) -
e,
0,
)),
(h = new iA.CustomEvent(tY.MEDIA_VOLUME_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
}
case "<":
(c = Math.max(
(null != (l = this.mediaStore.getState().mediaPlaybackRate)
? l
: 1) - 0.25,
0.25,
).toFixed(2)),
(h = new iA.CustomEvent(tY.MEDIA_PLAYBACK_RATE_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
case ">":
(c = Math.min(
(null != (d = this.mediaStore.getState().mediaPlaybackRate)
? d
: 1) + 0.25,
2,
).toFixed(2)),
(h = new iA.CustomEvent(tY.MEDIA_PLAYBACK_RATE_REQUEST, {
composed: !0,
bubbles: !0,
detail: c,
})),
this.dispatchEvent(h);
break;
case "/":
case "?":
e.shiftKey && a$(this, F, z).call(this);
break;
case "p":
(u = this.mediaStore.getState().mediaIsPip
? tY.MEDIA_EXIT_PIP_REQUEST
: tY.MEDIA_ENTER_PIP_REQUEST),
(h = new iA.CustomEvent(u, { composed: !0, bubbles: !0 })),
this.dispatchEvent(h);
}
}
}
(L = new WeakMap()),
(R = new WeakMap()),
(D = new WeakMap()),
(N = new WeakMap()),
(P = new WeakMap()),
(j = new WeakMap()),
(O = new WeakMap()),
(U = new WeakMap()),
(H = new WeakSet()),
(V = function () {
var e;
this.mediaStore = (({
media: e,
fullscreenElement: t,
documentElement: i,
stateMediator: a = aj,
requestMap: r = aO,
options: n = {},
monitorStateOwnersOnlyWithSubscriptions: o = !0,
}) => {
let s,
l = [],
d = { options: { ...n } },
u = Object.freeze({
mediaPreviewTime: void 0,
mediaPreviewImage: void 0,
mediaPreviewCoords: void 0,
mediaPreviewChapter: void 0,
}),
c = (e) => {
void 0 == e ||
aS(e, u) ||
((u = Object.freeze({ ...u, ...e })), l.forEach((e) => e(u)));
},
h = () => {
c(
Object.entries(a).reduce(
(e, [t, { get: i }]) => ((e[t] = i(d)), e),
{},
),
);
},
m = {},
p = async (e, t) => {
var i, r, n, u, p, v, b, g, f, E, w, y, x, A, k, I;
let C = !!s;
if (((s = { ...d, ...(null != s ? s : {}), ...e }), C)) return;
await aN(...Object.values(e));
let T = l.length > 0 && 0 === t && o,
M = d.media !== s.media,
_ =
(null == (i = d.media) ? void 0 : i.textTracks) !==
(null == (r = s.media) ? void 0 : r.textTracks),
S =
(null == (n = d.media) ? void 0 : n.videoRenditions) !==
(null == (u = s.media) ? void 0 : u.videoRenditions),
L =
(null == (p = d.media) ? void 0 : p.audioTracks) !==
(null == (v = s.media) ? void 0 : v.audioTracks),
R =
(null == (b = d.media) ? void 0 : b.remote) !==
(null == (g = s.media) ? void 0 : g.remote),
D = d.documentElement !== s.documentElement,
N = !!d.media && (M || T),
P =
!!(null == (f = d.media) ? void 0 : f.textTracks) && (_ || T),
j =
!!(null == (E = d.media) ? void 0 : E.videoRenditions) &&
(S || T),
O =
!!(null == (w = d.media) ? void 0 : w.audioTracks) &&
(L || T),
U = !!(null == (y = d.media) ? void 0 : y.remote) && (R || T),
H = !!d.documentElement && (D || T),
V = N || P || j || O || U || H,
W = 0 === l.length && 1 === t && o,
$ = !!s.media && (M || W),
B =
!!(null == (x = s.media) ? void 0 : x.textTracks) && (_ || W),
F =
!!(null == (A = s.media) ? void 0 : A.videoRenditions) &&
(S || W),
z =
!!(null == (k = s.media) ? void 0 : k.audioTracks) &&
(L || W),
G = !!(null == (I = s.media) ? void 0 : I.remote) && (R || W),
q = !!s.documentElement && (D || W),
Q = $ || B || F || z || G || q;
if (!(V || Q)) {
Object.entries(s).forEach(([e, t]) => {
d[e] = t;
}),
h(),
(s = void 0);
return;
}
Object.entries(a).forEach(
([
e,
{
get: t,
mediaEvents: i = [],
textTracksEvents: a = [],
videoRenditionsEvents: r = [],
audioTracksEvents: n = [],
remoteEvents: o = [],
rootEvents: l = [],
stateOwnersUpdateHandlers: u = [],
},
]) => {
let h;
m[e] || (m[e] = {});
let p = (i) => {
c({ [e]: t(d, i) });
};
(h = m[e].mediaEvents),
i.forEach((t) => {
h &&
N &&
(d.media.removeEventListener(t, h),
(m[e].mediaEvents = void 0)),
$ &&
(s.media.addEventListener(t, p),
(m[e].mediaEvents = p));
}),
(h = m[e].textTracksEvents),
a.forEach((t) => {
var i, a;
h &&
P &&
(null == (i = d.media.textTracks) ||
i.removeEventListener(t, h),
(m[e].textTracksEvents = void 0)),
B &&
(null == (a = s.media.textTracks) ||
a.addEventListener(t, p),
(m[e].textTracksEvents = p));
}),
(h = m[e].videoRenditionsEvents),
r.forEach((t) => {
var i, a;
h &&
j &&
(null == (i = d.media.videoRenditions) ||
i.removeEventListener(t, h),
(m[e].videoRenditionsEvents = void 0)),
F &&
(null == (a = s.media.videoRenditions) ||
a.addEventListener(t, p),
(m[e].videoRenditionsEvents = p));
}),
(h = m[e].audioTracksEvents),
n.forEach((t) => {
var i, a;
h &&
O &&
(null == (i = d.media.audioTracks) ||
i.removeEventListener(t, h),
(m[e].audioTracksEvents = void 0)),
z &&
(null == (a = s.media.audioTracks) ||
a.addEventListener(t, p),
(m[e].audioTracksEvents = p));
}),
(h = m[e].remoteEvents),
o.forEach((t) => {
var i, a;
h &&
U &&
(null == (i = d.media.remote) ||
i.removeEventListener(t, h),
(m[e].remoteEvents = void 0)),
G &&
(null == (a = s.media.remote) ||
a.addEventListener(t, p),
(m[e].remoteEvents = p));
}),
(h = m[e].rootEvents),
l.forEach((t) => {
h &&
H &&
(d.documentElement.removeEventListener(t, h),
(m[e].rootEvents = void 0)),
q &&
(s.documentElement.addEventListener(t, p),
(m[e].rootEvents = p));
});
let v = m[e].stateOwnersUpdateHandlers;
if (
(v &&
V &&
(Array.isArray(v) ? v : [v]).forEach((e) => {
"function" == typeof e && e();
}),
Q)
) {
let t = u
.map((e) => e(p, s))
.filter((e) => "function" == typeof e);
m[e].stateOwnersUpdateHandlers = 1 === t.length ? t[0] : t;
} else V && (m[e].stateOwnersUpdateHandlers = void 0);
},
),
Object.entries(s).forEach(([e, t]) => {
d[e] = t;
}),
h(),
(s = void 0);
};
return (
p({
media: e,
fullscreenElement: t,
documentElement: i,
options: n,
}),
{
dispatch(e) {
let { type: t, detail: i } = e;
r[t] && null == u.mediaErrorCode
? c(r[t](a, d, e))
: "mediaelementchangerequest" === t
? p({ media: i })
: "fullscreenelementchangerequest" === t
? p({ fullscreenElement: i })
: "documentelementchangerequest" === t
? p({ documentElement: i })
: "optionschangerequest" === t &&
(Object.entries(null != i ? i : {}).forEach(
([e, t]) => {
d.options[e] = t;
},
),
h());
},
getState: () => u,
subscribe: (e) => (
p({}, l.length + 1),
l.push(e),
e(u),
() => {
let t = l.indexOf(e);
t >= 0 && (p({}, l.length - 1), l.splice(t, 1));
}
),
}
);
})({
media: this.media,
fullscreenElement: this.fullscreenElement,
options: {
defaultSubtitles: this.hasAttribute(aF),
defaultDuration: this.hasAttribute(aG)
? +this.getAttribute(aG)
: void 0,
defaultStreamType: null != (e = this.getAttribute(az)) ? e : void 0,
liveEdgeOffset: this.hasAttribute(a2)
? +this.getAttribute(a2)
: void 0,
seekToLiveOffset: this.hasAttribute(a9)
? +this.getAttribute(a9)
: this.hasAttribute(a2)
? +this.getAttribute(a2)
: void 0,
noAutoSeekToLive: this.hasAttribute(a3),
noVolumePref: this.hasAttribute(a7),
noMutedPref: this.hasAttribute(a4),
noSubtitlesLangPref: this.hasAttribute(a8),
},
});
}),
(W = new WeakMap()),
($ = new WeakSet()),
(B = function (e) {
var t;
let { metaKey: i, altKey: a, key: r, shiftKey: n } = e,
o = n && ("/" === r || "?" === r);
if (
(o && (null == (t = aH(this, N)) ? void 0 : t.open)) ||
i ||
a ||
(!o && !aB.includes(r))
)
return void this.removeEventListener("keyup", aH(this, W));
let s = e.target,
l =
s instanceof HTMLElement &&
("media-volume-range" === s.tagName.toLowerCase() ||
"media-time-range" === s.tagName.toLowerCase());
![" ", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(r) ||
aH(this, L).contains(`no${r.toLowerCase()}`) ||
(" " === r && aH(this, L).contains("nospace")) ||
l ||
e.preventDefault(),
this.addEventListener("keyup", aH(this, W), { once: !0 });
}),
(F = new WeakSet()),
(z = function () {
aH(this, N) ||
(aW(this, N, ik.createElement("media-keyboard-shortcuts-dialog")),
this.appendChild(aH(this, N))),
(aH(this, N).open = !0);
});
let rt = Object.values(t0),
ri = Object.values(tZ),
ra = (e) => {
var t, i, a, r;
let { observedAttributes: n } = e.constructor;
!n &&
(null == (t = e.nodeName) ? void 0 : t.includes("-")) &&
(iA.customElements.upgrade(e),
({ observedAttributes: n } = e.constructor));
let o =
null ==
(r =
null ==
(a =
null == (i = null == e ? void 0 : e.getAttribute)
? void 0
: i.call(e, tX.MEDIA_CHROME_ATTRIBUTES))
? void 0
: a.split)
? void 0
: r.call(a, /\s+/);
return Array.isArray(n || o)
? (n || o).filter((e) => rt.includes(e))
: [];
},
rr = (e) => {
var t, i;
return (
(null == (t = e.nodeName) ? void 0 : t.includes("-")) &&
iA.customElements.get(
null == (i = e.nodeName) ? void 0 : i.toLowerCase(),
) &&
!(e instanceof iA.customElements.get(e.nodeName.toLowerCase())) &&
iA.customElements.upgrade(e),
ri.some((t) => t in e) || !!ra(e).length
);
},
rn = (e) => {
var t;
return null == (t = null == e ? void 0 : e.join)
? void 0
: t.call(e, ":");
},
ro = {
[t0.MEDIA_SUBTITLES_LIST]: ad,
[t0.MEDIA_SUBTITLES_SHOWING]: ad,
[t0.MEDIA_SEEKABLE]: rn,
[t0.MEDIA_BUFFERED]: (e) => (null == e ? void 0 : e.map(rn).join(" ")),
[t0.MEDIA_PREVIEW_COORDS]: (e) => (null == e ? void 0 : e.join(" ")),
[t0.MEDIA_RENDITION_LIST]: function (e) {
return null == e ? void 0 : e.map(ii).join(" ");
},
[t0.MEDIA_AUDIO_TRACK_LIST]: function (e) {
return null == e ? void 0 : e.map(ia).join(" ");
},
},
rs = async (e, t, i) => {
var a, r;
if (
(e.isConnected || (await io(0)), "boolean" == typeof i || null == i)
)
return iW(e, t, i);
if ("number" == typeof i) return iH(e, t, i);
if ("string" == typeof i) return iB(e, t, i);
if (Array.isArray(i) && !i.length) return e.removeAttribute(t);
let n =
null != (r = null == (a = ro[t]) ? void 0 : a.call(ro, i)) ? r : i;
return e.setAttribute(t, n);
},
rl = (e, t) => {
var i;
if (null == (i = e.closest) ? void 0 : i.call(e, '*[slot="media"]'))
return;
let a = (e, t) => {
var i, a;
rr(e) && t(e);
let { children: r = [] } = null != e ? e : {};
[
...r,
...(null !=
(a =
null == (i = null == e ? void 0 : e.shadowRoot)
? void 0
: i.children)
? a
: []),
].forEach((e) => rl(e, t));
},
r = null == e ? void 0 : e.nodeName.toLowerCase();
r.includes("-") && !rr(e)
? iA.customElements.whenDefined(r).then(() => {
a(e, t);
})
: a(e, t);
},
rd = (e, t, i) => {
e.forEach((e) => {
if (t in e) {
e[t] = i;
return;
}
let a = ra(e),
r = t.toLowerCase();
a.includes(r) && rs(e, r, i);
});
},
ru = (e, t, i) => {
rl(e, t);
let a = (e) => {
var i;
t(
null != (i = null == e ? void 0 : e.composedPath()[0])
? i
: e.target,
);
},
r = (e) => {
var t;
i(
null != (t = null == e ? void 0 : e.composedPath()[0])
? t
: e.target,
);
};
e.addEventListener(tY.REGISTER_MEDIA_STATE_RECEIVER, a),
e.addEventListener(tY.UNREGISTER_MEDIA_STATE_RECEIVER, r);
let n = [],
o = (e) => {
let a = e.target;
"media" !== a.name &&
(n.forEach((e) => rl(e, i)),
(n = [...a.assignedElements({ flatten: !0 })]).forEach((e) =>
rl(e, t),
));
};
e.addEventListener("slotchange", o);
let s = new MutationObserver((e) => {
e.forEach((e) => {
let {
addedNodes: a = [],
removedNodes: r = [],
type: n,
target: o,
attributeName: s,
} = e;
"childList" === n
? (Array.prototype.forEach.call(a, (e) => rl(e, t)),
Array.prototype.forEach.call(r, (e) => rl(e, i)))
: "attributes" === n &&
s === tX.MEDIA_CHROME_ATTRIBUTES &&
(rr(o) ? t(o) : i(o));
});
});
return (
s.observe(e, { childList: !0, attributes: !0, subtree: !0 }),
() => {
rl(e, i),
e.removeEventListener("slotchange", o),
s.disconnect(),
e.removeEventListener(tY.REGISTER_MEDIA_STATE_RECEIVER, a),
e.removeEventListener(tY.UNREGISTER_MEDIA_STATE_RECEIVER, r);
}
);
};
iA.customElements.get("media-controller") ||
iA.customElements.define("media-controller", re);
let rc = "placement",
rh = "bounds";
class rm extends iA.HTMLElement {
constructor() {
if (
(super(),
(this.updateXOffset = () => {
var e, t;
if (!iP(this, { checkOpacity: !1, checkVisibilityCSS: !1 })) return;
let i = this.placement;
if ("left" === i || "right" === i)
return void this.style.removeProperty("--media-tooltip-offset-x");
let a = getComputedStyle(this),
r =
null != (e = iN(this, "#" + this.bounds))
? e
: null !=
(t = (function (e) {
var t, i, a;
let { MEDIA_CONTROLLER: r } = tX,
n = e.getAttribute(r);
if (n) {
let r;
return null ==
(t =
(r =
null ==
(a = null == (i = e) ? void 0 : i.getRootNode)
? void 0
: a.call(i)) instanceof ShadowRoot ||
r instanceof Document
? r
: null)
? void 0
: t.getElementById(n);
}
})(this))
? t
: iN(this, "media-controller");
if (!r) return;
let { x: n, width: o } = r.getBoundingClientRect(),
{ x: s, width: l } = this.getBoundingClientRect(),
d = a.getPropertyValue("--media-tooltip-offset-x"),
u = d ? parseFloat(d.replace("px", "")) : 0,
c = a.getPropertyValue("--media-tooltip-container-margin"),
h = c ? parseFloat(c.replace("px", "")) : 0,
m = s - n + u - h,
p = s + l - (n + o) + u + h;
m < 0
? this.style.setProperty("--media-tooltip-offset-x", `${m}px`)
: p > 0
? this.style.setProperty("--media-tooltip-offset-x", `${p}px`)
: this.style.removeProperty("--media-tooltip-offset-x");
}),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
if (
((this.arrowEl = this.shadowRoot.querySelector("#arrow")),
Object.prototype.hasOwnProperty.call(this, "placement"))
) {
const e = this.placement;
delete this.placement, (this.placement = e);
}
}
static get observedAttributes() {
return [rc, rh];
}
get placement() {
return i$(this, rc);
}
set placement(e) {
iB(this, rc, e);
}
get bounds() {
return i$(this, rh);
}
set bounds(e) {
iB(this, rh, e);
}
}
(rm.shadowRootOptions = { mode: "open" }),
(rm.getTemplateHTML = function (e) {
return `
<style>
:host {
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
--_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));
--_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);
--_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);
--_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));
position: relative;
pointer-events: none;
display: var(--media-tooltip-display, inline-flex);
justify-content: center;
align-items: center;
box-sizing: border-box;
z-index: var(--media-tooltip-z-index, 1);
background: var(--_tooltip-background);
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
font: var(--media-font,
var(--media-font-weight, 400)
var(--media-font-size, 13px) /
var(--media-text-content-height, var(--media-control-height, 18px))
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
padding: var(--media-tooltip-padding, .35em .7em);
border: var(--media-tooltip-border, none);
border-radius: var(--media-tooltip-border-radius, 5px);
filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));
white-space: var(--media-tooltip-white-space, nowrap);
}
:host([hidden]) {
display: none;
}
img, svg {
display: inline-block;
}
#arrow {
position: absolute;
width: 0px;
height: 0px;
border-style: solid;
display: var(--media-tooltip-arrow-display, block);
}
:host(:not([placement])),
:host([placement="top"]) {
position: absolute;
bottom: calc(100% + var(--media-tooltip-distance, 12px));
left: 50%;
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
}
:host(:not([placement])) #arrow,
:host([placement="top"]) #arrow {
top: 100%;
left: 50%;
border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);
border-color: var(--_tooltip-arrow-background) transparent transparent transparent;
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
}
:host([placement="right"]) {
position: absolute;
left: calc(100% + var(--media-tooltip-distance, 12px));
top: 50%;
transform: translate(0, -50%);
}
:host([placement="right"]) #arrow {
top: 50%;
right: 100%;
border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;
border-color: transparent var(--_tooltip-arrow-background) transparent transparent;
transform: translate(0, -50%);
}
:host([placement="bottom"]) {
position: absolute;
top: calc(100% + var(--media-tooltip-distance, 12px));
left: 50%;
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
}
:host([placement="bottom"]) #arrow {
bottom: 100%;
left: 50%;
border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);
border-color: transparent transparent var(--_tooltip-arrow-background) transparent;
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
}
:host([placement="left"]) {
position: absolute;
right: calc(100% + var(--media-tooltip-distance, 12px));
top: 50%;
transform: translate(0, -50%);
}
:host([placement="left"]) #arrow {
top: 50%;
left: 100%;
border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);
border-color: transparent transparent transparent var(--_tooltip-arrow-background);
transform: translate(0, -50%);
}
:host([placement="none"]) #arrow {
display: none;
}
</style>
<slot></slot>
<div id="arrow"></div>
`;
}),
iA.customElements.get("media-tooltip") ||
iA.customElements.define("media-tooltip", rm);
var rp = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
rv = (e, t, i) => (
rp(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
rb = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
rg = (e, t, i, a) => (
rp(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
let rf = "tooltipplacement",
rE = "disabled",
rw = "notooltip";
class ry extends iA.HTMLElement {
constructor() {
if (
(super(),
rb(this, X),
rb(this, G, void 0),
(this.preventClick = !1),
(this.tooltipEl = null),
rb(this, q, (e) => {
this.preventClick || this.handleClick(e),
setTimeout(rv(this, Q), 0);
}),
rb(this, Q, () => {
var e, t;
null ==
(t = null == (e = this.tooltipEl) ? void 0 : e.updateXOffset) ||
t.call(e);
}),
rb(this, K, (e) => {
let { key: t } = e;
this.keysUsed.includes(t)
? this.preventClick || this.handleClick(e)
: this.removeEventListener("keyup", rv(this, K));
}),
rb(this, Y, (e) => {
let { metaKey: t, altKey: i, key: a } = e;
t || i || !this.keysUsed.includes(a)
? this.removeEventListener("keyup", rv(this, K))
: this.addEventListener("keyup", rv(this, K), { once: !0 });
}),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes),
t = this.constructor.getTemplateHTML(e);
this.shadowRoot.setHTMLUnsafe
? this.shadowRoot.setHTMLUnsafe(t)
: (this.shadowRoot.innerHTML = t);
}
this.tooltipEl = this.shadowRoot.querySelector("media-tooltip");
}
static get observedAttributes() {
return ["disabled", rf, tX.MEDIA_CONTROLLER, t0.MEDIA_LANG];
}
enable() {
this.addEventListener("click", rv(this, q)),
this.addEventListener("keydown", rv(this, Y)),
(this.tabIndex = 0);
}
disable() {
this.removeEventListener("click", rv(this, q)),
this.removeEventListener("keydown", rv(this, Y)),
this.removeEventListener("keyup", rv(this, K)),
(this.tabIndex = -1);
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
e === tX.MEDIA_CONTROLLER
? (t &&
(null ==
(r =
null == (a = rv(this, G)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
rg(this, G, null)),
i &&
this.isConnected &&
(rg(
this,
G,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s = null == (o = rv(this, G)) ? void 0 : o.associateElement) ||
s.call(o, this)))
: "disabled" === e && i !== t
? null == i
? this.enable()
: this.disable()
: e === rf && this.tooltipEl && i !== t
? (this.tooltipEl.placement = i)
: e === t0.MEDIA_LANG &&
(this.shadowRoot.querySelector(
'slot[name="tooltip-content"]',
).innerHTML = this.constructor.getTooltipContentHTML()),
rv(this, Q).call(this);
}
connectedCallback() {
var e, t, i;
let { style: a } = ij(this.shadowRoot, ":host");
a.setProperty(
"display",
`var(--media-control-display, var(--${this.localName}-display, inline-flex))`,
),
this.hasAttribute("disabled") ? this.disable() : this.enable(),
this.setAttribute("role", "button");
let r = this.getAttribute(tX.MEDIA_CONTROLLER);
r &&
(rg(
this,
G,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(r),
),
null ==
(i = null == (t = rv(this, G)) ? void 0 : t.associateElement) ||
i.call(t, this)),
iA.customElements.whenDefined("media-tooltip").then(() => {
var e, t;
return ((e = X),
(t = Z),
rp(this, e, "access private method"),
t).call(this);
});
}
disconnectedCallback() {
var e, t;
this.disable(),
null ==
(t = null == (e = rv(this, G)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
rg(this, G, null),
this.removeEventListener("mouseenter", rv(this, Q)),
this.removeEventListener("focus", rv(this, Q)),
this.removeEventListener("click", rv(this, q));
}
get keysUsed() {
return ["Enter", " "];
}
get tooltipPlacement() {
return i$(this, rf);
}
set tooltipPlacement(e) {
iB(this, rf, e);
}
get mediaController() {
return i$(this, tX.MEDIA_CONTROLLER);
}
set mediaController(e) {
iB(this, tX.MEDIA_CONTROLLER, e);
}
get disabled() {
return iV(this, rE);
}
set disabled(e) {
iW(this, rE, e);
}
get noTooltip() {
return iV(this, rw);
}
set noTooltip(e) {
iW(this, rw, e);
}
handleClick(e) {}
}
(G = new WeakMap()),
(q = new WeakMap()),
(Q = new WeakMap()),
(K = new WeakMap()),
(Y = new WeakMap()),
(X = new WeakSet()),
(Z = function () {
this.addEventListener("mouseenter", rv(this, Q)),
this.addEventListener("focus", rv(this, Q)),
this.addEventListener("click", rv(this, q));
let e = this.tooltipPlacement;
e && this.tooltipEl && (this.tooltipEl.placement = e);
}),
(ry.shadowRootOptions = { mode: "open" }),
(ry.getTemplateHTML = function (e, t = {}) {
return `
<style>
:host {
position: relative;
font: var(--media-font,
var(--media-font-weight, bold)
var(--media-font-size, 14px) /
var(--media-text-content-height, var(--media-control-height, 24px))
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
padding: var(--media-button-padding, var(--media-control-padding, 10px));
justify-content: var(--media-button-justify-content, center);
display: inline-flex;
align-items: center;
vertical-align: middle;
box-sizing: border-box;
transition: background .15s linear;
pointer-events: auto;
cursor: var(--media-cursor, pointer);
-webkit-tap-highlight-color: transparent;
}
:host(:focus-visible) {
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
outline: 0;
}
:host(:where(:focus)) {
box-shadow: none;
outline: 0;
}
:host(:hover) {
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
}
svg, img, ::slotted(svg), ::slotted(img) {
width: var(--media-button-icon-width);
height: var(--media-button-icon-height, var(--media-control-height, 24px));
transform: var(--media-button-icon-transform);
transition: var(--media-button-icon-transition);
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
vertical-align: middle;
max-width: 100%;
max-height: 100%;
min-width: 100%;
}
media-tooltip {
max-width: 0;
overflow-x: clip;
opacity: 0;
transition: opacity .3s, max-width 0s 9s;
}
:host(:hover) media-tooltip,
:host(:focus-visible) media-tooltip {
max-width: 100vw;
opacity: 1;
transition: opacity .3s;
}
:host([notooltip]) slot[name="tooltip"] {
display: none;
}
</style>
${this.getSlotTemplateHTML(e, t)}
<slot name="tooltip">
<media-tooltip part="tooltip" aria-hidden="true">
<template shadowrootmode="${rm.shadowRootOptions.mode}">
${rm.getTemplateHTML({})}
</template>
<slot name="tooltip-content">
${this.getTooltipContentHTML(e)}
</slot>
</media-tooltip>
</slot>
`;
}),
(ry.getSlotTemplateHTML = function (e, t) {
return `
<slot></slot>
`;
}),
(ry.getTooltipContentHTML = function () {
return "";
}),
iA.customElements.get("media-chrome-button") ||
iA.customElements.define("media-chrome-button", ry);
let rx = `<svg aria-hidden="true" viewBox="0 0 26 24">
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
</svg>
`,
rA = (e) => {
let t = e.mediaIsAirplaying ? id("stop airplay") : id("start airplay");
e.setAttribute("aria-label", t);
};
class rk extends ry {
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_IS_AIRPLAYING,
t0.MEDIA_AIRPLAY_UNAVAILABLE,
];
}
connectedCallback() {
super.connectedCallback(), rA(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_IS_AIRPLAYING && rA(this);
}
get mediaIsAirplaying() {
return iV(this, t0.MEDIA_IS_AIRPLAYING);
}
set mediaIsAirplaying(e) {
iW(this, t0.MEDIA_IS_AIRPLAYING, e);
}
get mediaAirplayUnavailable() {
return i$(this, t0.MEDIA_AIRPLAY_UNAVAILABLE);
}
set mediaAirplayUnavailable(e) {
iB(this, t0.MEDIA_AIRPLAY_UNAVAILABLE, e);
}
handleClick() {
let e = new iA.CustomEvent(tY.MEDIA_AIRPLAY_REQUEST, {
composed: !0,
bubbles: !0,
});
this.dispatchEvent(e);
}
}
(rk.getSlotTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
display: none !important;
}
:host(:not([${t0.MEDIA_IS_AIRPLAYING}])) slot[name=icon] slot:not([name=enter]) {
display: none !important;
}
:host([${t0.MEDIA_IS_AIRPLAYING}]) slot[name=tooltip-enter],
:host(:not([${t0.MEDIA_IS_AIRPLAYING}])) slot[name=tooltip-exit] {
display: none;
}
</style>
<slot name="icon">
<slot name="enter">${rx}</slot>
<slot name="exit">${rx}</slot>
</slot>
`;
}),
(rk.getTooltipContentHTML = function () {
return `
<slot name="tooltip-enter">${id("start airplay")}</slot>
<slot name="tooltip-exit">${id("stop airplay")}</slot>
`;
}),
iA.customElements.get("media-airplay-button") ||
iA.customElements.define("media-airplay-button", rk);
let rI = `<svg aria-hidden="true" viewBox="0 0 26 24">
<path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
</svg>`,
rC = `<svg aria-hidden="true" viewBox="0 0 26 24">
<path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
</svg>`,
rT = (e) => {
var t;
e.setAttribute(
"aria-checked",
(
!!(null == (t = e.mediaSubtitlesShowing) ? void 0 : t.length) ||
e.hasAttribute(t0.MEDIA_SUBTITLES_SHOWING)
).toString(),
);
};
class rM extends ry {
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_SUBTITLES_LIST,
t0.MEDIA_SUBTITLES_SHOWING,
];
}
connectedCallback() {
super.connectedCallback(),
this.setAttribute("role", "button"),
this.setAttribute("aria-label", id("closed captions")),
rT(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_SUBTITLES_SHOWING && rT(this);
}
get mediaSubtitlesList() {
return r_(this, t0.MEDIA_SUBTITLES_LIST);
}
set mediaSubtitlesList(e) {
rS(this, t0.MEDIA_SUBTITLES_LIST, e);
}
get mediaSubtitlesShowing() {
return r_(this, t0.MEDIA_SUBTITLES_SHOWING);
}
set mediaSubtitlesShowing(e) {
rS(this, t0.MEDIA_SUBTITLES_SHOWING, e);
}
handleClick() {
this.dispatchEvent(
new iA.CustomEvent(tY.MEDIA_TOGGLE_SUBTITLES_REQUEST, {
composed: !0,
bubbles: !0,
}),
);
}
}
(rM.getSlotTemplateHTML = function (e) {
return `
<style>
:host([aria-checked="true"]) slot[name=off] {
display: none !important;
}
:host(:not([aria-checked="true"])) slot[name=on] {
display: none !important;
}
:host([aria-checked="true"]) slot[name=tooltip-enable],
:host(:not([aria-checked="true"])) slot[name=tooltip-disable] {
display: none;
}
</style>
<slot name="icon">
<slot name="on">${rI}</slot>
<slot name="off">${rC}</slot>
</slot>
`;
}),
(rM.getTooltipContentHTML = function () {
return `
<slot name="tooltip-enable">${id("Enable captions")}</slot>
<slot name="tooltip-disable">${id("Disable captions")}</slot>
`;
});
let r_ = (e, t) => {
let i = e.getAttribute(t);
return i ? ao(i) : [];
},
rS = (e, t, i) => {
if (!(null == i ? void 0 : i.length)) return void e.removeAttribute(t);
let a = ad(i);
e.getAttribute(t) !== a && e.setAttribute(t, a);
};
iA.customElements.get("media-captions-button") ||
iA.customElements.define("media-captions-button", rM);
let rL = (e) => {
let t = e.mediaIsCasting ? id("stop casting") : id("start casting");
e.setAttribute("aria-label", t);
};
class rR extends ry {
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_IS_CASTING,
t0.MEDIA_CAST_UNAVAILABLE,
];
}
connectedCallback() {
super.connectedCallback(), rL(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_IS_CASTING && rL(this);
}
get mediaIsCasting() {
return iV(this, t0.MEDIA_IS_CASTING);
}
set mediaIsCasting(e) {
iW(this, t0.MEDIA_IS_CASTING, e);
}
get mediaCastUnavailable() {
return i$(this, t0.MEDIA_CAST_UNAVAILABLE);
}
set mediaCastUnavailable(e) {
iB(this, t0.MEDIA_CAST_UNAVAILABLE, e);
}
handleClick() {
let e = this.mediaIsCasting
? tY.MEDIA_EXIT_CAST_REQUEST
: tY.MEDIA_ENTER_CAST_REQUEST;
this.dispatchEvent(
new iA.CustomEvent(e, { composed: !0, bubbles: !0 }),
);
}
}
(rR.getSlotTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
display: none !important;
}
:host(:not([${t0.MEDIA_IS_CASTING}])) slot[name=icon] slot:not([name=enter]) {
display: none !important;
}
:host([${t0.MEDIA_IS_CASTING}]) slot[name=tooltip-enter],
:host(:not([${t0.MEDIA_IS_CASTING}])) slot[name=tooltip-exit] {
display: none;
}
</style>
<slot name="icon">
<slot name="enter"><svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg></slot>
<slot name="exit"><svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg></slot>
</slot>
`;
}),
(rR.getTooltipContentHTML = function () {
return `
<slot name="tooltip-enter">${id("Start casting")}</slot>
<slot name="tooltip-exit">${id("Stop casting")}</slot>
`;
}),
iA.customElements.get("media-cast-button") ||
iA.customElements.define("media-cast-button", rR);
var rD = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
rN = (e, t, i) => (
rD(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
rP = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
rj = (e, t, i, a) => (
rD(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
rO = (e, t, i) => (rD(e, t, "access private method"), i);
let rU = "open";
class rH extends iA.HTMLElement {
constructor() {
super(),
rP(this, ei),
rP(this, er),
rP(this, eo),
rP(this, el),
rP(this, eu),
rP(this, eh),
rP(this, J, !1),
rP(this, ee, null),
rP(this, et, null);
}
static get observedAttributes() {
return [rU, "anchor"];
}
get open() {
return iV(this, rU);
}
set open(e) {
iW(this, rU, e);
}
handleEvent(e) {
switch (e.type) {
case "invoke":
rO(this, el, ed).call(this, e);
break;
case "focusout":
rO(this, eu, ec).call(this, e);
break;
case "keydown":
rO(this, eh, em).call(this, e);
}
}
connectedCallback() {
rO(this, ei, ea).call(this),
this.role || (this.role = "dialog"),
this.addEventListener("invoke", this),
this.addEventListener("focusout", this),
this.addEventListener("keydown", this);
}
disconnectedCallback() {
this.removeEventListener("invoke", this),
this.removeEventListener("focusout", this),
this.removeEventListener("keydown", this);
}
attributeChangedCallback(e, t, i) {
rO(this, ei, ea).call(this),
e === rU &&
i !== t &&
(this.open
? rO(this, er, en).call(this)
: rO(this, eo, es).call(this));
}
focus() {
rj(
this,
ee,
(function e(t = document) {
var i;
let a = null == t ? void 0 : t.activeElement;
return a ? (null != (i = e(a.shadowRoot)) ? i : a) : null;
})(),
);
let e = !this.dispatchEvent(
new Event("focus", { composed: !0, cancelable: !0 }),
),
t = !this.dispatchEvent(
new Event("focusin", { composed: !0, bubbles: !0, cancelable: !0 }),
);
if (e || t) return;
let i = this.querySelector(
'[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]',
);
null == i || i.focus();
}
get keysUsed() {
return ["Escape", "Tab"];
}
}
(J = new WeakMap()),
(ee = new WeakMap()),
(et = new WeakMap()),
(ei = new WeakSet()),
(ea = function () {
if (!rN(this, J) && (rj(this, J, !0), !this.shadowRoot)) {
this.attachShadow(this.constructor.shadowRootOptions);
let e = iS(this.attributes);
(this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e)),
queueMicrotask(() => {
let { style: e } = ij(this.shadowRoot, ":host");
e.setProperty(
"transition",
"display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in",
);
});
}
}),
(er = new WeakSet()),
(en = function () {
var e;
null == (e = rN(this, et)) || e.setAttribute("aria-expanded", "true"),
this.dispatchEvent(new Event("open", { composed: !0, bubbles: !0 })),
this.addEventListener("transitionend", () => this.focus(), {
once: !0,
});
}),
(eo = new WeakSet()),
(es = function () {
var e;
null == (e = rN(this, et)) || e.setAttribute("aria-expanded", "false"),
this.dispatchEvent(new Event("close", { composed: !0, bubbles: !0 }));
}),
(el = new WeakSet()),
(ed = function (e) {
rj(this, et, e.relatedTarget),
iD(this, e.relatedTarget) || (this.open = !this.open);
}),
(eu = new WeakSet()),
(ec = function (e) {
var t;
!iD(this, e.relatedTarget) &&
(null == (t = rN(this, ee)) || t.focus(),
rN(this, et) &&
rN(this, et) !== e.relatedTarget &&
this.open &&
(this.open = !1));
}),
(eh = new WeakSet()),
(em = function (e) {
var t, i, a, r, n;
let { key: o, ctrlKey: s, altKey: l, metaKey: d } = e;
s ||
l ||
d ||
(this.keysUsed.includes(o) &&
(e.preventDefault(),
e.stopPropagation(),
"Tab" === o
? (e.shiftKey
? null ==
(i =
null == (t = this.previousElementSibling)
? void 0
: t.focus) || i.call(t)
: null ==
(r =
null == (a = this.nextElementSibling)
? void 0
: a.focus) || r.call(a),
this.blur())
: "Escape" === o &&
(null == (n = rN(this, ee)) || n.focus(), (this.open = !1))));
}),
(rH.shadowRootOptions = { mode: "open" }),
(rH.getTemplateHTML = function (e) {
return `
<style>
:host {
font: var(--media-font,
var(--media-font-weight, normal)
var(--media-font-size, 14px) /
var(--media-text-content-height, var(--media-control-height, 24px))
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
display: var(--media-dialog-display, inline-flex);
justify-content: center;
align-items: center;
transition-behavior: allow-discrete;
visibility: hidden;
opacity: 0;
transform: translateY(2px) scale(.99);
pointer-events: none;
}
:host([open]) {
transition: display .2s, visibility 0s, opacity .2s ease-out, transform .15s ease-out;
visibility: visible;
opacity: 1;
transform: translateY(0) scale(1);
pointer-events: auto;
}
#content {
display: flex;
position: relative;
box-sizing: border-box;
width: min(320px, 100%);
word-wrap: break-word;
max-height: 100%;
overflow: auto;
text-align: center;
line-height: 1.4;
}
</style>
${this.getSlotTemplateHTML(e)}
`;
}),
(rH.getSlotTemplateHTML = function (e) {
return `
<slot id="content"></slot>
`;
}),
iA.customElements.get("media-chrome-dialog") ||
iA.customElements.define("media-chrome-dialog", rH);
var rV = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
rW = (e, t, i) => (
rV(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
r$ = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
rB = (e, t, i, a) => (
rV(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
rF = (e, t, i) => (rV(e, t, "access private method"), i);
class rz extends iA.HTMLElement {
constructor() {
if (
(super(),
r$(this, eA),
r$(this, eI),
r$(this, eT),
r$(this, e_),
r$(this, eL),
r$(this, eD),
r$(this, eP),
r$(this, eO),
r$(this, ep, void 0),
r$(this, ev, void 0),
r$(this, eb, void 0),
r$(this, eg, void 0),
r$(this, ef, {}),
r$(this, eE, []),
r$(this, ew, () => {
if (this.range.matches(":focus-visible")) {
let { style: e } = ij(this.shadowRoot, ":host");
e.setProperty(
"--_focus-visible-box-shadow",
"var(--_focus-box-shadow)",
);
}
}),
r$(this, ey, () => {
let { style: e } = ij(this.shadowRoot, ":host");
e.removeProperty("--_focus-visible-box-shadow");
}),
r$(this, ex, () => {
let e = this.shadowRoot.querySelector("#segments-clipping");
e && e.parentNode.append(e);
}),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes),
t = this.constructor.getTemplateHTML(e);
this.shadowRoot.setHTMLUnsafe
? this.shadowRoot.setHTMLUnsafe(t)
: (this.shadowRoot.innerHTML = t);
}
(this.container = this.shadowRoot.querySelector("#container")),
rB(this, eb, this.shadowRoot.querySelector("#startpoint")),
rB(this, eg, this.shadowRoot.querySelector("#endpoint")),
(this.range = this.shadowRoot.querySelector("#range")),
(this.appearance = this.shadowRoot.querySelector("#appearance"));
}
static get observedAttributes() {
return ["disabled", "aria-disabled", tX.MEDIA_CONTROLLER];
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
e === tX.MEDIA_CONTROLLER
? (t &&
(null ==
(r =
null == (a = rW(this, ep)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
rB(this, ep, null)),
i &&
this.isConnected &&
(rB(
this,
ep,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s =
null == (o = rW(this, ep)) ? void 0 : o.associateElement) ||
s.call(o, this)))
: ("disabled" === e || ("aria-disabled" === e && t !== i)) &&
(null == i
? (this.range.removeAttribute(e), rF(this, eI, eC).call(this))
: (this.range.setAttribute(e, i), rF(this, eT, eM).call(this)));
}
connectedCallback() {
var e, t, i;
let { style: a } = ij(this.shadowRoot, ":host");
a.setProperty(
"display",
`var(--media-control-display, var(--${this.localName}-display, inline-flex))`,
),
(rW(this, ef).pointer = ij(this.shadowRoot, "#pointer")),
(rW(this, ef).progress = ij(this.shadowRoot, "#progress")),
(rW(this, ef).thumb = ij(
this.shadowRoot,
'#thumb, ::slotted([slot="thumb"])',
)),
(rW(this, ef).activeSegment = ij(
this.shadowRoot,
"#segments-clipping rect:nth-child(0)",
));
let r = this.getAttribute(tX.MEDIA_CONTROLLER);
r &&
(rB(
this,
ep,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(r),
),
null ==
(i = null == (t = rW(this, ep)) ? void 0 : t.associateElement) ||
i.call(t, this)),
this.updateBar(),
this.shadowRoot.addEventListener("focusin", rW(this, ew)),
this.shadowRoot.addEventListener("focusout", rW(this, ey)),
rF(this, eI, eC).call(this),
iM(this.container, rW(this, ex));
}
disconnectedCallback() {
var e, t;
rF(this, eT, eM).call(this),
null ==
(t = null == (e = rW(this, ep)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
rB(this, ep, null),
this.shadowRoot.removeEventListener("focusin", rW(this, ew)),
this.shadowRoot.removeEventListener("focusout", rW(this, ey)),
i_(this.container, rW(this, ex));
}
updatePointerBar(e) {
var t;
null == (t = rW(this, ef).pointer) ||
t.style.setProperty("width", `${100 * this.getPointerRatio(e)}%`);
}
updateBar() {
var e, t;
let i = 100 * this.range.valueAsNumber;
null == (e = rW(this, ef).progress) ||
e.style.setProperty("width", `${i}%`),
null == (t = rW(this, ef).thumb) ||
t.style.setProperty("left", `${i}%`);
}
updateSegments(e) {
let t = this.shadowRoot.querySelector("#segments-clipping");
if (
((t.textContent = ""),
this.container.classList.toggle(
"segments",
!!(null == e ? void 0 : e.length),
),
!(null == e ? void 0 : e.length))
)
return;
let i = [
...new Set([
+this.range.min,
...e.flatMap((e) => [e.start, e.end]),
+this.range.max,
]),
];
rB(this, eE, [...i]);
let a = i.pop();
for (let [e, r] of i.entries()) {
let [n, o] = [0 === e, e === i.length - 1],
s = n ? "calc(var(--segments-gap) / -1)" : `${100 * r}%`,
l = o ? a : i[e + 1],
d = `calc(${(l - r) * 100}%${n || o ? "" : " - var(--segments-gap)"})`,
u = ik.createElementNS("http://www.w3.org/2000/svg", "rect"),
c = iO(
this.shadowRoot,
`#segments-clipping rect:nth-child(${e + 1})`,
);
c.style.setProperty("x", s),
c.style.setProperty("width", d),
t.append(u);
}
}
getPointerRatio(e) {
var t, i, a, r;
let n, o, s;
return (
(t = e.clientX),
(i = e.clientY),
(a = rW(this, eb).getBoundingClientRect()),
(n = (r = rW(this, eg).getBoundingClientRect()).x - a.x),
0 == (s = n * n + (o = r.y - a.y) * o)
? 0
: Math.max(0, Math.min(1, ((t - a.x) * n + (i - a.y) * o) / s))
);
}
get dragging() {
return this.hasAttribute("dragging");
}
handleEvent(e) {
switch (e.type) {
case "pointermove":
rF(this, eO, eU).call(this, e);
break;
case "input":
this.updateBar();
break;
case "pointerenter":
rF(this, eL, eR).call(this, e);
break;
case "pointerdown":
rF(this, e_, eS).call(this, e);
break;
case "pointerup":
rF(this, eD, eN).call(this);
break;
case "pointerleave":
rF(this, eP, ej).call(this);
}
}
get keysUsed() {
return ["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"];
}
}
(ep = new WeakMap()),
(ev = new WeakMap()),
(eb = new WeakMap()),
(eg = new WeakMap()),
(ef = new WeakMap()),
(eE = new WeakMap()),
(ew = new WeakMap()),
(ey = new WeakMap()),
(ex = new WeakMap()),
(eA = new WeakSet()),
(ek = function (e) {
let t = rW(this, ef).activeSegment;
if (!t) return;
let i = this.getPointerRatio(e),
a = rW(this, eE).findIndex((e, t, a) => {
let r = a[t + 1];
return null != r && i >= e && i <= r;
}),
r = `#segments-clipping rect:nth-child(${a + 1})`;
(t.selectorText == r && t.style.transform) ||
((t.selectorText = r),
t.style.setProperty(
"transform",
"var(--media-range-segment-hover-transform, scaleY(2))",
));
}),
(eI = new WeakSet()),
(eC = function () {
!this.hasAttribute("disabled") &&
this.isConnected &&
(this.addEventListener("input", this),
this.addEventListener("pointerdown", this),
this.addEventListener("pointerenter", this));
}),
(eT = new WeakSet()),
(eM = function () {
var e, t;
this.removeEventListener("input", this),
this.removeEventListener("pointerdown", this),
this.removeEventListener("pointerenter", this),
this.removeEventListener("pointerleave", this),
null == (e = iA.window) || e.removeEventListener("pointerup", this),
null == (t = iA.window) || t.removeEventListener("pointermove", this);
}),
(e_ = new WeakSet()),
(eS = function (e) {
var t;
rB(this, ev, e.composedPath().includes(this.range)),
null == (t = iA.window) ||
t.addEventListener("pointerup", this, { once: !0 });
}),
(eL = new WeakSet()),
(eR = function (e) {
var t;
"mouse" !== e.pointerType && rF(this, e_, eS).call(this, e),
this.addEventListener("pointerleave", this, { once: !0 }),
null == (t = iA.window) || t.addEventListener("pointermove", this);
}),
(eD = new WeakSet()),
(eN = function () {
var e;
null == (e = iA.window) || e.removeEventListener("pointerup", this),
this.toggleAttribute("dragging", !1),
(this.range.disabled = this.hasAttribute("disabled"));
}),
(eP = new WeakSet()),
(ej = function () {
var e, t;
this.removeEventListener("pointerleave", this),
null == (e = iA.window) || e.removeEventListener("pointermove", this),
this.toggleAttribute("dragging", !1),
(this.range.disabled = this.hasAttribute("disabled")),
null == (t = rW(this, ef).activeSegment) ||
t.style.removeProperty("transform");
}),
(eO = new WeakSet()),
(eU = function (e) {
("pen" !== e.pointerType || 0 !== e.buttons) &&
(this.toggleAttribute(
"dragging",
1 === e.buttons || "mouse" !== e.pointerType,
),
this.updatePointerBar(e),
rF(this, eA, ek).call(this, e),
this.dragging &&
("mouse" !== e.pointerType || !rW(this, ev)) &&
((this.range.disabled = !0),
(this.range.valueAsNumber = this.getPointerRatio(e)),
this.range.dispatchEvent(
new Event("input", { bubbles: !0, composed: !0 }),
)));
}),
(rz.shadowRootOptions = { mode: "open" }),
(rz.getTemplateHTML = function (e) {
return `
<style>
:host {
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
--_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));
box-shadow: var(--_focus-visible-box-shadow, none);
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));
display: inline-flex;
align-items: center;
vertical-align: middle;
box-sizing: border-box;
position: relative;
width: 100px;
transition: background .15s linear;
cursor: var(--media-cursor, pointer);
pointer-events: auto;
touch-action: none;
}
input[type=range]:focus {
outline: 0;
}
input[type=range]:focus::-webkit-slider-runnable-track {
outline: 0;
}
:host(:hover) {
background: var(--media-control-hover-background, rgb(50 50 70 / .7));
}
#leftgap {
padding-left: var(--media-range-padding-left, var(--_media-range-padding));
}
#rightgap {
padding-right: var(--media-range-padding-right, var(--_media-range-padding));
}
#startpoint,
#endpoint {
position: absolute;
}
#endpoint {
right: 0;
}
#container {
width: var(--media-range-track-width, 100%);
transform: translate(var(--media-range-track-translate-x, 0px), var(--media-range-track-translate-y, 0px));
position: relative;
height: 100%;
display: flex;
align-items: center;
min-width: 40px;
}
#range {
display: var(--media-time-range-hover-display, block);
bottom: var(--media-time-range-hover-bottom, -7px);
height: var(--media-time-range-hover-height, max(100% + 7px, 25px));
width: 100%;
position: absolute;
cursor: var(--media-cursor, pointer);
-webkit-appearance: none;
-webkit-tap-highlight-color: transparent;
background: transparent;
margin: 0;
z-index: 1;
}
@media (hover: hover) {
#range {
bottom: var(--media-time-range-hover-bottom, -5px);
height: var(--media-time-range-hover-height, max(100% + 5px, 20px));
}
}
#range::-webkit-slider-thumb {
-webkit-appearance: none;
background: transparent;
width: .1px;
height: .1px;
}
#range::-moz-range-thumb {
background: transparent;
border: transparent;
width: .1px;
height: .1px;
}
#appearance {
height: var(--media-range-track-height, 4px);
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
position: absolute;
will-change: transform;
}
#track {
background: var(--media-range-track-background, rgb(255 255 255 / .2));
border-radius: var(--media-range-track-border-radius, 1px);
border: var(--media-range-track-border, none);
outline: var(--media-range-track-outline);
outline-offset: var(--media-range-track-outline-offset);
backdrop-filter: var(--media-range-track-backdrop-filter);
-webkit-backdrop-filter: var(--media-range-track-backdrop-filter);
box-shadow: var(--media-range-track-box-shadow, none);
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
#progress,
#pointer {
position: absolute;
height: 100%;
will-change: width;
}
#progress {
background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));
transition: var(--media-range-track-transition);
}
#pointer {
background: var(--media-range-track-pointer-background);
border-right: var(--media-range-track-pointer-border-right);
transition: visibility .25s, opacity .25s;
visibility: hidden;
opacity: 0;
}
@media (hover: hover) {
:host(:hover) #pointer {
transition: visibility .5s, opacity .5s;
visibility: visible;
opacity: 1;
}
}
#thumb,
::slotted([slot=thumb]) {
width: var(--media-range-thumb-width, 10px);
height: var(--media-range-thumb-height, 10px);
transition: var(--media-range-thumb-transition);
transform: var(--media-range-thumb-transform, none);
opacity: var(--media-range-thumb-opacity, 1);
translate: -50%;
position: absolute;
left: 0;
cursor: var(--media-cursor, pointer);
}
#thumb {
border-radius: var(--media-range-thumb-border-radius, 10px);
background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));
box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);
border: var(--media-range-thumb-border, none);
}
:host([disabled]) #thumb {
background-color: #777;
}
.segments #appearance {
height: var(--media-range-segment-hover-height, 7px);
}
#track {
clip-path: url(#segments-clipping);
}
#segments {
--segments-gap: var(--media-range-segments-gap, 2px);
position: absolute;
width: 100%;
height: 100%;
}
#segments-clipping {
transform: translateX(calc(var(--segments-gap) / 2));
}
#segments-clipping:empty {
display: none;
}
#segments-clipping rect {
height: var(--media-range-track-height, 4px);
y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);
transition: var(--media-range-segment-transition, transform .1s ease-in-out);
transform: var(--media-range-segment-transform, scaleY(1));
transform-origin: center;
}
/* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */
#range-label {
position: absolute;
left: -10000px;
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
pointer-events: none;
}
</style>
<div id="leftgap"></div>
<div id="container">
<div id="startpoint"></div>
<div id="endpoint"></div>
<div id="appearance">
<div id="track" part="track">
<div id="pointer"></div>
<div id="progress" part="progress"></div>
</div>
<slot name="thumb">
<div id="thumb" part="thumb"></div>
</slot>
<svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>
</div>
<input id="range" type="range" min="0" max="1" step="any" value="0">
<label for="range" id="range-label"></label>
${this.getContainerTemplateHTML(e)}
</div>
<div id="rightgap"></div>
`;
}),
(rz.getContainerTemplateHTML = function (e) {
return "";
}),
iA.customElements.get("media-chrome-range") ||
iA.customElements.define("media-chrome-range", rz);
var rG = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
rq = (e, t, i) => (
rG(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
rQ = (e, t, i, a) => (
rG(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class rK extends iA.HTMLElement {
constructor() {
if (
(super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eH, void 0),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
}
static get observedAttributes() {
return [tX.MEDIA_CONTROLLER];
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
e === tX.MEDIA_CONTROLLER &&
(t &&
(null ==
(r =
null == (a = rq(this, eH)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
rQ(this, eH, null)),
i &&
this.isConnected &&
(rQ(
this,
eH,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s = null == (o = rq(this, eH)) ? void 0 : o.associateElement) ||
s.call(o, this)));
}
connectedCallback() {
var e, t, i;
let a = this.getAttribute(tX.MEDIA_CONTROLLER);
a &&
(rQ(
this,
eH,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(a),
),
null ==
(i = null == (t = rq(this, eH)) ? void 0 : t.associateElement) ||
i.call(t, this));
}
disconnectedCallback() {
var e, t;
null ==
(t = null == (e = rq(this, eH)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
rQ(this, eH, null);
}
}
(eH = new WeakMap()),
(rK.shadowRootOptions = { mode: "open" }),
(rK.getTemplateHTML = function (e) {
return `
<style>
:host {
box-sizing: border-box;
display: var(--media-control-display, var(--media-control-bar-display, inline-flex));
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
--media-loading-indicator-icon-height: 44px;
}
::slotted(media-time-range),
::slotted(media-volume-range) {
min-height: 100%;
}
::slotted(media-time-range),
::slotted(media-clip-selector) {
flex-grow: 1;
}
::slotted([role="menu"]) {
position: absolute;
}
</style>
<slot></slot>
`;
}),
iA.customElements.get("media-control-bar") ||
iA.customElements.define("media-control-bar", rK);
var rY = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
rX = (e, t, i) => (
rY(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
rZ = (e, t, i, a) => (
rY(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class rJ extends iA.HTMLElement {
constructor() {
if (
(super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eV, void 0),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
}
static get observedAttributes() {
return [tX.MEDIA_CONTROLLER];
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
e === tX.MEDIA_CONTROLLER &&
(t &&
(null ==
(r =
null == (a = rX(this, eV)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
rZ(this, eV, null)),
i &&
this.isConnected &&
(rZ(
this,
eV,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s = null == (o = rX(this, eV)) ? void 0 : o.associateElement) ||
s.call(o, this)));
}
connectedCallback() {
var e, t, i;
let { style: a } = ij(this.shadowRoot, ":host");
a.setProperty(
"display",
`var(--media-control-display, var(--${this.localName}-display, inline-flex))`,
);
let r = this.getAttribute(tX.MEDIA_CONTROLLER);
r &&
(rZ(
this,
eV,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(r),
),
null ==
(i = null == (t = rX(this, eV)) ? void 0 : t.associateElement) ||
i.call(t, this));
}
disconnectedCallback() {
var e, t;
null ==
(t = null == (e = rX(this, eV)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
rZ(this, eV, null);
}
}
(eV = new WeakMap()),
(rJ.shadowRootOptions = { mode: "open" }),
(rJ.getTemplateHTML = function (e, t = {}) {
return `
<style>
:host {
font: var(--media-font,
var(--media-font-weight, normal)
var(--media-font-size, 14px) /
var(--media-text-content-height, var(--media-control-height, 24px))
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));
padding: var(--media-control-padding, 10px);
display: inline-flex;
justify-content: center;
align-items: center;
vertical-align: middle;
box-sizing: border-box;
text-align: center;
pointer-events: auto;
}
:host(:focus-visible) {
box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
outline: 0;
}
:host(:where(:focus)) {
box-shadow: none;
outline: 0;
}
</style>
${this.getSlotTemplateHTML(e, t)}
`;
}),
(rJ.getSlotTemplateHTML = function (e, t) {
return `
<slot></slot>
`;
}),
iA.customElements.get("media-text-display") ||
iA.customElements.define("media-text-display", rJ);
var r0 = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
r1 = (e, t, i) => (
r0(e, t, "read from private field"), i ? i.call(e) : t.get(e)
);
class r2 extends rJ {
constructor() {
var e;
super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eW, void 0),
((e, t, i, a) => (
r0(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i)
))(this, eW, this.shadowRoot.querySelector("slot")),
(r1(this, eW).textContent = ih(
null != (e = this.mediaDuration) ? e : 0,
));
}
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_DURATION];
}
attributeChangedCallback(e, t, i) {
e === t0.MEDIA_DURATION && (r1(this, eW).textContent = ih(+i)),
super.attributeChangedCallback(e, t, i);
}
get mediaDuration() {
return iU(this, t0.MEDIA_DURATION);
}
set mediaDuration(e) {
iH(this, t0.MEDIA_DURATION, e);
}
}
(eW = new WeakMap()),
(r2.getSlotTemplateHTML = function (e, t) {
return `
<slot>${ih(t.mediaDuration)}</slot>
`;
}),
iA.customElements.get("media-duration-display") ||
iA.customElements.define("media-duration-display", r2);
let r3 = {
2: id("Network Error"),
3: id("Decode Error"),
4: id("Source Not Supported"),
5: id("Encryption Error"),
},
r5 = {
2: id("A network error caused the media download to fail."),
3: id(
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",
),
4: id(
"An unsupported error occurred. The server or network failed, or your browser does not support this format.",
),
5: id("The media is encrypted and there are no keys to decrypt it."),
},
r6 = (e) => {
var t, i;
return 1 === e.code
? null
: {
title: null != (t = r3[e.code]) ? t : `Error ${e.code}`,
message: null != (i = r5[e.code]) ? i : e.message,
};
};
var r4 = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
};
function r8(e) {
var t;
let { title: i, message: a } = null != (t = r6(e)) ? t : {},
r = "";
return (
i && (r += `<slot name="error-${e.code}-title"><h3>${i}</h3></slot>`),
a && (r += `<slot name="error-${e.code}-message"><p>${a}</p></slot>`),
r
);
}
let r7 = [t0.MEDIA_ERROR_CODE, t0.MEDIA_ERROR_MESSAGE];
class r9 extends rH {
constructor() {
super(...arguments),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, e$, null);
}
static get observedAttributes() {
return [...super.observedAttributes, ...r7];
}
formatErrorMessage(e) {
return this.constructor.formatErrorMessage(e);
}
attributeChangedCallback(e, t, i) {
var a;
if ((super.attributeChangedCallback(e, t, i), !r7.includes(e))) return;
let r =
null != (a = this.mediaError)
? a
: { code: this.mediaErrorCode, message: this.mediaErrorMessage };
if (
((this.open = r.code && null !== r6(r)),
this.open &&
((this.shadowRoot.querySelector("slot").name =
`error-${this.mediaErrorCode}`),
(this.shadowRoot.querySelector("#content").innerHTML =
this.formatErrorMessage(r)),
!this.hasAttribute("aria-label")))
) {
let { title: e } = r6(r);
e && this.setAttribute("aria-label", e);
}
}
get mediaError() {
var e, t;
return (
r4(this, (e = e$), "read from private field"),
t ? t.call(this) : e.get(this)
);
}
set mediaError(e) {
var t, i;
r4(this, (t = e$), "write to private field"),
i ? i.call(this, e) : t.set(this, e);
}
get mediaErrorCode() {
return iU(this, "mediaerrorcode");
}
set mediaErrorCode(e) {
iH(this, "mediaerrorcode", e);
}
get mediaErrorMessage() {
return i$(this, "mediaerrormessage");
}
set mediaErrorMessage(e) {
iB(this, "mediaerrormessage", e);
}
}
(e$ = new WeakMap()),
(r9.getSlotTemplateHTML = function (e) {
return `
<style>
:host {
background: rgb(20 20 30 / .8);
}
#content {
display: block;
padding: 1.2em 1.5em;
}
h3,
p {
margin-block: 0 .3em;
}
</style>
<slot name="error-${e.mediaerrorcode}" id="content">
${r8({ code: +e.mediaerrorcode, message: e.mediaerrormessage })}
</slot>
`;
}),
(r9.formatErrorMessage = r8),
iA.customElements.get("media-error-dialog") ||
iA.customElements.define("media-error-dialog", r9);
var ne = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot read from private field");
return i ? i.call(e) : t.get(e);
},
nt = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
};
class ni extends rH {
constructor() {
super(...arguments),
nt(this, eB, (e) => {
var t;
if (!this.open) return;
let i =
null == (t = this.shadowRoot)
? void 0
: t.querySelector("#content");
if (!i) return;
let a = e.composedPath(),
r = a[0] === this || a.includes(this),
n = a.includes(i);
r && !n && (this.open = !1);
}),
nt(this, eF, (e) => {
if (!this.open) return;
let t = e.shiftKey && ("/" === e.key || "?" === e.key);
("Escape" !== e.key && !t) ||
e.ctrlKey ||
e.altKey ||
e.metaKey ||
((this.open = !1), e.preventDefault(), e.stopPropagation());
});
}
connectedCallback() {
super.connectedCallback(),
this.open &&
(this.addEventListener("click", ne(this, eB)),
document.addEventListener("keydown", ne(this, eF)));
}
disconnectedCallback() {
this.removeEventListener("click", ne(this, eB)),
document.removeEventListener("keydown", ne(this, eF));
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
"open" === e &&
(this.open
? (this.addEventListener("click", ne(this, eB)),
document.addEventListener("keydown", ne(this, eF)))
: (this.removeEventListener("click", ne(this, eB)),
document.removeEventListener("keydown", ne(this, eF))));
}
}
(eB = new WeakMap()),
(eF = new WeakMap()),
(ni.getSlotTemplateHTML = function (e) {
let t;
return `
<style>
:host {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
background: rgb(20 20 30 / .8);
backdrop-filter: blur(10px);
}
#content {
display: block;
width: clamp(400px, 40vw, 700px);
max-width: 90vw;
text-align: left;
}
h2 {
margin: 0 0 1.5rem 0;
font-size: 1.5rem;
font-weight: 500;
text-align: center;
}
.shortcuts-table {
width: 100%;
border-collapse: collapse;
}
.shortcuts-table tr {
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.shortcuts-table tr:last-child {
border-bottom: none;
}
.shortcuts-table td {
padding: 0.75rem 0.5rem;
}
.shortcuts-table td:first-child {
text-align: right;
padding-right: 1rem;
width: 40%;
min-width: 120px;
}
.shortcuts-table td:last-child {
padding-left: 1rem;
}
.key {
display: inline-block;
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 4px;
padding: 0.25rem 0.5rem;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
font-weight: 500;
min-width: 1.5rem;
text-align: center;
margin: 0 0.2rem;
}
.description {
color: rgba(255, 255, 255, 0.9);
font-size: 0.95rem;
}
.key-combo {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 0.3rem;
}
.key-separator {
color: rgba(255, 255, 255, 0.5);
font-size: 0.9rem;
}
</style>
<slot id="content">
${
((t = [
{ keys: ["Space", "k"], description: "Toggle Playback" },
{ keys: ["m"], description: "Toggle mute" },
{ keys: ["f"], description: "Toggle fullscreen" },
{
keys: ["c"],
description: "Toggle captions or subtitles, if available",
},
{ keys: ["p"], description: "Toggle Picture in Picture" },
{ keys: ["←", "j"], description: "Seek back 10s" },
{ keys: ["→", "l"], description: "Seek forward 10s" },
{ keys: ["↑"], description: "Turn volume up" },
{ keys: ["↓"], description: "Turn volume down" },
{ keys: ["< (SHIFT+,)"], description: "Decrease playback rate" },
{ keys: ["> (SHIFT+.)"], description: "Increase playback rate" },
]
.map(({ keys: e, description: t }) => {
let i = e
.map((e, t) =>
t > 0
? `<span class="key-separator">or</span><span class="key">${e}</span>`
: `<span class="key">${e}</span>`,
)
.join("");
return `
<tr>
<td>
<div class="key-combo">${i}</div>
</td>
<td class="description">${t}</td>
</tr>
`;
})
.join("")),
`
<h2>Keyboard Shortcuts</h2>
<table class="shortcuts-table">${t}</table>
`)
}
</slot>
`;
}),
iA.customElements.get("media-keyboard-shortcuts-dialog") ||
iA.customElements.define("media-keyboard-shortcuts-dialog", ni);
var na = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
};
let nr = `<svg aria-hidden="true" viewBox="0 0 26 24">
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
</svg>`,
nn = `<svg aria-hidden="true" viewBox="0 0 26 24">
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
</svg>`,
no = (e) => {
let t = e.mediaIsFullscreen
? id("exit fullscreen mode")
: id("enter fullscreen mode");
e.setAttribute("aria-label", t);
};
class ns extends ry {
constructor() {
super(...arguments),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, ez, null);
}
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_IS_FULLSCREEN,
t0.MEDIA_FULLSCREEN_UNAVAILABLE,
];
}
connectedCallback() {
super.connectedCallback(), no(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_IS_FULLSCREEN && no(this);
}
get mediaFullscreenUnavailable() {
return i$(this, t0.MEDIA_FULLSCREEN_UNAVAILABLE);
}
set mediaFullscreenUnavailable(e) {
iB(this, t0.MEDIA_FULLSCREEN_UNAVAILABLE, e);
}
get mediaIsFullscreen() {
return iV(this, t0.MEDIA_IS_FULLSCREEN);
}
set mediaIsFullscreen(e) {
iW(this, t0.MEDIA_IS_FULLSCREEN, e);
}
handleClick(e) {
var t, i, a, r;
na(this, (t = ez), "write to private field"),
i ? i.call(this, e) : t.set(this, e);
let n =
(na(this, (a = ez), "read from private field"),
(r ? r.call(this) : a.get(this)) instanceof PointerEvent),
o = this.mediaIsFullscreen
? new iA.CustomEvent(tY.MEDIA_EXIT_FULLSCREEN_REQUEST, {
composed: !0,
bubbles: !0,
})
: new iA.CustomEvent(tY.MEDIA_ENTER_FULLSCREEN_REQUEST, {
composed: !0,
bubbles: !0,
detail: n,
});
this.dispatchEvent(o);
}
}
(ez = new WeakMap()),
(ns.getSlotTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
display: none !important;
}
:host(:not([${t0.MEDIA_IS_FULLSCREEN}])) slot[name=icon] slot:not([name=enter]) {
display: none !important;
}
:host([${t0.MEDIA_IS_FULLSCREEN}]) slot[name=tooltip-enter],
:host(:not([${t0.MEDIA_IS_FULLSCREEN}])) slot[name=tooltip-exit] {
display: none;
}
</style>
<slot name="icon">
<slot name="enter">${nr}</slot>
<slot name="exit">${nn}</slot>
</slot>
`;
}),
(ns.getTooltipContentHTML = function () {
return `
<slot name="tooltip-enter">${id("Enter fullscreen mode")}</slot>
<slot name="tooltip-exit">${id("Exit fullscreen mode")}</slot>
`;
}),
iA.customElements.get("media-fullscreen-button") ||
iA.customElements.define("media-fullscreen-button", ns);
let { MEDIA_TIME_IS_LIVE: nl, MEDIA_PAUSED: nd } = t0,
{ MEDIA_SEEK_TO_LIVE_REQUEST: nu, MEDIA_PLAY_REQUEST: nc } = tY,
nh = (e) => {
var t;
let i = e.mediaPaused || !e.mediaTimeIsLive,
a = i ? id("seek to live") : id("playing live");
e.setAttribute("aria-label", a);
let r =
null == (t = e.shadowRoot)
? void 0
: t.querySelector('slot[name="text"]');
r && (r.textContent = id("live")),
i
? e.removeAttribute("aria-disabled")
: e.setAttribute("aria-disabled", "true");
};
class nm extends ry {
static get observedAttributes() {
return [...super.observedAttributes, nl, nd];
}
connectedCallback() {
super.connectedCallback(), nh(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i), nh(this);
}
get mediaPaused() {
return iV(this, t0.MEDIA_PAUSED);
}
set mediaPaused(e) {
iW(this, t0.MEDIA_PAUSED, e);
}
get mediaTimeIsLive() {
return iV(this, t0.MEDIA_TIME_IS_LIVE);
}
set mediaTimeIsLive(e) {
iW(this, t0.MEDIA_TIME_IS_LIVE, e);
}
handleClick() {
(this.mediaPaused || !this.mediaTimeIsLive) &&
(this.dispatchEvent(
new iA.CustomEvent(nu, { composed: !0, bubbles: !0 }),
),
this.hasAttribute(nd) &&
this.dispatchEvent(
new iA.CustomEvent(nc, { composed: !0, bubbles: !0 }),
));
}
}
(nm.getSlotTemplateHTML = function (e) {
return `
<style>
:host { --media-tooltip-display: none; }
slot[name=indicator] > *,
:host ::slotted([slot=indicator]) {
min-width: auto;
fill: var(--media-live-button-icon-color, rgb(140, 140, 140));
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
}
:host([${nl}]:not([${nd}])) slot[name=indicator] > *,
:host([${nl}]:not([${nd}])) ::slotted([slot=indicator]) {
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
}
:host([${nl}]:not([${nd}])) {
cursor: var(--media-cursor, not-allowed);
}
slot[name=text]{
text-transform: uppercase;
}
</style>
<slot name="indicator"><svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg></slot>
<slot name="spacer">&nbsp;</slot><slot name="text">${id("live")}</slot>
`;
}),
iA.customElements.get("media-live-button") ||
iA.customElements.define("media-live-button", nm);
var np = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
nv = (e, t, i) => (
np(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
nb = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
ng = (e, t, i, a) => (
np(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
let nf = "loadingdelay",
nE = "noautohide",
nw = `
<svg aria-hidden="true" viewBox="0 0 100 100">
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="1s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</path>
</svg>
`;
class ny extends iA.HTMLElement {
constructor() {
if (
(super(), nb(this, eG, void 0), nb(this, eq, 500), !this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
}
static get observedAttributes() {
return [tX.MEDIA_CONTROLLER, t0.MEDIA_PAUSED, t0.MEDIA_LOADING, nf];
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
e === nf && t !== i
? (this.loadingDelay = Number(i))
: e === tX.MEDIA_CONTROLLER &&
(t &&
(null ==
(r =
null == (a = nv(this, eG)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
ng(this, eG, null)),
i &&
this.isConnected &&
(ng(
this,
eG,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s =
null == (o = nv(this, eG)) ? void 0 : o.associateElement) ||
s.call(o, this)));
}
connectedCallback() {
var e, t, i;
let a = this.getAttribute(tX.MEDIA_CONTROLLER);
a &&
(ng(
this,
eG,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(a),
),
null ==
(i = null == (t = nv(this, eG)) ? void 0 : t.associateElement) ||
i.call(t, this));
}
disconnectedCallback() {
var e, t;
null ==
(t = null == (e = nv(this, eG)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
ng(this, eG, null);
}
get loadingDelay() {
return nv(this, eq);
}
set loadingDelay(e) {
ng(this, eq, e);
let { style: t } = ij(this.shadowRoot, ":host");
t.setProperty(
"--_loading-indicator-delay",
`var(--media-loading-indicator-transition-delay, ${e}ms)`,
);
}
get mediaPaused() {
return iV(this, t0.MEDIA_PAUSED);
}
set mediaPaused(e) {
iW(this, t0.MEDIA_PAUSED, e);
}
get mediaLoading() {
return iV(this, t0.MEDIA_LOADING);
}
set mediaLoading(e) {
iW(this, t0.MEDIA_LOADING, e);
}
get mediaController() {
return i$(this, tX.MEDIA_CONTROLLER);
}
set mediaController(e) {
iB(this, tX.MEDIA_CONTROLLER, e);
}
get noAutohide() {
return iV(this, nE);
}
set noAutohide(e) {
iW(this, nE, e);
}
}
(eG = new WeakMap()),
(eq = new WeakMap()),
(ny.shadowRootOptions = { mode: "open" }),
(ny.getTemplateHTML = function (e) {
return `
<style>
:host {
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
vertical-align: middle;
box-sizing: border-box;
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, 500ms);
}
#status {
color: rgba(0,0,0,0);
width: 0px;
height: 0px;
}
:host slot[name=icon] > *,
:host ::slotted([slot=icon]) {
opacity: var(--media-loading-indicator-opacity, 0);
transition: opacity 0.15s;
}
:host([${t0.MEDIA_LOADING}]:not([${t0.MEDIA_PAUSED}])) slot[name=icon] > *,
:host([${t0.MEDIA_LOADING}]:not([${t0.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
opacity: var(--media-loading-indicator-opacity, 1);
transition: opacity 0.15s var(--_loading-indicator-delay);
}
:host #status {
visibility: var(--media-loading-indicator-opacity, hidden);
transition: visibility 0.15s;
}
:host([${t0.MEDIA_LOADING}]:not([${t0.MEDIA_PAUSED}])) #status {
visibility: var(--media-loading-indicator-opacity, visible);
transition: visibility 0.15s var(--_loading-indicator-delay);
}
svg, img, ::slotted(svg), ::slotted(img) {
width: var(--media-loading-indicator-icon-width);
height: var(--media-loading-indicator-icon-height, 100px);
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
vertical-align: middle;
}
</style>
<slot name="icon">${nw}</slot>
<div id="status" role="status" aria-live="polite">${id("media loading")}</div>
`;
}),
iA.customElements.get("media-loading-indicator") ||
iA.customElements.define("media-loading-indicator", ny);
let nx = `<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
</svg>`,
nA = `<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
</svg>`,
nk = `<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
</svg>`,
nI = (e) => {
let t = "off" === e.mediaVolumeLevel ? id("unmute") : id("mute");
e.setAttribute("aria-label", t);
};
class nC extends ry {
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_VOLUME_LEVEL];
}
connectedCallback() {
super.connectedCallback(), nI(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_VOLUME_LEVEL && nI(this);
}
get mediaVolumeLevel() {
return i$(this, t0.MEDIA_VOLUME_LEVEL);
}
set mediaVolumeLevel(e) {
iB(this, t0.MEDIA_VOLUME_LEVEL, e);
}
handleClick() {
let e =
"off" === this.mediaVolumeLevel
? tY.MEDIA_UNMUTE_REQUEST
: tY.MEDIA_MUTE_REQUEST;
this.dispatchEvent(
new iA.CustomEvent(e, { composed: !0, bubbles: !0 }),
);
}
}
(nC.getSlotTemplateHTML = function (e) {
return `
<style>
:host(:not([${t0.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
:host([${t0.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
display: none !important;
}
:host([${t0.MEDIA_VOLUME_LEVEL}=off]) slot[name=icon] slot:not([name=off]) {
display: none !important;
}
:host([${t0.MEDIA_VOLUME_LEVEL}=low]) slot[name=icon] slot:not([name=low]) {
display: none !important;
}
:host([${t0.MEDIA_VOLUME_LEVEL}=medium]) slot[name=icon] slot:not([name=medium]) {
display: none !important;
}
:host(:not([${t0.MEDIA_VOLUME_LEVEL}=off])) slot[name=tooltip-unmute],
:host([${t0.MEDIA_VOLUME_LEVEL}=off]) slot[name=tooltip-mute] {
display: none;
}
</style>
<slot name="icon">
<slot name="off">${nx}</slot>
<slot name="low">${nA}</slot>
<slot name="medium">${nA}</slot>
<slot name="high">${nk}</slot>
</slot>
`;
}),
(nC.getTooltipContentHTML = function () {
return `
<slot name="tooltip-mute">${id("Mute")}</slot>
<slot name="tooltip-unmute">${id("Unmute")}</slot>
`;
}),
iA.customElements.get("media-mute-button") ||
iA.customElements.define("media-mute-button", nC);
let nT = `<svg aria-hidden="true" viewBox="0 0 28 24">
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
</svg>`,
nM = (e) => {
let t = e.mediaIsPip
? id("exit picture in picture mode")
: id("enter picture in picture mode");
e.setAttribute("aria-label", t);
};
class n_ extends ry {
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_IS_PIP,
t0.MEDIA_PIP_UNAVAILABLE,
];
}
connectedCallback() {
super.connectedCallback(), nM(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_IS_PIP && nM(this);
}
get mediaPipUnavailable() {
return i$(this, t0.MEDIA_PIP_UNAVAILABLE);
}
set mediaPipUnavailable(e) {
iB(this, t0.MEDIA_PIP_UNAVAILABLE, e);
}
get mediaIsPip() {
return iV(this, t0.MEDIA_IS_PIP);
}
set mediaIsPip(e) {
iW(this, t0.MEDIA_IS_PIP, e);
}
handleClick() {
let e = this.mediaIsPip
? tY.MEDIA_EXIT_PIP_REQUEST
: tY.MEDIA_ENTER_PIP_REQUEST;
this.dispatchEvent(
new iA.CustomEvent(e, { composed: !0, bubbles: !0 }),
);
}
}
(n_.getSlotTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
display: none !important;
}
:host(:not([${t0.MEDIA_IS_PIP}])) slot[name=icon] slot:not([name=enter]) {
display: none !important;
}
:host([${t0.MEDIA_IS_PIP}]) slot[name=tooltip-enter],
:host(:not([${t0.MEDIA_IS_PIP}])) slot[name=tooltip-exit] {
display: none;
}
</style>
<slot name="icon">
<slot name="enter">${nT}</slot>
<slot name="exit">${nT}</slot>
</slot>
`;
}),
(n_.getTooltipContentHTML = function () {
return `
<slot name="tooltip-enter">${id("Enter picture in picture mode")}</slot>
<slot name="tooltip-exit">${id("Exit picture in picture mode")}</slot>
`;
}),
iA.customElements.get("media-pip-button") ||
iA.customElements.define("media-pip-button", n_);
var nS = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot read from private field");
return i ? i.call(e) : t.get(e);
};
let nL = "rates",
nR = [1, 1.2, 1.5, 1.7, 2];
class nD extends ry {
constructor() {
var e;
super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eQ, new ar(this, nL, { defaultValue: nR })),
(this.container = this.shadowRoot.querySelector('slot[name="icon"]')),
(this.container.innerHTML = `${null != (e = this.mediaPlaybackRate) ? e : 1}x`);
}
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_PLAYBACK_RATE, nL];
}
attributeChangedCallback(e, t, i) {
if (
(super.attributeChangedCallback(e, t, i),
e === nL && (nS(this, eQ).value = i),
e === t0.MEDIA_PLAYBACK_RATE)
) {
let e = i ? +i : NaN,
t = Number.isNaN(e) ? 1 : e;
(this.container.innerHTML = `${t}x`),
this.setAttribute(
"aria-label",
id("Playback rate {playbackRate}", { playbackRate: t }),
);
}
}
get rates() {
return nS(this, eQ);
}
set rates(e) {
e
? Array.isArray(e)
? (nS(this, eQ).value = e.join(" "))
: "string" == typeof e && (nS(this, eQ).value = e)
: (nS(this, eQ).value = "");
}
get mediaPlaybackRate() {
return iU(this, t0.MEDIA_PLAYBACK_RATE, 1);
}
set mediaPlaybackRate(e) {
iH(this, t0.MEDIA_PLAYBACK_RATE, e);
}
handleClick() {
var e, t;
let i = Array.from(nS(this, eQ).values(), (e) => +e).sort(
(e, t) => e - t,
),
a =
null !=
(t =
null != (e = i.find((e) => e > this.mediaPlaybackRate))
? e
: i[0])
? t
: 1,
r = new iA.CustomEvent(tY.MEDIA_PLAYBACK_RATE_REQUEST, {
composed: !0,
bubbles: !0,
detail: a,
});
this.dispatchEvent(r);
}
}
(eQ = new WeakMap()),
(nD.getSlotTemplateHTML = function (e) {
return `
<style>
:host {
min-width: 5ch;
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
}
</style>
<slot name="icon">${e.mediaplaybackrate || 1}x</slot>
`;
}),
(nD.getTooltipContentHTML = function () {
return id("Playback rate");
}),
iA.customElements.get("media-playback-rate-button") ||
iA.customElements.define("media-playback-rate-button", nD);
let nN = `<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="m6 21 15-9L6 3v18Z"/>
</svg>`,
nP = `<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
</svg>`,
nj = (e) => {
let t = e.mediaPaused ? id("play") : id("pause");
e.setAttribute("aria-label", t);
};
class nO extends ry {
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_PAUSED, t0.MEDIA_ENDED];
}
connectedCallback() {
super.connectedCallback(), nj(this);
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
(e === t0.MEDIA_PAUSED || e === t0.MEDIA_LANG) && nj(this);
}
get mediaPaused() {
return iV(this, t0.MEDIA_PAUSED);
}
set mediaPaused(e) {
iW(this, t0.MEDIA_PAUSED, e);
}
handleClick() {
let e = this.mediaPaused
? tY.MEDIA_PLAY_REQUEST
: tY.MEDIA_PAUSE_REQUEST;
this.dispatchEvent(
new iA.CustomEvent(e, { composed: !0, bubbles: !0 }),
);
}
}
(nO.getSlotTemplateHTML = function (e) {
return `
<style>
:host([${t0.MEDIA_PAUSED}]) slot[name=pause],
:host(:not([${t0.MEDIA_PAUSED}])) slot[name=play] {
display: none !important;
}
:host([${t0.MEDIA_PAUSED}]) slot[name=tooltip-pause],
:host(:not([${t0.MEDIA_PAUSED}])) slot[name=tooltip-play] {
display: none;
}
</style>
<slot name="icon">
<slot name="play">${nN}</slot>
<slot name="pause">${nP}</slot>
</slot>
`;
}),
(nO.getTooltipContentHTML = function () {
return `
<slot name="tooltip-play">${id("Play")}</slot>
<slot name="tooltip-pause">${id("Pause")}</slot>
`;
}),
iA.customElements.get("media-play-button") ||
iA.customElements.define("media-play-button", nO);
let nU = "placeholdersrc";
class nH extends iA.HTMLElement {
static get observedAttributes() {
return [nU, "src"];
}
constructor() {
if ((super(), !this.shadowRoot)) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
this.image = this.shadowRoot.querySelector("#image");
}
attributeChangedCallback(e, t, i) {
if (
("src" === e &&
(null == i
? this.image.removeAttribute("src")
: this.image.setAttribute("src", i)),
e === nU)
)
if (null == i) this.image.style.removeProperty("background-image");
else {
var a;
(a = this.image), (a.style["background-image"] = `url('${i}')`);
}
}
get placeholderSrc() {
return i$(this, nU);
}
set placeholderSrc(e) {
iB(this, "src", e);
}
get src() {
return i$(this, "src");
}
set src(e) {
iB(this, "src", e);
}
}
(nH.shadowRootOptions = { mode: "open" }),
(nH.getTemplateHTML = function (e) {
return `
<style>
:host {
pointer-events: none;
display: var(--media-poster-image-display, inline-block);
box-sizing: border-box;
}
img {
max-width: 100%;
max-height: 100%;
min-width: 100%;
min-height: 100%;
background-repeat: no-repeat;
background-position: var(--media-poster-image-background-position, var(--media-object-position, center));
background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));
object-fit: var(--media-object-fit, contain);
object-position: var(--media-object-position, center);
}
</style>
<img part="poster img" aria-hidden="true" id="image"/>
`;
}),
iA.customElements.get("media-poster-image") ||
iA.customElements.define("media-poster-image", nH);
var nV = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
};
class nW extends rJ {
constructor() {
super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eK, void 0),
((e, t, i, a) => (
nV(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i)
))(this, eK, this.shadowRoot.querySelector("slot"));
}
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_PREVIEW_CHAPTER,
t0.MEDIA_LANG,
];
}
attributeChangedCallback(e, t, i) {
if (
(super.attributeChangedCallback(e, t, i),
(e === t0.MEDIA_PREVIEW_CHAPTER || e === t0.MEDIA_LANG) &&
i !== t &&
null != i)
) {
var a, r;
if (
(((nV(this, (a = eK), "read from private field"),
r ? r.call(this) : a.get(this)).textContent = i),
"" !== i)
) {
let e = id("chapter: {chapterName}", { chapterName: i });
this.setAttribute("aria-valuetext", e);
} else this.removeAttribute("aria-valuetext");
}
}
get mediaPreviewChapter() {
return i$(this, t0.MEDIA_PREVIEW_CHAPTER);
}
set mediaPreviewChapter(e) {
iB(this, t0.MEDIA_PREVIEW_CHAPTER, e);
}
}
(eK = new WeakMap()),
iA.customElements.get("media-preview-chapter-display") ||
iA.customElements.define("media-preview-chapter-display", nW);
var n$ = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
nB = (e, t, i) => (
n$(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
nF = (e, t, i, a) => (
n$(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class nz extends iA.HTMLElement {
constructor() {
if (
(super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eY, void 0),
!this.shadowRoot)
) {
this.attachShadow(this.constructor.shadowRootOptions);
const e = iS(this.attributes);
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(e);
}
}
static get observedAttributes() {
return [
tX.MEDIA_CONTROLLER,
t0.MEDIA_PREVIEW_IMAGE,
t0.MEDIA_PREVIEW_COORDS,
];
}
connectedCallback() {
var e, t, i;
let a = this.getAttribute(tX.MEDIA_CONTROLLER);
a &&
(nF(
this,
eY,
null == (e = this.getRootNode()) ? void 0 : e.getElementById(a),
),
null ==
(i = null == (t = nB(this, eY)) ? void 0 : t.associateElement) ||
i.call(t, this));
}
disconnectedCallback() {
var e, t;
null ==
(t = null == (e = nB(this, eY)) ? void 0 : e.unassociateElement) ||
t.call(e, this),
nF(this, eY, null);
}
attributeChangedCallback(e, t, i) {
var a, r, n, o, s;
[t0.MEDIA_PREVIEW_IMAGE, t0.MEDIA_PREVIEW_COORDS].includes(e) &&
this.update(),
e === tX.MEDIA_CONTROLLER &&
(t &&
(null ==
(r =
null == (a = nB(this, eY)) ? void 0 : a.unassociateElement) ||
r.call(a, this),
nF(this, eY, null)),
i &&
this.isConnected &&
(nF(
this,
eY,
null == (n = this.getRootNode()) ? void 0 : n.getElementById(i),
),
null ==
(s =
null == (o = nB(this, eY)) ? void 0 : o.associateElement) ||
s.call(o, this)));
}
get mediaPreviewImage() {
return i$(this, t0.MEDIA_PREVIEW_IMAGE);
}
set mediaPreviewImage(e) {
iB(this, t0.MEDIA_PREVIEW_IMAGE, e);
}
get mediaPreviewCoords() {
let e = this.getAttribute(t0.MEDIA_PREVIEW_COORDS);
if (e) return e.split(/\s+/).map((e) => +e);
}
set mediaPreviewCoords(e) {
e
? this.setAttribute(t0.MEDIA_PREVIEW_COORDS, e.join(" "))
: this.removeAttribute(t0.MEDIA_PREVIEW_COORDS);
}
update() {
let e,
t,
i = this.mediaPreviewCoords,
a = this.mediaPreviewImage;
if (!(i && a)) return;
let [r, n, o, s] = i,
l = a.split("#")[0],
d = getComputedStyle(this),
{ maxWidth: u, maxHeight: c, minWidth: h, minHeight: m } = d;
if (
"fill" ===
(d.getPropertyValue("--media-preview-thumbnail-object-fit").trim() ||
"contain")
) {
let i = parseInt(u) / o,
a = parseInt(c) / s,
r = parseInt(h) / o,
n = parseInt(m) / s;
(e = i < 1 ? i : Math.max(i, r)), (t = a < 1 ? a : Math.max(a, n));
} else {
let i = Math.min(parseInt(u) / o, parseInt(c) / s),
a = Math.max(parseInt(h) / o, parseInt(m) / s),
r = i < 1 ? i : a > 1 ? a : 1;
(e = r), (t = r);
}
let { style: p } = ij(this.shadowRoot, ":host"),
v = ij(this.shadowRoot, "img").style,
b = this.shadowRoot.querySelector("img"),
g = 1 > Math.min(e, t) ? "min" : "max";
p.setProperty(`${g}-width`, "initial", "important"),
p.setProperty(`${g}-height`, "initial", "important"),
(p.width = `${o * e}px`),
(p.height = `${s * t}px`);
let f = () => {
(v.width = `${this.imgWidth * e}px`),
(v.height = `${this.imgHeight * t}px`),
(v.display = "block");
};
b.src !== l &&
((b.onload = () => {
(this.imgWidth = b.naturalWidth),
(this.imgHeight = b.naturalHeight),
f(),
(b.onload = null);
}),
(b.src = l),
f()),
f(),
(v.transform = `translate(-${r * e}px, -${n * t}px)`);
}
}
(eY = new WeakMap()),
(nz.shadowRootOptions = { mode: "open" }),
(nz.getTemplateHTML = function (e) {
return `
<style>
:host {
box-sizing: border-box;
display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));
overflow: hidden;
}
img {
display: none;
position: relative;
}
</style>
<img crossorigin loading="eager" decoding="async">
`;
}),
iA.customElements.get("media-preview-thumbnail") ||
iA.customElements.define("media-preview-thumbnail", nz);
var nG = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
nq = (e, t, i) => (
nG(e, t, "read from private field"), i ? i.call(e) : t.get(e)
);
class nQ extends rJ {
constructor() {
super(),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, eX, void 0),
((e, t, i, a) => (
nG(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i)
))(this, eX, this.shadowRoot.querySelector("slot")),
(nq(this, eX).textContent = ih(0));
}
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_PREVIEW_TIME];
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_PREVIEW_TIME &&
null != i &&
(nq(this, eX).textContent = ih(parseFloat(i)));
}
get mediaPreviewTime() {
return iU(this, t0.MEDIA_PREVIEW_TIME);
}
set mediaPreviewTime(e) {
iH(this, t0.MEDIA_PREVIEW_TIME, e);
}
}
(eX = new WeakMap()),
iA.customElements.get("media-preview-time-display") ||
iA.customElements.define("media-preview-time-display", nQ);
let nK = "seekoffset";
class nY extends ry {
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_CURRENT_TIME, nK];
}
connectedCallback() {
super.connectedCallback(), (this.seekOffset = iU(this, nK, 30));
}
attributeChangedCallback(e, t, i) {
var a;
super.attributeChangedCallback(e, t, i),
(a = this.seekOffset),
this.setAttribute(
"aria-label",
id("seek back {seekOffset} seconds", { seekOffset: a }),
),
e === nK && (this.seekOffset = iU(this, nK, 30));
}
get seekOffset() {
return iU(this, nK, 30);
}
set seekOffset(e) {
iH(this, nK, e),
this.setAttribute(
"aria-label",
id("seek back {seekOffset} seconds", {
seekOffset: this.seekOffset,
}),
),
iL(iR(this, "icon"), this.seekOffset);
}
get mediaCurrentTime() {
return iU(this, t0.MEDIA_CURRENT_TIME, 0);
}
set mediaCurrentTime(e) {
iH(this, t0.MEDIA_CURRENT_TIME, e);
}
handleClick() {
let e = Math.max(this.mediaCurrentTime - this.seekOffset, 0),
t = new iA.CustomEvent(tY.MEDIA_SEEK_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
});
this.dispatchEvent(t);
}
}
(nY.getSlotTemplateHTML = function (e, t) {
let i;
return `
<slot name="icon">${
((i = t.seekOffset),
`
<svg aria-hidden="true" viewBox="0 0 20 24">
<defs>
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
</defs>
<text class="text value" transform="translate(2.18 19.87)">${i}</text>
<path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>
</svg>`)
}</slot>
`;
}),
(nY.getTooltipContentHTML = function () {
return id("Seek backward");
}),
iA.customElements.get("media-seek-backward-button") ||
iA.customElements.define("media-seek-backward-button", nY);
let nX = "seekoffset";
class nZ extends ry {
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_CURRENT_TIME, nX];
}
connectedCallback() {
super.connectedCallback(), (this.seekOffset = iU(this, nX, 30));
}
attributeChangedCallback(e, t, i) {
var a;
super.attributeChangedCallback(e, t, i),
(a = this.seekOffset),
this.setAttribute(
"aria-label",
id("seek forward {seekOffset} seconds", { seekOffset: a }),
),
e === nX && (this.seekOffset = iU(this, nX, 30));
}
get seekOffset() {
return iU(this, nX, 30);
}
set seekOffset(e) {
iH(this, nX, e),
this.setAttribute(
"aria-label",
id("seek forward {seekOffset} seconds", {
seekOffset: this.seekOffset,
}),
),
iL(iR(this, "icon"), this.seekOffset);
}
get mediaCurrentTime() {
return iU(this, t0.MEDIA_CURRENT_TIME, 0);
}
set mediaCurrentTime(e) {
iH(this, t0.MEDIA_CURRENT_TIME, e);
}
handleClick() {
let e = this.mediaCurrentTime + this.seekOffset,
t = new iA.CustomEvent(tY.MEDIA_SEEK_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
});
this.dispatchEvent(t);
}
}
(nZ.getSlotTemplateHTML = function (e, t) {
let i;
return `
<slot name="icon">${
((i = t.seekOffset),
`
<svg aria-hidden="true" viewBox="0 0 20 24">
<defs>
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
</defs>
<text class="text value" transform="translate(8.9 19.87)">${i}</text>
<path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
</svg>`)
}</slot>
`;
}),
(nZ.getTooltipContentHTML = function () {
return id("Seek forward");
}),
iA.customElements.get("media-seek-forward-button") ||
iA.customElements.define("media-seek-forward-button", nZ);
var nJ = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
n0 = (e, t, i) => (
nJ(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
n1 = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
n2 = (e, t, i, a) => (
nJ(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
n3 = (e, t, i) => (nJ(e, t, "access private method"), i);
let n5 = {
REMAINING: "remaining",
SHOW_DURATION: "showduration",
NO_TOGGLE: "notoggle",
},
n6 = [
...Object.values(n5),
t0.MEDIA_CURRENT_TIME,
t0.MEDIA_DURATION,
t0.MEDIA_SEEKABLE,
],
n4 = ["Enter", " "],
n8 = "&nbsp;/&nbsp;",
n7 = (e, { timesSep: t = n8 } = {}) => {
var i, a;
let r = null != (i = e.mediaCurrentTime) ? i : 0,
[, n] = null != (a = e.mediaSeekable) ? a : [],
o = 0;
Number.isFinite(e.mediaDuration)
? (o = e.mediaDuration)
: Number.isFinite(n) && (o = n);
let s = e.remaining ? ih(0 - (o - r)) : ih(r);
return e.showDuration ? `${s}${t}${ih(o)}` : s;
};
class n9 extends rJ {
constructor() {
super(),
n1(this, e1),
n1(this, e3),
n1(this, e6),
n1(this, e8),
n1(this, eZ, void 0),
n1(this, eJ, null),
n1(this, e0, (e) => {
let { metaKey: t, altKey: i, key: a } = e;
t || i || !n4.includes(a)
? this.removeEventListener("keyup", n0(this, eJ))
: this.addEventListener("keyup", n0(this, eJ));
}),
n2(this, eZ, this.shadowRoot.querySelector("slot")),
(n0(this, eZ).innerHTML = `${n7(this)}`);
}
static get observedAttributes() {
return [...super.observedAttributes, ...n6, "disabled"];
}
connectedCallback() {
let { style: e } = ij(this.shadowRoot, ":host(:hover:not([notoggle]))");
e.setProperty("cursor", "var(--media-cursor, pointer)"),
e.setProperty(
"background",
"var(--media-control-hover-background, rgba(50 50 70 / .7))",
),
this.setAttribute("aria-label", id("playback time")),
n3(this, e6, e4).call(this),
super.connectedCallback();
}
toggleTimeDisplay() {
this.noToggle ||
(this.hasAttribute("remaining")
? this.removeAttribute("remaining")
: this.setAttribute("remaining", ""));
}
disconnectedCallback() {
this.disable(),
n3(this, e3, e5).call(this),
super.disconnectedCallback();
}
attributeChangedCallback(e, t, i) {
this.setAttribute("aria-label", id("playback time")),
n6.includes(e)
? this.update()
: "disabled" === e && i !== t
? null == i
? n3(this, e6, e4).call(this)
: n3(this, e8, e7).call(this)
: e === n5.NO_TOGGLE &&
i !== t &&
(this.noToggle
? n3(this, e8, e7).call(this)
: n3(this, e6, e4).call(this)),
super.attributeChangedCallback(e, t, i);
}
enable() {
this.noToggle || (this.tabIndex = 0);
}
disable() {
this.tabIndex = -1;
}
get remaining() {
return iV(this, n5.REMAINING);
}
set remaining(e) {
iW(this, n5.REMAINING, e);
}
get showDuration() {
return iV(this, n5.SHOW_DURATION);
}
set showDuration(e) {
iW(this, n5.SHOW_DURATION, e);
}
get noToggle() {
return iV(this, n5.NO_TOGGLE);
}
set noToggle(e) {
iW(this, n5.NO_TOGGLE, e);
}
get mediaDuration() {
return iU(this, t0.MEDIA_DURATION);
}
set mediaDuration(e) {
iH(this, t0.MEDIA_DURATION, e);
}
get mediaCurrentTime() {
return iU(this, t0.MEDIA_CURRENT_TIME);
}
set mediaCurrentTime(e) {
iH(this, t0.MEDIA_CURRENT_TIME, e);
}
get mediaSeekable() {
let e = this.getAttribute(t0.MEDIA_SEEKABLE);
if (e) return e.split(":").map((e) => +e);
}
set mediaSeekable(e) {
null == e
? this.removeAttribute(t0.MEDIA_SEEKABLE)
: this.setAttribute(t0.MEDIA_SEEKABLE, e.join(":"));
}
update() {
let e = n7(this);
((e) => {
var t;
let i = e.mediaCurrentTime,
[, a] = null != (t = e.mediaSeekable) ? t : [],
r = null;
if (
(Number.isFinite(e.mediaDuration)
? (r = e.mediaDuration)
: Number.isFinite(a) && (r = a),
null == i || null === r)
)
return e.setAttribute(
"aria-valuetext",
id("video not loaded, unknown time."),
);
let n = e.remaining ? ic(0 - (r - i)) : ic(i);
if (!e.showDuration) return e.setAttribute("aria-valuetext", n);
let o = id("{currentTime} of {totalTime}", {
currentTime: n,
totalTime: ic(r),
});
e.setAttribute("aria-valuetext", o);
})(this),
e !== n0(this, eZ).innerHTML && (n0(this, eZ).innerHTML = e);
}
}
(eZ = new WeakMap()),
(eJ = new WeakMap()),
(e0 = new WeakMap()),
(e1 = new WeakSet()),
(e2 = function () {
n0(this, eJ) ||
(n2(this, eJ, (e) => {
let { key: t } = e;
n4.includes(t)
? this.toggleTimeDisplay()
: this.removeEventListener("keyup", n0(this, eJ));
}),
this.addEventListener("keydown", n0(this, e0)),
this.addEventListener("click", this.toggleTimeDisplay));
}),
(e3 = new WeakSet()),
(e5 = function () {
n0(this, eJ) &&
(this.removeEventListener("keyup", n0(this, eJ)),
this.removeEventListener("keydown", n0(this, e0)),
this.removeEventListener("click", this.toggleTimeDisplay),
n2(this, eJ, null));
}),
(e6 = new WeakSet()),
(e4 = function () {
this.noToggle ||
this.hasAttribute("disabled") ||
(this.setAttribute("role", "button"),
this.enable(),
n3(this, e1, e2).call(this));
}),
(e8 = new WeakSet()),
(e7 = function () {
this.removeAttribute("role"),
this.disable(),
n3(this, e3, e5).call(this);
}),
(n9.getSlotTemplateHTML = function (e, t) {
return `
<slot>${n7(t)}</slot>
`;
}),
iA.customElements.get("media-time-display") ||
iA.customElements.define("media-time-display", n9);
var oe = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
ot = (e, t, i) => (
oe(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
oi = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
oa = (e, t, i, a) => (
oe(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
);
class or {
constructor(e, t, i) {
oi(this, e9, void 0),
oi(this, te, void 0),
oi(this, tt, void 0),
oi(this, ti, void 0),
oi(this, ta, void 0),
oi(this, tr, void 0),
oi(this, tn, void 0),
oi(this, to, void 0),
oi(this, ts, 0),
oi(this, tl, (e = performance.now()) => {
oa(this, ts, requestAnimationFrame(ot(this, tl))),
oa(this, ti, performance.now() - ot(this, tt));
let t = 1e3 / this.fps;
if (ot(this, ti) > t) {
let i, a, r, n;
oa(this, tt, e - (ot(this, ti) % t));
let o =
1e3 /
((e - ot(this, te)) /
++((i = this),
(a = ta),
{
set _(value) {
oa(i, a, value, r);
},
get _() {
return ot(i, a, n);
},
})._),
s = (e - ot(this, tr)) / 1e3 / this.duration,
l = ot(this, tn) + s * this.playbackRate;
l - ot(this, e9).valueAsNumber > 0
? oa(this, to, this.playbackRate / this.duration / o)
: (oa(this, to, 0.995 * ot(this, to)),
(l = ot(this, e9).valueAsNumber + ot(this, to))),
this.callback(l);
}
}),
oa(this, e9, e),
(this.callback = t),
(this.fps = i);
}
start() {
0 === ot(this, ts) &&
(oa(this, tt, performance.now()),
oa(this, te, ot(this, tt)),
oa(this, ta, 0),
ot(this, tl).call(this));
}
stop() {
0 !== ot(this, ts) &&
(cancelAnimationFrame(ot(this, ts)), oa(this, ts, 0));
}
update({ start: e, duration: t, playbackRate: i }) {
let a = e - ot(this, e9).valueAsNumber,
r = Math.abs(t - this.duration);
(a > 0 || a < -0.03 || r >= 0.5) && this.callback(e),
oa(this, tn, e),
oa(this, tr, performance.now()),
(this.duration = t),
(this.playbackRate = i);
}
}
(e9 = new WeakMap()),
(te = new WeakMap()),
(tt = new WeakMap()),
(ti = new WeakMap()),
(ta = new WeakMap()),
(tr = new WeakMap()),
(tn = new WeakMap()),
(to = new WeakMap()),
(ts = new WeakMap()),
(tl = new WeakMap());
var on = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
},
oo = (e, t, i) => (
on(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
os = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
ol = (e, t, i, a) => (
on(e, t, "write to private field"), a ? a.call(e, i) : t.set(e, i), i
),
od = (e, t, i) => (on(e, t, "access private method"), i);
let ou = (e, t = e.mediaCurrentTime) => {
let i = Number.isFinite(e.mediaSeekableStart)
? e.mediaSeekableStart
: 0,
a = Number.isFinite(e.mediaDuration)
? e.mediaDuration
: e.mediaSeekableEnd;
return Number.isNaN(a)
? 0
: Math.max(0, Math.min((t - i) / (a - i), 1));
},
oc = (e, t = e.range.valueAsNumber) => {
let i = Number.isFinite(e.mediaSeekableStart)
? e.mediaSeekableStart
: 0,
a = Number.isFinite(e.mediaDuration)
? e.mediaDuration
: e.mediaSeekableEnd;
return Number.isNaN(a) ? 0 : t * (a - i) + i;
};
class oh extends rz {
constructor() {
super(),
os(this, tw),
os(this, tA),
os(this, tI),
os(this, tT),
os(this, t_),
os(this, tL),
os(this, tD),
os(this, td, null),
os(this, tu, void 0),
os(this, tc, void 0),
os(this, th, void 0),
os(this, tm, void 0),
os(this, tp, void 0),
os(this, tv, void 0),
os(this, tb, void 0),
os(this, tg, void 0),
os(this, tf, void 0),
os(this, tE, () => {
od(this, tw, ty).call(this)
? oo(this, tu).start()
: oo(this, tu).stop();
}),
os(this, tx, (e) => {
!this.dragging &&
(ir(e) && (this.range.valueAsNumber = e),
oo(this, tf) || this.updateBar());
}),
this.shadowRoot
.querySelector("#track")
.insertAdjacentHTML(
"afterbegin",
'<div id="buffered" part="buffered"></div>',
),
ol(this, tc, this.shadowRoot.querySelectorAll('[part~="box"]')),
ol(this, tm, this.shadowRoot.querySelector('[part~="preview-box"]')),
ol(this, tp, this.shadowRoot.querySelector('[part~="current-box"]'));
const e = getComputedStyle(this);
ol(this, tv, parseInt(e.getPropertyValue("--media-box-padding-left"))),
ol(
this,
tb,
parseInt(e.getPropertyValue("--media-box-padding-right")),
),
ol(this, tu, new or(this.range, oo(this, tx), 60));
}
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_PAUSED,
t0.MEDIA_DURATION,
t0.MEDIA_SEEKABLE,
t0.MEDIA_CURRENT_TIME,
t0.MEDIA_PREVIEW_IMAGE,
t0.MEDIA_PREVIEW_TIME,
t0.MEDIA_PREVIEW_CHAPTER,
t0.MEDIA_BUFFERED,
t0.MEDIA_PLAYBACK_RATE,
t0.MEDIA_LOADING,
t0.MEDIA_ENDED,
];
}
connectedCallback() {
var e;
super.connectedCallback(),
this.range.setAttribute("aria-label", id("seek")),
oo(this, tE).call(this),
ol(this, td, this.getRootNode()),
null == (e = oo(this, td)) ||
e.addEventListener("transitionstart", this);
}
disconnectedCallback() {
var e;
super.disconnectedCallback(),
oo(this, tu).stop(),
null == (e = oo(this, td)) ||
e.removeEventListener("transitionstart", this),
ol(this, td, null);
}
attributeChangedCallback(e, t, i) {
if ((super.attributeChangedCallback(e, t, i), t != i)) {
if (
e === t0.MEDIA_CURRENT_TIME ||
e === t0.MEDIA_PAUSED ||
e === t0.MEDIA_ENDED ||
e === t0.MEDIA_LOADING ||
e === t0.MEDIA_DURATION ||
e === t0.MEDIA_SEEKABLE
) {
let e, t, i, a;
oo(this, tu).update({
start: ou(this),
duration: this.mediaSeekableEnd - this.mediaSeekableStart,
playbackRate: this.mediaPlaybackRate,
}),
oo(this, tE).call(this),
(e = this.range),
(t = ic(+oc(this))),
(i = ic(+this.mediaSeekableEnd)),
(a =
t && i
? id("{currentTime} of {totalTime}", {
currentTime: t,
totalTime: i,
})
: id("video not loaded, unknown time.")),
e.setAttribute("aria-valuetext", a);
} else e === t0.MEDIA_BUFFERED && this.updateBufferedBar();
(e === t0.MEDIA_DURATION || e === t0.MEDIA_SEEKABLE) &&
((this.mediaChaptersCues = oo(this, tg)), this.updateBar());
}
}
get mediaChaptersCues() {
return oo(this, tg);
}
set mediaChaptersCues(e) {
var t;
ol(this, tg, e),
this.updateSegments(
null == (t = oo(this, tg))
? void 0
: t.map((e) => ({
start: ou(this, e.startTime),
end: ou(this, e.endTime),
})),
);
}
get mediaPaused() {
return iV(this, t0.MEDIA_PAUSED);
}
set mediaPaused(e) {
iW(this, t0.MEDIA_PAUSED, e);
}
get mediaLoading() {
return iV(this, t0.MEDIA_LOADING);
}
set mediaLoading(e) {
iW(this, t0.MEDIA_LOADING, e);
}
get mediaDuration() {
return iU(this, t0.MEDIA_DURATION);
}
set mediaDuration(e) {
iH(this, t0.MEDIA_DURATION, e);
}
get mediaCurrentTime() {
return iU(this, t0.MEDIA_CURRENT_TIME);
}
set mediaCurrentTime(e) {
iH(this, t0.MEDIA_CURRENT_TIME, e);
}
get mediaPlaybackRate() {
return iU(this, t0.MEDIA_PLAYBACK_RATE, 1);
}
set mediaPlaybackRate(e) {
iH(this, t0.MEDIA_PLAYBACK_RATE, e);
}
get mediaBuffered() {
let e = this.getAttribute(t0.MEDIA_BUFFERED);
return e ? e.split(" ").map((e) => e.split(":").map((e) => +e)) : [];
}
set mediaBuffered(e) {
if (!e) return void this.removeAttribute(t0.MEDIA_BUFFERED);
let t = e.map((e) => e.join(":")).join(" ");
this.setAttribute(t0.MEDIA_BUFFERED, t);
}
get mediaSeekable() {
let e = this.getAttribute(t0.MEDIA_SEEKABLE);
if (e) return e.split(":").map((e) => +e);
}
set mediaSeekable(e) {
null == e
? this.removeAttribute(t0.MEDIA_SEEKABLE)
: this.setAttribute(t0.MEDIA_SEEKABLE, e.join(":"));
}
get mediaSeekableEnd() {
var e;
let [, t = this.mediaDuration] =
null != (e = this.mediaSeekable) ? e : [];
return t;
}
get mediaSeekableStart() {
var e;
let [t = 0] = null != (e = this.mediaSeekable) ? e : [];
return t;
}
get mediaPreviewImage() {
return i$(this, t0.MEDIA_PREVIEW_IMAGE);
}
set mediaPreviewImage(e) {
iB(this, t0.MEDIA_PREVIEW_IMAGE, e);
}
get mediaPreviewTime() {
return iU(this, t0.MEDIA_PREVIEW_TIME);
}
set mediaPreviewTime(e) {
iH(this, t0.MEDIA_PREVIEW_TIME, e);
}
get mediaEnded() {
return iV(this, t0.MEDIA_ENDED);
}
set mediaEnded(e) {
iW(this, t0.MEDIA_ENDED, e);
}
updateBar() {
super.updateBar(), this.updateBufferedBar(), this.updateCurrentBox();
}
updateBufferedBar() {
var e;
let t,
i = this.mediaBuffered;
if (!i.length) return;
if (this.mediaEnded) t = 1;
else {
let a = this.mediaCurrentTime,
[, r = this.mediaSeekableStart] =
null != (e = i.find(([e, t]) => e <= a && a <= t)) ? e : [];
t = ou(this, r);
}
let { style: a } = ij(this.shadowRoot, "#buffered");
a.setProperty("width", `${100 * t}%`);
}
updateCurrentBox() {
if (
!this.shadowRoot
.querySelector('slot[name="current"]')
.assignedElements().length
)
return;
let e = ij(this.shadowRoot, "#current-rail"),
t = ij(this.shadowRoot, '[part~="current-box"]'),
i = od(this, tA, tk).call(this, oo(this, tp)),
a = od(this, tI, tC).call(this, i, this.range.valueAsNumber),
r = od(this, tT, tM).call(this, i, this.range.valueAsNumber);
(e.style.transform = `translateX(${a})`),
e.style.setProperty("--_range-width", `${i.range.width}`),
t.style.setProperty("--_box-shift", `${r}`),
t.style.setProperty("--_box-width", `${i.box.width}px`),
t.style.setProperty("visibility", "initial");
}
handleEvent(e) {
switch ((super.handleEvent(e), e.type)) {
case "input":
od(this, tD, tN).call(this);
break;
case "pointermove":
od(this, t_, tS).call(this, e);
break;
case "pointerup":
oo(this, tf) && ol(this, tf, !1);
break;
case "pointerdown":
ol(this, tf, !0);
break;
case "pointerleave":
od(this, tL, tR).call(this, null);
break;
case "transitionstart":
iD(e.target, this) && setTimeout(() => oo(this, tE).call(this), 0);
}
}
}
(td = new WeakMap()),
(tu = new WeakMap()),
(tc = new WeakMap()),
(th = new WeakMap()),
(tm = new WeakMap()),
(tp = new WeakMap()),
(tv = new WeakMap()),
(tb = new WeakMap()),
(tg = new WeakMap()),
(tf = new WeakMap()),
(tE = new WeakMap()),
(tw = new WeakSet()),
(ty = function () {
return (
this.isConnected &&
!this.mediaPaused &&
!this.mediaLoading &&
!this.mediaEnded &&
this.mediaSeekableEnd > 0 &&
iP(this)
);
}),
(tx = new WeakMap()),
(tA = new WeakSet()),
(tk = function (e) {
var t;
let i = (
null !=
(t = this.getAttribute("bounds")
? iN(this, `#${this.getAttribute("bounds")}`)
: this.parentElement)
? t
: this
).getBoundingClientRect(),
a = this.range.getBoundingClientRect(),
r = e.offsetWidth,
n = -(a.left - i.left - r / 2),
o = i.right - a.left - r / 2;
return { box: { width: r, min: n, max: o }, bounds: i, range: a };
}),
(tI = new WeakSet()),
(tC = function (e, t) {
let i = `${100 * t}%`,
{ width: a, min: r, max: n } = e.box;
if (!a) return i;
if (!Number.isNaN(r)) {
let e = `calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`;
i = `max(${e}, ${i})`;
}
if (!Number.isNaN(n)) {
let e = `calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;
i = `min(${i}, ${e})`;
}
return i;
}),
(tT = new WeakSet()),
(tM = function (e, t) {
let { width: i, min: a, max: r } = e.box,
n = t * e.range.width;
if (n < a + oo(this, tv)) {
let t = e.range.left - e.bounds.left - oo(this, tv);
return `${n - i / 2 + t}px`;
}
if (n > r - oo(this, tb)) {
let t = e.bounds.right - e.range.right - oo(this, tb);
return `${n + i / 2 - t - e.range.width}px`;
}
return 0;
}),
(t_ = new WeakSet()),
(tS = function (e) {
let t = [...oo(this, tc)].some((t) => e.composedPath().includes(t));
if (!this.dragging && (t || !e.composedPath().includes(this)))
return void od(this, tL, tR).call(this, null);
let i = this.mediaSeekableEnd;
if (!i) return;
let a = ij(this.shadowRoot, "#preview-rail"),
r = ij(this.shadowRoot, '[part~="preview-box"]'),
n = od(this, tA, tk).call(this, oo(this, tm)),
o = (e.clientX - n.range.left) / n.range.width;
o = Math.max(0, Math.min(1, o));
let s = od(this, tI, tC).call(this, n, o),
l = od(this, tT, tM).call(this, n, o);
(a.style.transform = `translateX(${s})`),
a.style.setProperty("--_range-width", `${n.range.width}`),
r.style.setProperty("--_box-shift", `${l}`),
r.style.setProperty("--_box-width", `${n.box.width}px`),
(1 > Math.abs(Math.round(oo(this, th)) - Math.round(o * i)) &&
o > 0.01 &&
o < 0.99) ||
(ol(this, th, o * i), od(this, tL, tR).call(this, oo(this, th)));
}),
(tL = new WeakSet()),
(tR = function (e) {
this.dispatchEvent(
new iA.CustomEvent(tY.MEDIA_PREVIEW_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
}),
);
}),
(tD = new WeakSet()),
(tN = function () {
oo(this, tu).stop();
let e = oc(this);
this.dispatchEvent(
new iA.CustomEvent(tY.MEDIA_SEEK_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
}),
);
}),
(oh.shadowRootOptions = { mode: "open" }),
(oh.getContainerTemplateHTML = function (e) {
return `
<style>
:host {
--media-box-border-radius: 4px;
--media-box-padding-left: 10px;
--media-box-padding-right: 10px;
--media-preview-border-radius: var(--media-box-border-radius);
--media-box-arrow-offset: var(--media-box-border-radius);
--_control-background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
--_preview-background: var(--media-preview-background, var(--_control-background));
contain: layout;
}
#buffered {
background: var(--media-time-range-buffered-color, rgb(255 255 255 / .4));
position: absolute;
height: 100%;
will-change: width;
}
#preview-rail,
#current-rail {
width: 100%;
position: absolute;
left: 0;
bottom: 100%;
pointer-events: none;
will-change: transform;
}
[part~="box"] {
width: min-content;
position: absolute;
bottom: 100%;
flex-direction: column;
align-items: center;
transform: translateX(-50%);
}
[part~="current-box"] {
display: var(--media-current-box-display, var(--media-box-display, flex));
margin: var(--media-current-box-margin, var(--media-box-margin, 0 0 5px));
visibility: hidden;
}
[part~="preview-box"] {
display: var(--media-preview-box-display, var(--media-box-display, flex));
margin: var(--media-preview-box-margin, var(--media-box-margin, 0 0 5px));
transition-property: var(--media-preview-transition-property, visibility, opacity);
transition-duration: var(--media-preview-transition-duration-out, .25s);
transition-delay: var(--media-preview-transition-delay-out, 0s);
visibility: hidden;
opacity: 0;
}
:host(:is([${t0.MEDIA_PREVIEW_IMAGE}], [${t0.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {
transition-duration: var(--media-preview-transition-duration-in, .5s);
transition-delay: var(--media-preview-transition-delay-in, .25s);
visibility: visible;
opacity: 1;
}
@media (hover: hover) {
:host(:is([${t0.MEDIA_PREVIEW_IMAGE}], [${t0.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {
transition-duration: var(--media-preview-transition-duration-in, .5s);
transition-delay: var(--media-preview-transition-delay-in, .25s);
visibility: visible;
opacity: 1;
}
}
media-preview-thumbnail,
::slotted(media-preview-thumbnail) {
visibility: hidden;
transition: visibility 0s .25s;
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
background: var(--media-preview-thumbnail-background, var(--_preview-background));
box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));
max-width: var(--media-preview-thumbnail-max-width, 180px);
max-height: var(--media-preview-thumbnail-max-height, 160px);
min-width: var(--media-preview-thumbnail-min-width, 120px);
min-height: var(--media-preview-thumbnail-min-height, 80px);
border: var(--media-preview-thumbnail-border);
border-radius: var(--media-preview-thumbnail-border-radius,
var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);
}
:host([${t0.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,
:host([${t0.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {
transition-delay: var(--media-preview-transition-delay-in, .25s);
visibility: visible;
}
@media (hover: hover) {
:host([${t0.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
:host([${t0.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
transition-delay: var(--media-preview-transition-delay-in, .25s);
visibility: visible;
}
:host([${t0.MEDIA_PREVIEW_TIME}]:hover) {
--media-time-range-hover-display: block;
}
}
media-preview-chapter-display,
::slotted(media-preview-chapter-display) {
font-size: var(--media-font-size, 13px);
line-height: 17px;
min-width: 0;
visibility: hidden;
transition: min-width 0s, border-radius 0s, margin 0s, padding 0s, visibility 0s;
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
background: var(--media-preview-chapter-background, var(--_preview-background));
border-radius: var(--media-preview-chapter-border-radius,
var(--media-preview-border-radius) var(--media-preview-border-radius)
var(--media-preview-border-radius) var(--media-preview-border-radius));
padding: var(--media-preview-chapter-padding, 3.5px 9px);
margin: var(--media-preview-chapter-margin, 0 0 5px);
text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));
}
:host([${t0.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
:host([${t0.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
transition-delay: var(--media-preview-transition-delay-in, .25s);
border-radius: var(--media-preview-chapter-border-radius, 0);
padding: var(--media-preview-chapter-padding, 3.5px 9px 0);
margin: var(--media-preview-chapter-margin, 0);
min-width: 100%;
}
media-preview-chapter-display[${t0.MEDIA_PREVIEW_CHAPTER}],
::slotted(media-preview-chapter-display[${t0.MEDIA_PREVIEW_CHAPTER}]) {
visibility: visible;
}
media-preview-chapter-display:not([aria-valuetext]),
::slotted(media-preview-chapter-display:not([aria-valuetext])) {
display: none;
}
media-preview-time-display,
::slotted(media-preview-time-display),
media-time-display,
::slotted(media-time-display) {
font-size: var(--media-font-size, 13px);
line-height: 17px;
min-width: 0;
transition: min-width 0s, border-radius 0s;
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
background: var(--media-preview-time-background, var(--_preview-background));
border-radius: var(--media-preview-time-border-radius,
var(--media-preview-border-radius) var(--media-preview-border-radius)
var(--media-preview-border-radius) var(--media-preview-border-radius));
padding: var(--media-preview-time-padding, 3.5px 9px);
margin: var(--media-preview-time-margin, 0);
text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));
transform: translateX(min(
max(calc(50% - var(--_box-width) / 2),
calc(var(--_box-shift, 0))),
calc(var(--_box-width) / 2 - 50%)
));
}
:host([${t0.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
:host([${t0.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
transition-delay: var(--media-preview-transition-delay-in, .25s);
border-radius: var(--media-preview-time-border-radius,
0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
min-width: 100%;
}
:host([${t0.MEDIA_PREVIEW_TIME}]:hover) {
--media-time-range-hover-display: block;
}
[part~="arrow"],
::slotted([part~="arrow"]) {
display: var(--media-box-arrow-display, inline-block);
transform: translateX(min(
max(calc(50% - var(--_box-width) / 2 + var(--media-box-arrow-offset)),
calc(var(--_box-shift, 0))),
calc(var(--_box-width) / 2 - 50% - var(--media-box-arrow-offset))
));
border-color: transparent;
border-top-color: var(--media-box-arrow-background, var(--_control-background));
border-width: var(--media-box-arrow-border-width,
var(--media-box-arrow-height, 5px) var(--media-box-arrow-width, 6px) 0);
border-style: solid;
justify-content: center;
height: 0;
}
</style>
<div id="preview-rail">
<slot name="preview" part="box preview-box">
<media-preview-thumbnail>
<template shadowrootmode="${nz.shadowRootOptions.mode}">
${nz.getTemplateHTML({})}
</template>
</media-preview-thumbnail>
<media-preview-chapter-display></media-preview-chapter-display>
<media-preview-time-display></media-preview-time-display>
<slot name="preview-arrow"><div part="arrow"></div></slot>
</slot>
</div>
<div id="current-rail">
<slot name="current" part="box current-box">
</slot>
</div>
`;
}),
iA.customElements.get("media-time-range") ||
iA.customElements.define("media-time-range", oh);
var om = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot read from private field");
return i ? i.call(e) : t.get(e);
};
class op extends rz {
constructor() {
super(...arguments),
((e, t, i) => {
if (t.has(e))
throw TypeError(
"Cannot add the same private member more than once",
);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
})(this, tP, () => {
let e = this.range.value,
t = new iA.CustomEvent(tY.MEDIA_VOLUME_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
});
this.dispatchEvent(t);
});
}
static get observedAttributes() {
return [
...super.observedAttributes,
t0.MEDIA_VOLUME,
t0.MEDIA_MUTED,
t0.MEDIA_VOLUME_UNAVAILABLE,
];
}
connectedCallback() {
super.connectedCallback(),
this.range.setAttribute("aria-label", id("volume")),
this.range.addEventListener("input", om(this, tP));
}
disconnectedCallback() {
this.range.removeEventListener("input", om(this, tP)),
super.disconnectedCallback();
}
attributeChangedCallback(e, t, i) {
if (
(super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_VOLUME || e === t0.MEDIA_MUTED)
) {
let e;
(this.range.valueAsNumber = this.mediaMuted ? 0 : this.mediaVolume),
this.range.setAttribute(
"aria-valuetext",
((e = this.range.valueAsNumber), `${Math.round(100 * e)}%`),
),
this.updateBar();
}
}
get mediaVolume() {
return iU(this, t0.MEDIA_VOLUME, 1);
}
set mediaVolume(e) {
iH(this, t0.MEDIA_VOLUME, e);
}
get mediaMuted() {
return iV(this, t0.MEDIA_MUTED);
}
set mediaMuted(e) {
iW(this, t0.MEDIA_MUTED, e);
}
get mediaVolumeUnavailable() {
return i$(this, t0.MEDIA_VOLUME_UNAVAILABLE);
}
set mediaVolumeUnavailable(e) {
iB(this, t0.MEDIA_VOLUME_UNAVAILABLE, e);
}
}
(tP = new WeakMap()),
iA.customElements.get("media-volume-range") ||
iA.customElements.define("media-volume-range", op);
class ov extends ry {
constructor() {
super(...arguments), (this.container = null);
}
static get observedAttributes() {
return [...super.observedAttributes, t0.MEDIA_LOOP];
}
connectedCallback() {
var e;
super.connectedCallback(),
(this.container =
(null == (e = this.shadowRoot)
? void 0
: e.querySelector("#icon")) || null),
this.container && (this.container.textContent = id("Loop"));
}
attributeChangedCallback(e, t, i) {
super.attributeChangedCallback(e, t, i),
e === t0.MEDIA_LOOP &&
this.container &&
this.setAttribute(
"aria-checked",
this.mediaLoop ? "true" : "false",
);
}
get mediaLoop() {
return iV(this, t0.MEDIA_LOOP);
}
set mediaLoop(e) {
iW(this, t0.MEDIA_LOOP, e);
}
handleClick() {
let e = !this.mediaLoop,
t = new iA.CustomEvent(tY.MEDIA_LOOP_REQUEST, {
composed: !0,
bubbles: !0,
detail: e,
});
this.dispatchEvent(t);
}
}
function ob(e) {
return "boolean" == typeof e
? e
? ""
: void 0
: "function" == typeof e
? void 0
: Array.isArray(e) &&
e.every(
(e) =>
"string" == typeof e ||
"number" == typeof e ||
"boolean" == typeof e,
)
? e.join(" ")
: "object" != typeof e || null === e
? e
: void 0;
}
(ov.getSlotTemplateHTML = function (e) {
return `
<style>
:host {
min-width: 4ch;
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
width: 100%;
display: grid;
grid-template-columns: 1fr auto;
gap: 1rem;
font-weight: var(--media-button-font-weight, normal);
}
#checked-indicator {
display: none;
}
:host([${t0.MEDIA_LOOP}]) #checked-indicator {
display: block;
}
</style>
<span id="icon">
</span>
<div id="checked-indicator">
<svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">
<path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
</svg>
</div>
`;
}),
(ov.getTooltipContentHTML = function () {
return id("Loop");
}),
iA.customElements.get("media-loop-button") ||
iA.customElements.define("media-loop-button", ov),
tQ({
tagName: "media-gesture-receiver",
elementClass: iq,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-container",
elementClass: i9,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
let og = tQ({
tagName: "media-controller",
elementClass: re,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
tQ({
tagName: "media-tooltip",
elementClass: rm,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-chrome-button",
elementClass: ry,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-airplay-button",
elementClass: rk,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-captions-button",
elementClass: rM,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-cast-button",
elementClass: rR,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-chrome-dialog",
elementClass: rH,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-chrome-range",
elementClass: rz,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
let of = tQ({
tagName: "media-control-bar",
elementClass: rK,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
tQ({
tagName: "media-text-display",
elementClass: rJ,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-duration-display",
elementClass: r2,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-error-dialog",
elementClass: r9,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-keyboard-shortcuts-dialog",
elementClass: ni,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
let oE = tQ({
tagName: "media-fullscreen-button",
elementClass: ns,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
tQ({
tagName: "media-live-button",
elementClass: nm,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-loading-indicator",
elementClass: ny,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-mute-button",
elementClass: nC,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-pip-button",
elementClass: n_,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-playback-rate-button",
elementClass: nD,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
let ow = tQ({
tagName: "media-play-button",
elementClass: nO,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
tQ({
tagName: "media-poster-image",
elementClass: nH,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-preview-chapter-display",
elementClass: nW,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-preview-thumbnail",
elementClass: nz,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-preview-time-display",
elementClass: nQ,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-seek-backward-button",
elementClass: nY,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-seek-forward-button",
elementClass: nZ,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
let oy = tQ({
tagName: "media-time-display",
elementClass: n9,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
ox = tQ({
tagName: "media-time-range",
elementClass: oh,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
});
function oA(e, t) {
let { minCurrentTimeSec: i = 0.5 } = t ?? {};
if (e.audioTracks && "number" == typeof e.audioTracks.length)
return e.audioTracks.length > 0;
if ("boolean" == typeof e.mozHasAudio) return e.mozHasAudio;
let a = e.webkitAudioDecodedByteCount;
if ("number" == typeof a) return e.currentTime < i ? null : a > 0;
let r = e.captureStream || e.mozCaptureStream;
if ("function" == typeof r)
try {
let t = r.call(e),
i = t.getAudioTracks().length > 0;
return t.getTracks().forEach((e) => e.stop()), i;
} catch {}
return null;
}
function ok({ size: e = 16 }) {
return (0, tj.jsxs)("svg", {
width: e,
height: e,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round",
children: [
(0, tj.jsx)("path", { d: "M8 3H5a2 2 0 00-2 2v3" }),
(0, tj.jsx)("path", { d: "M21 8V5a2 2 0 00-2-2h-3" }),
(0, tj.jsx)("path", { d: "M3 16v3a2 2 0 002 2h3" }),
(0, tj.jsx)("path", { d: "M16 21h3a2 2 0 002-2v-3" }),
],
});
}
function oI({ size: e = 16 }) {
return (0, tj.jsxs)("svg", {
width: e,
height: e,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: "2",
strokeLinecap: "round",
strokeLinejoin: "round",
children: [
(0, tj.jsx)("path", { d: "M8 3v3a2 2 0 01-2 2H3" }),
(0, tj.jsx)("path", { d: "M21 8h-3a2 2 0 01-2-2V3" }),
(0, tj.jsx)("path", { d: "M3 16h3a2 2 0 012 2v3" }),
(0, tj.jsx)("path", { d: "M16 21v-3a2 2 0 012-2h3" }),
],
});
}
function oC({ currentTime: e, duration: t, onSeek: i }) {
let a = (0, tO.useRef)(null),
[r, n] = (0, tO.useState)(!1),
o = t > 0 ? e / t : 0,
s = (0, tO.useCallback)(
(e) => {
let r = a.current;
if (!r || t <= 0) return;
let n = r.getBoundingClientRect();
i((Math.max(0, Math.min(e - n.left, n.width)) / n.width) * t);
},
[t, i],
),
l = (0, tO.useCallback)(
(e) => {
e.stopPropagation(), n(!0), s(e.clientX);
},
[s],
);
(0, tO.useEffect)(() => {
if (!r) return;
let e = (e) => s(e.clientX),
t = () => n(!1);
return (
window.addEventListener("mousemove", e),
window.addEventListener("mouseup", t),
() => {
window.removeEventListener("mousemove", e),
window.removeEventListener("mouseup", t);
}
);
}, [r, s]);
let d = (0, tO.useCallback)(
(e) => {
e.stopPropagation(), s(e.clientX);
},
[s],
);
return (0, tj.jsxs)("div", {
ref: a,
className: "relative flex-1 cursor-pointer",
style: { height: 20, display: "flex", alignItems: "center" },
onMouseDown: l,
onClick: d,
children: [
(0, tj.jsx)("div", {
className: "absolute left-0 right-0 rounded-full",
style: {
height: 4,
background: "rgba(255, 255, 255, 0.3)",
top: "50%",
transform: "translateY(-50%)",
pointerEvents: "none",
},
}),
(0, tj.jsx)("div", {
className: "absolute left-0 rounded-full",
style: {
height: 4,
background: "#fff",
width: `${100 * o}%`,
top: "50%",
transform: "translateY(-50%)",
pointerEvents: "none",
},
}),
(0, tj.jsx)("div", {
className: "absolute rounded-full",
style: {
width: 12,
height: 12,
background: "#fff",
top: "50%",
left: `${100 * o}%`,
transform: "translate(-50%, -50%)",
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.3)",
pointerEvents: "none",
},
}),
],
});
}
function oT({ lightChrome: e }) {
return (0, tj.jsx)("div", {
className:
"pointer-events-none absolute inset-0 z-[15] flex items-center justify-center",
"aria-hidden": !0,
children: (0, tj.jsx)("div", {
className: "flex items-center justify-center rounded-full px-6 py-3",
style: {
background: e ? "rgba(255, 255, 255, 0.75)" : "rgba(0, 0, 0, 0.5)",
},
children: (0, tj.jsx)("div", {
className: e
? "h-5 w-5 animate-spin rounded-full border-2 border-neutral-600 border-t-transparent"
: "h-5 w-5 animate-spin rounded-full border-2 border-white border-t-transparent",
style: { animationDuration: "0.8s" },
}),
}),
});
}
function oM({ volume: e, muted: t, onVolumeChange: i, onToggleMute: a }) {
let r = (0, tO.useRef)(null),
[n, o] = (0, tO.useState)(!1),
[s, l] = (0, tO.useState)(!1),
d = s || n,
u = t ? 0 : e,
c = (0, tO.useCallback)(
(e) => {
let t = r.current;
if (!t) return;
let a = t.getBoundingClientRect();
i(Math.max(0, Math.min(a.bottom - e, a.height)) / a.height);
},
[i],
),
h = (0, tO.useCallback)(
(e) => {
e.stopPropagation(), o(!0), c(e.clientY);
},
[c],
);
return (
(0, tO.useEffect)(() => {
if (!n) return;
let e = (e) => c(e.clientY),
t = () => o(!1);
return (
window.addEventListener("mousemove", e),
window.addEventListener("mouseup", t),
() => {
window.removeEventListener("mousemove", e),
window.removeEventListener("mouseup", t);
}
);
}, [n, c]),
(0, tj.jsxs)("div", {
className: "relative",
onMouseEnter: () => l(!0),
onMouseLeave: () => l(!1),
children: [
(0, tj.jsx)("div", {
className:
"absolute bottom-full left-1/2 flex -translate-x-1/2 flex-col items-center pb-2 transition-all duration-200",
style: { opacity: +!!d, pointerEvents: d ? "auto" : "none" },
children: (0, tj.jsxs)("div", {
className: "flex flex-col items-center rounded-lg",
style: {
background: "rgba(0, 0, 0, 0.75)",
padding: "8px 6px",
},
children: [
(0, tj.jsx)("span", {
className: "mb-1 text-xs tabular-nums text-white",
children: Math.round(100 * u),
}),
(0, tj.jsxs)("div", {
ref: r,
className: "relative cursor-pointer",
style: {
width: 20,
height: 100,
display: "flex",
justifyContent: "center",
},
onMouseDown: h,
children: [
(0, tj.jsx)("div", {
className: "absolute rounded-full",
style: {
width: 3,
top: 0,
bottom: 0,
background: "rgba(255, 255, 255, 0.3)",
left: "50%",
transform: "translateX(-50%)",
},
}),
(0, tj.jsx)("div", {
className: "absolute rounded-full",
style: {
width: 3,
background: "#fff",
height: `${100 * u}%`,
bottom: 0,
left: "50%",
transform: "translateX(-50%)",
},
}),
(0, tj.jsx)("div", {
className: "absolute rounded-full",
style: {
width: 10,
height: 10,
background: "#fff",
left: "50%",
bottom: `${100 * u}%`,
transform: "translate(-50%, 50%)",
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.3)",
},
}),
],
}),
],
}),
}),
(0, tj.jsx)("button", {
type: "button",
onClick: a,
className:
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20",
children:
t || 0 === e
? (0, tj.jsx)(t$.Icons.OffAudio, { width: 16, height: 16 })
: (0, tj.jsx)(t$.Icons.Audio, { width: 16, height: 16 }),
}),
],
})
);
}
tQ({
tagName: "media-volume-range",
elementClass: op,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
tQ({
tagName: "media-loop-button",
elementClass: ov,
react: tO.default,
toAttributeValue: ob,
defaultProps: { suppressHydrationWarning: !0 },
}),
e.s(["detectVideoHasAudio", () => oA], 42939);
let o_ = [1, 1.5, 2];
function oS({ speed: e, onChange: t }) {
let i = (0, tO.useCallback)(() => {
let i = o_.indexOf(e);
t(o_[(i + 1) % o_.length]);
}, [e, t]);
return (0, tj.jsx)("button", {
type: "button",
onClick: i,
className:
"flex h-7 shrink-0 items-center justify-center rounded-full px-2 text-xs font-medium tabular-nums text-white transition-colors hover:bg-white/20",
children: 1 === e ? "1x" : `${e}x`,
});
}
let oL = { 480: "480p 流畅", 720: "720p 高清", 1080: "1080p 超清" };
function oR(e) {
return e.name?.toLowerCase() === "original"
? `${Math.min(e.width, e.height)}p 原画质`
: oL[e.height] || e.name || `${e.height}p`;
}
function oD({ levels: e, currentLevel: t, onChange: i }) {
let [a, r] = (0, tO.useState)(!1),
n = (0, tO.useRef)(null);
(0, tO.useEffect)(() => {
if (!a) return;
let e = (e) => {
n.current && !n.current.contains(e.target) && r(!1);
};
return (
document.addEventListener("mousedown", e),
() => document.removeEventListener("mousedown", e)
);
}, [a]);
let o = -1 === t ? "自动" : e[t] ? oR(e[t]) : "自动";
return (0, tj.jsxs)("div", {
ref: n,
className: "relative",
children: [
(0, tj.jsx)("button", {
type: "button",
onClick: () => r((e) => !e),
className:
"flex h-7 shrink-0 items-center justify-center whitespace-nowrap rounded-full px-2 text-xs font-medium text-white transition-colors hover:bg-white/20",
children: o,
}),
a &&
(0, tj.jsxs)("div", {
className:
"absolute bottom-full left-0 mb-1 min-w-[130px] rounded-lg py-1",
style: { background: "rgba(0, 0, 0, 0.85)" },
children: [
(0, tj.jsxs)("button", {
type: "button",
className:
"flex w-full items-center justify-between px-3 py-1.5 text-left text-xs text-white transition-colors hover:bg-white/20",
onClick: () => {
i(-1), r(!1);
},
children: [
(0, tj.jsx)("span", {
className: "whitespace-nowrap",
children: "自动",
}),
-1 === t &&
(0, tj.jsx)(t$.Icons.Check, {
width: 14,
height: 14,
className: "shrink-0",
}),
],
}),
e.map((e) =>
(0, tj.jsxs)(
"button",
{
type: "button",
className:
"flex w-full items-center justify-between px-3 py-1.5 text-left text-xs text-white transition-colors hover:bg-white/20",
onClick: () => {
i(e.index), r(!1);
},
children: [
(0, tj.jsx)("span", {
className: "whitespace-nowrap",
children: oR(e),
}),
t === e.index &&
(0, tj.jsx)(t$.Icons.Check, {
width: 14,
height: 14,
className: "shrink-0",
}),
],
},
e.index,
),
),
],
}),
],
});
}
let oN = {
"--media-primary-color": "#fff",
"--media-secondary-color": "transparent",
"--media-control-background": "transparent",
"--media-control-hover-background": "transparent",
"--media-range-bar-color": "#fff",
"--media-range-track-height": "4px",
"--media-range-thumb-width": "12px",
"--media-range-thumb-height": "12px",
"--media-range-thumb-background": "#fff",
"--media-range-thumb-border-radius": "50%",
"--media-control-padding": "4px 8px",
"--media-font-size": "14px",
"--media-button-icon-width": "18px",
"--media-button-icon-height": "18px",
"--media-background-color": "transparent",
"--media-time-range-buffered-color": "rgba(255, 255, 255, 0.3)",
"--media-range-track-background": "rgba(255, 255, 255, 0.2)",
};
function oP({
src: e,
poster: t,
autoPlay: i,
loop: a,
muted: r,
initialTime: n,
hasAudio: o,
onTimeUpdate: s,
className: l,
style: d,
videoStyle: u,
showScreenshot: c,
onScreenshot: h,
externalVideoRef: m,
fullscreenContainerRef: p,
qualityLevels: v,
currentQualityLevel: b = -1,
onQualityChange: g,
isBuffering: f = !1,
showBufferingIndicator: E = !1,
chromeVariant: w = "default",
}) {
let y = (0, tO.useRef)(null),
x = (0, tO.useRef)(null),
A = m ?? y,
[k, I] = (0, tO.useState)(1),
[C, T] = (0, tO.useState)(+!r),
[M, _] = (0, tO.useState)(!!r),
[S, L] = (0, tO.useState)(!1 !== o && void 0),
R = !1 !== o && !0 === S;
(0, tO.useEffect)(() => {
L(!1 !== o && void 0);
}, [e, o]),
(0, tO.useEffect)(() => {
if (!m?.current || !x.current) return;
let e = m.current,
t = x.current,
i = e.parentElement,
a = e.nextSibling;
return (
e.setAttribute("slot", "media"),
t.appendChild(e),
() => {
e.removeAttribute("slot"),
t.contains(e) && t.removeChild(e),
i && i.insertBefore(e, a);
}
);
}, [m]),
(0, tO.useEffect)(() => {
let e = A.current;
if (!e || !1 === o) return;
let t = !1,
i = () => {
if (t) return;
let i = oA(e, { minCurrentTimeSec: 0.5 });
null !== i && ((t = !0), L(i));
},
r = () => {
s?.(e.currentTime), i();
},
l = () => {
n && n > 0 && (e.currentTime = n), i();
},
d = () => {
a || ((e.currentTime = 0), s?.(0));
};
return (
e.addEventListener("timeupdate", r),
e.addEventListener("loadedmetadata", l),
e.addEventListener("ended", d),
e.readyState >= 1 && l(),
() => {
e.removeEventListener("timeupdate", r),
e.removeEventListener("loadedmetadata", l),
e.removeEventListener("ended", d);
}
);
}, [n, s, o, a, A]);
let D = (0, tO.useCallback)(
(e) => {
let t = A.current;
t && ((t.playbackRate = e), I(e));
},
[A],
),
N = (0, tO.useCallback)(
(e) => {
let t = A.current;
t && ((t.volume = e), (t.muted = 0 === e), T(e), _(0 === e));
},
[A],
),
P = (0, tO.useCallback)(() => {
let e = A.current;
if (!e) return;
let t = !e.muted;
(e.muted = t), _(t), t || 0 !== C || ((e.volume = 0.5), T(0.5));
}, [C, A]),
j = (0, tO.useCallback)(() => {
let e = A.current;
e && h && h(e);
}, [h, A]),
O = (0, tO.useCallback)(() => {
let e = p?.current ?? x.current;
e &&
(document.fullscreenElement
? document.exitFullscreen()
: e.requestFullscreen());
}, [p]),
U = !!p,
H = "canvasLight" === w;
return (0, tj.jsxs)("div", {
className: l || "relative",
style: {
background: m
? "transparent"
: H
? "var(--canvas-bg, #f5f5f5)"
: "#000",
...d,
},
onContextMenu: (e) => e.preventDefault(),
children: [
E && f && (0, tj.jsx)(oT, { lightChrome: H }),
(0, tj.jsxs)(og, {
ref: x,
style: { ...oN, width: "100%", height: "100%" },
autohide: "3",
children: [
!m &&
(0, tj.jsx)("video", {
ref: y,
slot: "media",
src: e,
poster: t,
autoPlay: i,
loop: a,
muted: !!r,
playsInline: !0,
crossOrigin: "anonymous",
className: u ? "block" : "max-h-full max-w-full",
style: { background: "#000", ...u },
}),
(0, tj.jsx)("div", {
slot: "centered-chrome",
style: { display: "none" },
}),
(0, tj.jsxs)(of, {
style: {
background:
"linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7))",
paddingTop: "40px",
paddingBottom: "8px",
paddingLeft: "16px",
paddingRight: "16px",
gap: "12px",
},
children: [
(0, tj.jsx)(ow, {}),
(0, tj.jsx)(ox, {}),
(0, tj.jsx)(oy, { showDuration: !0 }),
(0, tj.jsx)(oS, { speed: k, onChange: D }),
v &&
v.length > 0 &&
g &&
(0, tj.jsx)(oD, {
levels: v,
currentLevel: b,
onChange: g,
}),
R &&
(0, tj.jsx)(oM, {
volume: C,
muted: M,
onVolumeChange: N,
onToggleMute: P,
}),
c &&
(0, tj.jsx)("button", {
type: "button",
onClick: j,
className:
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20",
children: (0, tj.jsx)(t$.Icons.camera, {
width: 16,
height: 16,
}),
}),
U
? (0, tj.jsx)("button", {
type: "button",
onClick: O,
className:
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20",
children: (0, tj.jsx)(ok, { size: 16 }),
})
: (0, tj.jsx)(oE, {}),
],
}),
],
}),
],
});
}
function oj(e, t, i, a, r, n) {
let o = Math.min(-i / 2 + r / 2, i / 2 - r / 2),
s = Math.min(-a / 2 + n / 2, a / 2 - n / 2);
return {
x: Math.min(Math.max(-i / 2 + r / 2, i / 2 - r / 2), Math.max(o, e)),
y: Math.min(Math.max(-a / 2 + n / 2, a / 2 - n / 2), Math.max(s, t)),
};
}
function oO({
src: e,
alt: t = "",
className: i = "",
onClick: a,
onLoad: r,
}) {
let n = (0, tO.useRef)(null),
o = (0, tO.useRef)(null),
[s, l] = (0, tO.useState)(1),
[d, u] = (0, tO.useState)({ x: 0, y: 0 }),
c = (0, tO.useRef)(!1),
h = (0, tO.useRef)({ x: 0, y: 0 }),
m = (0, tO.useRef)(null),
p = (0, tO.useRef)(null),
v = (0, tO.useRef)(s);
(v.current = s),
(0, tO.useEffect)(() => {
l(1), u({ x: 0, y: 0 });
}, [e]);
let b = (0, tO.useCallback)((e) => Math.min(5, Math.max(0.5, e)), []),
g = (0, tO.useCallback)((e) => {
u((t) => {
let i = e(t),
a = n.current,
r = o.current;
if (!a || !r) return i;
let s = a.getBoundingClientRect(),
l = r.getBoundingClientRect();
return l.width <= 0 || l.height <= 0
? i
: oj(i.x, i.y, s.width, s.height, l.width, l.height);
});
}, []),
f = (0, tO.useCallback)(
(e) => {
if ((e.preventDefault(), e.ctrlKey || e.metaKey)) {
let t = e.deltaY > 0 ? -0.06 : 0.06,
i = n.current?.getBoundingClientRect(),
a = o.current;
if (!i) return;
let r = e.clientX - i.left - i.width / 2,
s = e.clientY - i.top - i.height / 2,
d = v.current,
c = b(d + t),
h = c / d,
m = (e) => ({
x: e.x + (r - e.x) * (1 - h),
y: e.y + (s - e.y) * (1 - h),
});
if (a) {
let e = a.getBoundingClientRect(),
t = e.width * h,
r = e.height * h;
u((e) => {
let a = m(e);
return oj(a.x, a.y, i.width, i.height, t, r);
});
} else u((e) => m(e));
l(c);
} else g((t) => ({ x: t.x - e.deltaX, y: t.y - e.deltaY }));
},
[b, g],
);
(0, tO.useEffect)(() => {
let e = n.current;
if (e)
return (
e.addEventListener("wheel", f, { passive: !1 }),
() => e.removeEventListener("wheel", f)
);
}, [f]);
let E = (0, tO.useCallback)((e) => {
0 === e.button &&
((c.current = !0), (h.current = { x: e.clientX, y: e.clientY }));
}, []),
w = (0, tO.useCallback)(() => {
c.current = !1;
}, []);
(0, tO.useEffect)(() => {
let e = () => {
c.current = !1;
},
t = (e) => {
if (!c.current) return;
let t = e.clientX - h.current.x,
i = e.clientY - h.current.y;
(h.current = { x: e.clientX, y: e.clientY }),
g((e) => ({ x: e.x + t, y: e.y + i }));
};
return (
document.addEventListener("mouseup", e),
document.addEventListener("mousemove", t),
() => {
document.removeEventListener("mouseup", e),
document.removeEventListener("mousemove", t);
}
);
}, [g]);
let y = (0, tO.useCallback)((e) => {
e.stopPropagation(), l(1), u({ x: 0, y: 0 });
}, []),
x = (0, tO.useCallback)((e) => {
2 === e.touches.length
? ((m.current = Math.hypot(
e.touches[1].clientX - e.touches[0].clientX,
e.touches[1].clientY - e.touches[0].clientY,
)),
(p.current = {
x: (e.touches[0].clientX + e.touches[1].clientX) / 2,
y: (e.touches[0].clientY + e.touches[1].clientY) / 2,
}))
: 1 === e.touches.length &&
((m.current = null),
(p.current = null),
(h.current = {
x: e.touches[0].clientX,
y: e.touches[0].clientY,
}),
(c.current = !0));
}, []),
A = (0, tO.useCallback)(
(e) => {
if (2 === e.touches.length && null !== m.current && p.current) {
e.preventDefault();
let t = Math.hypot(
e.touches[1].clientX - e.touches[0].clientX,
e.touches[1].clientY - e.touches[0].clientY,
),
i = {
x: (e.touches[0].clientX + e.touches[1].clientX) / 2,
y: (e.touches[0].clientY + e.touches[1].clientY) / 2,
},
a = n.current?.getBoundingClientRect(),
r = o.current;
if (a && r) {
let e = i.x - a.left - a.width / 2,
n = i.y - a.top - a.height / 2,
o = t / m.current,
s = v.current,
d = b(s * o),
c = d / s,
h = r.getBoundingClientRect(),
p = h.width * c,
g = h.height * c;
u((t) => {
let i = {
x: t.x + (e - t.x) * (1 - c),
y: t.y + (n - t.y) * (1 - c),
};
return oj(i.x, i.y, a.width, a.height, p, g);
}),
l(d);
}
(m.current = t), (p.current = i);
} else if (1 === e.touches.length && c.current) {
let t = e.touches[0].clientX - h.current.x,
i = e.touches[0].clientY - h.current.y;
(h.current = {
x: e.touches[0].clientX,
y: e.touches[0].clientY,
}),
g((e) => ({ x: e.x + t, y: e.y + i }));
}
},
[b, g],
),
k = (0, tO.useCallback)(() => {
(m.current = null), (p.current = null), (c.current = !1);
}, []);
return (0, tj.jsx)("div", {
ref: n,
className: `flex cursor-grab items-center justify-center overflow-hidden active:cursor-grabbing ${i}`,
onMouseDown: E,
onMouseLeave: w,
onTouchStart: x,
onTouchMove: A,
onTouchEnd: k,
style: { touchAction: "none" },
children: (0, tj.jsx)("img", {
ref: o,
src: e,
alt: t,
draggable: !1,
className: "select-none",
onLoad: r,
style: {
width: "100%",
height: "100%",
objectFit: "contain",
transform: `translate(${d.x}px, ${d.y}px) scale(${s})`,
transformOrigin: "center center",
},
onClick: a,
onDoubleClick: y,
}),
});
}
function oU({
mediaType: e,
src: t,
onClose: i,
footer: a,
onPrev: r,
onNext: n,
zIndex: o,
}) {
let s = (0, tO.useCallback)(() => {
r?.();
}, [r]),
l = (0, tO.useCallback)(() => {
n?.();
}, [n]);
(0, tO.useEffect)(() => {
let e = (e) => {
"Escape" === e.key
? (e.stopImmediatePropagation(), i())
: "ArrowLeft" === e.key && r
? s()
: "ArrowRight" === e.key && n && l();
};
return (
document.addEventListener("keydown", e, !0),
() => document.removeEventListener("keydown", e, !0)
);
}, [i, r, n, s, l]);
let d =
"absolute top-1/2 z-20 flex size-10 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-black/50 text-white/70 transition-colors hover:bg-black/70 hover:text-white";
return (0, tB.createPortal)(
(0, tj.jsxs)("div", {
className:
"z-(--z-toast) fixed inset-0 flex items-center justify-center bg-black/80",
style: void 0 !== o ? { zIndex: o } : void 0,
onClick: i,
onContextMenu: (e) => e.preventDefault(),
children: [
r
? (0, tj.jsx)("button", {
type: "button",
onClick: (e) => {
e.stopPropagation(), s();
},
className: `${d} left-4`,
children: (0, tj.jsx)(t$.Icons.Left, {
width: 20,
height: 20,
}),
})
: null,
n
? (0, tj.jsx)("button", {
type: "button",
onClick: (e) => {
e.stopPropagation(), l();
},
className: `${d} right-4`,
children: (0, tj.jsx)(t$.Icons.Right, {
width: 20,
height: 20,
}),
})
: null,
(0, tj.jsxs)("div", {
className:
"relative flex max-h-[90vh] max-w-[85vw] flex-col items-center gap-4",
onClick: (e) => e.stopPropagation(),
children: [
(0, tj.jsx)("button", {
type: "button",
onClick: i,
className:
"absolute -right-3 -top-3 z-10 flex size-8 cursor-pointer items-center justify-center rounded-full bg-black/60 text-white/70 transition-colors hover:bg-black/80 hover:text-white",
children: (0, tj.jsx)(t$.Icons.x, { width: 16, height: 16 }),
}),
"video" === e
? (0, tj.jsx)(oP, {
src: t,
autoPlay: !0,
loop: !0,
className: "relative rounded-lg",
videoStyle: { maxHeight: "80vh", maxWidth: "85vw" },
})
: "audio" === e
? (0, tj.jsxs)("div", {
className:
"flex flex-col items-center gap-4 rounded-xl bg-white/10 p-8",
children: [
(0, tj.jsx)(t$.Icons.ThumbnailAudio, {
width: 50,
height: 50,
className: "mb-2 text-white/40",
}),
(0, tj.jsx)("audio", {
src: t,
autoPlay: !0,
controls: !0,
controlsList: "nodownload",
onContextMenu: (e) => e.preventDefault(),
className: "w-[420px]",
}),
],
})
: t
? (0, tj.jsx)("div", {
className: "h-[80vh] w-[85vw] rounded-lg",
children: (0, tj.jsx)(
oO,
{ src: t, className: "h-full w-full rounded-lg" },
t,
),
})
: null,
a,
],
}),
],
}),
document.body,
);
}
e.s(
[
"FullscreenEnterIcon",
() => ok,
"FullscreenExitIcon",
() => oI,
"FullscreenVideoPlayer",
() => oP,
"ProgressSlider",
() => oC,
],
575091,
),
e.s(["MediaPreviewOverlay", () => oU], 113492);
var oH = e.i(777784),
oV = e.i(944733),
oW = e.i(733077),
o$ = e.i(675706),
oB = e.i(635287),
oF = e.i(791997),
oz = e.i(41114),
oG = e.i(295085);
function oq(e) {
return e.videoUrl || e.originalVideoUrl || e.previewPath || "";
}
function oQ() {}
let oK = [
{
key: "libtv",
label: "LibTV",
subTabs: [
{ key: "image", label: "图片" },
{ key: "video", label: "视频" },
{ key: "audio", label: "音频" },
],
},
{
key: "lib-generator",
label: "Lib生成器",
subTabs: [
{ key: "image", label: "图片" },
{ key: "video", label: "视频" },
],
},
{
key: "webui",
label: "WebUI",
subTabs: [
{ key: "image", label: "图片" },
{ key: "video", label: "视频" },
],
},
{
key: "comfyui",
label: "ComfyUI",
subTabs: [
{ key: "image", label: "图片" },
{ key: "video", label: "音视频" },
],
},
{
key: "ai-app",
label: "AI应用",
subTabs: [
{ key: "image", label: "图片" },
{ key: "video", label: "音视频" },
],
},
],
oY = [15, 30, 45, 60],
oX = { image: "选择图片", video: "选择视频", audio: "选择音频" };
function oZ(e) {
let t = e.mediaType ?? "image",
i = e.previewPath ?? "",
a = "video" === t && /\.(mp4|webm|mov|m4v)(\?|$)/i.test(i) ? "" : i;
return {
id: String(e.artifactId ?? e.taskId ?? Math.random()),
thumbnailUrl: a,
mediaType: t,
raw: e,
source: "libtv",
};
}
function oJ(e, t, i) {
let a =
"video" === t
? e.imageUrl || e.coverPathUrl || ""
: e.imageUrl || e.imageId || e.url || "";
return {
id: String(e.id ?? Math.random()),
thumbnailUrl: a,
mediaType: "video" === t ? "video" : "image",
raw: e,
source: i,
};
}
function o0(e) {
return "object" == typeof e && null !== e && "data" in e
? (e.data ?? {})
: (e ?? {});
}
async function o1(e, t, i, a) {
let r;
if ("audio" === t && "libtv" !== e) return { items: [], total: 0 };
if ("libtv" === e) {
let e = await (0, oW.listTaskArtifacts)({
mediaType: t,
page: i,
pageSize: a,
});
if ((0, oB.isApiOk)(e)) {
let t = (0, oB.getApiData)(e);
return { items: (t?.list ?? []).map(oZ), total: t?.total ?? 0 };
}
return { items: [], total: 0 };
}
let n =
((r = new Date().getFullYear() + 1),
{
pageNo: i,
pageSize: a,
fromTime: "2024-01-01 00:00:00",
toTime: `${r}-01-01 00:00:00`,
});
if ("lib-generator" === e) {
n.fromTime = "2025-07-01 00:00:00";
let { list: i, total: a } = o0(
"image" === t
? await o$.editorImageService.getEditorImgHistory(n)
: await o$.editorImageService.getEditorVideoHistory(n),
);
return { items: (i ?? []).map((i) => oJ(i, t, e)), total: a ?? 0 };
}
if ("webui" === e) {
let { list: i, total: a } = o0(
"image" === t
? await o$.editorImageService.getWebUiImgHistory(n)
: await o$.editorImageService.getWebUiVideoHistory(n),
);
return { items: (i ?? []).map((i) => oJ(i, t, e)), total: a ?? 0 };
}
if ("comfyui" === e) {
let { list: i, total: a } = o0(
"image" === t
? await o$.sdService.getComfyHistory(n)
: await o$.sdService.getComfyVideoHistory(n),
);
return { items: (i ?? []).map((i) => oJ(i, t, e)), total: a ?? 0 };
}
if ("ai-app" === e) {
let { list: i, total: a } = o0(
"image" === t
? await o$.sdService.getAiImgHistoryList(n)
: await o$.sdService.getAiVideoHistoryList(n),
);
return { items: (i ?? []).map((i) => oJ(i, t, e)), total: a ?? 0 };
}
return { items: [], total: 0 };
}
function o2({
item: e,
selected: t,
onToggle: i,
onDelete: a,
onPreview: r,
themeLight: n,
}) {
let [o, s] = (0, tO.useState)(!1),
[l, d] = (0, tO.useState)(!1),
u = (0, tO.useRef)(null),
c = (0, tO.useRef)(!1),
h = (0, tO.useRef)(!1),
m = "video" === e.mediaType ? oq(e.raw) : "",
p = (0, tO.useCallback)(() => {
if (!m) return;
c.current = !0;
let e = u.current;
e &&
(h.current
? ((e.currentTime = 0), e.play().catch(oQ), d(!0))
: ((e.src = m), e.load()));
}, [m]),
v = (0, tO.useCallback)(() => {
(c.current = !1), d(!1);
let e = u.current;
e && e.pause();
}, []),
b = (0, tO.useCallback)(() => {
(h.current = !0), c.current && (d(!0), u.current?.play().catch(oQ));
}, []),
g =
e.thumbnailUrl ||
(m ? (0, oG.getVideoSnapshotForWidth)(m, 300) : null);
return (0, tj.jsx)("div", {
className:
"group relative w-full cursor-pointer overflow-hidden rounded-lg",
style: { height: 277 },
onClick: () => i(e),
children: (0, tj.jsxs)("div", {
className: (0, oz.cn)(
"border-hair relative size-full overflow-hidden rounded-lg border-solid transition-colors",
n ? "border-neutral-200" : "border-[#4a4a4a]",
),
onMouseEnter: p,
onMouseLeave: v,
children: [
"audio" === e.mediaType
? (0, tj.jsx)("div", {
className: (0, oz.cn)(
"flex size-full flex-col items-center justify-center",
n ? "bg-neutral-100" : "bg-neutral-800",
),
children: (0, tj.jsx)(t$.Icons.ThumbnailAudio, {
width: 36,
height: 36,
className: "text-neutral-500",
}),
})
: !g || o
? "video" === e.mediaType && m
? (0, tj.jsx)("div", {
className: (0, oz.cn)(
"flex size-full flex-col items-center justify-center",
n ? "bg-neutral-100" : "bg-neutral-800",
),
children: (0, tj.jsx)(t$.Icons.VideoBox, {
width: 36,
height: 36,
className: "text-neutral-400",
}),
})
: (0, tj.jsx)("div", {
className: (0, oz.cn)(
"flex size-full items-center justify-center text-xs",
n
? "bg-neutral-100 text-neutral-500"
: "bg-neutral-800 text-neutral-400",
),
children: "暂无预览",
})
: (0, tj.jsx)("img", {
src: g.startsWith("data:")
? g
: (0, oG.getOssCompressedImage)(g, 600),
alt: "",
className: "absolute inset-0 size-full object-cover",
onError: () => s(!0),
}),
m &&
(0, tj.jsx)("video", {
ref: u,
className: (0, oz.cn)(
"absolute inset-0 size-full object-cover transition-opacity duration-200",
l ? "opacity-100" : "opacity-0",
),
muted: !0,
loop: !0,
playsInline: !0,
preload: "none",
disablePictureInPicture: !0,
disableRemotePlayback: !0,
crossOrigin: "anonymous",
onLoadedData: b,
}),
(0, tj.jsx)("div", {
className: (0, oz.cn)(
"absolute inset-x-0 top-0 flex items-start rounded-t-lg p-2 transition-opacity",
"bg-linear-to-b from-black/16 to-transparent",
t ? "opacity-100" : "opacity-0 group-hover:opacity-100",
),
children: t
? (0, tj.jsx)("button", {
type: "button",
onClick: (t) => {
t.stopPropagation(), i(e);
},
className:
"bg-brand-600 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full border-none",
children: (0, tj.jsx)(t$.Icons.Check, {
width: 12,
height: 12,
color: "white",
}),
})
: (0, tj.jsx)("button", {
type: "button",
onClick: (t) => {
t.stopPropagation(), i(e);
},
className:
"flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full border-[1.5px] border-solid border-white/70 bg-black/20",
}),
}),
(0, tj.jsxs)("div", {
className:
"bg-linear-to-t absolute inset-x-0 bottom-0 flex items-center justify-end gap-2 rounded-b-lg from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",
children: [
(0, tj.jsx)("button", {
type: "button",
onClick: (t) => {
t.stopPropagation(), a?.(e);
},
className:
"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded border-none bg-black/65 backdrop-blur-[2px]",
children: (0, tj.jsx)(t$.Icons.Trash, {
width: 14,
height: 14,
color: "white",
}),
}),
(0, tj.jsx)("button", {
type: "button",
onClick: (t) => {
t.stopPropagation(), r?.(e);
},
className:
"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded border-none bg-black/65 backdrop-blur-[2px]",
children: (0, tj.jsx)(t$.Icons.BroadPicture, {
width: 14,
height: 14,
color: "white",
}),
}),
],
}),
],
}),
});
}
function o3({
opened: e,
onClose: t,
onConfirm: i,
maxSelect: a = 3,
allowedMediaType: r,
zIndex: n = "var(--z-modal)",
}) {
let [o, s] = (0, tO.useState)("libtv"),
[l, d] = (0, tO.useState)("image"),
[u, c] = (0, tO.useState)([]),
[h, m] = (0, tO.useState)(0),
[p, v] = (0, tO.useState)(1),
[b, g] = (0, tO.useState)(15),
[f, E] = (0, tO.useState)(!1),
[w, y] = (0, tO.useState)(!1),
[x, A] = (0, tO.useState)([]),
[k, I] = (0, tO.useState)(null),
C = null !== k ? (u[k] ?? null) : null,
T = (0, tO.useRef)(0),
M = "light" === (0, oF.useCanvasThemeStore)((e) => e.theme),
_ = (0, tO.useMemo)(() => oK.find((e) => e.key === o), [o]),
S = oX[l] ?? "选择图片",
L = (0, tO.useMemo)(
() => (r ? new Set(Array.isArray(r) ? r : [r]) : null),
[r],
),
R = (0, tO.useCallback)((e) => !!L && !L.has(e), [L]),
D = (0, tO.useCallback)(async (e, t, i, a) => {
let r = ++T.current;
E(!0), y(!1);
try {
let n = await o1(e, t, i, a);
if (T.current !== r) return;
c(n.items), m(n.total);
} catch {
if (T.current !== r) return;
c([]), m(0), y(!0);
} finally {
T.current === r && E(!1);
}
}, []);
(0, tO.useEffect)(() => {
e && D(o, l, p, b);
}, [e, o, l, p, b, D]),
(0, tO.useEffect)(() => {
e &&
(s("libtv"),
d((L ? [...L][0] : "image") ?? "image"),
v(1),
g(15),
A([]),
c([]),
m(0)),
I(null);
}, [e, L]);
let N = (0, tO.useCallback)(
(e) => {
if (e === o) return;
s(e);
let t = oK.find((t) => t.key === e);
d(
(L ? t?.subTabs.find((e) => L.has(e.key))?.key : void 0) ??
t?.subTabs[0]?.key ??
"image",
),
v(1),
A([]);
},
[o, L],
),
P = (0, tO.useCallback)(
(e) => {
R(e) || (e !== l && (d(e), v(1), A([])));
},
[l, R],
),
j = (0, tO.useCallback)((e) => {
v(e);
}, []),
O = (0, tO.useCallback)((e) => {
g(e), v(1);
}, []),
U = (0, tO.useCallback)(
(e) => {
A((t) => {
let i = t.findIndex((t) => t.id === e.id);
return i >= 0
? t.filter((e, t) => t !== i)
: t.length >= a
? t
: [...t, e];
});
},
[a],
),
H = (0, tO.useCallback)(() => {
i(x), t();
}, [x, i, t]),
V = (0, tO.useCallback)(
(e) => {
let t = Number(e.raw.artifactId);
"libtv" !== o || !Number.isFinite(t) || t <= 0
? oH.Notify.error("当前记录不支持删除")
: (0, oV.confirm)({
title: "删除记录",
message: "确认删除吗,删除后将不可恢复",
confirmText: "删除",
onConfirm: async () => {
let i = await (0, oW.delTaskArtifact)({ artifactId: t });
if (!(0, oB.isApiOk)(i)) throw Error("删除失败");
c((t) => t.filter((t) => t.id !== e.id)),
A((t) => t.filter((t) => t.id !== e.id)),
m((e) => Math.max(0, e - 1)),
oH.Notify.success("已删除");
},
});
},
[o],
),
W = (0, tO.useCallback)((e) => x.some((t) => t.id === e.id), [x]),
$ = Math.max(1, Math.ceil(h / b)),
B = (0, tO.useCallback)(
(e) => {
if ("Enter" !== e.key) return;
let t = Number(e.currentTarget.value);
Number.isFinite(t) && t >= 1 && t <= $ && j(t),
(e.currentTarget.value = "");
},
[$, j],
);
return (
(0, tO.useEffect)(() => {
if (!e) return;
let i = (e) => {
"Escape" !== e.key ||
C ||
(e.preventDefault(),
e.stopPropagation(),
e.stopImmediatePropagation(),
t());
};
return (
document.addEventListener("keydown", i, !0),
() => document.removeEventListener("keydown", i, !0)
);
}, [e, t, C]),
(0, tj.jsxs)(tj.Fragment, {
children: [
(0, tj.jsx)(tH.Modal, {
opened: e,
onClose: t,
zIndex: n,
closeOnEscape: !1,
size: "auto",
centered: !0,
withCloseButton: !1,
padding: 0,
radius: 12,
styles: {
content: {
border: M ? "0.5px solid #e3e3e3" : "0.5px solid #2f2f2f",
background: M ? "#ffffff" : "#1f1f1f",
overflow: "hidden",
width: "min(90vw, 1600px)",
maxWidth: "min(90vw, 1600px)",
height: "calc(100vh - 160px)",
maxHeight: "calc(100vh - 160px)",
},
},
children: (0, tj.jsxs)("div", {
className: (0, oz.cn)(
"flex min-h-0 flex-col pt-4",
M ? "canvas-light bg-white" : "bg-[#1f1f1f]",
),
style: {
width: "min(90vw, 1600px)",
maxWidth: "min(90vw, 1600px)",
height: "calc(100vh - 160px)",
},
children: [
(0, tj.jsxs)("div", {
className: (0, oz.cn)(
"border-b-hair flex shrink-0 items-center justify-between border-solid px-6 pb-4",
M ? "border-[#e8e8e8]" : "border-[#2f2f2f]",
),
children: [
(0, tj.jsx)("span", {
className: (0, oz.cn)(
"text-base font-medium",
M ? "text-neutral-900" : "text-[#f2f2f2]",
),
children: S,
}),
(0, tj.jsx)("button", {
type: "button",
onClick: t,
className: (0, oz.cn)(
"flex size-6 cursor-pointer items-center justify-center rounded-lg border-none bg-transparent transition-colors",
M ? "hover:bg-black/6" : "hover:bg-white/8",
),
children: (0, tj.jsx)(t$.Icons.Close, {
width: 14,
height: 14,
className: M
? "text-neutral-500"
: "text-neutral-400",
}),
}),
],
}),
(0, tj.jsxs)("div", {
className: "flex shrink-0 items-center gap-3 px-6 pt-4",
children: [
(0, tj.jsx)("div", {
className:
"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto [&::-webkit-scrollbar]:hidden",
children: oK.map((e) => {
let t = o === e.key;
return (0, tj.jsx)(
"button",
{
type: "button",
onClick: () => N(e.key),
className: (0, oz.cn)(
"flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-lg border-none px-3 py-1 text-[13px] transition-colors",
t
? M
? "bg-neutral-100 font-medium text-neutral-900"
: "bg-white/12 font-medium text-[#f2f2f2]"
: M
? "hover:bg-black/6 bg-transparent text-neutral-500"
: "hover:bg-white/8 bg-transparent text-[#787878]",
),
children: e.label,
},
e.key,
);
}),
}),
(0, tj.jsxs)("span", {
className: (0, oz.cn)(
"shrink-0 text-[13px]",
M ? "text-neutral-600" : "text-neutral-500",
),
children: [
"已选",
" ",
(0, tj.jsxs)("span", {
className: "text-[#478eff]",
children: [x.length, "/", a],
}),
" ",
"张",
],
}),
],
}),
(0, tj.jsx)("div", {
className: "flex shrink-0 items-center gap-2 px-6 pt-3",
children: _?.subTabs.map((e) => {
let t = l === e.key,
i = R(e.key);
return (0, tj.jsx)(
"button",
{
type: "button",
onClick: () => P(e.key),
disabled: i,
className: (0, oz.cn)(
"flex h-7 cursor-pointer items-center justify-center rounded-md border-none px-2.5 text-[12px] transition-colors",
i && "cursor-not-allowed opacity-40",
t
? M
? "bg-neutral-100 font-medium text-neutral-900"
: "bg-white/12 font-medium text-[#f2f2f2]"
: M
? "hover:bg-black/6 bg-transparent text-neutral-500"
: "hover:bg-white/8 bg-transparent text-[#787878]",
),
children: e.label,
},
e.key,
);
}),
}),
(0, tj.jsx)("div", {
className: "min-h-0 flex-1 px-6 pt-4",
children: f
? (0, tj.jsx)("div", {
className: "flex h-full items-center justify-center",
children: (0, tj.jsx)(tU.Loader, {
size: "sm",
color: "blue",
}),
})
: w
? (0, tj.jsxs)("div", {
className:
"flex h-full flex-col items-center justify-center gap-3",
children: [
(0, tj.jsx)("span", {
className: (0, oz.cn)(
"text-sm",
M ? "text-neutral-600" : "text-neutral-500",
),
children: "加载失败",
}),
(0, tj.jsx)("button", {
type: "button",
onClick: () => void D(o, l, p, b),
className: (0, oz.cn)(
"cursor-pointer rounded-lg border-none px-3 py-1.5 text-xs transition-colors",
M
? "bg-neutral-100 text-neutral-600 hover:bg-neutral-200"
: "bg-white/12 hover:bg-white/16 text-neutral-500",
),
children: "重试",
}),
],
})
: 0 === u.length
? (0, tj.jsx)("div", {
className: (0, oz.cn)(
"flex h-full items-center justify-center text-sm",
M ? "text-neutral-600" : "text-neutral-500",
),
children: "暂无数据",
})
: (0, tj.jsx)("div", {
className:
"h-full overflow-x-hidden [overflow-y:overlay]",
children: (0, tj.jsx)("div", {
className: "grid content-start gap-2",
style: {
gridTemplateColumns:
"repeat(auto-fill, minmax(208px, 1fr))",
},
children: u.map((e) =>
(0, tj.jsx)(
o2,
{
item: e,
selected: W(e),
themeLight: M,
onToggle: U,
onDelete: V,
onPreview: (e) => {
let t = u.indexOf(e);
I(t >= 0 ? t : null);
},
},
e.id,
),
),
}),
}),
}),
(0, tj.jsxs)("div", {
className: "flex shrink-0 items-center gap-3 px-6 py-4",
children: [
(0, tj.jsx)("div", {
className: "flex min-w-0 flex-1 items-center gap-2",
children:
h > 0 &&
(0, tj.jsxs)(tj.Fragment, {
children: [
(0, tj.jsx)(tV.Pagination, {
value: p,
onChange: j,
total: $,
size: "sm",
radius: "md",
classNames: {
control: M
? "border-none text-[13px] min-w-7 h-7 text-neutral-600 bg-transparent hover:bg-neutral-100 hover:text-neutral-900 data-[active]:bg-neutral-100 data-[active]:text-neutral-900"
: "border-none text-[13px] min-w-7 h-7 text-[#b0b0b0] bg-transparent hover:bg-[#303030] hover:text-[#e6e6e6] data-[active]:bg-[#303030] data-[active]:text-[#e6e6e6]",
dots: M
? "text-neutral-500"
: "text-[#b0b0b0]",
},
}),
(0, tj.jsx)(tW.Select, {
value: String(b),
onChange: (e) => e && O(Number(e)),
data: oY.map((e) => ({
value: String(e),
label: `${e}条/页`,
})),
allowDeselect: !1,
withCheckIcon: !1,
comboboxProps: { withinPortal: !1 },
size: "xs",
classNames: {
root: "w-[90px]",
wrapper: "w-[90px]",
input: M
? "h-7 min-h-7 cursor-pointer rounded-lg border border-solid border-neutral-200 bg-neutral-50 pr-6 pl-2 text-[13px] text-neutral-700"
: "h-7 min-h-7 cursor-pointer rounded-lg border-none bg-[#303030] pr-6 pl-2 text-[13px] text-[#b0b0b0]",
dropdown: M
? "rounded-lg border border-solid border-neutral-200 bg-white"
: "rounded-lg border border-solid border-[#3a3a3a] bg-[#262626]",
option: M
? "rounded-md text-[13px] text-neutral-700 data-[combobox-selected]:bg-neutral-100 data-[combobox-selected]:text-neutral-900 data-[combobox-active]:bg-neutral-50"
: "rounded-md text-[13px] text-[#b0b0b0] data-[combobox-selected]:bg-[#303030] data-[combobox-selected]:text-[#e6e6e6] data-[combobox-active]:bg-[#404040]",
},
}),
(0, tj.jsxs)("div", {
className: (0, oz.cn)(
"flex shrink-0 items-center gap-1 text-[13px]",
M ? "text-neutral-600" : "text-[#b0b0b0]",
),
children: [
(0, tj.jsx)("span", { children: "跳至" }),
(0, tj.jsx)("input", {
type: "text",
inputMode: "numeric",
className: (0, oz.cn)(
"h-7 w-10 rounded-lg text-center text-[13px] outline-none",
M
? "border border-solid border-neutral-200 bg-neutral-50 text-neutral-800"
: "border-none bg-[#303030] text-[#b0b0b0]",
),
onKeyDown: B,
}),
(0, tj.jsx)("span", { children: "页" }),
],
}),
],
}),
}),
(0, tj.jsx)("button", {
type: "button",
onClick: H,
disabled: 0 === x.length,
className:
"bg-brand-600 flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-lg border-none px-3 py-2 text-[13px] text-white transition-colors hover:bg-[#478eff] disabled:cursor-default disabled:opacity-50",
children: "确定",
}),
],
}),
],
}),
}),
null !== k &&
C &&
(0, tj.jsx)(oU, {
mediaType: C.mediaType,
src:
"video" === C.mediaType
? oq(C.raw)
: "audio" === C.mediaType
? C.raw.audioUrl || C.raw.previewPath || ""
: C.thumbnailUrl || C.raw.imageUrl || "",
onClose: () => I(null),
onPrev:
k > 0
? () => I((e) => (null !== e && e > 0 ? e - 1 : e))
: void 0,
onNext:
k < u.length - 1
? () =>
I((e) => (null !== e && e < u.length - 1 ? e + 1 : e))
: void 0,
zIndex: "number" == typeof n ? n + 100 : 900,
}),
],
})
);
}
e.s(["GalleryModal", () => o3], 763910);
};
export default moduleFactory;