@devix-technologies/react-gjirafa-vp-player 1.0.0 → 1.0.2
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/App.d.ts +2 -0
- package/dist/components/Feedback.d.ts +25 -0
- package/dist/components/VPPlayer/index.d.ts +2 -0
- package/dist/components/VPPlayer/ui/index.d.ts +1 -0
- package/dist/components/VPPlayer/ui/styled.d.ts +42 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/vpPlayerConfig.d.ts +9 -0
- package/dist/constants/configs.d.ts +22 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/storybook.d.ts +11 -0
- package/dist/constants/styles.d.ts +11 -0
- package/dist/constants/urls.d.ts +18 -0
- package/dist/constants/vpPlayer.d.ts +29 -0
- package/dist/contexts/VPPlayerContext.d.ts +53 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/features/VPPlayer.d.ts +27 -0
- package/dist/features/index.d.ts +1 -0
- package/dist/features/stories/ads/Ads.stories.d.ts +13 -0
- package/dist/features/stories/context/Context.stories.d.ts +10 -0
- package/dist/features/stories/index.d.ts +3 -0
- package/dist/features/stories/playback/Playback.stories.d.ts +15 -0
- package/dist/fixtures/index.d.ts +1 -0
- package/dist/fixtures/playlist.d.ts +11 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useVPPlayerLogic.d.ts +16 -0
- package/dist/hooks/useVPPlayerScript.d.ts +13 -0
- package/dist/hooks/useVideoData.d.ts +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/interfaces/config.d.ts +303 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/instance.d.ts +11 -0
- package/dist/interfaces/props.d.ts +54 -0
- package/dist/main.d.ts +1 -0
- package/dist/react-gjirafa-vp-player.es.js +1840 -0
- package/dist/react-gjirafa-vp-player.umd.js +84 -0
- package/dist/types/api.types.d.ts +50 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/vpPlayerConfigBuilder.d.ts +29 -0
- package/dist/utils/vpPlayerUtils.d.ts +8 -0
- package/package.json +1 -1
- package/dist/assets/index-C9o-nGUf.js +0 -111
- package/dist/assets/index-kINGwdwO.css +0 -1
- package/dist/index.html +0 -13
|
@@ -0,0 +1,1840 @@
|
|
|
1
|
+
import * as G from "react";
|
|
2
|
+
import mr, { forwardRef as yr, useContext as er, useState as D, useEffect as se, useRef as Ve, useMemo as rr, createContext as gr, useCallback as ze } from "react";
|
|
3
|
+
var de = { exports: {} }, ae = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var Be;
|
|
14
|
+
function br() {
|
|
15
|
+
if (Be) return ae;
|
|
16
|
+
Be = 1;
|
|
17
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
18
|
+
function t(n, a, i) {
|
|
19
|
+
var c = null;
|
|
20
|
+
if (i !== void 0 && (c = "" + i), a.key !== void 0 && (c = "" + a.key), "key" in a) {
|
|
21
|
+
i = {};
|
|
22
|
+
for (var s in a)
|
|
23
|
+
s !== "key" && (i[s] = a[s]);
|
|
24
|
+
} else i = a;
|
|
25
|
+
return a = i.ref, {
|
|
26
|
+
$$typeof: e,
|
|
27
|
+
type: n,
|
|
28
|
+
key: c,
|
|
29
|
+
ref: a !== void 0 ? a : null,
|
|
30
|
+
props: i
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return ae.Fragment = r, ae.jsx = t, ae.jsxs = t, ae;
|
|
34
|
+
}
|
|
35
|
+
var ie = {};
|
|
36
|
+
/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.development.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
var De;
|
|
46
|
+
function vr() {
|
|
47
|
+
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
|
+
function e(o) {
|
|
49
|
+
if (o == null) return null;
|
|
50
|
+
if (typeof o == "function")
|
|
51
|
+
return o.$$typeof === I ? null : o.displayName || o.name || null;
|
|
52
|
+
if (typeof o == "string") return o;
|
|
53
|
+
switch (o) {
|
|
54
|
+
case p:
|
|
55
|
+
return "Fragment";
|
|
56
|
+
case b:
|
|
57
|
+
return "Profiler";
|
|
58
|
+
case y:
|
|
59
|
+
return "StrictMode";
|
|
60
|
+
case E:
|
|
61
|
+
return "Suspense";
|
|
62
|
+
case T:
|
|
63
|
+
return "SuspenseList";
|
|
64
|
+
case L:
|
|
65
|
+
return "Activity";
|
|
66
|
+
}
|
|
67
|
+
if (typeof o == "object")
|
|
68
|
+
switch (typeof o.tag == "number" && console.error(
|
|
69
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
|
+
), o.$$typeof) {
|
|
71
|
+
case x:
|
|
72
|
+
return "Portal";
|
|
73
|
+
case S:
|
|
74
|
+
return (o.displayName || "Context") + ".Provider";
|
|
75
|
+
case v:
|
|
76
|
+
return (o._context.displayName || "Context") + ".Consumer";
|
|
77
|
+
case C:
|
|
78
|
+
var g = o.render;
|
|
79
|
+
return o = o.displayName, o || (o = g.displayName || g.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
80
|
+
case d:
|
|
81
|
+
return g = o.displayName || null, g !== null ? g : e(o.type) || "Memo";
|
|
82
|
+
case A:
|
|
83
|
+
g = o._payload, o = o._init;
|
|
84
|
+
try {
|
|
85
|
+
return e(o(g));
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function r(o) {
|
|
92
|
+
return "" + o;
|
|
93
|
+
}
|
|
94
|
+
function t(o) {
|
|
95
|
+
try {
|
|
96
|
+
r(o);
|
|
97
|
+
var g = !1;
|
|
98
|
+
} catch {
|
|
99
|
+
g = !0;
|
|
100
|
+
}
|
|
101
|
+
if (g) {
|
|
102
|
+
g = console;
|
|
103
|
+
var R = g.error, j = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
104
|
+
return R.call(
|
|
105
|
+
g,
|
|
106
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
+
j
|
|
108
|
+
), r(o);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function n(o) {
|
|
112
|
+
if (o === p) return "<>";
|
|
113
|
+
if (typeof o == "object" && o !== null && o.$$typeof === A)
|
|
114
|
+
return "<...>";
|
|
115
|
+
try {
|
|
116
|
+
var g = e(o);
|
|
117
|
+
return g ? "<" + g + ">" : "<...>";
|
|
118
|
+
} catch {
|
|
119
|
+
return "<...>";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function a() {
|
|
123
|
+
var o = M.A;
|
|
124
|
+
return o === null ? null : o.getOwner();
|
|
125
|
+
}
|
|
126
|
+
function i() {
|
|
127
|
+
return Error("react-stack-top-frame");
|
|
128
|
+
}
|
|
129
|
+
function c(o) {
|
|
130
|
+
if (H.call(o, "key")) {
|
|
131
|
+
var g = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
132
|
+
if (g && g.isReactWarning) return !1;
|
|
133
|
+
}
|
|
134
|
+
return o.key !== void 0;
|
|
135
|
+
}
|
|
136
|
+
function s(o, g) {
|
|
137
|
+
function R() {
|
|
138
|
+
ne || (ne = !0, console.error(
|
|
139
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
+
g
|
|
141
|
+
));
|
|
142
|
+
}
|
|
143
|
+
R.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
144
|
+
get: R,
|
|
145
|
+
configurable: !0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function f() {
|
|
149
|
+
var o = e(this.type);
|
|
150
|
+
return K[o] || (K[o] = !0, console.error(
|
|
151
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
|
+
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
153
|
+
}
|
|
154
|
+
function h(o, g, R, j, J, U, ke, Pe) {
|
|
155
|
+
return R = U.ref, o = {
|
|
156
|
+
$$typeof: w,
|
|
157
|
+
type: o,
|
|
158
|
+
key: g,
|
|
159
|
+
props: U,
|
|
160
|
+
_owner: J
|
|
161
|
+
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(o, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: f
|
|
164
|
+
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(o, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(o, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: ke
|
|
179
|
+
}), Object.defineProperty(o, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: Pe
|
|
184
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
185
|
+
}
|
|
186
|
+
function l(o, g, R, j, J, U, ke, Pe) {
|
|
187
|
+
var F = g.children;
|
|
188
|
+
if (F !== void 0)
|
|
189
|
+
if (j)
|
|
190
|
+
if (B(F)) {
|
|
191
|
+
for (j = 0; j < F.length; j++)
|
|
192
|
+
u(F[j]);
|
|
193
|
+
Object.freeze && Object.freeze(F);
|
|
194
|
+
} else
|
|
195
|
+
console.error(
|
|
196
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
+
);
|
|
198
|
+
else u(F);
|
|
199
|
+
if (H.call(g, "key")) {
|
|
200
|
+
F = e(o);
|
|
201
|
+
var Z = Object.keys(g).filter(function(hr) {
|
|
202
|
+
return hr !== "key";
|
|
203
|
+
});
|
|
204
|
+
j = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", Le[F + j] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
+
let props = %s;
|
|
207
|
+
<%s {...props} />
|
|
208
|
+
React keys must be passed directly to JSX without using spread:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s key={someKey} {...props} />`,
|
|
211
|
+
j,
|
|
212
|
+
F,
|
|
213
|
+
Z,
|
|
214
|
+
F
|
|
215
|
+
), Le[F + j] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (F = null, R !== void 0 && (t(R), F = "" + R), c(g) && (t(g.key), F = "" + g.key), "key" in g) {
|
|
218
|
+
R = {};
|
|
219
|
+
for (var Ee in g)
|
|
220
|
+
Ee !== "key" && (R[Ee] = g[Ee]);
|
|
221
|
+
} else R = g;
|
|
222
|
+
return F && s(
|
|
223
|
+
R,
|
|
224
|
+
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
225
|
+
), h(
|
|
226
|
+
o,
|
|
227
|
+
F,
|
|
228
|
+
U,
|
|
229
|
+
J,
|
|
230
|
+
a(),
|
|
231
|
+
R,
|
|
232
|
+
ke,
|
|
233
|
+
Pe
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function u(o) {
|
|
237
|
+
typeof o == "object" && o !== null && o.$$typeof === w && o._store && (o._store.validated = 1);
|
|
238
|
+
}
|
|
239
|
+
var m = mr, w = Symbol.for("react.transitional.element"), x = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), I = Symbol.for("react.client.reference"), M = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, B = Array.isArray, X = console.createTask ? console.createTask : function() {
|
|
240
|
+
return null;
|
|
241
|
+
};
|
|
242
|
+
m = {
|
|
243
|
+
"react-stack-bottom-frame": function(o) {
|
|
244
|
+
return o();
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var ne, K = {}, Ne = m["react-stack-bottom-frame"].bind(
|
|
248
|
+
m,
|
|
249
|
+
i
|
|
250
|
+
)(), Me = X(n(i)), Le = {};
|
|
251
|
+
ie.Fragment = p, ie.jsx = function(o, g, R, j, J) {
|
|
252
|
+
var U = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
253
|
+
return l(
|
|
254
|
+
o,
|
|
255
|
+
g,
|
|
256
|
+
R,
|
|
257
|
+
!1,
|
|
258
|
+
j,
|
|
259
|
+
J,
|
|
260
|
+
U ? Error("react-stack-top-frame") : Ne,
|
|
261
|
+
U ? X(n(o)) : Me
|
|
262
|
+
);
|
|
263
|
+
}, ie.jsxs = function(o, g, R, j, J) {
|
|
264
|
+
var U = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return l(
|
|
266
|
+
o,
|
|
267
|
+
g,
|
|
268
|
+
R,
|
|
269
|
+
!0,
|
|
270
|
+
j,
|
|
271
|
+
J,
|
|
272
|
+
U ? Error("react-stack-top-frame") : Ne,
|
|
273
|
+
U ? X(n(o)) : Me
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
}()), ie;
|
|
277
|
+
}
|
|
278
|
+
var Ue;
|
|
279
|
+
function xr() {
|
|
280
|
+
return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? de.exports = br() : de.exports = vr()), de.exports;
|
|
281
|
+
}
|
|
282
|
+
var O = xr();
|
|
283
|
+
function _e() {
|
|
284
|
+
return _e = Object.assign ? Object.assign.bind() : function(e) {
|
|
285
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
286
|
+
var t = arguments[r];
|
|
287
|
+
for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
288
|
+
}
|
|
289
|
+
return e;
|
|
290
|
+
}, _e.apply(null, arguments);
|
|
291
|
+
}
|
|
292
|
+
function wr(e) {
|
|
293
|
+
if (e.sheet)
|
|
294
|
+
return e.sheet;
|
|
295
|
+
for (var r = 0; r < document.styleSheets.length; r++)
|
|
296
|
+
if (document.styleSheets[r].ownerNode === e)
|
|
297
|
+
return document.styleSheets[r];
|
|
298
|
+
}
|
|
299
|
+
function kr(e) {
|
|
300
|
+
var r = document.createElement("style");
|
|
301
|
+
return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r;
|
|
302
|
+
}
|
|
303
|
+
var Pr = /* @__PURE__ */ function() {
|
|
304
|
+
function e(t) {
|
|
305
|
+
var n = this;
|
|
306
|
+
this._insertTag = function(a) {
|
|
307
|
+
var i;
|
|
308
|
+
n.tags.length === 0 ? n.insertionPoint ? i = n.insertionPoint.nextSibling : n.prepend ? i = n.container.firstChild : i = n.before : i = n.tags[n.tags.length - 1].nextSibling, n.container.insertBefore(a, i), n.tags.push(a);
|
|
309
|
+
}, this.isSpeedy = t.speedy === void 0 ? !0 : t.speedy, this.tags = [], this.ctr = 0, this.nonce = t.nonce, this.key = t.key, this.container = t.container, this.prepend = t.prepend, this.insertionPoint = t.insertionPoint, this.before = null;
|
|
310
|
+
}
|
|
311
|
+
var r = e.prototype;
|
|
312
|
+
return r.hydrate = function(n) {
|
|
313
|
+
n.forEach(this._insertTag);
|
|
314
|
+
}, r.insert = function(n) {
|
|
315
|
+
this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(kr(this));
|
|
316
|
+
var a = this.tags[this.tags.length - 1];
|
|
317
|
+
if (this.isSpeedy) {
|
|
318
|
+
var i = wr(a);
|
|
319
|
+
try {
|
|
320
|
+
i.insertRule(n, i.cssRules.length);
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
} else
|
|
324
|
+
a.appendChild(document.createTextNode(n));
|
|
325
|
+
this.ctr++;
|
|
326
|
+
}, r.flush = function() {
|
|
327
|
+
this.tags.forEach(function(n) {
|
|
328
|
+
var a;
|
|
329
|
+
return (a = n.parentNode) == null ? void 0 : a.removeChild(n);
|
|
330
|
+
}), this.tags = [], this.ctr = 0;
|
|
331
|
+
}, e;
|
|
332
|
+
}(), N = "-ms-", be = "-moz-", k = "-webkit-", tr = "comm", Ie = "rule", $e = "decl", Er = "@import", nr = "@keyframes", Sr = "@layer", Tr = Math.abs, ve = String.fromCharCode, Rr = Object.assign;
|
|
333
|
+
function _r(e, r) {
|
|
334
|
+
return $(e, 0) ^ 45 ? (((r << 2 ^ $(e, 0)) << 2 ^ $(e, 1)) << 2 ^ $(e, 2)) << 2 ^ $(e, 3) : 0;
|
|
335
|
+
}
|
|
336
|
+
function ar(e) {
|
|
337
|
+
return e.trim();
|
|
338
|
+
}
|
|
339
|
+
function Cr(e, r) {
|
|
340
|
+
return (e = r.exec(e)) ? e[0] : e;
|
|
341
|
+
}
|
|
342
|
+
function P(e, r, t) {
|
|
343
|
+
return e.replace(r, t);
|
|
344
|
+
}
|
|
345
|
+
function Ce(e, r) {
|
|
346
|
+
return e.indexOf(r);
|
|
347
|
+
}
|
|
348
|
+
function $(e, r) {
|
|
349
|
+
return e.charCodeAt(r) | 0;
|
|
350
|
+
}
|
|
351
|
+
function ce(e, r, t) {
|
|
352
|
+
return e.slice(r, t);
|
|
353
|
+
}
|
|
354
|
+
function W(e) {
|
|
355
|
+
return e.length;
|
|
356
|
+
}
|
|
357
|
+
function je(e) {
|
|
358
|
+
return e.length;
|
|
359
|
+
}
|
|
360
|
+
function pe(e, r) {
|
|
361
|
+
return r.push(e), e;
|
|
362
|
+
}
|
|
363
|
+
function Ar(e, r) {
|
|
364
|
+
return e.map(r).join("");
|
|
365
|
+
}
|
|
366
|
+
var xe = 1, ee = 1, ir = 0, V = 0, _ = 0, te = "";
|
|
367
|
+
function we(e, r, t, n, a, i, c) {
|
|
368
|
+
return { value: e, root: r, parent: t, type: n, props: a, children: i, line: xe, column: ee, length: c, return: "" };
|
|
369
|
+
}
|
|
370
|
+
function oe(e, r) {
|
|
371
|
+
return Rr(we("", null, null, "", null, null, 0), e, { length: -e.length }, r);
|
|
372
|
+
}
|
|
373
|
+
function Or() {
|
|
374
|
+
return _;
|
|
375
|
+
}
|
|
376
|
+
function Ir() {
|
|
377
|
+
return _ = V > 0 ? $(te, --V) : 0, ee--, _ === 10 && (ee = 1, xe--), _;
|
|
378
|
+
}
|
|
379
|
+
function z() {
|
|
380
|
+
return _ = V < ir ? $(te, V++) : 0, ee++, _ === 10 && (ee = 1, xe++), _;
|
|
381
|
+
}
|
|
382
|
+
function q() {
|
|
383
|
+
return $(te, V);
|
|
384
|
+
}
|
|
385
|
+
function me() {
|
|
386
|
+
return V;
|
|
387
|
+
}
|
|
388
|
+
function fe(e, r) {
|
|
389
|
+
return ce(te, e, r);
|
|
390
|
+
}
|
|
391
|
+
function le(e) {
|
|
392
|
+
switch (e) {
|
|
393
|
+
// \0 \t \n \r \s whitespace token
|
|
394
|
+
case 0:
|
|
395
|
+
case 9:
|
|
396
|
+
case 10:
|
|
397
|
+
case 13:
|
|
398
|
+
case 32:
|
|
399
|
+
return 5;
|
|
400
|
+
// ! + , / > @ ~ isolate token
|
|
401
|
+
case 33:
|
|
402
|
+
case 43:
|
|
403
|
+
case 44:
|
|
404
|
+
case 47:
|
|
405
|
+
case 62:
|
|
406
|
+
case 64:
|
|
407
|
+
case 126:
|
|
408
|
+
// ; { } breakpoint token
|
|
409
|
+
case 59:
|
|
410
|
+
case 123:
|
|
411
|
+
case 125:
|
|
412
|
+
return 4;
|
|
413
|
+
// : accompanied token
|
|
414
|
+
case 58:
|
|
415
|
+
return 3;
|
|
416
|
+
// " ' ( [ opening delimit token
|
|
417
|
+
case 34:
|
|
418
|
+
case 39:
|
|
419
|
+
case 40:
|
|
420
|
+
case 91:
|
|
421
|
+
return 2;
|
|
422
|
+
// ) ] closing delimit token
|
|
423
|
+
case 41:
|
|
424
|
+
case 93:
|
|
425
|
+
return 1;
|
|
426
|
+
}
|
|
427
|
+
return 0;
|
|
428
|
+
}
|
|
429
|
+
function or(e) {
|
|
430
|
+
return xe = ee = 1, ir = W(te = e), V = 0, [];
|
|
431
|
+
}
|
|
432
|
+
function sr(e) {
|
|
433
|
+
return te = "", e;
|
|
434
|
+
}
|
|
435
|
+
function ye(e) {
|
|
436
|
+
return ar(fe(V - 1, Ae(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
|
|
437
|
+
}
|
|
438
|
+
function $r(e) {
|
|
439
|
+
for (; (_ = q()) && _ < 33; )
|
|
440
|
+
z();
|
|
441
|
+
return le(e) > 2 || le(_) > 3 ? "" : " ";
|
|
442
|
+
}
|
|
443
|
+
function jr(e, r) {
|
|
444
|
+
for (; --r && z() && !(_ < 48 || _ > 102 || _ > 57 && _ < 65 || _ > 70 && _ < 97); )
|
|
445
|
+
;
|
|
446
|
+
return fe(e, me() + (r < 6 && q() == 32 && z() == 32));
|
|
447
|
+
}
|
|
448
|
+
function Ae(e) {
|
|
449
|
+
for (; z(); )
|
|
450
|
+
switch (_) {
|
|
451
|
+
// ] ) " '
|
|
452
|
+
case e:
|
|
453
|
+
return V;
|
|
454
|
+
// " '
|
|
455
|
+
case 34:
|
|
456
|
+
case 39:
|
|
457
|
+
e !== 34 && e !== 39 && Ae(_);
|
|
458
|
+
break;
|
|
459
|
+
// (
|
|
460
|
+
case 40:
|
|
461
|
+
e === 41 && Ae(e);
|
|
462
|
+
break;
|
|
463
|
+
// \
|
|
464
|
+
case 92:
|
|
465
|
+
z();
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
return V;
|
|
469
|
+
}
|
|
470
|
+
function Fr(e, r) {
|
|
471
|
+
for (; z() && e + _ !== 57; )
|
|
472
|
+
if (e + _ === 84 && q() === 47)
|
|
473
|
+
break;
|
|
474
|
+
return "/*" + fe(r, V - 1) + "*" + ve(e === 47 ? e : z());
|
|
475
|
+
}
|
|
476
|
+
function Nr(e) {
|
|
477
|
+
for (; !le(q()); )
|
|
478
|
+
z();
|
|
479
|
+
return fe(e, V);
|
|
480
|
+
}
|
|
481
|
+
function Mr(e) {
|
|
482
|
+
return sr(ge("", null, null, null, [""], e = or(e), 0, [0], e));
|
|
483
|
+
}
|
|
484
|
+
function ge(e, r, t, n, a, i, c, s, f) {
|
|
485
|
+
for (var h = 0, l = 0, u = c, m = 0, w = 0, x = 0, p = 1, y = 1, b = 1, v = 0, S = "", C = a, E = i, T = n, d = S; y; )
|
|
486
|
+
switch (x = v, v = z()) {
|
|
487
|
+
// (
|
|
488
|
+
case 40:
|
|
489
|
+
if (x != 108 && $(d, u - 1) == 58) {
|
|
490
|
+
Ce(d += P(ye(v), "&", "&\f"), "&\f") != -1 && (b = -1);
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
// " ' [
|
|
494
|
+
case 34:
|
|
495
|
+
case 39:
|
|
496
|
+
case 91:
|
|
497
|
+
d += ye(v);
|
|
498
|
+
break;
|
|
499
|
+
// \t \n \r \s
|
|
500
|
+
case 9:
|
|
501
|
+
case 10:
|
|
502
|
+
case 13:
|
|
503
|
+
case 32:
|
|
504
|
+
d += $r(x);
|
|
505
|
+
break;
|
|
506
|
+
// \
|
|
507
|
+
case 92:
|
|
508
|
+
d += jr(me() - 1, 7);
|
|
509
|
+
continue;
|
|
510
|
+
// /
|
|
511
|
+
case 47:
|
|
512
|
+
switch (q()) {
|
|
513
|
+
case 42:
|
|
514
|
+
case 47:
|
|
515
|
+
pe(Lr(Fr(z(), me()), r, t), f);
|
|
516
|
+
break;
|
|
517
|
+
default:
|
|
518
|
+
d += "/";
|
|
519
|
+
}
|
|
520
|
+
break;
|
|
521
|
+
// {
|
|
522
|
+
case 123 * p:
|
|
523
|
+
s[h++] = W(d) * b;
|
|
524
|
+
// } ; \0
|
|
525
|
+
case 125 * p:
|
|
526
|
+
case 59:
|
|
527
|
+
case 0:
|
|
528
|
+
switch (v) {
|
|
529
|
+
// \0 }
|
|
530
|
+
case 0:
|
|
531
|
+
case 125:
|
|
532
|
+
y = 0;
|
|
533
|
+
// ;
|
|
534
|
+
case 59 + l:
|
|
535
|
+
b == -1 && (d = P(d, /\f/g, "")), w > 0 && W(d) - u && pe(w > 32 ? Ye(d + ";", n, t, u - 1) : Ye(P(d, " ", "") + ";", n, t, u - 2), f);
|
|
536
|
+
break;
|
|
537
|
+
// @ ;
|
|
538
|
+
case 59:
|
|
539
|
+
d += ";";
|
|
540
|
+
// { rule/at-rule
|
|
541
|
+
default:
|
|
542
|
+
if (pe(T = We(d, r, t, h, l, a, s, S, C = [], E = [], u), i), v === 123)
|
|
543
|
+
if (l === 0)
|
|
544
|
+
ge(d, r, T, T, C, i, u, s, E);
|
|
545
|
+
else
|
|
546
|
+
switch (m === 99 && $(d, 3) === 110 ? 100 : m) {
|
|
547
|
+
// d l m s
|
|
548
|
+
case 100:
|
|
549
|
+
case 108:
|
|
550
|
+
case 109:
|
|
551
|
+
case 115:
|
|
552
|
+
ge(e, T, T, n && pe(We(e, T, T, 0, 0, a, s, S, a, C = [], u), E), a, E, u, s, n ? C : E);
|
|
553
|
+
break;
|
|
554
|
+
default:
|
|
555
|
+
ge(d, T, T, T, [""], E, 0, s, E);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
h = l = w = 0, p = b = 1, S = d = "", u = c;
|
|
559
|
+
break;
|
|
560
|
+
// :
|
|
561
|
+
case 58:
|
|
562
|
+
u = 1 + W(d), w = x;
|
|
563
|
+
default:
|
|
564
|
+
if (p < 1) {
|
|
565
|
+
if (v == 123)
|
|
566
|
+
--p;
|
|
567
|
+
else if (v == 125 && p++ == 0 && Ir() == 125)
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
switch (d += ve(v), v * p) {
|
|
571
|
+
// &
|
|
572
|
+
case 38:
|
|
573
|
+
b = l > 0 ? 1 : (d += "\f", -1);
|
|
574
|
+
break;
|
|
575
|
+
// ,
|
|
576
|
+
case 44:
|
|
577
|
+
s[h++] = (W(d) - 1) * b, b = 1;
|
|
578
|
+
break;
|
|
579
|
+
// @
|
|
580
|
+
case 64:
|
|
581
|
+
q() === 45 && (d += ye(z())), m = q(), l = u = W(S = d += Nr(me())), v++;
|
|
582
|
+
break;
|
|
583
|
+
// -
|
|
584
|
+
case 45:
|
|
585
|
+
x === 45 && W(d) == 2 && (p = 0);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return i;
|
|
589
|
+
}
|
|
590
|
+
function We(e, r, t, n, a, i, c, s, f, h, l) {
|
|
591
|
+
for (var u = a - 1, m = a === 0 ? i : [""], w = je(m), x = 0, p = 0, y = 0; x < n; ++x)
|
|
592
|
+
for (var b = 0, v = ce(e, u + 1, u = Tr(p = c[x])), S = e; b < w; ++b)
|
|
593
|
+
(S = ar(p > 0 ? m[b] + " " + v : P(v, /&\f/g, m[b]))) && (f[y++] = S);
|
|
594
|
+
return we(e, r, t, a === 0 ? Ie : s, f, h, l);
|
|
595
|
+
}
|
|
596
|
+
function Lr(e, r, t) {
|
|
597
|
+
return we(e, r, t, tr, ve(Or()), ce(e, 2, -2), 0);
|
|
598
|
+
}
|
|
599
|
+
function Ye(e, r, t, n) {
|
|
600
|
+
return we(e, r, t, $e, ce(e, 0, n), ce(e, n + 1, -1), n);
|
|
601
|
+
}
|
|
602
|
+
function Q(e, r) {
|
|
603
|
+
for (var t = "", n = je(e), a = 0; a < n; a++)
|
|
604
|
+
t += r(e[a], a, e, r) || "";
|
|
605
|
+
return t;
|
|
606
|
+
}
|
|
607
|
+
function Vr(e, r, t, n) {
|
|
608
|
+
switch (e.type) {
|
|
609
|
+
case Sr:
|
|
610
|
+
if (e.children.length) break;
|
|
611
|
+
case Er:
|
|
612
|
+
case $e:
|
|
613
|
+
return e.return = e.return || e.value;
|
|
614
|
+
case tr:
|
|
615
|
+
return "";
|
|
616
|
+
case nr:
|
|
617
|
+
return e.return = e.value + "{" + Q(e.children, n) + "}";
|
|
618
|
+
case Ie:
|
|
619
|
+
e.value = e.props.join(",");
|
|
620
|
+
}
|
|
621
|
+
return W(t = Q(e.children, n)) ? e.return = e.value + "{" + t + "}" : "";
|
|
622
|
+
}
|
|
623
|
+
function zr(e) {
|
|
624
|
+
var r = je(e);
|
|
625
|
+
return function(t, n, a, i) {
|
|
626
|
+
for (var c = "", s = 0; s < r; s++)
|
|
627
|
+
c += e[s](t, n, a, i) || "";
|
|
628
|
+
return c;
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
function Br(e) {
|
|
632
|
+
return function(r) {
|
|
633
|
+
r.root || (r = r.return) && e(r);
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function cr(e) {
|
|
637
|
+
var r = /* @__PURE__ */ Object.create(null);
|
|
638
|
+
return function(t) {
|
|
639
|
+
return r[t] === void 0 && (r[t] = e(t)), r[t];
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
var Dr = function(r, t, n) {
|
|
643
|
+
for (var a = 0, i = 0; a = i, i = q(), a === 38 && i === 12 && (t[n] = 1), !le(i); )
|
|
644
|
+
z();
|
|
645
|
+
return fe(r, V);
|
|
646
|
+
}, Ur = function(r, t) {
|
|
647
|
+
var n = -1, a = 44;
|
|
648
|
+
do
|
|
649
|
+
switch (le(a)) {
|
|
650
|
+
case 0:
|
|
651
|
+
a === 38 && q() === 12 && (t[n] = 1), r[n] += Dr(V - 1, t, n);
|
|
652
|
+
break;
|
|
653
|
+
case 2:
|
|
654
|
+
r[n] += ye(a);
|
|
655
|
+
break;
|
|
656
|
+
case 4:
|
|
657
|
+
if (a === 44) {
|
|
658
|
+
r[++n] = q() === 58 ? "&\f" : "", t[n] = r[n].length;
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
// fallthrough
|
|
662
|
+
default:
|
|
663
|
+
r[n] += ve(a);
|
|
664
|
+
}
|
|
665
|
+
while (a = z());
|
|
666
|
+
return r;
|
|
667
|
+
}, Wr = function(r, t) {
|
|
668
|
+
return sr(Ur(or(r), t));
|
|
669
|
+
}, qe = /* @__PURE__ */ new WeakMap(), Yr = function(r) {
|
|
670
|
+
if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo
|
|
671
|
+
// negative .length indicates that this rule has been already prefixed
|
|
672
|
+
r.length < 1)) {
|
|
673
|
+
for (var t = r.value, n = r.parent, a = r.column === n.column && r.line === n.line; n.type !== "rule"; )
|
|
674
|
+
if (n = n.parent, !n) return;
|
|
675
|
+
if (!(r.props.length === 1 && t.charCodeAt(0) !== 58 && !qe.get(n)) && !a) {
|
|
676
|
+
qe.set(r, !0);
|
|
677
|
+
for (var i = [], c = Wr(t, i), s = n.props, f = 0, h = 0; f < c.length; f++)
|
|
678
|
+
for (var l = 0; l < s.length; l++, h++)
|
|
679
|
+
r.props[h] = i[f] ? c[f].replace(/&\f/g, s[l]) : s[l] + " " + c[f];
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}, qr = function(r) {
|
|
683
|
+
if (r.type === "decl") {
|
|
684
|
+
var t = r.value;
|
|
685
|
+
// charcode for l
|
|
686
|
+
t.charCodeAt(0) === 108 && // charcode for b
|
|
687
|
+
t.charCodeAt(2) === 98 && (r.return = "", r.value = "");
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
function lr(e, r) {
|
|
691
|
+
switch (_r(e, r)) {
|
|
692
|
+
// color-adjust
|
|
693
|
+
case 5103:
|
|
694
|
+
return k + "print-" + e + e;
|
|
695
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
696
|
+
case 5737:
|
|
697
|
+
case 4201:
|
|
698
|
+
case 3177:
|
|
699
|
+
case 3433:
|
|
700
|
+
case 1641:
|
|
701
|
+
case 4457:
|
|
702
|
+
case 2921:
|
|
703
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
704
|
+
case 5572:
|
|
705
|
+
case 6356:
|
|
706
|
+
case 5844:
|
|
707
|
+
case 3191:
|
|
708
|
+
case 6645:
|
|
709
|
+
case 3005:
|
|
710
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
711
|
+
case 6391:
|
|
712
|
+
case 5879:
|
|
713
|
+
case 5623:
|
|
714
|
+
case 6135:
|
|
715
|
+
case 4599:
|
|
716
|
+
case 4855:
|
|
717
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
718
|
+
case 4215:
|
|
719
|
+
case 6389:
|
|
720
|
+
case 5109:
|
|
721
|
+
case 5365:
|
|
722
|
+
case 5621:
|
|
723
|
+
case 3829:
|
|
724
|
+
return k + e + e;
|
|
725
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
726
|
+
case 5349:
|
|
727
|
+
case 4246:
|
|
728
|
+
case 4810:
|
|
729
|
+
case 6968:
|
|
730
|
+
case 2756:
|
|
731
|
+
return k + e + be + e + N + e + e;
|
|
732
|
+
// flex, flex-direction
|
|
733
|
+
case 6828:
|
|
734
|
+
case 4268:
|
|
735
|
+
return k + e + N + e + e;
|
|
736
|
+
// order
|
|
737
|
+
case 6165:
|
|
738
|
+
return k + e + N + "flex-" + e + e;
|
|
739
|
+
// align-items
|
|
740
|
+
case 5187:
|
|
741
|
+
return k + e + P(e, /(\w+).+(:[^]+)/, k + "box-$1$2" + N + "flex-$1$2") + e;
|
|
742
|
+
// align-self
|
|
743
|
+
case 5443:
|
|
744
|
+
return k + e + N + "flex-item-" + P(e, /flex-|-self/, "") + e;
|
|
745
|
+
// align-content
|
|
746
|
+
case 4675:
|
|
747
|
+
return k + e + N + "flex-line-pack" + P(e, /align-content|flex-|-self/, "") + e;
|
|
748
|
+
// flex-shrink
|
|
749
|
+
case 5548:
|
|
750
|
+
return k + e + N + P(e, "shrink", "negative") + e;
|
|
751
|
+
// flex-basis
|
|
752
|
+
case 5292:
|
|
753
|
+
return k + e + N + P(e, "basis", "preferred-size") + e;
|
|
754
|
+
// flex-grow
|
|
755
|
+
case 6060:
|
|
756
|
+
return k + "box-" + P(e, "-grow", "") + k + e + N + P(e, "grow", "positive") + e;
|
|
757
|
+
// transition
|
|
758
|
+
case 4554:
|
|
759
|
+
return k + P(e, /([^-])(transform)/g, "$1" + k + "$2") + e;
|
|
760
|
+
// cursor
|
|
761
|
+
case 6187:
|
|
762
|
+
return P(P(P(e, /(zoom-|grab)/, k + "$1"), /(image-set)/, k + "$1"), e, "") + e;
|
|
763
|
+
// background, background-image
|
|
764
|
+
case 5495:
|
|
765
|
+
case 3959:
|
|
766
|
+
return P(e, /(image-set\([^]*)/, k + "$1$`$1");
|
|
767
|
+
// justify-content
|
|
768
|
+
case 4968:
|
|
769
|
+
return P(P(e, /(.+:)(flex-)?(.*)/, k + "box-pack:$3" + N + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + k + e + e;
|
|
770
|
+
// (margin|padding)-inline-(start|end)
|
|
771
|
+
case 4095:
|
|
772
|
+
case 3583:
|
|
773
|
+
case 4068:
|
|
774
|
+
case 2532:
|
|
775
|
+
return P(e, /(.+)-inline(.+)/, k + "$1$2") + e;
|
|
776
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
777
|
+
case 8116:
|
|
778
|
+
case 7059:
|
|
779
|
+
case 5753:
|
|
780
|
+
case 5535:
|
|
781
|
+
case 5445:
|
|
782
|
+
case 5701:
|
|
783
|
+
case 4933:
|
|
784
|
+
case 4677:
|
|
785
|
+
case 5533:
|
|
786
|
+
case 5789:
|
|
787
|
+
case 5021:
|
|
788
|
+
case 4765:
|
|
789
|
+
if (W(e) - 1 - r > 6) switch ($(e, r + 1)) {
|
|
790
|
+
// (m)ax-content, (m)in-content
|
|
791
|
+
case 109:
|
|
792
|
+
if ($(e, r + 4) !== 45) break;
|
|
793
|
+
// (f)ill-available, (f)it-content
|
|
794
|
+
case 102:
|
|
795
|
+
return P(e, /(.+:)(.+)-([^]+)/, "$1" + k + "$2-$3$1" + be + ($(e, r + 3) == 108 ? "$3" : "$2-$3")) + e;
|
|
796
|
+
// (s)tretch
|
|
797
|
+
case 115:
|
|
798
|
+
return ~Ce(e, "stretch") ? lr(P(e, "stretch", "fill-available"), r) + e : e;
|
|
799
|
+
}
|
|
800
|
+
break;
|
|
801
|
+
// position: sticky
|
|
802
|
+
case 4949:
|
|
803
|
+
if ($(e, r + 1) !== 115) break;
|
|
804
|
+
// display: (flex|inline-flex)
|
|
805
|
+
case 6444:
|
|
806
|
+
switch ($(e, W(e) - 3 - (~Ce(e, "!important") && 10))) {
|
|
807
|
+
// stic(k)y
|
|
808
|
+
case 107:
|
|
809
|
+
return P(e, ":", ":" + k) + e;
|
|
810
|
+
// (inline-)?fl(e)x
|
|
811
|
+
case 101:
|
|
812
|
+
return P(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + k + ($(e, 14) === 45 ? "inline-" : "") + "box$3$1" + k + "$2$3$1" + N + "$2box$3") + e;
|
|
813
|
+
}
|
|
814
|
+
break;
|
|
815
|
+
// writing-mode
|
|
816
|
+
case 5936:
|
|
817
|
+
switch ($(e, r + 11)) {
|
|
818
|
+
// vertical-l(r)
|
|
819
|
+
case 114:
|
|
820
|
+
return k + e + N + P(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
|
|
821
|
+
// vertical-r(l)
|
|
822
|
+
case 108:
|
|
823
|
+
return k + e + N + P(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
|
|
824
|
+
// horizontal(-)tb
|
|
825
|
+
case 45:
|
|
826
|
+
return k + e + N + P(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
|
|
827
|
+
}
|
|
828
|
+
return k + e + N + e + e;
|
|
829
|
+
}
|
|
830
|
+
return e;
|
|
831
|
+
}
|
|
832
|
+
var Hr = function(r, t, n, a) {
|
|
833
|
+
if (r.length > -1 && !r.return) switch (r.type) {
|
|
834
|
+
case $e:
|
|
835
|
+
r.return = lr(r.value, r.length);
|
|
836
|
+
break;
|
|
837
|
+
case nr:
|
|
838
|
+
return Q([oe(r, {
|
|
839
|
+
value: P(r.value, "@", "@" + k)
|
|
840
|
+
})], a);
|
|
841
|
+
case Ie:
|
|
842
|
+
if (r.length) return Ar(r.props, function(i) {
|
|
843
|
+
switch (Cr(i, /(::plac\w+|:read-\w+)/)) {
|
|
844
|
+
// :read-(only|write)
|
|
845
|
+
case ":read-only":
|
|
846
|
+
case ":read-write":
|
|
847
|
+
return Q([oe(r, {
|
|
848
|
+
props: [P(i, /:(read-\w+)/, ":" + be + "$1")]
|
|
849
|
+
})], a);
|
|
850
|
+
// :placeholder
|
|
851
|
+
case "::placeholder":
|
|
852
|
+
return Q([oe(r, {
|
|
853
|
+
props: [P(i, /:(plac\w+)/, ":" + k + "input-$1")]
|
|
854
|
+
}), oe(r, {
|
|
855
|
+
props: [P(i, /:(plac\w+)/, ":" + be + "$1")]
|
|
856
|
+
}), oe(r, {
|
|
857
|
+
props: [P(i, /:(plac\w+)/, N + "input-$1")]
|
|
858
|
+
})], a);
|
|
859
|
+
}
|
|
860
|
+
return "";
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
}, Gr = [Hr], Xr = function(r) {
|
|
864
|
+
var t = r.key;
|
|
865
|
+
if (t === "css") {
|
|
866
|
+
var n = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
867
|
+
Array.prototype.forEach.call(n, function(p) {
|
|
868
|
+
var y = p.getAttribute("data-emotion");
|
|
869
|
+
y.indexOf(" ") !== -1 && (document.head.appendChild(p), p.setAttribute("data-s", ""));
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
var a = r.stylisPlugins || Gr, i = {}, c, s = [];
|
|
873
|
+
c = r.container || document.head, Array.prototype.forEach.call(
|
|
874
|
+
// this means we will ignore elements which don't have a space in them which
|
|
875
|
+
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
876
|
+
document.querySelectorAll('style[data-emotion^="' + t + ' "]'),
|
|
877
|
+
function(p) {
|
|
878
|
+
for (var y = p.getAttribute("data-emotion").split(" "), b = 1; b < y.length; b++)
|
|
879
|
+
i[y[b]] = !0;
|
|
880
|
+
s.push(p);
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
var f, h = [Yr, qr];
|
|
884
|
+
{
|
|
885
|
+
var l, u = [Vr, Br(function(p) {
|
|
886
|
+
l.insert(p);
|
|
887
|
+
})], m = zr(h.concat(a, u)), w = function(y) {
|
|
888
|
+
return Q(Mr(y), m);
|
|
889
|
+
};
|
|
890
|
+
f = function(y, b, v, S) {
|
|
891
|
+
l = v, w(y ? y + "{" + b.styles + "}" : b.styles), S && (x.inserted[b.name] = !0);
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
var x = {
|
|
895
|
+
key: t,
|
|
896
|
+
sheet: new Pr({
|
|
897
|
+
key: t,
|
|
898
|
+
container: c,
|
|
899
|
+
nonce: r.nonce,
|
|
900
|
+
speedy: r.speedy,
|
|
901
|
+
prepend: r.prepend,
|
|
902
|
+
insertionPoint: r.insertionPoint
|
|
903
|
+
}),
|
|
904
|
+
nonce: r.nonce,
|
|
905
|
+
inserted: i,
|
|
906
|
+
registered: {},
|
|
907
|
+
insert: f
|
|
908
|
+
};
|
|
909
|
+
return x.sheet.hydrate(s), x;
|
|
910
|
+
}, Kr = !0;
|
|
911
|
+
function Jr(e, r, t) {
|
|
912
|
+
var n = "";
|
|
913
|
+
return t.split(" ").forEach(function(a) {
|
|
914
|
+
e[a] !== void 0 ? r.push(e[a] + ";") : a && (n += a + " ");
|
|
915
|
+
}), n;
|
|
916
|
+
}
|
|
917
|
+
var ur = function(r, t, n) {
|
|
918
|
+
var a = r.key + "-" + t.name;
|
|
919
|
+
// we only need to add the styles to the registered cache if the
|
|
920
|
+
// class name could be used further down
|
|
921
|
+
// the tree but if it's a string tag, we know it won't
|
|
922
|
+
// so we don't have to add it to registered cache.
|
|
923
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
924
|
+
(n === !1 || // we need to always store it if we're in compat mode and
|
|
925
|
+
// in node since emotion-server relies on whether a style is in
|
|
926
|
+
// the registered cache to know whether a style is global or not
|
|
927
|
+
// also, note that this check will be dead code eliminated in the browser
|
|
928
|
+
Kr === !1) && r.registered[a] === void 0 && (r.registered[a] = t.styles);
|
|
929
|
+
}, Zr = function(r, t, n) {
|
|
930
|
+
ur(r, t, n);
|
|
931
|
+
var a = r.key + "-" + t.name;
|
|
932
|
+
if (r.inserted[t.name] === void 0) {
|
|
933
|
+
var i = t;
|
|
934
|
+
do
|
|
935
|
+
r.insert(t === i ? "." + a : "", i, r.sheet, !0), i = i.next;
|
|
936
|
+
while (i !== void 0);
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
function Qr(e) {
|
|
940
|
+
for (var r = 0, t, n = 0, a = e.length; a >= 4; ++n, a -= 4)
|
|
941
|
+
t = e.charCodeAt(n) & 255 | (e.charCodeAt(++n) & 255) << 8 | (e.charCodeAt(++n) & 255) << 16 | (e.charCodeAt(++n) & 255) << 24, t = /* Math.imul(k, m): */
|
|
942
|
+
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), t ^= /* k >>> r: */
|
|
943
|
+
t >>> 24, r = /* Math.imul(k, m): */
|
|
944
|
+
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
|
|
945
|
+
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16);
|
|
946
|
+
switch (a) {
|
|
947
|
+
case 3:
|
|
948
|
+
r ^= (e.charCodeAt(n + 2) & 255) << 16;
|
|
949
|
+
case 2:
|
|
950
|
+
r ^= (e.charCodeAt(n + 1) & 255) << 8;
|
|
951
|
+
case 1:
|
|
952
|
+
r ^= e.charCodeAt(n) & 255, r = /* Math.imul(h, m): */
|
|
953
|
+
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16);
|
|
954
|
+
}
|
|
955
|
+
return r ^= r >>> 13, r = /* Math.imul(h, m): */
|
|
956
|
+
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36);
|
|
957
|
+
}
|
|
958
|
+
var et = {
|
|
959
|
+
animationIterationCount: 1,
|
|
960
|
+
aspectRatio: 1,
|
|
961
|
+
borderImageOutset: 1,
|
|
962
|
+
borderImageSlice: 1,
|
|
963
|
+
borderImageWidth: 1,
|
|
964
|
+
boxFlex: 1,
|
|
965
|
+
boxFlexGroup: 1,
|
|
966
|
+
boxOrdinalGroup: 1,
|
|
967
|
+
columnCount: 1,
|
|
968
|
+
columns: 1,
|
|
969
|
+
flex: 1,
|
|
970
|
+
flexGrow: 1,
|
|
971
|
+
flexPositive: 1,
|
|
972
|
+
flexShrink: 1,
|
|
973
|
+
flexNegative: 1,
|
|
974
|
+
flexOrder: 1,
|
|
975
|
+
gridRow: 1,
|
|
976
|
+
gridRowEnd: 1,
|
|
977
|
+
gridRowSpan: 1,
|
|
978
|
+
gridRowStart: 1,
|
|
979
|
+
gridColumn: 1,
|
|
980
|
+
gridColumnEnd: 1,
|
|
981
|
+
gridColumnSpan: 1,
|
|
982
|
+
gridColumnStart: 1,
|
|
983
|
+
msGridRow: 1,
|
|
984
|
+
msGridRowSpan: 1,
|
|
985
|
+
msGridColumn: 1,
|
|
986
|
+
msGridColumnSpan: 1,
|
|
987
|
+
fontWeight: 1,
|
|
988
|
+
lineHeight: 1,
|
|
989
|
+
opacity: 1,
|
|
990
|
+
order: 1,
|
|
991
|
+
orphans: 1,
|
|
992
|
+
scale: 1,
|
|
993
|
+
tabSize: 1,
|
|
994
|
+
widows: 1,
|
|
995
|
+
zIndex: 1,
|
|
996
|
+
zoom: 1,
|
|
997
|
+
WebkitLineClamp: 1,
|
|
998
|
+
// SVG-related properties
|
|
999
|
+
fillOpacity: 1,
|
|
1000
|
+
floodOpacity: 1,
|
|
1001
|
+
stopOpacity: 1,
|
|
1002
|
+
strokeDasharray: 1,
|
|
1003
|
+
strokeDashoffset: 1,
|
|
1004
|
+
strokeMiterlimit: 1,
|
|
1005
|
+
strokeOpacity: 1,
|
|
1006
|
+
strokeWidth: 1
|
|
1007
|
+
}, rt = /[A-Z]|^ms/g, tt = /_EMO_([^_]+?)_([^]*?)_EMO_/g, fr = function(r) {
|
|
1008
|
+
return r.charCodeAt(1) === 45;
|
|
1009
|
+
}, He = function(r) {
|
|
1010
|
+
return r != null && typeof r != "boolean";
|
|
1011
|
+
}, Se = /* @__PURE__ */ cr(function(e) {
|
|
1012
|
+
return fr(e) ? e : e.replace(rt, "-$&").toLowerCase();
|
|
1013
|
+
}), Ge = function(r, t) {
|
|
1014
|
+
switch (r) {
|
|
1015
|
+
case "animation":
|
|
1016
|
+
case "animationName":
|
|
1017
|
+
if (typeof t == "string")
|
|
1018
|
+
return t.replace(tt, function(n, a, i) {
|
|
1019
|
+
return Y = {
|
|
1020
|
+
name: a,
|
|
1021
|
+
styles: i,
|
|
1022
|
+
next: Y
|
|
1023
|
+
}, a;
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
return et[r] !== 1 && !fr(r) && typeof t == "number" && t !== 0 ? t + "px" : t;
|
|
1027
|
+
};
|
|
1028
|
+
function ue(e, r, t) {
|
|
1029
|
+
if (t == null)
|
|
1030
|
+
return "";
|
|
1031
|
+
var n = t;
|
|
1032
|
+
if (n.__emotion_styles !== void 0)
|
|
1033
|
+
return n;
|
|
1034
|
+
switch (typeof t) {
|
|
1035
|
+
case "boolean":
|
|
1036
|
+
return "";
|
|
1037
|
+
case "object": {
|
|
1038
|
+
var a = t;
|
|
1039
|
+
if (a.anim === 1)
|
|
1040
|
+
return Y = {
|
|
1041
|
+
name: a.name,
|
|
1042
|
+
styles: a.styles,
|
|
1043
|
+
next: Y
|
|
1044
|
+
}, a.name;
|
|
1045
|
+
var i = t;
|
|
1046
|
+
if (i.styles !== void 0) {
|
|
1047
|
+
var c = i.next;
|
|
1048
|
+
if (c !== void 0)
|
|
1049
|
+
for (; c !== void 0; )
|
|
1050
|
+
Y = {
|
|
1051
|
+
name: c.name,
|
|
1052
|
+
styles: c.styles,
|
|
1053
|
+
next: Y
|
|
1054
|
+
}, c = c.next;
|
|
1055
|
+
var s = i.styles + ";";
|
|
1056
|
+
return s;
|
|
1057
|
+
}
|
|
1058
|
+
return nt(e, r, t);
|
|
1059
|
+
}
|
|
1060
|
+
case "function": {
|
|
1061
|
+
if (e !== void 0) {
|
|
1062
|
+
var f = Y, h = t(e);
|
|
1063
|
+
return Y = f, ue(e, r, h);
|
|
1064
|
+
}
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
var l = t;
|
|
1069
|
+
if (r == null)
|
|
1070
|
+
return l;
|
|
1071
|
+
var u = r[l];
|
|
1072
|
+
return u !== void 0 ? u : l;
|
|
1073
|
+
}
|
|
1074
|
+
function nt(e, r, t) {
|
|
1075
|
+
var n = "";
|
|
1076
|
+
if (Array.isArray(t))
|
|
1077
|
+
for (var a = 0; a < t.length; a++)
|
|
1078
|
+
n += ue(e, r, t[a]) + ";";
|
|
1079
|
+
else
|
|
1080
|
+
for (var i in t) {
|
|
1081
|
+
var c = t[i];
|
|
1082
|
+
if (typeof c != "object") {
|
|
1083
|
+
var s = c;
|
|
1084
|
+
r != null && r[s] !== void 0 ? n += i + "{" + r[s] + "}" : He(s) && (n += Se(i) + ":" + Ge(i, s) + ";");
|
|
1085
|
+
} else if (Array.isArray(c) && typeof c[0] == "string" && (r == null || r[c[0]] === void 0))
|
|
1086
|
+
for (var f = 0; f < c.length; f++)
|
|
1087
|
+
He(c[f]) && (n += Se(i) + ":" + Ge(i, c[f]) + ";");
|
|
1088
|
+
else {
|
|
1089
|
+
var h = ue(e, r, c);
|
|
1090
|
+
switch (i) {
|
|
1091
|
+
case "animation":
|
|
1092
|
+
case "animationName": {
|
|
1093
|
+
n += Se(i) + ":" + h + ";";
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
default:
|
|
1097
|
+
n += i + "{" + h + "}";
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return n;
|
|
1102
|
+
}
|
|
1103
|
+
var Xe = /label:\s*([^\s;{]+)\s*(;|$)/g, Y;
|
|
1104
|
+
function at(e, r, t) {
|
|
1105
|
+
if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0)
|
|
1106
|
+
return e[0];
|
|
1107
|
+
var n = !0, a = "";
|
|
1108
|
+
Y = void 0;
|
|
1109
|
+
var i = e[0];
|
|
1110
|
+
if (i == null || i.raw === void 0)
|
|
1111
|
+
n = !1, a += ue(t, r, i);
|
|
1112
|
+
else {
|
|
1113
|
+
var c = i;
|
|
1114
|
+
a += c[0];
|
|
1115
|
+
}
|
|
1116
|
+
for (var s = 1; s < e.length; s++)
|
|
1117
|
+
if (a += ue(t, r, e[s]), n) {
|
|
1118
|
+
var f = i;
|
|
1119
|
+
a += f[s];
|
|
1120
|
+
}
|
|
1121
|
+
Xe.lastIndex = 0;
|
|
1122
|
+
for (var h = "", l; (l = Xe.exec(a)) !== null; )
|
|
1123
|
+
h += "-" + l[1];
|
|
1124
|
+
var u = Qr(a) + h;
|
|
1125
|
+
return {
|
|
1126
|
+
name: u,
|
|
1127
|
+
styles: a,
|
|
1128
|
+
next: Y
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
var it = function(r) {
|
|
1132
|
+
return r();
|
|
1133
|
+
}, ot = G.useInsertionEffect ? G.useInsertionEffect : !1, st = ot || it, dr = /* @__PURE__ */ G.createContext(
|
|
1134
|
+
// we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
1135
|
+
// because this module is primarily intended for the browser and node
|
|
1136
|
+
// but it's also required in react native and similar environments sometimes
|
|
1137
|
+
// and we could have a special build just for that
|
|
1138
|
+
// but this is much easier and the native packages
|
|
1139
|
+
// might use a different theme context in the future anyway
|
|
1140
|
+
typeof HTMLElement < "u" ? /* @__PURE__ */ Xr({
|
|
1141
|
+
key: "css"
|
|
1142
|
+
}) : null
|
|
1143
|
+
);
|
|
1144
|
+
dr.Provider;
|
|
1145
|
+
var ct = function(r) {
|
|
1146
|
+
return /* @__PURE__ */ yr(function(t, n) {
|
|
1147
|
+
var a = er(dr);
|
|
1148
|
+
return r(t, a, n);
|
|
1149
|
+
});
|
|
1150
|
+
}, lt = /* @__PURE__ */ G.createContext({}), ut = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, ft = /* @__PURE__ */ cr(
|
|
1151
|
+
function(e) {
|
|
1152
|
+
return ut.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
|
|
1153
|
+
}
|
|
1154
|
+
/* Z+1 */
|
|
1155
|
+
), dt = ft, pt = function(r) {
|
|
1156
|
+
return r !== "theme";
|
|
1157
|
+
}, Ke = function(r) {
|
|
1158
|
+
return typeof r == "string" && // 96 is one less than the char code
|
|
1159
|
+
// for "a" so this is checking that
|
|
1160
|
+
// it's a lowercase character
|
|
1161
|
+
r.charCodeAt(0) > 96 ? dt : pt;
|
|
1162
|
+
}, Je = function(r, t, n) {
|
|
1163
|
+
var a;
|
|
1164
|
+
if (t) {
|
|
1165
|
+
var i = t.shouldForwardProp;
|
|
1166
|
+
a = r.__emotion_forwardProp && i ? function(c) {
|
|
1167
|
+
return r.__emotion_forwardProp(c) && i(c);
|
|
1168
|
+
} : i;
|
|
1169
|
+
}
|
|
1170
|
+
return typeof a != "function" && n && (a = r.__emotion_forwardProp), a;
|
|
1171
|
+
}, ht = function(r) {
|
|
1172
|
+
var t = r.cache, n = r.serialized, a = r.isStringTag;
|
|
1173
|
+
return ur(t, n, a), st(function() {
|
|
1174
|
+
return Zr(t, n, a);
|
|
1175
|
+
}), null;
|
|
1176
|
+
}, mt = function e(r, t) {
|
|
1177
|
+
var n = r.__emotion_real === r, a = n && r.__emotion_base || r, i, c;
|
|
1178
|
+
t !== void 0 && (i = t.label, c = t.target);
|
|
1179
|
+
var s = Je(r, t, n), f = s || Ke(a), h = !f("as");
|
|
1180
|
+
return function() {
|
|
1181
|
+
var l = arguments, u = n && r.__emotion_styles !== void 0 ? r.__emotion_styles.slice(0) : [];
|
|
1182
|
+
if (i !== void 0 && u.push("label:" + i + ";"), l[0] == null || l[0].raw === void 0)
|
|
1183
|
+
u.push.apply(u, l);
|
|
1184
|
+
else {
|
|
1185
|
+
var m = l[0];
|
|
1186
|
+
u.push(m[0]);
|
|
1187
|
+
for (var w = l.length, x = 1; x < w; x++)
|
|
1188
|
+
u.push(l[x], m[x]);
|
|
1189
|
+
}
|
|
1190
|
+
var p = ct(function(y, b, v) {
|
|
1191
|
+
var S = h && y.as || a, C = "", E = [], T = y;
|
|
1192
|
+
if (y.theme == null) {
|
|
1193
|
+
T = {};
|
|
1194
|
+
for (var d in y)
|
|
1195
|
+
T[d] = y[d];
|
|
1196
|
+
T.theme = G.useContext(lt);
|
|
1197
|
+
}
|
|
1198
|
+
typeof y.className == "string" ? C = Jr(b.registered, E, y.className) : y.className != null && (C = y.className + " ");
|
|
1199
|
+
var A = at(u.concat(E), b.registered, T);
|
|
1200
|
+
C += b.key + "-" + A.name, c !== void 0 && (C += " " + c);
|
|
1201
|
+
var L = h && s === void 0 ? Ke(S) : f, I = {};
|
|
1202
|
+
for (var M in y)
|
|
1203
|
+
h && M === "as" || L(M) && (I[M] = y[M]);
|
|
1204
|
+
return I.className = C, v && (I.ref = v), /* @__PURE__ */ G.createElement(G.Fragment, null, /* @__PURE__ */ G.createElement(ht, {
|
|
1205
|
+
cache: b,
|
|
1206
|
+
serialized: A,
|
|
1207
|
+
isStringTag: typeof S == "string"
|
|
1208
|
+
}), /* @__PURE__ */ G.createElement(S, I));
|
|
1209
|
+
});
|
|
1210
|
+
return p.displayName = i !== void 0 ? i : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", p.defaultProps = r.defaultProps, p.__emotion_real = p, p.__emotion_base = a, p.__emotion_styles = u, p.__emotion_forwardProp = s, Object.defineProperty(p, "toString", {
|
|
1211
|
+
value: function() {
|
|
1212
|
+
return "." + c;
|
|
1213
|
+
}
|
|
1214
|
+
}), p.withComponent = function(y, b) {
|
|
1215
|
+
var v = e(y, _e({}, t, b, {
|
|
1216
|
+
shouldForwardProp: Je(p, b, !0)
|
|
1217
|
+
}));
|
|
1218
|
+
return v.apply(void 0, u);
|
|
1219
|
+
}, p;
|
|
1220
|
+
};
|
|
1221
|
+
}, yt = [
|
|
1222
|
+
"a",
|
|
1223
|
+
"abbr",
|
|
1224
|
+
"address",
|
|
1225
|
+
"area",
|
|
1226
|
+
"article",
|
|
1227
|
+
"aside",
|
|
1228
|
+
"audio",
|
|
1229
|
+
"b",
|
|
1230
|
+
"base",
|
|
1231
|
+
"bdi",
|
|
1232
|
+
"bdo",
|
|
1233
|
+
"big",
|
|
1234
|
+
"blockquote",
|
|
1235
|
+
"body",
|
|
1236
|
+
"br",
|
|
1237
|
+
"button",
|
|
1238
|
+
"canvas",
|
|
1239
|
+
"caption",
|
|
1240
|
+
"cite",
|
|
1241
|
+
"code",
|
|
1242
|
+
"col",
|
|
1243
|
+
"colgroup",
|
|
1244
|
+
"data",
|
|
1245
|
+
"datalist",
|
|
1246
|
+
"dd",
|
|
1247
|
+
"del",
|
|
1248
|
+
"details",
|
|
1249
|
+
"dfn",
|
|
1250
|
+
"dialog",
|
|
1251
|
+
"div",
|
|
1252
|
+
"dl",
|
|
1253
|
+
"dt",
|
|
1254
|
+
"em",
|
|
1255
|
+
"embed",
|
|
1256
|
+
"fieldset",
|
|
1257
|
+
"figcaption",
|
|
1258
|
+
"figure",
|
|
1259
|
+
"footer",
|
|
1260
|
+
"form",
|
|
1261
|
+
"h1",
|
|
1262
|
+
"h2",
|
|
1263
|
+
"h3",
|
|
1264
|
+
"h4",
|
|
1265
|
+
"h5",
|
|
1266
|
+
"h6",
|
|
1267
|
+
"head",
|
|
1268
|
+
"header",
|
|
1269
|
+
"hgroup",
|
|
1270
|
+
"hr",
|
|
1271
|
+
"html",
|
|
1272
|
+
"i",
|
|
1273
|
+
"iframe",
|
|
1274
|
+
"img",
|
|
1275
|
+
"input",
|
|
1276
|
+
"ins",
|
|
1277
|
+
"kbd",
|
|
1278
|
+
"keygen",
|
|
1279
|
+
"label",
|
|
1280
|
+
"legend",
|
|
1281
|
+
"li",
|
|
1282
|
+
"link",
|
|
1283
|
+
"main",
|
|
1284
|
+
"map",
|
|
1285
|
+
"mark",
|
|
1286
|
+
"marquee",
|
|
1287
|
+
"menu",
|
|
1288
|
+
"menuitem",
|
|
1289
|
+
"meta",
|
|
1290
|
+
"meter",
|
|
1291
|
+
"nav",
|
|
1292
|
+
"noscript",
|
|
1293
|
+
"object",
|
|
1294
|
+
"ol",
|
|
1295
|
+
"optgroup",
|
|
1296
|
+
"option",
|
|
1297
|
+
"output",
|
|
1298
|
+
"p",
|
|
1299
|
+
"param",
|
|
1300
|
+
"picture",
|
|
1301
|
+
"pre",
|
|
1302
|
+
"progress",
|
|
1303
|
+
"q",
|
|
1304
|
+
"rp",
|
|
1305
|
+
"rt",
|
|
1306
|
+
"ruby",
|
|
1307
|
+
"s",
|
|
1308
|
+
"samp",
|
|
1309
|
+
"script",
|
|
1310
|
+
"section",
|
|
1311
|
+
"select",
|
|
1312
|
+
"small",
|
|
1313
|
+
"source",
|
|
1314
|
+
"span",
|
|
1315
|
+
"strong",
|
|
1316
|
+
"style",
|
|
1317
|
+
"sub",
|
|
1318
|
+
"summary",
|
|
1319
|
+
"sup",
|
|
1320
|
+
"table",
|
|
1321
|
+
"tbody",
|
|
1322
|
+
"td",
|
|
1323
|
+
"textarea",
|
|
1324
|
+
"tfoot",
|
|
1325
|
+
"th",
|
|
1326
|
+
"thead",
|
|
1327
|
+
"time",
|
|
1328
|
+
"title",
|
|
1329
|
+
"tr",
|
|
1330
|
+
"track",
|
|
1331
|
+
"u",
|
|
1332
|
+
"ul",
|
|
1333
|
+
"var",
|
|
1334
|
+
"video",
|
|
1335
|
+
"wbr",
|
|
1336
|
+
// SVG
|
|
1337
|
+
"circle",
|
|
1338
|
+
"clipPath",
|
|
1339
|
+
"defs",
|
|
1340
|
+
"ellipse",
|
|
1341
|
+
"foreignObject",
|
|
1342
|
+
"g",
|
|
1343
|
+
"image",
|
|
1344
|
+
"line",
|
|
1345
|
+
"linearGradient",
|
|
1346
|
+
"mask",
|
|
1347
|
+
"path",
|
|
1348
|
+
"pattern",
|
|
1349
|
+
"polygon",
|
|
1350
|
+
"polyline",
|
|
1351
|
+
"radialGradient",
|
|
1352
|
+
"rect",
|
|
1353
|
+
"stop",
|
|
1354
|
+
"svg",
|
|
1355
|
+
"text",
|
|
1356
|
+
"tspan"
|
|
1357
|
+
], re = mt.bind(null);
|
|
1358
|
+
yt.forEach(function(e) {
|
|
1359
|
+
re[e] = re(e);
|
|
1360
|
+
});
|
|
1361
|
+
const gt = re.div`
|
|
1362
|
+
display: flex;
|
|
1363
|
+
align-items: center;
|
|
1364
|
+
justify-content: center;
|
|
1365
|
+
gap: 8px;
|
|
1366
|
+
padding: 12px;
|
|
1367
|
+
border-radius: 4px;
|
|
1368
|
+
text-align: center;
|
|
1369
|
+
font-size: 16px;
|
|
1370
|
+
line-height: 1.5;
|
|
1371
|
+
|
|
1372
|
+
/* Styling based on message type */
|
|
1373
|
+
${({ type: e }) => {
|
|
1374
|
+
switch (e) {
|
|
1375
|
+
case "error":
|
|
1376
|
+
return `
|
|
1377
|
+
color: red;
|
|
1378
|
+
background-color: rgba(255, 0, 0, 0.1);
|
|
1379
|
+
border: 1px solid red;
|
|
1380
|
+
`;
|
|
1381
|
+
case "loading":
|
|
1382
|
+
return `
|
|
1383
|
+
color: #666;
|
|
1384
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
1385
|
+
`;
|
|
1386
|
+
case "success":
|
|
1387
|
+
return `
|
|
1388
|
+
color: green;
|
|
1389
|
+
background-color: rgba(0, 255, 0, 0.1);
|
|
1390
|
+
border: 1px solid green;
|
|
1391
|
+
`;
|
|
1392
|
+
case "warning":
|
|
1393
|
+
return `
|
|
1394
|
+
color: orange;
|
|
1395
|
+
background-color: rgba(255, 165, 0, 0.1);
|
|
1396
|
+
border: 1px solid orange;
|
|
1397
|
+
`;
|
|
1398
|
+
default:
|
|
1399
|
+
return "";
|
|
1400
|
+
}
|
|
1401
|
+
}}
|
|
1402
|
+
`, Oe = ({ type: e, children: r, className: t, icon: n, action: a }) => O.jsxs(gt, { type: e, className: t, children: [n && O.jsx("span", { children: n }), O.jsx("span", { children: r }), a && O.jsx("span", { children: a })] }), Ze = re.div`
|
|
1403
|
+
width: ${({ width: e }) => e || "100%"};
|
|
1404
|
+
height: ${({ height: e }) => e || "100%"};
|
|
1405
|
+
border-radius: 8px;
|
|
1406
|
+
box-shadow: 0 0 0 1px #fff, 0 0 20px 0 rgba(0, 0, 0, 0.25);
|
|
1407
|
+
position: relative;
|
|
1408
|
+
z-index: 1002;
|
|
1409
|
+
|
|
1410
|
+
/* Hide specific elements inside the player */
|
|
1411
|
+
${({ $hiddenClasses: e }) => (e == null ? void 0 : e.length) && e.map((r) => `.${r} { display: none !important; }`).join("")}
|
|
1412
|
+
`, bt = re.div`
|
|
1413
|
+
position: fixed;
|
|
1414
|
+
top: 0;
|
|
1415
|
+
left: 0;
|
|
1416
|
+
width: 100%;
|
|
1417
|
+
height: 100%;
|
|
1418
|
+
background: rgba(0, 0, 0, 0.8);
|
|
1419
|
+
display: flex;
|
|
1420
|
+
justify-content: center;
|
|
1421
|
+
align-items: center;
|
|
1422
|
+
z-index: 1000;
|
|
1423
|
+
pointer-events: auto;
|
|
1424
|
+
`, vt = re.div`
|
|
1425
|
+
position: relative;
|
|
1426
|
+
width: 100%; /* Default for mobile */
|
|
1427
|
+
max-width: 100%;
|
|
1428
|
+
aspect-ratio: 9/16;
|
|
1429
|
+
height: auto;
|
|
1430
|
+
z-index: 1001;
|
|
1431
|
+
|
|
1432
|
+
/* Desktop styles (min-width: 768px) */
|
|
1433
|
+
@media (min-width: 768px) {
|
|
1434
|
+
width: min(70vw, 960px); /* Responsive width for desktop, capped at 960px */
|
|
1435
|
+
}
|
|
1436
|
+
`, xt = (e, r) => `https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${r}`, wt = (e, r) => `https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${r}/videos`, kt = (e) => `https://host.vpplayer.tech/player/${e}/vpplayer.js`, Fe = (e, r) => `vp-player-${e || "default"}-${r || ""}`, Te = /* @__PURE__ */ new Map(), Pt = (e, r) => {
|
|
1437
|
+
const [t, n] = D(!1), [a, i] = D(null);
|
|
1438
|
+
return se(() => {
|
|
1439
|
+
let c = null, s, f = 0;
|
|
1440
|
+
const h = 3;
|
|
1441
|
+
let l;
|
|
1442
|
+
try {
|
|
1443
|
+
l = r || kt(e || "latest");
|
|
1444
|
+
} catch (w) {
|
|
1445
|
+
const x = w instanceof Error ? w.message : String(w);
|
|
1446
|
+
i(`Failed to resolve script URL: ${x}`), n(!1);
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
if (Te.get(l)) {
|
|
1450
|
+
n(!0), i(null);
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
if (document.querySelector(`script[src="${l}"]`)) {
|
|
1454
|
+
Te.set(l, !0), n(!0), i(null);
|
|
1455
|
+
return;
|
|
1456
|
+
}
|
|
1457
|
+
const m = () => {
|
|
1458
|
+
c = document.createElement("script"), c.src = l, c.async = !0, s = window.setTimeout(() => {
|
|
1459
|
+
n(!1), i(`Loading script timed out: ${l}`);
|
|
1460
|
+
}, 1e4), c.onload = () => {
|
|
1461
|
+
clearTimeout(s), Te.set(l, !0), n(!0), i(null);
|
|
1462
|
+
}, c.onerror = () => {
|
|
1463
|
+
clearTimeout(s), f++, f < h ? setTimeout(m, 1e3 * f) : (n(!1), i(`Failed to load VP Player script after ${h} attempts: ${l}`));
|
|
1464
|
+
}, document.body.appendChild(c);
|
|
1465
|
+
};
|
|
1466
|
+
return m(), () => {
|
|
1467
|
+
clearTimeout(s), c && document.body.contains(c) && document.body.removeChild(c);
|
|
1468
|
+
};
|
|
1469
|
+
}, [e, r]), { isLoaded: t, error: a };
|
|
1470
|
+
}, Qe = {}, he = /* @__PURE__ */ new Map(), Et = 7e3, Re = 3, St = ({ projectId: e, videoId: r, playlistId: t, videoUrl: n, apiKey: a }) => {
|
|
1471
|
+
const [i, c] = D(null), [s, f] = D(null), [h, l] = D(!1), [u, m] = D(null), w = a || (typeof Qe < "u" ? Qe.VITE_VP_API_KEY : void 0);
|
|
1472
|
+
return se(() => {
|
|
1473
|
+
const x = r ? `video:${r}` : t ? `playlist:${t}` : null;
|
|
1474
|
+
if (!e || n || !r && !t) {
|
|
1475
|
+
c(n || null), f(null), l(!1), m(null);
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
if (!w) {
|
|
1479
|
+
l(!1), m("No API key provided");
|
|
1480
|
+
return;
|
|
1481
|
+
}
|
|
1482
|
+
if (x && he.has(x)) {
|
|
1483
|
+
const v = he.get(x);
|
|
1484
|
+
c(v.url), f(v.playlist), l(!1), m(null);
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
const p = new AbortController(), y = p.signal;
|
|
1488
|
+
return (async () => {
|
|
1489
|
+
var S, C;
|
|
1490
|
+
l(!0), m(null);
|
|
1491
|
+
let v = 0;
|
|
1492
|
+
for (; v < Re; )
|
|
1493
|
+
try {
|
|
1494
|
+
const E = r && !t ? xt(e, r) : wt(e, t), T = setTimeout(() => p.abort(), Et), d = await fetch(E, {
|
|
1495
|
+
method: "GET",
|
|
1496
|
+
headers: { "api-key": w, Accept: "application/json" },
|
|
1497
|
+
signal: y
|
|
1498
|
+
});
|
|
1499
|
+
if (clearTimeout(T), !d.ok)
|
|
1500
|
+
throw new Error(`Fetch failed with status ${d.status}`);
|
|
1501
|
+
const A = await d.json();
|
|
1502
|
+
if (r && !t) {
|
|
1503
|
+
const L = (C = (S = A.result) == null ? void 0 : S.items) == null ? void 0 : C.find((I) => I.mediaId === r);
|
|
1504
|
+
if (!(L != null && L.playbackUrl))
|
|
1505
|
+
throw new Error("Invalid video data");
|
|
1506
|
+
c(L.playbackUrl), f(null), x && he.set(x, { url: L.playbackUrl, playlist: null });
|
|
1507
|
+
} else {
|
|
1508
|
+
if (!Array.isArray(A.result))
|
|
1509
|
+
throw new Error("Invalid playlist format");
|
|
1510
|
+
f(A.result), c(null), x && he.set(x, { url: null, playlist: A.result });
|
|
1511
|
+
}
|
|
1512
|
+
break;
|
|
1513
|
+
} catch (E) {
|
|
1514
|
+
if (y.aborted) {
|
|
1515
|
+
m("Request timed out");
|
|
1516
|
+
break;
|
|
1517
|
+
}
|
|
1518
|
+
if (v++, v >= Re) {
|
|
1519
|
+
const T = E instanceof Error ? E.message : String(E);
|
|
1520
|
+
m(`Failed after ${Re} attempts: ${T}`);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
l(!1);
|
|
1524
|
+
})(), () => {
|
|
1525
|
+
p.abort();
|
|
1526
|
+
};
|
|
1527
|
+
}, [w, e, r, t, n]), { fetchedPlaybackUrl: i, fetchedPlaylist: s, isLoading: h, error: u };
|
|
1528
|
+
}, Tt = {
|
|
1529
|
+
projectId: "vp-player-projectId",
|
|
1530
|
+
video: {
|
|
1531
|
+
file: "",
|
|
1532
|
+
// Will be set dynamically if no playlist
|
|
1533
|
+
playlist: {
|
|
1534
|
+
state: !0,
|
|
1535
|
+
// Enable playlist by default
|
|
1536
|
+
playlistVideoIndex: 0,
|
|
1537
|
+
// Start with the first video
|
|
1538
|
+
videos: []
|
|
1539
|
+
// Empty by default, populated via props
|
|
1540
|
+
}
|
|
1541
|
+
},
|
|
1542
|
+
config: {
|
|
1543
|
+
autoplay: !0,
|
|
1544
|
+
// Start playing automatically
|
|
1545
|
+
muted: !0,
|
|
1546
|
+
// Start muted
|
|
1547
|
+
loop: !1,
|
|
1548
|
+
// No loop by default
|
|
1549
|
+
size: {
|
|
1550
|
+
width: "100%",
|
|
1551
|
+
// Width
|
|
1552
|
+
height: "30vh"
|
|
1553
|
+
// Height
|
|
1554
|
+
},
|
|
1555
|
+
controls: {
|
|
1556
|
+
settingsButton: !0,
|
|
1557
|
+
// Settings button
|
|
1558
|
+
chromecastButton: !1,
|
|
1559
|
+
// Chromecast button, false by default
|
|
1560
|
+
nextButton: !0,
|
|
1561
|
+
// False by default (single video, no playlist)
|
|
1562
|
+
fullscreenButton: !0,
|
|
1563
|
+
// Fullscreen option
|
|
1564
|
+
airplayButton: !1,
|
|
1565
|
+
// False by default
|
|
1566
|
+
bigPlayButton: !1,
|
|
1567
|
+
// False by default
|
|
1568
|
+
autopausePlayButton: !0,
|
|
1569
|
+
// Basic play/pause control enabled
|
|
1570
|
+
pictureInPictureButton: !1,
|
|
1571
|
+
// False by default
|
|
1572
|
+
relatedButton: !1,
|
|
1573
|
+
// False by default (single video)
|
|
1574
|
+
volumeButton: !0,
|
|
1575
|
+
// Volume control
|
|
1576
|
+
shareButton: !0
|
|
1577
|
+
// Enabled by default
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}, Rt = ({ videoUrl: e, fetchedPlaybackUrl: r, fetchedPlaylist: t, projectId: n, config: a = {} }) => {
|
|
1581
|
+
var h, l, u;
|
|
1582
|
+
const i = { ...Tt, ...a }, c = { ...i.config, ...a.config };
|
|
1583
|
+
if (e)
|
|
1584
|
+
return {
|
|
1585
|
+
...i,
|
|
1586
|
+
video: {
|
|
1587
|
+
...i.video,
|
|
1588
|
+
file: e,
|
|
1589
|
+
playlist: void 0
|
|
1590
|
+
},
|
|
1591
|
+
config: c
|
|
1592
|
+
};
|
|
1593
|
+
if (r)
|
|
1594
|
+
return {
|
|
1595
|
+
...i,
|
|
1596
|
+
video: {
|
|
1597
|
+
...i.video,
|
|
1598
|
+
file: r,
|
|
1599
|
+
playlist: void 0
|
|
1600
|
+
},
|
|
1601
|
+
config: c
|
|
1602
|
+
};
|
|
1603
|
+
if (t && t.length > 0)
|
|
1604
|
+
return {
|
|
1605
|
+
...i,
|
|
1606
|
+
projectId: n || "vp-player-projectId",
|
|
1607
|
+
video: {
|
|
1608
|
+
...i.video,
|
|
1609
|
+
file: ((h = t[0]) == null ? void 0 : h.hlsUrl) || "",
|
|
1610
|
+
playlist: {
|
|
1611
|
+
state: !0,
|
|
1612
|
+
playlistVideoIndex: 0,
|
|
1613
|
+
videos: t.map((m, w) => ({
|
|
1614
|
+
videoId: String(w),
|
|
1615
|
+
title: m.title,
|
|
1616
|
+
file: m.hlsUrl,
|
|
1617
|
+
thumbnailUrl: m.thumbnailUrl,
|
|
1618
|
+
duration: m.duration
|
|
1619
|
+
}))
|
|
1620
|
+
}
|
|
1621
|
+
},
|
|
1622
|
+
config: c
|
|
1623
|
+
};
|
|
1624
|
+
const s = ((l = a == null ? void 0 : a.video) == null ? void 0 : l.playlist) || i.video.playlist, f = (u = a == null ? void 0 : a.video) == null ? void 0 : u.file;
|
|
1625
|
+
if (f)
|
|
1626
|
+
return {
|
|
1627
|
+
...i,
|
|
1628
|
+
video: {
|
|
1629
|
+
...i.video,
|
|
1630
|
+
file: f,
|
|
1631
|
+
playlist: void 0
|
|
1632
|
+
// No playlist, just one video
|
|
1633
|
+
},
|
|
1634
|
+
config: c
|
|
1635
|
+
};
|
|
1636
|
+
if (s != null && s.videos && s.videos.length > 0) {
|
|
1637
|
+
const m = s.videos[s.playlistVideoIndex || 0];
|
|
1638
|
+
return {
|
|
1639
|
+
...i,
|
|
1640
|
+
video: {
|
|
1641
|
+
...i.video,
|
|
1642
|
+
file: (m == null ? void 0 : m.file) || "",
|
|
1643
|
+
playlist: {
|
|
1644
|
+
...s,
|
|
1645
|
+
state: s.state ?? !0,
|
|
1646
|
+
playlistVideoIndex: s.playlistVideoIndex ?? 0,
|
|
1647
|
+
videos: s.videos
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1650
|
+
config: {
|
|
1651
|
+
...i.config,
|
|
1652
|
+
...a == null ? void 0 : a.config
|
|
1653
|
+
}
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
throw new Error("No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist.");
|
|
1657
|
+
}, _t = (e) => {
|
|
1658
|
+
if (!e)
|
|
1659
|
+
return;
|
|
1660
|
+
const r = /https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/, t = e.match(r);
|
|
1661
|
+
return t ? t[2] : void 0;
|
|
1662
|
+
}, Ct = ({ playerId: e, videoId: r, version: t, videoUrl: n, projectId: a, playlistId: i, scriptUrl: c, config: s = {}, apiKey: f, isReels: h = !1 }) => {
|
|
1663
|
+
const l = Ve(null), u = Ve(null), { isLoaded: m, error: w } = Pt(t, c), x = r || _t(c), [p, y] = D(null), { fetchedPlaybackUrl: b, fetchedPlaylist: v, isLoading: S, error: C } = St({
|
|
1664
|
+
projectId: a,
|
|
1665
|
+
videoId: x,
|
|
1666
|
+
playlistId: i,
|
|
1667
|
+
videoUrl: n,
|
|
1668
|
+
apiKey: f
|
|
1669
|
+
}), E = Fe(e, x), T = rr(() => {
|
|
1670
|
+
var d;
|
|
1671
|
+
return {
|
|
1672
|
+
...s,
|
|
1673
|
+
config: {
|
|
1674
|
+
...s.config,
|
|
1675
|
+
autostartOnLoad: { state: h, onMobile: !0, onData: !0 },
|
|
1676
|
+
muted: !1,
|
|
1677
|
+
size: h ? { sizeType: "RESPONSIVE", aspectRatio: "9:16" } : ((d = s.config) == null ? void 0 : d.size) || { sizeType: "FIXED", width: "100%" },
|
|
1678
|
+
controls: {
|
|
1679
|
+
settingsButton: !0,
|
|
1680
|
+
chromecastButton: !1,
|
|
1681
|
+
nextButton: !0,
|
|
1682
|
+
fullscreenButton: !0,
|
|
1683
|
+
airplayButton: !0,
|
|
1684
|
+
bigPlayButton: !0,
|
|
1685
|
+
autopausePlayButton: !0,
|
|
1686
|
+
pictureInPictureButton: !0,
|
|
1687
|
+
relatedButton: !1,
|
|
1688
|
+
volumeButton: !0,
|
|
1689
|
+
shareButton: !0
|
|
1690
|
+
},
|
|
1691
|
+
socialMedia: ["FACEBOOK", "LINKEDIN", "REDDIT", "TWITTER", "PINTEREST"],
|
|
1692
|
+
skin: {
|
|
1693
|
+
controlBar: {
|
|
1694
|
+
background: "rgba(0, 0, 0, 0.3)",
|
|
1695
|
+
text: "#FFFFFF",
|
|
1696
|
+
icons: { default: "#FFFFFF", hover: "#CC0000" },
|
|
1697
|
+
timeslider: {
|
|
1698
|
+
progress: "#CC0000",
|
|
1699
|
+
rail: "#808080",
|
|
1700
|
+
buffer: "#E2E2E2",
|
|
1701
|
+
dragger: "#CC0000"
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
settings: {
|
|
1706
|
+
quality: "Quality",
|
|
1707
|
+
subtitles: "Subtitles",
|
|
1708
|
+
autoplay: "Autoplay",
|
|
1709
|
+
playbackRate: "Speed",
|
|
1710
|
+
auto: "Auto",
|
|
1711
|
+
off: "Off",
|
|
1712
|
+
normal: "Normal",
|
|
1713
|
+
share: "Share Video"
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
}, [s, h]);
|
|
1718
|
+
return se(() => {
|
|
1719
|
+
if (w) {
|
|
1720
|
+
y(w);
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1723
|
+
}, [w]), se(() => {
|
|
1724
|
+
if (!m || !l.current || S && !n)
|
|
1725
|
+
return;
|
|
1726
|
+
let d = !0;
|
|
1727
|
+
const L = setTimeout(async () => {
|
|
1728
|
+
try {
|
|
1729
|
+
if (window.vpPlayer && document.querySelectorAll('[id*="player"]').forEach((X) => {
|
|
1730
|
+
const ne = X.id;
|
|
1731
|
+
try {
|
|
1732
|
+
const K = window.vpPlayer(ne);
|
|
1733
|
+
K && K.destroy && K.destroy();
|
|
1734
|
+
} catch (K) {
|
|
1735
|
+
console.warn(`Failed to destroy existing player ${ne}:`, K);
|
|
1736
|
+
}
|
|
1737
|
+
}), await new Promise((B) => setTimeout(B, 100)), !d || !l.current)
|
|
1738
|
+
return;
|
|
1739
|
+
if (!document.getElementById(E)) {
|
|
1740
|
+
y("DOM element not found after cleanup.");
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1743
|
+
if (!window.vpPlayer) {
|
|
1744
|
+
y("VP Player script not loaded.");
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
const M = Rt({
|
|
1748
|
+
videoUrl: n,
|
|
1749
|
+
fetchedPlaybackUrl: b,
|
|
1750
|
+
fetchedPlaylist: v,
|
|
1751
|
+
projectId: a,
|
|
1752
|
+
config: T
|
|
1753
|
+
}), H = window.vpPlayer(E);
|
|
1754
|
+
if (!H) {
|
|
1755
|
+
y("Failed to create VP Player instance.");
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
d && l.current && (H.setup(M), u.current = H, y(null));
|
|
1759
|
+
} catch (I) {
|
|
1760
|
+
if (d) {
|
|
1761
|
+
const M = I instanceof Error ? I.message : String(I);
|
|
1762
|
+
y(M), console.error("VP Player initialization error:", I);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
}, 150);
|
|
1766
|
+
return () => {
|
|
1767
|
+
d = !1, clearTimeout(L);
|
|
1768
|
+
};
|
|
1769
|
+
}, [
|
|
1770
|
+
m,
|
|
1771
|
+
S,
|
|
1772
|
+
n,
|
|
1773
|
+
b,
|
|
1774
|
+
v,
|
|
1775
|
+
a,
|
|
1776
|
+
T,
|
|
1777
|
+
E
|
|
1778
|
+
]), se(() => () => {
|
|
1779
|
+
if (u.current) {
|
|
1780
|
+
try {
|
|
1781
|
+
u.current.destroy && u.current.destroy();
|
|
1782
|
+
} catch (A) {
|
|
1783
|
+
console.warn(`Failed to destroy player ${E}:`, A);
|
|
1784
|
+
}
|
|
1785
|
+
u.current = null;
|
|
1786
|
+
}
|
|
1787
|
+
const d = document.getElementById(E);
|
|
1788
|
+
d && (d.innerHTML = "");
|
|
1789
|
+
}, [E]), {
|
|
1790
|
+
playerRef: l,
|
|
1791
|
+
playerInstanceRef: u,
|
|
1792
|
+
isScriptLoaded: m,
|
|
1793
|
+
isLoading: S,
|
|
1794
|
+
error: C || p || w
|
|
1795
|
+
};
|
|
1796
|
+
}, At = ({ playerId: e, videoId: r, version: t, videoUrl: n, projectId: a, playlistId: i, scriptUrl: c, config: s = {}, apiKey: f, isReels: h = !1, hiddenClasses: l = [], onClose: u, className: m }) => {
|
|
1797
|
+
var L, I, M, H;
|
|
1798
|
+
const { playerRef: w, playerInstanceRef: x, isScriptLoaded: p, isLoading: y, error: b } = Ct({
|
|
1799
|
+
playerId: e,
|
|
1800
|
+
videoId: r,
|
|
1801
|
+
version: t,
|
|
1802
|
+
videoUrl: n,
|
|
1803
|
+
projectId: a,
|
|
1804
|
+
playlistId: i,
|
|
1805
|
+
scriptUrl: c,
|
|
1806
|
+
config: s,
|
|
1807
|
+
apiKey: f,
|
|
1808
|
+
isReels: h
|
|
1809
|
+
}), [v, S] = D(!0), C = () => h && S(!0), E = () => {
|
|
1810
|
+
var B, X;
|
|
1811
|
+
S(!1), (X = (B = x.current) == null ? void 0 : B.play) == null || X.call(B), u == null || u();
|
|
1812
|
+
}, T = (I = (L = s == null ? void 0 : s.config) == null ? void 0 : L.size) != null && I.width ? typeof s.config.size.width == "number" ? `${s.config.size.width}px` : s.config.size.width : void 0, d = (H = (M = s == null ? void 0 : s.config) == null ? void 0 : M.size) != null && H.height ? typeof s.config.size.height == "number" ? `${s.config.size.height}px` : s.config.size.height : void 0, A = Fe(e, r);
|
|
1813
|
+
return b ? O.jsxs(Oe, { type: "error", children: ["An error occurred: ", b] }) : y || !p ? O.jsx(Oe, { type: "loading", children: "Loading..." }) : O.jsxs(O.Fragment, { children: [h && !v ? O.jsx("div", { onClick: C }) : null, !h && O.jsx("div", { children: O.jsx(Ze, { id: A, ref: w, width: T || "100%", height: d || "auto", $hiddenClasses: l, className: m }) }, A), h && v && O.jsx(bt, { onClick: E, className: m, children: O.jsx(vt, { className: m, onClick: (B) => B.stopPropagation(), children: O.jsx("div", { children: O.jsx(Ze, { id: A, ref: w, width: "100%", height: "auto", $hiddenClasses: l, className: m }) }, A) }) })] });
|
|
1814
|
+
}, pr = gr(void 0), It = ({ children: e }) => {
|
|
1815
|
+
const [r, t] = D(!1), [n, a] = D(null), [i, c] = D(null), s = ze((l) => {
|
|
1816
|
+
try {
|
|
1817
|
+
const u = Fe(l.playerId, l.videoId);
|
|
1818
|
+
a({ ...l, playerId: u }), t(!0), c(null);
|
|
1819
|
+
} catch {
|
|
1820
|
+
c("Failed to show player.");
|
|
1821
|
+
}
|
|
1822
|
+
}, []), f = ze(() => {
|
|
1823
|
+
t(!1), a(null), c(null);
|
|
1824
|
+
}, []), h = rr(() => ({
|
|
1825
|
+
showPlayer: s,
|
|
1826
|
+
hidePlayer: f,
|
|
1827
|
+
isPlayerVisible: r,
|
|
1828
|
+
playerParams: n
|
|
1829
|
+
}), [s, f, r, n]);
|
|
1830
|
+
return O.jsxs(pr.Provider, { value: h, children: [e, i && O.jsx(Oe, { type: "error", children: i }), r && (n == null ? void 0 : n.playerId) && O.jsx(At, { playerId: n.playerId, videoId: n.videoId, projectId: n.projectId, videoUrl: n.videoUrl, version: n.version, playlistId: n.playlistId, scriptUrl: n.scriptUrl, config: n.config, isReels: n.isReels, thumbnailUrl: n.thumbnailUrl, onClose: f, hiddenClasses: n.hiddenClasses || [], apiKey: n.apiKey, className: n.className })] });
|
|
1831
|
+
}, $t = () => {
|
|
1832
|
+
const e = er(pr);
|
|
1833
|
+
if (!e)
|
|
1834
|
+
throw new Error("useVPPlayer must be used within a VPPlayerProvider");
|
|
1835
|
+
return e;
|
|
1836
|
+
};
|
|
1837
|
+
export {
|
|
1838
|
+
It as VPPlayerProvider,
|
|
1839
|
+
$t as useVPPlayer
|
|
1840
|
+
};
|