@car-cutter/react-webplayer 0.13.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4705 +0,0 @@
1
- import { jsx as i, jsxs as pe, Fragment as at } from "react/jsx-runtime";
2
- import Ar, { useState as Le, useEffect as fe, createContext as Et, useContext as Ct, useMemo as et, useCallback as j, useRef as Ie, Fragment as Hr, PureComponent as Or } from "react";
3
- const St = "cc-webplayer", Jt = "cc-webplayer-custom-media", Qt = "cc-webplayer-icon", $t = "composition-loading", er = "composition-loaded", tr = "composition-load-error", rr = "item-change", or = "extend-mode-on", nr = "extend-mode-off", ar = "hotspots-on", ir = "hotspots-off", sr = "gallery-open", lr = "gallery-close", Fr = !1, Ur = !1, Vr = !1, Br = "quality", Wr = 0, Xr = 1 / 0, Yr = 1, Zr = !1, Gr = !1, jr = "*", qr = "full_screen", cr = "cc-webplayer:", Kr = !1, Jr = !1;
4
- function En(r, a) {
5
- return `https://cdn.car-cutter.com/gallery/${r}/${a}/composition_v3.json`;
6
- }
7
- function Qr(r, a) {
8
- const l = r.split("/"), s = l.pop();
9
- return [l.join("/"), a, s].join("/");
10
- }
11
- function Cn() {
12
- return !!customElements.get(St) && !!customElements.get(Jt) && !!customElements.get(Qt);
13
- }
14
- async function $r(r) {
15
- const a = await fetch(r);
16
- if (!a.ok)
17
- throw new Error(`Failed to fetch composition: ${a.statusText}`);
18
- return await a.json();
19
- }
20
- const Rt = /* @__PURE__ */ new Map(), eo = (r) => {
21
- const [a, l] = Le({
22
- status: "pending",
23
- isSuccess: !1
24
- });
25
- return fe(() => {
26
- const s = (f) => l({ status: "success", data: f, isSuccess: !0 }), p = Rt.get(r);
27
- if (p && !(p instanceof Promise)) {
28
- s(p);
29
- return;
30
- }
31
- l({
32
- status: "fetching",
33
- isSuccess: !1
34
- }), async function() {
35
- try {
36
- let f;
37
- if (p)
38
- f = await p;
39
- else {
40
- const E = $r(r);
41
- Rt.set(r, E), f = await E, Rt.set(r, f);
42
- }
43
- s(f);
44
- } catch (f) {
45
- l({
46
- status: "error",
47
- isSuccess: !1,
48
- error: f
49
- });
50
- }
51
- }();
52
- }, [r]), a;
53
- }, ur = Et(null), $e = () => {
54
- const r = Ct(ur);
55
- if (!r)
56
- throw new Error(
57
- "useGlobalContext must be used within a GlobalContextProvider"
58
- );
59
- return r;
60
- }, to = ({ children: r, ...a }) => /* @__PURE__ */ i(ur.Provider, { value: a, children: r }), dr = Et(null), it = () => {
61
- const r = Ct(dr);
62
- if (!r)
63
- throw new Error(
64
- "useCompositionContext must be used within a CompositionContextProvider"
65
- );
66
- return r;
67
- }, ro = ({ composition: r, children: a }) => {
68
- const {
69
- aspectRatio: l,
70
- categories: s,
71
- imageHdWidth: p,
72
- imageSubWidths: f
73
- } = r, { minMediaWidth: E, maxMediaWidth: e, categoriesFilter: x } = $e(), b = et(() => {
74
- if (x === "*")
75
- return s;
76
- function o(L) {
77
- return x.split("|").some((D) => new RegExp(`^${D.replace(/\*/g, ".*")}$`).test(L));
78
- }
79
- return s.filter(({ id: L }) => o(L));
80
- }, [s, x]), z = et(
81
- () => b.flatMap(({ items: o }) => o),
82
- [b]
83
- ), y = {
84
- aspectRatio: l.replace(":", " / ")
85
- }, h = et(() => {
86
- const o = f.concat(p), L = o.sort((k, m) => k - m), D = L.filter(
87
- (k) => k >= E && k <= e
88
- );
89
- if (D.length === 0) {
90
- const k = (E + e) / 2, m = o.reduce(
91
- (N, w) => Math.abs(w - k) < Math.abs(N - k) ? w : N,
92
- p
93
- );
94
- return console.warn(
95
- `None of available media widths (${L.join("|")}) match the given constraints (${E > 0 ? `${E} ≤ ` : ""}width${e < 1 / 0 ? ` ≤ ${e}` : ""}).`,
96
- `Using the closest width instead (${m}).`
97
- ), [m];
98
- }
99
- return D;
100
- }, [f, p, E, e]);
101
- return /* @__PURE__ */ i(
102
- dr.Provider,
103
- {
104
- value: {
105
- ...r,
106
- categories: b,
107
- items: z,
108
- aspectRatioStyle: y,
109
- usedMediaWidths: h
110
- },
111
- children: a
112
- }
113
- );
114
- }, pr = 500, dt = 0.75, ct = 1 + dt * 2;
115
- function tt(r, a, l) {
116
- return Math.min(Math.max(r, a), l);
117
- }
118
- const yt = (r, a, l) => r + (a - r) * l, Bt = (r, a, l, s, p, f = !1) => {
119
- const E = tt(r, a, l);
120
- if (E === (f ? l : a)) return s;
121
- if (E === (f ? a : l)) return 1;
122
- const e = (E - a) / (l - a), b = 1 + (f ? e : 1 - e) * (s - 1), y = 1 + Math.round((b - 1) / p) * p;
123
- return tt(y, 1, s);
124
- }, hr = Et(null), _t = () => Ct(hr), ft = () => {
125
- const r = _t();
126
- if (!r)
127
- throw new Error(
128
- "useCustomizationContext must be used within a CustomizationContextProvider"
129
- );
130
- return r;
131
- }, Wt = "*:size-full", Xt = "*:object-cover *:size-full", oo = ({ children: r }) => {
132
- const { compositionUrl: a } = $e(), l = j(
133
- () => document.querySelector(
134
- `${St}[composition-url="${a}"]`
135
- ),
136
- [a]
137
- ), s = j((L) => {
138
- const D = L.querySelectorAll(Qt), k = /* @__PURE__ */ new Map();
139
- for (const m of D) {
140
- const N = m.getAttribute("name");
141
- if (!N) {
142
- console.warn("Icon element is missing a name attribute");
143
- continue;
144
- }
145
- const w = m.innerHTML, d = w ? /* @__PURE__ */ i(
146
- "div",
147
- {
148
- className: Wt,
149
- dangerouslySetInnerHTML: { __html: w }
150
- }
151
- ) : void 0;
152
- if (!d) {
153
- console.warn(`Icon "${N}" customization is empty.`);
154
- continue;
155
- }
156
- k.set(N, { Icon: d });
157
- }
158
- return k;
159
- }, []), [p, f] = Le(
160
- () => {
161
- const L = l();
162
- return L ? s(L) : /* @__PURE__ */ new Map();
163
- }
164
- );
165
- fe(() => {
166
- const L = l();
167
- if (!L)
168
- return;
169
- const D = new MutationObserver(() => {
170
- f(s(L));
171
- });
172
- return D.observe(L, {
173
- childList: !0,
174
- subtree: !0
175
- }), () => D.disconnect();
176
- }, [s, l]);
177
- const E = j(
178
- (L) => p.get(L),
179
- [p]
180
- ), e = j(
181
- (L, D) => {
182
- f((k) => {
183
- const { Icon: m, ...N } = D;
184
- return new Map(
185
- k.set(L, {
186
- ...N,
187
- Icon: /* @__PURE__ */ i("div", { className: Wt, children: m })
188
- })
189
- );
190
- });
191
- },
192
- []
193
- ), x = j((L) => {
194
- f((D) => (D.delete(L), new Map(D)));
195
- }, []), b = j((L) => {
196
- const D = L.querySelectorAll(
197
- Jt
198
- ), k = new Array();
199
- for (const m of D) {
200
- const N = m.innerHTML;
201
- if (!N) {
202
- console.warn("Custom media element is empty");
203
- continue;
204
- }
205
- const w = Number(m.getAttribute("index"));
206
- if (Number.isNaN(w)) {
207
- console.warn("Custom media element is missing the 'index' attribute");
208
- continue;
209
- }
210
- const d = m.getAttribute("thumbnail-src") ?? void 0, C = JSON.stringify({ index: w, thumbnailSrc: d });
211
- k.push({
212
- id: C,
213
- Media: /* @__PURE__ */ i(
214
- "div",
215
- {
216
- className: Xt,
217
- dangerouslySetInnerHTML: { __html: N }
218
- }
219
- ),
220
- index: w,
221
- thumbnailSrc: d
222
- });
223
- }
224
- return k;
225
- }, []), [z, y] = Le(() => {
226
- const L = l();
227
- return L ? b(L) : [];
228
- });
229
- fe(() => {
230
- const L = l();
231
- if (!L)
232
- return;
233
- const D = new MutationObserver(() => {
234
- y(b(L));
235
- });
236
- return D.observe(L, {
237
- childList: !0,
238
- subtree: !0
239
- }), () => D.disconnect();
240
- }, [b, l]);
241
- const h = j((L) => {
242
- const { Media: D, ...k } = L, m = /* @__PURE__ */ i("div", { className: Xt, children: D }), N = JSON.stringify(k);
243
- return y((w) => [
244
- ...w,
245
- {
246
- id: N,
247
- Media: m,
248
- ...k
249
- }
250
- ]), N;
251
- }, []), o = j((L) => {
252
- y(
253
- (D) => D.filter((k) => k.id !== L)
254
- );
255
- }, []);
256
- return /* @__PURE__ */ i(
257
- hr.Provider,
258
- {
259
- value: {
260
- getIconConfig: E,
261
- registerIconConfig: e,
262
- unregisterIconConfig: x,
263
- customMediaList: z,
264
- registerCustomMedia: h,
265
- unregisterCustomMedia: o
266
- },
267
- children: r
268
- }
269
- );
270
- }, fr = Et(null), Ke = () => {
271
- const r = Ct(fr);
272
- if (!r)
273
- throw new Error(
274
- "useControlsContext must be used within a ControlsContextProvider"
275
- );
276
- return r;
277
- }, no = ({
278
- children: r
279
- }) => {
280
- const {
281
- infiniteCarrousel: a,
282
- extendBehavior: l,
283
- emitEvent: s,
284
- isFullScreen: p,
285
- requestFullscreen: f,
286
- exitFullscreen: E
287
- } = $e(), { customMediaList: e } = ft(), { categories: x, items: b } = it(), z = et(() => {
288
- const Z = new Array(
289
- ...b
290
- ), ie = e.slice().sort((ge, be) => ge.index < 0 && be.index < 0 ? be.index - ge.index : ge.index < 0 ? 1 : be.index < 0 ? -1 : ge.index - be.index);
291
- for (const ge of ie) {
292
- let be = ge.index;
293
- be < 0 && (be = Z.length + be + 1), Z.splice(be, 0, {
294
- type: "custom",
295
- ...ge
296
- });
297
- }
298
- return Z;
299
- }, [b, e]), [y, h] = Le(z.map(() => null));
300
- fe(() => {
301
- h(z.map(() => null));
302
- }, [z]);
303
- const o = j(
304
- (Z, ie) => {
305
- h(
306
- (ge) => ge.map((be, _e) => _e === Z ? ie : be)
307
- );
308
- },
309
- []
310
- ), [L, D] = Le(0), [k, m] = Le(null), N = k ?? L, w = z[N], d = y[N], [C, P] = Le(
311
- null
312
- ), O = !!C, M = j(() => P(null), []), X = j(() => {
313
- if (O || k !== null)
314
- return;
315
- const Z = L - 1;
316
- Z >= 0 ? m(Z) : a && (P("first_to_last"), m(z.length - 1));
317
- }, [
318
- O,
319
- k,
320
- L,
321
- a,
322
- z.length
323
- ]), S = j(() => {
324
- if (O || k !== null)
325
- return;
326
- const Z = L + 1;
327
- Z < z.length ? m(Z) : a && (P("last_to_first"), m(0));
328
- }, [
329
- O,
330
- k,
331
- L,
332
- z.length,
333
- a
334
- ]), V = j(
335
- (Z) => {
336
- const ie = Math.min(L, Z), ge = Math.max(L, Z);
337
- y.slice(ie, ge + 1).filter((_e) => _e === null).length > 2 && P("instant"), m(Z);
338
- },
339
- [L, y]
340
- );
341
- fe(() => {
342
- s(rr, {
343
- index: N,
344
- item: w
345
- });
346
- }, [w, s, N]);
347
- const te = et(() => {
348
- let Z;
349
- if (w.type === "custom") {
350
- const ie = z.slice(0, N).reverse().find((ge) => ge.type !== "custom") ?? z.slice(N + 1).find((ge) => ge.type !== "custom");
351
- if (!ie)
352
- throw new Error("No non-custom item found");
353
- Z = ie;
354
- } else
355
- Z = w;
356
- for (const ie of x)
357
- if (ie.items.includes(Z))
358
- return ie.id;
359
- throw new Error("Current item not found in any category");
360
- }, [x, w, z, N]), W = j(
361
- (Z) => {
362
- const ie = x.find(({ id: be }) => be === Z)?.items[0];
363
- if (ie === void 0)
364
- throw new Error("Failed to find target category");
365
- const ge = z.findIndex((be) => be === ie);
366
- V(ge);
367
- },
368
- [x, z, V]
369
- ), I = et(() => {
370
- switch (w.type) {
371
- case "image":
372
- return !!w.hotspots?.length;
373
- case "360":
374
- return d === "running" && w.images.some((Z) => !!Z.hotspots?.length);
375
- default:
376
- return !1;
377
- }
378
- }, [w, d]), [F, T] = Le(!0), B = j(() => {
379
- const Z = !F;
380
- T(Z), s(Z ? ar : ir);
381
- }, [s, F]), J = et(() => {
382
- switch (w.type) {
383
- case "video":
384
- return d !== "running";
385
- default:
386
- return !0;
387
- }
388
- }, [w, d]), [me, xe] = Le(!1), Pe = j(() => {
389
- const Z = !me;
390
- xe(Z), s(Z ? sr : lr);
391
- }, [s, me]), [ne, re] = Le(null), G = j(() => re(null), []), ve = !!ne, H = et(() => {
392
- switch (w.type) {
393
- case "image":
394
- return !0;
395
- case "interior-360":
396
- return d === "running";
397
- case "360":
398
- return d === "running";
399
- default:
400
- return !1;
401
- }
402
- }, [w.type, d]), [ze, Y] = Le(1), Re = ze !== 1, Be = ze < ct, Ze = ze > 1, Oe = j((Z) => {
403
- Y((ie) => tt(ie + Z, 1, ct));
404
- }, []), c = j(() => Y(1), []), g = j(() => Oe(dt), [Oe]), le = j(() => Oe(-0.75), [Oe]), oe = j(() => {
405
- c(), G();
406
- }, [c, G]), [q, v] = Le(!1), [Q, $] = Le(), [he, ae] = Le(!1), Se = j(
407
- async (Z) => {
408
- oe(), v(Z), s(Z ? or : nr);
409
- },
410
- [s, oe]
411
- ), ke = j(() => {
412
- clearTimeout(Q);
413
- const Z = setTimeout(() => {
414
- $(void 0);
415
- }, pr);
416
- $(Z);
417
- }, [Q]), Ue = j(async () => {
418
- if (ke(), l === "full_screen") {
419
- const Z = await f();
420
- if (ae(!Z), Z)
421
- return;
422
- }
423
- Se(!0);
424
- }, [
425
- l,
426
- Se,
427
- f,
428
- ke
429
- ]), Ge = j(async () => {
430
- ke(), !(l === "full_screen" && (ae(!1), await E())) && Se(!1);
431
- }, [
432
- l,
433
- Se,
434
- E,
435
- ke
436
- ]), Ye = j(() => {
437
- q ? Ge() : Ue();
438
- }, [Ge, Ue, q]);
439
- return fe(() => {
440
- l === "full_screen" && (he && q || p !== q && (ke(), Se(p)));
441
- }, [
442
- l,
443
- Se,
444
- q,
445
- he,
446
- p,
447
- ke
448
- ]), /* @__PURE__ */ i(
449
- fr.Provider,
450
- {
451
- value: {
452
- items: z,
453
- setItemInteraction: o,
454
- slidable: z.length > 1,
455
- carrouselItemIndex: L,
456
- setCarrouselItemIndex: D,
457
- itemIndexCommand: k,
458
- setItemIndexCommand: m,
459
- masterItemIndex: N,
460
- specialCommand: C,
461
- isRunningSpecialCommand: O,
462
- finishSpecialCommand: M,
463
- prevItem: X,
464
- nextItem: S,
465
- scrollToItemIndex: V,
466
- displayedCategoryId: te,
467
- changeCategory: W,
468
- enableHotspotsControl: I,
469
- showHotspots: F,
470
- toggleHotspots: B,
471
- showGalleryControls: J,
472
- showGallery: me,
473
- toggleGallery: Pe,
474
- shownDetails: ne,
475
- isShowingDetails: ve,
476
- setShownDetails: re,
477
- resetShownDetails: G,
478
- showZoomControls: H,
479
- zoom: ze,
480
- isZooming: Re,
481
- setZoom: Y,
482
- resetZoom: c,
483
- canZoomIn: Be,
484
- zoomIn: g,
485
- canZoomOut: Ze,
486
- zoomOut: le,
487
- resetView: oe,
488
- extendMode: q,
489
- enableExtendMode: Ue,
490
- disableExtendMode: Ge,
491
- toggleExtendMode: Ye,
492
- extendTransition: !!Q,
493
- fakeFullScreen: he
494
- },
495
- children: r
496
- }
497
- );
498
- }, mr = ["left", "center", "right", "fullW"], gr = ["top", "middle", "bottom", "fullH"], ao = [
499
- ...mr,
500
- ...gr,
501
- "top-left",
502
- "top-center",
503
- "top-right",
504
- "top-fullW",
505
- "middle-left",
506
- "middle-center",
507
- "middle-right",
508
- "middle-fullW",
509
- "bottom-left",
510
- "bottom-center",
511
- "bottom-right",
512
- "bottom-fullW",
513
- "fullH-left",
514
- "fullH-center",
515
- "fullH-right",
516
- "fullW-fullW"
517
- ];
518
- function io(r) {
519
- return mr.includes(r);
520
- }
521
- function so(r) {
522
- return gr.includes(r);
523
- }
524
- function lo(r) {
525
- return ao.includes(r);
526
- }
527
- function co(r) {
528
- if (!lo(r))
529
- throw new Error(`Invalid position: ${r}`);
530
- return so(r) ? [r, void 0] : io(r) ? [void 0, r] : r.split("-");
531
- }
532
- function ce(...r) {
533
- return r.filter((a) => !!a).map((a) => a.trim()).join(" ");
534
- }
535
- function uo(r) {
536
- switch (r) {
537
- case "left":
538
- return "left-1 small:left-2";
539
- case "right":
540
- return "right-1 small:right-2";
541
- case "center":
542
- return "left-1/2 -translate-x-1/2";
543
- case "fullW":
544
- return "inset-x-1 small:inset-x-2";
545
- }
546
- }
547
- function vr(r) {
548
- switch (r) {
549
- case "top":
550
- return "top-1 small:top-2";
551
- case "bottom":
552
- return "bottom-1 small:bottom-2";
553
- case "middle":
554
- return "top-1/2 -translate-y-1/2";
555
- case "fullH":
556
- return "inset-y-1 small:inset-y-2";
557
- }
558
- }
559
- function po({
560
- positionX: r,
561
- positionY: a
562
- }) {
563
- const l = new Array();
564
- return r && l.push(uo(r)), a && l.push(vr(a)), l.join(" ");
565
- }
566
- function ut(r) {
567
- const [a, l] = co(r);
568
- return po({ positionX: l, positionY: a });
569
- }
570
- const Xe = ({
571
- customizationKey: r,
572
- className: a,
573
- children: l
574
- }) => {
575
- const { getIconConfig: s } = ft(), f = s(r)?.Icon;
576
- return f ? a ? /* @__PURE__ */ i("div", { className: a, children: f }) : f : l;
577
- }, ho = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_CLOSE", children: /* @__PURE__ */ i(
578
- "svg",
579
- {
580
- className: r,
581
- width: "24",
582
- height: "24",
583
- viewBox: "0 0 24 24",
584
- fill: "none",
585
- xmlns: "http://www.w3.org/2000/svg",
586
- children: /* @__PURE__ */ i(
587
- "path",
588
- {
589
- 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",
590
- fill: "currentColor"
591
- }
592
- )
593
- }
594
- ) }), fo = {
595
- fill: {
596
- primary: "bg-primary text-primary-foreground hover:opacity-80",
597
- neutral: "bg-background text-neutral-foreground hover:opacity-80"
598
- },
599
- ghost: {
600
- primary: "bg-transparent text-foreground hover:bg-primary/25",
601
- neutral: "bg-transparent text-background hover:bg-foreground/25"
602
- }
603
- }, mo = {
604
- button: "h-8 px-2",
605
- icon: "size-8 p-2"
606
- }, Qe = ({
607
- variant: r = "fill",
608
- shape: a = "button",
609
- color: l = "primary",
610
- className: s,
611
- children: p,
612
- ...f
613
- }) => {
614
- const E = fo[r][l], e = mo[a];
615
- return /* @__PURE__ */ i(
616
- "button",
617
- {
618
- className: ce(
619
- "flex items-center justify-center rounded-ui text-sm transition-all disabled:opacity-60",
620
- E,
621
- e,
622
- s
623
- ),
624
- ...f,
625
- children: p
626
- }
627
- );
628
- }, wr = (r) => /* @__PURE__ */ i(Qe, { color: "neutral", shape: "icon", ...r, children: /* @__PURE__ */ i(ho, { className: "size-full" }) }), Nt = ({ text: r, className: a }) => /* @__PURE__ */ pe(
629
- "div",
630
- {
631
- className: ce(
632
- "flex size-full flex-col items-center justify-center gap-y-4",
633
- a
634
- ),
635
- children: [
636
- /* @__PURE__ */ i(
637
- "img",
638
- {
639
- className: "h-20 small:h-28",
640
- src: "https://cdn.car-cutter.com/libs/web-player/v3/assets/car_placeholder.png"
641
- }
642
- ),
643
- /* @__PURE__ */ i("div", { className: "text-2xl font-bold", children: r })
644
- ]
645
- }
646
- ), go = {
647
- primary: "border-primary",
648
- foreground: "border-foreground",
649
- background: "border-background"
650
- }, vo = {
651
- sm: "size-4 border",
652
- md: "size-8 border-2",
653
- lg: "size-12 border-4"
654
- }, xr = ({
655
- color: r = "foreground",
656
- size: a = "md"
657
- }) => {
658
- const l = go[r], s = vo[a];
659
- return /* @__PURE__ */ i(
660
- "div",
661
- {
662
- className: ce(
663
- "inline-block animate-rotation rounded-full border-b-transparent",
664
- s,
665
- l
666
- )
667
- }
668
- );
669
- }, pt = ({
670
- src: r,
671
- className: a,
672
- onLoad: l,
673
- imgInPlayerWidthRatio: s = 1,
674
- onlyThumbnail: p,
675
- fadeIn: f,
676
- ...E
677
- }) => {
678
- const { mediaLoadStrategy: e, playerInViewportWidthRatio: x } = $e(), { imageHdWidth: b, usedMediaWidths: z } = it(), [y, h] = et(() => {
679
- const D = z.map((m) => `${m !== b ? Qr(r, m) : r} ${m}w`);
680
- let k;
681
- if (p)
682
- k = [`${z[0]}px`];
683
- else {
684
- const m = 1 / (s * x);
685
- switch (e) {
686
- case "quality": {
687
- const N = [...z], w = N.pop();
688
- k = N.map(
689
- (d) => `(max-width: ${m * d}px) ${d}px`
690
- ), k.push(`${w}px`);
691
- break;
692
- }
693
- case "balanced": {
694
- k = [];
695
- for (let N = 0; N < z.length - 1; N++) {
696
- const w = z[N], d = z[N + 1], C = Math.round((w + d) / 2);
697
- k.push(
698
- `(max-width: ${m * C}px) ${w}px`
699
- );
700
- }
701
- k.push(`${z[z.length - 1]}px`);
702
- break;
703
- }
704
- case "speed": {
705
- const N = [...z], w = N.shift();
706
- k = N.reverse().map(
707
- (d) => `(min-width: ${m * d}px) ${d}px`
708
- ), k.push(`${w}px`);
709
- break;
710
- }
711
- }
712
- }
713
- return [D.join(", "), k.join(", ")];
714
- }, [
715
- b,
716
- s,
717
- e,
718
- p,
719
- x,
720
- r,
721
- z
722
- ]), [o, L] = Le();
723
- return fe(() => {
724
- if (o === !0)
725
- return;
726
- const D = setTimeout(() => {
727
- L((k) => k ?? !1);
728
- }, 30);
729
- return () => clearTimeout(D);
730
- }, [o]), /* @__PURE__ */ i(
731
- "img",
732
- {
733
- src: r,
734
- srcSet: y,
735
- sizes: h,
736
- className: ce(
737
- a,
738
- f && ce(
739
- o !== void 0 && "transition-opacity duration-200",
740
- o === !1 && "opacity-0",
741
- o === !0 && "opacity-100"
742
- )
743
- ),
744
- onLoad: (D) => {
745
- L(!0), l?.(D);
746
- },
747
- ...E
748
- }
749
- );
750
- }, br = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_IMAGE", children: /* @__PURE__ */ i("svg", { className: r, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ i(
751
- "path",
752
- {
753
- 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",
754
- fill: "currentColor"
755
- }
756
- ) }) }), yr = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "INTERIOR_UI_360", children: /* @__PURE__ */ pe(
757
- "svg",
758
- {
759
- className: r,
760
- viewBox: "0 0 98 98",
761
- fill: "none",
762
- xmlns: "http://www.w3.org/2000/svg",
763
- children: [
764
- /* @__PURE__ */ i(
765
- "path",
766
- {
767
- d: "M30.9343 48C26.8559 48 24.3496 46.2454 23.3411 44.1517C23.1038 43.6651 23 43.1933 23 42.7509C23 41.6008 23.7415 40.8784 24.9725 40.8784C25.8623 40.8784 26.4259 41.2322 26.8708 42.0432C27.6271 43.5324 28.7839 44.4171 31.0085 44.4171C33.2034 44.4171 34.7161 43.149 34.7161 41.3797C34.731 39.3154 33.2034 38.1653 30.6081 38.1653H29.6737C28.5911 38.1653 27.9682 37.5313 27.9682 36.5729C27.9682 35.644 28.5911 34.9952 29.6737 34.9952H30.5488C32.7882 34.9952 34.2416 33.7862 34.2416 32.0463C34.2416 30.336 33.0848 29.2006 30.9195 29.2006C29.1102 29.2006 28.0127 29.9526 27.3157 31.4565C26.8263 32.4592 26.3072 32.8278 25.2987 32.8278C24.053 32.8278 23.4153 32.1053 23.4153 31.0289C23.4153 30.5276 23.5191 30.1 23.7415 29.5987C24.6907 27.5197 27.1229 25.7799 30.9047 25.7799C35.428 25.7799 38.4831 28.0063 38.4831 31.4123C38.4831 34.1106 36.5403 35.8799 34.0191 36.396V36.4845C37.2077 36.7793 39.2691 38.6372 39.2691 41.5713C39.2691 45.4344 35.9026 48 30.9343 48Z",
768
- fill: "white"
769
- }
770
- ),
771
- /* @__PURE__ */ i(
772
- "path",
773
- {
774
- d: "M50.5032 48C47.107 48 44.4079 46.4223 42.8358 43.2965C42.0201 41.6451 41.5752 39.5366 41.5752 37.0595C41.5752 30.0116 44.9566 25.7651 50.5181 25.7651C54.0626 25.7651 56.6134 27.2543 57.6219 29.2448C57.8295 29.6577 57.9333 30.0411 57.9333 30.4392C57.9333 31.4271 57.2363 32.1938 56.0647 32.1938C55.1749 32.1938 54.641 31.8104 53.9884 31.0584C53.0096 29.8346 51.9715 29.2891 50.5032 29.2891C47.4481 29.2891 45.8909 32.179 45.8613 36.7204V36.9415H45.9502C46.7808 34.9658 48.8867 33.5208 51.7787 33.5208C55.9164 33.5208 58.749 36.455 58.749 40.4508C58.749 44.8594 55.2787 48 50.5032 48ZM50.4439 44.4613C52.6388 44.4613 54.374 42.7804 54.3888 40.6424C54.3888 38.4013 52.7426 36.8088 50.4884 36.8088C48.2193 36.8088 46.5286 38.3865 46.5286 40.554C46.5286 42.7509 48.249 44.4613 50.4439 44.4613Z",
775
- fill: "white"
776
- }
777
- ),
778
- /* @__PURE__ */ i(
779
- "path",
780
- {
781
- d: "M68.9374 48C63.5094 48 60.2022 43.7388 60.2022 36.8531C60.2022 29.9821 63.5391 25.7651 68.9374 25.7651C74.3357 25.7651 77.6577 29.9673 77.6577 36.8383C77.6577 43.7093 74.3654 48 68.9374 48ZM68.9374 44.4318C71.5772 44.4318 73.1048 41.7335 73.1048 36.8531C73.1048 32.0021 71.5624 29.3333 68.9374 29.3333C66.3272 29.3333 64.7552 32.0168 64.7552 36.8531C64.7552 41.7335 66.2975 44.4318 68.9374 44.4318Z",
782
- fill: "white"
783
- }
784
- ),
785
- /* @__PURE__ */ i(
786
- "path",
787
- {
788
- d: "M81.6758 28.4244C78.6504 28.4244 76.3665 26.1685 76.3665 23.2048C76.3665 20.2559 78.6504 18 81.6758 18C84.6864 18 87 20.2559 87 23.2048C87 26.1685 84.6864 28.4244 81.6758 28.4244ZM81.6758 25.4755C82.9364 25.4755 83.9152 24.4581 83.9152 23.2048C83.9152 21.9368 82.9216 20.9489 81.6758 20.9489C80.4597 20.9489 79.4364 21.9368 79.4364 23.2048C79.4364 24.4581 80.4449 25.4755 81.6758 25.4755Z",
789
- fill: "white"
790
- }
791
- ),
792
- /* @__PURE__ */ i(
793
- "path",
794
- {
795
- d: "M37.3915 79.7285C36.5538 79.7285 36.0601 79.2171 36.0601 78.3442V68.0541C36.0601 67.1724 36.5538 66.661 37.3915 66.661C38.2292 66.661 38.7229 67.1724 38.7229 68.0541V78.3442C38.7229 79.2171 38.2292 79.7285 37.3915 79.7285Z",
796
- fill: "white"
797
- }
798
- ),
799
- /* @__PURE__ */ i(
800
- "path",
801
- {
802
- d: "M43.7429 79.7285C42.9405 79.7285 42.4644 79.2436 42.4644 78.3971V67.9924C42.4644 67.1459 42.9582 66.661 43.8047 66.661C44.3513 66.661 44.7217 66.8814 45.1273 67.4369L50.6294 75.1258H50.6999V68.0012C50.6999 67.1459 51.1761 66.661 51.9785 66.661C52.7809 66.661 53.2482 67.1459 53.2482 68.0012V78.4324C53.2482 79.2612 52.7809 79.7285 51.9432 79.7285C51.3701 79.7285 51.0174 79.5257 50.6118 78.9614L45.092 71.2284H45.0126V78.3971C45.0126 79.2436 44.5365 79.7285 43.7429 79.7285Z",
803
- fill: "white"
804
- }
805
- ),
806
- /* @__PURE__ */ i(
807
- "path",
808
- {
809
- d: "M61.3719 79.7285C60.5343 79.7285 60.0405 79.2171 60.0405 78.3442V69.0417H57.4129C56.6898 69.0417 56.2049 68.6273 56.2049 67.9395C56.2049 67.2518 56.681 66.8373 57.4129 66.8373H65.3398C66.0629 66.8373 66.539 67.2518 66.539 67.9395C66.539 68.6273 66.054 69.0417 65.3398 69.0417H62.7034V78.3442C62.7034 79.2171 62.2096 79.7285 61.3719 79.7285Z",
810
- fill: "white"
811
- }
812
- ),
813
- /* @__PURE__ */ i(
814
- "path",
815
- {
816
- d: "M11.5291 40.7269C5.85358 44.3944 2.5 48.9252 2.5 53.8286C2.5 62.4095 12.77 69.8493 27.7816 73.5179M86.4709 40.7269C92.1464 44.3944 95.5 48.9252 95.5 53.8286C95.5 61.8751 86.4695 68.9181 72.967 72.7891M27.7816 73.5179L23.267 65.1144M27.7816 73.5179L19.6553 77.7552",
817
- stroke: "currentColor",
818
- strokeWidth: "4.51456",
819
- strokeLinecap: "round"
820
- }
821
- )
822
- ]
823
- }
824
- ) }), Mt = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_PLAY", children: /* @__PURE__ */ i(
825
- "svg",
826
- {
827
- className: r,
828
- viewBox: "0 0 24 24",
829
- fill: "none",
830
- stroke: "currentColor",
831
- strokeWidth: "1.5",
832
- strokeLinecap: "round",
833
- strokeLinejoin: "round",
834
- children: /* @__PURE__ */ i("polygon", { points: "6 3 20 12 6 21 6 3" })
835
- }
836
- ) }), Er = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_360", children: /* @__PURE__ */ pe(
837
- "svg",
838
- {
839
- className: r,
840
- viewBox: "0 0 98 98",
841
- fill: "none",
842
- xmlns: "http://www.w3.org/2000/svg",
843
- children: [
844
- /* @__PURE__ */ i(
845
- "path",
846
- {
847
- d: "M30.9343 48C26.8559 48 24.3496 46.2454 23.3411 44.1517C23.1038 43.6651 23 43.1933 23 42.7509C23 41.6008 23.7415 40.8784 24.9725 40.8784C25.8623 40.8784 26.4259 41.2322 26.8708 42.0432C27.6271 43.5324 28.7839 44.4171 31.0085 44.4171C33.2034 44.4171 34.7161 43.149 34.7161 41.3797C34.731 39.3154 33.2034 38.1653 30.6081 38.1653H29.6737C28.5911 38.1653 27.9682 37.5313 27.9682 36.5729C27.9682 35.644 28.5911 34.9952 29.6737 34.9952H30.5488C32.7882 34.9952 34.2416 33.7862 34.2416 32.0463C34.2416 30.336 33.0848 29.2006 30.9195 29.2006C29.1102 29.2006 28.0127 29.9526 27.3157 31.4565C26.8263 32.4592 26.3072 32.8278 25.2987 32.8278C24.053 32.8278 23.4153 32.1053 23.4153 31.0289C23.4153 30.5276 23.5191 30.1 23.7415 29.5987C24.6907 27.5197 27.1229 25.7799 30.9047 25.7799C35.428 25.7799 38.4831 28.0063 38.4831 31.4123C38.4831 34.1106 36.5403 35.8799 34.0191 36.396V36.4845C37.2077 36.7793 39.2691 38.6372 39.2691 41.5713C39.2691 45.4344 35.9026 48 30.9343 48Z",
848
- fill: "white"
849
- }
850
- ),
851
- /* @__PURE__ */ i(
852
- "path",
853
- {
854
- d: "M50.5032 48C47.107 48 44.4079 46.4223 42.8358 43.2965C42.0201 41.6451 41.5752 39.5366 41.5752 37.0595C41.5752 30.0116 44.9566 25.7651 50.5181 25.7651C54.0626 25.7651 56.6134 27.2543 57.6219 29.2448C57.8295 29.6577 57.9333 30.0411 57.9333 30.4392C57.9333 31.4271 57.2363 32.1938 56.0647 32.1938C55.1749 32.1938 54.641 31.8104 53.9884 31.0584C53.0096 29.8346 51.9715 29.2891 50.5032 29.2891C47.4481 29.2891 45.8909 32.179 45.8613 36.7204V36.9415H45.9502C46.7808 34.9658 48.8867 33.5208 51.7787 33.5208C55.9164 33.5208 58.749 36.455 58.749 40.4508C58.749 44.8594 55.2787 48 50.5032 48ZM50.4439 44.4613C52.6388 44.4613 54.374 42.7804 54.3888 40.6424C54.3888 38.4013 52.7426 36.8088 50.4884 36.8088C48.2193 36.8088 46.5286 38.3865 46.5286 40.554C46.5286 42.7509 48.249 44.4613 50.4439 44.4613Z",
855
- fill: "white"
856
- }
857
- ),
858
- /* @__PURE__ */ i(
859
- "path",
860
- {
861
- d: "M68.9374 48C63.5094 48 60.2022 43.7388 60.2022 36.8531C60.2022 29.9821 63.5391 25.7651 68.9374 25.7651C74.3357 25.7651 77.6577 29.9673 77.6577 36.8383C77.6577 43.7093 74.3654 48 68.9374 48ZM68.9374 44.4318C71.5772 44.4318 73.1048 41.7335 73.1048 36.8531C73.1048 32.0021 71.5624 29.3333 68.9374 29.3333C66.3272 29.3333 64.7552 32.0168 64.7552 36.8531C64.7552 41.7335 66.2975 44.4318 68.9374 44.4318Z",
862
- fill: "white"
863
- }
864
- ),
865
- /* @__PURE__ */ i(
866
- "path",
867
- {
868
- d: "M81.6758 28.4244C78.6504 28.4244 76.3665 26.1685 76.3665 23.2048C76.3665 20.2559 78.6504 18 81.6758 18C84.6864 18 87 20.2559 87 23.2048C87 26.1685 84.6864 28.4244 81.6758 28.4244ZM81.6758 25.4755C82.9364 25.4755 83.9152 24.4581 83.9152 23.2048C83.9152 21.9368 82.9216 20.9489 81.6758 20.9489C80.4597 20.9489 79.4364 21.9368 79.4364 23.2048C79.4364 24.4581 80.4449 25.4755 81.6758 25.4755Z",
869
- fill: "white"
870
- }
871
- ),
872
- /* @__PURE__ */ i(
873
- "path",
874
- {
875
- d: "M34.6814 79.561C33.8438 79.561 33.35 79.0496 33.35 78.1678V68.2217C33.35 67.3487 33.8438 66.8373 34.6814 66.8373H40.7302C41.4621 66.8373 41.9382 67.2518 41.9382 67.9395C41.9382 68.6273 41.4533 69.0417 40.7302 69.0417H36.0129V72.1014H40.501C41.1623 72.1014 41.612 72.4894 41.612 73.1242C41.612 73.7591 41.1711 74.147 40.501 74.147H36.0129V77.3566H40.7302C41.4533 77.3566 41.9382 77.771 41.9382 78.4588C41.9382 79.1466 41.4621 79.561 40.7302 79.561H34.6814Z",
876
- fill: "white"
877
- }
878
- ),
879
- /* @__PURE__ */ i(
880
- "path",
881
- {
882
- d: "M46.4115 79.7285C45.7061 79.7285 45.1506 79.2171 45.1506 78.5734C45.1506 78.2472 45.2564 77.965 45.5121 77.6123L48.6864 73.1859V73.1154L45.6179 68.9359C45.327 68.5479 45.23 68.2569 45.23 67.9131C45.23 67.19 45.8031 66.661 46.5791 66.661C47.0817 66.661 47.4344 66.8814 47.7782 67.4017L50.5028 71.4224H50.5734L53.3862 67.3135C53.6948 66.855 53.9593 66.661 54.4707 66.661C55.1673 66.661 55.7669 67.1636 55.7669 67.7984C55.7669 68.1423 55.6699 68.4245 55.4142 68.7507L52.1076 73.1683V73.23L55.3172 77.5594C55.5641 77.8768 55.6699 78.1766 55.6699 78.5293C55.6699 79.2259 55.132 79.7285 54.3914 79.7285C53.9064 79.7285 53.5802 79.5345 53.2363 79.0672L50.397 75.1082H50.3265L47.5313 79.076C47.1963 79.561 46.9141 79.7285 46.4115 79.7285Z",
883
- fill: "white"
884
- }
885
- ),
886
- /* @__PURE__ */ i(
887
- "path",
888
- {
889
- d: "M63.7055 79.7285C62.8678 79.7285 62.374 79.2171 62.374 78.3442V69.0417H59.7464C59.0234 69.0417 58.5384 68.6273 58.5384 67.9395C58.5384 67.2518 59.0146 66.8373 59.7464 66.8373H67.6734C68.3964 66.8373 68.8725 67.2518 68.8725 67.9395C68.8725 68.6273 68.3876 69.0417 67.6734 69.0417H65.0369V78.3442C65.0369 79.2171 64.5431 79.7285 63.7055 79.7285Z",
890
- fill: "white"
891
- }
892
- ),
893
- /* @__PURE__ */ i(
894
- "path",
895
- {
896
- d: "M11.5291 40.7263C5.85358 44.3937 2.5 48.9245 2.5 53.828C2.5 62.4089 12.77 69.8486 27.7816 73.5172M86.4709 40.7263C92.1464 44.3937 95.5 48.9245 95.5 53.828C95.5 61.8744 86.4695 68.9174 72.967 72.7885M27.7816 73.5172L23.267 65.1137M27.7816 73.5172L19.6553 77.7545",
897
- stroke: "currentColor",
898
- strokeWidth: "4.51456",
899
- strokeLinecap: "round"
900
- }
901
- )
902
- ]
903
- }
904
- ) }), wo = ({
905
- src: r,
906
- withCdn: a
907
- }) => {
908
- const { permanentGallery: l } = $e();
909
- if (!r)
910
- return null;
911
- const s = "size-full object-cover";
912
- return a ? /* @__PURE__ */ i(
913
- pt,
914
- {
915
- className: s,
916
- src: r,
917
- onlyThumbnail: !0,
918
- fadeIn: !l
919
- }
920
- ) : /* @__PURE__ */ i("img", { className: s, src: r });
921
- }, wt = ({
922
- children: r
923
- }) => {
924
- const { extendMode: a } = Ke();
925
- return /* @__PURE__ */ i(
926
- "div",
927
- {
928
- className: ce(
929
- "flex aspect-square h-3/4 items-center justify-center rounded-full bg-foreground/50 p-1",
930
- a && "large:h-3/5 large:p-2"
931
- ),
932
- children: r
933
- }
934
- );
935
- }, xo = ({ item: r }) => {
936
- const { aspectRatioStyle: a } = it(), { type: l } = r;
937
- let s, p;
938
- switch (l) {
939
- case "360":
940
- s = r.images[0].src, p = !0;
941
- break;
942
- case "interior-360":
943
- s = r.poster, p = !0;
944
- break;
945
- case "image":
946
- s = r.src, p = !0;
947
- break;
948
- case "video":
949
- s = r.poster, p = !0;
950
- break;
951
- case "custom":
952
- s = r.thumbnailSrc, p = !1;
953
- break;
954
- default:
955
- p = !1;
956
- }
957
- const f = /* @__PURE__ */ i(wo, { src: s, withCdn: p });
958
- let E;
959
- switch (l) {
960
- case "360":
961
- E = /* @__PURE__ */ i(wt, { children: /* @__PURE__ */ i(Er, { className: "size-full text-primary-light" }) });
962
- break;
963
- case "interior-360":
964
- E = /* @__PURE__ */ i(wt, { children: /* @__PURE__ */ i(yr, { className: "size-full text-primary-light" }) });
965
- break;
966
- case "video":
967
- E = /* @__PURE__ */ i(wt, { children: /* @__PURE__ */ i(Mt, { className: "size-full p-0.5 text-background" }) });
968
- break;
969
- case "custom":
970
- E = s ? null : /* @__PURE__ */ i(wt, { children: /* @__PURE__ */ i(br, { className: "size-full p-0.5 text-background" }) });
971
- break;
972
- }
973
- return /* @__PURE__ */ pe("div", { className: "relative bg-foreground/30", style: a, children: [
974
- f,
975
- E && /* @__PURE__ */ i("div", { className: "absolute inset-0 flex items-center justify-center bg-foreground/25", children: E })
976
- ] });
977
- }, bo = {
978
- primary: "bg-primary/50",
979
- neutral: "bg-neutral/50",
980
- background: "bg-background/50",
981
- foreground: "bg-foreground/50"
982
- }, Cr = ({
983
- color: r = "neutral",
984
- orientation: a = "horizontal"
985
- }) => {
986
- const l = bo[r];
987
- return /* @__PURE__ */ i("div", { className: ce(l, a === "horizontal" ? "h-px w-full" : "w-px h-full") });
988
- }, Mr = ({
989
- className: r = "",
990
- containerClassName: a = ""
991
- }) => {
992
- const {
993
- hideCategoriesNav: l,
994
- infiniteCarrousel: s,
995
- permanentGallery: p,
996
- isFullScreen: f
997
- } = $e(), { categories: E, aspectRatioStyle: e } = it(), {
998
- items: x,
999
- extendMode: b,
1000
- extendTransition: z,
1001
- masterItemIndex: y,
1002
- prevItem: h,
1003
- nextItem: o,
1004
- scrollToItemIndex: L,
1005
- resetView: D
1006
- } = Ke(), k = et(() => {
1007
- if (l)
1008
- return [];
1009
- const S = new Array();
1010
- let V = E[0];
1011
- const te = (W) => E.find(
1012
- (I) => I.items.some((F) => F === W)
1013
- );
1014
- for (let W = 0; W < x.length; W++) {
1015
- const I = x[W], F = te(I);
1016
- F && F !== V && (S.push(W), V = F);
1017
- }
1018
- return S;
1019
- }, [E, l, x]), m = Ie(null), N = j(() => {
1020
- if (!m.current)
1021
- throw new Error("slider.current is null");
1022
- return m.current;
1023
- }, []), w = Ie(!1), d = Ie(
1024
- null
1025
- ), [C, P] = Le(!1), O = j(
1026
- (S, V) => {
1027
- const te = N(), W = te.clientWidth, I = te.scrollWidth / x.length, F = (S + 1 / 2) * I - W / 2, T = te.scrollWidth - te.clientWidth;
1028
- te.scrollTo({
1029
- left: tt(F, 0, T),
1030
- behavior: V
1031
- });
1032
- },
1033
- [x.length, N]
1034
- );
1035
- fe(() => {
1036
- const S = m.current;
1037
- if (!S)
1038
- return;
1039
- const V = (I) => {
1040
- I.preventDefault(), w.current = !0, d.current = {
1041
- x: I.pageX - S.offsetLeft,
1042
- scrollLeft: S.scrollLeft
1043
- };
1044
- }, te = (I) => {
1045
- if (!w.current)
1046
- return;
1047
- if (d.current === null)
1048
- throw new Error("[onMouseMove] scrollStart is null");
1049
- const T = I.pageX - S.offsetLeft - d.current.x;
1050
- if (!C && Math.abs(T) < 5)
1051
- return;
1052
- const B = d.current.scrollLeft - T;
1053
- P(!0), requestAnimationFrame(() => {
1054
- S.scrollLeft = B;
1055
- });
1056
- }, W = () => {
1057
- w.current && (w.current = !1, requestAnimationFrame(() => {
1058
- P(!1);
1059
- }));
1060
- };
1061
- return S.addEventListener("mousedown", V), document.addEventListener("mousemove", te), document.addEventListener("mouseleave", W), document.addEventListener("mouseup", W), document.addEventListener("contextmenu", W), () => {
1062
- S.removeEventListener("mousedown", V), document.removeEventListener("mousemove", te), document.removeEventListener("mouseleave", W), document.removeEventListener("mouseup", W), document.removeEventListener("contextmenu", W);
1063
- };
1064
- }, [C]);
1065
- const M = Ie(y);
1066
- fe(() => {
1067
- m.current && (O(y, "smooth"), M.current = y);
1068
- }, [y, O]), fe(() => {
1069
- m.current && O(M.current, "instant");
1070
- }, [
1071
- O,
1072
- // - Run the effect when those values change
1073
- f,
1074
- b,
1075
- z
1076
- ]);
1077
- const X = (S) => {
1078
- C || (s && S === x.length - 1 && y === 0 ? h() : s && S === 0 && y === x.length - 1 ? o() : L(S), D());
1079
- };
1080
- return /* @__PURE__ */ i(
1081
- "div",
1082
- {
1083
- ref: m,
1084
- className: ce(
1085
- "relative w-full overflow-x-auto no-scrollbar",
1086
- C ? "cursor-grab" : "cursor-grabbing",
1087
- r
1088
- ),
1089
- children: /* @__PURE__ */ i(
1090
- "div",
1091
- {
1092
- className: ce(
1093
- "flex h-10 w-fit gap-1 small:h-12 small:gap-2",
1094
- b && "large:h-20 large:gap-4",
1095
- a
1096
- ),
1097
- children: x.map((S, V) => /* @__PURE__ */ pe(Hr, { children: [
1098
- k.includes(V) && /* @__PURE__ */ i("div", { className: "my-2", children: /* @__PURE__ */ i(
1099
- Cr,
1100
- {
1101
- color: p && !f ? "neutral" : "background",
1102
- orientation: "vertical"
1103
- }
1104
- ) }),
1105
- /* @__PURE__ */ i(
1106
- "div",
1107
- {
1108
- className: ce(
1109
- "relative h-full overflow-hidden rounded-gallery transition-radius",
1110
- !C && "cursor-pointer",
1111
- "after:absolute after:inset-0 after:rounded-gallery after:border-2 after:border-primary after:transition-all",
1112
- V === y ? "after:opacity-100" : "after:opacity-0 hover:after:opacity-70"
1113
- ),
1114
- style: e,
1115
- onClick: () => X(V),
1116
- children: /* @__PURE__ */ i(xo, { item: S })
1117
- }
1118
- )
1119
- ] }, V))
1120
- }
1121
- )
1122
- }
1123
- );
1124
- }, Lr = (r) => 1 - Math.pow(1 - r, 2), yo = ({
1125
- Media: r,
1126
- itemIndex: a
1127
- }) => {
1128
- const { setItemInteraction: l } = Ke();
1129
- return fe(() => {
1130
- l(a, "ready");
1131
- }, [a, l]), r;
1132
- }, Yt = (r, a) => Math.sqrt(
1133
- (r.clientX - a.clientX) ** 2 + (r.clientY - a.clientY) ** 2
1134
- ), Eo = ({
1135
- onlyPreload: r,
1136
- ...a
1137
- }) => {
1138
- const { zoom: l, isZooming: s, setZoom: p } = Ke(), f = Ie(null), E = Ie(null), e = j((w) => {
1139
- if (!E.current)
1140
- throw new Error(
1141
- `[${w ?? "getTransformElementOrThrow"}] transformElementRef.current is null`
1142
- );
1143
- return E.current;
1144
- }, []), x = Ie(!1), b = Ie(null), z = Ie(/* @__PURE__ */ new Map()), y = Ie({ x: 0, y: 0, scale: 1 }), h = Ie(null), o = j(
1145
- (w) => {
1146
- const d = e("setTransformStyle"), {
1147
- x: C,
1148
- y: P,
1149
- scale: O
1150
- } = {
1151
- ...y.current,
1152
- ...w
1153
- }, M = tt(O, 1, ct), X = d.clientWidth, S = d.clientHeight, V = X * M, te = S * M, W = tt(C, -(V - X), 0), I = tt(P, -(te - S), 0);
1154
- y.current = { x: W, y: I, scale: M }, d.style.transform = `translate(${W}px, ${I}px) scale(${M})`;
1155
- },
1156
- [e]
1157
- ), L = j(
1158
- (w, d) => {
1159
- const {
1160
- x: C,
1161
- y: P,
1162
- scale: O
1163
- } = y.current, {
1164
- x: M,
1165
- y: X,
1166
- scale: S
1167
- } = {
1168
- ...y.current,
1169
- ...w
1170
- };
1171
- h.current && (cancelAnimationFrame(h.current), h.current = null);
1172
- const V = () => {
1173
- o({ x: M, y: X, scale: S }), p(S);
1174
- }, te = Math.abs(M - C) < 1 && Math.abs(X - P) < 1 && Math.abs(S - O) < 5e-3;
1175
- if (!d || te) {
1176
- V();
1177
- return;
1178
- }
1179
- const W = (/* @__PURE__ */ new Date()).getTime(), I = () => {
1180
- const F = () => {
1181
- const B = (/* @__PURE__ */ new Date()).getTime() - W;
1182
- if (B >= d) {
1183
- V(), h.current = null;
1184
- return;
1185
- }
1186
- const J = Math.min(B / d, 1), me = Lr(J), xe = yt(C, M, me), Pe = yt(P, X, me), ne = yt(O, S, me);
1187
- o({ x: xe, y: Pe, scale: ne }), I();
1188
- };
1189
- h.current = requestAnimationFrame(F);
1190
- };
1191
- I();
1192
- },
1193
- [o, p]
1194
- ), D = j(
1195
- (w, d) => {
1196
- let { x: C, y: P } = y.current;
1197
- w.x && (C += w.x), w.y && (P += w.y), L(
1198
- {
1199
- x: C,
1200
- y: P
1201
- },
1202
- d
1203
- );
1204
- },
1205
- [L]
1206
- ), k = j(
1207
- (w, d, C) => {
1208
- const P = y.current.scale, O = tt(w, 1, ct), M = O / P, { x: X, y: S } = y.current, { x: V, y: te } = d, W = -X + V, I = -S + te, F = W * M, T = I * M, B = F - V, J = T - te, me = -B, xe = -J;
1209
- L(
1210
- {
1211
- x: me,
1212
- y: xe,
1213
- scale: O
1214
- },
1215
- C
1216
- );
1217
- },
1218
- [L]
1219
- ), m = j(
1220
- (w) => {
1221
- const d = e(
1222
- "shiftZoomFromButton"
1223
- ), C = d.clientWidth, P = d.clientHeight;
1224
- k(
1225
- w,
1226
- {
1227
- x: C / 2,
1228
- y: P / 2
1229
- },
1230
- 200
1231
- );
1232
- },
1233
- [e, k]
1234
- ), N = j(
1235
- (w, d, C) => {
1236
- const { scale: P } = y.current;
1237
- k(
1238
- P + w,
1239
- d,
1240
- C
1241
- );
1242
- },
1243
- [k]
1244
- );
1245
- return fe(() => {
1246
- r || E.current && m(l);
1247
- }, [r, m, l]), fe(() => {
1248
- if (r || !s)
1249
- return;
1250
- const w = E.current;
1251
- if (!w)
1252
- return;
1253
- const d = (O) => {
1254
- O.preventDefault(), O.stopPropagation(), x.current = !0, b.current = {
1255
- x: O.clientX,
1256
- y: O.clientY
1257
- };
1258
- }, C = (O) => {
1259
- if (!x.current)
1260
- return;
1261
- if (!b.current)
1262
- throw new Error("mouseStartXY.current is null");
1263
- O.stopPropagation();
1264
- const M = O.clientX - b.current.x, X = O.clientY - b.current.y;
1265
- D({
1266
- x: M,
1267
- y: X
1268
- }), b.current = {
1269
- x: O.clientX,
1270
- y: O.clientY
1271
- };
1272
- }, P = () => {
1273
- x.current = !1;
1274
- };
1275
- return w.addEventListener("mousedown", d), document.addEventListener("mousemove", C), document.addEventListener("mouseleave", P), document.addEventListener("mouseup", P), document.addEventListener("contextmenu", P), () => {
1276
- w.removeEventListener("mousedown", d), document.removeEventListener("mousemove", C), document.removeEventListener("mouseleave", P), document.removeEventListener("mouseup", P), document.removeEventListener("contextmenu", P);
1277
- };
1278
- }, [s, D, r]), fe(() => {
1279
- if (r)
1280
- return;
1281
- const w = f.current;
1282
- if (!w)
1283
- return;
1284
- const d = (C) => {
1285
- const { ctrlKey: P, clientX: O, clientY: M, deltaX: X, deltaY: S } = C;
1286
- if (P) {
1287
- if (!s && S >= 0)
1288
- return;
1289
- const { left: V, top: te } = w.getBoundingClientRect(), W = O - V, I = M - te;
1290
- N(-0.01 * S, {
1291
- x: W,
1292
- y: I
1293
- });
1294
- } else {
1295
- if (!s)
1296
- return;
1297
- D({
1298
- x: -2 * X,
1299
- y: -2 * S
1300
- });
1301
- }
1302
- C.preventDefault();
1303
- };
1304
- return w.addEventListener("wheel", d), () => {
1305
- w.removeEventListener("wheel", d);
1306
- };
1307
- }, [s, D, N, r]), fe(() => {
1308
- const w = f.current, d = E.current;
1309
- if (!w || !d)
1310
- return;
1311
- const C = z.current, P = (X) => {
1312
- for (let S = 0; S < X.changedTouches.length; S++) {
1313
- const V = X.changedTouches[S];
1314
- C.set(V.identifier, V);
1315
- }
1316
- }, O = (X) => {
1317
- for (let S = 0; S < X.changedTouches.length; S++) {
1318
- const V = X.changedTouches[S];
1319
- C.delete(V.identifier);
1320
- }
1321
- }, M = (X) => {
1322
- const S = X.touches.length;
1323
- if (S === 1) {
1324
- if (!s)
1325
- return;
1326
- X.preventDefault();
1327
- const V = X.touches[0], te = C.get(V.identifier);
1328
- if (!te)
1329
- throw new Error("touchStart is null");
1330
- const W = V.clientX - te.clientX, I = V.clientY - te.clientY;
1331
- D({
1332
- x: W,
1333
- y: I
1334
- }), C.set(V.identifier, V);
1335
- } else if (S === 2) {
1336
- X.preventDefault();
1337
- const [V, te] = X.touches, W = C.get(V.identifier), I = C.get(te.identifier);
1338
- if (!W || !I)
1339
- throw new Error("initialTouch1 or initialTouch2 is null");
1340
- const F = Yt(
1341
- W,
1342
- I
1343
- ), B = Yt(V, te) / F, { left: J, top: me } = w.getBoundingClientRect();
1344
- N(B - 1, {
1345
- x: (V.clientX + te.clientX) / 2 - J,
1346
- y: (V.clientY + te.clientY) / 2 - me
1347
- }), C.set(V.identifier, V), C.set(te.identifier, te);
1348
- }
1349
- };
1350
- return d.addEventListener("touchstart", P), d.addEventListener("touchmove", M), d.addEventListener("touchend", O), d.addEventListener("touchcancel", O), () => {
1351
- d.removeEventListener("touchstart", P), d.removeEventListener("touchmove", M), d.removeEventListener("touchend", O), d.removeEventListener("touchcancel", O);
1352
- };
1353
- }, [s, D, N]), /* @__PURE__ */ i(
1354
- "div",
1355
- {
1356
- ref: f,
1357
- className: `relative size-full overflow-hidden ${s ? "z-zoomed-image cursor-move" : ""}`,
1358
- children: /* @__PURE__ */ i(
1359
- "div",
1360
- {
1361
- ref: E,
1362
- className: "origin-top-left",
1363
- children: /* @__PURE__ */ i(
1364
- pt,
1365
- {
1366
- ...a,
1367
- imgInPlayerWidthRatio: r ? 1 : l
1368
- }
1369
- )
1370
- }
1371
- )
1372
- }
1373
- );
1374
- }, Co = ({ hotspot: r }) => {
1375
- const { title: a, icon: l, description: s, position: p, detail: f } = r, { getIconConfig: E } = ft(), e = l ? E(l) : void 0, { extendMode: x, setShownDetails: b } = Ke(), z = !!f, y = f?.type === "image", h = !!a || !!s, o = y ? /* @__PURE__ */ i(br, { className: "size-4" }) : /* @__PURE__ */ i("div", { className: "size-1" }), L = () => {
1376
- y && b({
1377
- src: f.src,
1378
- title: a,
1379
- text: s
1380
- });
1381
- };
1382
- return /* @__PURE__ */ pe(
1383
- "div",
1384
- {
1385
- className: ce(
1386
- "group absolute z-hotspot -translate-x-1/2 -translate-y-1/2 hover:z-hotspot-hover",
1387
- z ? "cursor-pointer" : "cursor-help"
1388
- ),
1389
- style: {
1390
- top: `${100 * r.position.y}%`,
1391
- left: `${100 * r.position.x}%`
1392
- },
1393
- onClick: L,
1394
- children: [
1395
- /* @__PURE__ */ pe(
1396
- "div",
1397
- {
1398
- className: "relative flex items-center justify-center rounded-full border-2 border-background bg-primary text-primary-foreground",
1399
- children: [
1400
- /* @__PURE__ */ i(
1401
- "div",
1402
- {
1403
- className: "pointer-events-none absolute -z-20 size-8 animate-hotspot-ping rounded-full border-2 border-background"
1404
- }
1405
- ),
1406
- /* @__PURE__ */ i("div", { className: "p-1", children: e?.Icon ? /* @__PURE__ */ i("div", { className: "size-4", children: e.Icon }) : o })
1407
- ]
1408
- }
1409
- ),
1410
- !y && h && /* @__PURE__ */ i(
1411
- "div",
1412
- {
1413
- className: ce(
1414
- "absolute -z-10 w-max max-w-40 text-pretty rounded-ui bg-background p-2 small:max-w-48",
1415
- x && "large:max-w-56",
1416
- p.y < 0.55 ? "-top-1" : "-bottom-1",
1417
- p.x < 0.55 ? "-left-1 pl-6 small:pl-8" : "-right-1 pr-4 small:pr-6",
1418
- "pointer-events-none opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"
1419
- ),
1420
- children: /* @__PURE__ */ pe("div", { className: "space-y-1 text-pretty", children: [
1421
- a && /* @__PURE__ */ i("div", { className: "text-sm font-semibold small:text-base small:font-bold", children: a }),
1422
- s && /* @__PURE__ */ i("div", { className: "text-xs text-foreground/65 small:text-sm", children: s })
1423
- ] })
1424
- }
1425
- )
1426
- ]
1427
- }
1428
- );
1429
- }, Mo = ({ hotspot: r }) => {
1430
- const { detail: a } = r, l = /* @__PURE__ */ i(Co, { hotspot: r });
1431
- switch (a?.type) {
1432
- case "link":
1433
- case "pdf":
1434
- return /* @__PURE__ */ i("a", { href: a.src, target: "_blank", rel: "noreferrer", children: l });
1435
- default:
1436
- return l;
1437
- }
1438
- }, kr = ({
1439
- hotspots: r,
1440
- itemIndex: a,
1441
- className: l,
1442
- onLoad: s,
1443
- ...p
1444
- }) => {
1445
- const { isShowingDetails: f, showHotspots: E, setItemInteraction: e } = Ke();
1446
- return /* @__PURE__ */ i("div", { className: ce("relative size-full overflow-hidden", l), children: /* @__PURE__ */ pe(
1447
- "div",
1448
- {
1449
- className: ce(
1450
- "size-full duration-details",
1451
- f ? "scale-105" : "scale-100"
1452
- ),
1453
- children: [
1454
- /* @__PURE__ */ i(
1455
- Eo,
1456
- {
1457
- className: "size-full object-cover",
1458
- onLoad: (x) => {
1459
- a !== void 0 && e(a, "ready"), s?.(x);
1460
- },
1461
- ...p
1462
- }
1463
- ),
1464
- E && r?.map((x, b) => /* @__PURE__ */ i(Mo, { hotspot: x }, b))
1465
- ]
1466
- }
1467
- ) });
1468
- };
1469
- window.libpannellum = function(r, a, l) {
1470
- function s(z) {
1471
- var y = a.createElement("canvas");
1472
- y.style.width = y.style.height = "100%", z.appendChild(y);
1473
- var h, o, L, D, k, m, N, w, d, C, P, O, M, X, S, V;
1474
- this.init = function(c, g, le, oe, q, v, Q, $) {
1475
- if (g === l && (g = "equirectangular"), g != "equirectangular" && g != "cubemap" && g != "multires")
1476
- throw console.log("Error: invalid image type specified!"), { type: "config error" };
1477
- if (C = g, d = c, P = le, V = $ || {}, h) {
1478
- if (L && (o.detachShader(h, L), o.deleteShader(L)), D && (o.detachShader(h, D), o.deleteShader(D)), o.bindBuffer(o.ARRAY_BUFFER, null), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, null), h.texture && o.deleteTexture(h.texture), h.nodeCache)
1479
- for (var he = 0; he < h.nodeCache.length; he++)
1480
- o.deleteTexture(h.nodeCache[he].texture);
1481
- o.deleteProgram(h), h = l;
1482
- }
1483
- w = l;
1484
- var ae, Se = !1, ke;
1485
- if (C == "cubemap")
1486
- for (ae = 0; ae < 6; ae++)
1487
- d[ae].width > 0 ? (ke === l && (ke = d[ae].width), ke != d[ae].width && console.log("Cube faces have inconsistent widths: " + ke + " vs. " + d[ae].width)) : Se = !0;
1488
- function Ue(De) {
1489
- if (Se) {
1490
- var U = De * De * 4, Ee = new Uint8ClampedArray(U), we = $.backgroundColor ? $.backgroundColor : [0, 0, 0];
1491
- we[0] *= 255, we[1] *= 255, we[2] *= 255;
1492
- for (var ue = 0; ue < U; ue++)
1493
- Ee[ue++] = we[0], Ee[ue++] = we[1], Ee[ue++] = we[2];
1494
- var Ce = new ImageData(Ee, De, De);
1495
- for (ae = 0; ae < 6; ae++)
1496
- d[ae].width == 0 && (d[ae] = Ce);
1497
- }
1498
- }
1499
- if (C == "cubemap" && ke & ke - 1 && (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/) || navigator.userAgent.match(/Trident.*rv[ :]*11\./)) || (o || (o = y.getContext("experimental-webgl", { alpha: !1, depth: !1 })), o && o.getError() == 1286 && Oe()), !o && (C == "multires" && d.hasOwnProperty("fallbackPath") || C == "cubemap") && ("WebkitAppearance" in a.documentElement.style || navigator.userAgent.match(/Trident.*rv[ :]*11\./) || navigator.appVersion.indexOf("MSIE 10") !== -1)) {
1500
- m && z.removeChild(m), m = a.createElement("div"), m.className = "pnlm-world";
1501
- var Ge;
1502
- d.basePath ? Ge = d.basePath + d.fallbackPath : Ge = d.fallbackPath;
1503
- var Ye = ["f", "r", "b", "l", "u", "d"], Z = 0, ie = function() {
1504
- var U = a.createElement("canvas");
1505
- U.className = "pnlm-face pnlm-" + Ye[this.side] + "face", m.appendChild(U);
1506
- var Ee = U.getContext("2d");
1507
- U.style.width = this.width + 4 + "px", U.style.height = this.height + 4 + "px", U.width = this.width + 4, U.height = this.height + 4, Ee.drawImage(this, 2, 2);
1508
- var we = Ee.getImageData(0, 0, U.width, U.height), ue = we.data, Ce, K;
1509
- for (Ce = 2; Ce < U.width - 2; Ce++)
1510
- for (K = 0; K < 4; K++)
1511
- ue[(Ce + U.width) * 4 + K] = ue[(Ce + U.width * 2) * 4 + K], ue[(Ce + U.width * (U.height - 2)) * 4 + K] = ue[(Ce + U.width * (U.height - 3)) * 4 + K];
1512
- for (Ce = 2; Ce < U.height - 2; Ce++)
1513
- for (K = 0; K < 4; K++)
1514
- ue[(Ce * U.width + 1) * 4 + K] = ue[(Ce * U.width + 2) * 4 + K], ue[((Ce + 1) * U.width - 2) * 4 + K] = ue[((Ce + 1) * U.width - 3) * 4 + K];
1515
- for (K = 0; K < 4; K++)
1516
- ue[(U.width + 1) * 4 + K] = ue[(U.width * 2 + 2) * 4 + K], ue[(U.width * 2 - 2) * 4 + K] = ue[(U.width * 3 - 3) * 4 + K], ue[(U.width * (U.height - 2) + 1) * 4 + K] = ue[(U.width * (U.height - 3) + 2) * 4 + K], ue[(U.width * (U.height - 1) - 2) * 4 + K] = ue[(U.width * (U.height - 2) - 3) * 4 + K];
1517
- for (Ce = 1; Ce < U.width - 1; Ce++)
1518
- for (K = 0; K < 4; K++)
1519
- ue[Ce * 4 + K] = ue[(Ce + U.width) * 4 + K], ue[(Ce + U.width * (U.height - 1)) * 4 + K] = ue[(Ce + U.width * (U.height - 2)) * 4 + K];
1520
- for (Ce = 1; Ce < U.height - 1; Ce++)
1521
- for (K = 0; K < 4; K++)
1522
- ue[Ce * U.width * 4 + K] = ue[(Ce * U.width + 1) * 4 + K], ue[((Ce + 1) * U.width - 1) * 4 + K] = ue[((Ce + 1) * U.width - 2) * 4 + K];
1523
- for (K = 0; K < 4; K++)
1524
- ue[K] = ue[(U.width + 1) * 4 + K], ue[(U.width - 1) * 4 + K] = ue[(U.width * 2 - 2) * 4 + K], ue[U.width * (U.height - 1) * 4 + K] = ue[(U.width * (U.height - 2) + 1) * 4 + K], ue[(U.width * U.height - 1) * 4 + K] = ue[(U.width * (U.height - 1) - 2) * 4 + K];
1525
- Ee.putImageData(we, 0, 0), ge.call(this);
1526
- }, ge = function() {
1527
- this.width > 0 ? (k === l && (k = this.width), k != this.width && console.log("Fallback faces have inconsistent widths: " + k + " vs. " + this.width)) : Se = !0, Z++, Z == 6 && (k = this.width, z.appendChild(m), Q());
1528
- };
1529
- for (Se = !1, ae = 0; ae < 6; ae++) {
1530
- var be = new Image();
1531
- be.crossOrigin = V.crossOrigin ? V.crossOrigin : "anonymous", be.side = ae, be.onload = ie, be.onerror = ge, C == "multires" ? be.src = encodeURI(Ge.replace("%s", Ye[ae]) + "." + d.extension) : be.src = encodeURI(d[ae].src);
1532
- }
1533
- Ue(k);
1534
- return;
1535
- } else if (!o)
1536
- throw console.log("Error: no WebGL support detected!"), { type: "no webgl" };
1537
- C == "cubemap" && Ue(ke), d.basePath ? d.fullpath = d.basePath + d.path : d.fullpath = d.path, d.invTileResolution = 1 / d.tileResolution;
1538
- var _e = B();
1539
- for (N = [], ae = 0; ae < 6; ae++)
1540
- N[ae] = _e.slice(ae * 12, ae * 12 + 12), _e = B();
1541
- var Ne = 0, Fe = 0;
1542
- if (C == "equirectangular" ? (Ne = Math.max(d.width, d.height), Fe = o.getParameter(o.MAX_TEXTURE_SIZE)) : C == "cubemap" && (Ne = ke, Fe = o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE)), Ne > Fe)
1543
- throw console.log("Error: The image is too big; it's " + Ne + "px wide, but this device's maximum supported size is " + Fe + "px."), { type: "webgl size error", width: Ne, maxWidth: Fe };
1544
- $ !== l && ($.horizonPitch !== l || $.horizonRoll !== l) && (w = [$.horizonPitch == l ? 0 : $.horizonPitch, $.horizonRoll == l ? 0 : $.horizonRoll]);
1545
- var Ae = o.TEXTURE_2D;
1546
- o.viewport(0, 0, o.drawingBufferWidth, o.drawingBufferHeight), L = o.createShader(o.VERTEX_SHADER);
1547
- var je = p;
1548
- C == "multires" && (je = f), o.shaderSource(L, je), o.compileShader(L), D = o.createShader(o.FRAGMENT_SHADER);
1549
- var Ve = x;
1550
- C == "cubemap" ? (Ae = o.TEXTURE_CUBE_MAP, Ve = e) : C == "multires" && (Ve = b), o.shaderSource(D, Ve), o.compileShader(D), h = o.createProgram(), o.attachShader(h, L), o.attachShader(h, D), o.linkProgram(h), o.getShaderParameter(L, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(L)), o.getShaderParameter(D, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(D)), o.getProgramParameter(h, o.LINK_STATUS) || console.log(o.getProgramInfoLog(h)), o.useProgram(h), h.drawInProgress = !1;
1551
- var Te = $.backgroundColor ? $.backgroundColor : [0, 0, 0];
1552
- o.clearColor(Te[0], Te[1], Te[2], 1), o.clear(o.COLOR_BUFFER_BIT), h.texCoordLocation = o.getAttribLocation(h, "a_texCoord"), o.enableVertexAttribArray(h.texCoordLocation), C != "multires" ? (O || (O = o.createBuffer()), o.bindBuffer(o.ARRAY_BUFFER, O), o.bufferData(o.ARRAY_BUFFER, new Float32Array([-1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), o.STATIC_DRAW), o.vertexAttribPointer(h.texCoordLocation, 2, o.FLOAT, !1, 0, 0), h.aspectRatio = o.getUniformLocation(h, "u_aspectRatio"), o.uniform1f(h.aspectRatio, o.drawingBufferWidth / o.drawingBufferHeight), h.psi = o.getUniformLocation(h, "u_psi"), h.theta = o.getUniformLocation(h, "u_theta"), h.f = o.getUniformLocation(h, "u_f"), h.h = o.getUniformLocation(h, "u_h"), h.v = o.getUniformLocation(h, "u_v"), h.vo = o.getUniformLocation(h, "u_vo"), h.rot = o.getUniformLocation(h, "u_rot"), o.uniform1f(h.h, oe / (Math.PI * 2)), o.uniform1f(h.v, q / Math.PI), o.uniform1f(h.vo, v / Math.PI * 2), C == "equirectangular" && (h.backgroundColor = o.getUniformLocation(h, "u_backgroundColor"), o.uniform4fv(h.backgroundColor, Te.concat([1]))), h.texture = o.createTexture(), o.bindTexture(Ae, h.texture), C == "cubemap" ? (o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[1]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[3]), o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[4]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[5]), o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[0]), o.texImage2D(o.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d[2])) : o.texImage2D(Ae, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d), o.texParameteri(Ae, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(Ae, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE), o.texParameteri(Ae, o.TEXTURE_MIN_FILTER, o.LINEAR), o.texParameteri(Ae, o.TEXTURE_MAG_FILTER, o.LINEAR)) : (h.vertPosLocation = o.getAttribLocation(h, "a_vertCoord"), o.enableVertexAttribArray(h.vertPosLocation), M || (M = o.createBuffer()), X || (X = o.createBuffer()), S || (S = o.createBuffer()), o.bindBuffer(o.ARRAY_BUFFER, X), o.bufferData(o.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), o.STATIC_DRAW), o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, S), o.bufferData(o.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), o.STATIC_DRAW), h.perspUniform = o.getUniformLocation(h, "u_perspMatrix"), h.cubeUniform = o.getUniformLocation(h, "u_cubeMatrix"), h.level = -1, h.currentNodes = [], h.nodeCache = [], h.nodeCacheTimestamp = 0);
1553
- var He = o.getError();
1554
- if (He !== 0)
1555
- throw console.log("Error: Something went wrong with WebGL!", He), { type: "webgl error" };
1556
- Q();
1557
- }, this.destroy = function() {
1558
- if (z !== l && (y !== l && z.contains(y) && z.removeChild(y), m !== l && z.contains(m) && z.removeChild(m)), o) {
1559
- var c = o.getExtension("WEBGL_lose_context");
1560
- c && c.loseContext();
1561
- }
1562
- }, this.resize = function() {
1563
- var c = r.devicePixelRatio || 1;
1564
- y.width = y.clientWidth * c, y.height = y.clientHeight * c, o && (o.getError() == 1286 && Oe(), o.viewport(0, 0, o.drawingBufferWidth, o.drawingBufferHeight), C != "multires" && o.uniform1f(h.aspectRatio, y.clientWidth / y.clientHeight));
1565
- }, this.resize(), this.setPose = function(c, g) {
1566
- w = [c, g];
1567
- }, this.render = function(c, g, le, oe) {
1568
- var q, v, Q, $ = 0;
1569
- if (oe === l && (oe = {}), oe.roll && ($ = oe.roll), w !== l) {
1570
- var he = w[0], ae = w[1], Se = c, ke = g, Ue = Math.cos(ae) * Math.sin(c) * Math.sin(he) + Math.cos(c) * (Math.cos(he) * Math.cos(g) + Math.sin(ae) * Math.sin(he) * Math.sin(g)), Ge = -Math.sin(c) * Math.sin(ae) + Math.cos(c) * Math.cos(ae) * Math.sin(g), Ye = Math.cos(ae) * Math.cos(he) * Math.sin(c) + Math.cos(c) * (-Math.cos(g) * Math.sin(he) + Math.cos(he) * Math.sin(ae) * Math.sin(g));
1571
- c = Math.asin(Math.max(Math.min(Ye, 1), -1)), g = Math.atan2(Ge, Ue);
1572
- var Z = [Math.cos(Se) * (Math.sin(ae) * Math.sin(he) * Math.cos(ke) - Math.cos(he) * Math.sin(ke)), Math.cos(Se) * Math.cos(ae) * Math.cos(ke), Math.cos(Se) * (Math.cos(he) * Math.sin(ae) * Math.cos(ke) + Math.sin(ke) * Math.sin(he))], ie = [-Math.cos(c) * Math.sin(g), Math.cos(c) * Math.cos(g)], ge = Math.acos(Math.max(Math.min((Z[0] * ie[0] + Z[1] * ie[1]) / (Math.sqrt(Z[0] * Z[0] + Z[1] * Z[1] + Z[2] * Z[2]) * Math.sqrt(ie[0] * ie[0] + ie[1] * ie[1])), 1), -1));
1573
- Z[2] < 0 && (ge = 2 * Math.PI - ge), $ += ge;
1574
- }
1575
- if (!o && (C == "multires" || C == "cubemap")) {
1576
- Q = k / 2;
1577
- var be = {
1578
- f: "translate3d(-" + (Q + 2) + "px, -" + (Q + 2) + "px, -" + Q + "px)",
1579
- b: "translate3d(" + (Q + 2) + "px, -" + (Q + 2) + "px, " + Q + "px) rotateX(180deg) rotateZ(180deg)",
1580
- u: "translate3d(-" + (Q + 2) + "px, -" + Q + "px, " + (Q + 2) + "px) rotateX(270deg)",
1581
- d: "translate3d(-" + (Q + 2) + "px, " + Q + "px, -" + (Q + 2) + "px) rotateX(90deg)",
1582
- l: "translate3d(-" + Q + "px, -" + (Q + 2) + "px, " + (Q + 2) + "px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)",
1583
- r: "translate3d(" + Q + "px, -" + (Q + 2) + "px, -" + (Q + 2) + "px) rotateY(270deg)"
1584
- };
1585
- q = 1 / Math.tan(le / 2);
1586
- var _e = q * y.clientWidth / 2 + "px", Ne = "perspective(" + _e + ") translateZ(" + _e + ") rotateX(" + c + "rad) rotateY(" + g + "rad) ", Fe = Object.keys(be);
1587
- for (v = 0; v < 6; v++) {
1588
- var Ae = m.querySelector(".pnlm-" + Fe[v] + "face");
1589
- Ae && (Ae.style.webkitTransform = Ne + be[Fe[v]], Ae.style.transform = Ne + be[Fe[v]]);
1590
- }
1591
- return;
1592
- }
1593
- if (C != "multires") {
1594
- var je = 2 * Math.atan(Math.tan(le * 0.5) / (o.drawingBufferWidth / o.drawingBufferHeight));
1595
- q = 1 / Math.tan(je * 0.5), o.uniform1f(h.psi, g), o.uniform1f(h.theta, c), o.uniform1f(h.rot, $), o.uniform1f(h.f, q), P === !0 && C == "equirectangular" && (o.bindTexture(o.TEXTURE_2D, h.texture), o.texImage2D(o.TEXTURE_2D, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, d)), o.drawArrays(o.TRIANGLES, 0, 6);
1596
- } else {
1597
- var Ve = ne(le, o.drawingBufferWidth / o.drawingBufferHeight, 0.1, 100);
1598
- ze(le);
1599
- var Te = J();
1600
- Te = me(Te, -$, "z"), Te = me(Te, -c, "x"), Te = me(Te, g, "y"), Te = xe(Te), o.uniformMatrix4fv(h.perspUniform, !1, new Float32Array(Pe(Ve))), o.uniformMatrix4fv(h.cubeUniform, !1, new Float32Array(Pe(Te)));
1601
- var He = Y(Ve, Te);
1602
- if (h.nodeCache.sort(te), h.nodeCache.length > 200 && h.nodeCache.length > h.currentNodes.length + 50)
1603
- for (var De = h.nodeCache.splice(200, h.nodeCache.length - 200), v = 0; v < De.length; v++)
1604
- o.deleteTexture(De[v].texture);
1605
- h.currentNodes = [];
1606
- var U = ["f", "b", "u", "d", "l", "r"];
1607
- for (Q = 0; Q < 6; Q++) {
1608
- var Ee = new F(N[Q], U[Q], 1, 0, 0, d.fullpath);
1609
- T(He, Ee, c, g);
1610
- }
1611
- for (h.currentNodes.sort(W), v = G.length - 1; v >= 0; v--)
1612
- h.currentNodes.indexOf(G[v].node) === -1 && (G[v].node.textureLoad = !1, G.splice(v, 1));
1613
- if (G.length === 0)
1614
- for (v = 0; v < h.currentNodes.length; v++) {
1615
- var we = h.currentNodes[v];
1616
- if (!we.texture && !we.textureLoad) {
1617
- we.textureLoad = !0, setTimeout(H, 0, we);
1618
- break;
1619
- }
1620
- }
1621
- I();
1622
- }
1623
- if (oe.returnImage !== l)
1624
- return y.toDataURL("image/png");
1625
- }, this.isLoading = function() {
1626
- if (o && C == "multires") {
1627
- for (var c = 0; c < h.currentNodes.length; c++)
1628
- if (!h.currentNodes[c].textureLoaded)
1629
- return !0;
1630
- }
1631
- return !1;
1632
- }, this.getCanvas = function() {
1633
- return y;
1634
- };
1635
- function te(c, g) {
1636
- return c.level == 1 && g.level != 1 ? -1 : g.level == 1 && c.level != 1 ? 1 : g.timestamp - c.timestamp;
1637
- }
1638
- function W(c, g) {
1639
- return c.level != g.level ? c.level - g.level : c.diff - g.diff;
1640
- }
1641
- function I() {
1642
- if (!h.drawInProgress) {
1643
- h.drawInProgress = !0, o.clear(o.COLOR_BUFFER_BIT);
1644
- for (var c = 0; c < h.currentNodes.length; c++)
1645
- h.currentNodes[c].textureLoaded > 1 && (o.bindBuffer(o.ARRAY_BUFFER, M), o.bufferData(o.ARRAY_BUFFER, new Float32Array(h.currentNodes[c].vertices), o.STATIC_DRAW), o.vertexAttribPointer(h.vertPosLocation, 3, o.FLOAT, !1, 0, 0), o.bindBuffer(o.ARRAY_BUFFER, X), o.vertexAttribPointer(h.texCoordLocation, 2, o.FLOAT, !1, 0, 0), o.bindTexture(o.TEXTURE_2D, h.currentNodes[c].texture), o.drawElements(o.TRIANGLES, 6, o.UNSIGNED_SHORT, 0));
1646
- h.drawInProgress = !1;
1647
- }
1648
- }
1649
- function F(c, g, le, oe, q, v) {
1650
- this.vertices = c, this.side = g, this.level = le, this.x = oe, this.y = q, this.path = v.replace("%s", g).replace("%l", le).replace("%x", oe).replace("%y", q);
1651
- }
1652
- function T(c, g, le, oe, q) {
1653
- if (Ze(c, g.vertices)) {
1654
- var v = g.vertices, Q = v[0] + v[3] + v[6] + v[9], $ = v[1] + v[4] + v[7] + v[10], he = v[2] + v[5] + v[8] + v[11], ae = Math.sqrt(Q * Q + $ * $ + he * he), Se = Math.asin(he / ae), ke = Math.atan2($, Q), Ue = ke - oe;
1655
- Ue += Ue > Math.PI ? -2 * Math.PI : Ue < -Math.PI ? 2 * Math.PI : 0, Ue = Math.abs(Ue), g.diff = Math.acos(Math.sin(le) * Math.sin(Se) + Math.cos(le) * Math.cos(Se) * Math.cos(Ue));
1656
- for (var Ge = !1, Ye = 0; Ye < h.nodeCache.length; Ye++)
1657
- if (h.nodeCache[Ye].path == g.path) {
1658
- Ge = !0, h.nodeCache[Ye].timestamp = h.nodeCacheTimestamp++, h.nodeCache[Ye].diff = g.diff, h.currentNodes.push(h.nodeCache[Ye]);
1659
- break;
1660
- }
1661
- if (Ge || (g.timestamp = h.nodeCacheTimestamp++, h.currentNodes.push(g), h.nodeCache.push(g)), g.level < h.level) {
1662
- var Z = d.cubeResolution * Math.pow(2, g.level - d.maxLevel), ie = Math.ceil(Z * d.invTileResolution) - 1, ge = Z % d.tileResolution * 2, be = Z * 2 % d.tileResolution;
1663
- be === 0 && (be = d.tileResolution), ge === 0 && (ge = d.tileResolution * 2);
1664
- var _e = 0.5;
1665
- (g.x == ie || g.y == ie) && (_e = 1 - d.tileResolution / (d.tileResolution + be));
1666
- var Ne = 1 - _e, Fe = [], Ae, je, Ve = _e, Te = _e, He = _e, De = Ne, U = Ne, Ee = Ne;
1667
- be < d.tileResolution && (g.x == ie && g.y != ie ? (Te = 0.5, U = 0.5, (g.side == "d" || g.side == "u") && (He = 0.5, Ee = 0.5)) : g.x != ie && g.y == ie && (Ve = 0.5, De = 0.5, (g.side == "l" || g.side == "r") && (He = 0.5, Ee = 0.5))), ge <= d.tileResolution && (g.x == ie && (Ve = 0, De = 1, (g.side == "l" || g.side == "r") && (He = 0, Ee = 1)), g.y == ie && (Te = 0, U = 1, (g.side == "d" || g.side == "u") && (He = 0, Ee = 1))), Ae = [v[0], v[1], v[2], v[0] * Ve + v[3] * De, v[1] * _e + v[4] * Ne, v[2] * He + v[5] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[0] * _e + v[9] * Ne, v[1] * Te + v[10] * U, v[2] * He + v[11] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2, g.y * 2, d.fullpath), Fe.push(je), g.x == ie && ge <= d.tileResolution || (Ae = [v[0] * Ve + v[3] * De, v[1] * _e + v[4] * Ne, v[2] * He + v[5] * Ee, v[3], v[4], v[5], v[3] * _e + v[6] * Ne, v[4] * Te + v[7] * U, v[5] * He + v[8] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2 + 1, g.y * 2, d.fullpath), Fe.push(je)), !(g.x == ie && ge <= d.tileResolution) && !(g.y == ie && ge <= d.tileResolution) && (Ae = [v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[3] * _e + v[6] * Ne, v[4] * Te + v[7] * U, v[5] * He + v[8] * Ee, v[6], v[7], v[8], v[9] * Ve + v[6] * De, v[10] * _e + v[7] * Ne, v[11] * He + v[8] * Ee], je = new F(Ae, g.side, g.level + 1, g.x * 2 + 1, g.y * 2 + 1, d.fullpath), Fe.push(je)), g.y == ie && ge <= d.tileResolution || (Ae = [v[0] * _e + v[9] * Ne, v[1] * Te + v[10] * U, v[2] * He + v[11] * Ee, v[0] * Ve + v[6] * De, v[1] * Te + v[7] * U, v[2] * He + v[8] * Ee, v[9] * Ve + v[6] * De, v[10] * _e + v[7] * Ne, v[11] * He + v[8] * Ee, v[9], v[10], v[11]], je = new F(Ae, g.side, g.level + 1, g.x * 2, g.y * 2 + 1, d.fullpath), Fe.push(je));
1668
- for (var we = 0; we < Fe.length; we++)
1669
- T(c, Fe[we], le, oe);
1670
- }
1671
- }
1672
- }
1673
- function B() {
1674
- return [
1675
- -1,
1676
- 1,
1677
- -1,
1678
- 1,
1679
- 1,
1680
- -1,
1681
- 1,
1682
- -1,
1683
- -1,
1684
- -1,
1685
- -1,
1686
- -1,
1687
- // Front face
1688
- 1,
1689
- 1,
1690
- 1,
1691
- -1,
1692
- 1,
1693
- 1,
1694
- -1,
1695
- -1,
1696
- 1,
1697
- 1,
1698
- -1,
1699
- 1,
1700
- // Back face
1701
- -1,
1702
- 1,
1703
- 1,
1704
- 1,
1705
- 1,
1706
- 1,
1707
- 1,
1708
- 1,
1709
- -1,
1710
- -1,
1711
- 1,
1712
- -1,
1713
- // Up face
1714
- -1,
1715
- -1,
1716
- -1,
1717
- 1,
1718
- -1,
1719
- -1,
1720
- 1,
1721
- -1,
1722
- 1,
1723
- -1,
1724
- -1,
1725
- 1,
1726
- // Down face
1727
- -1,
1728
- 1,
1729
- 1,
1730
- -1,
1731
- 1,
1732
- -1,
1733
- -1,
1734
- -1,
1735
- -1,
1736
- -1,
1737
- -1,
1738
- 1,
1739
- // Left face
1740
- 1,
1741
- 1,
1742
- -1,
1743
- 1,
1744
- 1,
1745
- 1,
1746
- 1,
1747
- -1,
1748
- 1,
1749
- 1,
1750
- -1,
1751
- -1
1752
- // Right face
1753
- ];
1754
- }
1755
- function J() {
1756
- return [1, 0, 0, 0, 1, 0, 0, 0, 1];
1757
- }
1758
- function me(c, g, le) {
1759
- var oe = Math.sin(g), q = Math.cos(g);
1760
- if (le == "x")
1761
- return [c[0], q * c[1] + oe * c[2], q * c[2] - oe * c[1], c[3], q * c[4] + oe * c[5], q * c[5] - oe * c[4], c[6], q * c[7] + oe * c[8], q * c[8] - oe * c[7]];
1762
- if (le == "y")
1763
- return [q * c[0] - oe * c[2], c[1], q * c[2] + oe * c[0], q * c[3] - oe * c[5], c[4], q * c[5] + oe * c[3], q * c[6] - oe * c[8], c[7], q * c[8] + oe * c[6]];
1764
- if (le == "z")
1765
- return [q * c[0] + oe * c[1], q * c[1] - oe * c[0], c[2], q * c[3] + oe * c[4], q * c[4] - oe * c[3], c[5], q * c[6] + oe * c[7], q * c[7] - oe * c[6], c[8]];
1766
- }
1767
- function xe(c) {
1768
- return [c[0], c[1], c[2], 0, c[3], c[4], c[5], 0, c[6], c[7], c[8], 0, 0, 0, 0, 1];
1769
- }
1770
- function Pe(c) {
1771
- return [c[0], c[4], c[8], c[12], c[1], c[5], c[9], c[13], c[2], c[6], c[10], c[14], c[3], c[7], c[11], c[15]];
1772
- }
1773
- function ne(c, g, le, oe) {
1774
- var q = 2 * Math.atan(Math.tan(c / 2) * o.drawingBufferHeight / o.drawingBufferWidth), v = 1 / Math.tan(q / 2);
1775
- return [v / g, 0, 0, 0, 0, v, 0, 0, 0, 0, (oe + le) / (le - oe), 2 * oe * le / (le - oe), 0, 0, -1, 0];
1776
- }
1777
- function re(c, g) {
1778
- o.bindTexture(o.TEXTURE_2D, g), o.texImage2D(o.TEXTURE_2D, 0, o.RGB, o.RGB, o.UNSIGNED_BYTE, c), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, o.CLAMP_TO_EDGE), o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, o.CLAMP_TO_EDGE), o.bindTexture(o.TEXTURE_2D, null);
1779
- }
1780
- var G = [], ve = function() {
1781
- var c = 4, g = {}, le;
1782
- function oe() {
1783
- var $ = this;
1784
- this.texture = this.callback = null, this.image = new Image(), this.image.crossOrigin = le || "anonymous";
1785
- var he = function() {
1786
- $.image.width > 0 && $.image.height > 0 ? (re($.image, $.texture), $.callback($.texture, !0)) : $.callback($.texture, !1), v($);
1787
- };
1788
- this.image.addEventListener("load", he), this.image.addEventListener("error", he);
1789
- }
1790
- oe.prototype.loadTexture = function($, he, ae) {
1791
- this.texture = he, this.callback = ae, this.image.src = $;
1792
- };
1793
- function q($, he, ae, Se) {
1794
- this.node = $, this.src = he, this.texture = ae, this.callback = Se;
1795
- }
1796
- function v($) {
1797
- if (G.length) {
1798
- var he = G.shift();
1799
- $.loadTexture(he.src, he.texture, he.callback);
1800
- } else
1801
- g[c++] = $;
1802
- }
1803
- for (var Q = 0; Q < c; Q++)
1804
- g[Q] = new oe();
1805
- return function($, he, ae, Se) {
1806
- le = Se;
1807
- var ke = o.createTexture();
1808
- return c ? g[--c].loadTexture(he, ke, ae) : G.push(new q($, he, ke, ae)), ke;
1809
- };
1810
- }();
1811
- function H(c) {
1812
- ve(c, encodeURI(c.path + "." + d.extension), function(g, le) {
1813
- c.texture = g, c.textureLoaded = le ? 2 : 1;
1814
- }, V.crossOrigin);
1815
- }
1816
- function ze(c) {
1817
- for (var g = 1; g < d.maxLevel && o.drawingBufferWidth > d.tileResolution * Math.pow(2, g - 1) * Math.tan(c / 2) * 0.707; )
1818
- g++;
1819
- h.level = g;
1820
- }
1821
- function Y(c, g) {
1822
- return [c[0] * g[0], c[0] * g[1], c[0] * g[2], 0, c[5] * g[4], c[5] * g[5], c[5] * g[6], 0, c[10] * g[8], c[10] * g[9], c[10] * g[10], c[11], -g[8], -g[9], -g[10], 0];
1823
- }
1824
- function Re(c, g) {
1825
- return [c[0] * g[0] + c[1] * g[1] + c[2] * g[2], c[4] * g[0] + c[5] * g[1] + c[6] * g[2], c[11] + c[8] * g[0] + c[9] * g[1] + c[10] * g[2], 1 / (c[12] * g[0] + c[13] * g[1] + c[14] * g[2])];
1826
- }
1827
- function Be(c, g) {
1828
- var le = Re(c, g), oe = le[0] * le[3], q = le[1] * le[3], v = le[2] * le[3], Q = [0, 0, 0];
1829
- return oe < -1 && (Q[0] = -1), oe > 1 && (Q[0] = 1), q < -1 && (Q[1] = -1), q > 1 && (Q[1] = 1), (v < -1 || v > 1) && (Q[2] = 1), Q;
1830
- }
1831
- function Ze(c, g) {
1832
- var le = Be(c, g.slice(0, 3)), oe = Be(c, g.slice(3, 6)), q = Be(c, g.slice(6, 9)), v = Be(c, g.slice(9, 12)), Q = le[0] + oe[0] + q[0] + v[0];
1833
- if (Q == -4 || Q == 4)
1834
- return !1;
1835
- var $ = le[1] + oe[1] + q[1] + v[1];
1836
- if ($ == -4 || $ == 4)
1837
- return !1;
1838
- var he = le[2] + oe[2] + q[2] + v[2];
1839
- return he != 4;
1840
- }
1841
- function Oe() {
1842
- console.log("Reducing canvas size due to error 1286!"), y.width = Math.round(y.width / 2), y.height = Math.round(y.height / 2);
1843
- }
1844
- }
1845
- var p = [
1846
- "attribute vec2 a_texCoord;",
1847
- "varying vec2 v_texCoord;",
1848
- "void main() {",
1849
- // Set position
1850
- "gl_Position = vec4(a_texCoord, 0.0, 1.0);",
1851
- // Pass the coordinates to the fragment shader
1852
- "v_texCoord = a_texCoord;",
1853
- "}"
1854
- ].join(""), f = [
1855
- "attribute vec3 a_vertCoord;",
1856
- "attribute vec2 a_texCoord;",
1857
- "uniform mat4 u_cubeMatrix;",
1858
- "uniform mat4 u_perspMatrix;",
1859
- "varying mediump vec2 v_texCoord;",
1860
- "void main(void) {",
1861
- // Set position
1862
- "gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);",
1863
- // Pass the coordinates to the fragment shader
1864
- "v_texCoord = a_texCoord;",
1865
- "}"
1866
- ].join(""), E = [
1867
- "precision mediump float;",
1868
- "uniform float u_aspectRatio;",
1869
- "uniform float u_psi;",
1870
- "uniform float u_theta;",
1871
- "uniform float u_f;",
1872
- "uniform float u_h;",
1873
- "uniform float u_v;",
1874
- "uniform float u_vo;",
1875
- "uniform float u_rot;",
1876
- "const float PI = 3.14159265358979323846264;",
1877
- // Texture
1878
- "uniform sampler2D u_image;",
1879
- "uniform samplerCube u_imageCube;",
1880
- // Coordinates passed in from vertex shader
1881
- "varying vec2 v_texCoord;",
1882
- // Background color (display for partial panoramas)
1883
- "uniform vec4 u_backgroundColor;",
1884
- "void main() {",
1885
- // Map canvas/camera to sphere
1886
- "float x = v_texCoord.x * u_aspectRatio;",
1887
- "float y = v_texCoord.y;",
1888
- "float sinrot = sin(u_rot);",
1889
- "float cosrot = cos(u_rot);",
1890
- "float rot_x = x * cosrot - y * sinrot;",
1891
- "float rot_y = x * sinrot + y * cosrot;",
1892
- "float sintheta = sin(u_theta);",
1893
- "float costheta = cos(u_theta);",
1894
- "float a = u_f * costheta - rot_y * sintheta;",
1895
- "float root = sqrt(rot_x * rot_x + a * a);",
1896
- "float lambda = atan(rot_x / root, a / root) + u_psi;",
1897
- "float phi = atan((rot_y * costheta + u_f * sintheta) / root);"
1898
- ].join(`
1899
- `), e = E + [
1900
- // Look up color from texture
1901
- "float cosphi = cos(phi);",
1902
- "gl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));",
1903
- "}"
1904
- ].join(`
1905
- `), x = E + [
1906
- // Wrap image
1907
- "lambda = mod(lambda + PI, PI * 2.0) - PI;",
1908
- // Map texture to sphere
1909
- "vec2 coord = vec2(lambda / PI, phi / (PI / 2.0));",
1910
- // Look up color from texture
1911
- // Map from [-1,1] to [0,1] and flip y-axis
1912
- "if(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)",
1913
- "gl_FragColor = u_backgroundColor;",
1914
- "else",
1915
- "gl_FragColor = texture2D(u_image, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));",
1916
- "}"
1917
- ].join(`
1918
- `), b = [
1919
- "varying mediump vec2 v_texCoord;",
1920
- "uniform sampler2D u_sampler;",
1921
- //'uniform mediump vec4 u_color;',
1922
- "void main(void) {",
1923
- // Look up color from texture
1924
- "gl_FragColor = texture2D(u_sampler, v_texCoord);",
1925
- // 'gl_FragColor = u_color;',
1926
- "}"
1927
- ].join("");
1928
- return {
1929
- renderer: function(y, h, o, L) {
1930
- return new s(y);
1931
- }
1932
- };
1933
- }(window, document);
1934
- window.pannellum = /* @__PURE__ */ function(r, a, l) {
1935
- function s(p, f) {
1936
- var E = this, e, x, b, z = !1, y = Date.now(), h = 0, o = 0, L = -1, D = 0, k = 0, m = new Array(10), N = !1, w, d = !1, C = !1, P, O, M = { yaw: 0, pitch: 0, hfov: 0 }, X = !1, S = !1, V = 0, te, W = 0, I, F, T = {}, B = {}, J = [], me = !1, xe = !1, Pe = {
1937
- hfov: 100,
1938
- minHfov: 50,
1939
- maxHfov: 120,
1940
- pitch: 0,
1941
- minPitch: l,
1942
- maxPitch: l,
1943
- yaw: 0,
1944
- minYaw: -180,
1945
- maxYaw: 180,
1946
- roll: 0,
1947
- haov: 360,
1948
- vaov: 180,
1949
- vOffset: 0,
1950
- autoRotate: !1,
1951
- autoRotateInactivityDelay: -1,
1952
- autoRotateStopDelay: l,
1953
- type: "equirectangular",
1954
- northOffset: 0,
1955
- showFullscreenCtrl: !0,
1956
- dynamic: !1,
1957
- doubleClickZoom: !0,
1958
- keyboardZoom: !0,
1959
- mouseZoom: !0,
1960
- showZoomCtrl: !0,
1961
- autoLoad: !1,
1962
- showControls: !0,
1963
- orientationOnByDefault: !1,
1964
- hotSpotDebug: !1,
1965
- backgroundColor: [0, 0, 0],
1966
- avoidShowingBackground: !1,
1967
- animationTimingFunction: U,
1968
- draggable: !0,
1969
- disableKeyboardCtrl: !1,
1970
- crossOrigin: "anonymous",
1971
- touchPanSpeedCoeffFactor: 1,
1972
- capturedKeyNumbers: [16, 17, 27, 37, 38, 39, 40, 61, 65, 68, 83, 87, 107, 109, 173, 187, 189]
1973
- };
1974
- Pe.strings = {
1975
- // Labels
1976
- loadButtonLabel: "Click to<br>Load<br>Panorama",
1977
- loadingLabel: "Loading...",
1978
- bylineLabel: "by %s",
1979
- // One substitution: author
1980
- // Errors
1981
- noPanoramaError: "No panorama image was specified.",
1982
- fileAccessError: "The file %s could not be accessed.",
1983
- // One substitution: file URL
1984
- malformedURLError: "There is something wrong with the panorama URL.",
1985
- iOS8WebGLError: "Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",
1986
- genericWebGLError: "Your browser does not have the necessary WebGL support to display this panorama.",
1987
- textureSizeError: "This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",
1988
- // Two substitutions: image width, max image width
1989
- unknownError: "Unknown error. Check developer console."
1990
- }, p = typeof p == "string" ? a.getElementById(p) : p, p.classList.add("pnlm-container"), p.tabIndex = 0;
1991
- var ne = a.createElement("div");
1992
- ne.className = "pnlm-ui", p.appendChild(ne);
1993
- var re = a.createElement("div");
1994
- re.className = "pnlm-render-container", p.appendChild(re);
1995
- var G = a.createElement("div");
1996
- G.className = "pnlm-dragfix", ne.appendChild(G);
1997
- var ve = a.createElement("span");
1998
- ve.className = "pnlm-about-msg", ve.innerHTML = '<a href="https://pannellum.org/" target="_blank">Pannellum</a>', ne.appendChild(ve), G.addEventListener("contextmenu", Q);
1999
- var H = {}, ze = a.createElement("div");
2000
- ze.className = "pnlm-sprite pnlm-hot-spot-debug-indicator", ne.appendChild(ze), H.container = a.createElement("div"), H.container.className = "pnlm-panorama-info", H.title = a.createElement("div"), H.title.className = "pnlm-title-box", H.container.appendChild(H.title), H.author = a.createElement("div"), H.author.className = "pnlm-author-box", H.container.appendChild(H.author), ne.appendChild(H.container), H.load = {}, H.load.box = a.createElement("div"), H.load.box.className = "pnlm-load-box", H.load.boxp = a.createElement("p"), H.load.box.appendChild(H.load.boxp), H.load.lbox = a.createElement("div"), H.load.lbox.className = "pnlm-lbox", H.load.lbox.innerHTML = '<div class="pnlm-loading"></div>', H.load.box.appendChild(H.load.lbox), H.load.lbar = a.createElement("div"), H.load.lbar.className = "pnlm-lbar", H.load.lbarFill = a.createElement("div"), H.load.lbarFill.className = "pnlm-lbar-fill", H.load.lbar.appendChild(H.load.lbarFill), H.load.box.appendChild(H.load.lbar), H.load.msg = a.createElement("p"), H.load.msg.className = "pnlm-lmsg", H.load.box.appendChild(H.load.msg), ne.appendChild(H.load.box), H.errorMsg = a.createElement("div"), H.errorMsg.className = "pnlm-error-msg pnlm-info-box", ne.appendChild(H.errorMsg);
2001
- var Y = {};
2002
- Y.container = a.createElement("div"), Y.container.className = "pnlm-controls-container", ne.appendChild(Y.container), Y.load = a.createElement("div"), Y.load.className = "pnlm-load-button", Y.load.addEventListener("click", function() {
2003
- kt(), Ut();
2004
- }), ne.appendChild(Y.load), Y.zoom = a.createElement("div"), Y.zoom.className = "pnlm-zoom-controls pnlm-controls", Y.zoomIn = a.createElement("div"), Y.zoomIn.className = "pnlm-zoom-in pnlm-sprite pnlm-control", Y.zoomIn.addEventListener("click", Nr), Y.zoom.appendChild(Y.zoomIn), Y.zoomOut = a.createElement("div"), Y.zoomOut.className = "pnlm-zoom-out pnlm-sprite pnlm-control", Y.zoomOut.addEventListener("click", zr), Y.zoom.appendChild(Y.zoomOut), Y.container.appendChild(Y.zoom), Y.fullscreen = a.createElement("div"), Y.fullscreen.addEventListener("click", It), Y.fullscreen.className = "pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control", (a.fullscreenEnabled || a.mozFullScreenEnabled || a.webkitFullscreenEnabled || a.msFullscreenEnabled) && Y.container.appendChild(Y.fullscreen), Y.orientation = a.createElement("div"), Y.orientation.addEventListener("click", function(t) {
2005
- S ? ht() : vt();
2006
- }), Y.orientation.addEventListener("mousedown", function(t) {
2007
- t.stopPropagation();
2008
- }), Y.orientation.addEventListener("touchstart", function(t) {
2009
- t.stopPropagation();
2010
- }), Y.orientation.addEventListener("pointerdown", function(t) {
2011
- t.stopPropagation();
2012
- }), Y.orientation.className = "pnlm-orientation-button pnlm-orientation-button-inactive pnlm-sprite pnlm-controls pnlm-control";
2013
- var Re, Be = !1;
2014
- function Ze(t) {
2015
- r.removeEventListener("deviceorientation", Ze), t && t.alpha !== null && t.beta !== null && t.gamma !== null ? (Y.container.appendChild(Y.orientation), Re = !0, Be && vt()) : Re = !1;
2016
- }
2017
- r.DeviceOrientationEvent ? r.addEventListener("deviceorientation", Ze) : Re = !1;
2018
- var Oe = a.createElement("div");
2019
- Oe.className = "pnlm-compass pnlm-controls pnlm-control", ne.appendChild(Oe), f.firstScene ? mt(f.firstScene) : f.default && f.default.firstScene ? mt(f.default.firstScene) : mt(null), kt(!0);
2020
- function c() {
2021
- var t = a.createElement("div");
2022
- if (t.innerHTML = "<!--[if lte IE 9]><i></i><![endif]-->", t.getElementsByTagName("i").length == 1) {
2023
- q();
2024
- return;
2025
- }
2026
- I = e.hfov, F = e.pitch;
2027
- var n, u;
2028
- if (e.type == "cubemap") {
2029
- for (P = [], n = 0; n < 6; n++)
2030
- P.push(new Image()), P[n].crossOrigin = e.crossOrigin;
2031
- H.load.lbox.style.display = "block", H.load.lbar.style.display = "none";
2032
- } else if (e.type == "multires") {
2033
- var R = JSON.parse(JSON.stringify(e.multiRes));
2034
- e.basePath && e.multiRes.basePath && !/^(?:[a-z]+:)?\/\//i.test(e.multiRes.basePath) ? R.basePath = e.basePath + e.multiRes.basePath : e.multiRes.basePath ? R.basePath = e.multiRes.basePath : e.basePath && (R.basePath = e.basePath), P = R;
2035
- } else if (e.dynamic === !0)
2036
- P = e.panorama;
2037
- else {
2038
- if (e.panorama === l) {
2039
- q(e.strings.noPanoramaError);
2040
- return;
2041
- }
2042
- P = new Image();
2043
- }
2044
- if (e.type == "cubemap") {
2045
- var A = 6, _ = function() {
2046
- A--, A === 0 && le();
2047
- }, se = function(Me) {
2048
- var ye = a.createElement("a");
2049
- ye.href = Me.target.src, ye.textContent = ye.href, q(e.strings.fileAccessError.replace("%s", ye.outerHTML));
2050
- };
2051
- for (n = 0; n < P.length; n++)
2052
- u = e.cubeMap[n], u == "null" ? (console.log("Will use background instead of missing cubemap face " + n), _()) : (e.basePath && !g(u) && (u = e.basePath + u), P[n].onload = _, P[n].onerror = se, P[n].src = lt(u));
2053
- } else if (e.type == "multires")
2054
- le();
2055
- else if (u = "", e.basePath && (u = e.basePath), e.dynamic !== !0) {
2056
- u = g(e.panorama) ? e.panorama : u + e.panorama, P.onload = function() {
2057
- r.URL.revokeObjectURL(this.src), le();
2058
- };
2059
- var ee = new XMLHttpRequest();
2060
- ee.onloadend = function() {
2061
- if (ee.status != 200) {
2062
- var de = a.createElement("a");
2063
- de.href = u, de.textContent = de.href, q(e.strings.fileAccessError.replace("%s", de.outerHTML));
2064
- }
2065
- var Me = this.response;
2066
- oe(Me), H.load.msg.innerHTML = "";
2067
- }, ee.onprogress = function(de) {
2068
- if (de.lengthComputable) {
2069
- var Me = de.loaded / de.total * 100;
2070
- H.load.lbarFill.style.width = Me + "%";
2071
- var ye, qe, We;
2072
- de.total > 1e6 ? (ye = "MB", qe = (de.loaded / 1e6).toFixed(2), We = (de.total / 1e6).toFixed(2)) : de.total > 1e3 ? (ye = "kB", qe = (de.loaded / 1e3).toFixed(1), We = (de.total / 1e3).toFixed(1)) : (ye = "B", qe = de.loaded, We = de.total), H.load.msg.innerHTML = qe + " / " + We + " " + ye;
2073
- } else
2074
- H.load.lbox.style.display = "block", H.load.lbar.style.display = "none";
2075
- };
2076
- try {
2077
- ee.open("GET", u, !0);
2078
- } catch {
2079
- q(e.strings.malformedURLError);
2080
- }
2081
- ee.responseType = "blob", ee.setRequestHeader("Accept", "image/*,*/*;q=0.9"), ee.withCredentials = e.crossOrigin === "use-credentials", ee.send();
2082
- }
2083
- e.draggable && ne.classList.add("pnlm-grab"), ne.classList.remove("pnlm-grabbing");
2084
- }
2085
- function g(t) {
2086
- return new RegExp("^(?:[a-z]+:)?//", "i").test(t) || t[0] == "/" || t.slice(0, 5) == "blob:";
2087
- }
2088
- function le() {
2089
- x || (x = new libpannellum.renderer(re)), C || (C = !0, G.addEventListener("mousedown", he, !1), a.addEventListener("mousemove", ke, !1), a.addEventListener("mouseup", Ue, !1), e.mouseZoom && (ne.addEventListener("mousewheel", Fe, !1), ne.addEventListener("DOMMouseScroll", Fe, !1)), e.doubleClickZoom && G.addEventListener("dblclick", ae, !1), ne.addEventListener("mozfullscreenchange", rt, !1), ne.addEventListener("webkitfullscreenchange", rt, !1), ne.addEventListener("msfullscreenchange", rt, !1), ne.addEventListener("fullscreenchange", rt, !1), r.addEventListener("resize", Ee, !1), r.addEventListener("orientationchange", Ee, !1), e.disableKeyboardCtrl || (p.addEventListener("keydown", Ae, !1), p.addEventListener("keyup", Ve, !1), p.addEventListener("blur", je, !1)), a.addEventListener("mouseleave", Ue, !1), a.documentElement.style.pointerAction === "" && a.documentElement.style.touchAction === "" ? (G.addEventListener("pointerdown", be, !1), G.addEventListener("pointermove", _e, !1), G.addEventListener("pointerup", Ne, !1), G.addEventListener("pointerleave", Ne, !1)) : (G.addEventListener("touchstart", Ge, !1), G.addEventListener("touchmove", Ye, !1), G.addEventListener("touchend", Z, !1)), r.navigator.pointerEnabled && (p.style.touchAction = "none")), Pr(), Je(e.hfov), setTimeout(function() {
2090
- }, 500);
2091
- }
2092
- function oe(t) {
2093
- var n = new FileReader();
2094
- n.addEventListener("loadend", function() {
2095
- var u = n.result;
2096
- if (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)) {
2097
- var R = u.indexOf("ÿÂ");
2098
- (R < 0 || R > 65536) && q(e.strings.iOS8WebGLError);
2099
- }
2100
- var A = u.indexOf("<x:xmpmeta");
2101
- if (A > -1 && e.ignoreGPanoXMP !== !0) {
2102
- var _ = u.substring(A, u.indexOf("</x:xmpmeta>") + 12), se = function(Me) {
2103
- var ye;
2104
- return _.indexOf(Me + '="') >= 0 ? (ye = _.substring(_.indexOf(Me + '="') + Me.length + 2), ye = ye.substring(0, ye.indexOf('"'))) : _.indexOf(Me + ">") >= 0 && (ye = _.substring(_.indexOf(Me + ">") + Me.length + 1), ye = ye.substring(0, ye.indexOf("<"))), ye !== l ? Number(ye) : null;
2105
- }, ee = {
2106
- fullWidth: se("GPano:FullPanoWidthPixels"),
2107
- croppedWidth: se("GPano:CroppedAreaImageWidthPixels"),
2108
- fullHeight: se("GPano:FullPanoHeightPixels"),
2109
- croppedHeight: se("GPano:CroppedAreaImageHeightPixels"),
2110
- topPixels: se("GPano:CroppedAreaTopPixels"),
2111
- heading: se("GPano:PoseHeadingDegrees"),
2112
- horizonPitch: se("GPano:PosePitchDegrees"),
2113
- horizonRoll: se("GPano:PoseRollDegrees")
2114
- };
2115
- ee.fullWidth !== null && ee.croppedWidth !== null && ee.fullHeight !== null && ee.croppedHeight !== null && ee.topPixels !== null && (J.indexOf("haov") < 0 && (e.haov = ee.croppedWidth / ee.fullWidth * 360), J.indexOf("vaov") < 0 && (e.vaov = ee.croppedHeight / ee.fullHeight * 180), J.indexOf("vOffset") < 0 && (e.vOffset = ((ee.topPixels + ee.croppedHeight / 2) / ee.fullHeight - 0.5) * -180), ee.heading !== null && J.indexOf("northOffset") < 0 && (e.northOffset = ee.heading, e.compass !== !1 && (e.compass = !0)), ee.horizonPitch !== null && ee.horizonRoll !== null && (J.indexOf("horizonPitch") < 0 && (e.horizonPitch = ee.horizonPitch), J.indexOf("horizonRoll") < 0 && (e.horizonRoll = ee.horizonRoll)));
2116
- }
2117
- P.src = r.URL.createObjectURL(t);
2118
- }), n.readAsBinaryString !== l ? n.readAsBinaryString(t) : n.readAsText(t);
2119
- }
2120
- function q(t) {
2121
- t === l && (t = e.strings.genericWebGLError), H.errorMsg.innerHTML = "<p>" + t + "</p>", Y.load.style.display = "none", H.load.box.style.display = "none", H.errorMsg.style.display = "table", d = !0, re.style.display = "none", ot("error", t);
2122
- }
2123
- function v() {
2124
- d && (H.load.box.style.display = "none", H.errorMsg.style.display = "none", d = !1, ot("errorcleared"));
2125
- }
2126
- function Q(t) {
2127
- var n = $(t);
2128
- ve.style.left = n.x + "px", ve.style.top = n.y + "px", clearTimeout(Q.t1), clearTimeout(Q.t2), ve.style.display = "block", ve.style.opacity = 1, Q.t1 = setTimeout(function() {
2129
- ve.style.opacity = 0;
2130
- }, 2e3), Q.t2 = setTimeout(function() {
2131
- ve.style.display = "none";
2132
- }, 2500), t.preventDefault();
2133
- }
2134
- function $(t) {
2135
- var n = p.getBoundingClientRect(), u = {};
2136
- return u.x = t.clientX - n.left, u.y = t.clientY - n.top, u;
2137
- }
2138
- function he(t) {
2139
- if (t.preventDefault(), p.focus(), !(!w || !e.draggable)) {
2140
- var n = $(t);
2141
- if (e.hotSpotDebug) {
2142
- var u = Se(t);
2143
- console.log("Pitch: " + u[0] + ", Yaw: " + u[1] + ", Center Pitch: " + e.pitch + ", Center Yaw: " + e.yaw + ", HFOV: " + e.hfov);
2144
- }
2145
- gt(), ht(), e.roll = 0, M.hfov = 0, z = !0, y = Date.now(), h = n.x, o = n.y, D = e.yaw, k = e.pitch, ne.classList.add("pnlm-grabbing"), ne.classList.remove("pnlm-grab"), ot("mousedown", t), we();
2146
- }
2147
- }
2148
- function ae(t) {
2149
- if (e.minHfov === e.hfov)
2150
- E.setHfov(I, 1e3);
2151
- else {
2152
- var n = Se(t);
2153
- E.lookAt(n[0], n[1], e.minHfov, 1e3);
2154
- }
2155
- }
2156
- function Se(t) {
2157
- var n = $(t), u = x.getCanvas(), R = u.clientWidth, A = u.clientHeight, _ = n.x / R * 2 - 1, se = (1 - n.y / A * 2) * A / R, ee = 1 / Math.tan(e.hfov * Math.PI / 360), de = Math.sin(e.pitch * Math.PI / 180), Me = Math.cos(e.pitch * Math.PI / 180), ye = ee * Me - se * de, qe = Math.sqrt(_ * _ + ye * ye), We = Math.atan((se * Me + ee * de) / qe) * 180 / Math.PI, nt = Math.atan2(_ / qe, ye / qe) * 180 / Math.PI + e.yaw;
2158
- return nt < -180 && (nt += 360), nt > 180 && (nt -= 360), [We, nt];
2159
- }
2160
- function ke(t) {
2161
- if (z && w) {
2162
- y = Date.now();
2163
- var n = x.getCanvas(), u = n.clientWidth, R = n.clientHeight, A = $(t), _ = (Math.atan(h / u * 2 - 1) - Math.atan(A.x / u * 2 - 1)) * 180 / Math.PI * e.hfov / 90 + D;
2164
- M.yaw = (_ - e.yaw) % 360 * 0.2, e.yaw = _;
2165
- var se = 2 * Math.atan(Math.tan(e.hfov / 360 * Math.PI) * R / u) * 180 / Math.PI, ee = (Math.atan(A.y / R * 2 - 1) - Math.atan(o / R * 2 - 1)) * 180 / Math.PI * se / 90 + k;
2166
- M.pitch = (ee - e.pitch) * 0.2, e.pitch = ee;
2167
- }
2168
- }
2169
- function Ue(t) {
2170
- z && (z = !1, Date.now() - y > 15 && (M.pitch = M.yaw = 0), ne.classList.add("pnlm-grab"), ne.classList.remove("pnlm-grabbing"), y = Date.now(), ot("mouseup", t));
2171
- }
2172
- function Ge(t) {
2173
- if (!(!w || !e.draggable)) {
2174
- gt(), ht(), e.roll = 0, M.hfov = 0;
2175
- var n = $(t.targetTouches[0]);
2176
- if (h = n.x, o = n.y, t.targetTouches.length == 2) {
2177
- var u = $(t.targetTouches[1]);
2178
- h += (u.x - n.x) * 0.5, o += (u.y - n.y) * 0.5, L = Math.sqrt((n.x - u.x) * (n.x - u.x) + (n.y - u.y) * (n.y - u.y));
2179
- }
2180
- z = !0, y = Date.now(), D = e.yaw, k = e.pitch, ot("touchstart", t), we();
2181
- }
2182
- }
2183
- function Ye(t) {
2184
- if (e.draggable && (t.preventDefault(), w && (y = Date.now()), z && w)) {
2185
- var n = $(t.targetTouches[0]), u = n.x, R = n.y;
2186
- if (t.targetTouches.length == 2 && L != -1) {
2187
- var A = $(t.targetTouches[1]);
2188
- u += (A.x - n.x) * 0.5, R += (A.y - n.y) * 0.5;
2189
- var _ = Math.sqrt((n.x - A.x) * (n.x - A.x) + (n.y - A.y) * (n.y - A.y));
2190
- Je(e.hfov + (L - _) * 0.1), L = _;
2191
- }
2192
- var se = e.hfov / 360 * e.touchPanSpeedCoeffFactor, ee = (h - u) * se + D;
2193
- M.yaw = (ee - e.yaw) % 360 * 0.2, e.yaw = ee;
2194
- var de = (R - o) * se + k;
2195
- M.pitch = (de - e.pitch) * 0.2, e.pitch = de;
2196
- }
2197
- }
2198
- function Z() {
2199
- z = !1, Date.now() - y > 150 && (M.pitch = M.yaw = 0), L = -1, y = Date.now(), ot("touchend", event);
2200
- }
2201
- var ie = [], ge = [];
2202
- function be(t) {
2203
- t.pointerType == "touch" && (ie.push(t.pointerId), ge.push({ clientX: t.clientX, clientY: t.clientY }), t.targetTouches = ge, Ge(t), t.preventDefault());
2204
- }
2205
- function _e(t) {
2206
- if (t.pointerType == "touch") {
2207
- for (var n = 0; n < ie.length; n++)
2208
- if (t.pointerId == ie[n]) {
2209
- ge[n].clientX = t.clientX, ge[n].clientY = t.clientY, t.targetTouches = ge, Ye(t), t.preventDefault();
2210
- return;
2211
- }
2212
- }
2213
- }
2214
- function Ne(t) {
2215
- if (t.pointerType == "touch") {
2216
- for (var n = !1, u = 0; u < ie.length; u++)
2217
- t.pointerId == ie[u] && (ie[u] = l), ie[u] && (n = !0);
2218
- n || (ie = [], ge = [], Z()), t.preventDefault();
2219
- }
2220
- }
2221
- function Fe(t) {
2222
- !w || e.mouseZoom == "fullscreenonly" && !N || (t.preventDefault(), gt(), y = Date.now(), t.wheelDeltaY ? (Je(e.hfov - t.wheelDeltaY * 0.05), M.hfov = t.wheelDelta < 0 ? 1 : -1) : t.wheelDelta ? (Je(e.hfov - t.wheelDelta * 0.05), M.hfov = t.wheelDelta < 0 ? 1 : -1) : t.detail && (Je(e.hfov + t.detail * 1.5), M.hfov = t.detail > 0 ? 1 : -1), we());
2223
- }
2224
- function Ae(t) {
2225
- gt(), y = Date.now(), ht(), e.roll = 0;
2226
- var n = t.which || t.keycode;
2227
- e.capturedKeyNumbers.indexOf(n) < 0 || (t.preventDefault(), n == 27 ? N && It() : Te(n, !0));
2228
- }
2229
- function je() {
2230
- for (var t = 0; t < 10; t++)
2231
- m[t] = !1;
2232
- }
2233
- function Ve(t) {
2234
- var n = t.which || t.keycode;
2235
- e.capturedKeyNumbers.indexOf(n) < 0 || (t.preventDefault(), Te(n, !1));
2236
- }
2237
- function Te(t, n) {
2238
- var u = !1;
2239
- switch (t) {
2240
- case 109:
2241
- case 189:
2242
- case 17:
2243
- case 173:
2244
- m[0] != n && (u = !0), m[0] = n;
2245
- break;
2246
- case 107:
2247
- case 187:
2248
- case 16:
2249
- case 61:
2250
- m[1] != n && (u = !0), m[1] = n;
2251
- break;
2252
- case 38:
2253
- m[2] != n && (u = !0), m[2] = n;
2254
- break;
2255
- case 87:
2256
- m[6] != n && (u = !0), m[6] = n;
2257
- break;
2258
- case 40:
2259
- m[3] != n && (u = !0), m[3] = n;
2260
- break;
2261
- case 83:
2262
- m[7] != n && (u = !0), m[7] = n;
2263
- break;
2264
- case 37:
2265
- m[4] != n && (u = !0), m[4] = n;
2266
- break;
2267
- case 65:
2268
- m[8] != n && (u = !0), m[8] = n;
2269
- break;
2270
- case 39:
2271
- m[5] != n && (u = !0), m[5] = n;
2272
- break;
2273
- case 68:
2274
- m[9] != n && (u = !0), m[9] = n;
2275
- }
2276
- u && n && (typeof performance < "u" && performance.now() ? O = performance.now() : O = Date.now(), we());
2277
- }
2278
- function He() {
2279
- if (w) {
2280
- var t = !1, n = e.pitch, u = e.yaw, R = e.hfov, A;
2281
- typeof performance < "u" && performance.now() ? A = performance.now() : A = Date.now(), O === l && (O = A);
2282
- var _ = (A - O) * e.hfov / 1700;
2283
- if (_ = Math.min(_, 1), m[0] && e.keyboardZoom === !0 && (Je(e.hfov + (M.hfov * 0.8 + 0.5) * _), t = !0), m[1] && e.keyboardZoom === !0 && (Je(e.hfov + (M.hfov * 0.8 - 0.2) * _), t = !0), (m[2] || m[6]) && (e.pitch += (M.pitch * 0.8 + 0.2) * _, t = !0), (m[3] || m[7]) && (e.pitch += (M.pitch * 0.8 - 0.2) * _, t = !0), (m[4] || m[8]) && (e.yaw += (M.yaw * 0.8 - 0.2) * _, t = !0), (m[5] || m[9]) && (e.yaw += (M.yaw * 0.8 + 0.2) * _, t = !0), t && (y = Date.now()), e.autoRotate) {
2284
- if (A - O > 1e-3) {
2285
- var se = (A - O) / 1e3, ee = (M.yaw / se * _ - e.autoRotate * 0.2) * se;
2286
- ee = (-e.autoRotate > 0 ? 1 : -1) * Math.min(Math.abs(e.autoRotate * se), Math.abs(ee)), e.yaw += ee;
2287
- }
2288
- e.autoRotateStopDelay && (e.autoRotateStopDelay -= A - O, e.autoRotateStopDelay <= 0 && (e.autoRotateStopDelay = !1, W = e.autoRotate, e.autoRotate = 0));
2289
- }
2290
- if (T.pitch && (De("pitch"), n = e.pitch), T.yaw && (De("yaw"), u = e.yaw), T.hfov && (De("hfov"), R = e.hfov), _ > 0 && !e.autoRotate) {
2291
- var de = 0.85;
2292
- !m[4] && !m[5] && !m[8] && !m[9] && !T.yaw && (e.yaw += M.yaw * _ * de), !m[2] && !m[3] && !m[6] && !m[7] && !T.pitch && (e.pitch += M.pitch * _ * de), !m[0] && !m[1] && !T.hfov && Je(e.hfov + M.hfov * _ * de);
2293
- }
2294
- if (O = A, _ > 0) {
2295
- M.yaw = M.yaw * 0.8 + (e.yaw - u) / _ * 0.2, M.pitch = M.pitch * 0.8 + (e.pitch - n) / _ * 0.2, M.hfov = M.hfov * 0.8 + (e.hfov - R) / _ * 0.2;
2296
- var Me = e.autoRotate ? Math.abs(e.autoRotate) : 5;
2297
- M.yaw = Math.min(Me, Math.max(M.yaw, -Me)), M.pitch = Math.min(Me, Math.max(M.pitch, -Me)), M.hfov = Math.min(Me, Math.max(M.hfov, -Me));
2298
- }
2299
- m[0] && m[1] && (M.hfov = 0), (m[2] || m[6]) && (m[3] || m[7]) && (M.pitch = 0), (m[4] || m[8]) && (m[5] || m[9]) && (M.yaw = 0);
2300
- }
2301
- }
2302
- function De(t) {
2303
- var n = T[t], u = Math.min(1, Math.max((Date.now() - n.startTime) / 1e3 / (n.duration / 1e3), 0)), R = n.startPosition + e.animationTimingFunction(u) * (n.endPosition - n.startPosition);
2304
- if (n.endPosition > n.startPosition && R >= n.endPosition || n.endPosition < n.startPosition && R <= n.endPosition || n.endPosition === n.startPosition) {
2305
- R = n.endPosition, M[t] = 0;
2306
- var A = T[t].callback, _ = T[t].callbackArgs;
2307
- delete T[t], typeof A == "function" && A(_);
2308
- }
2309
- e[t] = R;
2310
- }
2311
- function U(t) {
2312
- return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
2313
- }
2314
- function Ee() {
2315
- rt();
2316
- }
2317
- function we() {
2318
- X || (X = !0, ue());
2319
- }
2320
- function ue() {
2321
- if (Ce(), te && clearTimeout(te), z || S === !0)
2322
- requestAnimationFrame(ue);
2323
- else if (m[0] || m[1] || m[2] || m[3] || m[4] || m[5] || m[6] || m[7] || m[8] || m[9] || e.autoRotate || T.pitch || T.yaw || T.hfov || Math.abs(M.yaw) > 0.01 || Math.abs(M.pitch) > 0.01 || Math.abs(M.hfov) > 0.01)
2324
- He(), e.autoRotateInactivityDelay >= 0 && W && Date.now() - y > e.autoRotateInactivityDelay && !e.autoRotate && (e.autoRotate = W, E.lookAt(F, l, I, 3e3)), requestAnimationFrame(ue);
2325
- else if (x && (x.isLoading() || e.dynamic === !0 && me))
2326
- requestAnimationFrame(ue);
2327
- else {
2328
- X = !1, O = l;
2329
- var t = e.autoRotateInactivityDelay - (Date.now() - y);
2330
- t > 0 ? te = setTimeout(function() {
2331
- e.autoRotate = W, E.lookAt(F, l, I, 3e3), we();
2332
- }, t) : e.autoRotateInactivityDelay >= 0 && W && (e.autoRotate = W, E.lookAt(F, l, I, 3e3), we());
2333
- }
2334
- }
2335
- function Ce() {
2336
- var t;
2337
- if (w) {
2338
- e.yaw > 180 ? e.yaw -= 360 : e.yaw < -180 && (e.yaw += 360), t = e.yaw;
2339
- var n = 0;
2340
- if (e.avoidShowingBackground) {
2341
- var de = x.getCanvas(), u = e.hfov / 2, R = Math.atan2(Math.tan(u / 180 * Math.PI), de.width / de.height) * 180 / Math.PI, A = e.vaov > e.haov;
2342
- A ? R * (1 - Math.min(Math.cos((e.pitch - u) / 180 * Math.PI), Math.cos((e.pitch + u) / 180 * Math.PI))) : n = u * (1 - Math.min(Math.cos((e.pitch - R) / 180 * Math.PI), Math.cos((e.pitch + R) / 180 * Math.PI)));
2343
- }
2344
- var _ = e.maxYaw - e.minYaw, se = -180, ee = 180;
2345
- _ < 360 && (se = e.minYaw + e.hfov / 2 + n, ee = e.maxYaw - e.hfov / 2 - n, _ < e.hfov && (se = ee = (se + ee) / 2), e.yaw = Math.max(se, Math.min(ee, e.yaw))), e.autoRotate !== !1 && t != e.yaw && O !== l && (e.autoRotate *= -1);
2346
- var de = x.getCanvas(), Me = 2 * Math.atan(Math.tan(e.hfov / 180 * Math.PI * 0.5) / (de.width / de.height)) / Math.PI * 180, ye = e.minPitch + Me / 2, qe = e.maxPitch - Me / 2, We = e.maxPitch - e.minPitch;
2347
- We < Me && (ye = qe = (ye + qe) / 2), isNaN(ye) && (ye = -90), isNaN(qe) && (qe = 90), e.pitch = Math.max(ye, Math.min(qe, e.pitch)), x.render(e.pitch * Math.PI / 180, e.yaw * Math.PI / 180, e.hfov * Math.PI / 180, { roll: e.roll * Math.PI / 180 }), Ot(), e.compass && (Oe.style.transform = "rotate(" + (-e.yaw - e.northOffset) + "deg)", Oe.style.webkitTransform = "rotate(" + (-e.yaw - e.northOffset) + "deg)"), e.onRender && e.onRender();
2348
- }
2349
- }
2350
- function K(t, n, u, R) {
2351
- this.w = t, this.x = n, this.y = u, this.z = R;
2352
- }
2353
- K.prototype.multiply = function(t) {
2354
- return new K(this.w * t.w - this.x * t.x - this.y * t.y - this.z * t.z, this.x * t.w + this.w * t.x + this.y * t.z - this.z * t.y, this.y * t.w + this.w * t.y + this.z * t.x - this.x * t.z, this.z * t.w + this.w * t.z + this.x * t.y - this.y * t.x);
2355
- }, K.prototype.toEulerAngles = function() {
2356
- var t = Math.atan2(2 * (this.w * this.x + this.y * this.z), 1 - 2 * (this.x * this.x + this.y * this.y)), n = Math.asin(2 * (this.w * this.y - this.z * this.x)), u = Math.atan2(2 * (this.w * this.z + this.x * this.y), 1 - 2 * (this.y * this.y + this.z * this.z));
2357
- return [t, n, u];
2358
- };
2359
- function Ir(t, n, u) {
2360
- var R = [n ? n * Math.PI / 180 / 2 : 0, u ? u * Math.PI / 180 / 2 : 0, t ? t * Math.PI / 180 / 2 : 0], A = [Math.cos(R[0]), Math.cos(R[1]), Math.cos(R[2])], _ = [Math.sin(R[0]), Math.sin(R[1]), Math.sin(R[2])];
2361
- return new K(A[0] * A[1] * A[2] - _[0] * _[1] * _[2], _[0] * A[1] * A[2] - A[0] * _[1] * _[2], A[0] * _[1] * A[2] + _[0] * A[1] * _[2], A[0] * A[1] * _[2] + _[0] * _[1] * A[2]);
2362
- }
2363
- function Tr(t, n, u) {
2364
- var R = Ir(t, n, u);
2365
- R = R.multiply(new K(Math.sqrt(0.5), -Math.sqrt(0.5), 0, 0));
2366
- var A = r.orientation ? -r.orientation * Math.PI / 180 / 2 : 0;
2367
- return R.multiply(new K(Math.cos(A), 0, -Math.sin(A), 0));
2368
- }
2369
- function Dt(t) {
2370
- var n = Tr(t.alpha, t.beta, t.gamma).toEulerAngles();
2371
- typeof S == "number" && S < 10 ? S += 1 : S === 10 ? (V = n[2] / Math.PI * 180 + e.yaw, S = !0, requestAnimationFrame(ue)) : (e.pitch = n[0] / Math.PI * 180, e.roll = -n[1] / Math.PI * 180, e.yaw = -n[2] / Math.PI * 180 + V);
2372
- }
2373
- function Pr() {
2374
- try {
2375
- var t = {};
2376
- e.horizonPitch !== l && (t.horizonPitch = e.horizonPitch * Math.PI / 180), e.horizonRoll !== l && (t.horizonRoll = e.horizonRoll * Math.PI / 180), e.backgroundColor !== l && (t.backgroundColor = e.backgroundColor), x.init(P, e.type, e.dynamic, e.haov * Math.PI / 180, e.vaov * Math.PI / 180, e.vOffset * Math.PI / 180, Rr, t), e.dynamic !== !0 && (P = l);
2377
- } catch (n) {
2378
- if (n.type == "webgl error" || n.type == "no webgl")
2379
- q();
2380
- else if (n.type == "webgl size error")
2381
- q(e.strings.textureSizeError.replace("%s", n.width).replace("%s", n.maxWidth));
2382
- else
2383
- throw q(e.strings.unknownError), n;
2384
- }
2385
- }
2386
- function Rr() {
2387
- if (e.sceneFadeDuration && x.fadeImg !== l) {
2388
- x.fadeImg.style.opacity = 0;
2389
- var t = x.fadeImg;
2390
- delete x.fadeImg, setTimeout(function() {
2391
- re.removeChild(t), ot("scenechangefadedone");
2392
- }, e.sceneFadeDuration);
2393
- }
2394
- e.compass ? Oe.style.display = "inline" : Oe.style.display = "none", Sr(), H.load.box.style.display = "none", b !== l && (re.removeChild(b), b = l), w = !0, ot("load"), we();
2395
- }
2396
- function At(t) {
2397
- t.pitch = Number(t.pitch) || 0, t.yaw = Number(t.yaw) || 0;
2398
- var n = a.createElement("div");
2399
- n.className = "pnlm-hotspot-base", t.cssClass ? n.className += " " + t.cssClass : n.className += " pnlm-hotspot pnlm-sprite pnlm-" + st(t.type);
2400
- var u = a.createElement("span");
2401
- t.text && (u.innerHTML = st(t.text));
2402
- var R;
2403
- if (t.video) {
2404
- var A = a.createElement("video"), _ = t.video;
2405
- e.basePath && !g(_) && (_ = e.basePath + _), A.src = lt(_), A.controls = !0, A.style.width = t.width + "px", re.appendChild(n), u.appendChild(A);
2406
- } else if (t.image) {
2407
- var _ = t.image;
2408
- e.basePath && !g(_) && (_ = e.basePath + _), R = a.createElement("a"), R.href = lt(t.URL ? t.URL : _), R.target = "_blank", u.appendChild(R);
2409
- var se = a.createElement("img");
2410
- se.src = lt(_), se.style.width = t.width + "px", se.style.paddingTop = "5px", re.appendChild(n), R.appendChild(se), u.style.maxWidth = "initial";
2411
- } else t.URL ? (R = a.createElement("a"), R.href = lt(t.URL), R.target = "_blank", re.appendChild(R), n.className += " pnlm-pointer", u.className += " pnlm-pointer", R.appendChild(n)) : (t.sceneId && (n.onclick = n.ontouchend = function() {
2412
- return n.clicked || (n.clicked = !0, Tt(t.sceneId, t.targetPitch, t.targetYaw, t.targetHfov)), !1;
2413
- }, n.className += " pnlm-pointer", u.className += " pnlm-pointer"), re.appendChild(n));
2414
- t.createTooltipFunc ? t.createTooltipFunc(n, t.createTooltipArgs) : (t.text || t.video || t.image) && (n.classList.add("pnlm-tooltip"), n.appendChild(u), u.style.width = u.scrollWidth - 20 + "px", u.style.marginLeft = -(u.scrollWidth - n.offsetWidth) / 2 + "px", u.style.marginTop = -u.scrollHeight - 12 + "px"), t.clickHandlerFunc && (n.addEventListener("click", function(ee) {
2415
- t.clickHandlerFunc(ee, t.clickHandlerArgs);
2416
- }, "false"), n.className += " pnlm-pointer", u.className += " pnlm-pointer"), t.div = n;
2417
- }
2418
- function Sr() {
2419
- xe || (e.hotSpots ? (e.hotSpots = e.hotSpots.sort(function(t, n) {
2420
- return t.pitch < n.pitch;
2421
- }), e.hotSpots.forEach(At)) : e.hotSpots = [], xe = !0, Ot());
2422
- }
2423
- function _r() {
2424
- var t = e.hotSpots;
2425
- if (xe = !1, delete e.hotSpots, t)
2426
- for (var n = 0; n < t.length; n++) {
2427
- for (var u = t[n].div; u.parentNode != re; )
2428
- u = u.parentNode;
2429
- re.removeChild(u), delete t[n].div;
2430
- }
2431
- }
2432
- function Ht(t) {
2433
- var n = Math.sin(t.pitch * Math.PI / 180), u = Math.cos(t.pitch * Math.PI / 180), R = Math.sin(e.pitch * Math.PI / 180), A = Math.cos(e.pitch * Math.PI / 180), _ = Math.cos((-t.yaw + e.yaw) * Math.PI / 180), se = n * R + u * _ * A;
2434
- if (t.yaw <= 90 && t.yaw > -90 && se <= 0 || (t.yaw > 90 || t.yaw <= -90) && se <= 0)
2435
- t.div.style.visibility = "hidden";
2436
- else {
2437
- var ee = Math.sin((-t.yaw + e.yaw) * Math.PI / 180), de = Math.tan(e.hfov * Math.PI / 360);
2438
- t.div.style.visibility = "visible";
2439
- var Me = x.getCanvas(), ye = Me.clientWidth, qe = Me.clientHeight, We = [-ye / de * ee * u / se / 2, -ye / de * (n * A - u * _ * R) / se / 2], nt = Math.sin(e.roll * Math.PI / 180), Vt = Math.cos(e.roll * Math.PI / 180);
2440
- We = [We[0] * Vt - We[1] * nt, We[0] * nt + We[1] * Vt], We[0] += (ye - t.div.offsetWidth) / 2, We[1] += (qe - t.div.offsetHeight) / 2;
2441
- var Pt = "translate(" + We[0] + "px, " + We[1] + "px) translateZ(9999px) rotate(" + e.roll + "deg)";
2442
- t.div.style.webkitTransform = Pt, t.div.style.MozTransform = Pt, t.div.style.transform = Pt;
2443
- }
2444
- }
2445
- function Ot() {
2446
- e.hotSpots.forEach(Ht);
2447
- }
2448
- function mt(t) {
2449
- e = {};
2450
- var n, u, R = ["haov", "vaov", "vOffset", "northOffset", "horizonPitch", "horizonRoll"];
2451
- J = [];
2452
- for (n in Pe)
2453
- Pe.hasOwnProperty(n) && (e[n] = Pe[n]);
2454
- for (n in f.default)
2455
- if (f.default.hasOwnProperty(n))
2456
- if (n == "strings")
2457
- for (u in f.default.strings)
2458
- f.default.strings.hasOwnProperty(u) && (e.strings[u] = st(f.default.strings[u]));
2459
- else
2460
- e[n] = f.default[n], R.indexOf(n) >= 0 && J.push(n);
2461
- if (t !== null && t !== "" && f.scenes && f.scenes[t]) {
2462
- var A = f.scenes[t];
2463
- for (n in A)
2464
- if (A.hasOwnProperty(n))
2465
- if (n == "strings")
2466
- for (u in A.strings)
2467
- A.strings.hasOwnProperty(u) && (e.strings[u] = st(A.strings[u]));
2468
- else
2469
- e[n] = A[n], R.indexOf(n) >= 0 && J.push(n);
2470
- e.scene = t;
2471
- }
2472
- for (n in f)
2473
- if (f.hasOwnProperty(n))
2474
- if (n == "strings")
2475
- for (u in f.strings)
2476
- f.strings.hasOwnProperty(u) && (e.strings[u] = st(f.strings[u]));
2477
- else
2478
- e[n] = f[n], R.indexOf(n) >= 0 && J.push(n);
2479
- }
2480
- function kt(t) {
2481
- if (t = t || !1, t && "preview" in e) {
2482
- var n = e.preview;
2483
- e.basePath && !g(n) && (n = e.basePath + n), b = a.createElement("div"), b.className = "pnlm-preview-img", b.style.backgroundImage = "url('" + Dr(n) + "')", re.appendChild(b);
2484
- }
2485
- var u = e.title, R = e.author;
2486
- t && ("previewTitle" in e && (e.title = e.previewTitle), "previewAuthor" in e && (e.author = e.previewAuthor)), e.hasOwnProperty("title") || (H.title.innerHTML = ""), e.hasOwnProperty("author") || (H.author.innerHTML = ""), !e.hasOwnProperty("title") && !e.hasOwnProperty("author") && (H.container.style.display = "none"), Y.load.innerHTML = "<p>" + e.strings.loadButtonLabel + "</p>", H.load.boxp.innerHTML = e.strings.loadingLabel;
2487
- for (var A in e)
2488
- if (e.hasOwnProperty(A))
2489
- switch (A) {
2490
- case "title":
2491
- H.title.innerHTML = st(e[A]), H.container.style.display = "inline";
2492
- break;
2493
- case "author":
2494
- H.author.innerHTML = e.strings.bylineLabel.replace("%s", st(e[A])), H.container.style.display = "inline";
2495
- break;
2496
- case "fallback":
2497
- var _ = a.createElement("a");
2498
- _.href = lt(e[A]), _.target = "_blank", _.textContent = "Click here to view this panorama in an alternative viewer.";
2499
- var se = a.createElement("p");
2500
- se.textContent = "Your browser does not support WebGL.", se.appendChild(a.createElement("br")), se.appendChild(_), H.errorMsg.innerHTML = "", H.errorMsg.appendChild(se);
2501
- break;
2502
- case "hfov":
2503
- Je(Number(e[A]));
2504
- break;
2505
- case "autoLoad":
2506
- e[A] === !0 && x === l && (H.load.box.style.display = "inline", Y.load.style.display = "none", c());
2507
- break;
2508
- case "showZoomCtrl":
2509
- e[A] && e.showControls != !1 ? Y.zoom.style.display = "block" : Y.zoom.style.display = "none";
2510
- break;
2511
- case "showFullscreenCtrl":
2512
- e[A] && e.showControls != !1 && ("fullscreen" in a || "mozFullScreen" in a || "webkitIsFullScreen" in a || "msFullscreenElement" in a) ? Y.fullscreen.style.display = "block" : Y.fullscreen.style.display = "none";
2513
- break;
2514
- case "hotSpotDebug":
2515
- e[A] ? ze.style.display = "block" : ze.style.display = "none";
2516
- break;
2517
- case "showControls":
2518
- e[A] || (Y.orientation.style.display = "none", Y.zoom.style.display = "none", Y.fullscreen.style.display = "none");
2519
- break;
2520
- case "orientationOnByDefault":
2521
- e[A] && (Re === l ? Be = !0 : Re === !0 && vt());
2522
- break;
2523
- }
2524
- t && (u ? e.title = u : delete e.title, R ? e.author = R : delete e.author);
2525
- }
2526
- function It() {
2527
- if (w && !d)
2528
- if (N)
2529
- a.exitFullscreen ? a.exitFullscreen() : a.mozCancelFullScreen ? a.mozCancelFullScreen() : a.webkitCancelFullScreen ? a.webkitCancelFullScreen() : a.msExitFullscreen && a.msExitFullscreen();
2530
- else
2531
- try {
2532
- p.requestFullscreen ? p.requestFullscreen() : p.mozRequestFullScreen ? p.mozRequestFullScreen() : p.msRequestFullscreen ? p.msRequestFullscreen() : p.webkitRequestFullScreen();
2533
- } catch {
2534
- }
2535
- }
2536
- function rt() {
2537
- var t = r.innerWidth == screen.width && r.innerHeight == screen.height;
2538
- a.fullscreen || a.mozFullScreen || a.webkitIsFullScreen || a.msFullscreenElement || t ? (Y.fullscreen.classList.add("pnlm-fullscreen-toggle-button-active"), N = !0) : (Y.fullscreen.classList.remove("pnlm-fullscreen-toggle-button-active"), N = !1), x.resize(), Je(e.hfov), we();
2539
- }
2540
- function Nr() {
2541
- w && (Je(e.hfov - 5), we());
2542
- }
2543
- function zr() {
2544
- w && (Je(e.hfov + 5), we());
2545
- }
2546
- function Ft(t) {
2547
- var n = e.minHfov;
2548
- if (e.type == "multires" && x && (n = Math.min(n, x.getCanvas().width / (e.multiRes.cubeResolution / 90 * 0.9))), n > e.maxHfov)
2549
- return console.log("HFOV bounds do not make sense (minHfov > maxHfov)."), e.hfov;
2550
- var u = e.hfov;
2551
- if (t < n ? u = n : t > e.maxHfov ? u = e.maxHfov : u = t, e.avoidShowingBackground && x) {
2552
- var R = x.getCanvas();
2553
- u = Math.min(u, Math.atan(Math.tan((e.maxPitch - e.minPitch) / 360 * Math.PI) / R.height * R.width) * 360 / Math.PI);
2554
- }
2555
- return u;
2556
- }
2557
- function Je(t) {
2558
- e.hfov = Ft(t);
2559
- }
2560
- function gt() {
2561
- T = {}, W = e.autoRotate ? e.autoRotate : W, e.autoRotate = !1;
2562
- }
2563
- function Ut() {
2564
- v(), w = !1, Y.load.style.display = "none", H.load.box.style.display = "inline", c();
2565
- }
2566
- function Tt(t, n, u, R, A) {
2567
- w = !1, T = {};
2568
- var _, se, ee, de;
2569
- if (e.sceneFadeDuration && !A) {
2570
- var Me = x.render(e.pitch * Math.PI / 180, e.yaw * Math.PI / 180, e.hfov * Math.PI / 180, { returnImage: !0 });
2571
- if (Me !== l) {
2572
- _ = new Image(), _.className = "pnlm-fade-img", _.style.transition = "opacity " + e.sceneFadeDuration / 1e3 + "s", _.style.width = "100%", _.style.height = "100%", _.onload = function() {
2573
- Tt(t, n, u, R, !0);
2574
- }, _.src = Me, re.appendChild(_), x.fadeImg = _;
2575
- return;
2576
- }
2577
- }
2578
- n === "same" ? se = e.pitch : se = n, u === "same" ? ee = e.yaw : u === "sameAzimuth" ? ee = e.yaw + (e.northOffset || 0) - (f.scenes[t].northOffset || 0) : ee = u, R === "same" ? de = e.hfov : de = R, _r(), mt(t), M.yaw = M.pitch = M.hfov = 0, kt(), se !== l && (e.pitch = se), ee !== l && (e.yaw = ee), de !== l && (e.hfov = de), ot("scenechange", t), Ut();
2579
- }
2580
- function ht() {
2581
- r.removeEventListener("deviceorientation", Dt), Y.orientation.classList.remove("pnlm-orientation-button-active"), S = !1;
2582
- }
2583
- function vt() {
2584
- S = 1, r.addEventListener("deviceorientation", Dt), Y.orientation.classList.add("pnlm-orientation-button-active");
2585
- }
2586
- function st(t) {
2587
- return f.escapeHTML ? String(t).split(/&/g).join("&amp;").split('"').join("&quot;").split("'").join("&#39;").split("<").join("&lt;").split(">").join("&gt;").split("/").join("&#x2f;").split(`
2588
- `).join("<br>") : String(t).split(`
2589
- `).join("<br>");
2590
- }
2591
- function lt(t) {
2592
- return t.trim().toLowerCase().indexOf("javascript:") === 0 ? "about:blank" : t;
2593
- }
2594
- function Dr(t) {
2595
- return lt(t).replace(/"/g, "%22").replace(/'/g, "%27");
2596
- }
2597
- this.isLoaded = function() {
2598
- return !!w;
2599
- }, this.getPitch = function() {
2600
- return e.pitch;
2601
- }, this.setPitch = function(t, n, u, R) {
2602
- return n = n == l ? 1e3 : Number(n), n ? T.pitch = {
2603
- startTime: Date.now(),
2604
- startPosition: e.pitch,
2605
- endPosition: t,
2606
- duration: n,
2607
- callback: u,
2608
- callbackArgs: R
2609
- } : e.pitch = t, we(), this;
2610
- }, this.getPitchBounds = function() {
2611
- return [e.minPitch, e.maxPitch];
2612
- }, this.setPitchBounds = function(t) {
2613
- return e.minPitch = Math.max(-90, Math.min(t[0], 90)), e.maxPitch = Math.max(-90, Math.min(t[1], 90)), this;
2614
- }, this.getYaw = function() {
2615
- return e.yaw;
2616
- }, this.setYaw = function(t, n, u, R) {
2617
- return n = n == l ? 1e3 : Number(n), t = (t + 180) % 360 - 180, n ? (e.yaw - t > 180 ? t += 360 : t - e.yaw > 180 && (t -= 360), T.yaw = {
2618
- startTime: Date.now(),
2619
- startPosition: e.yaw,
2620
- endPosition: t,
2621
- duration: n,
2622
- callback: u,
2623
- callbackArgs: R
2624
- }) : e.yaw = t, we(), this;
2625
- }, this.getYawBounds = function() {
2626
- return [e.minYaw, e.maxYaw];
2627
- }, this.setYawBounds = function(t) {
2628
- return e.minYaw = Math.max(-180, Math.min(t[0], 180)), e.maxYaw = Math.max(-180, Math.min(t[1], 180)), this;
2629
- }, this.getHfov = function() {
2630
- return e.hfov;
2631
- }, this.setHfov = function(t, n, u, R) {
2632
- return n = n == l ? 1e3 : Number(n), n ? T.hfov = {
2633
- startTime: Date.now(),
2634
- startPosition: e.hfov,
2635
- endPosition: Ft(t),
2636
- duration: n,
2637
- callback: u,
2638
- callbackArgs: R
2639
- } : Je(t), we(), this;
2640
- }, this.getHfovBounds = function() {
2641
- return [e.minHfov, e.maxHfov];
2642
- }, this.setHfovBounds = function(t) {
2643
- return e.minHfov = Math.max(0, t[0]), e.maxHfov = Math.max(0, t[1]), this;
2644
- }, this.lookAt = function(t, n, u, R, A, _) {
2645
- return R = R == l ? 1e3 : Number(R), t !== l && (this.setPitch(t, R, A, _), A = l), n !== l && (this.setYaw(n, R, A, _), A = l), u !== l && this.setHfov(u, R, A, _), this;
2646
- }, this.getNorthOffset = function() {
2647
- return e.northOffset;
2648
- }, this.setNorthOffset = function(t) {
2649
- return e.northOffset = Math.min(360, Math.max(0, t)), we(), this;
2650
- }, this.getHorizonRoll = function() {
2651
- return e.horizonRoll;
2652
- }, this.setHorizonRoll = function(t) {
2653
- return e.horizonRoll = Math.min(90, Math.max(-90, t)), x.setPose(e.horizonPitch * Math.PI / 180, e.horizonRoll * Math.PI / 180), we(), this;
2654
- }, this.getHorizonPitch = function() {
2655
- return e.horizonPitch;
2656
- }, this.setHorizonPitch = function(t) {
2657
- return e.horizonPitch = Math.min(90, Math.max(-90, t)), x.setPose(e.horizonPitch * Math.PI / 180, e.horizonRoll * Math.PI / 180), we(), this;
2658
- }, this.startAutoRotate = function(t) {
2659
- return t = t || W || 1, e.autoRotate = t, E.lookAt(F, l, I, 3e3), we(), this;
2660
- }, this.stopAutoRotate = function() {
2661
- return W = e.autoRotate ? e.autoRotate : W, e.autoRotate = !1, e.autoRotateInactivityDelay = -1, this;
2662
- }, this.getRenderer = function() {
2663
- return x;
2664
- }, this.setUpdate = function(t) {
2665
- return me = t === !0, x === l ? le() : we(), this;
2666
- }, this.mouseEventToCoords = function(t) {
2667
- return Se(t);
2668
- }, this.loadScene = function(t, n, u, R) {
2669
- return w !== !1 && Tt(t, n, u, R), this;
2670
- }, this.getScene = function() {
2671
- return e.scene;
2672
- }, this.addScene = function(t, n) {
2673
- return f.scenes[t] = n, this;
2674
- }, this.removeScene = function(t) {
2675
- return e.scene === t || !f.scenes.hasOwnProperty(t) ? !1 : (delete f.scenes[t], !0);
2676
- }, this.toggleFullscreen = function() {
2677
- return It(), this;
2678
- }, this.getConfig = function() {
2679
- return e;
2680
- }, this.getContainer = function() {
2681
- return p;
2682
- }, this.addHotSpot = function(t, n) {
2683
- if (n === l && e.scene === l)
2684
- e.hotSpots.push(t);
2685
- else {
2686
- var u = n !== l ? n : e.scene;
2687
- if (f.scenes.hasOwnProperty(u))
2688
- f.scenes[u].hasOwnProperty("hotSpots") || (f.scenes[u].hotSpots = [], u == e.scene && (e.hotSpots = f.scenes[u].hotSpots)), f.scenes[u].hotSpots.push(t);
2689
- else
2690
- throw "Invalid scene ID!";
2691
- }
2692
- return (n === l || e.scene == n) && (At(t), w && Ht(t)), this;
2693
- }, this.removeHotSpot = function(t, n) {
2694
- if (n === l || e.scene == n) {
2695
- if (!e.hotSpots)
2696
- return !1;
2697
- for (var u = 0; u < e.hotSpots.length; u++)
2698
- if (e.hotSpots[u].hasOwnProperty("id") && e.hotSpots[u].id === t) {
2699
- for (var R = e.hotSpots[u].div; R.parentNode != re; )
2700
- R = R.parentNode;
2701
- return re.removeChild(R), delete e.hotSpots[u].div, e.hotSpots.splice(u, 1), !0;
2702
- }
2703
- } else if (f.scenes.hasOwnProperty(n)) {
2704
- if (!f.scenes[n].hasOwnProperty("hotSpots"))
2705
- return !1;
2706
- for (var u = 0; u < f.scenes[n].hotSpots.length; u++)
2707
- if (f.scenes[n].hotSpots[u].hasOwnProperty("id") && f.scenes[n].hotSpots[u].id === t)
2708
- return f.scenes[n].hotSpots.splice(u, 1), !0;
2709
- } else
2710
- return !1;
2711
- }, this.resize = function() {
2712
- x && Ee();
2713
- }, this.isLoaded = function() {
2714
- return w;
2715
- }, this.isOrientationSupported = function() {
2716
- return Re || !1;
2717
- }, this.stopOrientation = function() {
2718
- ht();
2719
- }, this.startOrientation = function() {
2720
- Re && vt();
2721
- }, this.isOrientationActive = function() {
2722
- return !!S;
2723
- }, this.on = function(t, n) {
2724
- return B[t] = B[t] || [], B[t].push(n), this;
2725
- }, this.off = function(t, n) {
2726
- if (!t)
2727
- return B = {}, this;
2728
- if (n) {
2729
- var u = B[t].indexOf(n);
2730
- u >= 0 && B[t].splice(u, 1), B[t].length == 0 && delete B[t];
2731
- } else
2732
- delete B[t];
2733
- return this;
2734
- };
2735
- function ot(t) {
2736
- if (t in B)
2737
- for (var n = B[t].length; n > 0; n--)
2738
- B[t][B[t].length - n].apply(null, [].slice.call(arguments, 1));
2739
- }
2740
- this.destroy = function() {
2741
- x && x.destroy(), C && (G.removeEventListener("mousedown", he, !1), G.removeEventListener("dblclick", ae, !1), a.removeEventListener("mousemove", ke, !1), a.removeEventListener("mouseup", Ue, !1), p.removeEventListener("mousewheel", Fe, !1), p.removeEventListener("DOMMouseScroll", Fe, !1), p.removeEventListener("mozfullscreenchange", rt, !1), p.removeEventListener("webkitfullscreenchange", rt, !1), p.removeEventListener("msfullscreenchange", rt, !1), p.removeEventListener("fullscreenchange", rt, !1), r.removeEventListener("resize", Ee, !1), r.removeEventListener("orientationchange", Ee, !1), p.removeEventListener("keydown", Ae, !1), p.removeEventListener("keyup", Ve, !1), p.removeEventListener("blur", je, !1), a.removeEventListener("mouseleave", Ue, !1), G.removeEventListener("touchstart", Ge, !1), G.removeEventListener("touchmove", Ye, !1), G.removeEventListener("touchend", Z, !1), G.removeEventListener("pointerdown", be, !1), G.removeEventListener("pointermove", _e, !1), G.removeEventListener("pointerup", Ne, !1), G.removeEventListener("pointerleave", Ne, !1)), p.innerHTML = "", p.classList.remove("pnlm-container"), ne.classList.remove("pnlm-grab"), ne.classList.remove("pnlm-grabbing");
2742
- };
2743
- }
2744
- return {
2745
- viewer: function(f, E) {
2746
- return new s(f, E);
2747
- }
2748
- };
2749
- }(window, document);
2750
- window.requestAnimationFrame || (window.requestAnimationFrame = function() {
2751
- return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(r, a) {
2752
- window.setTimeout(r, 1e3 / 60);
2753
- };
2754
- }());
2755
- var Zt, Gt;
2756
- function Lo(r, a) {
2757
- if (!(r instanceof a))
2758
- throw new TypeError("Cannot call a class as a function");
2759
- }
2760
- function ko(r, a) {
2761
- if (!r)
2762
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2763
- return a && (typeof a == "object" || typeof a == "function") ? a : r;
2764
- }
2765
- function Io(r, a) {
2766
- if (typeof a != "function" && a !== null)
2767
- throw new TypeError("Super expression must either be null or a function, not " + typeof a);
2768
- r.prototype = Object.create(a && a.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), a && (Object.setPrototypeOf ? Object.setPrototypeOf(r, a) : r.__proto__ = a);
2769
- }
2770
- var Lt = (Gt = Zt = function(r) {
2771
- Io(a, r);
2772
- function a(l) {
2773
- Lo(this, a);
2774
- var s = ko(this, r.call(this, l));
2775
- return s.renderImage = function(p) {
2776
- var f = s.props.children, E = [].concat(f), e = [];
2777
- Array.isArray(E) && E.map(function(b) {
2778
- switch (b.props.type) {
2779
- case "info":
2780
- return e.push({
2781
- id: Math.random().toString(36).substr(2, 9),
2782
- type: b.props.type,
2783
- pitch: b.props.pitch ? b.props.pitch : 10,
2784
- yaw: b.props.yaw ? b.props.yaw : 10,
2785
- text: b.props.text ? b.props.text : "",
2786
- URL: b.props.URL ? b.props.URL : ""
2787
- });
2788
- case "custom":
2789
- return e.push({
2790
- id: Math.random().toString(36).substr(2, 9),
2791
- pitch: b.props.pitch ? b.props.pitch : 10,
2792
- yaw: b.props.yaw ? b.props.yaw : 10,
2793
- cssClass: b.props.cssClass ? b.props.cssClass : "tooltipcss",
2794
- createTooltipFunc: b.props.tooltip ? b.props.tooltip : s.hotspotTooltip,
2795
- createTooltipArgs: b.props.tooltipArg ? b.props.tooltipArg : {},
2796
- clickHandlerFunc: b.props.handleClick ? b.props.handleClick : s.handleClickHotspot,
2797
- clickHandlerArgs: b.props.handleClickArg ? b.props.handleClickArg : { name: "test" }
2798
- });
2799
- default:
2800
- return [];
2801
- }
2802
- });
2803
- var x = {
2804
- type: "equirectangular",
2805
- panorama: s.props.image,
2806
- haov: s.props.haov,
2807
- vaov: s.props.vaov,
2808
- vOffset: s.props.vOffset,
2809
- yaw: s.props.yaw,
2810
- pitch: s.props.pitch,
2811
- hfov: s.props.hfov,
2812
- minHfov: s.props.minHfov,
2813
- maxHfov: s.props.maxHfov,
2814
- minPitch: s.props.minPitch,
2815
- maxPitch: s.props.maxPitch,
2816
- minYaw: s.props.minYaw,
2817
- maxYaw: s.props.maxYaw,
2818
- autoRotate: s.props.autoRotate,
2819
- compass: s.props.compass,
2820
- preview: s.props.preview,
2821
- previewTitle: s.props.previewTitle,
2822
- previewAuthor: s.props.previewAuthor,
2823
- author: s.props.author,
2824
- title: s.props.title,
2825
- autoLoad: s.props.autoLoad,
2826
- orientationOnByDefault: s.props.orientationOnByDefault,
2827
- showZoomCtrl: s.props.showZoomCtrl,
2828
- keyboardZoom: s.props.keyboardZoom,
2829
- mouseZoom: s.props.mouseZoom,
2830
- draggable: s.props.draggable,
2831
- disableKeyboardCtrl: s.props.disableKeyboardCtrl,
2832
- showFullscreenCtrl: s.props.showFullscreenCtrl,
2833
- showControls: s.props.showControls,
2834
- hotSpotDebug: s.props.hotspotDebug,
2835
- hotSpots: e,
2836
- onRender: s.props.onRender
2837
- };
2838
- Object.keys(x).forEach(function(b) {
2839
- return x[b] === "" && delete x[b];
2840
- }), p === "update" && s.panorama.destroy(), s.panorama = pannellum.viewer(s.props.id ? s.props.id : s.state.id, x), s.panorama.on("load", s.props.onLoad), s.panorama.on("scenechange", s.props.onScenechange), s.panorama.on("scenechangefadedone", s.props.onScenechangefadedone), s.panorama.on("error", s.props.onError), s.panorama.on("errorcleared", s.props.onErrorcleared), s.panorama.on("mousedown", s.props.onMousedown), s.panorama.on("mouseup", s.props.onMouseup), s.panorama.on("touchstart", s.props.onTouchstart), s.panorama.on("touchend", s.props.onTouchend);
2841
- }, s.componentDidMount = function() {
2842
- s.renderImage("mount");
2843
- }, s.handleClickHotspot = function(p, f) {
2844
- console.log("hotspot clicked", f.name);
2845
- }, s.hotspotTooltip = function(p, f) {
2846
- p.setAttribute("id", "textInfo");
2847
- var E = document.createElement("div");
2848
- E.classList.add("hotspot");
2849
- var e = document.createElement("div");
2850
- e.classList.add("out");
2851
- var x = document.createElement("div");
2852
- x.classList.add("in");
2853
- var b = document.createElement("div");
2854
- b.classList.add("image"), p.appendChild(E), E.appendChild(x), E.appendChild(e);
2855
- }, s.getViewer = function() {
2856
- return s.panorama;
2857
- }, s.forceRender = function() {
2858
- s.renderImage("update");
2859
- }, s.state = {
2860
- id: Math.random().toString(36).substr(2, 9)
2861
- }, s;
2862
- }
2863
- return a.prototype.componentDidUpdate = function(s, p, f) {
2864
- (s.image !== this.props.image || s.width !== this.props.width || s.height !== this.props.height || s.compass !== this.props.compass || s.title !== this.props.title || s.author !== this.props.author || s.preview !== this.props.preview || s.previewTitle !== this.props.previewTitle || s.previewAuthor !== this.props.previewAuthor || s.showZoomCtrl !== this.props.showZoomCtrl || s.showFullscreenCtrl !== this.props.showFullscreenCtrl || s.showControls !== this.props.showControls || s.children.length !== this.props.children.length) && this.renderImage("update"), (s.maxYaw !== this.props.maxYaw || s.minYaw !== this.props.minYaw || s.maxPitch !== this.props.maxPitch || s.minPitch !== this.props.minPitch || s.maxHfov !== this.props.maxHfov || s.minHfov !== this.props.minHfov) && (this.panorama.setYawBounds([this.props.minYaw, this.props.maxYaw]), this.panorama.setPitchBounds([this.props.minPitch, this.props.maxPitch]), this.panorama.setHfovBounds([this.props.minHfov, this.props.maxHfov])), s.yaw !== this.props.yaw && this.panorama.setYaw(this.props.yaw), s.pitch !== this.props.pitch && this.panorama.setPitch(this.props.pitch), s.hfov !== this.props.hfov && this.panorama.setHfov(this.props.hfov);
2865
- }, a.prototype.render = function() {
2866
- var s = this, p = this.props, f = p.width, E = p.height, e = {
2867
- width: f,
2868
- height: E
2869
- };
2870
- return Ar.createElement("div", {
2871
- id: this.props.id ? this.props.id : this.state.id,
2872
- style: e,
2873
- ref: function(b) {
2874
- return s.imageNode = b;
2875
- }
2876
- });
2877
- }, a;
2878
- }(Or), Zt.defaultProps = {
2879
- children: [],
2880
- width: "100%",
2881
- height: "400px",
2882
- image: "",
2883
- haov: 360,
2884
- vaov: 180,
2885
- vOffset: 0,
2886
- yaw: 0,
2887
- pitch: 0,
2888
- hfov: 100,
2889
- minHfov: 50,
2890
- maxHfov: 150,
2891
- minPitch: -90,
2892
- maxPitch: 90,
2893
- minYaw: -180,
2894
- maxYaw: 180,
2895
- autoRotate: 0,
2896
- compass: !1,
2897
- preview: "",
2898
- previewTitle: "",
2899
- previewAuthor: "",
2900
- title: "",
2901
- author: "",
2902
- autoLoad: !1,
2903
- orientationOnByDefault: !1,
2904
- showZoomCtrl: !0,
2905
- keyboardZoom: !0,
2906
- mouseZoom: !0,
2907
- draggable: !0,
2908
- disableKeyboardCtrl: !1,
2909
- showFullscreenCtrl: !0,
2910
- showControls: !0,
2911
- onLoad: function() {
2912
- },
2913
- onScenechange: function() {
2914
- },
2915
- onScenechangefadedone: function() {
2916
- },
2917
- onError: function() {
2918
- },
2919
- onErrorcleared: function() {
2920
- },
2921
- onMousedown: function() {
2922
- },
2923
- onMouseup: function() {
2924
- },
2925
- onTouchstart: function() {
2926
- },
2927
- onTouchend: function() {
2928
- },
2929
- hotspotDebug: !1,
2930
- onRender: null
2931
- }, Gt);
2932
- Lt.propTypes = {};
2933
- Lt.Hotspot = function() {
2934
- };
2935
- Lt.Hotspot = function() {
2936
- };
2937
- const jt = 100, xt = 100, bt = 50, To = 0, Po = 0, Ro = (r) => {
2938
- const [a, l] = Le(0), [s, p] = Le(!1);
2939
- return fe(() => {
2940
- const f = XMLHttpRequest.prototype.open, E = XMLHttpRequest.prototype.send;
2941
- let e = !1;
2942
- return XMLHttpRequest.prototype.open = function(x, b, z = !0, y, h) {
2943
- return b.toString().includes(r) && (e = !0, p(!0)), f.call(
2944
- this,
2945
- x,
2946
- b,
2947
- z,
2948
- y || null,
2949
- h || null
2950
- );
2951
- }, XMLHttpRequest.prototype.send = function(x) {
2952
- return e && (this.addEventListener("progress", (b) => {
2953
- if (b.lengthComputable) {
2954
- const z = Math.round(b.loaded / b.total * 100);
2955
- l(z);
2956
- }
2957
- }), this.addEventListener("loadend", () => {
2958
- e = !1, l(100), p(!1);
2959
- })), E.call(this, x);
2960
- }, () => {
2961
- XMLHttpRequest.prototype.open = f, XMLHttpRequest.prototype.send = E;
2962
- };
2963
- }, [r]), [a, s];
2964
- };
2965
- function So(r, a = 50, l = 200) {
2966
- let s = null, p = 0;
2967
- return (...f) => {
2968
- const E = Date.now();
2969
- s && (clearTimeout(s), s = null), E - p >= a && (r(...f), p = E), s = setTimeout(() => {
2970
- r(...f);
2971
- }, l);
2972
- };
2973
- }
2974
- const _o = ({
2975
- isPannellumLoaded: r,
2976
- isLoading: a,
2977
- progress: l,
2978
- autoloadInterior360: s,
2979
- loadScene: p
2980
- }) => r ? null : (s && p(), /* @__PURE__ */ i("div", { className: "pointer-events-auto absolute inset-0 flex flex-col items-center justify-center gap-y-4", children: /* @__PURE__ */ pe("div", { className: "pointer-events-auto absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35", children: [
2981
- /* @__PURE__ */ i(yr, { className: "size-20 text-primary-light" }),
2982
- /* @__PURE__ */ i(Qe, { color: "neutral", shape: "icon", onClick: p, children: /* @__PURE__ */ i(Mt, { className: "size-full" }) }),
2983
- /* @__PURE__ */ i(
2984
- "div",
2985
- {
2986
- className: ce(
2987
- "relative h-1 w-3/5 overflow-hidden rounded-full bg-background",
2988
- !a && "invisible"
2989
- ),
2990
- children: /* @__PURE__ */ i(
2991
- "div",
2992
- {
2993
- className: "h-full bg-primary transition-[width]",
2994
- style: { width: `${l}%` }
2995
- }
2996
- )
2997
- }
2998
- )
2999
- ] }) })), No = (r) => {
3000
- const { itemIndex: a, src: l, poster: s, onLoaded: p, onError: f } = r, { autoLoadInterior360: E } = $e(), { isShowingDetails: e, setItemInteraction: x, zoom: b, isZooming: z, setZoom: y } = Ke(), [h, o] = Ro(l), L = Ie(null), D = Ie(null), [k, m] = Le(!1), N = j(() => {
3001
- a !== void 0 && x(a, "ready"), p?.(), m(!0);
3002
- }, [a, x, p]), w = j((C) => {
3003
- C instanceof MouseEvent && C.button !== 0 || (C.preventDefault(), C.stopPropagation(), C.stopImmediatePropagation());
3004
- }, []), d = j(() => {
3005
- const C = L.current?.getViewer();
3006
- C && C.loadScene();
3007
- }, []);
3008
- return fe(() => {
3009
- if (L.current && k && D.current) {
3010
- const C = L.current.getViewer(), P = D.current;
3011
- if (C) {
3012
- const O = (W) => {
3013
- W.preventDefault();
3014
- const I = Bt(
3015
- C.getHfov(),
3016
- bt,
3017
- xt,
3018
- ct,
3019
- dt
3020
- ), T = (W.deltaY < 0 ? "zoom-in" : "zoom-out") === "zoom-in" ? Math.min(I + dt, ct) : Math.max(I - dt, 1);
3021
- y(T);
3022
- }, M = So(
3023
- O,
3024
- 100,
3025
- 150
3026
- ), X = (W) => {
3027
- W.preventDefault();
3028
- const I = Bt(
3029
- C.getHfov(),
3030
- bt,
3031
- xt,
3032
- ct,
3033
- dt,
3034
- !0
3035
- );
3036
- y(I);
3037
- };
3038
- P.addEventListener("wheel", M), P.addEventListener("dblclick", X);
3039
- const S = Math.abs(1 - Math.abs(b)), V = xt - bt, te = jt - S * V;
3040
- return C.setHfov(te), () => {
3041
- P.removeEventListener("wheel", O), P.removeEventListener("dblclick", X);
3042
- };
3043
- }
3044
- }
3045
- }, [b, k, z, y]), /* @__PURE__ */ i(at, { children: /* @__PURE__ */ i("div", { className: ce("relative size-full overflow-hidden bg-transparent"), children: /* @__PURE__ */ pe(
3046
- "div",
3047
- {
3048
- className: ce(
3049
- "size-full duration-details",
3050
- e ? "scale-105" : "scale-100"
3051
- ),
3052
- children: [
3053
- /* @__PURE__ */ pe("div", { ref: D, children: [
3054
- /* @__PURE__ */ i("style", { children: `
3055
- .pnlm-load-button {
3056
- display: none !important;
3057
- }
3058
- .pnlm-load-box {
3059
- display: none !important;
3060
- }
3061
- .pnlm-container {
3062
- background-image: none !important;
3063
- }
3064
- ` }),
3065
- D.current && /* @__PURE__ */ i(
3066
- Lt,
3067
- {
3068
- ref: L,
3069
- id: D.current,
3070
- panorama: l,
3071
- preview: s,
3072
- width: "0",
3073
- height: "0",
3074
- image: l,
3075
- pitch: To,
3076
- yaw: Po,
3077
- hfov: jt,
3078
- maxHfov: xt,
3079
- minHfov: bt,
3080
- compass: !1,
3081
- showControls: !1,
3082
- keyboardZoom: !1,
3083
- onLoad: N,
3084
- onError: f,
3085
- onMousedown: w,
3086
- onTouchstart: w,
3087
- onTouchend: w,
3088
- onMouseup: w,
3089
- autoLoad: !1
3090
- }
3091
- )
3092
- ] }),
3093
- /* @__PURE__ */ i(
3094
- _o,
3095
- {
3096
- isPannellumLoaded: k,
3097
- isLoading: o,
3098
- progress: h,
3099
- autoloadInterior360: E,
3100
- loadScene: d
3101
- }
3102
- )
3103
- ]
3104
- }
3105
- ) }) });
3106
- }, zo = (r) => {
3107
- const { itemIndex: a } = r, { setItemInteraction: l } = Ke(), [s, p] = Le();
3108
- return fe(() => {
3109
- s === null || s === "error" || l(a, s === "spin" ? "running" : "ready");
3110
- }, [a, l, s]), s === "error" ? /* @__PURE__ */ i(
3111
- Nt,
3112
- {
3113
- className: "text-background",
3114
- text: "Interior Spin could not be loaded"
3115
- }
3116
- ) : /* @__PURE__ */ i(
3117
- No,
3118
- {
3119
- ...r,
3120
- onLoaded: () => p("spin"),
3121
- onError: () => p("error")
3122
- }
3123
- );
3124
- }, Do = 750, Ao = 1250, Ho = 360, Oo = 480, Fo = ({
3125
- images: r,
3126
- onlyPreload: a
3127
- }) => {
3128
- const { demoSpin: l, reverse360: s } = $e(), { isShowingDetails: p, isZooming: f } = Ke(), E = f || p, e = Ie(null), x = Ie(null), b = Ie(l), z = Ie(null), y = j(() => {
3129
- z.current && (clearTimeout(z.current), z.current = null);
3130
- }, []), h = Ie(null), o = () => {
3131
- h.current && (cancelAnimationFrame(h.current), h.current = null);
3132
- }, [L, D] = Le(0), k = r.length, m = j(() => {
3133
- D((w) => (w - 1 + k) % k);
3134
- }, [k]), N = j(() => {
3135
- D((w) => (w + 1) % k);
3136
- }, [k]);
3137
- return fe(() => {
3138
- if (E) {
3139
- y();
3140
- return;
3141
- }
3142
- const w = e.current, d = x.current;
3143
- if (!w || !d)
3144
- return;
3145
- b.current && (b.current = !1, z.current = setTimeout(() => {
3146
- const re = Date.now(), G = () => {
3147
- const ve = () => {
3148
- const ze = (Date.now() - re) / Ao, Re = Math.round(((Ze) => Ze * (2 - Ze))(ze) * k), Be = tt(Re % k, 0, k - 1);
3149
- D(Be), !(Re >= k) && G();
3150
- };
3151
- h.current = requestAnimationFrame(ve);
3152
- };
3153
- G();
3154
- }, Do));
3155
- const C = Ho / k;
3156
- let P = null, O = [];
3157
- const M = (re) => {
3158
- O.push(re), O.length > 20 && O.shift();
3159
- }, X = () => {
3160
- const re = (() => {
3161
- const Y = Date.now(), Re = O.filter(
3162
- (Oe) => Y - Oe.timestamp < 50
3163
- );
3164
- if (Re.length < 2)
3165
- return 0;
3166
- const Be = Re[0], Ze = Re[Re.length - 1];
3167
- return (Ze.value - Be.value) / (1e-3 * Math.max(Ze.timestamp - Be.timestamp, 1));
3168
- })(), G = Date.now();
3169
- let ve = 0, H = G;
3170
- const ze = () => {
3171
- const Y = () => {
3172
- const Re = Date.now(), Be = (Re - G) / 1e3, Ze = Math.pow(0.05, Be), Oe = re * Ze, c = (Re - H) / 1e3;
3173
- if (ve += Oe * c, Math.abs(Oe) < 5 * C && Math.abs(ve) < C) {
3174
- h.current = null;
3175
- return;
3176
- }
3177
- Math.abs(ve) >= C && (ve > 0 !== s ? N() : m(), ve = 0), H = Re, ze();
3178
- };
3179
- h.current = requestAnimationFrame(Y);
3180
- };
3181
- ze();
3182
- }, S = () => {
3183
- y(), o();
3184
- }, V = (re) => {
3185
- if (re.button !== 0)
3186
- return;
3187
- re.preventDefault(), re.stopPropagation(), S();
3188
- const G = re.clientX;
3189
- P = G, O = [{ timestamp: Date.now(), value: G }];
3190
- }, te = (re) => {
3191
- if (P === null)
3192
- return;
3193
- re.stopPropagation();
3194
- const { clientX: G } = re;
3195
- M({ timestamp: Date.now(), value: G });
3196
- const ve = G - P;
3197
- Math.abs(ve) < C || (ve > 0 !== s ? N() : m(), P = G);
3198
- }, W = () => {
3199
- P !== null && (P = null, X());
3200
- };
3201
- w.addEventListener("mousedown", V), document.addEventListener("mousemove", te), document.addEventListener("mouseleave", W), document.addEventListener("mouseup", W), document.addEventListener("contextmenu", W);
3202
- const I = Oo / k, F = () => d.getBoundingClientRect().width, T = () => d.scrollWidth / 2 - F() / 2, B = () => {
3203
- const re = T();
3204
- d.scrollLeft = re;
3205
- };
3206
- B();
3207
- const J = () => {
3208
- const re = d.scrollLeft - T();
3209
- Math.abs(re) < I || (re < 0 !== s ? N() : m(), B());
3210
- };
3211
- d.addEventListener("scroll", J);
3212
- let me = null;
3213
- const xe = (re) => {
3214
- if (me !== null || re.changedTouches.length !== 1)
3215
- return;
3216
- S();
3217
- const { identifier: G, clientX: ve } = re.changedTouches[0];
3218
- me = G, P = ve, O = [{ timestamp: Date.now(), value: ve }];
3219
- }, Pe = (re) => {
3220
- if (!P)
3221
- return;
3222
- const G = Array.from(re.changedTouches).find(
3223
- ({ identifier: ze }) => ze === me
3224
- );
3225
- if (!G)
3226
- return;
3227
- re.preventDefault();
3228
- const { clientX: ve } = G;
3229
- M({ timestamp: Date.now(), value: ve });
3230
- const H = ve - P;
3231
- Math.abs(H) < C || (H > 0 !== s ? N() : m(), P = ve);
3232
- }, ne = (re) => {
3233
- !P || !Array.from(re.changedTouches).some(
3234
- ({ identifier: ve }) => ve === me
3235
- ) || (me = null, P = null, X());
3236
- };
3237
- return d.addEventListener("touchstart", xe), d.addEventListener("touchmove", Pe), d.addEventListener("touchend", ne), d.addEventListener("touchcancel", ne), () => {
3238
- w.removeEventListener("mousedown", V), document.removeEventListener("mousemove", te), document.removeEventListener("mouseleave", W), document.removeEventListener("mouseup", W), document.removeEventListener("contextmenu", W), d.removeEventListener("scroll", J), d.removeEventListener("touchstart", xe), d.removeEventListener("touchmove", Pe), d.removeEventListener("touchend", ne), d.removeEventListener("touchcancel", ne);
3239
- };
3240
- }, [
3241
- y,
3242
- N,
3243
- m,
3244
- E,
3245
- s,
3246
- k
3247
- ]), /* @__PURE__ */ i("div", { ref: e, className: "cursor-ew-resize", children: /* @__PURE__ */ pe("div", { ref: x, className: "overflow-x-scroll no-scrollbar", children: [
3248
- /* @__PURE__ */ pe("div", { className: "sticky left-0 top-0", children: [
3249
- r.map((w) => /* @__PURE__ */ i(
3250
- pt,
3251
- {
3252
- src: w.src,
3253
- className: "pointer-events-none !absolute left-0 top-0 -z-10"
3254
- },
3255
- w.src
3256
- )),
3257
- /* @__PURE__ */ i(kr, { ...r[L], onlyPreload: a })
3258
- ] }),
3259
- /* @__PURE__ */ i("div", { className: "pointer-events-none -mt-px h-px w-[calc(100%+1024px)]" })
3260
- ] }) });
3261
- }, Uo = ({ images: r, onPlaceholderImageLoaded: a, onSpinImagesLoaded: l, onError: s }) => {
3262
- const { autoLoad360: p } = $e(), f = et(() => r.map(({ src: y }) => y), [r]), [E, e] = Le(null), x = E ? [...E.values()].filter((y) => y).length / r.length * 100 : null, b = j(() => {
3263
- x === null && e(new Map(f.map((y) => [y, !1])));
3264
- }, [f, x]), z = j((y) => {
3265
- e((h) => {
3266
- const o = new Map(h);
3267
- return o.set(y, !0), o;
3268
- });
3269
- }, []);
3270
- return fe(() => {
3271
- p && b();
3272
- }, [p, b]), fe(() => {
3273
- x === 100 && l();
3274
- }, [x, l]), /* @__PURE__ */ pe("div", { className: "relative size-full", children: [
3275
- x !== null && x !== 100 && // Add images to DOM to preload them
3276
- /* @__PURE__ */ i("div", { className: "hidden", children: f.map((y) => /* @__PURE__ */ i(
3277
- pt,
3278
- {
3279
- src: y,
3280
- onLoad: () => z(y),
3281
- onError: s
3282
- },
3283
- y
3284
- )) }),
3285
- /* @__PURE__ */ i(
3286
- pt,
3287
- {
3288
- className: "size-full",
3289
- src: f[0],
3290
- onLoad: a
3291
- }
3292
- ),
3293
- /* @__PURE__ */ pe("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35", children: [
3294
- /* @__PURE__ */ i(Er, { className: "size-20 text-primary-light" }),
3295
- /* @__PURE__ */ i(Qe, { color: "neutral", shape: "icon", onClick: b, children: /* @__PURE__ */ i(Mt, { className: "size-full" }) }),
3296
- /* @__PURE__ */ i(
3297
- "div",
3298
- {
3299
- className: ce(
3300
- "relative h-1 w-3/5 overflow-hidden rounded-full bg-background",
3301
- x === null && "invisible"
3302
- ),
3303
- children: /* @__PURE__ */ i(
3304
- "div",
3305
- {
3306
- className: "h-full bg-primary transition-[width]",
3307
- style: { width: `${x ?? 0}%` }
3308
- }
3309
- )
3310
- }
3311
- )
3312
- ] })
3313
- ] });
3314
- }, Vo = (r) => {
3315
- const { itemIndex: a } = r, { setItemInteraction: l } = Ke(), [s, p] = Le();
3316
- return fe(() => {
3317
- s === null || s === "error" || l(a, s === "spin" ? "running" : "ready");
3318
- }, [a, l, s]), s === "error" ? /* @__PURE__ */ i(
3319
- Nt,
3320
- {
3321
- className: "text-background",
3322
- text: "Spin could not be loaded"
3323
- }
3324
- ) : s !== "spin" ? /* @__PURE__ */ i(
3325
- Uo,
3326
- {
3327
- ...r,
3328
- onPlaceholderImageLoaded: () => p((f) => f === null ? "placeholder" : f),
3329
- onSpinImagesLoaded: () => p("spin"),
3330
- onError: () => p("error")
3331
- }
3332
- ) : /* @__PURE__ */ i(Fo, { ...r });
3333
- }, Bo = (r) => /* @__PURE__ */ i(Qe, { color: "neutral", shape: "icon", ...r, children: /* @__PURE__ */ i(Mt, { className: "size-full" }) }), Wo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_PAUSE", children: /* @__PURE__ */ i(
3334
- "svg",
3335
- {
3336
- className: r,
3337
- width: "16",
3338
- height: "16",
3339
- viewBox: "0 0 16 16",
3340
- fill: "none",
3341
- xmlns: "http://www.w3.org/2000/svg",
3342
- children: /* @__PURE__ */ i(
3343
- "path",
3344
- {
3345
- d: "M4 12.6667H6.66667V3.33333H4V12.6667ZM9.33333 3.33333V12.6667H12V3.33333H9.33333Z",
3346
- fill: "currentColor"
3347
- }
3348
- )
3349
- }
3350
- ) }), Xo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_VOLUME", children: /* @__PURE__ */ i(
3351
- "svg",
3352
- {
3353
- className: r,
3354
- width: "16",
3355
- height: "16",
3356
- viewBox: "0 0 16 16",
3357
- fill: "none",
3358
- xmlns: "http://www.w3.org/2000/svg",
3359
- children: /* @__PURE__ */ i(
3360
- "path",
3361
- {
3362
- 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",
3363
- fill: "currentColor"
3364
- }
3365
- )
3366
- }
3367
- ) }), Yo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_VOLUME_OFF", children: /* @__PURE__ */ i(
3368
- "svg",
3369
- {
3370
- className: r,
3371
- width: "16",
3372
- height: "16",
3373
- viewBox: "0 0 16 16",
3374
- fill: "none",
3375
- xmlns: "http://www.w3.org/2000/svg",
3376
- children: /* @__PURE__ */ i(
3377
- "path",
3378
- {
3379
- 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",
3380
- fill: "currentColor"
3381
- }
3382
- )
3383
- }
3384
- ) }), qt = ({ progress: r }) => /* @__PURE__ */ i("div", { className: "h-1 w-full overflow-hidden rounded-ui-sm bg-background/25", children: /* @__PURE__ */ i(
3385
- "div",
3386
- {
3387
- className: "size-full rounded-ui-sm bg-background transition-transform",
3388
- style: { transform: `translateX(-${100 * (1 - r)}%)` }
3389
- }
3390
- ) }), Zo = 3e3, Go = ({ src: r, poster: a, itemIndex: l }) => {
3391
- const { carrouselItemIndex: s, setItemInteraction: p } = Ke(), f = Ie(null), E = Ie(null), e = j(() => {
3392
- if (!E.current)
3393
- throw new Error("videoRef.current is null");
3394
- return E.current;
3395
- }, []);
3396
- fe(() => {
3397
- p(l, "ready");
3398
- }, [l, p]);
3399
- const x = j(() => {
3400
- e().play();
3401
- }, [e]), b = j(() => {
3402
- e().pause();
3403
- }, [e]);
3404
- fe(() => {
3405
- s === l || b();
3406
- }, [s, l, b]);
3407
- const [z, y] = Le(!1), [h, o] = Le(!0), L = () => {
3408
- y(!0), p(l, "running");
3409
- }, D = () => {
3410
- y(!1), p(l, "ready");
3411
- }, k = () => {
3412
- o(!1);
3413
- }, m = () => {
3414
- o(!0);
3415
- }, [N, w] = Le(null), d = (T) => {
3416
- const B = e(), J = T.currentTarget.getBoundingClientRect(), xe = (T.clientX - J.left) / J.width, Pe = Math.min(1, Math.max(0, xe));
3417
- B.volume = Pe, B.muted = !1;
3418
- }, C = (T) => {
3419
- const B = e();
3420
- B.muted = T;
3421
- };
3422
- fe(() => {
3423
- const T = E.current;
3424
- if (!T)
3425
- return;
3426
- const B = () => {
3427
- w({
3428
- volume: T.volume,
3429
- isMuted: T.muted
3430
- });
3431
- };
3432
- return B(), T.addEventListener("volumechange", B), () => {
3433
- T.removeEventListener("volumechange", B);
3434
- };
3435
- }, []);
3436
- const [P, O] = Le(null), M = P ? P.currentTime / P.duration : 0;
3437
- fe(() => {
3438
- const T = E.current;
3439
- if (!T) return;
3440
- const B = () => {
3441
- const J = T.currentTime, me = T.duration;
3442
- isNaN(J) || isNaN(me) || O({
3443
- currentTime: J,
3444
- duration: me
3445
- });
3446
- };
3447
- return B(), T.addEventListener("timeupdate", B), () => {
3448
- T.removeEventListener("timeupdate", B);
3449
- };
3450
- }, []);
3451
- const X = (T) => {
3452
- const B = e(), J = T.currentTarget.getBoundingClientRect(), xe = (T.clientX - J.left) / J.width, Pe = B.duration * xe;
3453
- B.currentTime = Pe;
3454
- }, S = (T) => {
3455
- const B = Math.floor(T % 3600 / 60), J = Math.floor(T % 60);
3456
- return `${B}:${J.toString().padStart(2, "0")}`;
3457
- }, [V, te] = Le(!1), W = Ie(void 0), I = j(
3458
- () => clearTimeout(W.current),
3459
- []
3460
- ), F = j(() => {
3461
- I(), W.current = setTimeout(() => {
3462
- te(!1);
3463
- }, Zo);
3464
- }, [I]);
3465
- return fe(() => {
3466
- const T = f.current, B = E.current;
3467
- if (!T || !B)
3468
- return;
3469
- const J = () => {
3470
- F(), te(!0);
3471
- }, me = () => {
3472
- I(), te(!1);
3473
- };
3474
- let xe = !1;
3475
- const Pe = () => {
3476
- xe = !0;
3477
- }, ne = () => {
3478
- xe && (xe = !1, b());
3479
- }, re = () => {
3480
- xe = !1, J();
3481
- }, G = (ve) => {
3482
- ve.preventDefault(), ve.touches.length === 1 && (F(), te((ze) => !ze));
3483
- };
3484
- return T.addEventListener("mousedown", Pe), T.addEventListener("mouseup", ne), T.addEventListener("mouseenter", J), T.addEventListener("mousemove", re), T.addEventListener("mouseleave", me), B.addEventListener("touchstart", G), () => {
3485
- T.removeEventListener("mousedown", Pe), T.removeEventListener("mouseup", ne), T.removeEventListener("mouseenter", J), T.removeEventListener("mousemove", J), T.removeEventListener("mouseleave", me), B.removeEventListener("touchstart", G);
3486
- };
3487
- }, [I, b, F]), /* @__PURE__ */ pe("div", { ref: f, className: "relative size-full", children: [
3488
- /* @__PURE__ */ i(
3489
- "video",
3490
- {
3491
- ref: E,
3492
- className: "size-full",
3493
- src: r,
3494
- poster: a,
3495
- disablePictureInPicture: !0,
3496
- playsInline: !0,
3497
- onPlay: L,
3498
- onPause: D,
3499
- onEnded: D,
3500
- onCanPlay: k,
3501
- onWaiting: m
3502
- }
3503
- ),
3504
- z ? /* @__PURE__ */ pe(at, { children: [
3505
- /* @__PURE__ */ pe(
3506
- "div",
3507
- {
3508
- className: ce(
3509
- "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",
3510
- V ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
3511
- ),
3512
- onMouseDownCapture: (T) => T.stopPropagation(),
3513
- children: [
3514
- /* @__PURE__ */ pe("div", { className: "flex items-center justify-between text-background", children: [
3515
- /* @__PURE__ */ pe(
3516
- "div",
3517
- {
3518
- className: "flex items-center gap-x-4",
3519
- children: [
3520
- /* @__PURE__ */ i(
3521
- Qe,
3522
- {
3523
- shape: "icon",
3524
- variant: "ghost",
3525
- color: "neutral",
3526
- onClick: b,
3527
- children: /* @__PURE__ */ i(Wo, { className: "size-full" })
3528
- }
3529
- ),
3530
- P && /* @__PURE__ */ pe("span", { className: "text-sm", children: [
3531
- S(P.currentTime),
3532
- " /",
3533
- " ",
3534
- S(P.duration)
3535
- ] })
3536
- ]
3537
- }
3538
- ),
3539
- N && /* @__PURE__ */ pe(
3540
- "div",
3541
- {
3542
- className: "group/volume flex items-center gap-x-4 rounded-ui-md p-2 transition-colors hover:bg-foreground/25",
3543
- children: [
3544
- /* @__PURE__ */ i(
3545
- "div",
3546
- {
3547
- className: `w-12 cursor-pointer py-1 opacity-0 transition-opacity ${N.isMuted ? "group-hover/volume:opacity-50" : "group-hover/volume:opacity-100"}`,
3548
- onClick: d,
3549
- children: /* @__PURE__ */ i(qt, { progress: N.volume })
3550
- }
3551
- ),
3552
- /* @__PURE__ */ i(
3553
- "div",
3554
- {
3555
- className: "size-5 cursor-pointer",
3556
- onClick: () => C(!N.isMuted),
3557
- children: N.isMuted ? /* @__PURE__ */ i(Yo, { className: "size-full" }) : /* @__PURE__ */ i(Xo, { className: "size-full" })
3558
- }
3559
- )
3560
- ]
3561
- }
3562
- )
3563
- ] }),
3564
- /* @__PURE__ */ i(
3565
- "div",
3566
- {
3567
- className: "cursor-pointer py-1",
3568
- onClick: X,
3569
- children: /* @__PURE__ */ i(qt, { progress: M })
3570
- }
3571
- )
3572
- ]
3573
- }
3574
- ),
3575
- h && /* @__PURE__ */ i(
3576
- "div",
3577
- {
3578
- className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",
3579
- children: /* @__PURE__ */ i(xr, { size: "lg", color: "background" })
3580
- }
3581
- )
3582
- ] }) : /* @__PURE__ */ i(
3583
- "div",
3584
- {
3585
- className: "absolute inset-0 flex items-center justify-center bg-foreground/25",
3586
- children: /* @__PURE__ */ i(Bo, { onClick: x })
3587
- }
3588
- )
3589
- ] });
3590
- }, jo = ({ index: r, item: a, isShown: l }) => {
3591
- const { type: s } = a;
3592
- let p;
3593
- switch (s) {
3594
- case "image":
3595
- p = /* @__PURE__ */ i(kr, { itemIndex: r, onlyPreload: !l, ...a });
3596
- break;
3597
- case "video":
3598
- p = /* @__PURE__ */ i(Go, { itemIndex: r, ...a });
3599
- break;
3600
- case "360":
3601
- p = /* @__PURE__ */ i(Vo, { itemIndex: r, onlyPreload: !l, ...a });
3602
- break;
3603
- case "interior-360":
3604
- p = /* @__PURE__ */ i(
3605
- zo,
3606
- {
3607
- itemIndex: r,
3608
- onlyPreload: !l,
3609
- ...a
3610
- }
3611
- );
3612
- break;
3613
- case "custom":
3614
- p = /* @__PURE__ */ i(yo, { itemIndex: r, ...a });
3615
- }
3616
- return p = /* @__PURE__ */ i("div", { className: "-ml-px h-full w-[calc(100%+2px)]", children: p }), p;
3617
- }, qo = (r) => {
3618
- fe(() => {
3619
- const a = (l) => {
3620
- l.key === "Escape" && r();
3621
- };
3622
- return addEventListener("keydown", a), () => {
3623
- removeEventListener("keydown", a);
3624
- };
3625
- }, [r]);
3626
- };
3627
- function Ko(r) {
3628
- return r.target === r.currentTarget;
3629
- }
3630
- const Jo = ({ currentIndex: r, maxIndex: a }) => /* @__PURE__ */ pe("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: [
3631
- /* @__PURE__ */ i("span", { children: r + 1 }),
3632
- /* @__PURE__ */ i("span", { children: "/" }),
3633
- /* @__PURE__ */ i("span", { children: a + 1 })
3634
- ] }), Kt = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_ARROW_RIGHT", children: /* @__PURE__ */ i("svg", { className: r, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ i(
3635
- "path",
3636
- {
3637
- d: "M4.07666 13.4868L5.25666 14.6668L11.9233 8.00016L5.25666 1.3335L4.07666 2.5135L9.56333 8.00016L4.07666 13.4868Z",
3638
- fill: "currentColor"
3639
- }
3640
- ) }) }), Qo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_EXTEND", children: /* @__PURE__ */ i("svg", { className: r, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ i(
3641
- "path",
3642
- {
3643
- 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",
3644
- fill: "currentColor"
3645
- }
3646
- ) }) }), $o = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_GALLERY", children: /* @__PURE__ */ i("svg", { className: r, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ i(
3647
- "path",
3648
- {
3649
- 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",
3650
- fill: "currentColor"
3651
- }
3652
- ) }) }), en = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_HOTSPOTS", children: /* @__PURE__ */ pe(
3653
- "svg",
3654
- {
3655
- className: r,
3656
- width: "12",
3657
- height: "12",
3658
- viewBox: "0 0 12 12",
3659
- fill: "none",
3660
- xmlns: "http://www.w3.org/2000/svg",
3661
- children: [
3662
- /* @__PURE__ */ i("g", { clipPath: "url(#clip0_418_982)", children: /* @__PURE__ */ i(
3663
- "path",
3664
- {
3665
- 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",
3666
- fill: "currentColor"
3667
- }
3668
- ) }),
3669
- /* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "clip0_418_982", children: /* @__PURE__ */ i("rect", { width: "12", height: "12", fill: "white" }) }) })
3670
- ]
3671
- }
3672
- ) }), tn = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_MINUS", children: /* @__PURE__ */ i(
3673
- "svg",
3674
- {
3675
- className: r,
3676
- width: "16",
3677
- height: "16",
3678
- viewBox: "0 0 16 16",
3679
- fill: "none",
3680
- xmlns: "http://www.w3.org/2000/svg",
3681
- children: /* @__PURE__ */ i(
3682
- "path",
3683
- {
3684
- d: "M12.6666 8.66634H3.33325V7.33301H12.6666V8.66634Z",
3685
- fill: "currentColor"
3686
- }
3687
- )
3688
- }
3689
- ) }), rn = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_PLUS", children: /* @__PURE__ */ i(
3690
- "svg",
3691
- {
3692
- className: r,
3693
- width: "16",
3694
- height: "16",
3695
- viewBox: "0 0 16 16",
3696
- fill: "none",
3697
- xmlns: "http://www.w3.org/2000/svg",
3698
- children: /* @__PURE__ */ i(
3699
- "path",
3700
- {
3701
- d: "M12.6666 8.66634H8.66659V12.6663H7.33325V8.66634H3.33325V7.33301H7.33325V3.33301H8.66659V7.33301H12.6666V8.66634Z",
3702
- fill: "currentColor"
3703
- }
3704
- )
3705
- }
3706
- ) }), on = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_REDUCE", children: /* @__PURE__ */ i("svg", { className: r, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ i(
3707
- "path",
3708
- {
3709
- 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",
3710
- fill: "currentColor"
3711
- }
3712
- ) }) }), nn = ({
3713
- enabled: r,
3714
- onToggle: a,
3715
- label: l,
3716
- className: s,
3717
- children: p
3718
- }) => /* @__PURE__ */ pe(
3719
- "label",
3720
- {
3721
- className: ce(
3722
- "flex cursor-pointer items-center justify-center gap-x-2",
3723
- s
3724
- ),
3725
- children: [
3726
- /* @__PURE__ */ i(
3727
- "input",
3728
- {
3729
- type: "checkbox",
3730
- className: "sr-only",
3731
- checked: r,
3732
- onChange: a
3733
- }
3734
- ),
3735
- l && /* @__PURE__ */ i("div", { className: "text-xs text-background", children: l }),
3736
- /* @__PURE__ */ i(
3737
- "div",
3738
- {
3739
- className: ce(
3740
- "flex h-5 w-8 items-center justify-center rounded-full transition-colors",
3741
- r ? "bg-primary" : "bg-background/60"
3742
- ),
3743
- children: /* @__PURE__ */ i(
3744
- "div",
3745
- {
3746
- className: ce(
3747
- "flex size-4 items-center justify-center rounded-full p-0.5 transition",
3748
- r ? "translate-x-1.5 bg-primary-foreground text-primary" : "-translate-x-1.5 bg-background text-foreground"
3749
- ),
3750
- children: p
3751
- }
3752
- )
3753
- }
3754
- )
3755
- ]
3756
- }
3757
- ), an = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_BURGER", children: /* @__PURE__ */ i(
3758
- "svg",
3759
- {
3760
- className: r,
3761
- width: "16",
3762
- height: "16",
3763
- viewBox: "0 0 16 16",
3764
- fill: "none",
3765
- xmlns: "http://www.w3.org/2000/svg",
3766
- children: /* @__PURE__ */ i(
3767
- "path",
3768
- {
3769
- d: "M2 12H14V10.6667H2V12ZM2 8.66667H14V7.33333H2V8.66667ZM2 4V5.33333H14V4H2Z",
3770
- fill: "currentColor"
3771
- }
3772
- )
3773
- }
3774
- ) }), sn = ({ sharedClassName: r }) => {
3775
- const { categories: a } = it(), { displayedCategoryId: l, changeCategory: s } = Ke(), [p, f] = Le(!1), E = () => {
3776
- f(!p);
3777
- }, e = () => {
3778
- f(!1);
3779
- };
3780
- return /* @__PURE__ */ pe(at, { children: [
3781
- p && /* @__PURE__ */ i(
3782
- "div",
3783
- {
3784
- className: ce(r, "inset-0 small:hidden"),
3785
- onClick: e
3786
- }
3787
- ),
3788
- /* @__PURE__ */ pe(
3789
- "div",
3790
- {
3791
- className: ce(
3792
- r,
3793
- ut("top-left"),
3794
- "flex gap-x-2 small:hidden"
3795
- ),
3796
- children: [
3797
- /* @__PURE__ */ i(
3798
- Qe,
3799
- {
3800
- shape: "icon",
3801
- color: p ? "primary" : "neutral",
3802
- onClick: E,
3803
- children: /* @__PURE__ */ i(an, {})
3804
- }
3805
- ),
3806
- p && /* @__PURE__ */ i("div", { className: "rounded-ui-md bg-background transition-radius", children: /* @__PURE__ */ i("ul", { className: "space-y-0.5 p-1", children: a.map(({ id: x, title: b }) => /* @__PURE__ */ i(
3807
- "li",
3808
- {
3809
- className: ce(
3810
- "cursor-pointer rounded-ui px-2 py-1 text-sm font-bold transition-all hover:bg-primary/30",
3811
- x === l && "bg-primary/50"
3812
- ),
3813
- onClick: () => {
3814
- s(x), f(!1);
3815
- },
3816
- children: b
3817
- },
3818
- x
3819
- )) }) })
3820
- ]
3821
- }
3822
- ),
3823
- /* @__PURE__ */ i(
3824
- "div",
3825
- {
3826
- className: ce(
3827
- r,
3828
- vr("top"),
3829
- "w-full overflow-x-auto max-small:hidden"
3830
- ),
3831
- children: /* @__PURE__ */ i("div", { className: "mx-auto flex w-fit gap-x-1 rounded-ui-md bg-background p-1 shadow", children: a.map(({ id: x, title: b }) => /* @__PURE__ */ i(
3832
- Qe,
3833
- {
3834
- variant: x === l ? "fill" : "ghost",
3835
- onClick: () => s(x),
3836
- children: b
3837
- },
3838
- x
3839
- )) })
3840
- }
3841
- )
3842
- ] });
3843
- }, ln = () => {
3844
- const {
3845
- hideCategoriesNav: r,
3846
- infiniteCarrousel: a,
3847
- permanentGallery: l,
3848
- extendBehavior: s
3849
- } = $e(), {
3850
- aspectRatioStyle: p,
3851
- categories: { length: f }
3852
- } = it(), {
3853
- items: { length: E },
3854
- slidable: e,
3855
- carrouselItemIndex: x,
3856
- masterItemIndex: b,
3857
- prevItem: z,
3858
- nextItem: y,
3859
- showGalleryControls: h,
3860
- enableHotspotsControl: o,
3861
- showHotspots: L,
3862
- toggleHotspots: D,
3863
- showGallery: k,
3864
- toggleGallery: m,
3865
- extendMode: N,
3866
- toggleExtendMode: w,
3867
- shownDetails: d,
3868
- isShowingDetails: C,
3869
- resetShownDetails: P,
3870
- showZoomControls: O,
3871
- isZooming: M,
3872
- canZoomIn: X,
3873
- zoomIn: S,
3874
- canZoomOut: V,
3875
- zoomOut: te,
3876
- resetView: W
3877
- } = Ke(), I = j(
3878
- (T) => {
3879
- Ko(T) && P();
3880
- },
3881
- [P]
3882
- );
3883
- qo(P);
3884
- const F = "absolute z-overlay";
3885
- return /* @__PURE__ */ pe(at, { children: [
3886
- !r && f > 1 && /* @__PURE__ */ i(
3887
- sn,
3888
- {
3889
- sharedClassName: ce(
3890
- F,
3891
- "transition-opacity",
3892
- M ? "!pointer-events-none opacity-0" : "opacity-100"
3893
- )
3894
- }
3895
- ),
3896
- e && !M && /* @__PURE__ */ i("div", { className: ce(F, ut("top-right")), children: /* @__PURE__ */ i(
3897
- Jo,
3898
- {
3899
- currentIndex: x,
3900
- maxIndex: E - 1
3901
- }
3902
- ) }),
3903
- e && /* @__PURE__ */ pe(at, { children: [
3904
- /* @__PURE__ */ i(
3905
- Qe,
3906
- {
3907
- shape: "icon",
3908
- color: "neutral",
3909
- className: ce(
3910
- F,
3911
- ut("middle-left"),
3912
- M ? "!pointer-events-none opacity-0" : "opacity-100"
3913
- ),
3914
- onClick: z,
3915
- disabled: !a && b <= 0,
3916
- children: /* @__PURE__ */ i(Xe, { customizationKey: "CONTROLS_PREV", children: /* @__PURE__ */ i(Kt, { className: "size-full -scale-x-100" }) })
3917
- }
3918
- ),
3919
- /* @__PURE__ */ i(
3920
- Qe,
3921
- {
3922
- shape: "icon",
3923
- color: "neutral",
3924
- className: ce(
3925
- F,
3926
- ut("middle-right"),
3927
- M ? "!pointer-events-none opacity-0" : "opacity-100"
3928
- ),
3929
- onClick: y,
3930
- disabled: !a && b >= E - 1,
3931
- children: /* @__PURE__ */ i(Xe, { customizationKey: "CONTROLS_NEXT", children: /* @__PURE__ */ i(Kt, { className: "size-full" }) })
3932
- }
3933
- )
3934
- ] }),
3935
- /* @__PURE__ */ pe(
3936
- "div",
3937
- {
3938
- className: ce(
3939
- F,
3940
- ut("bottom-fullW"),
3941
- "pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"
3942
- ),
3943
- children: [
3944
- !l && e && /* @__PURE__ */ pe(at, { children: [
3945
- /* @__PURE__ */ i(
3946
- Qe,
3947
- {
3948
- className: h && !M ? "opacity-100" : "!pointer-events-none opacity-0",
3949
- variant: "fill",
3950
- color: k ? "primary" : "neutral",
3951
- shape: "icon",
3952
- onClick: m,
3953
- children: /* @__PURE__ */ i($o, { className: "size-full" })
3954
- }
3955
- ),
3956
- k && /* @__PURE__ */ i(
3957
- Mr,
3958
- {
3959
- className: ce(
3960
- "transition-opacity",
3961
- h && !M ? "opacity-100" : "!pointer-events-none opacity-0",
3962
- // Left & Right gradient mask to fade the gallery
3963
- "[mask-image:linear-gradient(to_left,transparent_0px,black_4px,black_calc(100%-4px),transparent_100%)]"
3964
- ),
3965
- containerClassName: "mx-1"
3966
- }
3967
- )
3968
- ] }),
3969
- /* @__PURE__ */ pe("div", { className: "col-start-3 flex flex-col items-end gap-y-1 small:gap-y-2", children: [
3970
- o && /* @__PURE__ */ i(
3971
- nn,
3972
- {
3973
- className: ce(
3974
- "transition-opacity",
3975
- M ? "!pointer-events-none opacity-0" : "opacity-100"
3976
- ),
3977
- enabled: L,
3978
- onToggle: D,
3979
- children: /* @__PURE__ */ i(en, { className: "size-full" })
3980
- }
3981
- ),
3982
- O && /* @__PURE__ */ pe("div", { className: "max-small:hidden", children: [
3983
- /* @__PURE__ */ i(
3984
- Qe,
3985
- {
3986
- className: "rounded-b-none",
3987
- color: "neutral",
3988
- shape: "icon",
3989
- disabled: !X,
3990
- onClick: S,
3991
- children: /* @__PURE__ */ i(rn, { className: "size-full" })
3992
- }
3993
- ),
3994
- /* @__PURE__ */ i(Cr, { color: "background" }),
3995
- /* @__PURE__ */ i(
3996
- Qe,
3997
- {
3998
- className: "rounded-t-none",
3999
- color: "neutral",
4000
- shape: "icon",
4001
- disabled: !V,
4002
- onClick: te,
4003
- children: /* @__PURE__ */ i(tn, { className: "size-full" })
4004
- }
4005
- )
4006
- ] }),
4007
- s !== "none" && /* @__PURE__ */ i(
4008
- Qe,
4009
- {
4010
- variant: "fill",
4011
- color: N ? "primary" : "neutral",
4012
- shape: "icon",
4013
- onClick: w,
4014
- children: N ? /* @__PURE__ */ i(on, { className: "size-full" }) : /* @__PURE__ */ i(Qo, { className: "size-full" })
4015
- }
4016
- )
4017
- ] })
4018
- ]
4019
- }
4020
- ),
4021
- /* @__PURE__ */ i(
4022
- "div",
4023
- {
4024
- className: ce(
4025
- F,
4026
- "inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",
4027
- C ? "opacity-100" : "pointer-events-none opacity-0"
4028
- ),
4029
- onClick: I,
4030
- children: /* @__PURE__ */ i(
4031
- "div",
4032
- {
4033
- className: ce(
4034
- "h-full w-3/5 bg-background transition-transform duration-details",
4035
- C ? "translate-x-0" : "translate-x-full"
4036
- ),
4037
- children: !!d && /* @__PURE__ */ pe(at, { children: [
4038
- /* @__PURE__ */ i(
4039
- pt,
4040
- {
4041
- className: "w-full bg-foreground/65",
4042
- style: p,
4043
- src: d.src,
4044
- imgInPlayerWidthRatio: 0.6
4045
- }
4046
- ),
4047
- /* @__PURE__ */ pe(
4048
- "div",
4049
- {
4050
- className: ce(
4051
- "space-y-1 px-2 py-1 small:p-3",
4052
- N && "large:p-4"
4053
- ),
4054
- children: [
4055
- d.title && /* @__PURE__ */ i(
4056
- "span",
4057
- {
4058
- className: ce(
4059
- "text-sm font-semibold small:text-base small:font-bold",
4060
- N && "large:text-lg"
4061
- ),
4062
- children: d.title
4063
- }
4064
- ),
4065
- d.text && /* @__PURE__ */ i(
4066
- "p",
4067
- {
4068
- className: ce(
4069
- "text-xs text-foreground/65 small:text-sm",
4070
- N && "large:text-base"
4071
- ),
4072
- children: d.text
4073
- }
4074
- )
4075
- ]
4076
- }
4077
- )
4078
- ] })
4079
- }
4080
- )
4081
- }
4082
- ),
4083
- (M || C) && /* @__PURE__ */ i(
4084
- wr,
4085
- {
4086
- className: ce(F, ut("top-right")),
4087
- onClick: W
4088
- }
4089
- )
4090
- ] });
4091
- }, cn = ({ className: r = "" }) => {
4092
- const { infiniteCarrousel: a, preloadRange: l, isFullScreen: s } = $e(), { aspectRatioStyle: p } = it(), {
4093
- items: f,
4094
- slidable: E,
4095
- carrouselItemIndex: e,
4096
- setCarrouselItemIndex: x,
4097
- itemIndexCommand: b,
4098
- setItemIndexCommand: z,
4099
- specialCommand: y,
4100
- isRunningSpecialCommand: h,
4101
- finishSpecialCommand: o,
4102
- extendMode: L,
4103
- extendTransition: D
4104
- } = Ke(), k = Ie(null), m = j((I) => {
4105
- if (!k.current)
4106
- throw new Error(`[${I ?? "sliderOrThrow"}] slider.current is null`);
4107
- return k.current;
4108
- }, []), N = Ie(!1), w = Ie(null), d = Ie(null), C = Ie(null), P = j(() => {
4109
- C.current && cancelAnimationFrame(C.current);
4110
- }, []), O = j(() => {
4111
- const I = m("computeClosestSnapIndex"), F = Array.from(I.children), T = I.scrollLeft;
4112
- return F.reduce(
4113
- (J, me, xe) => {
4114
- const Pe = me.offsetLeft;
4115
- return Math.abs(Pe - T) < Math.abs(F[J].offsetLeft - T) ? xe : J;
4116
- },
4117
- 0
4118
- );
4119
- }, [m]), M = j(
4120
- (I) => {
4121
- const F = m("setStyleCursor");
4122
- F.style.cursor = I;
4123
- },
4124
- [m]
4125
- ), X = j(
4126
- (I) => {
4127
- const F = m("setStyleSnapState");
4128
- I === "mandatory" ? F.style.scrollSnapType = "x mandatory" : F.style.scrollSnapType = "none";
4129
- },
4130
- [m]
4131
- ), S = j(
4132
- (I, F, T) => {
4133
- P();
4134
- const B = m("scrollToIndex"), J = Array.from(B.children), me = B.scrollLeft, xe = J[I].offsetLeft, Pe = (ze) => {
4135
- B.scrollTo({
4136
- left: ze,
4137
- behavior: "instant"
4138
- });
4139
- }, ne = () => {
4140
- Pe(xe), X("mandatory"), T?.();
4141
- }, re = Math.abs(me - xe);
4142
- if (re < 1 || F === "instant") {
4143
- ne();
4144
- return;
4145
- }
4146
- const G = tt(re / 2.5, 300, 1e3), ve = (/* @__PURE__ */ new Date()).getTime();
4147
- X("none");
4148
- const H = () => {
4149
- const ze = () => {
4150
- const Re = (/* @__PURE__ */ new Date()).getTime() - ve;
4151
- if (Re >= G) {
4152
- ne();
4153
- return;
4154
- }
4155
- const Be = Math.min(Re / G, 1), Ze = Lr(Be), Oe = yt(me, xe, Ze);
4156
- Pe(Oe), H();
4157
- };
4158
- C.current = requestAnimationFrame(ze);
4159
- };
4160
- H();
4161
- },
4162
- [P, m, X]
4163
- ), [V, te] = Le(), W = !!V;
4164
- return fe(() => {
4165
- const I = () => {
4166
- clearTimeout(V);
4167
- const F = setTimeout(() => {
4168
- te(void 0);
4169
- }, pr);
4170
- te(F);
4171
- };
4172
- return addEventListener("resize", I), document.addEventListener("fullscreenchange", I), () => {
4173
- removeEventListener("resize", I), document.removeEventListener("fullscreenchange", I);
4174
- };
4175
- }, [V]), fe(() => {
4176
- if (y)
4177
- return;
4178
- const I = O();
4179
- Number.isNaN(I) || I !== e && S(e, "instant");
4180
- }, [
4181
- e,
4182
- O,
4183
- S,
4184
- y,
4185
- // - Run the effect when those values change
4186
- f,
4187
- V,
4188
- s,
4189
- L,
4190
- D
4191
- ]), fe(() => {
4192
- if (!E || h) {
4193
- M("auto");
4194
- return;
4195
- }
4196
- const I = k.current;
4197
- if (!I)
4198
- return;
4199
- M("grab"), X("mandatory");
4200
- const F = (J) => {
4201
- J.button === 0 && (J.preventDefault(), J.stopPropagation(), P(), N.current = !0, w.current = J.pageX - I.offsetLeft, d.current = I.scrollLeft, M("grabbing"));
4202
- }, T = (J) => {
4203
- if (!N.current)
4204
- return;
4205
- if (w.current === null)
4206
- throw new Error("[onMouseMove] startX is null");
4207
- X("none");
4208
- const xe = J.pageX - I.offsetLeft - w.current;
4209
- requestAnimationFrame(() => {
4210
- if (d.current === null)
4211
- throw new Error("[onMouseMove] scrollLeft is null");
4212
- I.scrollLeft = d.current - xe;
4213
- });
4214
- }, B = () => {
4215
- if (!N.current)
4216
- return;
4217
- N.current = !1, M("grab");
4218
- const J = O();
4219
- S(J, "smooth");
4220
- };
4221
- return I.addEventListener("mousedown", F), document.addEventListener("mousemove", T), document.addEventListener("mouseleave", B), document.addEventListener("mouseup", B), document.addEventListener("contextmenu", B), () => {
4222
- I.removeEventListener("mousedown", F), document.removeEventListener("mousemove", T), document.removeEventListener("mouseleave", B), document.removeEventListener("mouseup", B), document.removeEventListener("contextmenu", B);
4223
- };
4224
- }, [
4225
- P,
4226
- O,
4227
- h,
4228
- S,
4229
- M,
4230
- X,
4231
- E
4232
- ]), fe(() => {
4233
- if (D || W)
4234
- return;
4235
- const I = k.current;
4236
- if (!I)
4237
- return;
4238
- const F = () => {
4239
- const T = O();
4240
- Number.isNaN(T) || (x(T), T === b && z(null));
4241
- };
4242
- return I.addEventListener("scroll", F), () => {
4243
- I.removeEventListener("scroll", F);
4244
- };
4245
- }, [
4246
- O,
4247
- D,
4248
- W,
4249
- b,
4250
- x,
4251
- z
4252
- ]), fe(() => {
4253
- if (b === null)
4254
- return;
4255
- const I = () => {
4256
- setTimeout(() => {
4257
- z(null), o();
4258
- }, 75);
4259
- };
4260
- switch (y) {
4261
- case "first_to_last":
4262
- S(f.length - 1, "instant", I);
4263
- break;
4264
- case "last_to_first":
4265
- S(0, "instant", I);
4266
- break;
4267
- case "instant":
4268
- S(b, "instant", I);
4269
- break;
4270
- default:
4271
- S(b, "smooth");
4272
- break;
4273
- }
4274
- }, [
4275
- y,
4276
- o,
4277
- b,
4278
- f.length,
4279
- S,
4280
- z
4281
- ]), /* @__PURE__ */ pe(
4282
- "div",
4283
- {
4284
- className: ce(
4285
- "relative overflow-hidden rounded-carrousel transition-radius",
4286
- r
4287
- ),
4288
- style: p,
4289
- children: [
4290
- /* @__PURE__ */ i(
4291
- "div",
4292
- {
4293
- ref: k,
4294
- className: `flex size-full ${E ? "overflow-x-auto no-scrollbar *:snap-start *:snap-always" : "justify-center"}`,
4295
- children: f.map((I, F) => {
4296
- const T = F === e, B = F === 0, J = F === f.length - 1, me = (() => {
4297
- if (y === "first_to_last" && B)
4298
- return {
4299
- transform: `translateX(${100 * f.length}%)`
4300
- };
4301
- if (y === "last_to_first" && J)
4302
- return {
4303
- transform: `translateX(-${100 * f.length}%)`
4304
- };
4305
- })();
4306
- let xe = Math.abs(F - e) <= l;
4307
- xe ||= F === b, a && (xe ||= e < l && f.length - F <= l - e, xe ||= e >= f.length - l && F <= l - (f.length - e));
4308
- const Pe = (() => {
4309
- let ne;
4310
- switch (I.type) {
4311
- case "360":
4312
- ne = I.images[0].src;
4313
- break;
4314
- case "interior-360":
4315
- ne = I.poster ?? "interior-360";
4316
- break;
4317
- case "image":
4318
- ne = I.src;
4319
- break;
4320
- case "video":
4321
- ne = I.poster ?? "video";
4322
- break;
4323
- case "custom":
4324
- ne = "custom";
4325
- break;
4326
- default:
4327
- ne = "unknown";
4328
- }
4329
- return `${F}_${ne}`;
4330
- })();
4331
- return /* @__PURE__ */ i(
4332
- "div",
4333
- {
4334
- className: ce(
4335
- "h-full bg-foreground/35",
4336
- e === F && "z-1"
4337
- // Give high-ground to the shown item (to avoid 1px vertical line)
4338
- ),
4339
- style: { ...p, ...me },
4340
- children: xe && /* @__PURE__ */ i(jo, { index: F, item: I, isShown: T })
4341
- },
4342
- Pe
4343
- );
4344
- })
4345
- }
4346
- ),
4347
- /* @__PURE__ */ i(ln, {})
4348
- ]
4349
- }
4350
- );
4351
- }, un = () => {
4352
- const { permanentGallery: r } = $e(), { aspectRatioStyle: a } = it(), {
4353
- prevItem: l,
4354
- nextItem: s,
4355
- isShowingDetails: p,
4356
- resetShownDetails: f,
4357
- extendMode: E,
4358
- disableExtendMode: e,
4359
- isZooming: x,
4360
- resetZoom: b,
4361
- fakeFullScreen: z
4362
- } = Ke(), y = Ie(null), h = Ie(null), o = Ie(null);
4363
- return fe(() => {
4364
- if (!E)
4365
- return;
4366
- const L = y.current, D = h.current, k = o.current;
4367
- if (!L || !D || !k)
4368
- return;
4369
- let m = !1;
4370
- const N = (C) => [L, D, k].includes(C.target), w = (C) => {
4371
- m = N(C);
4372
- }, d = (C) => {
4373
- m && (N(C) && e(), m = !1);
4374
- };
4375
- return L.addEventListener("mousedown", w), L.addEventListener("mouseup", d), () => {
4376
- L.removeEventListener("mousedown", w), L.removeEventListener("mouseup", d);
4377
- };
4378
- }, [e, E]), fe(() => {
4379
- const L = (D) => {
4380
- D.key === "Escape" && (x ? b() : p ? f() : e());
4381
- };
4382
- return addEventListener("keydown", L), () => {
4383
- removeEventListener("keydown", L);
4384
- };
4385
- }, [
4386
- e,
4387
- p,
4388
- x,
4389
- s,
4390
- l,
4391
- f,
4392
- b
4393
- ]), /* @__PURE__ */ pe(
4394
- "div",
4395
- {
4396
- ref: y,
4397
- className: ce(
4398
- "relative",
4399
- E && "flex size-full items-center justify-center",
4400
- z && "fixed inset-0 z-overlay bg-foreground/75"
4401
- ),
4402
- children: [
4403
- /* @__PURE__ */ pe(
4404
- "div",
4405
- {
4406
- ref: h,
4407
- className: E ? "flex size-full flex-col justify-center gap-y-2 small:gap-y-4" : "space-y-2",
4408
- children: [
4409
- /* @__PURE__ */ i(
4410
- "div",
4411
- {
4412
- ref: o,
4413
- className: ce(
4414
- E && "mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"
4415
- ),
4416
- style: a,
4417
- children: /* @__PURE__ */ i(cn, { className: ce(E && "h-full min-w-0") })
4418
- }
4419
- ),
4420
- r && /* @__PURE__ */ i(Mr, { className: ce(E && "my-2 shrink-0 small:my-4") })
4421
- ]
4422
- }
4423
- ),
4424
- E && /* @__PURE__ */ i(
4425
- wr,
4426
- {
4427
- className: "absolute right-2 top-2 small:right-4 small:top-4",
4428
- onClick: e
4429
- }
4430
- )
4431
- ]
4432
- }
4433
- );
4434
- }, dn = () => {
4435
- const { emitEvent: r, compositionUrl: a } = $e(), {
4436
- data: l,
4437
- status: s,
4438
- isSuccess: p,
4439
- error: f
4440
- } = eo(a);
4441
- return fe(() => {
4442
- f ? r(tr, f) : s === "fetching" ? r($t, a) : p && r(er, l);
4443
- }, [l, a, r, f, p, s]), f ? /* @__PURE__ */ i(
4444
- Nt,
4445
- {
4446
- className: "aspect-square text-foreground/70",
4447
- text: "Player could not be loaded"
4448
- }
4449
- ) : p ? /* @__PURE__ */ i(ro, { composition: l, children: /* @__PURE__ */ i(no, { children: /* @__PURE__ */ i(un, {}) }) }) : /* @__PURE__ */ pe("div", { className: "flex aspect-square size-full flex-col items-center justify-center gap-y-4", children: [
4450
- /* @__PURE__ */ i("div", { className: "animate-pulse text-xl", children: "Loading Player" }),
4451
- /* @__PURE__ */ i(xr, { color: "foreground" })
4452
- ] });
4453
- }, pn = ({
4454
- compositionUrl: r,
4455
- hideCategoriesNav: a = Fr,
4456
- infiniteCarrousel: l = Ur,
4457
- permanentGallery: s = Vr,
4458
- mediaLoadStrategy: p = Br,
4459
- minMediaWidth: f = Wr,
4460
- maxMediaWidth: E = Xr,
4461
- preloadRange: e = Yr,
4462
- autoLoad360: x = Zr,
4463
- autoLoadInterior360: b = Gr,
4464
- categoriesFilter: z = jr,
4465
- extendBehavior: y = qr,
4466
- eventPrefix: h = cr,
4467
- demoSpin: o = Kr,
4468
- reverse360: L = Jr,
4469
- children: D
4470
- // NOTE: use to customize the player, not to display the content
4471
- }) => {
4472
- const k = Ie(null), [m, N] = Le(0.5), [w, d] = Le(!1), C = j(
4473
- (M, X) => {
4474
- const S = h + M, V = new CustomEvent(S, { detail: X });
4475
- document.dispatchEvent(V);
4476
- },
4477
- [h]
4478
- );
4479
- fe(() => {
4480
- if (w) {
4481
- N(1);
4482
- return;
4483
- }
4484
- if (!k.current)
4485
- return;
4486
- const M = k.current, X = () => {
4487
- const S = window.innerWidth, V = M.clientWidth;
4488
- N(V / S);
4489
- };
4490
- return X(), addEventListener("resize", X), () => {
4491
- removeEventListener("resize", X);
4492
- };
4493
- }, [w]), fe(() => {
4494
- if (y !== "full_screen")
4495
- return;
4496
- const M = k.current;
4497
- if (!M)
4498
- throw new Error("Wrapper not found");
4499
- const X = () => {
4500
- const { fullscreenElement: S } = document;
4501
- d(
4502
- S === M || // NOTE: For custom element, the web browser is making the whole custom element full-screen and not only the wrapper
4503
- S?.localName === St
4504
- );
4505
- };
4506
- return document.addEventListener("fullscreenchange", X), () => {
4507
- document.removeEventListener("fullscreenchange", X);
4508
- };
4509
- }, [y]);
4510
- const P = j(async () => {
4511
- const M = k.current;
4512
- if (!M)
4513
- throw new Error("Wrapper not found");
4514
- try {
4515
- return await M.requestFullscreen(), !0;
4516
- } catch {
4517
- return !1;
4518
- }
4519
- }, []), O = j(async () => {
4520
- try {
4521
- return await document.exitFullscreen(), !0;
4522
- } catch {
4523
- return !1;
4524
- }
4525
- }, []);
4526
- return /* @__PURE__ */ i(
4527
- to,
4528
- {
4529
- compositionUrl: r,
4530
- hideCategoriesNav: a,
4531
- infiniteCarrousel: l,
4532
- permanentGallery: s,
4533
- mediaLoadStrategy: p,
4534
- minMediaWidth: f,
4535
- maxMediaWidth: E,
4536
- preloadRange: e,
4537
- categoriesFilter: z,
4538
- autoLoad360: x,
4539
- autoLoadInterior360: b,
4540
- extendBehavior: y,
4541
- demoSpin: o,
4542
- reverse360: L,
4543
- emitEvent: C,
4544
- playerInViewportWidthRatio: m,
4545
- isFullScreen: w,
4546
- requestFullscreen: P,
4547
- exitFullscreen: O,
4548
- children: /* @__PURE__ */ pe(oo, { children: [
4549
- /* @__PURE__ */ i(
4550
- "div",
4551
- {
4552
- ref: k,
4553
- className: "select-none text-foreground",
4554
- style: {
4555
- "--background": "var(--cc-webplayer-background, 0 0% 100%)",
4556
- "--foreground": "var(--cc-webplayer-foreground, 240 10% 3.9%)",
4557
- "--primary": "var(--cc-webplayer-primary, 216 100% 52%)",
4558
- "--primary-foreground": "var(--cc-webplayer-primary-foreground, var(--background))",
4559
- "--primary-light": "var(--cc-webplayer-primary-light, var(--primary))",
4560
- "--neutral": "var(--cc-webplayer-neutral, 0 0% 39%)",
4561
- "--neutral-foreground": "var(--cc-webplayer-neutral-foreground, var(--foreground))",
4562
- "--radius-ui": "var(--cc-webplayer-radius-ui, 16px)",
4563
- "--radius-carrousel": "var(--cc-webplayer-radius-carrousel, 0)",
4564
- "--radius-gallery": "var(--cc-webplayer-radius-gallery, 0)"
4565
- },
4566
- children: /* @__PURE__ */ i(dn, {})
4567
- }
4568
- ),
4569
- D
4570
- ] })
4571
- }
4572
- );
4573
- }, hn = ({ children: r, index: a, thumbnailSrc: l }) => {
4574
- const { registerCustomMedia: s, unregisterCustomMedia: p } = ft();
4575
- return fe(() => {
4576
- if (!r)
4577
- return;
4578
- const f = s({
4579
- Media: r,
4580
- index: a,
4581
- thumbnailSrc: l
4582
- });
4583
- return () => {
4584
- p(f);
4585
- };
4586
- }, [r, p, a, s, l]), null;
4587
- }, Mn = (r) => _t() ? /* @__PURE__ */ i(hn, { ...r }) : /* @__PURE__ */ i("slot", {}), fn = ({ name: r, children: a }) => {
4588
- const { registerIconConfig: l, unregisterIconConfig: s } = ft();
4589
- return fe(() => {
4590
- if (a)
4591
- return l(r, {
4592
- Icon: a
4593
- }), () => {
4594
- s(r);
4595
- };
4596
- }, [a, r, l, s]), null;
4597
- }, Ln = (r) => _t() ? /* @__PURE__ */ i(fn, { ...r }) : /* @__PURE__ */ i("slot", {}), mn = `*,: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:4px;right:4px}.inset-y-1{top:4px;bottom:4px}.-bottom-1{bottom:-4px}.-left-1{left:-4px}.-right-1{right:-4px}.-top-1{top:-4px}.bottom-0{bottom:0}.bottom-1{bottom:4px}.left-0{left:0}.left-1{left:4px}.left-1\\/2{left:50%}.right-1{right:4px}.right-2{right:8px}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-2{top:8px}.-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:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:8px;margin-bottom:8px}.-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:4px;height:4px}.size-12{width:48px;height:48px}.size-20{width:80px;height:80px}.size-4{width:16px;height:16px}.size-5{width:20px;height:20px}.size-8{width:32px;height:32px}.size-full{width:100%;height:100%}.h-1{height:4px}.h-10{height:40px}.h-20{height:80px}.h-3\\/4{height:75%}.h-5{height:20px}.h-8{height:32px}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0}.w-12{width:48px}.w-3\\/5{width:60%}.w-8{width:32px}.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:0}.max-w-40{max-width:160px}.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: -6px;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: 0;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: 6px;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:4px}.gap-x-1{-moz-column-gap:4px;column-gap:4px}.gap-x-2{-moz-column-gap:8px;column-gap:8px}.gap-x-4{-moz-column-gap:16px;column-gap:16px}.gap-y-1{row-gap:4px}.gap-y-2{row-gap:8px}.gap-y-4{row-gap:16px}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2px * var(--tw-space-x-reverse));margin-left:calc(2px * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * 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) + 2px)}.rounded-ui-sm{border-radius:calc(var(--radius-ui) - 2px)}.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:2px}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.py-0\\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.pl-6{padding-left:24px}.pr-12{padding-right:48px}.pr-4{padding-right:16px}.pt-8{padding-top:32px}.text-2xl{font-size:24px;line-height:32px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.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)}.invert{--tw-invert: invert(100%);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)}.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:8px;right:8px}.small\\:inset-y-2{top:8px;bottom:8px}.small\\:bottom-2{bottom:8px}.small\\:left-2{left:8px}.small\\:right-2{right:8px}.small\\:right-4{right:16px}.small\\:top-2{top:8px}.small\\:top-4{top:16px}.small\\:my-4{margin-top:16px;margin-bottom:16px}.small\\:hidden{display:none}.small\\:h-12{height:48px}.small\\:h-28{height:112px}.small\\:max-w-48{max-width:192px}.small\\:gap-2{gap:8px}.small\\:gap-x-2{-moz-column-gap:8px;column-gap:8px}.small\\:gap-y-2{row-gap:8px}.small\\:gap-y-4{row-gap:16px}.small\\:space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}.small\\:p-3{padding:12px}.small\\:px-2{padding-left:8px;padding-right:8px}.small\\:py-1{padding-top:4px;padding-bottom:4px}.small\\:pl-8{padding-left:32px}.small\\:pr-6{padding-right:24px}.small\\:text-base{font-size:16px;line-height:24px}.small\\:text-sm{font-size:14px;line-height:20px}.small\\:font-bold{font-weight:700}}@media (min-width: 1280px){.large\\:h-20{height:80px}.large\\:h-3\\/5{height:60%}.large\\:max-w-56{max-width:224px}.large\\:gap-4{gap:16px}.large\\:p-2{padding:8px}.large\\:p-4{padding:16px}.large\\:text-base{font-size:16px;line-height:24px}.large\\:text-lg{font-size:18px;line-height:28px}}.pnlm-container{margin:0;padding:0;overflow:hidden;position:relative;cursor:default;width:100%;height:100%;font-family:Helvetica,Nimbus Sans L,Liberation Sans,Arial,sans-serif;background:#f4f4f4 url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='67'%20height='100'%20viewBox='0%200%2067%20100'%3e%3cpath%20stroke='%23ccc'%20fill='none'%20d='M33.5,50,0,63,33.5,75,67,63,33.5,50m-33.5-50,67,25m-0.5,0,0,75m-66.5-75,67-25m-33.5,75,0,25m0-100,0,50'/%3e%3c/svg%3e") repeat;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;outline:0;line-height:1.4;contain:content;touch-action:none}.pnlm-container *{box-sizing:content-box}.pnlm-ui{position:absolute;width:100%;height:100%;z-index:1}.pnlm-grab{cursor:grab;cursor:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='26'%20width='26'%3e%3cpath%20stroke='%23000'%20stroke-width='1px'%20fill='%23fff'%20d='m15.3%2020.5s6.38-6.73%204.64-8.24-3.47%201.01-3.47%201.01%203.61-5.72%201.41-6.49c-2.2-0.769-3.33%204.36-3.33%204.36s0.873-5.76-1.06-5.76-1.58%205.39-1.58%205.39-0.574-4.59-2.18-4.12c-1.61%200.468-0.572%205.51-0.572%205.51s-1.58-4.89-2.93-3.79c-1.35%201.11%200.258%205.25%200.572%206.62%200.836%202.43%202.03%202.94%202.17%205.55'/%3e%3c/svg%3e") 12 8,default}.pnlm-grabbing{cursor:grabbing;cursor:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='26'%20width='26'%3e%3cpath%20stroke='%23000'%20stroke-width='1px'%20fill='%23fff'%20d='m15.3%2020.5s5.07-5.29%203.77-6.74c-1.31-1.45-2.53%200.14-2.53%200.14s2.74-3.29%200.535-4.06c-2.2-0.769-2.52%201.3-2.52%201.3s0.81-2.13-1.12-2.13-1.52%201.77-1.52%201.77-0.261-1.59-1.87-1.12c-1.61%200.468-0.874%202.17-0.874%202.17s-0.651-1.55-2-0.445c-1.35%201.11-0.68%202.25-0.365%203.62%200.836%202.43%202.03%202.94%202.17%205.55'/%3e%3c/svg%3e") 12 8,default}.pnlm-sprite{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='26'%20height='208'%3e%3ccircle%20fill-opacity='.78'%20cy='117'%20cx='13'%20r='11'%20fill='%23fff'/%3e%3ccircle%20fill-opacity='.78'%20cy='143'%20cx='13'%20r='11'%20fill='%23fff'/%3e%3ccircle%20cy='169'%20cx='13'%20r='7'%20fill='none'%20stroke='%23000'%20stroke-width='2'/%3e%3ccircle%20cy='195'%20cx='13'%20r='7'%20fill='none'%20stroke='%23000'%20stroke-width='2'/%3e%3ccircle%20cx='13'%20cy='195'%20r='2.5'/%3e%3cpath%20d='m5%2083v6h2v-4h4v-2zm10%200v2h4v4h2v-6zm-5%205v6h6v-6zm-5%205v6h6v-2h-4v-4zm14%200v4h-4v2h6v-6z'/%3e%3cpath%20d='m13%20110a7%207%200%200%200%20-7%207%207%207%200%200%200%207%207%207%207%200%200%200%207%20-7%207%207%200%200%200%20-7%20-7zm-1%203h2v2h-2zm0%203h2v5h-2z'/%3e%3cpath%20d='m5%2057v6h2v-4h4v-2zm10%200v2h4v4h2v-6zm-10%2010v6h6v-2h-4v-4zm14%200v4h-4v2h6v-6z'/%3e%3cpath%20d='m17%2038v2h-8v-2z'/%3e%3cpath%20d='m12%209v3h-3v2h3v3h2v-3h3v-2h-3v-3z'/%3e%3cpath%20d='m13%20136-6.125%206.125h4.375v7.875h3.5v-7.875h4.375z'/%3e%3cpath%20d='m10.428%20173.33v-5.77l5-2.89v5.77zm1-1.73%203-1.73-3.001-1.74z'/%3e%3c/svg%3e")}.pnlm-container:fullscreen{height:100%!important;width:100%!important;position:static!important}.pnlm-render-container{cursor:inherit;position:absolute;height:100%;width:100%}.pnlm-controls{margin-top:4px;background-color:#fff;border:1px solid #999;border-color:#0006;border-radius:3px;cursor:pointer;z-index:2;transform:translateZ(9999px)}.pnlm-control:hover{background-color:#f8f8f8}.pnlm-controls-container{position:absolute;top:0;left:4px;z-index:1}.pnlm-zoom-controls{width:26px;height:52px}.pnlm-zoom-in{width:100%;height:50%;position:absolute;top:0;border-radius:3px 3px 0 0}.pnlm-zoom-out{width:100%;height:50%;position:absolute;bottom:0;background-position:0 -26px;border-top:1px solid #ddd;border-top-color:#0000001a;border-radius:0 0 3px 3px}.pnlm-fullscreen-toggle-button,.pnlm-orientation-button,.pnlm-hot-spot-debug-indicator{width:26px;height:26px}.pnlm-hot-spot-debug-indicator{position:absolute;top:50%;left:50%;width:26px;height:26px;margin:-13px 0 0 -13px;background-color:#ffffff80;border-radius:13px;display:none}.pnlm-orientation-button-inactive{background-position:0 -156px}.pnlm-orientation-button-active{background-position:0 -182px}.pnlm-fullscreen-toggle-button-inactive{background-position:0 -52px}.pnlm-fullscreen-toggle-button-active{background-position:0 -78px}.pnlm-panorama-info{position:absolute;bottom:4px;background-color:#000000b3;border-radius:0 3px 3px 0;padding-right:10px;color:#fff;text-align:left;display:none;z-index:2;transform:translateZ(9999px)}.pnlm-title-box{position:relative;font-size:20px;display:table;padding-left:5px;margin-bottom:3px}.pnlm-author-box{position:relative;font-size:12px;display:table;padding-left:5px}.pnlm-load-box{position:absolute;top:50%;left:50%;width:200px;height:150px;margin:-75px 0 0 -100px;background-color:#000000b3;border-radius:3px;text-align:center;font-size:20px;display:none;color:#fff}.pnlm-load-box p{margin:20px 0}.pnlm-lbox{position:absolute;top:50%;left:50%;width:20px;height:20px;margin:-10px 0 0 -10px;display:none}.pnlm-loading{animation-duration:1.5s;-webkit-animation-duration:1.5s;animation-name:pnlm-mv;-webkit-animation-name:pnlm-mv;animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;animation-timing-function:linear;-webkit-animation-timing-function:linear;height:10px;width:10px;background-color:#fff;position:relative}@keyframes pnlm-mv{0%{left:0;top:0}25%{left:10px;top:0}50%{left:10px;top:10px}75%{left:0;top:10px}to{left:0;top:0}}.pnlm-load-button{position:absolute;top:50%;left:50%;width:200px;height:100px;margin:-50px 0 0 -100px;background-color:#000000b3;border-radius:3px;text-align:center;font-size:20px;display:table;color:#fff;cursor:pointer}.pnlm-load-button:hover{background-color:#000c}.pnlm-load-button p{display:table-cell;vertical-align:middle}.pnlm-info-box{font-size:15px;position:absolute;top:50%;left:50%;width:200px;height:150px;margin:-75px 0 0 -100px;background-color:#000;border-radius:3px;display:table;text-align:center;color:#fff;table-layout:fixed}.pnlm-info-box a{color:#fff;word-wrap:break-word;overflow-wrap:break-word}.pnlm-info-box p{display:table-cell;vertical-align:middle;padding:0 5px}.pnlm-error-msg{display:none}.pnlm-about-msg{font-size:11px;line-height:11px;color:#fff;padding:5px 8px;background:#000000b3;border-radius:3px;position:absolute;top:50px;left:50px;display:none;opacity:0;transition:opacity .3s ease-in-out;z-index:1}.pnlm-about-msg a:link,.pnlm-about-msg a:visited{color:#fff}.pnlm-about-msg a:hover,.pnlm-about-msg a:active{color:#eee}.pnlm-hotspot-base{position:absolute;visibility:hidden;cursor:default;vertical-align:middle;top:0;z-index:1}.pnlm-hotspot{height:26px;width:26px;border-radius:13px}.pnlm-hotspot:hover{background-color:#fff3}.pnlm-hotspot.pnlm-info{background-position:0 -104px}.pnlm-hotspot.pnlm-scene{background-position:0 -130px}div.pnlm-tooltip span{visibility:hidden;position:absolute;border-radius:3px;background-color:#000000b3;color:#fff;text-align:center;max-width:200px;padding:5px 10px;margin-left:-220px;cursor:default}div.pnlm-tooltip:hover span{visibility:visible}div.pnlm-tooltip:hover span:after{content:"";position:absolute;width:0;height:0;border-width:10px;border-style:solid;border-color:rgba(0,0,0,.7) transparent transparent transparent;bottom:-20px;left:-10px;margin:0 50%}.pnlm-compass{position:absolute;width:50px;height:50px;right:4px;bottom:4px;border-radius:25px;background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='50'%20width='50'%3e%3cpath%20d='m24.5078%206-3.2578%2018h7.5l-3.25781-18h-0.984376zm-3.2578%2020%203.2578%2018h0.9844l3.2578-18h-7.5zm1.19531%200.9941h5.10938l-2.5547%2014.1075-2.5547-14.1075z'/%3e%3c/svg%3e");cursor:default;display:none}.pnlm-world{position:absolute;left:50%;top:50%}.pnlm-face{position:absolute;transform-origin:0 0 0}.pnlm-dragfix,.pnlm-preview-img{position:absolute;height:100%;width:100%}.pnlm-preview-img{background-size:cover;background-position:center}.pnlm-lbar{width:150px;margin:0 auto;border:#fff 1px solid;height:6px}.pnlm-lbar-fill{background:#fff;height:100%;width:0}.pnlm-lmsg{font-size:12px}.pnlm-fade-img{position:absolute;top:0;left:0}.pnlm-pointer{cursor:pointer}#textInfo .tooltip-content{font-size:1.6em;position:absolute;left:-70px;bottom:80px;width:200px;pointer-events:none;background-color:#333;color:#fff;line-height:1.2em;padding:.8em;opacity:0;transform-origin:50% calc(100% + 6em);transform:rotate3d(0,0,1,15deg);transition:opacity .5s,transform .5s;transition-timing-function:ease,cubic-bezier(.17,.67,.4,1.39)}#textInfo:hover{z-index:3}#textInfo:hover .tooltip-content{opacity:1;pointer-events:all;transform:translateZ(0) rotate3d(0,0,0,0)}#textInfo .hotspot{cursor:pointer;box-sizing:border-box}#textInfo .hotspot .out:before{speak:none;font-size:48px;line-height:90px;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;display:block;-webkit-font-smoothing:antialiased}#textInfo .hotspot .out{width:60px;height:60px;border-radius:50%;border:5px solid rgba(255,255,255,.8);transition:transform ease-out .1s,border .2s;box-sizing:border-box}#textInfo .hotspot .in{width:40px;height:40px;position:absolute;top:10px;left:10px;background-color:#fffc;border-radius:50%;transition:transform ease-out .1s,background .2s}#textInfo .hotspot .out:after{top:0;left:0;padding:0;z-index:-1;box-shadow:0 0 0 2px #ffffff1a;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%;border-radius:50%;content:"";box-sizing:content-box;transform:scale(.9)}#textInfo .hotspot:hover .out{border:5px solid rgba(255,255,255,1);transform:scale(.9);color:#fff}#textInfo .hotspot:hover .in{background-color:#fff;transform:scale(.8)}#textInfo .hotspot:hover .out:after{animation:sonarEffect 1.2s ease-out}@keyframes sonarEffect{0%{opacity:.5}20%{opacity:.8;box-shadow:0 0 0 2px #ffffff1a,0 0 10px 10px #25aae1cc,0 0 0 10px #ffffff80}to{box-shadow:0 0 0 2px #ffffff1a,0 0 10px 10px #25aae1cc,0 0 0 10px #ffffff80;transform:scale(1.5);opacity:0}}`;
4598
- function gn(r) {
4599
- return r.replace(
4600
- /([a-z0-9])([A-Z])/g,
4601
- (a, l, s) => `${l}-${s.toLowerCase()}`
4602
- );
4603
- }
4604
- function zt(r) {
4605
- return Object.entries(r).reduce((a, [l, s]) => {
4606
- if (s !== void 0) {
4607
- const p = gn(l);
4608
- a[p] = s.toString();
4609
- }
4610
- return a;
4611
- }, {});
4612
- }
4613
- const kn = (r) => /* @__PURE__ */ pe(at, { children: [
4614
- /* @__PURE__ */ i("style", { children: mn }),
4615
- /* @__PURE__ */ i(pn, { ...r })
4616
- ] }), vn = (r) => zt(r), wn = (r) => zt(r), xn = (r) => zt(r), In = ({
4617
- onCompositionLoading: r,
4618
- onCompositionLoaded: a,
4619
- onCompositionLoadError: l,
4620
- onItemChange: s,
4621
- onExtendModeOn: p,
4622
- onExtendModeOff: f,
4623
- onHotspotsOn: E,
4624
- onHotspotsOff: e,
4625
- onGalleryOpen: x,
4626
- onGalleryClose: b,
4627
- className: z,
4628
- style: y = {},
4629
- children: h,
4630
- ...o
4631
- }) => {
4632
- const L = et(() => {
4633
- const D = vn(o);
4634
- return z && Object.assign(D, { class: z }), D;
4635
- }, [z, o]);
4636
- return fe(() => {
4637
- const D = o.eventPrefix ?? cr, k = (w) => `${D}${w}`, m = {
4638
- [$t]: r,
4639
- [er]: a,
4640
- [tr]: l,
4641
- [rr]: s,
4642
- [or]: p,
4643
- [nr]: f,
4644
- [ar]: E,
4645
- [ir]: e,
4646
- [sr]: x,
4647
- [lr]: b
4648
- }, N = /* @__PURE__ */ new Map();
4649
- return Object.entries(m).forEach(([w, d]) => {
4650
- if (!d)
4651
- return;
4652
- const C = k(w), P = (O) => d(O.detail);
4653
- N.set(C, P), document.addEventListener(C, P);
4654
- }), () => {
4655
- N.forEach((w, d) => {
4656
- document.removeEventListener(d, w);
4657
- });
4658
- };
4659
- }, [
4660
- o.eventPrefix,
4661
- r,
4662
- a,
4663
- l,
4664
- s,
4665
- p,
4666
- f,
4667
- E,
4668
- e,
4669
- x,
4670
- b
4671
- ]), /* @__PURE__ */ i("cc-webplayer", { style: { display: "block", ...y }, ...L, children: h });
4672
- }, Tn = ({ children: r, ...a }) => {
4673
- const l = wn(a);
4674
- return /* @__PURE__ */ i("cc-webplayer-custom-media", { ...l, children: r });
4675
- }, Pn = ({
4676
- children: r,
4677
- ...a
4678
- }) => {
4679
- const l = xn(a);
4680
- return /* @__PURE__ */ i("cc-webplayer-icon", { ...l, children: r });
4681
- };
4682
- export {
4683
- cr as D,
4684
- $t as E,
4685
- kn as W,
4686
- Mn as a,
4687
- Ln as b,
4688
- Cn as c,
4689
- St as d,
4690
- Jt as e,
4691
- Qt as f,
4692
- In as g,
4693
- Tn as h,
4694
- Pn as i,
4695
- er as j,
4696
- tr as k,
4697
- rr as l,
4698
- or as m,
4699
- nr as n,
4700
- ar as o,
4701
- ir as p,
4702
- sr as q,
4703
- lr as r,
4704
- En as s
4705
- };