@car-cutter/react-webplayer 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2880 @@
1
+ import { jsx as t, jsxs as A, Fragment as ie } from "react/jsx-runtime";
2
+ import { useState as Z, useEffect as O, createContext as Ce, useContext as Ee, useMemo as re, useCallback as T, useRef as j, Fragment as Mt } from "react";
3
+ const Pe = "cc-webplayer", Ue = "cc-webplayer-custom-media", Ge = "cc-webplayer-icon", Be = "composition-loading", qe = "composition-loaded", Ke = "composition-load-error", Je = "item-change", Qe = "extend-mode-on", et = "extend-mode-off", tt = "hotspots-on", rt = "hotspots-off", nt = "gallery-open", ot = "gallery-close", Nt = !1, Tt = !1, zt = !1, St = "quality", _t = 0, Vt = 1 / 0, Pt = 1, Ht = !1, st = "cc-webplayer:", Dt = !1;
4
+ function $r(e, r) {
5
+ return `https://cdn.car-cutter.com/gallery/${e}/${r}/composition_v3.json`;
6
+ }
7
+ function Rt(e, r) {
8
+ const n = e.split("/"), o = n.pop();
9
+ return [n.join("/"), r, o].join("/");
10
+ }
11
+ function Ur() {
12
+ return !!customElements.get(Pe) && !!customElements.get(Ue) && !!customElements.get(Ge);
13
+ }
14
+ async function At(e) {
15
+ const r = await fetch(e);
16
+ if (!r.ok)
17
+ throw new Error(`Failed to fetch composition: ${r.statusText}`);
18
+ return await r.json();
19
+ }
20
+ const Se = /* @__PURE__ */ new Map(), Wt = (e) => {
21
+ const [r, n] = Z({
22
+ status: "pending",
23
+ isSuccess: !1
24
+ });
25
+ return O(() => {
26
+ const o = (l) => n({ status: "success", data: l, isSuccess: !0 }), i = Se.get(e);
27
+ if (i && !(i instanceof Promise)) {
28
+ o(i);
29
+ return;
30
+ }
31
+ n({
32
+ status: "fetching",
33
+ isSuccess: !1
34
+ }), async function() {
35
+ try {
36
+ let l;
37
+ if (i)
38
+ l = await i;
39
+ else {
40
+ const p = At(e);
41
+ Se.set(e, p), l = await p, Se.set(e, l);
42
+ }
43
+ o(l);
44
+ } catch (l) {
45
+ n({
46
+ status: "error",
47
+ isSuccess: !1,
48
+ error: l
49
+ });
50
+ }
51
+ }();
52
+ }, [e]), r;
53
+ }, at = Ce(null), ne = () => {
54
+ const e = Ee(at);
55
+ if (!e)
56
+ throw new Error(
57
+ "useGlobalContext must be used within a GlobalContextProvider"
58
+ );
59
+ return e;
60
+ }, Ot = ({ children: e, ...r }) => /* @__PURE__ */ t(at.Provider, { value: r, children: e }), it = Ce(null), se = () => {
61
+ const e = Ee(it);
62
+ if (!e)
63
+ throw new Error(
64
+ "useCompositionContext must be used within a CompositionContextProvider"
65
+ );
66
+ return e;
67
+ }, Xt = ({ composition: e, children: r }) => {
68
+ const {
69
+ aspectRatio: n,
70
+ categories: o,
71
+ imageHdWidth: i,
72
+ imageSubWidths: l
73
+ } = e, { minMediaWidth: p, maxMediaWidth: m } = ne(), L = re(
74
+ () => o.flatMap(({ items: C }) => C),
75
+ [o]
76
+ ), I = {
77
+ aspectRatio: n.replace(":", " / ")
78
+ }, f = re(() => {
79
+ const C = l.concat(i), V = C.sort((a, d) => a - d), z = V.filter(
80
+ (a) => a >= p && a <= m
81
+ );
82
+ if (z.length === 0) {
83
+ const a = (p + m) / 2, d = C.reduce(
84
+ (g, x) => Math.abs(x - a) < Math.abs(g - a) ? x : g,
85
+ i
86
+ );
87
+ return console.warn(
88
+ `None of available media widths (${V.join("|")}) match the given constraints (${p > 0 ? `${p} ≤ ` : ""}width${m < 1 / 0 ? ` ≤ ${m}` : ""}).`,
89
+ `Using the closest width instead (${d}).`
90
+ ), [d];
91
+ }
92
+ return z;
93
+ }, [l, i, p, m]);
94
+ return /* @__PURE__ */ t(
95
+ it.Provider,
96
+ {
97
+ value: {
98
+ ...e,
99
+ items: L,
100
+ aspectRatioStyle: I,
101
+ usedMediaWidths: f
102
+ },
103
+ children: r
104
+ }
105
+ );
106
+ }, ct = 500, Ve = 0.75, xe = 1 + Ve * 2;
107
+ function ce(e, r, n) {
108
+ return Math.min(Math.max(e, r), n);
109
+ }
110
+ const ye = (e, r, n) => e + (r - e) * n, Xe = (e, r) => (e % r + r) % r, lt = Ce(null), He = () => Ee(lt), ve = () => {
111
+ const e = He();
112
+ if (!e)
113
+ throw new Error(
114
+ "useCustomizationContext must be used within a CustomizationContextProvider"
115
+ );
116
+ return e;
117
+ }, Ze = "*:size-full", Ye = "*:object-cover *:size-full", Zt = ({ children: e }) => {
118
+ const { compositionUrl: r } = ne(), n = T(
119
+ () => document.querySelector(
120
+ `${Pe}[composition-url="${r}"]`
121
+ ),
122
+ [r]
123
+ ), o = T((a) => {
124
+ const d = a.querySelectorAll(Ge), g = /* @__PURE__ */ new Map();
125
+ for (const x of d) {
126
+ const w = x.getAttribute("name");
127
+ if (!w) {
128
+ console.warn("Icon element is missing a name attribute");
129
+ continue;
130
+ }
131
+ const u = x.innerHTML, c = u ? /* @__PURE__ */ t(
132
+ "div",
133
+ {
134
+ className: Ze,
135
+ dangerouslySetInnerHTML: { __html: u }
136
+ }
137
+ ) : void 0;
138
+ if (!c) {
139
+ console.warn(`Icon "${w}" customization is empty.`);
140
+ continue;
141
+ }
142
+ g.set(w, { Icon: c });
143
+ }
144
+ return g;
145
+ }, []), [i, l] = Z(
146
+ () => {
147
+ const a = n();
148
+ return a ? o(a) : /* @__PURE__ */ new Map();
149
+ }
150
+ );
151
+ O(() => {
152
+ const a = n();
153
+ if (!a)
154
+ return;
155
+ const d = new MutationObserver(() => {
156
+ l(o(a));
157
+ });
158
+ return d.observe(a, {
159
+ childList: !0,
160
+ subtree: !0
161
+ }), () => d.disconnect();
162
+ }, [o, n]);
163
+ const p = T(
164
+ (a) => i.get(a),
165
+ [i]
166
+ ), m = T(
167
+ (a, d) => {
168
+ l((g) => {
169
+ const { Icon: x, ...w } = d;
170
+ return new Map(
171
+ g.set(a, {
172
+ ...w,
173
+ Icon: /* @__PURE__ */ t("div", { className: Ze, children: x })
174
+ })
175
+ );
176
+ });
177
+ },
178
+ []
179
+ ), L = T((a) => {
180
+ l((d) => (d.delete(a), new Map(d)));
181
+ }, []), I = T((a) => {
182
+ const d = a.querySelectorAll(
183
+ Ue
184
+ ), g = new Array();
185
+ for (const x of d) {
186
+ const w = x.innerHTML;
187
+ if (!w) {
188
+ console.warn("Custom media element is empty");
189
+ continue;
190
+ }
191
+ const u = Number(x.getAttribute("index"));
192
+ if (Number.isNaN(u)) {
193
+ console.warn("Custom media element is missing the 'index' attribute");
194
+ continue;
195
+ }
196
+ const c = x.getAttribute("thumbnail-src") ?? void 0, h = JSON.stringify({ index: u, thumbnailSrc: c });
197
+ g.push({
198
+ id: h,
199
+ Media: /* @__PURE__ */ t(
200
+ "div",
201
+ {
202
+ className: Ye,
203
+ dangerouslySetInnerHTML: { __html: w }
204
+ }
205
+ ),
206
+ index: u,
207
+ thumbnailSrc: c
208
+ });
209
+ }
210
+ return g;
211
+ }, []), [f, C] = Z(() => {
212
+ const a = n();
213
+ return a ? I(a) : [];
214
+ });
215
+ O(() => {
216
+ const a = n();
217
+ if (!a)
218
+ return;
219
+ const d = new MutationObserver(() => {
220
+ C(I(a));
221
+ });
222
+ return d.observe(a, {
223
+ childList: !0,
224
+ subtree: !0
225
+ }), () => d.disconnect();
226
+ }, [I, n]);
227
+ const V = T((a) => {
228
+ const { Media: d, ...g } = a, x = /* @__PURE__ */ t("div", { className: Ye, children: d }), w = JSON.stringify(g);
229
+ return C((u) => [
230
+ ...u,
231
+ {
232
+ id: w,
233
+ Media: x,
234
+ ...g
235
+ }
236
+ ]), w;
237
+ }, []), z = T((a) => {
238
+ C(
239
+ (d) => d.filter((g) => g.id !== a)
240
+ );
241
+ }, []);
242
+ return /* @__PURE__ */ t(
243
+ lt.Provider,
244
+ {
245
+ value: {
246
+ getIconConfig: p,
247
+ registerIconConfig: m,
248
+ unregisterIconConfig: L,
249
+ customMediaList: f,
250
+ registerCustomMedia: V,
251
+ unregisterCustomMedia: z
252
+ },
253
+ children: e
254
+ }
255
+ );
256
+ }, ut = Ce(null), Q = () => {
257
+ const e = Ee(ut);
258
+ if (!e)
259
+ throw new Error(
260
+ "useControlsContext must be used within a ControlsContextProvider"
261
+ );
262
+ return e;
263
+ }, Yt = ({
264
+ children: e
265
+ }) => {
266
+ const {
267
+ infiniteCarrousel: r,
268
+ preventFullScreen: n,
269
+ emitEvent: o,
270
+ isFullScreen: i,
271
+ requestFullscreen: l,
272
+ exitFullscreen: p
273
+ } = ne(), { customMediaList: m } = ve(), { categories: L, items: I } = se(), f = re(() => {
274
+ const W = new Array(
275
+ ...I
276
+ ), q = m.slice().sort((G, K) => G.index < 0 && K.index < 0 ? K.index - G.index : G.index < 0 ? 1 : K.index < 0 ? -1 : G.index - K.index);
277
+ for (const G of q) {
278
+ let K = G.index;
279
+ K < 0 && (K = W.length + K + 1), W.splice(K, 0, {
280
+ type: "custom",
281
+ ...G
282
+ });
283
+ }
284
+ return W;
285
+ }, [I, m]), [C, V] = Z(f.map(() => null));
286
+ O(() => {
287
+ V(f.map(() => null));
288
+ }, [f]);
289
+ const z = T(
290
+ (W, q) => {
291
+ V(
292
+ (G) => G.map((K, ze) => ze === W ? q : K)
293
+ );
294
+ },
295
+ []
296
+ ), [a, d] = Z(0), [g, x] = Z(null), w = g ?? a, u = f[w], c = C[w], [h, b] = Z(
297
+ null
298
+ ), k = !!h, X = T(() => b(null), []), P = T(() => {
299
+ if (k || g !== null)
300
+ return;
301
+ const W = a - 1;
302
+ W >= 0 ? x(W) : r && (b("first_to_last"), x(f.length - 1));
303
+ }, [
304
+ k,
305
+ g,
306
+ a,
307
+ r,
308
+ f.length
309
+ ]), y = T(() => {
310
+ if (k || g !== null)
311
+ return;
312
+ const W = a + 1;
313
+ W < f.length ? x(W) : r && (b("last_to_first"), x(0));
314
+ }, [
315
+ k,
316
+ g,
317
+ a,
318
+ f.length,
319
+ r
320
+ ]), N = T(
321
+ (W) => {
322
+ const q = Math.min(a, W), G = Math.max(a, W);
323
+ C.slice(q, G + 1).filter((ze) => ze === null).length > 2 && b("instant"), x(W);
324
+ },
325
+ [a, C]
326
+ );
327
+ O(() => {
328
+ o(Je, {
329
+ index: w,
330
+ item: u
331
+ });
332
+ }, [u, o, w]);
333
+ const S = re(() => {
334
+ let W;
335
+ if (u.type === "custom") {
336
+ const q = f.slice(0, w).reverse().find((G) => G.type !== "custom") ?? f.slice(w + 1).find((G) => G.type !== "custom");
337
+ if (!q)
338
+ throw new Error("No non-custom item found");
339
+ W = q;
340
+ } else
341
+ W = u;
342
+ for (const q of L)
343
+ if (q.items.includes(W))
344
+ return q.id;
345
+ throw new Error("Current item not found in any category");
346
+ }, [L, u, f, w]), _ = T(
347
+ (W) => {
348
+ const q = L.find(({ id: K }) => K === W)?.items[0];
349
+ if (q === void 0)
350
+ throw new Error("Failed to find target category");
351
+ const G = f.findIndex((K) => K === q);
352
+ N(G);
353
+ },
354
+ [L, f, N]
355
+ ), R = re(() => {
356
+ switch (u.type) {
357
+ case "image":
358
+ return !!u.hotspots?.length;
359
+ case "360":
360
+ return c === "running";
361
+ default:
362
+ return !1;
363
+ }
364
+ }, [u, c]), [v, s] = Z(!0), E = T(() => {
365
+ const W = !v;
366
+ s(W), o(W ? tt : rt);
367
+ }, [o, v]), M = re(() => {
368
+ switch (u.type) {
369
+ case "video":
370
+ return c !== "running";
371
+ default:
372
+ return !0;
373
+ }
374
+ }, [u, c]), [D, Y] = Z(!1), F = T(() => {
375
+ const W = !D;
376
+ Y(W), o(W ? nt : ot);
377
+ }, [o, D]), [$, U] = Z(null), J = T(() => U(null), []), ee = !!$, le = re(() => {
378
+ switch (u.type) {
379
+ case "image":
380
+ return !0;
381
+ case "360":
382
+ return c === "running";
383
+ default:
384
+ return !1;
385
+ }
386
+ }, [u.type, c]), [oe, ae] = Z(1), Ae = oe !== 1, be = oe < xe, ke = oe > 1, ue = T((W) => {
387
+ ae((q) => ce(q + W, 1, xe));
388
+ }, []), ge = T(() => ae(1), []), Et = T(() => ue(Ve), [ue]), kt = T(() => ue(-Ve), [ue]), Le = T(() => {
389
+ ge(), J();
390
+ }, [ge, J]), [de, Lt] = Z(!1), [Ie, We] = Z(), [Me, Oe] = Z(!1), me = T(
391
+ async (W) => {
392
+ Le(), Lt(W), o(W ? Qe : et);
393
+ },
394
+ [o, Le]
395
+ ), pe = T(() => {
396
+ clearTimeout(Ie);
397
+ const W = setTimeout(() => {
398
+ We(void 0);
399
+ }, ct);
400
+ We(W);
401
+ }, [Ie]), Ne = T(async () => {
402
+ if (pe(), !n) {
403
+ const W = await l();
404
+ if (Oe(!W), W)
405
+ return;
406
+ }
407
+ me(!0);
408
+ }, [
409
+ n,
410
+ me,
411
+ l,
412
+ pe
413
+ ]), Te = T(async () => {
414
+ pe(), !(!n && (Oe(!1), await p())) && me(!1);
415
+ }, [
416
+ n,
417
+ me,
418
+ p,
419
+ pe
420
+ ]), It = T(() => {
421
+ de ? Te() : Ne();
422
+ }, [Te, Ne, de]);
423
+ return O(() => {
424
+ n || Me && de || i !== de && (pe(), me(i));
425
+ }, [
426
+ n,
427
+ me,
428
+ de,
429
+ Me,
430
+ i,
431
+ pe
432
+ ]), /* @__PURE__ */ t(
433
+ ut.Provider,
434
+ {
435
+ value: {
436
+ items: f,
437
+ setItemInteraction: z,
438
+ slidable: f.length > 1,
439
+ carrouselItemIndex: a,
440
+ setCarrouselItemIndex: d,
441
+ itemIndexCommand: g,
442
+ setItemIndexCommand: x,
443
+ masterItemIndex: w,
444
+ specialCommand: h,
445
+ isRunningSpecialCommand: k,
446
+ finishSpecialCommand: X,
447
+ prevItem: P,
448
+ nextItem: y,
449
+ scrollToItemIndex: N,
450
+ displayedCategoryId: S,
451
+ changeCategory: _,
452
+ enableHotspotsControl: R,
453
+ showHotspots: v,
454
+ toggleHotspots: E,
455
+ showGalleryControls: M,
456
+ showGallery: D,
457
+ toggleGallery: F,
458
+ shownDetails: $,
459
+ isShowingDetails: ee,
460
+ setShownDetails: U,
461
+ resetShownDetails: J,
462
+ showZoomControls: le,
463
+ zoom: oe,
464
+ isZooming: Ae,
465
+ setZoom: ae,
466
+ resetZoom: ge,
467
+ canZoomIn: be,
468
+ zoomIn: Et,
469
+ canZoomOut: ke,
470
+ zoomOut: kt,
471
+ resetView: Le,
472
+ extendMode: de,
473
+ enableExtendMode: Ne,
474
+ disableExtendMode: Te,
475
+ toggleExtendMode: It,
476
+ extendTransition: !!Ie,
477
+ fakeFullScreen: Me
478
+ },
479
+ children: e
480
+ }
481
+ );
482
+ }, dt = ["left", "center", "right", "fullW"], mt = ["top", "middle", "bottom", "fullH"], Ft = [
483
+ ...dt,
484
+ ...mt,
485
+ "top-left",
486
+ "top-center",
487
+ "top-right",
488
+ "top-fullW",
489
+ "middle-left",
490
+ "middle-center",
491
+ "middle-right",
492
+ "middle-fullW",
493
+ "bottom-left",
494
+ "bottom-center",
495
+ "bottom-right",
496
+ "bottom-fullW",
497
+ "fullH-left",
498
+ "fullH-center",
499
+ "fullH-right",
500
+ "fullW-fullW"
501
+ ];
502
+ function jt(e) {
503
+ return dt.includes(e);
504
+ }
505
+ function $t(e) {
506
+ return mt.includes(e);
507
+ }
508
+ function Ut(e) {
509
+ return Ft.includes(e);
510
+ }
511
+ function Gt(e) {
512
+ if (!Ut(e))
513
+ throw new Error(`Invalid position: ${e}`);
514
+ return $t(e) ? [e, void 0] : jt(e) ? [void 0, e] : e.split("-");
515
+ }
516
+ function H(...e) {
517
+ return e.filter((r) => !!r).map((r) => r.trim()).join(" ");
518
+ }
519
+ function Bt(e) {
520
+ switch (e) {
521
+ case "left":
522
+ return "left-1 small:left-2";
523
+ case "right":
524
+ return "right-1 small:right-2";
525
+ case "center":
526
+ return "left-1/2 -translate-x-1/2";
527
+ case "fullW":
528
+ return "inset-x-1 small:inset-x-2";
529
+ }
530
+ }
531
+ function pt(e) {
532
+ switch (e) {
533
+ case "top":
534
+ return "top-1 small:top-2";
535
+ case "bottom":
536
+ return "bottom-1 small:bottom-2";
537
+ case "middle":
538
+ return "top-1/2 -translate-y-1/2";
539
+ case "fullH":
540
+ return "inset-y-1 small:inset-y-2";
541
+ }
542
+ }
543
+ function qt({
544
+ positionX: e,
545
+ positionY: r
546
+ }) {
547
+ const n = new Array();
548
+ return e && n.push(Bt(e)), r && n.push(pt(r)), n.join(" ");
549
+ }
550
+ function he(e) {
551
+ const [r, n] = Gt(e);
552
+ return qt({ positionX: n, positionY: r });
553
+ }
554
+ const B = ({
555
+ customizationKey: e,
556
+ className: r,
557
+ children: n
558
+ }) => {
559
+ const { getIconConfig: o } = ve(), l = o(e)?.Icon;
560
+ return l ? r ? /* @__PURE__ */ t("div", { className: r, children: l }) : l : n;
561
+ }, Kt = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_CLOSE", children: /* @__PURE__ */ t(
562
+ "svg",
563
+ {
564
+ className: e,
565
+ width: "24",
566
+ height: "24",
567
+ viewBox: "0 0 24 24",
568
+ fill: "none",
569
+ xmlns: "http://www.w3.org/2000/svg",
570
+ children: /* @__PURE__ */ t(
571
+ "path",
572
+ {
573
+ d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",
574
+ fill: "currentColor"
575
+ }
576
+ )
577
+ }
578
+ ) }), Jt = {
579
+ fill: {
580
+ primary: "bg-primary text-primary-foreground hover:opacity-80",
581
+ neutral: "bg-background text-neutral-foreground hover:opacity-80"
582
+ },
583
+ ghost: {
584
+ primary: "bg-transparent text-foreground hover:bg-primary/25",
585
+ neutral: "bg-transparent text-background hover:bg-foreground/25"
586
+ }
587
+ }, Qt = {
588
+ button: "h-8 px-2",
589
+ icon: "size-8 p-2"
590
+ }, te = ({
591
+ variant: e = "fill",
592
+ shape: r = "button",
593
+ color: n = "primary",
594
+ className: o,
595
+ children: i,
596
+ ...l
597
+ }) => {
598
+ const p = Jt[e][n], m = Qt[r];
599
+ return /* @__PURE__ */ t(
600
+ "button",
601
+ {
602
+ className: H(
603
+ "flex items-center justify-center rounded-ui text-sm transition-all disabled:opacity-60",
604
+ p,
605
+ m,
606
+ o
607
+ ),
608
+ ...l,
609
+ children: i
610
+ }
611
+ );
612
+ }, ht = (e) => /* @__PURE__ */ t(te, { color: "neutral", shape: "icon", ...e, children: /* @__PURE__ */ t(Kt, { className: "size-full" }) }), ft = ({ text: e, className: r }) => /* @__PURE__ */ A(
613
+ "div",
614
+ {
615
+ className: H(
616
+ "flex size-full flex-col items-center justify-center gap-y-4",
617
+ r
618
+ ),
619
+ children: [
620
+ /* @__PURE__ */ t(
621
+ "img",
622
+ {
623
+ className: "h-20 small:h-28",
624
+ src: "https://cdn.car-cutter.com/libs/web-player/v3/assets/car_placeholder.png"
625
+ }
626
+ ),
627
+ /* @__PURE__ */ t("div", { className: "text-2xl font-bold", children: e })
628
+ ]
629
+ }
630
+ ), er = {
631
+ primary: "border-primary",
632
+ foreground: "border-foreground",
633
+ background: "border-background"
634
+ }, tr = {
635
+ sm: "size-4 border",
636
+ md: "size-8 border-2",
637
+ lg: "size-12 border-4"
638
+ }, gt = ({
639
+ color: e = "foreground",
640
+ size: r = "md"
641
+ }) => {
642
+ const n = er[e], o = tr[r];
643
+ return /* @__PURE__ */ t(
644
+ "div",
645
+ {
646
+ className: H(
647
+ "inline-block animate-rotation rounded-full border-b-transparent",
648
+ o,
649
+ n
650
+ )
651
+ }
652
+ );
653
+ }, fe = ({
654
+ src: e,
655
+ className: r,
656
+ onLoad: n,
657
+ imgInPlayerWidthRatio: o = 1,
658
+ onlyThumbnail: i,
659
+ fadeIn: l,
660
+ ...p
661
+ }) => {
662
+ const { mediaLoadStrategy: m, playerInViewportWidthRatio: L } = ne(), { imageHdWidth: I, usedMediaWidths: f } = se(), [C, V] = re(() => {
663
+ const d = f.map((x) => `${x !== I ? Rt(e, x) : e} ${x}w`);
664
+ let g;
665
+ if (i)
666
+ g = [`${f[0]}px`];
667
+ else {
668
+ const x = 1 / (o * L);
669
+ switch (m) {
670
+ case "quality": {
671
+ const w = [...f], u = w.pop();
672
+ g = w.map(
673
+ (c) => `(max-width: ${x * c}px) ${c}px`
674
+ ), g.push(`${u}px`);
675
+ break;
676
+ }
677
+ case "balanced": {
678
+ g = [];
679
+ for (let w = 0; w < f.length - 1; w++) {
680
+ const u = f[w], c = f[w + 1], h = Math.round((u + c) / 2);
681
+ g.push(
682
+ `(max-width: ${x * h}px) ${u}px`
683
+ );
684
+ }
685
+ g.push(`${f[f.length - 1]}px`);
686
+ break;
687
+ }
688
+ case "speed": {
689
+ const w = [...f], u = w.shift();
690
+ g = w.reverse().map(
691
+ (c) => `(min-width: ${x * c}px) ${c}px`
692
+ ), g.push(`${u}px`);
693
+ break;
694
+ }
695
+ }
696
+ }
697
+ return [d.join(", "), g.join(", ")];
698
+ }, [
699
+ I,
700
+ o,
701
+ m,
702
+ i,
703
+ L,
704
+ e,
705
+ f
706
+ ]), [z, a] = Z();
707
+ return O(() => {
708
+ if (z === !0)
709
+ return;
710
+ const d = setTimeout(() => {
711
+ a((g) => g ?? !1);
712
+ }, 30);
713
+ return () => clearTimeout(d);
714
+ }, [z]), /* @__PURE__ */ t(
715
+ "img",
716
+ {
717
+ src: e,
718
+ srcSet: C,
719
+ sizes: V,
720
+ className: H(
721
+ r,
722
+ l && H(
723
+ z !== void 0 && "transition-opacity duration-200",
724
+ z === !1 && "opacity-0",
725
+ z === !0 && "opacity-100"
726
+ )
727
+ ),
728
+ onLoad: (d) => {
729
+ a(!0), n?.(d);
730
+ },
731
+ ...p
732
+ }
733
+ );
734
+ }, wt = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_IMAGE", children: /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ t(
735
+ "path",
736
+ {
737
+ d: "M9.5 2.5V9.5H2.5V2.5H9.5ZM9.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V2.5C10.5 1.95 10.05 1.5 9.5 1.5ZM7.07 5.93L5.57 7.865L4.5 6.57L3 8.5H9L7.07 5.93Z",
738
+ fill: "currentColor"
739
+ }
740
+ ) }) }), De = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_PLAY", children: /* @__PURE__ */ t(
741
+ "svg",
742
+ {
743
+ className: e,
744
+ viewBox: "0 0 24 24",
745
+ fill: "none",
746
+ stroke: "currentColor",
747
+ strokeWidth: "1.5",
748
+ strokeLinecap: "round",
749
+ strokeLinejoin: "round",
750
+ children: /* @__PURE__ */ t("polygon", { points: "6 3 20 12 6 21 6 3" })
751
+ }
752
+ ) }), vt = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_360", children: /* @__PURE__ */ A(
753
+ "svg",
754
+ {
755
+ className: e,
756
+ viewBox: "0 0 56 56",
757
+ fill: "none",
758
+ xmlns: "http://www.w3.org/2000/svg",
759
+ children: [
760
+ /* @__PURE__ */ A("g", { clipPath: "url(#clip0_134_843)", children: [
761
+ /* @__PURE__ */ t(
762
+ "path",
763
+ {
764
+ d: "M35.2497 43.93C34.4358 43.93 33.7296 43.325 33.6241 42.4966C33.51 41.5977 34.1457 40.7765 35.0442 40.662C40.2284 40.0015 44.8709 38.5967 48.1162 36.7057C51.0843 34.9767 52.7185 32.9438 52.7185 30.9819C52.7185 28.8196 50.8062 27.0504 49.2014 25.9464C48.455 25.4329 48.2662 24.4117 48.7798 23.6649C49.2933 22.9185 50.3148 22.7297 51.0612 23.2432C54.2921 25.4657 55.9998 28.1416 55.9998 30.9823C55.9998 34.2063 53.8452 37.1659 49.7684 39.5409C46.0988 41.6789 41.1509 43.1922 35.4591 43.9172C35.3886 43.9257 35.3185 43.93 35.2497 43.93Z",
765
+ fill: "currentColor"
766
+ }
767
+ ),
768
+ /* @__PURE__ */ t(
769
+ "path",
770
+ {
771
+ d: "M27.6 41.5797L23.225 37.2047C22.5842 36.5638 21.5455 36.5638 20.9047 37.2047C20.2642 37.8451 20.2642 38.8842 20.9047 39.5246L22.183 40.8029C17.2816 40.2966 12.8289 39.1555 9.38102 37.4973C5.50463 35.6333 3.28124 33.2582 3.28124 30.9818C3.28124 29.0511 4.87316 27.0443 7.76347 25.3311C8.5432 24.8692 8.8004 23.8626 8.33854 23.0833C7.87627 22.3036 6.86968 22.0464 6.09038 22.5083C1.05658 25.4922 0 28.7631 0 30.9818C0 34.622 2.82665 37.9861 7.95915 40.4547C11.9428 42.3701 17.0958 43.6531 22.7098 44.1495L20.9047 45.9546C20.2642 46.5951 20.2642 47.6341 20.9047 48.275C21.2251 48.595 21.6451 48.7552 22.0651 48.7552C22.4846 48.7552 22.9046 48.595 23.225 48.275L27.6 43.9C28.2405 43.2592 28.2405 42.2201 27.6 41.5797Z",
772
+ fill: "currentColor"
773
+ }
774
+ ),
775
+ /* @__PURE__ */ t(
776
+ "path",
777
+ {
778
+ d: "M17.1827 27.6963V27.3016C17.1827 25.9092 16.3303 25.6391 15.1874 25.6391C14.4808 25.6391 14.2522 25.0158 14.2522 24.3924C14.2522 23.7687 14.4808 23.1453 15.1874 23.1453C15.977 23.1453 16.8084 23.0415 16.8084 21.3581C16.8084 20.1529 16.1227 19.8619 15.2703 19.8619C14.2522 19.8619 13.7327 20.1114 13.7327 20.9219C13.7327 21.6282 13.4208 22.1063 12.2155 22.1063C10.7193 22.1063 10.5326 21.7944 10.5326 20.7967C10.5326 19.1762 11.696 17.0771 15.2703 17.0771C17.9098 17.0771 19.9046 18.0329 19.9046 20.8386C19.9046 22.3553 19.3437 23.7687 18.3046 24.2468C19.5308 24.7039 20.4242 25.6182 20.4242 27.3016V27.6963C20.4242 31.1045 18.076 32.393 15.1665 32.393C11.5922 32.393 10.2207 30.2111 10.2207 28.4654C10.2207 27.5301 10.6155 27.2806 11.7584 27.2806C13.0884 27.2806 13.4208 27.5716 13.4208 28.3616C13.4208 29.3382 14.3355 29.5668 15.2703 29.5668C16.6836 29.5668 17.1827 29.0473 17.1827 27.6963Z",
779
+ fill: "white"
780
+ }
781
+ ),
782
+ /* @__PURE__ */ t(
783
+ "path",
784
+ {
785
+ d: "M33.0384 27.3016V27.4887C33.0384 31.063 30.8146 32.393 27.9469 32.393C25.0792 32.393 22.8345 31.063 22.8345 27.4887V21.9815C22.8345 18.4072 25.1412 17.0771 28.134 17.0771C31.646 17.0771 33.0384 19.2591 33.0384 20.9839C33.0384 21.9815 32.5603 22.293 31.5212 22.293C30.6279 22.293 29.8379 22.0644 29.8379 21.1086C29.8379 20.3191 29.0069 19.9034 28.0302 19.9034C26.804 19.9034 26.0764 20.5477 26.0764 21.9815V23.8515C26.7416 23.1244 27.6769 22.9372 28.6745 22.9372C31.0431 22.9372 33.0384 23.9763 33.0384 27.3016ZM26.0764 27.7173C26.0764 29.1511 26.7831 29.7745 27.9469 29.7745C29.1107 29.7745 29.7964 29.1511 29.7964 27.7173V27.5301C29.7964 26.013 29.1107 25.4311 27.926 25.4311C26.804 25.4311 26.0764 25.9715 26.0764 27.343V27.7173Z",
786
+ fill: "white"
787
+ }
788
+ ),
789
+ /* @__PURE__ */ t(
790
+ "path",
791
+ {
792
+ d: "M35.5527 27.4887V21.9815C35.5527 18.4072 37.7761 17.0771 40.6442 17.0771C43.5119 17.0771 45.7562 18.4072 45.7562 21.9815V27.4887C45.7562 31.063 43.5119 32.393 40.6442 32.393C37.7761 32.393 35.5527 31.063 35.5527 27.4887ZM42.5143 21.9815C42.5143 20.5477 41.808 19.9034 40.6442 19.9034C39.4804 19.9034 38.7947 20.5477 38.7947 21.9815V27.4887C38.7947 28.9225 39.4804 29.5668 40.6442 29.5668C41.808 29.5668 42.5143 28.9225 42.5143 27.4887V21.9815Z",
793
+ fill: "white"
794
+ }
795
+ ),
796
+ /* @__PURE__ */ t(
797
+ "path",
798
+ {
799
+ d: "M49.6948 17.0625C46.9805 17.0625 44.7729 14.8545 44.7729 12.1406C44.7729 9.42675 46.9805 7.21875 49.6948 7.21875C52.4087 7.21875 54.6167 9.42675 54.6167 12.1406C54.6167 14.8545 52.4087 17.0625 49.6948 17.0625ZM49.6948 10.5C48.7899 10.5 48.0542 11.2361 48.0542 12.1406C48.0542 13.0455 48.7899 13.7812 49.6948 13.7812C50.5993 13.7812 51.3354 13.0455 51.3354 12.1406C51.3354 11.2361 50.5993 10.5 49.6948 10.5Z",
800
+ fill: "white"
801
+ }
802
+ )
803
+ ] }),
804
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "clip0_134_843", children: /* @__PURE__ */ t("rect", { width: "56", height: "56", fill: "white" }) }) })
805
+ ]
806
+ }
807
+ ) }), rr = ({
808
+ src: e,
809
+ withCdn: r
810
+ }) => {
811
+ const { permanentGallery: n } = ne();
812
+ if (!e)
813
+ return null;
814
+ const o = "size-full object-cover";
815
+ return r ? /* @__PURE__ */ t(
816
+ fe,
817
+ {
818
+ className: o,
819
+ src: e,
820
+ onlyThumbnail: !0,
821
+ fadeIn: !n
822
+ }
823
+ ) : /* @__PURE__ */ t("img", { className: o, src: e });
824
+ }, _e = ({
825
+ children: e
826
+ }) => {
827
+ const { extendMode: r } = Q();
828
+ return /* @__PURE__ */ t(
829
+ "div",
830
+ {
831
+ className: H(
832
+ "flex aspect-square h-3/4 items-center justify-center rounded-full bg-foreground/50 p-1",
833
+ r && "large:h-3/5 large:p-2"
834
+ ),
835
+ children: e
836
+ }
837
+ );
838
+ }, nr = ({ item: e }) => {
839
+ const { aspectRatioStyle: r } = se(), { type: n } = e;
840
+ let o, i;
841
+ switch (n) {
842
+ case "360":
843
+ o = e.images[0].src, i = !0;
844
+ break;
845
+ case "image":
846
+ o = e.src, i = !0;
847
+ break;
848
+ case "video":
849
+ o = e.poster, i = !0;
850
+ break;
851
+ case "custom":
852
+ o = e.thumbnailSrc, i = !1;
853
+ break;
854
+ }
855
+ const l = /* @__PURE__ */ t(rr, { src: o, withCdn: i });
856
+ let p;
857
+ switch (n) {
858
+ case "360":
859
+ p = /* @__PURE__ */ t(_e, { children: /* @__PURE__ */ t(vt, { className: "size-full text-primary-light" }) });
860
+ break;
861
+ case "video":
862
+ p = /* @__PURE__ */ t(_e, { children: /* @__PURE__ */ t(De, { className: "size-full p-0.5 text-background" }) });
863
+ break;
864
+ case "custom":
865
+ p = o ? null : /* @__PURE__ */ t(_e, { children: /* @__PURE__ */ t(wt, { className: "size-full p-0.5 text-background" }) });
866
+ break;
867
+ }
868
+ return /* @__PURE__ */ A("div", { className: "relative bg-foreground/30", style: r, children: [
869
+ l,
870
+ p && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-foreground/25", children: p })
871
+ ] });
872
+ }, or = {
873
+ primary: "bg-primary/50",
874
+ neutral: "bg-neutral/50",
875
+ background: "bg-background/50",
876
+ foreground: "bg-foreground/50"
877
+ }, bt = ({
878
+ color: e = "neutral",
879
+ orientation: r = "horizontal"
880
+ }) => {
881
+ const n = or[e];
882
+ return /* @__PURE__ */ t("div", { className: H(n, r === "horizontal" ? "h-px w-full" : "w-px h-full") });
883
+ }, yt = ({
884
+ className: e = "",
885
+ containerClassName: r = ""
886
+ }) => {
887
+ const { hideCategories: n, infiniteCarrousel: o, permanentGallery: i, isFullScreen: l } = ne(), { categories: p, aspectRatioStyle: m } = se(), {
888
+ items: L,
889
+ extendMode: I,
890
+ extendTransition: f,
891
+ masterItemIndex: C,
892
+ prevItem: V,
893
+ nextItem: z,
894
+ scrollToItemIndex: a,
895
+ resetView: d
896
+ } = Q(), g = re(() => {
897
+ if (n)
898
+ return [];
899
+ const y = new Array();
900
+ let N = p[0];
901
+ const S = (_) => p.find(
902
+ (R) => R.items.some((v) => v === _)
903
+ );
904
+ for (let _ = 0; _ < L.length; _++) {
905
+ const R = L[_], v = S(R);
906
+ v && v !== N && (y.push(_), N = v);
907
+ }
908
+ return y;
909
+ }, [p, n, L]), x = j(null), w = T(() => {
910
+ if (!x.current)
911
+ throw new Error("slider.current is null");
912
+ return x.current;
913
+ }, []), u = j(!1), c = j(
914
+ null
915
+ ), [h, b] = Z(!1), k = T(
916
+ (y, N) => {
917
+ const S = w(), _ = S.clientWidth, R = S.scrollWidth / L.length, v = (y + 1 / 2) * R - _ / 2, s = S.scrollWidth - S.clientWidth;
918
+ S.scrollTo({
919
+ left: ce(v, 0, s),
920
+ behavior: N
921
+ });
922
+ },
923
+ [L.length, w]
924
+ );
925
+ O(() => {
926
+ const y = x.current;
927
+ if (!y)
928
+ return;
929
+ const N = (R) => {
930
+ R.preventDefault(), u.current = !0, c.current = {
931
+ x: R.pageX - y.offsetLeft,
932
+ scrollLeft: y.scrollLeft
933
+ };
934
+ }, S = (R) => {
935
+ if (!u.current)
936
+ return;
937
+ if (c.current === null)
938
+ throw new Error("[onMouseMove] scrollStart is null");
939
+ const s = R.pageX - y.offsetLeft - c.current.x;
940
+ if (!h && Math.abs(s) < 5)
941
+ return;
942
+ const E = c.current.scrollLeft - s;
943
+ b(!0), requestAnimationFrame(() => {
944
+ y.scrollLeft = E;
945
+ });
946
+ }, _ = () => {
947
+ u.current && (u.current = !1, requestAnimationFrame(() => {
948
+ b(!1);
949
+ }));
950
+ };
951
+ return y.addEventListener("mousedown", N), document.addEventListener("mousemove", S), document.addEventListener("mouseleave", _), document.addEventListener("mouseup", _), document.addEventListener("contextmenu", _), () => {
952
+ y.removeEventListener("mousedown", N), document.removeEventListener("mousemove", S), document.removeEventListener("mouseleave", _), document.removeEventListener("mouseup", _), document.removeEventListener("contextmenu", _);
953
+ };
954
+ }, [h]);
955
+ const X = j(C);
956
+ O(() => {
957
+ x.current && (k(C, "smooth"), X.current = C);
958
+ }, [C, k]), O(() => {
959
+ x.current && k(X.current, "instant");
960
+ }, [
961
+ k,
962
+ // - Run the effect when those values change
963
+ l,
964
+ I,
965
+ f
966
+ ]);
967
+ const P = (y) => {
968
+ h || (o && y === L.length - 1 && C === 0 ? V() : o && y === 0 && C === L.length - 1 ? z() : a(y), d());
969
+ };
970
+ return /* @__PURE__ */ t(
971
+ "div",
972
+ {
973
+ ref: x,
974
+ className: H(
975
+ "relative w-full overflow-x-auto no-scrollbar",
976
+ h ? "cursor-grab" : "cursor-grabbing",
977
+ e
978
+ ),
979
+ children: /* @__PURE__ */ t(
980
+ "div",
981
+ {
982
+ className: H(
983
+ "flex h-10 w-fit gap-1 small:h-12 small:gap-2",
984
+ I && "large:h-20 large:gap-4",
985
+ r
986
+ ),
987
+ children: L.map((y, N) => /* @__PURE__ */ A(Mt, { children: [
988
+ g.includes(N) && /* @__PURE__ */ t("div", { className: "my-2", children: /* @__PURE__ */ t(
989
+ bt,
990
+ {
991
+ color: i && !l ? "neutral" : "background",
992
+ orientation: "vertical"
993
+ }
994
+ ) }),
995
+ /* @__PURE__ */ t(
996
+ "div",
997
+ {
998
+ className: H(
999
+ "relative h-full overflow-hidden rounded-gallery transition-radius",
1000
+ !h && "cursor-pointer",
1001
+ "after:absolute after:inset-0 after:rounded-gallery after:border-2 after:border-primary after:transition-all",
1002
+ N === C ? "after:opacity-100" : "after:opacity-0 hover:after:opacity-70"
1003
+ ),
1004
+ style: m,
1005
+ onClick: () => P(N),
1006
+ children: /* @__PURE__ */ t(nr, { item: y })
1007
+ }
1008
+ )
1009
+ ] }, N))
1010
+ }
1011
+ )
1012
+ }
1013
+ );
1014
+ }, xt = (e) => 1 - Math.pow(1 - e, 2), sr = ({
1015
+ Media: e,
1016
+ itemIndex: r
1017
+ }) => {
1018
+ const { setItemInteraction: n } = Q();
1019
+ return O(() => {
1020
+ n(r, "ready");
1021
+ }, [r, n]), e;
1022
+ }, Fe = (e, r) => Math.sqrt(
1023
+ (e.clientX - r.clientX) ** 2 + (e.clientY - r.clientY) ** 2
1024
+ ), ar = ({
1025
+ onlyPreload: e,
1026
+ ...r
1027
+ }) => {
1028
+ const { zoom: n, isZooming: o, setZoom: i } = Q(), l = j(null), p = j(null), m = T((u) => {
1029
+ if (!p.current)
1030
+ throw new Error(
1031
+ `[${u ?? "getTransformElementOrThrow"}] transformElementRef.current is null`
1032
+ );
1033
+ return p.current;
1034
+ }, []), L = j(!1), I = j(null), f = j(/* @__PURE__ */ new Map()), C = j({ x: 0, y: 0, scale: 1 }), V = j(null), z = T(
1035
+ (u) => {
1036
+ const c = m("setTransformStyle"), {
1037
+ x: h,
1038
+ y: b,
1039
+ scale: k
1040
+ } = {
1041
+ ...C.current,
1042
+ ...u
1043
+ }, X = ce(k, 1, xe), P = c.clientWidth, y = c.clientHeight, N = P * X, S = y * X, _ = ce(h, -(N - P), 0), R = ce(b, -(S - y), 0);
1044
+ C.current = { x: _, y: R, scale: X }, c.style.transform = `translate(${_}px, ${R}px) scale(${X})`;
1045
+ },
1046
+ [m]
1047
+ ), a = T(
1048
+ (u, c) => {
1049
+ const {
1050
+ x: h,
1051
+ y: b,
1052
+ scale: k
1053
+ } = C.current, {
1054
+ x: X,
1055
+ y: P,
1056
+ scale: y
1057
+ } = {
1058
+ ...C.current,
1059
+ ...u
1060
+ };
1061
+ V.current && (cancelAnimationFrame(V.current), V.current = null);
1062
+ const N = () => {
1063
+ z({ x: X, y: P, scale: y }), i(y);
1064
+ }, S = Math.abs(X - h) < 1 && Math.abs(P - b) < 1 && Math.abs(y - k) < 5e-3;
1065
+ if (!c || S) {
1066
+ N();
1067
+ return;
1068
+ }
1069
+ const _ = (/* @__PURE__ */ new Date()).getTime(), R = () => {
1070
+ const v = () => {
1071
+ const E = (/* @__PURE__ */ new Date()).getTime() - _;
1072
+ if (E >= c) {
1073
+ N(), V.current = null;
1074
+ return;
1075
+ }
1076
+ const M = Math.min(E / c, 1), D = xt(M), Y = ye(h, X, D), F = ye(b, P, D), $ = ye(k, y, D);
1077
+ z({ x: Y, y: F, scale: $ }), R();
1078
+ };
1079
+ V.current = requestAnimationFrame(v);
1080
+ };
1081
+ R();
1082
+ },
1083
+ [z, i]
1084
+ ), d = T(
1085
+ (u, c) => {
1086
+ let { x: h, y: b } = C.current;
1087
+ u.x && (h += u.x), u.y && (b += u.y), a(
1088
+ {
1089
+ x: h,
1090
+ y: b
1091
+ },
1092
+ c
1093
+ );
1094
+ },
1095
+ [a]
1096
+ ), g = T(
1097
+ (u, c, h) => {
1098
+ const b = C.current.scale, k = ce(u, 1, xe), X = k / b, { x: P, y } = C.current, { x: N, y: S } = c, _ = -P + N, R = -y + S, v = _ * X, s = R * X, E = v - N, M = s - S, D = -E, Y = -M;
1099
+ a(
1100
+ {
1101
+ x: D,
1102
+ y: Y,
1103
+ scale: k
1104
+ },
1105
+ h
1106
+ );
1107
+ },
1108
+ [a]
1109
+ ), x = T(
1110
+ (u) => {
1111
+ const c = m(
1112
+ "shiftZoomFromButton"
1113
+ ), h = c.clientWidth, b = c.clientHeight;
1114
+ g(
1115
+ u,
1116
+ {
1117
+ x: h / 2,
1118
+ y: b / 2
1119
+ },
1120
+ 200
1121
+ );
1122
+ },
1123
+ [m, g]
1124
+ ), w = T(
1125
+ (u, c, h) => {
1126
+ const { scale: b } = C.current;
1127
+ g(
1128
+ b + u,
1129
+ c,
1130
+ h
1131
+ );
1132
+ },
1133
+ [g]
1134
+ );
1135
+ return O(() => {
1136
+ e || p.current && x(n);
1137
+ }, [e, x, n]), O(() => {
1138
+ if (e || !o)
1139
+ return;
1140
+ const u = p.current;
1141
+ if (!u)
1142
+ return;
1143
+ const c = (k) => {
1144
+ k.preventDefault(), k.stopPropagation(), L.current = !0, I.current = {
1145
+ x: k.clientX,
1146
+ y: k.clientY
1147
+ };
1148
+ }, h = (k) => {
1149
+ if (!L.current)
1150
+ return;
1151
+ if (!I.current)
1152
+ throw new Error("mouseStartXY.current is null");
1153
+ k.stopPropagation();
1154
+ const X = k.clientX - I.current.x, P = k.clientY - I.current.y;
1155
+ d({
1156
+ x: X,
1157
+ y: P
1158
+ }), I.current = {
1159
+ x: k.clientX,
1160
+ y: k.clientY
1161
+ };
1162
+ }, b = () => {
1163
+ L.current = !1;
1164
+ };
1165
+ return u.addEventListener("mousedown", c), document.addEventListener("mousemove", h), document.addEventListener("mouseleave", b), document.addEventListener("mouseup", b), document.addEventListener("contextmenu", b), () => {
1166
+ u.removeEventListener("mousedown", c), document.removeEventListener("mousemove", h), document.removeEventListener("mouseleave", b), document.removeEventListener("mouseup", b), document.removeEventListener("contextmenu", b);
1167
+ };
1168
+ }, [o, d, e]), O(() => {
1169
+ if (e)
1170
+ return;
1171
+ const u = l.current;
1172
+ if (!u)
1173
+ return;
1174
+ const c = (h) => {
1175
+ const { ctrlKey: b, clientX: k, clientY: X, deltaX: P, deltaY: y } = h;
1176
+ if (b) {
1177
+ if (!o && y >= 0)
1178
+ return;
1179
+ const { left: N, top: S } = u.getBoundingClientRect(), _ = k - N, R = X - S;
1180
+ w(-0.01 * y, {
1181
+ x: _,
1182
+ y: R
1183
+ });
1184
+ } else {
1185
+ if (!o)
1186
+ return;
1187
+ d({
1188
+ x: -2 * P,
1189
+ y: -2 * y
1190
+ });
1191
+ }
1192
+ h.preventDefault();
1193
+ };
1194
+ return u.addEventListener("wheel", c), () => {
1195
+ u.removeEventListener("wheel", c);
1196
+ };
1197
+ }, [o, d, w, e]), O(() => {
1198
+ const u = l.current, c = p.current;
1199
+ if (!u || !c)
1200
+ return;
1201
+ const h = f.current, b = (P) => {
1202
+ for (let y = 0; y < P.changedTouches.length; y++) {
1203
+ const N = P.changedTouches[y];
1204
+ h.set(N.identifier, N);
1205
+ }
1206
+ }, k = (P) => {
1207
+ for (let y = 0; y < P.changedTouches.length; y++) {
1208
+ const N = P.changedTouches[y];
1209
+ h.delete(N.identifier);
1210
+ }
1211
+ }, X = (P) => {
1212
+ const y = P.touches.length;
1213
+ if (y === 1) {
1214
+ if (!o)
1215
+ return;
1216
+ P.preventDefault();
1217
+ const N = P.touches[0], S = h.get(N.identifier);
1218
+ if (!S)
1219
+ throw new Error("touchStart is null");
1220
+ const _ = N.clientX - S.clientX, R = N.clientY - S.clientY;
1221
+ d({
1222
+ x: _,
1223
+ y: R
1224
+ }), h.set(N.identifier, N);
1225
+ } else if (y === 2) {
1226
+ P.preventDefault();
1227
+ const [N, S] = P.touches, _ = h.get(N.identifier), R = h.get(S.identifier);
1228
+ if (!_ || !R)
1229
+ throw new Error("intialTouch1 or intialTouch2 is null");
1230
+ const v = Fe(
1231
+ _,
1232
+ R
1233
+ ), E = Fe(N, S) / v, { left: M, top: D } = u.getBoundingClientRect();
1234
+ w(E - 1, {
1235
+ x: (N.clientX + S.clientX) / 2 - M,
1236
+ y: (N.clientY + S.clientY) / 2 - D
1237
+ }), h.set(N.identifier, N), h.set(S.identifier, S);
1238
+ }
1239
+ };
1240
+ return c.addEventListener("touchstart", b), c.addEventListener("touchmove", X), c.addEventListener("touchend", k), c.addEventListener("touchcancel", k), () => {
1241
+ c.removeEventListener("touchstart", b), c.removeEventListener("touchmove", X), c.removeEventListener("touchend", k), c.removeEventListener("touchcancel", k);
1242
+ };
1243
+ }, [o, d, w]), /* @__PURE__ */ t(
1244
+ "div",
1245
+ {
1246
+ ref: l,
1247
+ className: `relative size-full overflow-hidden ${o ? "z-zoomed-image cursor-move" : ""}`,
1248
+ children: /* @__PURE__ */ t(
1249
+ "div",
1250
+ {
1251
+ ref: p,
1252
+ className: "origin-top-left",
1253
+ children: /* @__PURE__ */ t(
1254
+ fe,
1255
+ {
1256
+ ...r,
1257
+ imgInPlayerWidthRatio: e ? 1 : n
1258
+ }
1259
+ )
1260
+ }
1261
+ )
1262
+ }
1263
+ );
1264
+ }, ir = ({ hotspot: e }) => {
1265
+ const { title: r, icon: n, description: o, position: i, detail: l } = e, { getIconConfig: p } = ve(), m = n ? p(n) : void 0, { extendMode: L, setShownDetails: I } = Q(), f = !!l, C = l?.type === "image", V = !!r || !!o, z = C ? /* @__PURE__ */ t(wt, { className: "size-4" }) : /* @__PURE__ */ t("div", { className: "size-1" }), a = () => {
1266
+ C && I({
1267
+ src: l.src,
1268
+ title: r,
1269
+ text: o
1270
+ });
1271
+ };
1272
+ return /* @__PURE__ */ A(
1273
+ "div",
1274
+ {
1275
+ className: H(
1276
+ "group absolute z-hotspot -translate-x-1/2 -translate-y-1/2 hover:z-hotspot-hover",
1277
+ f ? "cursor-pointer" : "cursor-help"
1278
+ ),
1279
+ style: {
1280
+ top: `${100 * e.position.y}%`,
1281
+ left: `${100 * e.position.x}%`
1282
+ },
1283
+ onClick: a,
1284
+ children: [
1285
+ /* @__PURE__ */ A(
1286
+ "div",
1287
+ {
1288
+ className: "relative flex items-center justify-center rounded-full border-2 border-background bg-primary text-primary-foreground",
1289
+ children: [
1290
+ /* @__PURE__ */ t(
1291
+ "div",
1292
+ {
1293
+ className: "pointer-events-none absolute -z-20 size-8 animate-hotspot-ping rounded-full border-2 border-background"
1294
+ }
1295
+ ),
1296
+ /* @__PURE__ */ t("div", { className: "p-1", children: m?.Icon ? /* @__PURE__ */ t("div", { className: "size-4", children: m.Icon }) : z })
1297
+ ]
1298
+ }
1299
+ ),
1300
+ !C && V && /* @__PURE__ */ t(
1301
+ "div",
1302
+ {
1303
+ className: H(
1304
+ "absolute -z-10 w-max max-w-40 text-pretty rounded-ui bg-background p-2 small:max-w-48",
1305
+ L && "large:max-w-56",
1306
+ i.y < 0.55 ? "-top-1" : "-bottom-1",
1307
+ i.x < 0.55 ? "-left-1 pl-6 small:pl-8" : "-right-1 pr-4 small:pr-6",
1308
+ "pointer-events-none opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"
1309
+ ),
1310
+ children: /* @__PURE__ */ A("div", { className: "space-y-1 text-pretty", children: [
1311
+ r && /* @__PURE__ */ t("div", { className: "text-sm font-semibold small:text-base small:font-bold", children: r }),
1312
+ o && /* @__PURE__ */ t("div", { className: "text-xs text-foreground/65 small:text-sm", children: o })
1313
+ ] })
1314
+ }
1315
+ )
1316
+ ]
1317
+ }
1318
+ );
1319
+ }, cr = ({ hotspot: e }) => {
1320
+ const { detail: r } = e, n = /* @__PURE__ */ t(ir, { hotspot: e });
1321
+ switch (r?.type) {
1322
+ case "link":
1323
+ case "pdf":
1324
+ return /* @__PURE__ */ t("a", { href: r.src, target: "_blank", rel: "noreferrer", children: n });
1325
+ default:
1326
+ return n;
1327
+ }
1328
+ }, Ct = ({
1329
+ hotspots: e,
1330
+ itemIndex: r,
1331
+ className: n,
1332
+ onLoad: o,
1333
+ ...i
1334
+ }) => {
1335
+ const { isShowingDetails: l, showHotspots: p, setItemInteraction: m } = Q();
1336
+ return /* @__PURE__ */ t("div", { className: H("relative size-full overflow-hidden", n), children: /* @__PURE__ */ A(
1337
+ "div",
1338
+ {
1339
+ className: H(
1340
+ "size-full duration-details",
1341
+ l ? "scale-105" : "scale-100"
1342
+ ),
1343
+ children: [
1344
+ /* @__PURE__ */ t(
1345
+ ar,
1346
+ {
1347
+ className: "size-full object-cover",
1348
+ onLoad: (L) => {
1349
+ r !== void 0 && m(r, "ready"), o?.(L);
1350
+ },
1351
+ ...i
1352
+ }
1353
+ ),
1354
+ p && e?.map((L, I) => /* @__PURE__ */ t(cr, { hotspot: L }, I))
1355
+ ]
1356
+ }
1357
+ ) });
1358
+ }, we = 10, lr = 15, ur = ({
1359
+ images: e,
1360
+ onlyPreload: r
1361
+ }) => {
1362
+ const { reverse360: n } = ne(), { isShowingDetails: o, isZooming: i } = Q(), l = i || o, p = j(null), m = j(null), [L, I] = Z(0), f = e.length, C = T(() => {
1363
+ I((z) => (z - 1 + f) % f);
1364
+ }, [f]), V = T(() => {
1365
+ I((z) => (z + 1) % f);
1366
+ }, [f]);
1367
+ return O(() => {
1368
+ if (l)
1369
+ return;
1370
+ const z = p.current, a = m.current;
1371
+ if (!z || !a)
1372
+ return;
1373
+ let d = null, g = [], x = null;
1374
+ const w = (s) => {
1375
+ g.push(s), g.length > 20 && g.shift();
1376
+ }, u = () => {
1377
+ const s = Date.now(), E = (() => {
1378
+ const F = Date.now(), $ = g.filter(
1379
+ (ee) => F - ee.timestamp < 50
1380
+ );
1381
+ if ($.length < 2)
1382
+ return 0;
1383
+ const U = $[0], J = $[$.length - 1];
1384
+ return (J.value - U.value) / (1e-3 * Math.max(J.timestamp - U.timestamp, 1));
1385
+ })();
1386
+ let M = 0, D = s;
1387
+ const Y = () => {
1388
+ x = requestAnimationFrame(() => {
1389
+ const $ = Date.now(), U = ($ - s) / 1e3, J = Math.pow(0.05, U), ee = E * J, le = ($ - D) / 1e3;
1390
+ if (M += ee * le, Math.abs(ee) < 5 * we && Math.abs(M) < we) {
1391
+ x = null;
1392
+ return;
1393
+ }
1394
+ Math.abs(M) >= we && (M > 0 !== n ? V() : C(), M = 0), D = $, Y();
1395
+ });
1396
+ };
1397
+ Y();
1398
+ }, c = () => {
1399
+ x && (cancelAnimationFrame(x), x = null);
1400
+ }, h = (s) => {
1401
+ if (s.button !== 0)
1402
+ return;
1403
+ s.preventDefault(), s.stopPropagation(), c();
1404
+ const E = s.clientX;
1405
+ d = E, g = [{ timestamp: Date.now(), value: E }];
1406
+ }, b = (s) => {
1407
+ if (d === null)
1408
+ return;
1409
+ s.stopPropagation();
1410
+ const { clientX: E } = s;
1411
+ w({ timestamp: Date.now(), value: E });
1412
+ const M = E - d;
1413
+ Math.abs(M) < we || (M > 0 !== n ? V() : C(), d = E);
1414
+ }, k = () => {
1415
+ d !== null && (d = null, u());
1416
+ };
1417
+ z.addEventListener("mousedown", h), document.addEventListener("mousemove", b), document.addEventListener("mouseleave", k), document.addEventListener("mouseup", k), document.addEventListener("contextmenu", k);
1418
+ const X = () => a.getBoundingClientRect().width, P = () => a.scrollWidth / 2 - X() / 2, y = () => {
1419
+ const s = P();
1420
+ a.scrollLeft = s;
1421
+ };
1422
+ y();
1423
+ const N = () => {
1424
+ const s = a.scrollLeft - P();
1425
+ Math.abs(s) < lr || (s < 0 !== n ? V() : C(), y());
1426
+ };
1427
+ a.addEventListener("scroll", N);
1428
+ let S = null;
1429
+ const _ = (s) => {
1430
+ if (S !== null || s.changedTouches.length !== 1)
1431
+ return;
1432
+ c();
1433
+ const { identifier: E, clientX: M } = s.changedTouches[0];
1434
+ S = E, d = M, g = [{ timestamp: Date.now(), value: M }];
1435
+ }, R = (s) => {
1436
+ if (!d)
1437
+ return;
1438
+ const E = Array.from(s.changedTouches).find(
1439
+ ({ identifier: Y }) => Y === S
1440
+ );
1441
+ if (!E)
1442
+ return;
1443
+ s.preventDefault();
1444
+ const { clientX: M } = E;
1445
+ w({ timestamp: Date.now(), value: M });
1446
+ const D = M - d;
1447
+ Math.abs(D) < we || (D > 0 !== n ? V() : C(), d = M);
1448
+ }, v = (s) => {
1449
+ !d || !Array.from(s.changedTouches).some(
1450
+ ({ identifier: M }) => M === S
1451
+ ) || (S = null, d = null, u());
1452
+ };
1453
+ return a.addEventListener("touchstart", _), a.addEventListener("touchmove", R), a.addEventListener("touchend", v), a.addEventListener("touchcancel", v), () => {
1454
+ z.removeEventListener("mousedown", h), document.removeEventListener("mousemove", b), document.removeEventListener("mouseleave", k), document.removeEventListener("mouseup", k), document.removeEventListener("contextmenu", k), a.removeEventListener("scroll", N), a.removeEventListener("touchstart", _), a.removeEventListener("touchmove", R), a.removeEventListener("touchend", v), a.removeEventListener("touchcancel", v);
1455
+ };
1456
+ }, [V, C, l, n]), /* @__PURE__ */ t("div", { ref: p, className: "cursor-ew-resize", children: /* @__PURE__ */ A("div", { ref: m, className: "overflow-x-scroll no-scrollbar", children: [
1457
+ /* @__PURE__ */ A("div", { className: "sticky left-0 top-0", children: [
1458
+ e.map((z) => /* @__PURE__ */ t(
1459
+ fe,
1460
+ {
1461
+ src: z.src,
1462
+ className: "pointer-events-none !absolute left-0 top-0 -z-10"
1463
+ },
1464
+ z.src
1465
+ )),
1466
+ /* @__PURE__ */ t(Ct, { ...e[L], onlyPreload: r })
1467
+ ] }),
1468
+ /* @__PURE__ */ t("div", { className: "pointer-events-none -mt-px h-px w-[calc(100%+1024px)]" })
1469
+ ] }) });
1470
+ }, dr = ({ images: e, onPlaceholderImageLoaded: r, onSpinImagesLoaded: n, onError: o }) => {
1471
+ const i = re(() => e.map(({ src: f }) => f), [e]), [l, p] = Z(null), m = l ? [...l.values()].filter((f) => f).length / e.length * 100 : null, L = T(() => {
1472
+ m === null && p(new Map(i.map((f) => [f, !1])));
1473
+ }, [i, m]), I = T((f) => {
1474
+ p((C) => {
1475
+ const V = new Map(C);
1476
+ return V.set(f, !0), V;
1477
+ });
1478
+ }, []);
1479
+ return O(() => {
1480
+ m === 100 && n();
1481
+ }, [m, n]), /* @__PURE__ */ A("div", { className: "relative size-full", children: [
1482
+ m !== null && m !== 100 && // Add images to DOM to preload them
1483
+ /* @__PURE__ */ t("div", { className: "hidden", children: i.map((f) => /* @__PURE__ */ t(
1484
+ fe,
1485
+ {
1486
+ src: f,
1487
+ onLoad: () => I(f),
1488
+ onError: o
1489
+ },
1490
+ f
1491
+ )) }),
1492
+ /* @__PURE__ */ t(
1493
+ fe,
1494
+ {
1495
+ className: "size-full",
1496
+ src: i[0],
1497
+ onLoad: r
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ A("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35", children: [
1501
+ /* @__PURE__ */ t(vt, { className: "size-20 text-primary-light" }),
1502
+ /* @__PURE__ */ t(te, { color: "neutral", shape: "icon", onClick: L, children: /* @__PURE__ */ t(De, { className: "size-full" }) }),
1503
+ /* @__PURE__ */ t(
1504
+ "div",
1505
+ {
1506
+ className: H(
1507
+ "relative h-1 w-3/5 overflow-hidden rounded-full bg-background",
1508
+ m === null && "invisible"
1509
+ ),
1510
+ children: /* @__PURE__ */ t(
1511
+ "div",
1512
+ {
1513
+ className: "h-full bg-primary transition-[width]",
1514
+ style: { width: `${m ?? 0}%` }
1515
+ }
1516
+ )
1517
+ }
1518
+ )
1519
+ ] })
1520
+ ] });
1521
+ }, mr = (e) => {
1522
+ const { itemIndex: r } = e, { setItemInteraction: n } = Q(), [o, i] = Z();
1523
+ return O(() => {
1524
+ o === null || o === "error" || n(r, o === "spin" ? "running" : "ready");
1525
+ }, [r, n, o]), o === "error" ? /* @__PURE__ */ t(
1526
+ ft,
1527
+ {
1528
+ className: "text-background",
1529
+ text: "Spin could not be loaded"
1530
+ }
1531
+ ) : o !== "spin" ? /* @__PURE__ */ t(
1532
+ dr,
1533
+ {
1534
+ ...e,
1535
+ onPlaceholderImageLoaded: () => i("placeholder"),
1536
+ onSpinImagesLoaded: () => i("spin"),
1537
+ onError: () => i("error")
1538
+ }
1539
+ ) : /* @__PURE__ */ t(ur, { ...e });
1540
+ }, pr = (e) => /* @__PURE__ */ t(te, { color: "neutral", shape: "icon", ...e, children: /* @__PURE__ */ t(De, { className: "size-full" }) }), hr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_PAUSE", children: /* @__PURE__ */ t(
1541
+ "svg",
1542
+ {
1543
+ className: e,
1544
+ width: "16",
1545
+ height: "16",
1546
+ viewBox: "0 0 16 16",
1547
+ fill: "none",
1548
+ xmlns: "http://www.w3.org/2000/svg",
1549
+ children: /* @__PURE__ */ t(
1550
+ "path",
1551
+ {
1552
+ d: "M4 12.6667H6.66667V3.33333H4V12.6667ZM9.33333 3.33333V12.6667H12V3.33333H9.33333Z",
1553
+ fill: "currentColor"
1554
+ }
1555
+ )
1556
+ }
1557
+ ) }), fr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_VOLUME", children: /* @__PURE__ */ t(
1558
+ "svg",
1559
+ {
1560
+ className: e,
1561
+ width: "16",
1562
+ height: "16",
1563
+ viewBox: "0 0 16 16",
1564
+ fill: "none",
1565
+ xmlns: "http://www.w3.org/2000/svg",
1566
+ children: /* @__PURE__ */ t(
1567
+ "path",
1568
+ {
1569
+ d: "M2 6V10H4.66667L8 13.3333V2.66667L4.66667 6H2ZM11 8C11 6.82 10.32 5.80667 9.33333 5.31334V10.68C10.32 10.1933 11 9.18 11 8ZM9.33333 2.15334V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8C12.6667 10.1133 11.26 11.9 9.33333 12.4733V13.8467C12.0067 13.24 14 10.8533 14 8C14 5.14667 12.0067 2.76 9.33333 2.15334Z",
1570
+ fill: "currentColor"
1571
+ }
1572
+ )
1573
+ }
1574
+ ) }), gr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_VOLUME_OFF", children: /* @__PURE__ */ t(
1575
+ "svg",
1576
+ {
1577
+ className: e,
1578
+ width: "16",
1579
+ height: "16",
1580
+ viewBox: "0 0 16 16",
1581
+ fill: "none",
1582
+ xmlns: "http://www.w3.org/2000/svg",
1583
+ children: /* @__PURE__ */ t(
1584
+ "path",
1585
+ {
1586
+ d: "M11 8C11 6.82 10.32 5.80667 9.33333 5.31333V6.78667L10.9667 8.42C10.9867 8.28667 11 8.14667 11 8ZM12.6667 8C12.6667 8.62667 12.5333 9.21333 12.3067 9.76L13.3133 10.7667C13.7533 9.94 14 9 14 8C14 5.14667 12.0067 2.76 9.33333 2.15333V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8ZM2.84667 2L2 2.84667L5.15333 6H2V10H4.66667L8 13.3333V8.84667L10.8333 11.68C10.3867 12.0267 9.88667 12.3 9.33333 12.4667V13.84C10.2533 13.6333 11.0867 13.2067 11.7933 12.6333L13.1533 14L14 13.1533L2.84667 2ZM8 2.66667L6.60667 4.06L8 5.45333V2.66667Z",
1587
+ fill: "currentColor"
1588
+ }
1589
+ )
1590
+ }
1591
+ ) }), je = ({ progress: e }) => /* @__PURE__ */ t("div", { className: "h-1 w-full overflow-hidden rounded-ui-sm bg-background/25", children: /* @__PURE__ */ t(
1592
+ "div",
1593
+ {
1594
+ className: "size-full rounded-ui-sm bg-background transition-transform",
1595
+ style: { transform: `translateX(-${100 * (1 - e)}%)` }
1596
+ }
1597
+ ) }), wr = 3e3, vr = ({ src: e, poster: r, itemIndex: n }) => {
1598
+ const { carrouselItemIndex: o, setItemInteraction: i } = Q(), l = j(null), p = j(null), m = T(() => {
1599
+ if (!p.current)
1600
+ throw new Error("videoRef.current is null");
1601
+ return p.current;
1602
+ }, []);
1603
+ O(() => {
1604
+ i(n, "ready");
1605
+ }, [n, i]);
1606
+ const L = T(() => {
1607
+ m().play();
1608
+ }, [m]), I = T(() => {
1609
+ m().pause();
1610
+ }, [m]);
1611
+ O(() => {
1612
+ o === n || I();
1613
+ }, [o, n, I]);
1614
+ const [f, C] = Z(!1), [V, z] = Z(!0), a = () => {
1615
+ C(!0), i(n, "running");
1616
+ }, d = () => {
1617
+ C(!1), i(n, "ready");
1618
+ }, g = () => {
1619
+ z(!1);
1620
+ }, x = () => {
1621
+ z(!0);
1622
+ }, [w, u] = Z(null), c = (s) => {
1623
+ const E = m(), M = s.currentTarget.getBoundingClientRect(), Y = (s.clientX - M.left) / M.width, F = Math.min(1, Math.max(0, Y));
1624
+ E.volume = F, E.muted = !1;
1625
+ }, h = (s) => {
1626
+ const E = m();
1627
+ E.muted = s;
1628
+ };
1629
+ O(() => {
1630
+ const s = p.current;
1631
+ if (!s)
1632
+ return;
1633
+ const E = () => {
1634
+ u({
1635
+ volume: s.volume,
1636
+ isMuted: s.muted
1637
+ });
1638
+ };
1639
+ return E(), s.addEventListener("volumechange", E), () => {
1640
+ s.removeEventListener("volumechange", E);
1641
+ };
1642
+ }, []);
1643
+ const [b, k] = Z(null), X = b ? b.currentTime / b.duration : 0;
1644
+ O(() => {
1645
+ const s = p.current;
1646
+ if (!s) return;
1647
+ const E = () => {
1648
+ const M = s.currentTime, D = s.duration;
1649
+ isNaN(M) || isNaN(D) || k({
1650
+ currentTime: M,
1651
+ duration: D
1652
+ });
1653
+ };
1654
+ return E(), s.addEventListener("timeupdate", E), () => {
1655
+ s.removeEventListener("timeupdate", E);
1656
+ };
1657
+ }, []);
1658
+ const P = (s) => {
1659
+ const E = m(), M = s.currentTarget.getBoundingClientRect(), Y = (s.clientX - M.left) / M.width, F = E.duration * Y;
1660
+ E.currentTime = F;
1661
+ }, y = (s) => {
1662
+ const E = Math.floor(s % 3600 / 60), M = Math.floor(s % 60);
1663
+ return `${E}:${M.toString().padStart(2, "0")}`;
1664
+ }, [N, S] = Z(!1), _ = j(void 0), R = T(
1665
+ () => clearTimeout(_.current),
1666
+ []
1667
+ ), v = T(() => {
1668
+ R(), _.current = setTimeout(() => {
1669
+ S(!1);
1670
+ }, wr);
1671
+ }, [R]);
1672
+ return O(() => {
1673
+ const s = l.current, E = p.current;
1674
+ if (!s || !E)
1675
+ return;
1676
+ const M = () => {
1677
+ v(), S(!0);
1678
+ }, D = () => {
1679
+ R(), S(!1);
1680
+ };
1681
+ let Y = !1;
1682
+ const F = () => {
1683
+ Y = !0;
1684
+ }, $ = () => {
1685
+ Y && (Y = !1, I());
1686
+ }, U = () => {
1687
+ Y = !1, M();
1688
+ }, J = (ee) => {
1689
+ ee.preventDefault(), ee.touches.length === 1 && (v(), S((oe) => !oe));
1690
+ };
1691
+ return s.addEventListener("mousedown", F), s.addEventListener("mouseup", $), s.addEventListener("mouseenter", M), s.addEventListener("mousemove", U), s.addEventListener("mouseleave", D), E.addEventListener("touchstart", J), () => {
1692
+ s.removeEventListener("mousedown", F), s.removeEventListener("mouseup", $), s.removeEventListener("mouseenter", M), s.removeEventListener("mousemove", M), s.removeEventListener("mouseleave", D), E.removeEventListener("touchstart", J);
1693
+ };
1694
+ }, [R, I, v]), /* @__PURE__ */ A("div", { ref: l, className: "relative size-full", children: [
1695
+ /* @__PURE__ */ t(
1696
+ "video",
1697
+ {
1698
+ ref: p,
1699
+ className: "size-full",
1700
+ src: e,
1701
+ poster: r,
1702
+ disablePictureInPicture: !0,
1703
+ playsInline: !0,
1704
+ onPlay: a,
1705
+ onPause: d,
1706
+ onEnded: d,
1707
+ onCanPlay: g,
1708
+ onWaiting: x
1709
+ }
1710
+ ),
1711
+ f ? /* @__PURE__ */ A(ie, { children: [
1712
+ /* @__PURE__ */ A(
1713
+ "div",
1714
+ {
1715
+ className: H(
1716
+ "absolute inset-x-0 bottom-0 cursor-auto space-y-2 bg-gradient-to-t from-foreground to-transparent p-4 pr-12 pt-8 transition-opacity duration-300",
1717
+ N ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
1718
+ ),
1719
+ onMouseDownCapture: (s) => s.stopPropagation(),
1720
+ children: [
1721
+ /* @__PURE__ */ A("div", { className: "flex items-center justify-between text-background", children: [
1722
+ /* @__PURE__ */ A(
1723
+ "div",
1724
+ {
1725
+ className: "flex items-center gap-x-4",
1726
+ children: [
1727
+ /* @__PURE__ */ t(
1728
+ te,
1729
+ {
1730
+ shape: "icon",
1731
+ variant: "ghost",
1732
+ color: "neutral",
1733
+ onClick: I,
1734
+ children: /* @__PURE__ */ t(hr, { className: "size-full" })
1735
+ }
1736
+ ),
1737
+ b && /* @__PURE__ */ A("span", { className: "text-sm", children: [
1738
+ y(b.currentTime),
1739
+ " /",
1740
+ " ",
1741
+ y(b.duration)
1742
+ ] })
1743
+ ]
1744
+ }
1745
+ ),
1746
+ w && /* @__PURE__ */ A(
1747
+ "div",
1748
+ {
1749
+ className: "group/volume flex items-center gap-x-4 rounded-ui-md p-2 transition-colors hover:bg-foreground/25",
1750
+ children: [
1751
+ /* @__PURE__ */ t(
1752
+ "div",
1753
+ {
1754
+ className: `w-12 cursor-pointer py-1 opacity-0 transition-opacity ${w.isMuted ? "group-hover/volume:opacity-50" : "group-hover/volume:opacity-100"}`,
1755
+ onClick: c,
1756
+ children: /* @__PURE__ */ t(je, { progress: w.volume })
1757
+ }
1758
+ ),
1759
+ /* @__PURE__ */ t(
1760
+ "div",
1761
+ {
1762
+ className: "size-5 cursor-pointer",
1763
+ onClick: () => h(!w.isMuted),
1764
+ children: w.isMuted ? /* @__PURE__ */ t(gr, { className: "size-full" }) : /* @__PURE__ */ t(fr, { className: "size-full" })
1765
+ }
1766
+ )
1767
+ ]
1768
+ }
1769
+ )
1770
+ ] }),
1771
+ /* @__PURE__ */ t(
1772
+ "div",
1773
+ {
1774
+ className: "cursor-pointer py-1",
1775
+ onClick: P,
1776
+ children: /* @__PURE__ */ t(je, { progress: X })
1777
+ }
1778
+ )
1779
+ ]
1780
+ }
1781
+ ),
1782
+ V && /* @__PURE__ */ t(
1783
+ "div",
1784
+ {
1785
+ className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",
1786
+ children: /* @__PURE__ */ t(gt, { size: "lg", color: "background" })
1787
+ }
1788
+ )
1789
+ ] }) : /* @__PURE__ */ t(
1790
+ "div",
1791
+ {
1792
+ className: "absolute inset-0 flex items-center justify-center bg-foreground/25",
1793
+ children: /* @__PURE__ */ t(pr, { onClick: L })
1794
+ }
1795
+ )
1796
+ ] });
1797
+ }, br = ({ index: e, item: r, isShown: n }) => {
1798
+ const { type: o } = r;
1799
+ let i;
1800
+ switch (o) {
1801
+ case "image":
1802
+ i = /* @__PURE__ */ t(Ct, { itemIndex: e, onlyPreload: !n, ...r });
1803
+ break;
1804
+ case "video":
1805
+ i = /* @__PURE__ */ t(vr, { itemIndex: e, ...r });
1806
+ break;
1807
+ case "360":
1808
+ i = /* @__PURE__ */ t(mr, { itemIndex: e, onlyPreload: !n, ...r });
1809
+ break;
1810
+ case "custom":
1811
+ i = /* @__PURE__ */ t(sr, { itemIndex: e, ...r });
1812
+ }
1813
+ return i = /* @__PURE__ */ t("div", { className: "-ml-px h-full w-[calc(100%+2px)]", children: i }), i;
1814
+ }, yr = (e) => {
1815
+ O(() => {
1816
+ const r = (n) => {
1817
+ n.key === "Escape" && e();
1818
+ };
1819
+ return addEventListener("keydown", r), () => {
1820
+ removeEventListener("keydown", r);
1821
+ };
1822
+ }, [e]);
1823
+ };
1824
+ function xr(e) {
1825
+ return e.target === e.currentTarget;
1826
+ }
1827
+ const Cr = ({ currentIndex: e, maxIndex: r }) => /* @__PURE__ */ A("div", { className: "space-x-0.5 rounded-ui bg-foreground/40 px-1.5 py-0.5 text-xs text-background/75 transition-radius small:space-x-1 small:px-2 small:py-1 small:text-sm", children: [
1828
+ /* @__PURE__ */ t("span", { children: e + 1 }),
1829
+ /* @__PURE__ */ t("span", { children: "/" }),
1830
+ /* @__PURE__ */ t("span", { children: r + 1 })
1831
+ ] }), $e = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_ARROW_RIGHT", children: /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
1832
+ "path",
1833
+ {
1834
+ d: "M4.07666 13.4868L5.25666 14.6668L11.9233 8.00016L5.25666 1.3335L4.07666 2.5135L9.56333 8.00016L4.07666 13.4868Z",
1835
+ fill: "currentColor"
1836
+ }
1837
+ ) }) }), Er = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_EXTEND", children: /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
1838
+ "path",
1839
+ {
1840
+ d: "M4.66683 9.3335H3.3335V12.6668H6.66683V11.3335H4.66683V9.3335ZM3.3335 6.66683H4.66683V4.66683H6.66683V3.3335H3.3335V6.66683ZM11.3335 11.3335H9.3335V12.6668H12.6668V9.3335H11.3335V11.3335ZM9.3335 3.3335V4.66683H11.3335V6.66683H12.6668V3.3335H9.3335Z",
1841
+ fill: "currentColor"
1842
+ }
1843
+ ) }) }), kr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_GALLERY", children: /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
1844
+ "path",
1845
+ {
1846
+ d: "M13.3334 2.66683V10.6668H5.33337V2.66683H13.3334ZM13.3334 1.3335H5.33337C4.60004 1.3335 4.00004 1.9335 4.00004 2.66683V10.6668C4.00004 11.4002 4.60004 12.0002 5.33337 12.0002H13.3334C14.0667 12.0002 14.6667 11.4002 14.6667 10.6668V2.66683C14.6667 1.9335 14.0667 1.3335 13.3334 1.3335ZM7.66671 7.78016L8.79337 9.28683L10.4467 7.22016L12.6667 10.0002H6.00004L7.66671 7.78016ZM1.33337 4.00016V13.3335C1.33337 14.0668 1.93337 14.6668 2.66671 14.6668H12V13.3335H2.66671V4.00016H1.33337Z",
1847
+ fill: "currentColor"
1848
+ }
1849
+ ) }) }), Lr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_HOTSPOTS", children: /* @__PURE__ */ A(
1850
+ "svg",
1851
+ {
1852
+ className: e,
1853
+ width: "12",
1854
+ height: "12",
1855
+ viewBox: "0 0 12 12",
1856
+ fill: "none",
1857
+ xmlns: "http://www.w3.org/2000/svg",
1858
+ children: [
1859
+ /* @__PURE__ */ t("g", { clipPath: "url(#clip0_418_982)", children: /* @__PURE__ */ t(
1860
+ "path",
1861
+ {
1862
+ d: "M6 4C4.895 4 4 4.895 4 6C4 7.105 4.895 8 6 8C7.105 8 8 7.105 8 6C8 4.895 7.105 4 6 4ZM10.47 5.5C10.24 3.415 8.585 1.76 6.5 1.53V0.5H5.5V1.53C3.415 1.76 1.76 3.415 1.53 5.5H0.5V6.5H1.53C1.76 8.585 3.415 10.24 5.5 10.47V11.5H6.5V10.47C8.585 10.24 10.24 8.585 10.47 6.5H11.5V5.5H10.47ZM6 9.5C4.065 9.5 2.5 7.935 2.5 6C2.5 4.065 4.065 2.5 6 2.5C7.935 2.5 9.5 4.065 9.5 6C9.5 7.935 7.935 9.5 6 9.5Z",
1863
+ fill: "currentColor"
1864
+ }
1865
+ ) }),
1866
+ /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "clip0_418_982", children: /* @__PURE__ */ t("rect", { width: "12", height: "12", fill: "white" }) }) })
1867
+ ]
1868
+ }
1869
+ ) }), Ir = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_MINUS", children: /* @__PURE__ */ t(
1870
+ "svg",
1871
+ {
1872
+ className: e,
1873
+ width: "16",
1874
+ height: "16",
1875
+ viewBox: "0 0 16 16",
1876
+ fill: "none",
1877
+ xmlns: "http://www.w3.org/2000/svg",
1878
+ children: /* @__PURE__ */ t(
1879
+ "path",
1880
+ {
1881
+ d: "M12.6666 8.66634H3.33325V7.33301H12.6666V8.66634Z",
1882
+ fill: "currentColor"
1883
+ }
1884
+ )
1885
+ }
1886
+ ) }), Mr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_PLUS", children: /* @__PURE__ */ t(
1887
+ "svg",
1888
+ {
1889
+ className: e,
1890
+ width: "16",
1891
+ height: "16",
1892
+ viewBox: "0 0 16 16",
1893
+ fill: "none",
1894
+ xmlns: "http://www.w3.org/2000/svg",
1895
+ children: /* @__PURE__ */ t(
1896
+ "path",
1897
+ {
1898
+ d: "M12.6666 8.66634H8.66659V12.6663H7.33325V8.66634H3.33325V7.33301H7.33325V3.33301H8.66659V7.33301H12.6666V8.66634Z",
1899
+ fill: "currentColor"
1900
+ }
1901
+ )
1902
+ }
1903
+ ) }), Nr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_REDUCE", children: /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t(
1904
+ "path",
1905
+ {
1906
+ d: "M3.33325 10.6668H5.33325V12.6668H6.66659V9.3335H3.33325V10.6668ZM5.33325 5.3335H3.33325V6.66683H6.66659V3.3335H5.33325V5.3335ZM9.33325 12.6668H10.6666V10.6668H12.6666V9.3335H9.33325V12.6668ZM10.6666 5.3335V3.3335H9.33325V6.66683H12.6666V5.3335H10.6666Z",
1907
+ fill: "currentColor"
1908
+ }
1909
+ ) }) }), Tr = ({
1910
+ enabled: e,
1911
+ onToggle: r,
1912
+ label: n,
1913
+ className: o,
1914
+ children: i
1915
+ }) => /* @__PURE__ */ A(
1916
+ "label",
1917
+ {
1918
+ className: H(
1919
+ "flex cursor-pointer items-center justify-center gap-x-2",
1920
+ o
1921
+ ),
1922
+ children: [
1923
+ /* @__PURE__ */ t(
1924
+ "input",
1925
+ {
1926
+ type: "checkbox",
1927
+ className: "sr-only",
1928
+ checked: e,
1929
+ onChange: r
1930
+ }
1931
+ ),
1932
+ n && /* @__PURE__ */ t("div", { className: "text-xs text-background", children: n }),
1933
+ /* @__PURE__ */ t(
1934
+ "div",
1935
+ {
1936
+ className: H(
1937
+ "flex h-5 w-8 items-center justify-center rounded-full transition-colors",
1938
+ e ? "bg-primary" : "bg-background/60"
1939
+ ),
1940
+ children: /* @__PURE__ */ t(
1941
+ "div",
1942
+ {
1943
+ className: H(
1944
+ "flex size-4 items-center justify-center rounded-full p-0.5 transition",
1945
+ e ? "translate-x-1.5 bg-primary-foreground text-primary" : "-translate-x-1.5 bg-background text-foreground"
1946
+ ),
1947
+ children: i
1948
+ }
1949
+ )
1950
+ }
1951
+ )
1952
+ ]
1953
+ }
1954
+ ), zr = ({ className: e }) => /* @__PURE__ */ t(B, { className: e, customizationKey: "UI_BURGER", children: /* @__PURE__ */ t(
1955
+ "svg",
1956
+ {
1957
+ className: e,
1958
+ width: "16",
1959
+ height: "16",
1960
+ viewBox: "0 0 16 16",
1961
+ fill: "none",
1962
+ xmlns: "http://www.w3.org/2000/svg",
1963
+ children: /* @__PURE__ */ t(
1964
+ "path",
1965
+ {
1966
+ d: "M2 12H14V10.6667H2V12ZM2 8.66667H14V7.33333H2V8.66667ZM2 4V5.33333H14V4H2Z",
1967
+ fill: "currentColor"
1968
+ }
1969
+ )
1970
+ }
1971
+ ) }), Sr = ({ sharedClassName: e }) => {
1972
+ const { categories: r } = se(), { displayedCategoryId: n, changeCategory: o } = Q(), [i, l] = Z(!1), p = () => {
1973
+ l(!i);
1974
+ }, m = () => {
1975
+ l(!1);
1976
+ };
1977
+ return /* @__PURE__ */ A(ie, { children: [
1978
+ i && /* @__PURE__ */ t(
1979
+ "div",
1980
+ {
1981
+ className: H(e, "inset-0 small:hidden"),
1982
+ onClick: m
1983
+ }
1984
+ ),
1985
+ /* @__PURE__ */ A(
1986
+ "div",
1987
+ {
1988
+ className: H(
1989
+ e,
1990
+ he("top-left"),
1991
+ "flex gap-x-2 small:hidden"
1992
+ ),
1993
+ children: [
1994
+ /* @__PURE__ */ t(
1995
+ te,
1996
+ {
1997
+ shape: "icon",
1998
+ color: i ? "primary" : "neutral",
1999
+ onClick: p,
2000
+ children: /* @__PURE__ */ t(zr, {})
2001
+ }
2002
+ ),
2003
+ i && /* @__PURE__ */ t("div", { className: "rounded-ui-md bg-background transition-radius", children: /* @__PURE__ */ t("ul", { className: "space-y-0.5 p-1", children: r.map(({ id: L, title: I }) => /* @__PURE__ */ t(
2004
+ "li",
2005
+ {
2006
+ className: H(
2007
+ "cursor-pointer rounded-ui px-2 py-1 text-sm font-bold transition-all hover:bg-primary/30",
2008
+ L === n && "bg-primary/50"
2009
+ ),
2010
+ onClick: () => {
2011
+ o(L), l(!1);
2012
+ },
2013
+ children: I
2014
+ },
2015
+ L
2016
+ )) }) })
2017
+ ]
2018
+ }
2019
+ ),
2020
+ /* @__PURE__ */ t(
2021
+ "div",
2022
+ {
2023
+ className: H(
2024
+ e,
2025
+ pt("top"),
2026
+ "w-full overflow-x-auto max-small:hidden"
2027
+ ),
2028
+ children: /* @__PURE__ */ t("div", { className: "mx-auto flex w-fit gap-x-1 rounded-ui-md bg-background p-1 shadow", children: r.map(({ id: L, title: I }) => /* @__PURE__ */ t(
2029
+ te,
2030
+ {
2031
+ variant: L === n ? "fill" : "ghost",
2032
+ onClick: () => o(L),
2033
+ children: I
2034
+ },
2035
+ L
2036
+ )) })
2037
+ }
2038
+ )
2039
+ ] });
2040
+ }, _r = () => {
2041
+ const { hideCategories: e, infiniteCarrousel: r, permanentGallery: n } = ne(), { aspectRatioStyle: o } = se(), {
2042
+ items: { length: i },
2043
+ slidable: l,
2044
+ carrouselItemIndex: p,
2045
+ masterItemIndex: m,
2046
+ prevItem: L,
2047
+ nextItem: I,
2048
+ showGalleryControls: f,
2049
+ enableHotspotsControl: C,
2050
+ showHotspots: V,
2051
+ toggleHotspots: z,
2052
+ showGallery: a,
2053
+ toggleGallery: d,
2054
+ extendMode: g,
2055
+ toggleExtendMode: x,
2056
+ shownDetails: w,
2057
+ isShowingDetails: u,
2058
+ resetShownDetails: c,
2059
+ showZoomControls: h,
2060
+ isZooming: b,
2061
+ canZoomIn: k,
2062
+ zoomIn: X,
2063
+ canZoomOut: P,
2064
+ zoomOut: y,
2065
+ resetView: N
2066
+ } = Q(), S = T(
2067
+ (R) => {
2068
+ xr(R) && c();
2069
+ },
2070
+ [c]
2071
+ );
2072
+ yr(c);
2073
+ const _ = "absolute z-overlay";
2074
+ return /* @__PURE__ */ A(ie, { children: [
2075
+ !e && /* @__PURE__ */ t(
2076
+ Sr,
2077
+ {
2078
+ sharedClassName: H(
2079
+ _,
2080
+ "transition-opacity",
2081
+ b ? "!pointer-events-none opacity-0" : "opacity-100"
2082
+ )
2083
+ }
2084
+ ),
2085
+ l && !b && /* @__PURE__ */ t("div", { className: H(_, he("top-right")), children: /* @__PURE__ */ t(
2086
+ Cr,
2087
+ {
2088
+ currentIndex: p,
2089
+ maxIndex: i - 1
2090
+ }
2091
+ ) }),
2092
+ l && /* @__PURE__ */ A(ie, { children: [
2093
+ /* @__PURE__ */ t(
2094
+ te,
2095
+ {
2096
+ shape: "icon",
2097
+ color: "neutral",
2098
+ className: H(
2099
+ _,
2100
+ he("middle-left"),
2101
+ b ? "!pointer-events-none opacity-0" : "opacity-100"
2102
+ ),
2103
+ onClick: L,
2104
+ disabled: !r && m <= 0,
2105
+ children: /* @__PURE__ */ t(B, { customizationKey: "CONTROLS_PREV", children: /* @__PURE__ */ t($e, { className: "size-full -scale-x-100" }) })
2106
+ }
2107
+ ),
2108
+ /* @__PURE__ */ t(
2109
+ te,
2110
+ {
2111
+ shape: "icon",
2112
+ color: "neutral",
2113
+ className: H(
2114
+ _,
2115
+ he("middle-right"),
2116
+ b ? "!pointer-events-none opacity-0" : "opacity-100"
2117
+ ),
2118
+ onClick: I,
2119
+ disabled: !r && m >= i - 1,
2120
+ children: /* @__PURE__ */ t(B, { customizationKey: "CONTROLS_NEXT", children: /* @__PURE__ */ t($e, { className: "size-full" }) })
2121
+ }
2122
+ )
2123
+ ] }),
2124
+ /* @__PURE__ */ A(
2125
+ "div",
2126
+ {
2127
+ className: H(
2128
+ _,
2129
+ he("bottom-fullW"),
2130
+ "pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"
2131
+ ),
2132
+ children: [
2133
+ !n && l && /* @__PURE__ */ A(ie, { children: [
2134
+ /* @__PURE__ */ t(
2135
+ te,
2136
+ {
2137
+ className: f && !b ? "opacity-100" : "!pointer-events-none opacity-0",
2138
+ variant: "fill",
2139
+ color: a ? "primary" : "neutral",
2140
+ shape: "icon",
2141
+ onClick: d,
2142
+ children: /* @__PURE__ */ t(kr, { className: "size-full" })
2143
+ }
2144
+ ),
2145
+ a && /* @__PURE__ */ t(
2146
+ yt,
2147
+ {
2148
+ className: H(
2149
+ "transition-opacity",
2150
+ f && !b ? "opacity-100" : "!pointer-events-none opacity-0",
2151
+ // Left & Right gradient mask to fade the gallery
2152
+ "[mask-image:linear-gradient(to_left,transparent_0px,black_4px,black_calc(100%-4px),transparent_100%)]"
2153
+ ),
2154
+ containerClassName: "mx-1"
2155
+ }
2156
+ )
2157
+ ] }),
2158
+ /* @__PURE__ */ A("div", { className: "col-start-3 flex flex-col items-end gap-y-1 small:gap-y-2", children: [
2159
+ C && /* @__PURE__ */ t(
2160
+ Tr,
2161
+ {
2162
+ className: H(
2163
+ "transition-opacity",
2164
+ b ? "!pointer-events-none opacity-0" : "opacity-100"
2165
+ ),
2166
+ enabled: V,
2167
+ onToggle: z,
2168
+ children: /* @__PURE__ */ t(Lr, { className: "size-full" })
2169
+ }
2170
+ ),
2171
+ h && /* @__PURE__ */ A("div", { className: "max-small:hidden", children: [
2172
+ /* @__PURE__ */ t(
2173
+ te,
2174
+ {
2175
+ className: "rounded-b-none",
2176
+ color: "neutral",
2177
+ shape: "icon",
2178
+ disabled: !k,
2179
+ onClick: X,
2180
+ children: /* @__PURE__ */ t(Mr, { className: "size-full" })
2181
+ }
2182
+ ),
2183
+ /* @__PURE__ */ t(bt, { color: "background" }),
2184
+ /* @__PURE__ */ t(
2185
+ te,
2186
+ {
2187
+ className: "rounded-t-none",
2188
+ color: "neutral",
2189
+ shape: "icon",
2190
+ disabled: !P,
2191
+ onClick: y,
2192
+ children: /* @__PURE__ */ t(Ir, { className: "size-full" })
2193
+ }
2194
+ )
2195
+ ] }),
2196
+ /* @__PURE__ */ t(
2197
+ te,
2198
+ {
2199
+ variant: "fill",
2200
+ color: g ? "primary" : "neutral",
2201
+ shape: "icon",
2202
+ onClick: x,
2203
+ children: g ? /* @__PURE__ */ t(Nr, { className: "size-full" }) : /* @__PURE__ */ t(Er, { className: "size-full" })
2204
+ }
2205
+ )
2206
+ ] })
2207
+ ]
2208
+ }
2209
+ ),
2210
+ /* @__PURE__ */ t(
2211
+ "div",
2212
+ {
2213
+ className: H(
2214
+ _,
2215
+ "inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",
2216
+ u ? "opacity-100" : "pointer-events-none opacity-0"
2217
+ ),
2218
+ onClick: S,
2219
+ children: /* @__PURE__ */ t(
2220
+ "div",
2221
+ {
2222
+ className: H(
2223
+ "h-full w-3/5 bg-background transition-transform duration-details",
2224
+ u ? "translate-x-0" : "translate-x-full"
2225
+ ),
2226
+ children: !!w && /* @__PURE__ */ A(ie, { children: [
2227
+ /* @__PURE__ */ t(
2228
+ fe,
2229
+ {
2230
+ className: "w-full bg-foreground/65",
2231
+ style: o,
2232
+ src: w.src,
2233
+ imgInPlayerWidthRatio: 0.6
2234
+ }
2235
+ ),
2236
+ /* @__PURE__ */ A(
2237
+ "div",
2238
+ {
2239
+ className: H(
2240
+ "space-y-1 px-2 py-1 small:p-3",
2241
+ g && "large:p-4"
2242
+ ),
2243
+ children: [
2244
+ w.title && /* @__PURE__ */ t(
2245
+ "span",
2246
+ {
2247
+ className: H(
2248
+ "text-sm font-semibold small:text-base small:font-bold",
2249
+ g && "large:text-lg"
2250
+ ),
2251
+ children: w.title
2252
+ }
2253
+ ),
2254
+ w.text && /* @__PURE__ */ t(
2255
+ "p",
2256
+ {
2257
+ className: H(
2258
+ "text-xs text-foreground/65 small:text-sm",
2259
+ g && "large:text-base"
2260
+ ),
2261
+ children: w.text
2262
+ }
2263
+ )
2264
+ ]
2265
+ }
2266
+ )
2267
+ ] })
2268
+ }
2269
+ )
2270
+ }
2271
+ ),
2272
+ (b || u) && /* @__PURE__ */ t(
2273
+ ht,
2274
+ {
2275
+ className: H(_, he("top-right")),
2276
+ onClick: N
2277
+ }
2278
+ )
2279
+ ] });
2280
+ }, Vr = ({ className: e = "" }) => {
2281
+ const { infiniteCarrousel: r, preloadRange: n, isFullScreen: o } = ne(), { aspectRatioStyle: i } = se(), {
2282
+ items: l,
2283
+ slidable: p,
2284
+ carrouselItemIndex: m,
2285
+ setCarrouselItemIndex: L,
2286
+ itemIndexCommand: I,
2287
+ setItemIndexCommand: f,
2288
+ specialCommand: C,
2289
+ isRunningSpecialCommand: V,
2290
+ finishSpecialCommand: z,
2291
+ extendMode: a,
2292
+ extendTransition: d
2293
+ } = Q(), g = j(null), x = T((v) => {
2294
+ if (!g.current)
2295
+ throw new Error(`[${v ?? "sliderOrThrow"}] slider.current is null`);
2296
+ return g.current;
2297
+ }, []), w = j(!1), u = j(null), c = j(null), h = j(null), b = T(() => {
2298
+ h.current && cancelAnimationFrame(h.current);
2299
+ }, []), k = T(() => {
2300
+ const v = x("computeClosestSnapIndex"), s = Array.from(v.children), E = v.scrollLeft, M = s.reduce(
2301
+ (D, Y, F) => {
2302
+ const $ = Y.offsetLeft;
2303
+ return Math.abs($ - E) < Math.abs(s[D].offsetLeft - E) ? F : D;
2304
+ },
2305
+ 0
2306
+ );
2307
+ return C === "first_to_last" ? Xe(M, l.length) : C === "last_to_first" ? Xe(M - 1, l.length) : M;
2308
+ }, [C, x, l.length]), X = T(
2309
+ (v) => {
2310
+ const s = x("setStyleCursor");
2311
+ s.style.cursor = v;
2312
+ },
2313
+ [x]
2314
+ ), P = T(
2315
+ (v) => {
2316
+ const s = x("setStyleSnapState");
2317
+ v === "mandatory" ? s.style.scrollSnapType = "x mandatory" : s.style.scrollSnapType = "none";
2318
+ },
2319
+ [x]
2320
+ ), y = T(
2321
+ (v, s, E) => {
2322
+ b();
2323
+ const M = x("scrollToIndex"), D = Array.from(M.children), Y = M.scrollLeft, F = D[v].offsetLeft, $ = (ae) => {
2324
+ M.scrollTo({
2325
+ left: ae,
2326
+ behavior: "instant"
2327
+ });
2328
+ }, U = () => {
2329
+ $(F), P("mandatory"), E?.();
2330
+ }, J = Math.abs(Y - F);
2331
+ if (J < 1 || s === "instant") {
2332
+ U();
2333
+ return;
2334
+ }
2335
+ const ee = ce(J / 2.5, 300, 1e3), le = (/* @__PURE__ */ new Date()).getTime();
2336
+ P("none");
2337
+ const oe = () => {
2338
+ const ae = () => {
2339
+ const be = (/* @__PURE__ */ new Date()).getTime() - le;
2340
+ if (be >= ee) {
2341
+ U();
2342
+ return;
2343
+ }
2344
+ const ke = Math.min(be / ee, 1), ue = xt(ke), ge = ye(Y, F, ue);
2345
+ $(ge), oe();
2346
+ };
2347
+ h.current = requestAnimationFrame(ae);
2348
+ };
2349
+ oe();
2350
+ },
2351
+ [b, x, P]
2352
+ ), [N, S] = Z(), _ = !!N;
2353
+ O(() => {
2354
+ const v = () => {
2355
+ clearTimeout(N);
2356
+ const s = setTimeout(() => {
2357
+ S(void 0);
2358
+ }, ct);
2359
+ S(s);
2360
+ };
2361
+ return addEventListener("resize", v), document.addEventListener("fullscreenchange", v), () => {
2362
+ removeEventListener("resize", v), document.removeEventListener("fullscreenchange", v);
2363
+ };
2364
+ }, [N]), O(() => {
2365
+ const v = k();
2366
+ Number.isNaN(v) || v !== m && y(m, "instant");
2367
+ }, [
2368
+ m,
2369
+ y,
2370
+ k,
2371
+ // - Run the effect when those values change
2372
+ l,
2373
+ N,
2374
+ o,
2375
+ a,
2376
+ d
2377
+ ]), O(() => {
2378
+ if (!p || V) {
2379
+ X("auto");
2380
+ return;
2381
+ }
2382
+ const v = g.current;
2383
+ if (!v)
2384
+ return;
2385
+ X("grab"), P("mandatory");
2386
+ const s = (D) => {
2387
+ D.button === 0 && (D.preventDefault(), D.stopPropagation(), b(), w.current = !0, u.current = D.pageX - v.offsetLeft, c.current = v.scrollLeft, X("grabbing"));
2388
+ }, E = (D) => {
2389
+ if (!w.current)
2390
+ return;
2391
+ if (u.current === null)
2392
+ throw new Error("[onMouseMove] startX is null");
2393
+ P("none");
2394
+ const F = D.pageX - v.offsetLeft - u.current;
2395
+ requestAnimationFrame(() => {
2396
+ if (c.current === null)
2397
+ throw new Error("[onMouseMove] scrollLeft is null");
2398
+ v.scrollLeft = c.current - F;
2399
+ });
2400
+ }, M = () => {
2401
+ if (!w.current)
2402
+ return;
2403
+ w.current = !1, X("grab");
2404
+ const D = k();
2405
+ y(D, "smooth");
2406
+ };
2407
+ return v.addEventListener("mousedown", s), document.addEventListener("mousemove", E), document.addEventListener("mouseleave", M), document.addEventListener("mouseup", M), document.addEventListener("contextmenu", M), () => {
2408
+ v.removeEventListener("mousedown", s), document.removeEventListener("mousemove", E), document.removeEventListener("mouseleave", M), document.removeEventListener("mouseup", M), document.removeEventListener("contextmenu", M);
2409
+ };
2410
+ }, [
2411
+ b,
2412
+ k,
2413
+ V,
2414
+ y,
2415
+ X,
2416
+ P,
2417
+ p
2418
+ ]), O(() => {
2419
+ if (d || _)
2420
+ return;
2421
+ const v = g.current;
2422
+ if (!v)
2423
+ return;
2424
+ const s = () => {
2425
+ const E = k();
2426
+ Number.isNaN(E) || (L(E), E === I && f(null));
2427
+ };
2428
+ return v.addEventListener("scroll", s), () => {
2429
+ v.removeEventListener("scroll", s);
2430
+ };
2431
+ }, [
2432
+ k,
2433
+ d,
2434
+ V,
2435
+ _,
2436
+ I,
2437
+ l.length,
2438
+ L,
2439
+ f
2440
+ ]), O(() => {
2441
+ if (I === null)
2442
+ return;
2443
+ const v = () => z();
2444
+ switch (C) {
2445
+ case "first_to_last":
2446
+ y(l.length, "instant"), y(l.length - 1, "smooth", v);
2447
+ break;
2448
+ case "last_to_first":
2449
+ y(0, "instant"), y(1, "smooth", v);
2450
+ break;
2451
+ case "instant":
2452
+ y(I, "instant", v);
2453
+ break;
2454
+ default:
2455
+ y(I, "smooth");
2456
+ break;
2457
+ }
2458
+ }, [
2459
+ C,
2460
+ z,
2461
+ I,
2462
+ l.length,
2463
+ y
2464
+ ]);
2465
+ const R = () => /* @__PURE__ */ t("div", { className: "h-full", style: i });
2466
+ return /* @__PURE__ */ A(
2467
+ "div",
2468
+ {
2469
+ className: H(
2470
+ "relative overflow-hidden rounded-carrousel transition-radius",
2471
+ e
2472
+ ),
2473
+ style: i,
2474
+ children: [
2475
+ /* @__PURE__ */ A(
2476
+ "div",
2477
+ {
2478
+ ref: g,
2479
+ className: `flex size-full ${p ? "overflow-x-auto no-scrollbar *:snap-start *:snap-always" : "justify-center"}`,
2480
+ children: [
2481
+ C === "last_to_first" && /* @__PURE__ */ t(R, {}),
2482
+ l.map((v, s) => {
2483
+ const E = s === m, M = s === 0, D = s === l.length - 1, Y = (() => {
2484
+ if (C === "first_to_last" && M)
2485
+ return {
2486
+ transform: `translateX(${100 * l.length}%)`
2487
+ };
2488
+ if (C === "last_to_first" && D)
2489
+ return {
2490
+ transform: `translateX(-${100 * l.length}%)`
2491
+ };
2492
+ })();
2493
+ let F = Math.abs(s - m) <= n;
2494
+ F ||= s === I, r && (F ||= m < n && l.length - s <= n - m, F ||= m >= l.length - n && s <= n - (l.length - m));
2495
+ const $ = (() => {
2496
+ let U;
2497
+ switch (v.type) {
2498
+ case "360":
2499
+ U = v.images[0].src;
2500
+ break;
2501
+ case "image":
2502
+ U = v.src;
2503
+ break;
2504
+ case "video":
2505
+ U = v.poster ?? "video";
2506
+ break;
2507
+ case "custom":
2508
+ U = "custom";
2509
+ break;
2510
+ }
2511
+ return `${s}_${U}`;
2512
+ })();
2513
+ return /* @__PURE__ */ t(
2514
+ "div",
2515
+ {
2516
+ className: H(
2517
+ "h-full bg-foreground/35",
2518
+ m === s && "z-1"
2519
+ // Give high-ground to the shown item (to avoid 1px vertical line)
2520
+ ),
2521
+ style: { ...i, ...Y },
2522
+ children: F && /* @__PURE__ */ t(br, { index: s, item: v, isShown: E })
2523
+ },
2524
+ $
2525
+ );
2526
+ }),
2527
+ C === "first_to_last" && /* @__PURE__ */ t(R, {})
2528
+ ]
2529
+ }
2530
+ ),
2531
+ /* @__PURE__ */ t(_r, {})
2532
+ ]
2533
+ }
2534
+ );
2535
+ }, Pr = () => {
2536
+ const { permanentGallery: e } = ne(), { aspectRatioStyle: r } = se(), {
2537
+ prevItem: n,
2538
+ nextItem: o,
2539
+ isShowingDetails: i,
2540
+ resetShownDetails: l,
2541
+ extendMode: p,
2542
+ disableExtendMode: m,
2543
+ isZooming: L,
2544
+ resetZoom: I,
2545
+ fakeFullScreen: f
2546
+ } = Q(), C = j(null), V = j(null), z = j(null);
2547
+ return O(() => {
2548
+ if (!p)
2549
+ return;
2550
+ const a = C.current, d = V.current, g = z.current;
2551
+ if (!a || !d || !g)
2552
+ return;
2553
+ let x = !1;
2554
+ const w = (h) => [a, d, g].includes(h.target), u = (h) => {
2555
+ x = w(h);
2556
+ }, c = (h) => {
2557
+ x && (w(h) && m(), x = !1);
2558
+ };
2559
+ return a.addEventListener("mousedown", u), a.addEventListener("mouseup", c), () => {
2560
+ a.removeEventListener("mousedown", u), a.removeEventListener("mouseup", c);
2561
+ };
2562
+ }, [m, p]), O(() => {
2563
+ const a = (d) => {
2564
+ d.key === "Escape" && (L ? I() : i ? l() : m());
2565
+ };
2566
+ return addEventListener("keydown", a), () => {
2567
+ removeEventListener("keydown", a);
2568
+ };
2569
+ }, [
2570
+ m,
2571
+ i,
2572
+ L,
2573
+ o,
2574
+ n,
2575
+ l,
2576
+ I
2577
+ ]), /* @__PURE__ */ A(
2578
+ "div",
2579
+ {
2580
+ ref: C,
2581
+ className: H(
2582
+ f ? "fixed inset-0 z-overlay" : "relative",
2583
+ p && "flex size-full items-center justify-center bg-foreground/75"
2584
+ ),
2585
+ children: [
2586
+ /* @__PURE__ */ A(
2587
+ "div",
2588
+ {
2589
+ ref: V,
2590
+ className: p ? "flex size-full flex-col justify-center gap-y-2 small:gap-y-4" : "space-y-2",
2591
+ children: [
2592
+ /* @__PURE__ */ t(
2593
+ "div",
2594
+ {
2595
+ ref: z,
2596
+ className: H(
2597
+ p && "mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"
2598
+ ),
2599
+ style: r,
2600
+ children: /* @__PURE__ */ t(Vr, { className: H(p && "h-full min-w-0") })
2601
+ }
2602
+ ),
2603
+ e && /* @__PURE__ */ t(yt, { className: H(p && "my-2 shrink-0 small:my-4") })
2604
+ ]
2605
+ }
2606
+ ),
2607
+ p && /* @__PURE__ */ t(
2608
+ ht,
2609
+ {
2610
+ className: "absolute right-2 top-2 small:right-4 small:top-4",
2611
+ onClick: m
2612
+ }
2613
+ )
2614
+ ]
2615
+ }
2616
+ );
2617
+ }, Hr = () => {
2618
+ const { emitEvent: e, compositionUrl: r } = ne(), {
2619
+ data: n,
2620
+ status: o,
2621
+ isSuccess: i,
2622
+ error: l
2623
+ } = Wt(r);
2624
+ return O(() => {
2625
+ l ? e(Ke, l) : o === "fetching" ? e(Be, r) : i && e(qe, n);
2626
+ }, [n, r, e, l, i, o]), l ? /* @__PURE__ */ t(
2627
+ ft,
2628
+ {
2629
+ className: "aspect-square text-foreground/70",
2630
+ text: "Player could not be loaded"
2631
+ }
2632
+ ) : i ? /* @__PURE__ */ t(Xt, { composition: n, children: /* @__PURE__ */ t(Yt, { children: /* @__PURE__ */ t(Pr, {}) }) }) : /* @__PURE__ */ A("div", { className: "flex aspect-square size-full flex-col items-center justify-center gap-y-4", children: [
2633
+ /* @__PURE__ */ t("div", { className: "animate-pulse text-xl", children: "Loading Player" }),
2634
+ /* @__PURE__ */ t(gt, { color: "foreground" })
2635
+ ] });
2636
+ }, Dr = ({
2637
+ compositionUrl: e,
2638
+ hideCategories: r = Nt,
2639
+ infiniteCarrousel: n = Tt,
2640
+ permanentGallery: o = zt,
2641
+ mediaLoadStrategy: i = St,
2642
+ minMediaWidth: l = _t,
2643
+ maxMediaWidth: p = Vt,
2644
+ preloadRange: m = Pt,
2645
+ preventFullScreen: L = Ht,
2646
+ eventPrefix: I = st,
2647
+ reverse360: f = Dt,
2648
+ children: C
2649
+ // NOTE: use to customize the player, not to display the content
2650
+ }) => {
2651
+ const V = j(null), [z, a] = Z(0.5), [d, g] = Z(!1), x = T(
2652
+ (c, h) => {
2653
+ const b = I + c, k = new CustomEvent(b, { detail: h });
2654
+ document.dispatchEvent(k);
2655
+ },
2656
+ [I]
2657
+ );
2658
+ O(() => {
2659
+ if (d) {
2660
+ a(1);
2661
+ return;
2662
+ }
2663
+ if (!V.current)
2664
+ return;
2665
+ const c = V.current, h = () => {
2666
+ const b = window.innerWidth, k = c.clientWidth;
2667
+ a(k / b);
2668
+ };
2669
+ return h(), addEventListener("resize", h), () => {
2670
+ removeEventListener("resize", h);
2671
+ };
2672
+ }, [d]), O(() => {
2673
+ if (L)
2674
+ return;
2675
+ const c = V.current;
2676
+ if (!c)
2677
+ throw new Error("Wrapper not found");
2678
+ const h = () => {
2679
+ const { fullscreenElement: b } = document;
2680
+ g(
2681
+ b === c || // NOTE: For custom element, the web browser is making the whole custom element full-screen and not only the wrapper
2682
+ b?.localName === Pe
2683
+ );
2684
+ };
2685
+ return document.addEventListener("fullscreenchange", h), () => {
2686
+ document.removeEventListener("fullscreenchange", h);
2687
+ };
2688
+ }, [L]);
2689
+ const w = T(async () => {
2690
+ const c = V.current;
2691
+ if (!c)
2692
+ throw new Error("Wrapper not found");
2693
+ try {
2694
+ return await c.requestFullscreen(), !0;
2695
+ } catch {
2696
+ return !1;
2697
+ }
2698
+ }, []), u = T(async () => {
2699
+ try {
2700
+ return await document.exitFullscreen(), !0;
2701
+ } catch {
2702
+ return !1;
2703
+ }
2704
+ }, []);
2705
+ return /* @__PURE__ */ t(
2706
+ Ot,
2707
+ {
2708
+ compositionUrl: e,
2709
+ hideCategories: r,
2710
+ infiniteCarrousel: n,
2711
+ permanentGallery: o,
2712
+ mediaLoadStrategy: i,
2713
+ minMediaWidth: l,
2714
+ maxMediaWidth: p,
2715
+ preloadRange: m,
2716
+ preventFullScreen: L,
2717
+ reverse360: f,
2718
+ emitEvent: x,
2719
+ playerInViewportWidthRatio: z,
2720
+ isFullScreen: d,
2721
+ requestFullscreen: w,
2722
+ exitFullscreen: u,
2723
+ children: /* @__PURE__ */ A(Zt, { children: [
2724
+ /* @__PURE__ */ t(
2725
+ "div",
2726
+ {
2727
+ ref: V,
2728
+ className: "select-none text-foreground",
2729
+ style: {
2730
+ "--background": "var(--cc-webplayer-background, 0 0% 100%)",
2731
+ "--foreground": "var(--cc-webplayer-foreground, 240 10% 3.9%)",
2732
+ "--primary": "var(--cc-webplayer-primary, 216 100% 52%)",
2733
+ "--primary-foreground": "var(--cc-webplayer-primary-foreground, var(--background))",
2734
+ "--primary-light": "var(--cc-webplayer-primary-light, var(--primary))",
2735
+ "--neutral": "var(--cc-webplayer-neutral, 0 0% 39%)",
2736
+ "--neutral-foreground": "var(--cc-webplayer-neutral-foreground, var(--foreground))",
2737
+ "--radius-ui": "var(--cc-webplayer-radius-ui, 1rem)",
2738
+ "--radius-carrousel": "var(--cc-webplayer-radius-carrousel, 0)",
2739
+ "--radius-gallery": "var(--cc-webplayer-radius-gallery, 0)"
2740
+ },
2741
+ children: /* @__PURE__ */ t(Hr, {})
2742
+ }
2743
+ ),
2744
+ C
2745
+ ] })
2746
+ }
2747
+ );
2748
+ }, Rr = ({ children: e, index: r, thumbnailSrc: n }) => {
2749
+ const { registerCustomMedia: o, unregisterCustomMedia: i } = ve();
2750
+ return O(() => {
2751
+ if (!e)
2752
+ return;
2753
+ const l = o({
2754
+ Media: e,
2755
+ index: r,
2756
+ thumbnailSrc: n
2757
+ });
2758
+ return () => {
2759
+ i(l);
2760
+ };
2761
+ }, [e, i, r, o, n]), null;
2762
+ }, Gr = (e) => He() ? /* @__PURE__ */ t(Rr, { ...e }) : /* @__PURE__ */ t("slot", {}), Ar = ({ name: e, children: r }) => {
2763
+ const { registerIconConfig: n, unregisterIconConfig: o } = ve();
2764
+ return O(() => {
2765
+ if (r)
2766
+ return n(e, {
2767
+ Icon: r
2768
+ }), () => {
2769
+ o(e);
2770
+ };
2771
+ }, [r, e, n, o]), null;
2772
+ }, Br = (e) => He() ? /* @__PURE__ */ t(Ar, { ...e }) : /* @__PURE__ */ t("slot", {}), Wr = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.\\!container{width:100%!important}.container{width:100%}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.\\!absolute{position:absolute!important}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-x-1{left:.25rem;right:.25rem}.inset-y-1{top:.25rem;bottom:.25rem}.-bottom-1{bottom:-.25rem}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.left-0{left:0}.left-1{left:.25rem}.left-1\\/2{left:50%}.right-1{right:.25rem}.right-2{right:.5rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-2{top:.5rem}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-1{z-index:1}.z-hotspot{z-index:10}.z-overlay{z-index:30}.z-zoomed-image{z-index:20}.col-start-3{grid-column-start:3}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-ml-px{margin-left:-1px}.-mt-px{margin-top:-1px}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-1{width:.25rem;height:.25rem}.size-12{width:3rem;height:3rem}.size-20{width:5rem;height:5rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-1{height:.25rem}.h-10{height:2.5rem}.h-20{height:5rem}.h-3\\/4{height:75%}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-12{width:3rem}.w-3\\/5{width:60%}.w-8{width:2rem}.w-\\[calc\\(100\\%\\+1024px\\)\\]{width:calc(100% + 1024px)}.w-\\[calc\\(100\\%\\+2px\\)\\]{width:calc(100% + 2px)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.max-w-40{max-width:10rem}.max-w-\\[1600px\\]{max-width:1600px}.shrink-0{flex-shrink:0}.origin-top-left{transform-origin:top left}.-translate-x-1\\.5{--tw-translate-x: -.375rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\.5{--tw-translate-x: .375rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-scale-x-100{--tw-scale-x: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes hotspot-ping{0%{transform:scale(0)}25%{opacity:1}75%,to{transform:scale(1.5);opacity:0}}.animate-hotspot-ping{animation:hotspot-ping 3s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:1}0%,to{opacity:0}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-rotation{animation:rotation 1s linear infinite}.cursor-auto{cursor:auto}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-\\[auto\\,1fr\\,auto\\]{grid-template-columns:auto 1fr auto}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-4{row-gap:1rem}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-scroll{overflow-x:scroll}.text-pretty{text-wrap:pretty}.rounded-carrousel{border-radius:var(--radius-carrousel)}.rounded-full{border-radius:9999px}.rounded-gallery{border-radius:var(--radius-gallery)}.rounded-ui{border-radius:var(--radius-ui)}.rounded-ui-md{border-radius:calc(var(--radius-ui) + .125rem)}.rounded-ui-sm{border-radius:calc(var(--radius-ui) - .125rem)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-background{border-color:hsl(var(--background))}.border-foreground{border-color:hsl(var(--foreground))}.border-primary{border-color:hsl(var(--primary))}.border-b-transparent{border-bottom-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\\/25{background-color:hsl(var(--background) / .25)}.bg-background\\/50{background-color:hsl(var(--background) / .5)}.bg-background\\/60{background-color:hsl(var(--background) / .6)}.bg-foreground\\/25{background-color:hsl(var(--foreground) / .25)}.bg-foreground\\/30{background-color:hsl(var(--foreground) / .3)}.bg-foreground\\/35{background-color:hsl(var(--foreground) / .35)}.bg-foreground\\/40{background-color:hsl(var(--foreground) / .4)}.bg-foreground\\/50{background-color:hsl(var(--foreground) / .5)}.bg-foreground\\/60{background-color:hsl(var(--foreground) / .6)}.bg-foreground\\/65{background-color:hsl(var(--foreground) / .65)}.bg-foreground\\/75{background-color:hsl(var(--foreground) / .75)}.bg-neutral\\/50{background-color:hsl(var(--neutral) / .5)}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\\/50{background-color:hsl(var(--primary) / .5)}.bg-transparent{background-color:transparent}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-foreground{--tw-gradient-from: hsl(var(--foreground)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--foreground) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pl-6{padding-left:1.5rem}.pr-12{padding-right:3rem}.pr-4{padding-right:1rem}.pt-8{padding-top:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-background{color:hsl(var(--background))}.text-background\\/75{color:hsl(var(--background) / .75)}.text-foreground{color:hsl(var(--foreground))}.text-foreground\\/65{color:hsl(var(--foreground) / .65)}.text-foreground\\/70{color:hsl(var(--foreground) / .7)}.text-neutral-foreground{color:hsl(var(--neutral-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary-light{color:hsl(var(--primary-light))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[width\\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-radius{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-details{transition-duration:.35s}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{display:none}.\\[mask-image\\:linear-gradient\\(to_left\\,transparent_0px\\,black_4px\\,black_calc\\(100\\%-4px\\)\\,transparent_100\\%\\)\\]{-webkit-mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%);mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%)}.\\*\\:pointer-events-auto>*{pointer-events:auto}.\\*\\:size-full>*{width:100%;height:100%}.\\*\\:snap-start>*{scroll-snap-align:start}.\\*\\:snap-always>*{scroll-snap-stop:always}.\\*\\:object-cover>*{-o-object-fit:cover;object-fit:cover}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:0}.after\\:rounded-gallery:after{content:var(--tw-content);border-radius:var(--radius-gallery)}.after\\:border-2:after{content:var(--tw-content);border-width:2px}.after\\:border-primary:after{content:var(--tw-content);border-color:hsl(var(--primary))}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:z-hotspot-hover:hover{z-index:11}.hover\\:bg-foreground\\/25:hover{background-color:hsl(var(--foreground) / .25)}.hover\\:bg-primary\\/25:hover{background-color:hsl(var(--primary) / .25)}.hover\\:bg-primary\\/30:hover{background-color:hsl(var(--primary) / .3)}.hover\\:opacity-80:hover{opacity:.8}.hover\\:after\\:opacity-70:hover:after{content:var(--tw-content);opacity:.7}.disabled\\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\\:pointer-events-auto{pointer-events:auto}.group\\/volume:hover .group-hover\\/volume\\:opacity-100{opacity:1}.group\\/volume:hover .group-hover\\/volume\\:opacity-50{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}@media ((orientation: portrait) and (max-width: 767px)) or ((orientation: landscape) and (max-width: 1023px)){.max-small\\:hidden{display:none}}@media ((orientation: portrait) and (min-width: 768px)) or ((orientation: landscape) and (min-width: 1024px)){.small\\:inset-x-2{left:.5rem;right:.5rem}.small\\:inset-y-2{top:.5rem;bottom:.5rem}.small\\:bottom-2{bottom:.5rem}.small\\:left-2{left:.5rem}.small\\:right-2{right:.5rem}.small\\:right-4{right:1rem}.small\\:top-2{top:.5rem}.small\\:top-4{top:1rem}.small\\:my-4{margin-top:1rem;margin-bottom:1rem}.small\\:hidden{display:none}.small\\:h-12{height:3rem}.small\\:h-28{height:7rem}.small\\:max-w-48{max-width:12rem}.small\\:gap-2{gap:.5rem}.small\\:gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.small\\:gap-y-2{row-gap:.5rem}.small\\:gap-y-4{row-gap:1rem}.small\\:space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.small\\:p-3{padding:.75rem}.small\\:px-2{padding-left:.5rem;padding-right:.5rem}.small\\:py-1{padding-top:.25rem;padding-bottom:.25rem}.small\\:pl-8{padding-left:2rem}.small\\:pr-6{padding-right:1.5rem}.small\\:text-base{font-size:1rem;line-height:1.5rem}.small\\:text-sm{font-size:.875rem;line-height:1.25rem}.small\\:font-bold{font-weight:700}}@media (min-width: 1280px){.large\\:h-20{height:5rem}.large\\:h-3\\/5{height:60%}.large\\:max-w-56{max-width:14rem}.large\\:gap-4{gap:1rem}.large\\:p-2{padding:.5rem}.large\\:p-4{padding:1rem}.large\\:text-base{font-size:1rem;line-height:1.5rem}.large\\:text-lg{font-size:1.125rem;line-height:1.75rem}}';
2773
+ function Or(e) {
2774
+ return e.replace(
2775
+ /([a-z0-9])([A-Z])/g,
2776
+ (r, n, o) => `${n}-${o.toLowerCase()}`
2777
+ );
2778
+ }
2779
+ function Re(e) {
2780
+ return Object.entries(e).reduce((r, [n, o]) => {
2781
+ if (o !== void 0) {
2782
+ const i = Or(n);
2783
+ r[i] = o.toString();
2784
+ }
2785
+ return r;
2786
+ }, {});
2787
+ }
2788
+ const qr = (e) => /* @__PURE__ */ A(ie, { children: [
2789
+ /* @__PURE__ */ t("style", { children: Wr }),
2790
+ /* @__PURE__ */ t(Dr, { ...e })
2791
+ ] }), Xr = (e) => Re(e), Zr = (e) => Re(e), Yr = (e) => Re(e), Kr = ({
2792
+ onCompositionLoading: e,
2793
+ onCompositionLoaded: r,
2794
+ onCompositionLoadError: n,
2795
+ onItemChange: o,
2796
+ onExtendModeOn: i,
2797
+ onExtendModeOff: l,
2798
+ onHotspotsOn: p,
2799
+ onHotspotsOff: m,
2800
+ onGalleryOpen: L,
2801
+ onGalleryClose: I,
2802
+ className: f,
2803
+ style: C = {},
2804
+ children: V,
2805
+ ...z
2806
+ }) => {
2807
+ const a = re(() => {
2808
+ const d = Xr(z);
2809
+ return f && Object.assign(d, { class: f }), d;
2810
+ }, [f, z]);
2811
+ return O(() => {
2812
+ const d = z.eventPrefix ?? st, g = (u) => `${d}${u}`, x = {
2813
+ [Be]: e,
2814
+ [qe]: r,
2815
+ [Ke]: n,
2816
+ [Je]: o,
2817
+ [Qe]: i,
2818
+ [et]: l,
2819
+ [tt]: p,
2820
+ [rt]: m,
2821
+ [nt]: L,
2822
+ [ot]: I
2823
+ }, w = /* @__PURE__ */ new Map();
2824
+ return Object.entries(x).forEach(([u, c]) => {
2825
+ if (!c)
2826
+ return;
2827
+ const h = g(u), b = (k) => c(k.detail);
2828
+ w.set(h, b), document.addEventListener(h, b);
2829
+ }), () => {
2830
+ w.forEach((u, c) => {
2831
+ document.removeEventListener(c, u);
2832
+ });
2833
+ };
2834
+ }, [
2835
+ z.eventPrefix,
2836
+ e,
2837
+ r,
2838
+ n,
2839
+ o,
2840
+ i,
2841
+ l,
2842
+ p,
2843
+ m,
2844
+ L,
2845
+ I
2846
+ ]), /* @__PURE__ */ t("cc-webplayer", { style: { display: "block", ...C }, ...a, children: V });
2847
+ }, Jr = ({ children: e, ...r }) => {
2848
+ const n = Zr(r);
2849
+ return /* @__PURE__ */ t("cc-webplayer-custom-media", { ...n, children: e });
2850
+ }, Qr = ({
2851
+ children: e,
2852
+ ...r
2853
+ }) => {
2854
+ const n = Yr(r);
2855
+ return /* @__PURE__ */ t("cc-webplayer-icon", { ...n, children: e });
2856
+ };
2857
+ export {
2858
+ st as D,
2859
+ Be as E,
2860
+ qr as W,
2861
+ Gr as a,
2862
+ Br as b,
2863
+ Ur as c,
2864
+ Pe as d,
2865
+ Ue as e,
2866
+ Ge as f,
2867
+ Kr as g,
2868
+ Jr as h,
2869
+ Qr as i,
2870
+ qe as j,
2871
+ Ke as k,
2872
+ Je as l,
2873
+ Qe as m,
2874
+ et as n,
2875
+ tt as o,
2876
+ rt as p,
2877
+ nt as q,
2878
+ ot as r,
2879
+ $r as s
2880
+ };