@sapia-ai/chatbot-v3 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EmbeddedVideoPlayer-CNcds-dW.js → EmbeddedVideoPlayer-COUZHpPa.js} +14 -14
- package/dist/{Preview-Dmns6UWL.js → Preview-wPnYtccF.js} +3 -3
- package/dist/api/client.d.ts +6 -2
- package/dist/api/types/messages.d.ts +16 -5
- package/dist/api/types/responses.d.ts +48 -7
- package/dist/api.js +2 -2
- package/dist/core/bubbles/types.d.ts +2 -5
- package/dist/core/i18n/languages.d.ts +6 -1
- package/dist/core/interview.d.ts +15 -8
- package/dist/core/media/mimeTypes.d.ts +6 -1
- package/dist/core/media/recorder.d.ts +11 -2
- package/dist/core/store.d.ts +21 -1
- package/dist/core/theme/contrast.d.ts +6 -0
- package/dist/core/theme/cssVariables.d.ts +5 -0
- package/dist/core/theme/types.d.ts +3 -0
- package/dist/{dist-BSi28_cP.js → dist-BOe6WyvN.js} +92 -92
- package/dist/{dist-B9SbMqZU.js → dist-Bwlks_W8.js} +98 -98
- package/dist/{fix-webm-duration-BWL-ZRDX.js → fix-webm-duration-QAy9T6AR.js} +2 -2
- package/dist/index.js +7445 -5039
- package/dist/{jsx-runtime-8QqjHL5t.js → jsx-runtime-24G8w2Bf.js} +2 -2
- package/dist/{messages-Czlp86gl.js → messages-DCvBcspv.js} +260 -245
- package/dist/react/AnswerInput.d.ts +4 -5
- package/dist/react/bubbleViewModel.d.ts +25 -9
- package/dist/react/strings.d.ts +26 -3
- package/dist/{react-DJysvNxz.js → react-BjO903pN.js} +33 -33
- package/dist/{react-QrtEtv1G.js → react-Bw5AugJc.js} +31 -31
- package/dist/{react-dE7BdGuR.js → react-D8hV9uow.js} +10 -10
- package/dist/{react-NauLB_WU.js → react-DDjfkpOE.js} +38 -38
- package/dist/{react-Dbs-sPBo.js → react-DEF8h8hc.js} +37 -37
- package/dist/{react-B0K-sClg.js → react-DOgLiyZi.js} +2 -2
- package/dist/{react-be7q6yw_.js → react-DPFikgTM.js} +55 -55
- package/dist/{react-ChCcxVnw.js → react-qa12DkXH.js} +34 -34
- package/dist/{react-czRIxT0g.js → react-y4vaW3OH.js} +46 -46
- package/dist/ui/chat/ChatBubble/ChatBubble.d.ts +14 -5
- package/dist/ui/chat/ChatLog/ChatLog.d.ts +6 -4
- package/dist/ui/chat/EditBanner/EditBanner.d.ts +16 -0
- package/dist/ui/chat/SummaryCard/SummaryCard.d.ts +46 -0
- package/dist/ui/chat/types.d.ts +21 -8
- package/dist/ui/constants.d.ts +1 -0
- package/dist/ui/inputs/OptionList/OptionList.d.ts +3 -1
- package/dist/ui/inputs/TextAnswerInput/TextAnswerInput.d.ts +11 -4
- package/dist/ui/inputs/VideoRecorder/VideoRecorder.d.ts +6 -2
- package/dist/ui/markdown.d.ts +4 -0
- package/dist/ui/motion.d.ts +2 -0
- package/dist/ui/primitives/Button/Button.d.ts +5 -1
- package/dist/ui/primitives/Dialog/Dialog.d.ts +2 -1
- package/dist/ui/shell/WidgetRoot/WidgetRoot.d.ts +7 -1
- package/dist-umd/sapia-chatbot.umd.js +394 -270
- package/package.json +4 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
3
|
-
import {
|
|
4
|
-
import { t as s } from "./
|
|
1
|
+
import { w as e } from "./messages-DCvBcspv.js";
|
|
2
|
+
import { t } from "./react-DOgLiyZi.js";
|
|
3
|
+
import { t as n } from "./defineProperty-DiFpLzd2.js";
|
|
4
|
+
import { a as r, i, n as a, r as o, t as s } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
5
5
|
import { t as c } from "./dist-FvHBWiRa.js";
|
|
6
6
|
//#region ../../node_modules/.pnpm/@vimeo+player@2.29.0/node_modules/@vimeo/player/dist/player.es.js
|
|
7
7
|
var l = /* @__PURE__ */ e(t(), 1);
|
|
@@ -1812,9 +1812,9 @@ function Le(e, t) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakSet(), $ = class extends c((Me = globalThis.HTMLElement) == null ? class {} : Me) {
|
|
1814
1814
|
constructor() {
|
|
1815
|
-
super(),
|
|
1816
|
-
|
|
1817
|
-
}),
|
|
1815
|
+
super(), r(this, ze), n(this, "loadComplete", new qe()), i(this, L, void 0), i(this, R, void 0), i(this, z, void 0), i(this, B, 0), i(this, V, NaN), i(this, H, !1), i(this, U, !this.autoplay), i(this, W, 1), i(this, G, 0), i(this, K, 0), i(this, q, !1), i(this, J, 1), i(this, Y, NaN), i(this, X, NaN), i(this, Z, null), i(this, Q, !1), i(this, Re, async () => {
|
|
1816
|
+
s(K, this, 1), this.dispatchEvent(new Event("loadedmetadata")), this.api && (s(H, this, await this.api.getMuted()), s(J, this, await this.api.getVolume()), this.dispatchEvent(new Event("volumechange")), s(V, this, await this.api.getDuration()), this.dispatchEvent(new Event("durationchange"))), this.dispatchEvent(new Event("loadcomplete")), this.loadComplete.resolve();
|
|
1817
|
+
}), o(ze, this, Ve).call(this, "config");
|
|
1818
1818
|
}
|
|
1819
1819
|
requestFullscreen() {
|
|
1820
1820
|
var e, t;
|
|
@@ -1833,18 +1833,18 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1833
1833
|
return (t = (e = this.api) == null ? void 0 : e.exitPictureInPicture) == null ? void 0 : t.call(e);
|
|
1834
1834
|
}
|
|
1835
1835
|
get config() {
|
|
1836
|
-
return
|
|
1836
|
+
return a(Z, this);
|
|
1837
1837
|
}
|
|
1838
1838
|
set config(e) {
|
|
1839
|
-
JSON.stringify(
|
|
1839
|
+
JSON.stringify(a(Z, this)) !== JSON.stringify(e) && (s(Z, this, e), this.load());
|
|
1840
1840
|
}
|
|
1841
1841
|
async load() {
|
|
1842
1842
|
var e, t;
|
|
1843
|
-
if (
|
|
1844
|
-
await
|
|
1843
|
+
if (a(L, this)) return;
|
|
1844
|
+
await s(L, this, Promise.resolve()), s(L, this, null), s(B, this, 0), s(V, this, NaN), s(H, this, !1), s(U, this, !this.autoplay), s(W, this, 1), s(G, this, 0), s(K, this, 0), s(q, this, !1), s(J, this, 1), s(K, this, 0), s(Y, this, NaN), s(X, this, NaN), this.dispatchEvent(new Event("emptied"));
|
|
1845
1845
|
let n = this.api;
|
|
1846
1846
|
if (this.api = null, !this.src) return;
|
|
1847
|
-
|
|
1847
|
+
a(R, this) && (this.loadComplete = new qe()), s(R, this, !0), this.dispatchEvent(new Event("loadstart"));
|
|
1848
1848
|
let r = {
|
|
1849
1849
|
autoplay: this.autoplay,
|
|
1850
1850
|
controls: this.controls,
|
|
@@ -1854,28 +1854,28 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1854
1854
|
preload: (e = this.preload) == null ? "metadata" : e,
|
|
1855
1855
|
transparent: !1,
|
|
1856
1856
|
autopause: this.hasAttribute("autopause"),
|
|
1857
|
-
...
|
|
1857
|
+
...a(Z, this)
|
|
1858
1858
|
};
|
|
1859
|
-
if (
|
|
1859
|
+
if (a(z, this)) {
|
|
1860
1860
|
this.api = n, await this.api.loadVideo({
|
|
1861
1861
|
...r,
|
|
1862
1862
|
url: this.src
|
|
1863
|
-
}), await
|
|
1863
|
+
}), await a(Re, this).call(this), await this.loadComplete;
|
|
1864
1864
|
return;
|
|
1865
1865
|
}
|
|
1866
|
-
|
|
1867
|
-
let
|
|
1868
|
-
|
|
1866
|
+
s(z, this, !0), this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
1867
|
+
let i = this.shadowRoot.querySelector("iframe");
|
|
1868
|
+
i && !a(Q, this) ? a(Z, this) || s(Z, this, JSON.parse(i.getAttribute("data-config") || "{}")) : this.shadowRoot.innerHTML = Ie(Ke(this.attributes), this), s(Q, this, !1), (t = n == null ? void 0 : n.destroy) == null || t.call(n);
|
|
1869
1869
|
let c = this.shadowRoot.querySelector("iframe");
|
|
1870
|
-
this.api = new je(c),
|
|
1870
|
+
this.api = new je(c), o(ze, this, Be).call(this), await this.loadComplete;
|
|
1871
1871
|
}
|
|
1872
1872
|
connectedCallback() {
|
|
1873
1873
|
var e;
|
|
1874
|
-
|
|
1874
|
+
a(Q, this) && this.load(), (e = super.connectedCallback) == null || e.call(this);
|
|
1875
1875
|
}
|
|
1876
1876
|
disconnectedCallback() {
|
|
1877
1877
|
var e, t, n;
|
|
1878
|
-
|
|
1878
|
+
s(Q, this, !0), s(L, this, null), s(R, this, null), s(z, this, null), this.loadComplete = new qe(), (t = (e = this.api) == null ? void 0 : e.destroy) == null || t.call(e), this.api = null, (n = super.disconnectedCallback) == null || n.call(this);
|
|
1879
1879
|
}
|
|
1880
1880
|
async attributeChangedCallback(e, t, n) {
|
|
1881
1881
|
if (t !== n) {
|
|
@@ -1895,11 +1895,11 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1895
1895
|
}
|
|
1896
1896
|
async play() {
|
|
1897
1897
|
var e;
|
|
1898
|
-
|
|
1898
|
+
s(U, this, !1), this.dispatchEvent(new Event("play")), await this.loadComplete;
|
|
1899
1899
|
try {
|
|
1900
1900
|
await ((e = this.api) == null ? void 0 : e.play());
|
|
1901
1901
|
} catch (e) {
|
|
1902
|
-
throw
|
|
1902
|
+
throw s(U, this, !0), this.dispatchEvent(new Event("pause")), e;
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
async pause() {
|
|
@@ -1907,19 +1907,19 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1907
1907
|
return await this.loadComplete, (e = this.api) == null ? void 0 : e.pause();
|
|
1908
1908
|
}
|
|
1909
1909
|
get ended() {
|
|
1910
|
-
return
|
|
1910
|
+
return a(B, this) >= a(V, this);
|
|
1911
1911
|
}
|
|
1912
1912
|
get seeking() {
|
|
1913
|
-
return
|
|
1913
|
+
return a(q, this);
|
|
1914
1914
|
}
|
|
1915
1915
|
get readyState() {
|
|
1916
|
-
return
|
|
1916
|
+
return a(K, this);
|
|
1917
1917
|
}
|
|
1918
1918
|
get videoWidth() {
|
|
1919
|
-
return
|
|
1919
|
+
return a(Y, this);
|
|
1920
1920
|
}
|
|
1921
1921
|
get videoHeight() {
|
|
1922
|
-
return
|
|
1922
|
+
return a(X, this);
|
|
1923
1923
|
}
|
|
1924
1924
|
get src() {
|
|
1925
1925
|
return this.getAttribute("src");
|
|
@@ -1928,10 +1928,10 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1928
1928
|
this.src != e && this.setAttribute("src", e);
|
|
1929
1929
|
}
|
|
1930
1930
|
get paused() {
|
|
1931
|
-
return
|
|
1931
|
+
return a(U, this);
|
|
1932
1932
|
}
|
|
1933
1933
|
get duration() {
|
|
1934
|
-
return
|
|
1934
|
+
return a(V, this);
|
|
1935
1935
|
}
|
|
1936
1936
|
get autoplay() {
|
|
1937
1937
|
return this.hasAttribute("autoplay");
|
|
@@ -1940,7 +1940,7 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1940
1940
|
this.autoplay != e && this.toggleAttribute("autoplay", !!e);
|
|
1941
1941
|
}
|
|
1942
1942
|
get buffered() {
|
|
1943
|
-
return
|
|
1943
|
+
return a(G, this) > 0 ? Je(0, a(G, this)) : Je();
|
|
1944
1944
|
}
|
|
1945
1945
|
get controls() {
|
|
1946
1946
|
return this.hasAttribute("controls");
|
|
@@ -1949,10 +1949,10 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1949
1949
|
this.controls != e && this.toggleAttribute("controls", !!e);
|
|
1950
1950
|
}
|
|
1951
1951
|
get currentTime() {
|
|
1952
|
-
return
|
|
1952
|
+
return a(B, this);
|
|
1953
1953
|
}
|
|
1954
1954
|
set currentTime(e) {
|
|
1955
|
-
this.currentTime != e && (
|
|
1955
|
+
this.currentTime != e && (s(B, this, e), this.loadComplete.then(() => {
|
|
1956
1956
|
var t;
|
|
1957
1957
|
(t = this.api) == null || t.setCurrentTime(e).catch(() => {});
|
|
1958
1958
|
}));
|
|
@@ -1970,19 +1970,19 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
1970
1970
|
this.loop != e && this.toggleAttribute("loop", !!e);
|
|
1971
1971
|
}
|
|
1972
1972
|
get muted() {
|
|
1973
|
-
return
|
|
1973
|
+
return a(H, this);
|
|
1974
1974
|
}
|
|
1975
1975
|
set muted(e) {
|
|
1976
|
-
this.muted != e && (
|
|
1976
|
+
this.muted != e && (s(H, this, e), this.loadComplete.then(() => {
|
|
1977
1977
|
var t;
|
|
1978
1978
|
(t = this.api) == null || t.setMuted(e).catch(() => {});
|
|
1979
1979
|
}));
|
|
1980
1980
|
}
|
|
1981
1981
|
get playbackRate() {
|
|
1982
|
-
return
|
|
1982
|
+
return a(W, this);
|
|
1983
1983
|
}
|
|
1984
1984
|
set playbackRate(e) {
|
|
1985
|
-
this.playbackRate != e && (
|
|
1985
|
+
this.playbackRate != e && (s(W, this, e), this.loadComplete.then(() => {
|
|
1986
1986
|
var t;
|
|
1987
1987
|
(t = this.api) == null || t.setPlaybackRate(e).catch(() => {});
|
|
1988
1988
|
}));
|
|
@@ -2000,10 +2000,10 @@ var L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /*
|
|
|
2000
2000
|
this.poster != e && this.setAttribute("poster", `${e}`);
|
|
2001
2001
|
}
|
|
2002
2002
|
get volume() {
|
|
2003
|
-
return
|
|
2003
|
+
return a(J, this);
|
|
2004
2004
|
}
|
|
2005
2005
|
set volume(e) {
|
|
2006
|
-
this.volume != e && (
|
|
2006
|
+
this.volume != e && (s(J, this, e), this.loadComplete.then(() => {
|
|
2007
2007
|
var t;
|
|
2008
2008
|
(t = this.api) == null || t.setVolume(e).catch(() => {});
|
|
2009
2009
|
}));
|
|
@@ -2020,35 +2020,35 @@ function Be() {
|
|
|
2020
2020
|
e ? this.api.enableTextTrack(e.language, e.kind) : this.api.disableTextTrack();
|
|
2021
2021
|
});
|
|
2022
2022
|
let t = () => {
|
|
2023
|
-
this.api.off("loaded", t),
|
|
2023
|
+
this.api.off("loaded", t), a(Re, this).call(this);
|
|
2024
2024
|
};
|
|
2025
2025
|
this.api.on("loaded", t), this.api.on("bufferstart", () => {
|
|
2026
|
-
|
|
2026
|
+
a(U, this) && (s(U, this, !1), this.dispatchEvent(new Event("play"))), this.dispatchEvent(new Event("waiting"));
|
|
2027
2027
|
}), this.api.on("play", () => {
|
|
2028
|
-
|
|
2028
|
+
a(U, this) && (s(U, this, !1), this.dispatchEvent(new Event("play")));
|
|
2029
2029
|
}), this.api.on("playing", () => {
|
|
2030
|
-
|
|
2030
|
+
s(K, this, 3), s(U, this, !1), this.dispatchEvent(new Event("playing"));
|
|
2031
2031
|
}), this.api.on("seeking", () => {
|
|
2032
|
-
|
|
2032
|
+
s(q, this, !0), this.onSeeking(), this.dispatchEvent(new Event("seeking"));
|
|
2033
2033
|
}), this.api.on("seeked", async () => {
|
|
2034
|
-
|
|
2034
|
+
s(q, this, !1), s(B, this, await this.api.getCurrentTime().catch(() => a(B, this))), this.dispatchEvent(new Event("seeked"));
|
|
2035
2035
|
}), this.api.on("pause", () => {
|
|
2036
|
-
|
|
2036
|
+
s(U, this, !0), this.dispatchEvent(new Event("pause"));
|
|
2037
2037
|
}), this.api.on("ended", () => {
|
|
2038
|
-
|
|
2038
|
+
s(U, this, !0), this.dispatchEvent(new Event("ended"));
|
|
2039
2039
|
}), this.api.on("ratechange", ({ playbackRate: e }) => {
|
|
2040
|
-
|
|
2040
|
+
s(W, this, e), this.dispatchEvent(new Event("ratechange"));
|
|
2041
2041
|
}), this.api.on("volumechange", async ({ volume: e }) => {
|
|
2042
|
-
|
|
2042
|
+
s(J, this, e), this.api && s(H, this, await this.api.getMuted()), this.dispatchEvent(new Event("volumechange"));
|
|
2043
2043
|
}), this.api.on("durationchange", ({ duration: e }) => {
|
|
2044
|
-
|
|
2044
|
+
s(V, this, e), this.dispatchEvent(new Event("durationchange"));
|
|
2045
2045
|
}), this.api.on("timeupdate", ({ seconds: e }) => {
|
|
2046
2046
|
let t = Math.round(e * 100) / 100;
|
|
2047
|
-
|
|
2047
|
+
s(B, this, t), this.dispatchEvent(new Event("timeupdate"));
|
|
2048
2048
|
}), this.api.on("progress", ({ seconds: e }) => {
|
|
2049
|
-
|
|
2049
|
+
s(G, this, e), this.dispatchEvent(new Event("progress"));
|
|
2050
2050
|
}), this.api.on("resize", ({ videoWidth: e, videoHeight: t }) => {
|
|
2051
|
-
|
|
2051
|
+
s(Y, this, e), s(X, this, t), this.dispatchEvent(new Event("resize"));
|
|
2052
2052
|
});
|
|
2053
2053
|
}
|
|
2054
2054
|
function Ve(e) {
|
|
@@ -2057,7 +2057,7 @@ function Ve(e) {
|
|
|
2057
2057
|
delete this[e], this[e] = t;
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
|
-
|
|
2060
|
+
n($, "getTemplateHTML", Ie), n($, "shadowRootOptions", { mode: "open" }), n($, "observedAttributes", [
|
|
2061
2061
|
"autoplay",
|
|
2062
2062
|
"controls",
|
|
2063
2063
|
"crossorigin",
|
|
@@ -2207,4 +2207,4 @@ var rt = tt({
|
|
|
2207
2207
|
//#endregion
|
|
2208
2208
|
export { rt as default };
|
|
2209
2209
|
|
|
2210
|
-
//# sourceMappingURL=react-
|
|
2210
|
+
//# sourceMappingURL=react-DPFikgTM.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
3
|
-
import {
|
|
4
|
-
import { t as s } from "./
|
|
1
|
+
import { w as e } from "./messages-DCvBcspv.js";
|
|
2
|
+
import { t } from "./react-DOgLiyZi.js";
|
|
3
|
+
import { t as n } from "./defineProperty-DiFpLzd2.js";
|
|
4
|
+
import { a as r, i, n as a, r as o, t as s } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
5
5
|
//#region ../../node_modules/.pnpm/tiktok-video-element@0.1.2/node_modules/tiktok-video-element/dist/tiktok-video-element.js
|
|
6
6
|
var c = /* @__PURE__ */ e(t(), 1), l, u = "https://www.tiktok.com/player/v1", d = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/, f = {
|
|
7
7
|
INIT: -1,
|
|
@@ -67,16 +67,16 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
67
67
|
];
|
|
68
68
|
}
|
|
69
69
|
constructor() {
|
|
70
|
-
super(),
|
|
70
|
+
super(), r(this, E), n(this, "loadComplete", new N()), i(this, g, void 0), i(this, _, void 0), i(this, v, !1), i(this, y, 0), i(this, b, !0), i(this, x, null), i(this, S, 100), i(this, C, 0), i(this, w, void 0), i(this, T, (e) => {
|
|
71
71
|
var t;
|
|
72
|
-
if (e.source !== ((t =
|
|
72
|
+
if (e.source !== ((t = a(w, this)) == null ? void 0 : t.contentWindow)) return;
|
|
73
73
|
let n = e.data;
|
|
74
74
|
if (n != null && n["x-tiktok-player"]) switch (n.type) {
|
|
75
75
|
case "onPlayerReady":
|
|
76
76
|
this.loadComplete.resolve();
|
|
77
77
|
break;
|
|
78
78
|
case "onStateChange": {
|
|
79
|
-
|
|
79
|
+
s(b, this, [
|
|
80
80
|
f.INIT,
|
|
81
81
|
f.PAUSED,
|
|
82
82
|
f.ENDED
|
|
@@ -86,13 +86,13 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case "onCurrentTime":
|
|
89
|
-
|
|
89
|
+
s(y, this, n.value.currentTime), s(C, this, n.value.duration), this.dispatchEvent(new Event("durationchange")), this.dispatchEvent(new Event("timeupdate"));
|
|
90
90
|
break;
|
|
91
91
|
case "onVolumeChange":
|
|
92
|
-
|
|
92
|
+
s(S, this, n.value), this.dispatchEvent(new Event("volumechange"));
|
|
93
93
|
break;
|
|
94
94
|
case "onMute":
|
|
95
|
-
|
|
95
|
+
s(v, this, !!n.value), s(S, this, n.value ? 0 : a(S, this)), this.dispatchEvent(new Event("volumechange"));
|
|
96
96
|
break;
|
|
97
97
|
case "onError":
|
|
98
98
|
this.dispatchEvent(new Event("error"));
|
|
@@ -101,18 +101,18 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
101
101
|
console.warn("Unhandled TikTok player message:", n);
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
104
|
+
}), o(E, this, M).call(this, "config");
|
|
105
105
|
}
|
|
106
106
|
async load() {
|
|
107
|
-
if (
|
|
107
|
+
if (a(g, this)) return;
|
|
108
108
|
this.shadowRoot || this.attachShadow(e.shadowRootOptions);
|
|
109
|
-
let t = !
|
|
110
|
-
if (
|
|
111
|
-
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message",
|
|
109
|
+
let t = !a(_, this);
|
|
110
|
+
if (a(_, this) && (this.loadComplete = new N()), s(_, this, !0), await s(g, this, Promise.resolve()), s(g, this, null), s(y, this, 0), s(v, this, !1), s(b, this, !0), !this.src) {
|
|
111
|
+
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message", a(T, this));
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
let n = this.shadowRoot.querySelector("iframe"), r = P(this.attributes);
|
|
115
|
-
t && n &&
|
|
115
|
+
t && n && s(x, this, JSON.parse(n.getAttribute("data-config") || "{}")), (!(n != null && n.src) || n.src !== h(r, this)) && (this.shadowRoot.innerHTML = m(r, this), n = this.shadowRoot.querySelector("iframe")), s(w, this, n), globalThis.addEventListener("message", a(T, this));
|
|
116
116
|
}
|
|
117
117
|
async attributeChangedCallback(e, t, n) {
|
|
118
118
|
if (t !== n) switch (e) {
|
|
@@ -128,34 +128,34 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
get config() {
|
|
131
|
-
return
|
|
131
|
+
return a(x, this);
|
|
132
132
|
}
|
|
133
133
|
set config(e) {
|
|
134
|
-
|
|
134
|
+
s(x, this, e);
|
|
135
135
|
}
|
|
136
136
|
async play() {
|
|
137
|
-
await this.loadComplete,
|
|
137
|
+
await this.loadComplete, o(E, this, O).call(this, "play");
|
|
138
138
|
}
|
|
139
139
|
async pause() {
|
|
140
|
-
await this.loadComplete,
|
|
140
|
+
await this.loadComplete, o(E, this, O).call(this, "pause");
|
|
141
141
|
}
|
|
142
142
|
get volume() {
|
|
143
|
-
return
|
|
143
|
+
return a(S, this) / 100;
|
|
144
144
|
}
|
|
145
145
|
set volume(e) {
|
|
146
146
|
console.warn("Volume control is not supported for TikTok videos.");
|
|
147
147
|
}
|
|
148
148
|
get currentTime() {
|
|
149
|
-
return
|
|
149
|
+
return a(y, this);
|
|
150
150
|
}
|
|
151
151
|
set currentTime(e) {
|
|
152
|
-
|
|
152
|
+
o(E, this, k).call(this, e);
|
|
153
153
|
}
|
|
154
154
|
get muted() {
|
|
155
|
-
return
|
|
155
|
+
return a(v, this);
|
|
156
156
|
}
|
|
157
157
|
set muted(e) {
|
|
158
|
-
|
|
158
|
+
s(v, this, e), e ? o(E, this, A).call(this) : o(E, this, j).call(this);
|
|
159
159
|
}
|
|
160
160
|
get defaultMuted() {
|
|
161
161
|
return this.hasAttribute("muted");
|
|
@@ -164,10 +164,10 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
164
164
|
this.toggleAttribute("muted", !!e);
|
|
165
165
|
}
|
|
166
166
|
get paused() {
|
|
167
|
-
return
|
|
167
|
+
return a(b, this);
|
|
168
168
|
}
|
|
169
169
|
get duration() {
|
|
170
|
-
return
|
|
170
|
+
return a(C, this);
|
|
171
171
|
}
|
|
172
172
|
get src() {
|
|
173
173
|
return this.getAttribute("src");
|
|
@@ -178,22 +178,22 @@ var g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /*
|
|
|
178
178
|
};
|
|
179
179
|
function O(e, t) {
|
|
180
180
|
var n;
|
|
181
|
-
if (!((n =
|
|
181
|
+
if (!((n = a(w, this)) != null && n.contentWindow)) return;
|
|
182
182
|
let r = {
|
|
183
183
|
"x-tiktok-player": !0,
|
|
184
184
|
type: e,
|
|
185
185
|
...t === void 0 ? {} : { value: t }
|
|
186
186
|
};
|
|
187
|
-
|
|
187
|
+
a(w, this).contentWindow.postMessage(r, "*");
|
|
188
188
|
}
|
|
189
189
|
async function k(e) {
|
|
190
|
-
await this.loadComplete,
|
|
190
|
+
await this.loadComplete, o(E, this, O).call(this, "seekTo", Number(e));
|
|
191
191
|
}
|
|
192
192
|
async function A() {
|
|
193
|
-
await this.loadComplete,
|
|
193
|
+
await this.loadComplete, o(E, this, O).call(this, "mute");
|
|
194
194
|
}
|
|
195
195
|
async function j() {
|
|
196
|
-
await this.loadComplete,
|
|
196
|
+
await this.loadComplete, o(E, this, O).call(this, "unMute");
|
|
197
197
|
}
|
|
198
198
|
function M(e) {
|
|
199
199
|
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
@@ -201,7 +201,7 @@ function M(e) {
|
|
|
201
201
|
delete this[e], this[e] = t;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
n(D, "getTemplateHTML", m), n(D, "shadowRootOptions", { mode: "open" });
|
|
205
205
|
var N = class extends Promise {
|
|
206
206
|
constructor(e = () => {}) {
|
|
207
207
|
let t, n;
|
|
@@ -332,4 +332,4 @@ var K = W({
|
|
|
332
332
|
//#endregion
|
|
333
333
|
export { K as default };
|
|
334
334
|
|
|
335
|
-
//# sourceMappingURL=react-
|
|
335
|
+
//# sourceMappingURL=react-qa12DkXH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./react-
|
|
3
|
-
import {
|
|
4
|
-
import { t as s } from "./
|
|
1
|
+
import { w as e } from "./messages-DCvBcspv.js";
|
|
2
|
+
import { t } from "./react-DOgLiyZi.js";
|
|
3
|
+
import { t as n } from "./defineProperty-DiFpLzd2.js";
|
|
4
|
+
import { a as r, i, n as a, r as o, t as s } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
5
5
|
//#region ../../node_modules/.pnpm/twitch-video-element@0.1.6/node_modules/twitch-video-element/dist/twitch-video-element.js
|
|
6
6
|
var c = /* @__PURE__ */ e(t(), 1), l, u = "https://player.twitch.tv", d = /(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/, f = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/, p = {
|
|
7
7
|
IDLE: "Idle",
|
|
@@ -70,39 +70,39 @@ function g(e, t) {
|
|
|
70
70
|
}
|
|
71
71
|
var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakSet(), A = class extends ((l = globalThis.HTMLElement) == null ? class {} : l) {
|
|
72
72
|
constructor() {
|
|
73
|
-
super(),
|
|
74
|
-
var t, n, r,
|
|
75
|
-
if (!
|
|
76
|
-
let { data:
|
|
77
|
-
if (c ===
|
|
78
|
-
if (
|
|
79
|
-
else if (
|
|
80
|
-
let e =
|
|
81
|
-
|
|
82
|
-
...
|
|
83
|
-
...
|
|
84
|
-
}), e !==
|
|
73
|
+
super(), r(this, k), n(this, "loadComplete", new R()), i(this, _, void 0), i(this, v, void 0), i(this, y, void 0), i(this, b, {}), i(this, x, 0), i(this, S, !1), i(this, C, 1), i(this, w, !this.autoplay), i(this, T, !1), i(this, E, 0), i(this, D, null), i(this, O, async (e) => {
|
|
74
|
+
var t, n, r, i;
|
|
75
|
+
if (!a(y, this).contentWindow) return;
|
|
76
|
+
let { data: o, source: c } = e;
|
|
77
|
+
if (c === a(y, this).contentWindow) {
|
|
78
|
+
if (o.namespace === "twitch-embed") await new Promise((e) => setTimeout(e, 10)), o.eventName === "ready" ? (this.dispatchEvent(new Event("loadcomplete")), this.loadComplete.resolve(), s(E, this, 1), this.dispatchEvent(new Event("loadedmetadata"))) : o.eventName === "seek" ? (s(T, this, !0), this.dispatchEvent(new Event("seeking"))) : o.eventName === "playing" ? (a(T, this) && (s(T, this, !1), this.dispatchEvent(new Event("seeked"))), s(E, this, 3), this.dispatchEvent(new Event("playing"))) : this.dispatchEvent(new Event(o.eventName));
|
|
79
|
+
else if (o.namespace === "twitch-embed-player-proxy" && o.eventName === "UPDATE_STATE") {
|
|
80
|
+
let e = a(b, this).duration, c = a(b, this).currentTime, l = a(b, this).volume, u = a(b, this).muted, d = (n = (t = a(b, this).stats) == null ? void 0 : t.videoStats) == null ? void 0 : n.bufferSize;
|
|
81
|
+
s(b, this, {
|
|
82
|
+
...a(b, this),
|
|
83
|
+
...o.params
|
|
84
|
+
}), e !== a(b, this).duration && this.dispatchEvent(new Event("durationchange")), c !== a(b, this).currentTime && this.dispatchEvent(new Event("timeupdate")), (l !== a(b, this).volume || u !== a(b, this).muted) && (a(b, this).volume !== void 0 && s(C, this, a(b, this).volume), a(b, this).muted !== void 0 && s(S, this, a(b, this).muted), this.dispatchEvent(new Event("volumechange"))), d !== ((i = (r = a(b, this).stats) == null ? void 0 : r.videoStats) == null ? void 0 : i.bufferSize) && this.dispatchEvent(new Event("progress"));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
}),
|
|
87
|
+
}), o(k, this, M).call(this, "config");
|
|
88
88
|
}
|
|
89
89
|
get config() {
|
|
90
|
-
return
|
|
90
|
+
return a(D, this);
|
|
91
91
|
}
|
|
92
92
|
set config(e) {
|
|
93
|
-
|
|
93
|
+
s(D, this, e);
|
|
94
94
|
}
|
|
95
95
|
async load() {
|
|
96
|
-
if (
|
|
96
|
+
if (a(_, this)) return;
|
|
97
97
|
this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
98
|
-
let e = !
|
|
99
|
-
if (
|
|
100
|
-
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message",
|
|
98
|
+
let e = !a(v, this);
|
|
99
|
+
if (a(v, this) && (this.loadComplete = new R()), s(v, this, !0), await s(_, this, Promise.resolve()), s(_, this, null), s(E, this, 0), this.dispatchEvent(new Event("emptied")), !this.src) {
|
|
100
|
+
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message", a(O, this));
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
this.dispatchEvent(new Event("loadstart"));
|
|
104
104
|
let t = this.shadowRoot.querySelector("iframe"), n = N(this.attributes);
|
|
105
|
-
e && t &&
|
|
105
|
+
e && t && s(D, this, JSON.parse(t.getAttribute("data-config") || "{}")), (!(t != null && t.src) || t.src !== g(n, this)) && (this.shadowRoot.innerHTML = h(n, this), t = this.shadowRoot.querySelector("iframe")), s(y, this, t), globalThis.addEventListener("message", a(O, this));
|
|
106
106
|
}
|
|
107
107
|
attributeChangedCallback(e, t, n) {
|
|
108
108
|
if (t !== n) switch (e) {
|
|
@@ -113,7 +113,7 @@ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /*
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
getVideoPlaybackQuality() {
|
|
116
|
-
return
|
|
116
|
+
return a(b, this).stats.videoStats;
|
|
117
117
|
}
|
|
118
118
|
get src() {
|
|
119
119
|
return this.getAttribute("src");
|
|
@@ -122,24 +122,24 @@ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /*
|
|
|
122
122
|
this.setAttribute("src", e);
|
|
123
123
|
}
|
|
124
124
|
get readyState() {
|
|
125
|
-
return
|
|
125
|
+
return a(E, this);
|
|
126
126
|
}
|
|
127
127
|
get seeking() {
|
|
128
|
-
return
|
|
128
|
+
return a(T, this);
|
|
129
129
|
}
|
|
130
130
|
get buffered() {
|
|
131
131
|
var e, t, n;
|
|
132
|
-
return z(0, (e = (n = (t =
|
|
132
|
+
return z(0, (e = (n = (t = a(b, this).stats) == null ? void 0 : t.videoStats) == null ? void 0 : n.bufferSize) == null ? 0 : e);
|
|
133
133
|
}
|
|
134
134
|
get paused() {
|
|
135
|
-
return
|
|
135
|
+
return a(b, this).playback ? a(b, this).playback === p.IDLE : a(w, this);
|
|
136
136
|
}
|
|
137
137
|
get ended() {
|
|
138
|
-
return
|
|
138
|
+
return a(b, this).playback ? a(b, this).playback === p.ENDED : !1;
|
|
139
139
|
}
|
|
140
140
|
get duration() {
|
|
141
141
|
var e;
|
|
142
|
-
return (e =
|
|
142
|
+
return (e = a(b, this).duration) == null ? NaN : e;
|
|
143
143
|
}
|
|
144
144
|
get autoplay() {
|
|
145
145
|
return this.hasAttribute("autoplay");
|
|
@@ -154,11 +154,11 @@ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /*
|
|
|
154
154
|
this.controls != e && this.toggleAttribute("controls", !!e);
|
|
155
155
|
}
|
|
156
156
|
get currentTime() {
|
|
157
|
-
return
|
|
157
|
+
return a(b, this).currentTime ? a(b, this).currentTime : a(x, this);
|
|
158
158
|
}
|
|
159
159
|
set currentTime(e) {
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
s(x, this, e), this.loadComplete.then(() => {
|
|
161
|
+
o(k, this, j).call(this, m.SEEK, e);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
get defaultMuted() {
|
|
@@ -174,19 +174,19 @@ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /*
|
|
|
174
174
|
this.toggleAttribute("loop", !!e);
|
|
175
175
|
}
|
|
176
176
|
get muted() {
|
|
177
|
-
return
|
|
177
|
+
return a(S, this);
|
|
178
178
|
}
|
|
179
179
|
set muted(e) {
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
s(S, this, e), this.loadComplete.then(() => {
|
|
181
|
+
o(k, this, j).call(this, m.SET_MUTED, e);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
get volume() {
|
|
185
|
-
return
|
|
185
|
+
return a(C, this);
|
|
186
186
|
}
|
|
187
187
|
set volume(e) {
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
s(C, this, e), this.loadComplete.then(() => {
|
|
189
|
+
o(k, this, j).call(this, m.SET_VOLUME, e);
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
get playsInline() {
|
|
@@ -196,20 +196,20 @@ var _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /*
|
|
|
196
196
|
this.toggleAttribute("playsinline", !!e);
|
|
197
197
|
}
|
|
198
198
|
play() {
|
|
199
|
-
|
|
199
|
+
s(w, this, !1), o(k, this, j).call(this, m.PLAY);
|
|
200
200
|
}
|
|
201
201
|
pause() {
|
|
202
|
-
|
|
202
|
+
s(w, this, !0), o(k, this, j).call(this, m.PAUSE);
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
function j(e, t) {
|
|
206
|
-
if (!
|
|
206
|
+
if (!a(y, this).contentWindow) return;
|
|
207
207
|
let n = {
|
|
208
208
|
eventName: e,
|
|
209
209
|
params: t,
|
|
210
210
|
namespace: "twitch-embed-player-proxy"
|
|
211
211
|
};
|
|
212
|
-
|
|
212
|
+
a(y, this).contentWindow.postMessage(n, u);
|
|
213
213
|
}
|
|
214
214
|
function M(e) {
|
|
215
215
|
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
@@ -217,7 +217,7 @@ function M(e) {
|
|
|
217
217
|
delete this[e], this[e] = t;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
n(A, "getTemplateHTML", h), n(A, "shadowRootOptions", { mode: "open" }), n(A, "observedAttributes", [
|
|
221
221
|
"autoplay",
|
|
222
222
|
"controls",
|
|
223
223
|
"loop",
|
|
@@ -365,4 +365,4 @@ var J = K({
|
|
|
365
365
|
//#endregion
|
|
366
366
|
export { J as default };
|
|
367
367
|
|
|
368
|
-
//# sourceMappingURL=react-
|
|
368
|
+
//# sourceMappingURL=react-y4vaW3OH.js.map
|