@sapia-ai/chatbot-v3 1.0.0 → 1.0.1
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-SaMMfDIW.js → EmbeddedVideoPlayer-CNcds-dW.js} +283 -282
- package/dist/Preview-Dmns6UWL.js +84 -0
- package/dist/api.js +1 -1
- package/dist/{dist-DGBYKC8c.js → dist-B9SbMqZU.js} +2693 -2693
- package/dist/embed/createChatbot.d.ts +2 -0
- package/dist/{fix-webm-duration-BW9Fbdzt.js → fix-webm-duration-BWL-ZRDX.js} +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +15479 -2067
- package/dist/jsx-runtime-8QqjHL5t.js +24 -0
- package/dist/messages-Czlp86gl.js +1963 -0
- package/dist/react-B0K-sClg.js +295 -0
- package/dist/{react-Bujo1aK5.js → react-ChCcxVnw.js} +90 -89
- package/dist/{react-GXf8sbzf.js → react-DJysvNxz.js} +72 -71
- package/dist/{react-BVzcquey.js → react-Dbs-sPBo.js} +93 -92
- package/dist/{react-lp7yfM94.js → react-NauLB_WU.js} +91 -90
- package/dist/{react-BGJ7Szvq.js → react-QrtEtv1G.js} +76 -74
- package/dist/{react-BrCGR7Ca.js → react-be7q6yw_.js} +312 -310
- package/dist/{react-CRTg4gz8.js → react-czRIxT0g.js} +85 -84
- package/dist/{react-BMxM8TWJ.js → react-dE7BdGuR.js} +49 -48
- package/package.json +14 -25
- package/dist/EmbeddedVideoPlayer-SaMMfDIW.js.map +0 -1
- package/dist/Preview-Db-hgkTh.js +0 -83
- package/dist/Preview-Db-hgkTh.js.map +0 -1
- package/dist/dash.all.min-DZ1yEcJk.js.map +0 -1
- package/dist/dist-BSi28_cP.js.map +0 -1
- package/dist/dist-DGBYKC8c.js.map +0 -1
- package/dist/dist-FvHBWiRa.js.map +0 -1
- package/dist/fix-webm-duration-BW9Fbdzt.js.map +0 -1
- package/dist/hls-mBncGwsE.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/max-Btet1snX.js.map +0 -1
- package/dist/messages-C4jqrtSG.js +0 -187
- package/dist/messages-C4jqrtSG.js.map +0 -1
- package/dist/react-BGJ7Szvq.js.map +0 -1
- package/dist/react-BMxM8TWJ.js.map +0 -1
- package/dist/react-BVzcquey.js.map +0 -1
- package/dist/react-BrCGR7Ca.js.map +0 -1
- package/dist/react-Bujo1aK5.js.map +0 -1
- package/dist/react-CRTg4gz8.js.map +0 -1
- package/dist/react-GXf8sbzf.js.map +0 -1
- package/dist/react-lp7yfM94.js.map +0 -1
- package/dist/sapia-chatbot.css +0 -3
- package/dist-umd/sapia-chatbot.umd.js.map +0 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { v as e } from "./messages-Czlp86gl.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/react@19.2.7/node_modules/react/cjs/react.production.js
|
|
3
|
+
var t = /* @__PURE__ */ e(((e) => {
|
|
4
|
+
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), f = Symbol.for("react.activity"), p = Symbol.iterator;
|
|
5
|
+
function m(e) {
|
|
6
|
+
return typeof e != "object" || !e ? null : (e = p && e[p] || e["@@iterator"], typeof e == "function" ? e : null);
|
|
7
|
+
}
|
|
8
|
+
var h = {
|
|
9
|
+
isMounted: function() {
|
|
10
|
+
return !1;
|
|
11
|
+
},
|
|
12
|
+
enqueueForceUpdate: function() {},
|
|
13
|
+
enqueueReplaceState: function() {},
|
|
14
|
+
enqueueSetState: function() {}
|
|
15
|
+
}, g = Object.assign, _ = {};
|
|
16
|
+
function v(e, t, n) {
|
|
17
|
+
this.props = e, this.context = t, this.refs = _, this.updater = n || h;
|
|
18
|
+
}
|
|
19
|
+
v.prototype.isReactComponent = {}, v.prototype.setState = function(e, t) {
|
|
20
|
+
if (typeof e != "object" && typeof e != "function" && e != null) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
21
|
+
this.updater.enqueueSetState(this, e, t, "setState");
|
|
22
|
+
}, v.prototype.forceUpdate = function(e) {
|
|
23
|
+
this.updater.enqueueForceUpdate(this, e, "forceUpdate");
|
|
24
|
+
};
|
|
25
|
+
function y() {}
|
|
26
|
+
y.prototype = v.prototype;
|
|
27
|
+
function b(e, t, n) {
|
|
28
|
+
this.props = e, this.context = t, this.refs = _, this.updater = n || h;
|
|
29
|
+
}
|
|
30
|
+
var x = b.prototype = new y();
|
|
31
|
+
x.constructor = b, g(x, v.prototype), x.isPureReactComponent = !0;
|
|
32
|
+
var S = Array.isArray;
|
|
33
|
+
function C() {}
|
|
34
|
+
var w = {
|
|
35
|
+
H: null,
|
|
36
|
+
A: null,
|
|
37
|
+
T: null,
|
|
38
|
+
S: null
|
|
39
|
+
}, T = Object.prototype.hasOwnProperty;
|
|
40
|
+
function E(e, n, r) {
|
|
41
|
+
var i = r.ref;
|
|
42
|
+
return {
|
|
43
|
+
$$typeof: t,
|
|
44
|
+
type: e,
|
|
45
|
+
key: n,
|
|
46
|
+
ref: i === void 0 ? null : i,
|
|
47
|
+
props: r
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function D(e, t) {
|
|
51
|
+
return E(e.type, t, e.props);
|
|
52
|
+
}
|
|
53
|
+
function O(e) {
|
|
54
|
+
return typeof e == "object" && !!e && e.$$typeof === t;
|
|
55
|
+
}
|
|
56
|
+
function k(e) {
|
|
57
|
+
var t = {
|
|
58
|
+
"=": "=0",
|
|
59
|
+
":": "=2"
|
|
60
|
+
};
|
|
61
|
+
return "$" + e.replace(/[=:]/g, function(e) {
|
|
62
|
+
return t[e];
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
var A = /\/+/g;
|
|
66
|
+
function j(e, t) {
|
|
67
|
+
return typeof e == "object" && e && e.key != null ? k("" + e.key) : t.toString(36);
|
|
68
|
+
}
|
|
69
|
+
function M(e) {
|
|
70
|
+
switch (e.status) {
|
|
71
|
+
case "fulfilled": return e.value;
|
|
72
|
+
case "rejected": throw e.reason;
|
|
73
|
+
default: switch (typeof e.status == "string" ? e.then(C, C) : (e.status = "pending", e.then(function(t) {
|
|
74
|
+
e.status === "pending" && (e.status = "fulfilled", e.value = t);
|
|
75
|
+
}, function(t) {
|
|
76
|
+
e.status === "pending" && (e.status = "rejected", e.reason = t);
|
|
77
|
+
})), e.status) {
|
|
78
|
+
case "fulfilled": return e.value;
|
|
79
|
+
case "rejected": throw e.reason;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw e;
|
|
83
|
+
}
|
|
84
|
+
function N(e, r, i, a, o) {
|
|
85
|
+
var s = typeof e;
|
|
86
|
+
(s === "undefined" || s === "boolean") && (e = null);
|
|
87
|
+
var c = !1;
|
|
88
|
+
if (e === null) c = !0;
|
|
89
|
+
else switch (s) {
|
|
90
|
+
case "bigint":
|
|
91
|
+
case "string":
|
|
92
|
+
case "number":
|
|
93
|
+
c = !0;
|
|
94
|
+
break;
|
|
95
|
+
case "object": switch (e.$$typeof) {
|
|
96
|
+
case t:
|
|
97
|
+
case n:
|
|
98
|
+
c = !0;
|
|
99
|
+
break;
|
|
100
|
+
case d: return c = e._init, N(c(e._payload), r, i, a, o);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (c) return o = o(e), c = a === "" ? "." + j(e, 0) : a, S(o) ? (i = "", c != null && (i = c.replace(A, "$&/") + "/"), N(o, r, i, "", function(e) {
|
|
104
|
+
return e;
|
|
105
|
+
})) : o != null && (O(o) && (o = D(o, i + (o.key == null || e && e.key === o.key ? "" : ("" + o.key).replace(A, "$&/") + "/") + c)), r.push(o)), 1;
|
|
106
|
+
c = 0;
|
|
107
|
+
var l = a === "" ? "." : a + ":";
|
|
108
|
+
if (S(e)) for (var u = 0; u < e.length; u++) a = e[u], s = l + j(a, u), c += N(a, r, i, s, o);
|
|
109
|
+
else if (u = m(e), typeof u == "function") for (e = u.call(e), u = 0; !(a = e.next()).done;) a = a.value, s = l + j(a, u++), c += N(a, r, i, s, o);
|
|
110
|
+
else if (s === "object") {
|
|
111
|
+
if (typeof e.then == "function") return N(M(e), r, i, a, o);
|
|
112
|
+
throw r = String(e), Error("Objects are not valid as a React child (found: " + (r === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : r) + "). If you meant to render a collection of children, use an array instead.");
|
|
113
|
+
}
|
|
114
|
+
return c;
|
|
115
|
+
}
|
|
116
|
+
function P(e, t, n) {
|
|
117
|
+
if (e == null) return e;
|
|
118
|
+
var r = [], i = 0;
|
|
119
|
+
return N(e, r, "", "", function(e) {
|
|
120
|
+
return t.call(n, e, i++);
|
|
121
|
+
}), r;
|
|
122
|
+
}
|
|
123
|
+
function F(e) {
|
|
124
|
+
if (e._status === -1) {
|
|
125
|
+
var t = e._result;
|
|
126
|
+
t = t(), t.then(function(t) {
|
|
127
|
+
(e._status === 0 || e._status === -1) && (e._status = 1, e._result = t);
|
|
128
|
+
}, function(t) {
|
|
129
|
+
(e._status === 0 || e._status === -1) && (e._status = 2, e._result = t);
|
|
130
|
+
}), e._status === -1 && (e._status = 0, e._result = t);
|
|
131
|
+
}
|
|
132
|
+
if (e._status === 1) return e._result.default;
|
|
133
|
+
throw e._result;
|
|
134
|
+
}
|
|
135
|
+
var I = typeof reportError == "function" ? reportError : function(e) {
|
|
136
|
+
if (typeof window == "object" && typeof window.ErrorEvent == "function") {
|
|
137
|
+
var t = new window.ErrorEvent("error", {
|
|
138
|
+
bubbles: !0,
|
|
139
|
+
cancelable: !0,
|
|
140
|
+
message: typeof e == "object" && e && typeof e.message == "string" ? String(e.message) : String(e),
|
|
141
|
+
error: e
|
|
142
|
+
});
|
|
143
|
+
if (!window.dispatchEvent(t)) return;
|
|
144
|
+
} else if (typeof process == "object" && typeof process.emit == "function") {
|
|
145
|
+
process.emit("uncaughtException", e);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
console.error(e);
|
|
149
|
+
}, L = {
|
|
150
|
+
map: P,
|
|
151
|
+
forEach: function(e, t, n) {
|
|
152
|
+
P(e, function() {
|
|
153
|
+
t.apply(this, arguments);
|
|
154
|
+
}, n);
|
|
155
|
+
},
|
|
156
|
+
count: function(e) {
|
|
157
|
+
var t = 0;
|
|
158
|
+
return P(e, function() {
|
|
159
|
+
t++;
|
|
160
|
+
}), t;
|
|
161
|
+
},
|
|
162
|
+
toArray: function(e) {
|
|
163
|
+
return P(e, function(e) {
|
|
164
|
+
return e;
|
|
165
|
+
}) || [];
|
|
166
|
+
},
|
|
167
|
+
only: function(e) {
|
|
168
|
+
if (!O(e)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
169
|
+
return e;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
e.Activity = f, e.Children = L, e.Component = v, e.Fragment = r, e.Profiler = a, e.PureComponent = b, e.StrictMode = i, e.Suspense = l, e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = w, e.__COMPILER_RUNTIME = {
|
|
173
|
+
__proto__: null,
|
|
174
|
+
c: function(e) {
|
|
175
|
+
return w.H.useMemoCache(e);
|
|
176
|
+
}
|
|
177
|
+
}, e.cache = function(e) {
|
|
178
|
+
return function() {
|
|
179
|
+
return e.apply(null, arguments);
|
|
180
|
+
};
|
|
181
|
+
}, e.cacheSignal = function() {
|
|
182
|
+
return null;
|
|
183
|
+
}, e.cloneElement = function(e, t, n) {
|
|
184
|
+
if (e == null) throw Error("The argument must be a React element, but you passed " + e + ".");
|
|
185
|
+
var r = g({}, e.props), i = e.key;
|
|
186
|
+
if (t != null) for (a in t.key !== void 0 && (i = "" + t.key), t) !T.call(t, a) || a === "key" || a === "__self" || a === "__source" || a === "ref" && t.ref === void 0 || (r[a] = t[a]);
|
|
187
|
+
var a = arguments.length - 2;
|
|
188
|
+
if (a === 1) r.children = n;
|
|
189
|
+
else if (1 < a) {
|
|
190
|
+
for (var o = Array(a), s = 0; s < a; s++) o[s] = arguments[s + 2];
|
|
191
|
+
r.children = o;
|
|
192
|
+
}
|
|
193
|
+
return E(e.type, i, r);
|
|
194
|
+
}, e.createContext = function(e) {
|
|
195
|
+
return e = {
|
|
196
|
+
$$typeof: s,
|
|
197
|
+
_currentValue: e,
|
|
198
|
+
_currentValue2: e,
|
|
199
|
+
_threadCount: 0,
|
|
200
|
+
Provider: null,
|
|
201
|
+
Consumer: null
|
|
202
|
+
}, e.Provider = e, e.Consumer = {
|
|
203
|
+
$$typeof: o,
|
|
204
|
+
_context: e
|
|
205
|
+
}, e;
|
|
206
|
+
}, e.createElement = function(e, t, n) {
|
|
207
|
+
var r, i = {}, a = null;
|
|
208
|
+
if (t != null) for (r in t.key !== void 0 && (a = "" + t.key), t) T.call(t, r) && r !== "key" && r !== "__self" && r !== "__source" && (i[r] = t[r]);
|
|
209
|
+
var o = arguments.length - 2;
|
|
210
|
+
if (o === 1) i.children = n;
|
|
211
|
+
else if (1 < o) {
|
|
212
|
+
for (var s = Array(o), c = 0; c < o; c++) s[c] = arguments[c + 2];
|
|
213
|
+
i.children = s;
|
|
214
|
+
}
|
|
215
|
+
if (e && e.defaultProps) for (r in o = e.defaultProps, o) i[r] === void 0 && (i[r] = o[r]);
|
|
216
|
+
return E(e, a, i);
|
|
217
|
+
}, e.createRef = function() {
|
|
218
|
+
return { current: null };
|
|
219
|
+
}, e.forwardRef = function(e) {
|
|
220
|
+
return {
|
|
221
|
+
$$typeof: c,
|
|
222
|
+
render: e
|
|
223
|
+
};
|
|
224
|
+
}, e.isValidElement = O, e.lazy = function(e) {
|
|
225
|
+
return {
|
|
226
|
+
$$typeof: d,
|
|
227
|
+
_payload: {
|
|
228
|
+
_status: -1,
|
|
229
|
+
_result: e
|
|
230
|
+
},
|
|
231
|
+
_init: F
|
|
232
|
+
};
|
|
233
|
+
}, e.memo = function(e, t) {
|
|
234
|
+
return {
|
|
235
|
+
$$typeof: u,
|
|
236
|
+
type: e,
|
|
237
|
+
compare: t === void 0 ? null : t
|
|
238
|
+
};
|
|
239
|
+
}, e.startTransition = function(e) {
|
|
240
|
+
var t = w.T, n = {};
|
|
241
|
+
w.T = n;
|
|
242
|
+
try {
|
|
243
|
+
var r = e(), i = w.S;
|
|
244
|
+
i !== null && i(n, r), typeof r == "object" && r && typeof r.then == "function" && r.then(C, I);
|
|
245
|
+
} catch (e) {
|
|
246
|
+
I(e);
|
|
247
|
+
} finally {
|
|
248
|
+
t !== null && n.types !== null && (t.types = n.types), w.T = t;
|
|
249
|
+
}
|
|
250
|
+
}, e.unstable_useCacheRefresh = function() {
|
|
251
|
+
return w.H.useCacheRefresh();
|
|
252
|
+
}, e.use = function(e) {
|
|
253
|
+
return w.H.use(e);
|
|
254
|
+
}, e.useActionState = function(e, t, n) {
|
|
255
|
+
return w.H.useActionState(e, t, n);
|
|
256
|
+
}, e.useCallback = function(e, t) {
|
|
257
|
+
return w.H.useCallback(e, t);
|
|
258
|
+
}, e.useContext = function(e) {
|
|
259
|
+
return w.H.useContext(e);
|
|
260
|
+
}, e.useDebugValue = function() {}, e.useDeferredValue = function(e, t) {
|
|
261
|
+
return w.H.useDeferredValue(e, t);
|
|
262
|
+
}, e.useEffect = function(e, t) {
|
|
263
|
+
return w.H.useEffect(e, t);
|
|
264
|
+
}, e.useEffectEvent = function(e) {
|
|
265
|
+
return w.H.useEffectEvent(e);
|
|
266
|
+
}, e.useId = function() {
|
|
267
|
+
return w.H.useId();
|
|
268
|
+
}, e.useImperativeHandle = function(e, t, n) {
|
|
269
|
+
return w.H.useImperativeHandle(e, t, n);
|
|
270
|
+
}, e.useInsertionEffect = function(e, t) {
|
|
271
|
+
return w.H.useInsertionEffect(e, t);
|
|
272
|
+
}, e.useLayoutEffect = function(e, t) {
|
|
273
|
+
return w.H.useLayoutEffect(e, t);
|
|
274
|
+
}, e.useMemo = function(e, t) {
|
|
275
|
+
return w.H.useMemo(e, t);
|
|
276
|
+
}, e.useOptimistic = function(e, t) {
|
|
277
|
+
return w.H.useOptimistic(e, t);
|
|
278
|
+
}, e.useReducer = function(e, t, n) {
|
|
279
|
+
return w.H.useReducer(e, t, n);
|
|
280
|
+
}, e.useRef = function(e) {
|
|
281
|
+
return w.H.useRef(e);
|
|
282
|
+
}, e.useState = function(e) {
|
|
283
|
+
return w.H.useState(e);
|
|
284
|
+
}, e.useSyncExternalStore = function(e, t, n) {
|
|
285
|
+
return w.H.useSyncExternalStore(e, t, n);
|
|
286
|
+
}, e.useTransition = function() {
|
|
287
|
+
return w.H.useTransition();
|
|
288
|
+
}, e.version = "19.2.7";
|
|
289
|
+
})), n = /* @__PURE__ */ e(((e, n) => {
|
|
290
|
+
n.exports = t();
|
|
291
|
+
}));
|
|
292
|
+
//#endregion
|
|
293
|
+
export { n as t };
|
|
294
|
+
|
|
295
|
+
//# sourceMappingURL=react-B0K-sClg.js.map
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import o from "
|
|
1
|
+
import { b as e } from "./messages-Czlp86gl.js";
|
|
2
|
+
import { t } from "./react-B0K-sClg.js";
|
|
3
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./classPrivateFieldSet2-DtQPURVD.js";
|
|
4
|
+
import { t as s } from "./defineProperty-DiFpLzd2.js";
|
|
4
5
|
//#region ../../node_modules/.pnpm/tiktok-video-element@0.1.2/node_modules/tiktok-video-element/dist/tiktok-video-element.js
|
|
5
|
-
var
|
|
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 = {
|
|
6
7
|
INIT: -1,
|
|
7
8
|
ENDED: 0,
|
|
8
9
|
PLAYING: 1,
|
|
9
10
|
PAUSED: 2,
|
|
10
11
|
BUFFERING: 3
|
|
11
|
-
},
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
12
|
+
}, p = {
|
|
13
|
+
[f.INIT]: "emptied",
|
|
14
|
+
[f.PAUSED]: "pause",
|
|
15
|
+
[f.ENDED]: "ended",
|
|
16
|
+
[f.PLAYING]: "play",
|
|
17
|
+
[f.BUFFERING]: "waiting"
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
+
function m(e, t = {}) {
|
|
19
20
|
let n = {
|
|
20
|
-
src:
|
|
21
|
+
src: h(e, t),
|
|
21
22
|
frameborder: 0,
|
|
22
23
|
width: "100%",
|
|
23
24
|
height: "100%",
|
|
@@ -40,13 +41,13 @@ function f(e, t = {}) {
|
|
|
40
41
|
border:0;
|
|
41
42
|
}
|
|
42
43
|
</style>
|
|
43
|
-
<iframe ${
|
|
44
|
+
<iframe ${L(n)} title="TikTok video"></iframe>
|
|
44
45
|
`;
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function h(e, t = {}) {
|
|
47
48
|
if (!e.src) return;
|
|
48
|
-
let n = e.src.match(
|
|
49
|
-
return `${
|
|
49
|
+
let n = e.src.match(d);
|
|
50
|
+
return `${u}/${n && n[1]}?${I({
|
|
50
51
|
controls: e.controls === "" ? null : 0,
|
|
51
52
|
autoplay: e.autoplay,
|
|
52
53
|
muted: e.muted,
|
|
@@ -55,7 +56,7 @@ function p(e, t = {}) {
|
|
|
55
56
|
...t.config
|
|
56
57
|
})}`;
|
|
57
58
|
}
|
|
58
|
-
var
|
|
59
|
+
var g = /* @__PURE__ */ new WeakMap(), _ = /* @__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 WeakSet(), D = class e extends ((l = globalThis.HTMLElement) == null ? class {} : l) {
|
|
59
60
|
static get observedAttributes() {
|
|
60
61
|
return [
|
|
61
62
|
"src",
|
|
@@ -66,52 +67,52 @@ var m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /*
|
|
|
66
67
|
];
|
|
67
68
|
}
|
|
68
69
|
constructor() {
|
|
69
|
-
super(),
|
|
70
|
+
super(), n(this, E), s(this, "loadComplete", new N()), r(this, g, void 0), r(this, _, void 0), r(this, v, !1), r(this, y, 0), r(this, b, !0), r(this, x, null), r(this, S, 100), r(this, C, 0), r(this, w, void 0), r(this, T, (e) => {
|
|
70
71
|
var t;
|
|
71
|
-
if (e.source !== ((t =
|
|
72
|
-
let
|
|
73
|
-
if (
|
|
72
|
+
if (e.source !== ((t = i(w, this)) == null ? void 0 : t.contentWindow)) return;
|
|
73
|
+
let n = e.data;
|
|
74
|
+
if (n != null && n["x-tiktok-player"]) switch (n.type) {
|
|
74
75
|
case "onPlayerReady":
|
|
75
76
|
this.loadComplete.resolve();
|
|
76
77
|
break;
|
|
77
78
|
case "onStateChange": {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
].includes(
|
|
83
|
-
let e =
|
|
79
|
+
o(b, this, [
|
|
80
|
+
f.INIT,
|
|
81
|
+
f.PAUSED,
|
|
82
|
+
f.ENDED
|
|
83
|
+
].includes(n.value));
|
|
84
|
+
let e = p[n.value];
|
|
84
85
|
e && this.dispatchEvent(new Event(e));
|
|
85
86
|
break;
|
|
86
87
|
}
|
|
87
88
|
case "onCurrentTime":
|
|
88
|
-
|
|
89
|
+
o(y, this, n.value.currentTime), o(C, this, n.value.duration), this.dispatchEvent(new Event("durationchange")), this.dispatchEvent(new Event("timeupdate"));
|
|
89
90
|
break;
|
|
90
91
|
case "onVolumeChange":
|
|
91
|
-
|
|
92
|
+
o(S, this, n.value), this.dispatchEvent(new Event("volumechange"));
|
|
92
93
|
break;
|
|
93
94
|
case "onMute":
|
|
94
|
-
|
|
95
|
+
o(v, this, !!n.value), o(S, this, n.value ? 0 : i(S, this)), this.dispatchEvent(new Event("volumechange"));
|
|
95
96
|
break;
|
|
96
97
|
case "onError":
|
|
97
98
|
this.dispatchEvent(new Event("error"));
|
|
98
99
|
break;
|
|
99
100
|
default:
|
|
100
|
-
console.warn("Unhandled TikTok player message:",
|
|
101
|
+
console.warn("Unhandled TikTok player message:", n);
|
|
101
102
|
break;
|
|
102
103
|
}
|
|
103
|
-
}),
|
|
104
|
+
}), a(E, this, M).call(this, "config");
|
|
104
105
|
}
|
|
105
106
|
async load() {
|
|
106
|
-
if (
|
|
107
|
-
this.shadowRoot || this.attachShadow(
|
|
108
|
-
let
|
|
109
|
-
if (
|
|
110
|
-
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message",
|
|
107
|
+
if (i(g, this)) return;
|
|
108
|
+
this.shadowRoot || this.attachShadow(e.shadowRootOptions);
|
|
109
|
+
let t = !i(_, this);
|
|
110
|
+
if (i(_, this) && (this.loadComplete = new N()), o(_, this, !0), await o(g, this, Promise.resolve()), o(g, this, null), o(y, this, 0), o(v, this, !1), o(b, this, !0), !this.src) {
|
|
111
|
+
this.shadowRoot.innerHTML = "", globalThis.removeEventListener("message", i(T, this));
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
let
|
|
114
|
-
|
|
114
|
+
let n = this.shadowRoot.querySelector("iframe"), r = P(this.attributes);
|
|
115
|
+
t && n && o(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")), o(w, this, n), globalThis.addEventListener("message", i(T, this));
|
|
115
116
|
}
|
|
116
117
|
async attributeChangedCallback(e, t, n) {
|
|
117
118
|
if (t !== n) switch (e) {
|
|
@@ -127,34 +128,34 @@ var m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /*
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
get config() {
|
|
130
|
-
return
|
|
131
|
+
return i(x, this);
|
|
131
132
|
}
|
|
132
133
|
set config(e) {
|
|
133
|
-
|
|
134
|
+
o(x, this, e);
|
|
134
135
|
}
|
|
135
136
|
async play() {
|
|
136
|
-
await this.loadComplete,
|
|
137
|
+
await this.loadComplete, a(E, this, O).call(this, "play");
|
|
137
138
|
}
|
|
138
139
|
async pause() {
|
|
139
|
-
await this.loadComplete,
|
|
140
|
+
await this.loadComplete, a(E, this, O).call(this, "pause");
|
|
140
141
|
}
|
|
141
142
|
get volume() {
|
|
142
|
-
return
|
|
143
|
+
return i(S, this) / 100;
|
|
143
144
|
}
|
|
144
145
|
set volume(e) {
|
|
145
146
|
console.warn("Volume control is not supported for TikTok videos.");
|
|
146
147
|
}
|
|
147
148
|
get currentTime() {
|
|
148
|
-
return
|
|
149
|
+
return i(y, this);
|
|
149
150
|
}
|
|
150
151
|
set currentTime(e) {
|
|
151
|
-
|
|
152
|
+
a(E, this, k).call(this, e);
|
|
152
153
|
}
|
|
153
154
|
get muted() {
|
|
154
|
-
return
|
|
155
|
+
return i(v, this);
|
|
155
156
|
}
|
|
156
157
|
set muted(e) {
|
|
157
|
-
|
|
158
|
+
o(v, this, e), e ? a(E, this, A).call(this) : a(E, this, j).call(this);
|
|
158
159
|
}
|
|
159
160
|
get defaultMuted() {
|
|
160
161
|
return this.hasAttribute("muted");
|
|
@@ -163,10 +164,10 @@ var m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /*
|
|
|
163
164
|
this.toggleAttribute("muted", !!e);
|
|
164
165
|
}
|
|
165
166
|
get paused() {
|
|
166
|
-
return
|
|
167
|
+
return i(b, this);
|
|
167
168
|
}
|
|
168
169
|
get duration() {
|
|
169
|
-
return
|
|
170
|
+
return i(C, this);
|
|
170
171
|
}
|
|
171
172
|
get src() {
|
|
172
173
|
return this.getAttribute("src");
|
|
@@ -175,33 +176,33 @@ var m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /*
|
|
|
175
176
|
this.setAttribute("src", e == null ? "" : e);
|
|
176
177
|
}
|
|
177
178
|
};
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
if (!((
|
|
181
|
-
let
|
|
179
|
+
function O(e, t) {
|
|
180
|
+
var n;
|
|
181
|
+
if (!((n = i(w, this)) != null && n.contentWindow)) return;
|
|
182
|
+
let r = {
|
|
182
183
|
"x-tiktok-player": !0,
|
|
183
184
|
type: e,
|
|
184
185
|
...t === void 0 ? {} : { value: t }
|
|
185
186
|
};
|
|
186
|
-
|
|
187
|
+
i(w, this).contentWindow.postMessage(r, "*");
|
|
187
188
|
}
|
|
188
|
-
async function
|
|
189
|
-
await this.loadComplete,
|
|
189
|
+
async function k(e) {
|
|
190
|
+
await this.loadComplete, a(E, this, O).call(this, "seekTo", Number(e));
|
|
190
191
|
}
|
|
191
|
-
async function
|
|
192
|
-
await this.loadComplete,
|
|
192
|
+
async function A() {
|
|
193
|
+
await this.loadComplete, a(E, this, O).call(this, "mute");
|
|
193
194
|
}
|
|
194
|
-
async function
|
|
195
|
-
await this.loadComplete,
|
|
195
|
+
async function j() {
|
|
196
|
+
await this.loadComplete, a(E, this, O).call(this, "unMute");
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
+
function M(e) {
|
|
198
199
|
if (Object.prototype.hasOwnProperty.call(this, e)) {
|
|
199
200
|
let t = this[e];
|
|
200
201
|
delete this[e], this[e] = t;
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
|
-
|
|
204
|
-
var
|
|
204
|
+
s(D, "getTemplateHTML", m), s(D, "shadowRootOptions", { mode: "open" });
|
|
205
|
+
var N = class extends Promise {
|
|
205
206
|
constructor(e = () => {}) {
|
|
206
207
|
let t, n;
|
|
207
208
|
super((r, i) => {
|
|
@@ -209,12 +210,12 @@ var j = class extends Promise {
|
|
|
209
210
|
}), this.resolve = t, this.reject = n;
|
|
210
211
|
}
|
|
211
212
|
};
|
|
212
|
-
function
|
|
213
|
+
function P(e) {
|
|
213
214
|
let t = {};
|
|
214
215
|
for (let n of e) t[n.name] = n.value;
|
|
215
216
|
return t;
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function F(e) {
|
|
218
219
|
let t = {};
|
|
219
220
|
for (let n in e) {
|
|
220
221
|
let r = e[n];
|
|
@@ -222,22 +223,22 @@ function N(e) {
|
|
|
222
223
|
}
|
|
223
224
|
return t;
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
-
return String(new URLSearchParams(
|
|
226
|
+
function I(e) {
|
|
227
|
+
return String(new URLSearchParams(F(e)));
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
+
function L(e) {
|
|
229
230
|
let t = "";
|
|
230
231
|
for (let n in e) {
|
|
231
232
|
let r = e[n];
|
|
232
|
-
r === "" ? t += ` ${
|
|
233
|
+
r === "" ? t += ` ${R(n)}` : t += ` ${R(n)}="${R(`${r}`)}"`;
|
|
233
234
|
}
|
|
234
235
|
return t;
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function R(e) {
|
|
237
238
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`");
|
|
238
239
|
}
|
|
239
|
-
globalThis.customElements && !globalThis.customElements.get("tiktok-video") && globalThis.customElements.define("tiktok-video",
|
|
240
|
-
var
|
|
240
|
+
globalThis.customElements && !globalThis.customElements.get("tiktok-video") && globalThis.customElements.define("tiktok-video", D);
|
|
241
|
+
var z = D, B = /* @__PURE__ */ new Set([
|
|
241
242
|
"style",
|
|
242
243
|
"children",
|
|
243
244
|
"ref",
|
|
@@ -245,28 +246,28 @@ var L = T, R = /* @__PURE__ */ new Set([
|
|
|
245
246
|
"suppressContentEditableWarning",
|
|
246
247
|
"suppressHydrationWarning",
|
|
247
248
|
"dangerouslySetInnerHTML"
|
|
248
|
-
]),
|
|
249
|
+
]), V = {
|
|
249
250
|
className: "class",
|
|
250
251
|
htmlFor: "for"
|
|
251
252
|
};
|
|
252
|
-
function
|
|
253
|
+
function H(e) {
|
|
253
254
|
return e.toLowerCase();
|
|
254
255
|
}
|
|
255
|
-
function
|
|
256
|
+
function U(e) {
|
|
256
257
|
if (typeof e == "boolean") return e ? "" : void 0;
|
|
257
258
|
if (typeof e != "function" && !(typeof e == "object" && e)) return e;
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function W({ react: e, tagName: t, elementClass: n, events: r, displayName: i, defaultProps: a, toAttributeName: o = H, toAttributeValue: s = U }) {
|
|
260
261
|
let c = Number.parseInt(e.version) >= 19, l = e.forwardRef((i, l) => {
|
|
261
262
|
var u, d;
|
|
262
263
|
let f = e.useRef(null), p = e.useRef(/* @__PURE__ */ new Map()), m = {}, h = {}, g = {}, _ = {};
|
|
263
264
|
for (let [e, t] of Object.entries(i)) {
|
|
264
265
|
var v, y;
|
|
265
|
-
if (
|
|
266
|
+
if (B.has(e)) {
|
|
266
267
|
g[e] = t;
|
|
267
268
|
continue;
|
|
268
269
|
}
|
|
269
|
-
let r = o((v =
|
|
270
|
+
let r = o((v = V[e]) == null ? e : v);
|
|
270
271
|
if (n.prototype && e in n.prototype && !(e in ((y = (u = globalThis.HTMLElement) == null ? void 0 : u.prototype) == null ? {} : y)) && !((d = n.observedAttributes) != null && d.some((e) => e === r))) {
|
|
271
272
|
_[e] = t;
|
|
272
273
|
continue;
|
|
@@ -276,7 +277,7 @@ function H({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
276
277
|
continue;
|
|
277
278
|
}
|
|
278
279
|
let i = s(t);
|
|
279
|
-
r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i ===
|
|
280
|
+
r && i != null && (h[r] = String(i), c || (g[r] = i)), r && c && (i === U(t) ? g[r] = t : g[r] = i);
|
|
280
281
|
}
|
|
281
282
|
if (typeof window < "u") {
|
|
282
283
|
for (let t in m) {
|
|
@@ -292,8 +293,8 @@ function H({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
292
293
|
e.useLayoutEffect(() => {
|
|
293
294
|
if (f.current === null) return;
|
|
294
295
|
let e = /* @__PURE__ */ new Map();
|
|
295
|
-
for (let t in _)
|
|
296
|
-
for (let [e, t] of p.current)
|
|
296
|
+
for (let t in _) G(f.current, t, _[t]), p.current.delete(t), e.set(t, _[t]);
|
|
297
|
+
for (let [e, t] of p.current) G(f.current, e, void 0);
|
|
297
298
|
p.current = e;
|
|
298
299
|
});
|
|
299
300
|
}
|
|
@@ -316,19 +317,19 @@ function H({ react: e, tagName: t, elementClass: n, events: r, displayName: i, d
|
|
|
316
317
|
});
|
|
317
318
|
return l.displayName = i == null ? n.name : i, l;
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function G(e, t, n) {
|
|
320
321
|
var r, i;
|
|
321
322
|
e[t] = n, n == null && t in ((r = (i = globalThis.HTMLElement) == null ? void 0 : i.prototype) == null ? {} : r) && e.removeAttribute(t);
|
|
322
323
|
}
|
|
323
|
-
var
|
|
324
|
-
react:
|
|
324
|
+
var K = W({
|
|
325
|
+
react: c.default,
|
|
325
326
|
tagName: "tiktok-video",
|
|
326
|
-
elementClass:
|
|
327
|
+
elementClass: z,
|
|
327
328
|
toAttributeName(e) {
|
|
328
|
-
return e === "muted" ? "" : e === "defaultMuted" ? "muted" :
|
|
329
|
+
return e === "muted" ? "" : e === "defaultMuted" ? "muted" : H(e);
|
|
329
330
|
}
|
|
330
331
|
});
|
|
331
332
|
//#endregion
|
|
332
|
-
export {
|
|
333
|
+
export { K as default };
|
|
333
334
|
|
|
334
|
-
//# sourceMappingURL=react-
|
|
335
|
+
//# sourceMappingURL=react-ChCcxVnw.js.map
|