@car-cutter/react-webplayer 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.js +59 -52
- package/dist/legacy.cjs +1 -1
- package/dist/legacy.d.ts +23 -7
- package/dist/legacy.js +49 -41
- package/dist/shared-Cs2DFbEI.cjs +16 -0
- package/dist/shared-DKvJSb9q.js +4712 -0
- package/dist/style.css +1 -0
- package/package.json +6 -6
- package/dist/shared-DQuprS5K.js +0 -2880
- package/dist/shared-QPXPDOqW.cjs +0 -1
|
@@ -0,0 +1,4712 @@
|
|
|
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((A) => new RegExp(`^${A.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), A = L.filter(
|
|
87
|
+
(k) => k >= E && k <= e
|
|
88
|
+
);
|
|
89
|
+
if (A.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 A;
|
|
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 A = L.querySelectorAll(Qt), k = /* @__PURE__ */ new Map();
|
|
139
|
+
for (const m of A) {
|
|
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 A = new MutationObserver(() => {
|
|
170
|
+
f(s(L));
|
|
171
|
+
});
|
|
172
|
+
return A.observe(L, {
|
|
173
|
+
childList: !0,
|
|
174
|
+
subtree: !0
|
|
175
|
+
}), () => A.disconnect();
|
|
176
|
+
}, [s, l]);
|
|
177
|
+
const E = j(
|
|
178
|
+
(L) => p.get(L),
|
|
179
|
+
[p]
|
|
180
|
+
), e = j(
|
|
181
|
+
(L, A) => {
|
|
182
|
+
f((k) => {
|
|
183
|
+
const { Icon: m, ...N } = A;
|
|
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((A) => (A.delete(L), new Map(A)));
|
|
195
|
+
}, []), b = j((L) => {
|
|
196
|
+
const A = L.querySelectorAll(
|
|
197
|
+
Jt
|
|
198
|
+
), k = new Array();
|
|
199
|
+
for (const m of A) {
|
|
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 A = new MutationObserver(() => {
|
|
234
|
+
y(b(L));
|
|
235
|
+
});
|
|
236
|
+
return A.observe(L, {
|
|
237
|
+
childList: !0,
|
|
238
|
+
subtree: !0
|
|
239
|
+
}), () => A.disconnect();
|
|
240
|
+
}, [b, l]);
|
|
241
|
+
const h = j((L) => {
|
|
242
|
+
const { Media: A, ...k } = L, m = /* @__PURE__ */ i("div", { className: Xt, children: A }), 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
|
+
(A) => A.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, A] = Le(0), [k, m] = Le(null), N = k ?? L, w = z[N], d = y[N], [C, I] = Le(
|
|
311
|
+
null
|
|
312
|
+
), O = !!C, M = j(() => I(null), []), X = j(() => {
|
|
313
|
+
if (O || k !== null)
|
|
314
|
+
return;
|
|
315
|
+
const Z = L - 1;
|
|
316
|
+
Z >= 0 ? m(Z) : a && (I("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 && (I("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 && I("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
|
+
), T = 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, P] = Le(!0), B = j(() => {
|
|
379
|
+
const Z = !F;
|
|
380
|
+
P(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: A,
|
|
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: T,
|
|
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 A = 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 [A.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 A = setTimeout(() => {
|
|
727
|
+
L((k) => k ?? !1);
|
|
728
|
+
}, 30);
|
|
729
|
+
return () => clearTimeout(A);
|
|
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: (A) => {
|
|
745
|
+
L(!0), l?.(A);
|
|
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: A
|
|
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
|
+
(T) => T.items.some((F) => F === W)
|
|
1013
|
+
);
|
|
1014
|
+
for (let W = 0; W < x.length; W++) {
|
|
1015
|
+
const T = x[W], F = te(T);
|
|
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, I] = Le(!1), O = j(
|
|
1026
|
+
(S, V) => {
|
|
1027
|
+
const te = N(), W = te.clientWidth, T = te.scrollWidth / x.length, F = (S + 1 / 2) * T - W / 2, P = te.scrollWidth - te.clientWidth;
|
|
1028
|
+
te.scrollTo({
|
|
1029
|
+
left: tt(F, 0, P),
|
|
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 = (T) => {
|
|
1040
|
+
T.preventDefault(), w.current = !0, d.current = {
|
|
1041
|
+
x: T.pageX - S.offsetLeft,
|
|
1042
|
+
scrollLeft: S.scrollLeft
|
|
1043
|
+
};
|
|
1044
|
+
}, te = (T) => {
|
|
1045
|
+
if (!w.current)
|
|
1046
|
+
return;
|
|
1047
|
+
if (d.current === null)
|
|
1048
|
+
throw new Error("[onMouseMove] scrollStart is null");
|
|
1049
|
+
const P = T.pageX - S.offsetLeft - d.current.x;
|
|
1050
|
+
if (!C && Math.abs(P) < 5)
|
|
1051
|
+
return;
|
|
1052
|
+
const B = d.current.scrollLeft - P;
|
|
1053
|
+
I(!0), requestAnimationFrame(() => {
|
|
1054
|
+
S.scrollLeft = B;
|
|
1055
|
+
});
|
|
1056
|
+
}, W = () => {
|
|
1057
|
+
w.current && (w.current = !1, requestAnimationFrame(() => {
|
|
1058
|
+
I(!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), A());
|
|
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: I,
|
|
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), T = tt(I, -(te - S), 0);
|
|
1154
|
+
y.current = { x: W, y: T, scale: M }, d.style.transform = `translate(${W}px, ${T}px) scale(${M})`;
|
|
1155
|
+
},
|
|
1156
|
+
[e]
|
|
1157
|
+
), L = j(
|
|
1158
|
+
(w, d) => {
|
|
1159
|
+
const {
|
|
1160
|
+
x: C,
|
|
1161
|
+
y: I,
|
|
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 - I) < 1 && Math.abs(S - O) < 5e-3;
|
|
1175
|
+
if (!d || te) {
|
|
1176
|
+
V();
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
const W = (/* @__PURE__ */ new Date()).getTime(), T = () => {
|
|
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(I, X, me), ne = yt(O, S, me);
|
|
1187
|
+
o({ x: xe, y: Pe, scale: ne }), T();
|
|
1188
|
+
};
|
|
1189
|
+
h.current = requestAnimationFrame(F);
|
|
1190
|
+
};
|
|
1191
|
+
T();
|
|
1192
|
+
},
|
|
1193
|
+
[o, p]
|
|
1194
|
+
), A = j(
|
|
1195
|
+
(w, d) => {
|
|
1196
|
+
let { x: C, y: I } = y.current;
|
|
1197
|
+
w.x && (C += w.x), w.y && (I += w.y), L(
|
|
1198
|
+
{
|
|
1199
|
+
x: C,
|
|
1200
|
+
y: I
|
|
1201
|
+
},
|
|
1202
|
+
d
|
|
1203
|
+
);
|
|
1204
|
+
},
|
|
1205
|
+
[L]
|
|
1206
|
+
), k = j(
|
|
1207
|
+
(w, d, C) => {
|
|
1208
|
+
const I = y.current.scale, O = tt(w, 1, ct), M = O / I, { x: X, y: S } = y.current, { x: V, y: te } = d, W = -X + V, T = -S + te, F = W * M, P = T * M, B = F - V, J = P - 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, I = d.clientHeight;
|
|
1224
|
+
k(
|
|
1225
|
+
w,
|
|
1226
|
+
{
|
|
1227
|
+
x: C / 2,
|
|
1228
|
+
y: I / 2
|
|
1229
|
+
},
|
|
1230
|
+
200
|
|
1231
|
+
);
|
|
1232
|
+
},
|
|
1233
|
+
[e, k]
|
|
1234
|
+
), N = j(
|
|
1235
|
+
(w, d, C) => {
|
|
1236
|
+
const { scale: I } = y.current;
|
|
1237
|
+
k(
|
|
1238
|
+
I + 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
|
+
A({
|
|
1266
|
+
x: M,
|
|
1267
|
+
y: X
|
|
1268
|
+
}), b.current = {
|
|
1269
|
+
x: O.clientX,
|
|
1270
|
+
y: O.clientY
|
|
1271
|
+
};
|
|
1272
|
+
}, I = () => {
|
|
1273
|
+
x.current = !1;
|
|
1274
|
+
};
|
|
1275
|
+
return w.addEventListener("mousedown", d), document.addEventListener("mousemove", C), document.addEventListener("mouseleave", I), document.addEventListener("mouseup", I), document.addEventListener("contextmenu", I), () => {
|
|
1276
|
+
w.removeEventListener("mousedown", d), document.removeEventListener("mousemove", C), document.removeEventListener("mouseleave", I), document.removeEventListener("mouseup", I), document.removeEventListener("contextmenu", I);
|
|
1277
|
+
};
|
|
1278
|
+
}, [s, A, r]), fe(() => {
|
|
1279
|
+
if (r)
|
|
1280
|
+
return;
|
|
1281
|
+
const w = f.current;
|
|
1282
|
+
if (!w)
|
|
1283
|
+
return;
|
|
1284
|
+
const d = (C) => {
|
|
1285
|
+
const { ctrlKey: I, clientX: O, clientY: M, deltaX: X, deltaY: S } = C;
|
|
1286
|
+
if (I) {
|
|
1287
|
+
if (!s && S >= 0)
|
|
1288
|
+
return;
|
|
1289
|
+
const { left: V, top: te } = w.getBoundingClientRect(), W = O - V, T = M - te;
|
|
1290
|
+
N(-0.01 * S, {
|
|
1291
|
+
x: W,
|
|
1292
|
+
y: T
|
|
1293
|
+
});
|
|
1294
|
+
} else {
|
|
1295
|
+
if (!s)
|
|
1296
|
+
return;
|
|
1297
|
+
A({
|
|
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, A, N, r]), fe(() => {
|
|
1308
|
+
const w = f.current, d = E.current;
|
|
1309
|
+
if (!w || !d)
|
|
1310
|
+
return;
|
|
1311
|
+
const C = z.current, I = (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, T = V.clientY - te.clientY;
|
|
1331
|
+
A({
|
|
1332
|
+
x: W,
|
|
1333
|
+
y: T
|
|
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), T = C.get(te.identifier);
|
|
1338
|
+
if (!W || !T)
|
|
1339
|
+
throw new Error("initialTouch1 or initialTouch2 is null");
|
|
1340
|
+
const F = Yt(
|
|
1341
|
+
W,
|
|
1342
|
+
T
|
|
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", I), d.addEventListener("touchmove", M), d.addEventListener("touchend", O), d.addEventListener("touchcancel", O), () => {
|
|
1351
|
+
d.removeEventListener("touchstart", I), d.removeEventListener("touchmove", M), d.removeEventListener("touchend", O), d.removeEventListener("touchcancel", O);
|
|
1352
|
+
};
|
|
1353
|
+
}, [s, A, 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, A, k, m, N, w, d, C, I, 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, I = le, V = $ || {}, h) {
|
|
1478
|
+
if (L && (o.detachShader(h, L), o.deleteShader(L)), A && (o.detachShader(h, A), o.deleteShader(A)), 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), A = 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(A, Ve), o.compileShader(A), h = o.createProgram(), o.attachShader(h, L), o.attachShader(h, A), o.linkProgram(h), o.getShaderParameter(L, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(L)), o.getShaderParameter(A, o.COMPILE_STATUS) || console.log(o.getShaderInfoLog(A)), 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), I === !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
|
+
P(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
|
+
T();
|
|
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 T() {
|
|
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 P(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
|
+
P(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, A = 0, k = 0, m = new Array(10), N = !1, w, d = !1, C = !1, I, O, M = { yaw: 0, pitch: 0, hfov: 0 }, X = !1, S = !1, V = 0, te, W = 0, T, F, P = {}, 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
|
+
T = e.hfov, F = e.pitch;
|
|
2027
|
+
var n, u;
|
|
2028
|
+
if (e.type == "cubemap") {
|
|
2029
|
+
for (I = [], n = 0; n < 6; n++)
|
|
2030
|
+
I.push(new Image()), I[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), I = R;
|
|
2035
|
+
} else if (e.dynamic === !0)
|
|
2036
|
+
I = e.panorama;
|
|
2037
|
+
else {
|
|
2038
|
+
if (e.panorama === l) {
|
|
2039
|
+
q(e.strings.noPanoramaError);
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
I = new Image();
|
|
2043
|
+
}
|
|
2044
|
+
if (e.type == "cubemap") {
|
|
2045
|
+
var D = 6, _ = function() {
|
|
2046
|
+
D--, D === 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 < I.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), I[n].onload = _, I[n].onerror = se, I[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, I.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 D = u.indexOf("<x:xmpmeta");
|
|
2101
|
+
if (D > -1 && e.ignoreGPanoXMP !== !0) {
|
|
2102
|
+
var _ = u.substring(D, 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
|
+
I.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, A = 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(T, 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, D = u.clientHeight, _ = n.x / R * 2 - 1, se = (1 - n.y / D * 2) * D / 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, D = $(t), _ = (Math.atan(h / u * 2 - 1) - Math.atan(D.x / u * 2 - 1)) * 180 / Math.PI * e.hfov / 90 + A;
|
|
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(D.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(), A = 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 D = $(t.targetTouches[1]);
|
|
2188
|
+
u += (D.x - n.x) * 0.5, R += (D.y - n.y) * 0.5;
|
|
2189
|
+
var _ = Math.sqrt((n.x - D.x) * (n.x - D.x) + (n.y - D.y) * (n.y - D.y));
|
|
2190
|
+
Je(e.hfov + (L - _) * 0.1), L = _;
|
|
2191
|
+
}
|
|
2192
|
+
var se = e.hfov / 360 * e.touchPanSpeedCoeffFactor, ee = (h - u) * se + A;
|
|
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, D;
|
|
2281
|
+
typeof performance < "u" && performance.now() ? D = performance.now() : D = Date.now(), O === l && (O = D);
|
|
2282
|
+
var _ = (D - 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 (D - O > 1e-3) {
|
|
2285
|
+
var se = (D - 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 -= D - O, e.autoRotateStopDelay <= 0 && (e.autoRotateStopDelay = !1, W = e.autoRotate, e.autoRotate = 0));
|
|
2289
|
+
}
|
|
2290
|
+
if (P.pitch && (De("pitch"), n = e.pitch), P.yaw && (De("yaw"), u = e.yaw), P.hfov && (De("hfov"), R = e.hfov), _ > 0 && !e.autoRotate) {
|
|
2291
|
+
var de = 0.85;
|
|
2292
|
+
!m[4] && !m[5] && !m[8] && !m[9] && !P.yaw && (e.yaw += M.yaw * _ * de), !m[2] && !m[3] && !m[6] && !m[7] && !P.pitch && (e.pitch += M.pitch * _ * de), !m[0] && !m[1] && !P.hfov && Je(e.hfov + M.hfov * _ * de);
|
|
2293
|
+
}
|
|
2294
|
+
if (O = D, _ > 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 = P[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 D = P[t].callback, _ = P[t].callbackArgs;
|
|
2307
|
+
delete P[t], typeof D == "function" && D(_);
|
|
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 || P.pitch || P.yaw || P.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, T, 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, T, 3e3), we();
|
|
2332
|
+
}, t) : e.autoRotateInactivityDelay >= 0 && W && (e.autoRotate = W, E.lookAt(F, l, T, 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, D = e.vaov > e.haov;
|
|
2342
|
+
D ? 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], D = [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(D[0] * D[1] * D[2] - _[0] * _[1] * _[2], _[0] * D[1] * D[2] - D[0] * _[1] * _[2], D[0] * _[1] * D[2] + _[0] * D[1] * _[2], D[0] * D[1] * _[2] + _[0] * _[1] * D[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 D = r.orientation ? -r.orientation * Math.PI / 180 / 2 : 0;
|
|
2367
|
+
return R.multiply(new K(Math.cos(D), 0, -Math.sin(D), 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(I, e.type, e.dynamic, e.haov * Math.PI / 180, e.vaov * Math.PI / 180, e.vOffset * Math.PI / 180, Rr, t), e.dynamic !== !0 && (I = 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 D = a.createElement("video"), _ = t.video;
|
|
2405
|
+
e.basePath && !g(_) && (_ = e.basePath + _), D.src = lt(_), D.controls = !0, D.style.width = t.width + "px", re.appendChild(n), u.appendChild(D);
|
|
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), D = Math.cos(e.pitch * Math.PI / 180), _ = Math.cos((-t.yaw + e.yaw) * Math.PI / 180), se = n * R + u * _ * D;
|
|
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 * D - 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 D = f.scenes[t];
|
|
2463
|
+
for (n in D)
|
|
2464
|
+
if (D.hasOwnProperty(n))
|
|
2465
|
+
if (n == "strings")
|
|
2466
|
+
for (u in D.strings)
|
|
2467
|
+
D.strings.hasOwnProperty(u) && (e.strings[u] = st(D.strings[u]));
|
|
2468
|
+
else
|
|
2469
|
+
e[n] = D[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 D in e)
|
|
2488
|
+
if (e.hasOwnProperty(D))
|
|
2489
|
+
switch (D) {
|
|
2490
|
+
case "title":
|
|
2491
|
+
H.title.innerHTML = st(e[D]), H.container.style.display = "inline";
|
|
2492
|
+
break;
|
|
2493
|
+
case "author":
|
|
2494
|
+
H.author.innerHTML = e.strings.bylineLabel.replace("%s", st(e[D])), H.container.style.display = "inline";
|
|
2495
|
+
break;
|
|
2496
|
+
case "fallback":
|
|
2497
|
+
var _ = a.createElement("a");
|
|
2498
|
+
_.href = lt(e[D]), _.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[D]));
|
|
2504
|
+
break;
|
|
2505
|
+
case "autoLoad":
|
|
2506
|
+
e[D] === !0 && x === l && (H.load.box.style.display = "inline", Y.load.style.display = "none", c());
|
|
2507
|
+
break;
|
|
2508
|
+
case "showZoomCtrl":
|
|
2509
|
+
e[D] && e.showControls != !1 ? Y.zoom.style.display = "block" : Y.zoom.style.display = "none";
|
|
2510
|
+
break;
|
|
2511
|
+
case "showFullscreenCtrl":
|
|
2512
|
+
e[D] && 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[D] ? ze.style.display = "block" : ze.style.display = "none";
|
|
2516
|
+
break;
|
|
2517
|
+
case "showControls":
|
|
2518
|
+
e[D] || (Y.orientation.style.display = "none", Y.zoom.style.display = "none", Y.fullscreen.style.display = "none");
|
|
2519
|
+
break;
|
|
2520
|
+
case "orientationOnByDefault":
|
|
2521
|
+
e[D] && (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
|
+
P = {}, 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, D) {
|
|
2567
|
+
w = !1, P = {};
|
|
2568
|
+
var _, se, ee, de;
|
|
2569
|
+
if (e.sceneFadeDuration && !D) {
|
|
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("&").split('"').join(""").split("'").join("'").split("<").join("<").split(">").join(">").split("/").join("/").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 ? P.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), P.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 ? P.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, D, _) {
|
|
2645
|
+
return R = R == l ? 1e3 : Number(R), t !== l && (this.setPitch(t, R, D, _), D = l), n !== l && (this.setYaw(n, R, D, _), D = l), u !== l && this.setHfov(u, R, D, _), 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, T, 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), A = 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) {
|
|
3010
|
+
const C = L.current.getViewer();
|
|
3011
|
+
if (C) {
|
|
3012
|
+
const I = A.current, O = (W) => {
|
|
3013
|
+
W.preventDefault();
|
|
3014
|
+
const T = Bt(
|
|
3015
|
+
C.getHfov(),
|
|
3016
|
+
bt,
|
|
3017
|
+
xt,
|
|
3018
|
+
ct,
|
|
3019
|
+
dt
|
|
3020
|
+
), P = (W.deltaY < 0 ? "zoom-in" : "zoom-out") === "zoom-in" ? Math.min(T + dt, ct) : Math.max(T - dt, 1);
|
|
3021
|
+
y(P);
|
|
3022
|
+
}, M = So(
|
|
3023
|
+
O,
|
|
3024
|
+
100,
|
|
3025
|
+
150
|
|
3026
|
+
), X = (W) => {
|
|
3027
|
+
W.preventDefault();
|
|
3028
|
+
const T = Bt(
|
|
3029
|
+
C.getHfov(),
|
|
3030
|
+
bt,
|
|
3031
|
+
xt,
|
|
3032
|
+
ct,
|
|
3033
|
+
dt,
|
|
3034
|
+
!0
|
|
3035
|
+
);
|
|
3036
|
+
y(T);
|
|
3037
|
+
};
|
|
3038
|
+
I !== null && (I.addEventListener(
|
|
3039
|
+
"wheel",
|
|
3040
|
+
M
|
|
3041
|
+
), I.addEventListener(
|
|
3042
|
+
"dblclick",
|
|
3043
|
+
X
|
|
3044
|
+
));
|
|
3045
|
+
const S = Math.abs(1 - Math.abs(b)), V = xt - bt, te = jt - S * V;
|
|
3046
|
+
return C.setHfov(te), () => {
|
|
3047
|
+
I && (I.removeEventListener("wheel", O), I.removeEventListener(
|
|
3048
|
+
"dblclick",
|
|
3049
|
+
X
|
|
3050
|
+
));
|
|
3051
|
+
};
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
}, [b, k, z, y]), /* @__PURE__ */ i(at, { children: /* @__PURE__ */ i("div", { className: ce("relative size-full overflow-hidden bg-transparent"), children: /* @__PURE__ */ pe(
|
|
3055
|
+
"div",
|
|
3056
|
+
{
|
|
3057
|
+
className: ce(
|
|
3058
|
+
"size-full duration-details",
|
|
3059
|
+
e ? "scale-105" : "scale-100"
|
|
3060
|
+
),
|
|
3061
|
+
children: [
|
|
3062
|
+
/* @__PURE__ */ i("style", { children: `
|
|
3063
|
+
.pnlm-load-button {
|
|
3064
|
+
display: none !important;
|
|
3065
|
+
}
|
|
3066
|
+
.pnlm-load-box {
|
|
3067
|
+
display: none !important;
|
|
3068
|
+
}
|
|
3069
|
+
.pnlm-container {
|
|
3070
|
+
background-image: none !important;
|
|
3071
|
+
}
|
|
3072
|
+
` }),
|
|
3073
|
+
/* @__PURE__ */ pe("div", { className: "relative size-full", ref: A, children: [
|
|
3074
|
+
/* @__PURE__ */ i(
|
|
3075
|
+
Lt,
|
|
3076
|
+
{
|
|
3077
|
+
ref: L,
|
|
3078
|
+
panorama: l,
|
|
3079
|
+
preview: s,
|
|
3080
|
+
width: "100%",
|
|
3081
|
+
height: "100%",
|
|
3082
|
+
image: l,
|
|
3083
|
+
pitch: To,
|
|
3084
|
+
yaw: Po,
|
|
3085
|
+
hfov: jt,
|
|
3086
|
+
maxHfov: xt,
|
|
3087
|
+
minHfov: bt,
|
|
3088
|
+
compass: !1,
|
|
3089
|
+
showControls: !1,
|
|
3090
|
+
onLoad: N,
|
|
3091
|
+
onError: f,
|
|
3092
|
+
onMousedown: w,
|
|
3093
|
+
onTouchstart: w,
|
|
3094
|
+
onTouchend: w,
|
|
3095
|
+
onMouseup: w,
|
|
3096
|
+
autoLoad: !1
|
|
3097
|
+
}
|
|
3098
|
+
),
|
|
3099
|
+
/* @__PURE__ */ i(
|
|
3100
|
+
_o,
|
|
3101
|
+
{
|
|
3102
|
+
isPannellumLoaded: k,
|
|
3103
|
+
isLoading: o,
|
|
3104
|
+
progress: h,
|
|
3105
|
+
autoloadInterior360: E,
|
|
3106
|
+
loadScene: d
|
|
3107
|
+
}
|
|
3108
|
+
)
|
|
3109
|
+
] })
|
|
3110
|
+
]
|
|
3111
|
+
}
|
|
3112
|
+
) }) });
|
|
3113
|
+
}, zo = (r) => {
|
|
3114
|
+
const { itemIndex: a } = r, { setItemInteraction: l } = Ke(), [s, p] = Le();
|
|
3115
|
+
return fe(() => {
|
|
3116
|
+
s === null || s === "error" || l(a, s === "spin" ? "running" : "ready");
|
|
3117
|
+
}, [a, l, s]), s === "error" ? /* @__PURE__ */ i(
|
|
3118
|
+
Nt,
|
|
3119
|
+
{
|
|
3120
|
+
className: "text-background",
|
|
3121
|
+
text: "Interior Spin could not be loaded"
|
|
3122
|
+
}
|
|
3123
|
+
) : /* @__PURE__ */ i(
|
|
3124
|
+
No,
|
|
3125
|
+
{
|
|
3126
|
+
...r,
|
|
3127
|
+
onLoaded: () => p("spin"),
|
|
3128
|
+
onError: () => p("error")
|
|
3129
|
+
}
|
|
3130
|
+
);
|
|
3131
|
+
}, Do = 750, Ao = 1250, Ho = 360, Oo = 480, Fo = ({
|
|
3132
|
+
images: r,
|
|
3133
|
+
onlyPreload: a
|
|
3134
|
+
}) => {
|
|
3135
|
+
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(() => {
|
|
3136
|
+
z.current && (clearTimeout(z.current), z.current = null);
|
|
3137
|
+
}, []), h = Ie(null), o = () => {
|
|
3138
|
+
h.current && (cancelAnimationFrame(h.current), h.current = null);
|
|
3139
|
+
}, [L, A] = Le(0), k = r.length, m = j(() => {
|
|
3140
|
+
A((w) => (w - 1 + k) % k);
|
|
3141
|
+
}, [k]), N = j(() => {
|
|
3142
|
+
A((w) => (w + 1) % k);
|
|
3143
|
+
}, [k]);
|
|
3144
|
+
return fe(() => {
|
|
3145
|
+
if (E) {
|
|
3146
|
+
y();
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
const w = e.current, d = x.current;
|
|
3150
|
+
if (!w || !d)
|
|
3151
|
+
return;
|
|
3152
|
+
b.current && (b.current = !1, z.current = setTimeout(() => {
|
|
3153
|
+
const re = Date.now(), G = () => {
|
|
3154
|
+
const ve = () => {
|
|
3155
|
+
const ze = (Date.now() - re) / Ao, Re = Math.round(((Ze) => Ze * (2 - Ze))(ze) * k), Be = tt(Re % k, 0, k - 1);
|
|
3156
|
+
A(Be), !(Re >= k) && G();
|
|
3157
|
+
};
|
|
3158
|
+
h.current = requestAnimationFrame(ve);
|
|
3159
|
+
};
|
|
3160
|
+
G();
|
|
3161
|
+
}, Do));
|
|
3162
|
+
const C = Ho / k;
|
|
3163
|
+
let I = null, O = [];
|
|
3164
|
+
const M = (re) => {
|
|
3165
|
+
O.push(re), O.length > 20 && O.shift();
|
|
3166
|
+
}, X = () => {
|
|
3167
|
+
const re = (() => {
|
|
3168
|
+
const Y = Date.now(), Re = O.filter(
|
|
3169
|
+
(Oe) => Y - Oe.timestamp < 50
|
|
3170
|
+
);
|
|
3171
|
+
if (Re.length < 2)
|
|
3172
|
+
return 0;
|
|
3173
|
+
const Be = Re[0], Ze = Re[Re.length - 1];
|
|
3174
|
+
return (Ze.value - Be.value) / (1e-3 * Math.max(Ze.timestamp - Be.timestamp, 1));
|
|
3175
|
+
})(), G = Date.now();
|
|
3176
|
+
let ve = 0, H = G;
|
|
3177
|
+
const ze = () => {
|
|
3178
|
+
const Y = () => {
|
|
3179
|
+
const Re = Date.now(), Be = (Re - G) / 1e3, Ze = Math.pow(0.05, Be), Oe = re * Ze, c = (Re - H) / 1e3;
|
|
3180
|
+
if (ve += Oe * c, Math.abs(Oe) < 5 * C && Math.abs(ve) < C) {
|
|
3181
|
+
h.current = null;
|
|
3182
|
+
return;
|
|
3183
|
+
}
|
|
3184
|
+
Math.abs(ve) >= C && (ve > 0 !== s ? N() : m(), ve = 0), H = Re, ze();
|
|
3185
|
+
};
|
|
3186
|
+
h.current = requestAnimationFrame(Y);
|
|
3187
|
+
};
|
|
3188
|
+
ze();
|
|
3189
|
+
}, S = () => {
|
|
3190
|
+
y(), o();
|
|
3191
|
+
}, V = (re) => {
|
|
3192
|
+
if (re.button !== 0)
|
|
3193
|
+
return;
|
|
3194
|
+
re.preventDefault(), re.stopPropagation(), S();
|
|
3195
|
+
const G = re.clientX;
|
|
3196
|
+
I = G, O = [{ timestamp: Date.now(), value: G }];
|
|
3197
|
+
}, te = (re) => {
|
|
3198
|
+
if (I === null)
|
|
3199
|
+
return;
|
|
3200
|
+
re.stopPropagation();
|
|
3201
|
+
const { clientX: G } = re;
|
|
3202
|
+
M({ timestamp: Date.now(), value: G });
|
|
3203
|
+
const ve = G - I;
|
|
3204
|
+
Math.abs(ve) < C || (ve > 0 !== s ? N() : m(), I = G);
|
|
3205
|
+
}, W = () => {
|
|
3206
|
+
I !== null && (I = null, X());
|
|
3207
|
+
};
|
|
3208
|
+
w.addEventListener("mousedown", V), document.addEventListener("mousemove", te), document.addEventListener("mouseleave", W), document.addEventListener("mouseup", W), document.addEventListener("contextmenu", W);
|
|
3209
|
+
const T = Oo / k, F = () => d.getBoundingClientRect().width, P = () => d.scrollWidth / 2 - F() / 2, B = () => {
|
|
3210
|
+
const re = P();
|
|
3211
|
+
d.scrollLeft = re;
|
|
3212
|
+
};
|
|
3213
|
+
B();
|
|
3214
|
+
const J = () => {
|
|
3215
|
+
const re = d.scrollLeft - P();
|
|
3216
|
+
Math.abs(re) < T || (re < 0 !== s ? N() : m(), B());
|
|
3217
|
+
};
|
|
3218
|
+
d.addEventListener("scroll", J);
|
|
3219
|
+
let me = null;
|
|
3220
|
+
const xe = (re) => {
|
|
3221
|
+
if (me !== null || re.changedTouches.length !== 1)
|
|
3222
|
+
return;
|
|
3223
|
+
S();
|
|
3224
|
+
const { identifier: G, clientX: ve } = re.changedTouches[0];
|
|
3225
|
+
me = G, I = ve, O = [{ timestamp: Date.now(), value: ve }];
|
|
3226
|
+
}, Pe = (re) => {
|
|
3227
|
+
if (!I)
|
|
3228
|
+
return;
|
|
3229
|
+
const G = Array.from(re.changedTouches).find(
|
|
3230
|
+
({ identifier: ze }) => ze === me
|
|
3231
|
+
);
|
|
3232
|
+
if (!G)
|
|
3233
|
+
return;
|
|
3234
|
+
re.preventDefault();
|
|
3235
|
+
const { clientX: ve } = G;
|
|
3236
|
+
M({ timestamp: Date.now(), value: ve });
|
|
3237
|
+
const H = ve - I;
|
|
3238
|
+
Math.abs(H) < C || (H > 0 !== s ? N() : m(), I = ve);
|
|
3239
|
+
}, ne = (re) => {
|
|
3240
|
+
!I || !Array.from(re.changedTouches).some(
|
|
3241
|
+
({ identifier: ve }) => ve === me
|
|
3242
|
+
) || (me = null, I = null, X());
|
|
3243
|
+
};
|
|
3244
|
+
return d.addEventListener("touchstart", xe), d.addEventListener("touchmove", Pe), d.addEventListener("touchend", ne), d.addEventListener("touchcancel", ne), () => {
|
|
3245
|
+
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);
|
|
3246
|
+
};
|
|
3247
|
+
}, [
|
|
3248
|
+
y,
|
|
3249
|
+
N,
|
|
3250
|
+
m,
|
|
3251
|
+
E,
|
|
3252
|
+
s,
|
|
3253
|
+
k
|
|
3254
|
+
]), /* @__PURE__ */ i("div", { ref: e, className: "cursor-ew-resize", children: /* @__PURE__ */ pe("div", { ref: x, className: "overflow-x-scroll no-scrollbar", children: [
|
|
3255
|
+
/* @__PURE__ */ pe("div", { className: "sticky left-0 top-0", children: [
|
|
3256
|
+
r.map((w) => /* @__PURE__ */ i(
|
|
3257
|
+
pt,
|
|
3258
|
+
{
|
|
3259
|
+
src: w.src,
|
|
3260
|
+
className: "pointer-events-none !absolute left-0 top-0 -z-10"
|
|
3261
|
+
},
|
|
3262
|
+
w.src
|
|
3263
|
+
)),
|
|
3264
|
+
/* @__PURE__ */ i(kr, { ...r[L], onlyPreload: a })
|
|
3265
|
+
] }),
|
|
3266
|
+
/* @__PURE__ */ i("div", { className: "pointer-events-none -mt-px h-px w-[calc(100%+1024px)]" })
|
|
3267
|
+
] }) });
|
|
3268
|
+
}, Uo = ({ images: r, onPlaceholderImageLoaded: a, onSpinImagesLoaded: l, onError: s }) => {
|
|
3269
|
+
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(() => {
|
|
3270
|
+
x === null && e(new Map(f.map((y) => [y, !1])));
|
|
3271
|
+
}, [f, x]), z = j((y) => {
|
|
3272
|
+
e((h) => {
|
|
3273
|
+
const o = new Map(h);
|
|
3274
|
+
return o.set(y, !0), o;
|
|
3275
|
+
});
|
|
3276
|
+
}, []);
|
|
3277
|
+
return fe(() => {
|
|
3278
|
+
p && b();
|
|
3279
|
+
}, [p, b]), fe(() => {
|
|
3280
|
+
x === 100 && l();
|
|
3281
|
+
}, [x, l]), /* @__PURE__ */ pe("div", { className: "relative size-full", children: [
|
|
3282
|
+
x !== null && x !== 100 && // Add images to DOM to preload them
|
|
3283
|
+
/* @__PURE__ */ i("div", { className: "hidden", children: f.map((y) => /* @__PURE__ */ i(
|
|
3284
|
+
pt,
|
|
3285
|
+
{
|
|
3286
|
+
src: y,
|
|
3287
|
+
onLoad: () => z(y),
|
|
3288
|
+
onError: s
|
|
3289
|
+
},
|
|
3290
|
+
y
|
|
3291
|
+
)) }),
|
|
3292
|
+
/* @__PURE__ */ i(
|
|
3293
|
+
pt,
|
|
3294
|
+
{
|
|
3295
|
+
className: "size-full",
|
|
3296
|
+
src: f[0],
|
|
3297
|
+
onLoad: a
|
|
3298
|
+
}
|
|
3299
|
+
),
|
|
3300
|
+
/* @__PURE__ */ pe("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35", children: [
|
|
3301
|
+
/* @__PURE__ */ i(Er, { className: "size-20 text-primary-light" }),
|
|
3302
|
+
/* @__PURE__ */ i(Qe, { color: "neutral", shape: "icon", onClick: b, children: /* @__PURE__ */ i(Mt, { className: "size-full" }) }),
|
|
3303
|
+
/* @__PURE__ */ i(
|
|
3304
|
+
"div",
|
|
3305
|
+
{
|
|
3306
|
+
className: ce(
|
|
3307
|
+
"relative h-1 w-3/5 overflow-hidden rounded-full bg-background",
|
|
3308
|
+
x === null && "invisible"
|
|
3309
|
+
),
|
|
3310
|
+
children: /* @__PURE__ */ i(
|
|
3311
|
+
"div",
|
|
3312
|
+
{
|
|
3313
|
+
className: "h-full bg-primary transition-[width]",
|
|
3314
|
+
style: { width: `${x ?? 0}%` }
|
|
3315
|
+
}
|
|
3316
|
+
)
|
|
3317
|
+
}
|
|
3318
|
+
)
|
|
3319
|
+
] })
|
|
3320
|
+
] });
|
|
3321
|
+
}, Vo = (r) => {
|
|
3322
|
+
const { itemIndex: a } = r, { setItemInteraction: l } = Ke(), [s, p] = Le();
|
|
3323
|
+
return fe(() => {
|
|
3324
|
+
s === null || s === "error" || l(a, s === "spin" ? "running" : "ready");
|
|
3325
|
+
}, [a, l, s]), s === "error" ? /* @__PURE__ */ i(
|
|
3326
|
+
Nt,
|
|
3327
|
+
{
|
|
3328
|
+
className: "text-background",
|
|
3329
|
+
text: "Spin could not be loaded"
|
|
3330
|
+
}
|
|
3331
|
+
) : s !== "spin" ? /* @__PURE__ */ i(
|
|
3332
|
+
Uo,
|
|
3333
|
+
{
|
|
3334
|
+
...r,
|
|
3335
|
+
onPlaceholderImageLoaded: () => p((f) => f === null ? "placeholder" : f),
|
|
3336
|
+
onSpinImagesLoaded: () => p("spin"),
|
|
3337
|
+
onError: () => p("error")
|
|
3338
|
+
}
|
|
3339
|
+
) : /* @__PURE__ */ i(Fo, { ...r });
|
|
3340
|
+
}, 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(
|
|
3341
|
+
"svg",
|
|
3342
|
+
{
|
|
3343
|
+
className: r,
|
|
3344
|
+
width: "16",
|
|
3345
|
+
height: "16",
|
|
3346
|
+
viewBox: "0 0 16 16",
|
|
3347
|
+
fill: "none",
|
|
3348
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3349
|
+
children: /* @__PURE__ */ i(
|
|
3350
|
+
"path",
|
|
3351
|
+
{
|
|
3352
|
+
d: "M4 12.6667H6.66667V3.33333H4V12.6667ZM9.33333 3.33333V12.6667H12V3.33333H9.33333Z",
|
|
3353
|
+
fill: "currentColor"
|
|
3354
|
+
}
|
|
3355
|
+
)
|
|
3356
|
+
}
|
|
3357
|
+
) }), Xo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_VOLUME", children: /* @__PURE__ */ i(
|
|
3358
|
+
"svg",
|
|
3359
|
+
{
|
|
3360
|
+
className: r,
|
|
3361
|
+
width: "16",
|
|
3362
|
+
height: "16",
|
|
3363
|
+
viewBox: "0 0 16 16",
|
|
3364
|
+
fill: "none",
|
|
3365
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3366
|
+
children: /* @__PURE__ */ i(
|
|
3367
|
+
"path",
|
|
3368
|
+
{
|
|
3369
|
+
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",
|
|
3370
|
+
fill: "currentColor"
|
|
3371
|
+
}
|
|
3372
|
+
)
|
|
3373
|
+
}
|
|
3374
|
+
) }), Yo = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_VOLUME_OFF", children: /* @__PURE__ */ i(
|
|
3375
|
+
"svg",
|
|
3376
|
+
{
|
|
3377
|
+
className: r,
|
|
3378
|
+
width: "16",
|
|
3379
|
+
height: "16",
|
|
3380
|
+
viewBox: "0 0 16 16",
|
|
3381
|
+
fill: "none",
|
|
3382
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3383
|
+
children: /* @__PURE__ */ i(
|
|
3384
|
+
"path",
|
|
3385
|
+
{
|
|
3386
|
+
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",
|
|
3387
|
+
fill: "currentColor"
|
|
3388
|
+
}
|
|
3389
|
+
)
|
|
3390
|
+
}
|
|
3391
|
+
) }), qt = ({ progress: r }) => /* @__PURE__ */ i("div", { className: "h-1 w-full overflow-hidden rounded-ui-sm bg-background/25", children: /* @__PURE__ */ i(
|
|
3392
|
+
"div",
|
|
3393
|
+
{
|
|
3394
|
+
className: "size-full rounded-ui-sm bg-background transition-transform",
|
|
3395
|
+
style: { transform: `translateX(-${100 * (1 - r)}%)` }
|
|
3396
|
+
}
|
|
3397
|
+
) }), Zo = 3e3, Go = ({ src: r, poster: a, itemIndex: l }) => {
|
|
3398
|
+
const { carrouselItemIndex: s, setItemInteraction: p } = Ke(), f = Ie(null), E = Ie(null), e = j(() => {
|
|
3399
|
+
if (!E.current)
|
|
3400
|
+
throw new Error("videoRef.current is null");
|
|
3401
|
+
return E.current;
|
|
3402
|
+
}, []);
|
|
3403
|
+
fe(() => {
|
|
3404
|
+
p(l, "ready");
|
|
3405
|
+
}, [l, p]);
|
|
3406
|
+
const x = j(() => {
|
|
3407
|
+
e().play();
|
|
3408
|
+
}, [e]), b = j(() => {
|
|
3409
|
+
e().pause();
|
|
3410
|
+
}, [e]);
|
|
3411
|
+
fe(() => {
|
|
3412
|
+
s === l || b();
|
|
3413
|
+
}, [s, l, b]);
|
|
3414
|
+
const [z, y] = Le(!1), [h, o] = Le(!0), L = () => {
|
|
3415
|
+
y(!0), p(l, "running");
|
|
3416
|
+
}, A = () => {
|
|
3417
|
+
y(!1), p(l, "ready");
|
|
3418
|
+
}, k = () => {
|
|
3419
|
+
o(!1);
|
|
3420
|
+
}, m = () => {
|
|
3421
|
+
o(!0);
|
|
3422
|
+
}, [N, w] = Le(null), d = (P) => {
|
|
3423
|
+
const B = e(), J = P.currentTarget.getBoundingClientRect(), xe = (P.clientX - J.left) / J.width, Pe = Math.min(1, Math.max(0, xe));
|
|
3424
|
+
B.volume = Pe, B.muted = !1;
|
|
3425
|
+
}, C = (P) => {
|
|
3426
|
+
const B = e();
|
|
3427
|
+
B.muted = P;
|
|
3428
|
+
};
|
|
3429
|
+
fe(() => {
|
|
3430
|
+
const P = E.current;
|
|
3431
|
+
if (!P)
|
|
3432
|
+
return;
|
|
3433
|
+
const B = () => {
|
|
3434
|
+
w({
|
|
3435
|
+
volume: P.volume,
|
|
3436
|
+
isMuted: P.muted
|
|
3437
|
+
});
|
|
3438
|
+
};
|
|
3439
|
+
return B(), P.addEventListener("volumechange", B), () => {
|
|
3440
|
+
P.removeEventListener("volumechange", B);
|
|
3441
|
+
};
|
|
3442
|
+
}, []);
|
|
3443
|
+
const [I, O] = Le(null), M = I ? I.currentTime / I.duration : 0;
|
|
3444
|
+
fe(() => {
|
|
3445
|
+
const P = E.current;
|
|
3446
|
+
if (!P) return;
|
|
3447
|
+
const B = () => {
|
|
3448
|
+
const J = P.currentTime, me = P.duration;
|
|
3449
|
+
isNaN(J) || isNaN(me) || O({
|
|
3450
|
+
currentTime: J,
|
|
3451
|
+
duration: me
|
|
3452
|
+
});
|
|
3453
|
+
};
|
|
3454
|
+
return B(), P.addEventListener("timeupdate", B), () => {
|
|
3455
|
+
P.removeEventListener("timeupdate", B);
|
|
3456
|
+
};
|
|
3457
|
+
}, []);
|
|
3458
|
+
const X = (P) => {
|
|
3459
|
+
const B = e(), J = P.currentTarget.getBoundingClientRect(), xe = (P.clientX - J.left) / J.width, Pe = B.duration * xe;
|
|
3460
|
+
B.currentTime = Pe;
|
|
3461
|
+
}, S = (P) => {
|
|
3462
|
+
const B = Math.floor(P % 3600 / 60), J = Math.floor(P % 60);
|
|
3463
|
+
return `${B}:${J.toString().padStart(2, "0")}`;
|
|
3464
|
+
}, [V, te] = Le(!1), W = Ie(void 0), T = j(
|
|
3465
|
+
() => clearTimeout(W.current),
|
|
3466
|
+
[]
|
|
3467
|
+
), F = j(() => {
|
|
3468
|
+
T(), W.current = setTimeout(() => {
|
|
3469
|
+
te(!1);
|
|
3470
|
+
}, Zo);
|
|
3471
|
+
}, [T]);
|
|
3472
|
+
return fe(() => {
|
|
3473
|
+
const P = f.current, B = E.current;
|
|
3474
|
+
if (!P || !B)
|
|
3475
|
+
return;
|
|
3476
|
+
const J = () => {
|
|
3477
|
+
F(), te(!0);
|
|
3478
|
+
}, me = () => {
|
|
3479
|
+
T(), te(!1);
|
|
3480
|
+
};
|
|
3481
|
+
let xe = !1;
|
|
3482
|
+
const Pe = () => {
|
|
3483
|
+
xe = !0;
|
|
3484
|
+
}, ne = () => {
|
|
3485
|
+
xe && (xe = !1, b());
|
|
3486
|
+
}, re = () => {
|
|
3487
|
+
xe = !1, J();
|
|
3488
|
+
}, G = (ve) => {
|
|
3489
|
+
ve.preventDefault(), ve.touches.length === 1 && (F(), te((ze) => !ze));
|
|
3490
|
+
};
|
|
3491
|
+
return P.addEventListener("mousedown", Pe), P.addEventListener("mouseup", ne), P.addEventListener("mouseenter", J), P.addEventListener("mousemove", re), P.addEventListener("mouseleave", me), B.addEventListener("touchstart", G), () => {
|
|
3492
|
+
P.removeEventListener("mousedown", Pe), P.removeEventListener("mouseup", ne), P.removeEventListener("mouseenter", J), P.removeEventListener("mousemove", J), P.removeEventListener("mouseleave", me), B.removeEventListener("touchstart", G);
|
|
3493
|
+
};
|
|
3494
|
+
}, [T, b, F]), /* @__PURE__ */ pe("div", { ref: f, className: "relative size-full", children: [
|
|
3495
|
+
/* @__PURE__ */ i(
|
|
3496
|
+
"video",
|
|
3497
|
+
{
|
|
3498
|
+
ref: E,
|
|
3499
|
+
className: "size-full",
|
|
3500
|
+
src: r,
|
|
3501
|
+
poster: a,
|
|
3502
|
+
disablePictureInPicture: !0,
|
|
3503
|
+
playsInline: !0,
|
|
3504
|
+
onPlay: L,
|
|
3505
|
+
onPause: A,
|
|
3506
|
+
onEnded: A,
|
|
3507
|
+
onCanPlay: k,
|
|
3508
|
+
onWaiting: m
|
|
3509
|
+
}
|
|
3510
|
+
),
|
|
3511
|
+
z ? /* @__PURE__ */ pe(at, { children: [
|
|
3512
|
+
/* @__PURE__ */ pe(
|
|
3513
|
+
"div",
|
|
3514
|
+
{
|
|
3515
|
+
className: ce(
|
|
3516
|
+
"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",
|
|
3517
|
+
V ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
|
|
3518
|
+
),
|
|
3519
|
+
onMouseDownCapture: (P) => P.stopPropagation(),
|
|
3520
|
+
children: [
|
|
3521
|
+
/* @__PURE__ */ pe("div", { className: "flex items-center justify-between text-background", children: [
|
|
3522
|
+
/* @__PURE__ */ pe(
|
|
3523
|
+
"div",
|
|
3524
|
+
{
|
|
3525
|
+
className: "flex items-center gap-x-4",
|
|
3526
|
+
children: [
|
|
3527
|
+
/* @__PURE__ */ i(
|
|
3528
|
+
Qe,
|
|
3529
|
+
{
|
|
3530
|
+
shape: "icon",
|
|
3531
|
+
variant: "ghost",
|
|
3532
|
+
color: "neutral",
|
|
3533
|
+
onClick: b,
|
|
3534
|
+
children: /* @__PURE__ */ i(Wo, { className: "size-full" })
|
|
3535
|
+
}
|
|
3536
|
+
),
|
|
3537
|
+
I && /* @__PURE__ */ pe("span", { className: "text-sm", children: [
|
|
3538
|
+
S(I.currentTime),
|
|
3539
|
+
" /",
|
|
3540
|
+
" ",
|
|
3541
|
+
S(I.duration)
|
|
3542
|
+
] })
|
|
3543
|
+
]
|
|
3544
|
+
}
|
|
3545
|
+
),
|
|
3546
|
+
N && /* @__PURE__ */ pe(
|
|
3547
|
+
"div",
|
|
3548
|
+
{
|
|
3549
|
+
className: "group/volume flex items-center gap-x-4 rounded-ui-md p-2 transition-colors hover:bg-foreground/25",
|
|
3550
|
+
children: [
|
|
3551
|
+
/* @__PURE__ */ i(
|
|
3552
|
+
"div",
|
|
3553
|
+
{
|
|
3554
|
+
className: `w-12 cursor-pointer py-1 opacity-0 transition-opacity ${N.isMuted ? "group-hover/volume:opacity-50" : "group-hover/volume:opacity-100"}`,
|
|
3555
|
+
onClick: d,
|
|
3556
|
+
children: /* @__PURE__ */ i(qt, { progress: N.volume })
|
|
3557
|
+
}
|
|
3558
|
+
),
|
|
3559
|
+
/* @__PURE__ */ i(
|
|
3560
|
+
"div",
|
|
3561
|
+
{
|
|
3562
|
+
className: "size-5 cursor-pointer",
|
|
3563
|
+
onClick: () => C(!N.isMuted),
|
|
3564
|
+
children: N.isMuted ? /* @__PURE__ */ i(Yo, { className: "size-full" }) : /* @__PURE__ */ i(Xo, { className: "size-full" })
|
|
3565
|
+
}
|
|
3566
|
+
)
|
|
3567
|
+
]
|
|
3568
|
+
}
|
|
3569
|
+
)
|
|
3570
|
+
] }),
|
|
3571
|
+
/* @__PURE__ */ i(
|
|
3572
|
+
"div",
|
|
3573
|
+
{
|
|
3574
|
+
className: "cursor-pointer py-1",
|
|
3575
|
+
onClick: X,
|
|
3576
|
+
children: /* @__PURE__ */ i(qt, { progress: M })
|
|
3577
|
+
}
|
|
3578
|
+
)
|
|
3579
|
+
]
|
|
3580
|
+
}
|
|
3581
|
+
),
|
|
3582
|
+
h && /* @__PURE__ */ i(
|
|
3583
|
+
"div",
|
|
3584
|
+
{
|
|
3585
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",
|
|
3586
|
+
children: /* @__PURE__ */ i(xr, { size: "lg", color: "background" })
|
|
3587
|
+
}
|
|
3588
|
+
)
|
|
3589
|
+
] }) : /* @__PURE__ */ i(
|
|
3590
|
+
"div",
|
|
3591
|
+
{
|
|
3592
|
+
className: "absolute inset-0 flex items-center justify-center bg-foreground/25",
|
|
3593
|
+
children: /* @__PURE__ */ i(Bo, { onClick: x })
|
|
3594
|
+
}
|
|
3595
|
+
)
|
|
3596
|
+
] });
|
|
3597
|
+
}, jo = ({ index: r, item: a, isShown: l }) => {
|
|
3598
|
+
const { type: s } = a;
|
|
3599
|
+
let p;
|
|
3600
|
+
switch (s) {
|
|
3601
|
+
case "image":
|
|
3602
|
+
p = /* @__PURE__ */ i(kr, { itemIndex: r, onlyPreload: !l, ...a });
|
|
3603
|
+
break;
|
|
3604
|
+
case "video":
|
|
3605
|
+
p = /* @__PURE__ */ i(Go, { itemIndex: r, ...a });
|
|
3606
|
+
break;
|
|
3607
|
+
case "360":
|
|
3608
|
+
p = /* @__PURE__ */ i(Vo, { itemIndex: r, onlyPreload: !l, ...a });
|
|
3609
|
+
break;
|
|
3610
|
+
case "interior-360":
|
|
3611
|
+
p = /* @__PURE__ */ i(
|
|
3612
|
+
zo,
|
|
3613
|
+
{
|
|
3614
|
+
itemIndex: r,
|
|
3615
|
+
onlyPreload: !l,
|
|
3616
|
+
...a
|
|
3617
|
+
}
|
|
3618
|
+
);
|
|
3619
|
+
break;
|
|
3620
|
+
case "custom":
|
|
3621
|
+
p = /* @__PURE__ */ i(yo, { itemIndex: r, ...a });
|
|
3622
|
+
}
|
|
3623
|
+
return p = /* @__PURE__ */ i("div", { className: "-ml-px h-full w-[calc(100%+2px)]", children: p }), p;
|
|
3624
|
+
}, qo = (r) => {
|
|
3625
|
+
fe(() => {
|
|
3626
|
+
const a = (l) => {
|
|
3627
|
+
l.key === "Escape" && r();
|
|
3628
|
+
};
|
|
3629
|
+
return addEventListener("keydown", a), () => {
|
|
3630
|
+
removeEventListener("keydown", a);
|
|
3631
|
+
};
|
|
3632
|
+
}, [r]);
|
|
3633
|
+
};
|
|
3634
|
+
function Ko(r) {
|
|
3635
|
+
return r.target === r.currentTarget;
|
|
3636
|
+
}
|
|
3637
|
+
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: [
|
|
3638
|
+
/* @__PURE__ */ i("span", { children: r + 1 }),
|
|
3639
|
+
/* @__PURE__ */ i("span", { children: "/" }),
|
|
3640
|
+
/* @__PURE__ */ i("span", { children: a + 1 })
|
|
3641
|
+
] }), 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(
|
|
3642
|
+
"path",
|
|
3643
|
+
{
|
|
3644
|
+
d: "M4.07666 13.4868L5.25666 14.6668L11.9233 8.00016L5.25666 1.3335L4.07666 2.5135L9.56333 8.00016L4.07666 13.4868Z",
|
|
3645
|
+
fill: "currentColor"
|
|
3646
|
+
}
|
|
3647
|
+
) }) }), 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(
|
|
3648
|
+
"path",
|
|
3649
|
+
{
|
|
3650
|
+
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",
|
|
3651
|
+
fill: "currentColor"
|
|
3652
|
+
}
|
|
3653
|
+
) }) }), $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(
|
|
3654
|
+
"path",
|
|
3655
|
+
{
|
|
3656
|
+
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",
|
|
3657
|
+
fill: "currentColor"
|
|
3658
|
+
}
|
|
3659
|
+
) }) }), en = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_HOTSPOTS", children: /* @__PURE__ */ pe(
|
|
3660
|
+
"svg",
|
|
3661
|
+
{
|
|
3662
|
+
className: r,
|
|
3663
|
+
width: "12",
|
|
3664
|
+
height: "12",
|
|
3665
|
+
viewBox: "0 0 12 12",
|
|
3666
|
+
fill: "none",
|
|
3667
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3668
|
+
children: [
|
|
3669
|
+
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_418_982)", children: /* @__PURE__ */ i(
|
|
3670
|
+
"path",
|
|
3671
|
+
{
|
|
3672
|
+
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",
|
|
3673
|
+
fill: "currentColor"
|
|
3674
|
+
}
|
|
3675
|
+
) }),
|
|
3676
|
+
/* @__PURE__ */ i("defs", { children: /* @__PURE__ */ i("clipPath", { id: "clip0_418_982", children: /* @__PURE__ */ i("rect", { width: "12", height: "12", fill: "white" }) }) })
|
|
3677
|
+
]
|
|
3678
|
+
}
|
|
3679
|
+
) }), tn = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_MINUS", children: /* @__PURE__ */ i(
|
|
3680
|
+
"svg",
|
|
3681
|
+
{
|
|
3682
|
+
className: r,
|
|
3683
|
+
width: "16",
|
|
3684
|
+
height: "16",
|
|
3685
|
+
viewBox: "0 0 16 16",
|
|
3686
|
+
fill: "none",
|
|
3687
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3688
|
+
children: /* @__PURE__ */ i(
|
|
3689
|
+
"path",
|
|
3690
|
+
{
|
|
3691
|
+
d: "M12.6666 8.66634H3.33325V7.33301H12.6666V8.66634Z",
|
|
3692
|
+
fill: "currentColor"
|
|
3693
|
+
}
|
|
3694
|
+
)
|
|
3695
|
+
}
|
|
3696
|
+
) }), rn = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_PLUS", children: /* @__PURE__ */ i(
|
|
3697
|
+
"svg",
|
|
3698
|
+
{
|
|
3699
|
+
className: r,
|
|
3700
|
+
width: "16",
|
|
3701
|
+
height: "16",
|
|
3702
|
+
viewBox: "0 0 16 16",
|
|
3703
|
+
fill: "none",
|
|
3704
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3705
|
+
children: /* @__PURE__ */ i(
|
|
3706
|
+
"path",
|
|
3707
|
+
{
|
|
3708
|
+
d: "M12.6666 8.66634H8.66659V12.6663H7.33325V8.66634H3.33325V7.33301H7.33325V3.33301H8.66659V7.33301H12.6666V8.66634Z",
|
|
3709
|
+
fill: "currentColor"
|
|
3710
|
+
}
|
|
3711
|
+
)
|
|
3712
|
+
}
|
|
3713
|
+
) }), 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(
|
|
3714
|
+
"path",
|
|
3715
|
+
{
|
|
3716
|
+
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",
|
|
3717
|
+
fill: "currentColor"
|
|
3718
|
+
}
|
|
3719
|
+
) }) }), nn = ({
|
|
3720
|
+
enabled: r,
|
|
3721
|
+
onToggle: a,
|
|
3722
|
+
label: l,
|
|
3723
|
+
className: s,
|
|
3724
|
+
children: p
|
|
3725
|
+
}) => /* @__PURE__ */ pe(
|
|
3726
|
+
"label",
|
|
3727
|
+
{
|
|
3728
|
+
className: ce(
|
|
3729
|
+
"flex cursor-pointer items-center justify-center gap-x-2",
|
|
3730
|
+
s
|
|
3731
|
+
),
|
|
3732
|
+
children: [
|
|
3733
|
+
/* @__PURE__ */ i(
|
|
3734
|
+
"input",
|
|
3735
|
+
{
|
|
3736
|
+
type: "checkbox",
|
|
3737
|
+
className: "sr-only",
|
|
3738
|
+
checked: r,
|
|
3739
|
+
onChange: a
|
|
3740
|
+
}
|
|
3741
|
+
),
|
|
3742
|
+
l && /* @__PURE__ */ i("div", { className: "text-xs text-background", children: l }),
|
|
3743
|
+
/* @__PURE__ */ i(
|
|
3744
|
+
"div",
|
|
3745
|
+
{
|
|
3746
|
+
className: ce(
|
|
3747
|
+
"flex h-5 w-8 items-center justify-center rounded-full transition-colors",
|
|
3748
|
+
r ? "bg-primary" : "bg-background/60"
|
|
3749
|
+
),
|
|
3750
|
+
children: /* @__PURE__ */ i(
|
|
3751
|
+
"div",
|
|
3752
|
+
{
|
|
3753
|
+
className: ce(
|
|
3754
|
+
"flex size-4 items-center justify-center rounded-full p-0.5 transition",
|
|
3755
|
+
r ? "translate-x-1.5 bg-primary-foreground text-primary" : "-translate-x-1.5 bg-background text-foreground"
|
|
3756
|
+
),
|
|
3757
|
+
children: p
|
|
3758
|
+
}
|
|
3759
|
+
)
|
|
3760
|
+
}
|
|
3761
|
+
)
|
|
3762
|
+
]
|
|
3763
|
+
}
|
|
3764
|
+
), an = ({ className: r }) => /* @__PURE__ */ i(Xe, { className: r, customizationKey: "UI_BURGER", children: /* @__PURE__ */ i(
|
|
3765
|
+
"svg",
|
|
3766
|
+
{
|
|
3767
|
+
className: r,
|
|
3768
|
+
width: "16",
|
|
3769
|
+
height: "16",
|
|
3770
|
+
viewBox: "0 0 16 16",
|
|
3771
|
+
fill: "none",
|
|
3772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3773
|
+
children: /* @__PURE__ */ i(
|
|
3774
|
+
"path",
|
|
3775
|
+
{
|
|
3776
|
+
d: "M2 12H14V10.6667H2V12ZM2 8.66667H14V7.33333H2V8.66667ZM2 4V5.33333H14V4H2Z",
|
|
3777
|
+
fill: "currentColor"
|
|
3778
|
+
}
|
|
3779
|
+
)
|
|
3780
|
+
}
|
|
3781
|
+
) }), sn = ({ sharedClassName: r }) => {
|
|
3782
|
+
const { categories: a } = it(), { displayedCategoryId: l, changeCategory: s } = Ke(), [p, f] = Le(!1), E = () => {
|
|
3783
|
+
f(!p);
|
|
3784
|
+
}, e = () => {
|
|
3785
|
+
f(!1);
|
|
3786
|
+
};
|
|
3787
|
+
return /* @__PURE__ */ pe(at, { children: [
|
|
3788
|
+
p && /* @__PURE__ */ i(
|
|
3789
|
+
"div",
|
|
3790
|
+
{
|
|
3791
|
+
className: ce(r, "inset-0 small:hidden"),
|
|
3792
|
+
onClick: e
|
|
3793
|
+
}
|
|
3794
|
+
),
|
|
3795
|
+
/* @__PURE__ */ pe(
|
|
3796
|
+
"div",
|
|
3797
|
+
{
|
|
3798
|
+
className: ce(
|
|
3799
|
+
r,
|
|
3800
|
+
ut("top-left"),
|
|
3801
|
+
"flex gap-x-2 small:hidden"
|
|
3802
|
+
),
|
|
3803
|
+
children: [
|
|
3804
|
+
/* @__PURE__ */ i(
|
|
3805
|
+
Qe,
|
|
3806
|
+
{
|
|
3807
|
+
shape: "icon",
|
|
3808
|
+
color: p ? "primary" : "neutral",
|
|
3809
|
+
onClick: E,
|
|
3810
|
+
children: /* @__PURE__ */ i(an, {})
|
|
3811
|
+
}
|
|
3812
|
+
),
|
|
3813
|
+
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(
|
|
3814
|
+
"li",
|
|
3815
|
+
{
|
|
3816
|
+
className: ce(
|
|
3817
|
+
"cursor-pointer rounded-ui px-2 py-1 text-sm font-bold transition-all hover:bg-primary/30",
|
|
3818
|
+
x === l && "bg-primary/50"
|
|
3819
|
+
),
|
|
3820
|
+
onClick: () => {
|
|
3821
|
+
s(x), f(!1);
|
|
3822
|
+
},
|
|
3823
|
+
children: b
|
|
3824
|
+
},
|
|
3825
|
+
x
|
|
3826
|
+
)) }) })
|
|
3827
|
+
]
|
|
3828
|
+
}
|
|
3829
|
+
),
|
|
3830
|
+
/* @__PURE__ */ i(
|
|
3831
|
+
"div",
|
|
3832
|
+
{
|
|
3833
|
+
className: ce(
|
|
3834
|
+
r,
|
|
3835
|
+
vr("top"),
|
|
3836
|
+
"w-full overflow-x-auto max-small:hidden"
|
|
3837
|
+
),
|
|
3838
|
+
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(
|
|
3839
|
+
Qe,
|
|
3840
|
+
{
|
|
3841
|
+
variant: x === l ? "fill" : "ghost",
|
|
3842
|
+
onClick: () => s(x),
|
|
3843
|
+
children: b
|
|
3844
|
+
},
|
|
3845
|
+
x
|
|
3846
|
+
)) })
|
|
3847
|
+
}
|
|
3848
|
+
)
|
|
3849
|
+
] });
|
|
3850
|
+
}, ln = () => {
|
|
3851
|
+
const {
|
|
3852
|
+
hideCategoriesNav: r,
|
|
3853
|
+
infiniteCarrousel: a,
|
|
3854
|
+
permanentGallery: l,
|
|
3855
|
+
extendBehavior: s
|
|
3856
|
+
} = $e(), {
|
|
3857
|
+
aspectRatioStyle: p,
|
|
3858
|
+
categories: { length: f }
|
|
3859
|
+
} = it(), {
|
|
3860
|
+
items: { length: E },
|
|
3861
|
+
slidable: e,
|
|
3862
|
+
carrouselItemIndex: x,
|
|
3863
|
+
masterItemIndex: b,
|
|
3864
|
+
prevItem: z,
|
|
3865
|
+
nextItem: y,
|
|
3866
|
+
showGalleryControls: h,
|
|
3867
|
+
enableHotspotsControl: o,
|
|
3868
|
+
showHotspots: L,
|
|
3869
|
+
toggleHotspots: A,
|
|
3870
|
+
showGallery: k,
|
|
3871
|
+
toggleGallery: m,
|
|
3872
|
+
extendMode: N,
|
|
3873
|
+
toggleExtendMode: w,
|
|
3874
|
+
shownDetails: d,
|
|
3875
|
+
isShowingDetails: C,
|
|
3876
|
+
resetShownDetails: I,
|
|
3877
|
+
showZoomControls: O,
|
|
3878
|
+
isZooming: M,
|
|
3879
|
+
canZoomIn: X,
|
|
3880
|
+
zoomIn: S,
|
|
3881
|
+
canZoomOut: V,
|
|
3882
|
+
zoomOut: te,
|
|
3883
|
+
resetView: W
|
|
3884
|
+
} = Ke(), T = j(
|
|
3885
|
+
(P) => {
|
|
3886
|
+
Ko(P) && I();
|
|
3887
|
+
},
|
|
3888
|
+
[I]
|
|
3889
|
+
);
|
|
3890
|
+
qo(I);
|
|
3891
|
+
const F = "absolute z-overlay";
|
|
3892
|
+
return /* @__PURE__ */ pe(at, { children: [
|
|
3893
|
+
!r && f > 1 && /* @__PURE__ */ i(
|
|
3894
|
+
sn,
|
|
3895
|
+
{
|
|
3896
|
+
sharedClassName: ce(
|
|
3897
|
+
F,
|
|
3898
|
+
"transition-opacity",
|
|
3899
|
+
M ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
3900
|
+
)
|
|
3901
|
+
}
|
|
3902
|
+
),
|
|
3903
|
+
e && !M && /* @__PURE__ */ i("div", { className: ce(F, ut("top-right")), children: /* @__PURE__ */ i(
|
|
3904
|
+
Jo,
|
|
3905
|
+
{
|
|
3906
|
+
currentIndex: x,
|
|
3907
|
+
maxIndex: E - 1
|
|
3908
|
+
}
|
|
3909
|
+
) }),
|
|
3910
|
+
e && /* @__PURE__ */ pe(at, { children: [
|
|
3911
|
+
/* @__PURE__ */ i(
|
|
3912
|
+
Qe,
|
|
3913
|
+
{
|
|
3914
|
+
shape: "icon",
|
|
3915
|
+
color: "neutral",
|
|
3916
|
+
className: ce(
|
|
3917
|
+
F,
|
|
3918
|
+
ut("middle-left"),
|
|
3919
|
+
M ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
3920
|
+
),
|
|
3921
|
+
onClick: z,
|
|
3922
|
+
disabled: !a && b <= 0,
|
|
3923
|
+
children: /* @__PURE__ */ i(Xe, { customizationKey: "CONTROLS_PREV", children: /* @__PURE__ */ i(Kt, { className: "size-full -scale-x-100" }) })
|
|
3924
|
+
}
|
|
3925
|
+
),
|
|
3926
|
+
/* @__PURE__ */ i(
|
|
3927
|
+
Qe,
|
|
3928
|
+
{
|
|
3929
|
+
shape: "icon",
|
|
3930
|
+
color: "neutral",
|
|
3931
|
+
className: ce(
|
|
3932
|
+
F,
|
|
3933
|
+
ut("middle-right"),
|
|
3934
|
+
M ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
3935
|
+
),
|
|
3936
|
+
onClick: y,
|
|
3937
|
+
disabled: !a && b >= E - 1,
|
|
3938
|
+
children: /* @__PURE__ */ i(Xe, { customizationKey: "CONTROLS_NEXT", children: /* @__PURE__ */ i(Kt, { className: "size-full" }) })
|
|
3939
|
+
}
|
|
3940
|
+
)
|
|
3941
|
+
] }),
|
|
3942
|
+
/* @__PURE__ */ pe(
|
|
3943
|
+
"div",
|
|
3944
|
+
{
|
|
3945
|
+
className: ce(
|
|
3946
|
+
F,
|
|
3947
|
+
ut("bottom-fullW"),
|
|
3948
|
+
"pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"
|
|
3949
|
+
),
|
|
3950
|
+
children: [
|
|
3951
|
+
!l && e && /* @__PURE__ */ pe(at, { children: [
|
|
3952
|
+
/* @__PURE__ */ i(
|
|
3953
|
+
Qe,
|
|
3954
|
+
{
|
|
3955
|
+
className: h && !M ? "opacity-100" : "!pointer-events-none opacity-0",
|
|
3956
|
+
variant: "fill",
|
|
3957
|
+
color: k ? "primary" : "neutral",
|
|
3958
|
+
shape: "icon",
|
|
3959
|
+
onClick: m,
|
|
3960
|
+
children: /* @__PURE__ */ i($o, { className: "size-full" })
|
|
3961
|
+
}
|
|
3962
|
+
),
|
|
3963
|
+
k && /* @__PURE__ */ i(
|
|
3964
|
+
Mr,
|
|
3965
|
+
{
|
|
3966
|
+
className: ce(
|
|
3967
|
+
"transition-opacity",
|
|
3968
|
+
h && !M ? "opacity-100" : "!pointer-events-none opacity-0",
|
|
3969
|
+
// Left & Right gradient mask to fade the gallery
|
|
3970
|
+
"[mask-image:linear-gradient(to_left,transparent_0px,black_4px,black_calc(100%-4px),transparent_100%)]"
|
|
3971
|
+
),
|
|
3972
|
+
containerClassName: "mx-1"
|
|
3973
|
+
}
|
|
3974
|
+
)
|
|
3975
|
+
] }),
|
|
3976
|
+
/* @__PURE__ */ pe("div", { className: "col-start-3 flex flex-col items-end gap-y-1 small:gap-y-2", children: [
|
|
3977
|
+
o && /* @__PURE__ */ i(
|
|
3978
|
+
nn,
|
|
3979
|
+
{
|
|
3980
|
+
className: ce(
|
|
3981
|
+
"transition-opacity",
|
|
3982
|
+
M ? "!pointer-events-none opacity-0" : "opacity-100"
|
|
3983
|
+
),
|
|
3984
|
+
enabled: L,
|
|
3985
|
+
onToggle: A,
|
|
3986
|
+
children: /* @__PURE__ */ i(en, { className: "size-full" })
|
|
3987
|
+
}
|
|
3988
|
+
),
|
|
3989
|
+
O && /* @__PURE__ */ pe("div", { className: "max-small:hidden", children: [
|
|
3990
|
+
/* @__PURE__ */ i(
|
|
3991
|
+
Qe,
|
|
3992
|
+
{
|
|
3993
|
+
className: "rounded-b-none",
|
|
3994
|
+
color: "neutral",
|
|
3995
|
+
shape: "icon",
|
|
3996
|
+
disabled: !X,
|
|
3997
|
+
onClick: S,
|
|
3998
|
+
children: /* @__PURE__ */ i(rn, { className: "size-full" })
|
|
3999
|
+
}
|
|
4000
|
+
),
|
|
4001
|
+
/* @__PURE__ */ i(Cr, { color: "background" }),
|
|
4002
|
+
/* @__PURE__ */ i(
|
|
4003
|
+
Qe,
|
|
4004
|
+
{
|
|
4005
|
+
className: "rounded-t-none",
|
|
4006
|
+
color: "neutral",
|
|
4007
|
+
shape: "icon",
|
|
4008
|
+
disabled: !V,
|
|
4009
|
+
onClick: te,
|
|
4010
|
+
children: /* @__PURE__ */ i(tn, { className: "size-full" })
|
|
4011
|
+
}
|
|
4012
|
+
)
|
|
4013
|
+
] }),
|
|
4014
|
+
s !== "none" && /* @__PURE__ */ i(
|
|
4015
|
+
Qe,
|
|
4016
|
+
{
|
|
4017
|
+
variant: "fill",
|
|
4018
|
+
color: N ? "primary" : "neutral",
|
|
4019
|
+
shape: "icon",
|
|
4020
|
+
onClick: w,
|
|
4021
|
+
children: N ? /* @__PURE__ */ i(on, { className: "size-full" }) : /* @__PURE__ */ i(Qo, { className: "size-full" })
|
|
4022
|
+
}
|
|
4023
|
+
)
|
|
4024
|
+
] })
|
|
4025
|
+
]
|
|
4026
|
+
}
|
|
4027
|
+
),
|
|
4028
|
+
/* @__PURE__ */ i(
|
|
4029
|
+
"div",
|
|
4030
|
+
{
|
|
4031
|
+
className: ce(
|
|
4032
|
+
F,
|
|
4033
|
+
"inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",
|
|
4034
|
+
C ? "opacity-100" : "pointer-events-none opacity-0"
|
|
4035
|
+
),
|
|
4036
|
+
onClick: T,
|
|
4037
|
+
children: /* @__PURE__ */ i(
|
|
4038
|
+
"div",
|
|
4039
|
+
{
|
|
4040
|
+
className: ce(
|
|
4041
|
+
"h-full w-3/5 bg-background transition-transform duration-details",
|
|
4042
|
+
C ? "translate-x-0" : "translate-x-full"
|
|
4043
|
+
),
|
|
4044
|
+
children: !!d && /* @__PURE__ */ pe(at, { children: [
|
|
4045
|
+
/* @__PURE__ */ i(
|
|
4046
|
+
pt,
|
|
4047
|
+
{
|
|
4048
|
+
className: "w-full bg-foreground/65",
|
|
4049
|
+
style: p,
|
|
4050
|
+
src: d.src,
|
|
4051
|
+
imgInPlayerWidthRatio: 0.6
|
|
4052
|
+
}
|
|
4053
|
+
),
|
|
4054
|
+
/* @__PURE__ */ pe(
|
|
4055
|
+
"div",
|
|
4056
|
+
{
|
|
4057
|
+
className: ce(
|
|
4058
|
+
"space-y-1 px-2 py-1 small:p-3",
|
|
4059
|
+
N && "large:p-4"
|
|
4060
|
+
),
|
|
4061
|
+
children: [
|
|
4062
|
+
d.title && /* @__PURE__ */ i(
|
|
4063
|
+
"span",
|
|
4064
|
+
{
|
|
4065
|
+
className: ce(
|
|
4066
|
+
"text-sm font-semibold small:text-base small:font-bold",
|
|
4067
|
+
N && "large:text-lg"
|
|
4068
|
+
),
|
|
4069
|
+
children: d.title
|
|
4070
|
+
}
|
|
4071
|
+
),
|
|
4072
|
+
d.text && /* @__PURE__ */ i(
|
|
4073
|
+
"p",
|
|
4074
|
+
{
|
|
4075
|
+
className: ce(
|
|
4076
|
+
"text-xs text-foreground/65 small:text-sm",
|
|
4077
|
+
N && "large:text-base"
|
|
4078
|
+
),
|
|
4079
|
+
children: d.text
|
|
4080
|
+
}
|
|
4081
|
+
)
|
|
4082
|
+
]
|
|
4083
|
+
}
|
|
4084
|
+
)
|
|
4085
|
+
] })
|
|
4086
|
+
}
|
|
4087
|
+
)
|
|
4088
|
+
}
|
|
4089
|
+
),
|
|
4090
|
+
(M || C) && /* @__PURE__ */ i(
|
|
4091
|
+
wr,
|
|
4092
|
+
{
|
|
4093
|
+
className: ce(F, ut("top-right")),
|
|
4094
|
+
onClick: W
|
|
4095
|
+
}
|
|
4096
|
+
)
|
|
4097
|
+
] });
|
|
4098
|
+
}, cn = ({ className: r = "" }) => {
|
|
4099
|
+
const { infiniteCarrousel: a, preloadRange: l, isFullScreen: s } = $e(), { aspectRatioStyle: p } = it(), {
|
|
4100
|
+
items: f,
|
|
4101
|
+
slidable: E,
|
|
4102
|
+
carrouselItemIndex: e,
|
|
4103
|
+
setCarrouselItemIndex: x,
|
|
4104
|
+
itemIndexCommand: b,
|
|
4105
|
+
setItemIndexCommand: z,
|
|
4106
|
+
specialCommand: y,
|
|
4107
|
+
isRunningSpecialCommand: h,
|
|
4108
|
+
finishSpecialCommand: o,
|
|
4109
|
+
extendMode: L,
|
|
4110
|
+
extendTransition: A
|
|
4111
|
+
} = Ke(), k = Ie(null), m = j((T) => {
|
|
4112
|
+
if (!k.current)
|
|
4113
|
+
throw new Error(`[${T ?? "sliderOrThrow"}] slider.current is null`);
|
|
4114
|
+
return k.current;
|
|
4115
|
+
}, []), N = Ie(!1), w = Ie(null), d = Ie(null), C = Ie(null), I = j(() => {
|
|
4116
|
+
C.current && cancelAnimationFrame(C.current);
|
|
4117
|
+
}, []), O = j(() => {
|
|
4118
|
+
const T = m("computeClosestSnapIndex"), F = Array.from(T.children), P = T.scrollLeft;
|
|
4119
|
+
return F.reduce(
|
|
4120
|
+
(J, me, xe) => {
|
|
4121
|
+
const Pe = me.offsetLeft;
|
|
4122
|
+
return Math.abs(Pe - P) < Math.abs(F[J].offsetLeft - P) ? xe : J;
|
|
4123
|
+
},
|
|
4124
|
+
0
|
|
4125
|
+
);
|
|
4126
|
+
}, [m]), M = j(
|
|
4127
|
+
(T) => {
|
|
4128
|
+
const F = m("setStyleCursor");
|
|
4129
|
+
F.style.cursor = T;
|
|
4130
|
+
},
|
|
4131
|
+
[m]
|
|
4132
|
+
), X = j(
|
|
4133
|
+
(T) => {
|
|
4134
|
+
const F = m("setStyleSnapState");
|
|
4135
|
+
T === "mandatory" ? F.style.scrollSnapType = "x mandatory" : F.style.scrollSnapType = "none";
|
|
4136
|
+
},
|
|
4137
|
+
[m]
|
|
4138
|
+
), S = j(
|
|
4139
|
+
(T, F, P) => {
|
|
4140
|
+
I();
|
|
4141
|
+
const B = m("scrollToIndex"), J = Array.from(B.children), me = B.scrollLeft, xe = J[T].offsetLeft, Pe = (ze) => {
|
|
4142
|
+
B.scrollTo({
|
|
4143
|
+
left: ze,
|
|
4144
|
+
behavior: "instant"
|
|
4145
|
+
});
|
|
4146
|
+
}, ne = () => {
|
|
4147
|
+
Pe(xe), X("mandatory"), P?.();
|
|
4148
|
+
}, re = Math.abs(me - xe);
|
|
4149
|
+
if (re < 1 || F === "instant") {
|
|
4150
|
+
ne();
|
|
4151
|
+
return;
|
|
4152
|
+
}
|
|
4153
|
+
const G = tt(re / 2.5, 300, 1e3), ve = (/* @__PURE__ */ new Date()).getTime();
|
|
4154
|
+
X("none");
|
|
4155
|
+
const H = () => {
|
|
4156
|
+
const ze = () => {
|
|
4157
|
+
const Re = (/* @__PURE__ */ new Date()).getTime() - ve;
|
|
4158
|
+
if (Re >= G) {
|
|
4159
|
+
ne();
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
const Be = Math.min(Re / G, 1), Ze = Lr(Be), Oe = yt(me, xe, Ze);
|
|
4163
|
+
Pe(Oe), H();
|
|
4164
|
+
};
|
|
4165
|
+
C.current = requestAnimationFrame(ze);
|
|
4166
|
+
};
|
|
4167
|
+
H();
|
|
4168
|
+
},
|
|
4169
|
+
[I, m, X]
|
|
4170
|
+
), [V, te] = Le(), W = !!V;
|
|
4171
|
+
return fe(() => {
|
|
4172
|
+
const T = () => {
|
|
4173
|
+
clearTimeout(V);
|
|
4174
|
+
const F = setTimeout(() => {
|
|
4175
|
+
te(void 0);
|
|
4176
|
+
}, pr);
|
|
4177
|
+
te(F);
|
|
4178
|
+
};
|
|
4179
|
+
return addEventListener("resize", T), document.addEventListener("fullscreenchange", T), () => {
|
|
4180
|
+
removeEventListener("resize", T), document.removeEventListener("fullscreenchange", T);
|
|
4181
|
+
};
|
|
4182
|
+
}, [V]), fe(() => {
|
|
4183
|
+
if (y)
|
|
4184
|
+
return;
|
|
4185
|
+
const T = O();
|
|
4186
|
+
Number.isNaN(T) || T !== e && S(e, "instant");
|
|
4187
|
+
}, [
|
|
4188
|
+
e,
|
|
4189
|
+
O,
|
|
4190
|
+
S,
|
|
4191
|
+
y,
|
|
4192
|
+
// - Run the effect when those values change
|
|
4193
|
+
f,
|
|
4194
|
+
V,
|
|
4195
|
+
s,
|
|
4196
|
+
L,
|
|
4197
|
+
A
|
|
4198
|
+
]), fe(() => {
|
|
4199
|
+
if (!E || h) {
|
|
4200
|
+
M("auto");
|
|
4201
|
+
return;
|
|
4202
|
+
}
|
|
4203
|
+
const T = k.current;
|
|
4204
|
+
if (!T)
|
|
4205
|
+
return;
|
|
4206
|
+
M("grab"), X("mandatory");
|
|
4207
|
+
const F = (J) => {
|
|
4208
|
+
J.button === 0 && (J.preventDefault(), J.stopPropagation(), I(), N.current = !0, w.current = J.pageX - T.offsetLeft, d.current = T.scrollLeft, M("grabbing"));
|
|
4209
|
+
}, P = (J) => {
|
|
4210
|
+
if (!N.current)
|
|
4211
|
+
return;
|
|
4212
|
+
if (w.current === null)
|
|
4213
|
+
throw new Error("[onMouseMove] startX is null");
|
|
4214
|
+
X("none");
|
|
4215
|
+
const xe = J.pageX - T.offsetLeft - w.current;
|
|
4216
|
+
requestAnimationFrame(() => {
|
|
4217
|
+
if (d.current === null)
|
|
4218
|
+
throw new Error("[onMouseMove] scrollLeft is null");
|
|
4219
|
+
T.scrollLeft = d.current - xe;
|
|
4220
|
+
});
|
|
4221
|
+
}, B = () => {
|
|
4222
|
+
if (!N.current)
|
|
4223
|
+
return;
|
|
4224
|
+
N.current = !1, M("grab");
|
|
4225
|
+
const J = O();
|
|
4226
|
+
S(J, "smooth");
|
|
4227
|
+
};
|
|
4228
|
+
return T.addEventListener("mousedown", F), document.addEventListener("mousemove", P), document.addEventListener("mouseleave", B), document.addEventListener("mouseup", B), document.addEventListener("contextmenu", B), () => {
|
|
4229
|
+
T.removeEventListener("mousedown", F), document.removeEventListener("mousemove", P), document.removeEventListener("mouseleave", B), document.removeEventListener("mouseup", B), document.removeEventListener("contextmenu", B);
|
|
4230
|
+
};
|
|
4231
|
+
}, [
|
|
4232
|
+
I,
|
|
4233
|
+
O,
|
|
4234
|
+
h,
|
|
4235
|
+
S,
|
|
4236
|
+
M,
|
|
4237
|
+
X,
|
|
4238
|
+
E
|
|
4239
|
+
]), fe(() => {
|
|
4240
|
+
if (A || W)
|
|
4241
|
+
return;
|
|
4242
|
+
const T = k.current;
|
|
4243
|
+
if (!T)
|
|
4244
|
+
return;
|
|
4245
|
+
const F = () => {
|
|
4246
|
+
const P = O();
|
|
4247
|
+
Number.isNaN(P) || (x(P), P === b && z(null));
|
|
4248
|
+
};
|
|
4249
|
+
return T.addEventListener("scroll", F), () => {
|
|
4250
|
+
T.removeEventListener("scroll", F);
|
|
4251
|
+
};
|
|
4252
|
+
}, [
|
|
4253
|
+
O,
|
|
4254
|
+
A,
|
|
4255
|
+
W,
|
|
4256
|
+
b,
|
|
4257
|
+
x,
|
|
4258
|
+
z
|
|
4259
|
+
]), fe(() => {
|
|
4260
|
+
if (b === null)
|
|
4261
|
+
return;
|
|
4262
|
+
const T = () => {
|
|
4263
|
+
setTimeout(() => {
|
|
4264
|
+
z(null), o();
|
|
4265
|
+
}, 75);
|
|
4266
|
+
};
|
|
4267
|
+
switch (y) {
|
|
4268
|
+
case "first_to_last":
|
|
4269
|
+
S(f.length - 1, "instant", T);
|
|
4270
|
+
break;
|
|
4271
|
+
case "last_to_first":
|
|
4272
|
+
S(0, "instant", T);
|
|
4273
|
+
break;
|
|
4274
|
+
case "instant":
|
|
4275
|
+
S(b, "instant", T);
|
|
4276
|
+
break;
|
|
4277
|
+
default:
|
|
4278
|
+
S(b, "smooth");
|
|
4279
|
+
break;
|
|
4280
|
+
}
|
|
4281
|
+
}, [
|
|
4282
|
+
y,
|
|
4283
|
+
o,
|
|
4284
|
+
b,
|
|
4285
|
+
f.length,
|
|
4286
|
+
S,
|
|
4287
|
+
z
|
|
4288
|
+
]), /* @__PURE__ */ pe(
|
|
4289
|
+
"div",
|
|
4290
|
+
{
|
|
4291
|
+
className: ce(
|
|
4292
|
+
"relative overflow-hidden rounded-carrousel transition-radius",
|
|
4293
|
+
r
|
|
4294
|
+
),
|
|
4295
|
+
style: p,
|
|
4296
|
+
children: [
|
|
4297
|
+
/* @__PURE__ */ i(
|
|
4298
|
+
"div",
|
|
4299
|
+
{
|
|
4300
|
+
ref: k,
|
|
4301
|
+
className: `flex size-full ${E ? "overflow-x-auto no-scrollbar *:snap-start *:snap-always" : "justify-center"}`,
|
|
4302
|
+
children: f.map((T, F) => {
|
|
4303
|
+
const P = F === e, B = F === 0, J = F === f.length - 1, me = (() => {
|
|
4304
|
+
if (y === "first_to_last" && B)
|
|
4305
|
+
return {
|
|
4306
|
+
transform: `translateX(${100 * f.length}%)`
|
|
4307
|
+
};
|
|
4308
|
+
if (y === "last_to_first" && J)
|
|
4309
|
+
return {
|
|
4310
|
+
transform: `translateX(-${100 * f.length}%)`
|
|
4311
|
+
};
|
|
4312
|
+
})();
|
|
4313
|
+
let xe = Math.abs(F - e) <= l;
|
|
4314
|
+
xe ||= F === b, a && (xe ||= e < l && f.length - F <= l - e, xe ||= e >= f.length - l && F <= l - (f.length - e));
|
|
4315
|
+
const Pe = (() => {
|
|
4316
|
+
let ne;
|
|
4317
|
+
switch (T.type) {
|
|
4318
|
+
case "360":
|
|
4319
|
+
ne = T.images[0].src;
|
|
4320
|
+
break;
|
|
4321
|
+
case "interior-360":
|
|
4322
|
+
ne = T.poster ?? "interior-360";
|
|
4323
|
+
break;
|
|
4324
|
+
case "image":
|
|
4325
|
+
ne = T.src;
|
|
4326
|
+
break;
|
|
4327
|
+
case "video":
|
|
4328
|
+
ne = T.poster ?? "video";
|
|
4329
|
+
break;
|
|
4330
|
+
case "custom":
|
|
4331
|
+
ne = "custom";
|
|
4332
|
+
break;
|
|
4333
|
+
default:
|
|
4334
|
+
ne = "unknown";
|
|
4335
|
+
}
|
|
4336
|
+
return `${F}_${ne}`;
|
|
4337
|
+
})();
|
|
4338
|
+
return /* @__PURE__ */ i(
|
|
4339
|
+
"div",
|
|
4340
|
+
{
|
|
4341
|
+
className: ce(
|
|
4342
|
+
"h-full bg-foreground/35",
|
|
4343
|
+
e === F && "z-1"
|
|
4344
|
+
// Give high-ground to the shown item (to avoid 1px vertical line)
|
|
4345
|
+
),
|
|
4346
|
+
style: { ...p, ...me },
|
|
4347
|
+
children: xe && /* @__PURE__ */ i(jo, { index: F, item: T, isShown: P })
|
|
4348
|
+
},
|
|
4349
|
+
Pe
|
|
4350
|
+
);
|
|
4351
|
+
})
|
|
4352
|
+
}
|
|
4353
|
+
),
|
|
4354
|
+
/* @__PURE__ */ i(ln, {})
|
|
4355
|
+
]
|
|
4356
|
+
}
|
|
4357
|
+
);
|
|
4358
|
+
}, un = () => {
|
|
4359
|
+
const { permanentGallery: r } = $e(), { aspectRatioStyle: a } = it(), {
|
|
4360
|
+
prevItem: l,
|
|
4361
|
+
nextItem: s,
|
|
4362
|
+
isShowingDetails: p,
|
|
4363
|
+
resetShownDetails: f,
|
|
4364
|
+
extendMode: E,
|
|
4365
|
+
disableExtendMode: e,
|
|
4366
|
+
isZooming: x,
|
|
4367
|
+
resetZoom: b,
|
|
4368
|
+
fakeFullScreen: z
|
|
4369
|
+
} = Ke(), y = Ie(null), h = Ie(null), o = Ie(null);
|
|
4370
|
+
return fe(() => {
|
|
4371
|
+
if (!E)
|
|
4372
|
+
return;
|
|
4373
|
+
const L = y.current, A = h.current, k = o.current;
|
|
4374
|
+
if (!L || !A || !k)
|
|
4375
|
+
return;
|
|
4376
|
+
let m = !1;
|
|
4377
|
+
const N = (C) => [L, A, k].includes(C.target), w = (C) => {
|
|
4378
|
+
m = N(C);
|
|
4379
|
+
}, d = (C) => {
|
|
4380
|
+
m && (N(C) && e(), m = !1);
|
|
4381
|
+
};
|
|
4382
|
+
return L.addEventListener("mousedown", w), L.addEventListener("mouseup", d), () => {
|
|
4383
|
+
L.removeEventListener("mousedown", w), L.removeEventListener("mouseup", d);
|
|
4384
|
+
};
|
|
4385
|
+
}, [e, E]), fe(() => {
|
|
4386
|
+
const L = (A) => {
|
|
4387
|
+
A.key === "Escape" && (x ? b() : p ? f() : e());
|
|
4388
|
+
};
|
|
4389
|
+
return addEventListener("keydown", L), () => {
|
|
4390
|
+
removeEventListener("keydown", L);
|
|
4391
|
+
};
|
|
4392
|
+
}, [
|
|
4393
|
+
e,
|
|
4394
|
+
p,
|
|
4395
|
+
x,
|
|
4396
|
+
s,
|
|
4397
|
+
l,
|
|
4398
|
+
f,
|
|
4399
|
+
b
|
|
4400
|
+
]), /* @__PURE__ */ pe(
|
|
4401
|
+
"div",
|
|
4402
|
+
{
|
|
4403
|
+
ref: y,
|
|
4404
|
+
className: ce(
|
|
4405
|
+
"relative",
|
|
4406
|
+
E && "flex size-full items-center justify-center",
|
|
4407
|
+
z && "fixed inset-0 z-overlay bg-foreground/75"
|
|
4408
|
+
),
|
|
4409
|
+
children: [
|
|
4410
|
+
/* @__PURE__ */ pe(
|
|
4411
|
+
"div",
|
|
4412
|
+
{
|
|
4413
|
+
ref: h,
|
|
4414
|
+
className: E ? "flex size-full flex-col justify-center gap-y-2 small:gap-y-4" : "space-y-2",
|
|
4415
|
+
children: [
|
|
4416
|
+
/* @__PURE__ */ i(
|
|
4417
|
+
"div",
|
|
4418
|
+
{
|
|
4419
|
+
ref: o,
|
|
4420
|
+
className: ce(
|
|
4421
|
+
E && "mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"
|
|
4422
|
+
),
|
|
4423
|
+
style: a,
|
|
4424
|
+
children: /* @__PURE__ */ i(cn, { className: ce(E && "h-full min-w-0") })
|
|
4425
|
+
}
|
|
4426
|
+
),
|
|
4427
|
+
r && /* @__PURE__ */ i(Mr, { className: ce(E && "my-2 shrink-0 small:my-4") })
|
|
4428
|
+
]
|
|
4429
|
+
}
|
|
4430
|
+
),
|
|
4431
|
+
E && /* @__PURE__ */ i(
|
|
4432
|
+
wr,
|
|
4433
|
+
{
|
|
4434
|
+
className: "absolute right-2 top-2 small:right-4 small:top-4",
|
|
4435
|
+
onClick: e
|
|
4436
|
+
}
|
|
4437
|
+
)
|
|
4438
|
+
]
|
|
4439
|
+
}
|
|
4440
|
+
);
|
|
4441
|
+
}, dn = () => {
|
|
4442
|
+
const { emitEvent: r, compositionUrl: a } = $e(), {
|
|
4443
|
+
data: l,
|
|
4444
|
+
status: s,
|
|
4445
|
+
isSuccess: p,
|
|
4446
|
+
error: f
|
|
4447
|
+
} = eo(a);
|
|
4448
|
+
return fe(() => {
|
|
4449
|
+
f ? r(tr, f) : s === "fetching" ? r($t, a) : p && r(er, l);
|
|
4450
|
+
}, [l, a, r, f, p, s]), f ? /* @__PURE__ */ i(
|
|
4451
|
+
Nt,
|
|
4452
|
+
{
|
|
4453
|
+
className: "aspect-square text-foreground/70",
|
|
4454
|
+
text: "Player could not be loaded"
|
|
4455
|
+
}
|
|
4456
|
+
) : 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: [
|
|
4457
|
+
/* @__PURE__ */ i("div", { className: "animate-pulse text-xl", children: "Loading Player" }),
|
|
4458
|
+
/* @__PURE__ */ i(xr, { color: "foreground" })
|
|
4459
|
+
] });
|
|
4460
|
+
}, pn = ({
|
|
4461
|
+
compositionUrl: r,
|
|
4462
|
+
hideCategoriesNav: a = Fr,
|
|
4463
|
+
infiniteCarrousel: l = Ur,
|
|
4464
|
+
permanentGallery: s = Vr,
|
|
4465
|
+
mediaLoadStrategy: p = Br,
|
|
4466
|
+
minMediaWidth: f = Wr,
|
|
4467
|
+
maxMediaWidth: E = Xr,
|
|
4468
|
+
preloadRange: e = Yr,
|
|
4469
|
+
autoLoad360: x = Zr,
|
|
4470
|
+
autoLoadInterior360: b = Gr,
|
|
4471
|
+
categoriesFilter: z = jr,
|
|
4472
|
+
extendBehavior: y = qr,
|
|
4473
|
+
eventPrefix: h = cr,
|
|
4474
|
+
demoSpin: o = Kr,
|
|
4475
|
+
reverse360: L = Jr,
|
|
4476
|
+
children: A
|
|
4477
|
+
// NOTE: use to customize the player, not to display the content
|
|
4478
|
+
}) => {
|
|
4479
|
+
const k = Ie(null), [m, N] = Le(0.5), [w, d] = Le(!1), C = j(
|
|
4480
|
+
(M, X) => {
|
|
4481
|
+
const S = h + M, V = new CustomEvent(S, { detail: X });
|
|
4482
|
+
document.dispatchEvent(V);
|
|
4483
|
+
},
|
|
4484
|
+
[h]
|
|
4485
|
+
);
|
|
4486
|
+
fe(() => {
|
|
4487
|
+
if (w) {
|
|
4488
|
+
N(1);
|
|
4489
|
+
return;
|
|
4490
|
+
}
|
|
4491
|
+
if (!k.current)
|
|
4492
|
+
return;
|
|
4493
|
+
const M = k.current, X = () => {
|
|
4494
|
+
const S = window.innerWidth, V = M.clientWidth;
|
|
4495
|
+
N(V / S);
|
|
4496
|
+
};
|
|
4497
|
+
return X(), addEventListener("resize", X), () => {
|
|
4498
|
+
removeEventListener("resize", X);
|
|
4499
|
+
};
|
|
4500
|
+
}, [w]), fe(() => {
|
|
4501
|
+
if (y !== "full_screen")
|
|
4502
|
+
return;
|
|
4503
|
+
const M = k.current;
|
|
4504
|
+
if (!M)
|
|
4505
|
+
throw new Error("Wrapper not found");
|
|
4506
|
+
const X = () => {
|
|
4507
|
+
const { fullscreenElement: S } = document;
|
|
4508
|
+
d(
|
|
4509
|
+
S === M || // NOTE: For custom element, the web browser is making the whole custom element full-screen and not only the wrapper
|
|
4510
|
+
S?.localName === St
|
|
4511
|
+
);
|
|
4512
|
+
};
|
|
4513
|
+
return document.addEventListener("fullscreenchange", X), () => {
|
|
4514
|
+
document.removeEventListener("fullscreenchange", X);
|
|
4515
|
+
};
|
|
4516
|
+
}, [y]);
|
|
4517
|
+
const I = j(async () => {
|
|
4518
|
+
const M = k.current;
|
|
4519
|
+
if (!M)
|
|
4520
|
+
throw new Error("Wrapper not found");
|
|
4521
|
+
try {
|
|
4522
|
+
return await M.requestFullscreen(), !0;
|
|
4523
|
+
} catch {
|
|
4524
|
+
return !1;
|
|
4525
|
+
}
|
|
4526
|
+
}, []), O = j(async () => {
|
|
4527
|
+
try {
|
|
4528
|
+
return await document.exitFullscreen(), !0;
|
|
4529
|
+
} catch {
|
|
4530
|
+
return !1;
|
|
4531
|
+
}
|
|
4532
|
+
}, []);
|
|
4533
|
+
return /* @__PURE__ */ i(
|
|
4534
|
+
to,
|
|
4535
|
+
{
|
|
4536
|
+
compositionUrl: r,
|
|
4537
|
+
hideCategoriesNav: a,
|
|
4538
|
+
infiniteCarrousel: l,
|
|
4539
|
+
permanentGallery: s,
|
|
4540
|
+
mediaLoadStrategy: p,
|
|
4541
|
+
minMediaWidth: f,
|
|
4542
|
+
maxMediaWidth: E,
|
|
4543
|
+
preloadRange: e,
|
|
4544
|
+
categoriesFilter: z,
|
|
4545
|
+
autoLoad360: x,
|
|
4546
|
+
autoLoadInterior360: b,
|
|
4547
|
+
extendBehavior: y,
|
|
4548
|
+
demoSpin: o,
|
|
4549
|
+
reverse360: L,
|
|
4550
|
+
emitEvent: C,
|
|
4551
|
+
playerInViewportWidthRatio: m,
|
|
4552
|
+
isFullScreen: w,
|
|
4553
|
+
requestFullscreen: I,
|
|
4554
|
+
exitFullscreen: O,
|
|
4555
|
+
children: /* @__PURE__ */ pe(oo, { children: [
|
|
4556
|
+
/* @__PURE__ */ i(
|
|
4557
|
+
"div",
|
|
4558
|
+
{
|
|
4559
|
+
ref: k,
|
|
4560
|
+
className: "select-none text-foreground",
|
|
4561
|
+
style: {
|
|
4562
|
+
"--background": "var(--cc-webplayer-background, 0 0% 100%)",
|
|
4563
|
+
"--foreground": "var(--cc-webplayer-foreground, 240 10% 3.9%)",
|
|
4564
|
+
"--primary": "var(--cc-webplayer-primary, 216 100% 52%)",
|
|
4565
|
+
"--primary-foreground": "var(--cc-webplayer-primary-foreground, var(--background))",
|
|
4566
|
+
"--primary-light": "var(--cc-webplayer-primary-light, var(--primary))",
|
|
4567
|
+
"--neutral": "var(--cc-webplayer-neutral, 0 0% 39%)",
|
|
4568
|
+
"--neutral-foreground": "var(--cc-webplayer-neutral-foreground, var(--foreground))",
|
|
4569
|
+
"--radius-ui": "var(--cc-webplayer-radius-ui, 16px)",
|
|
4570
|
+
"--radius-carrousel": "var(--cc-webplayer-radius-carrousel, 0)",
|
|
4571
|
+
"--radius-gallery": "var(--cc-webplayer-radius-gallery, 0)"
|
|
4572
|
+
},
|
|
4573
|
+
children: /* @__PURE__ */ i(dn, {})
|
|
4574
|
+
}
|
|
4575
|
+
),
|
|
4576
|
+
A
|
|
4577
|
+
] })
|
|
4578
|
+
}
|
|
4579
|
+
);
|
|
4580
|
+
}, hn = ({ children: r, index: a, thumbnailSrc: l }) => {
|
|
4581
|
+
const { registerCustomMedia: s, unregisterCustomMedia: p } = ft();
|
|
4582
|
+
return fe(() => {
|
|
4583
|
+
if (!r)
|
|
4584
|
+
return;
|
|
4585
|
+
const f = s({
|
|
4586
|
+
Media: r,
|
|
4587
|
+
index: a,
|
|
4588
|
+
thumbnailSrc: l
|
|
4589
|
+
});
|
|
4590
|
+
return () => {
|
|
4591
|
+
p(f);
|
|
4592
|
+
};
|
|
4593
|
+
}, [r, p, a, s, l]), null;
|
|
4594
|
+
}, Mn = (r) => _t() ? /* @__PURE__ */ i(hn, { ...r }) : /* @__PURE__ */ i("slot", {}), fn = ({ name: r, children: a }) => {
|
|
4595
|
+
const { registerIconConfig: l, unregisterIconConfig: s } = ft();
|
|
4596
|
+
return fe(() => {
|
|
4597
|
+
if (a)
|
|
4598
|
+
return l(r, {
|
|
4599
|
+
Icon: a
|
|
4600
|
+
}), () => {
|
|
4601
|
+
s(r);
|
|
4602
|
+
};
|
|
4603
|
+
}, [a, r, l, s]), null;
|
|
4604
|
+
}, 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}}`;
|
|
4605
|
+
function gn(r) {
|
|
4606
|
+
return r.replace(
|
|
4607
|
+
/([a-z0-9])([A-Z])/g,
|
|
4608
|
+
(a, l, s) => `${l}-${s.toLowerCase()}`
|
|
4609
|
+
);
|
|
4610
|
+
}
|
|
4611
|
+
function zt(r) {
|
|
4612
|
+
return Object.entries(r).reduce((a, [l, s]) => {
|
|
4613
|
+
if (s !== void 0) {
|
|
4614
|
+
const p = gn(l);
|
|
4615
|
+
a[p] = s.toString();
|
|
4616
|
+
}
|
|
4617
|
+
return a;
|
|
4618
|
+
}, {});
|
|
4619
|
+
}
|
|
4620
|
+
const kn = (r) => /* @__PURE__ */ pe(at, { children: [
|
|
4621
|
+
/* @__PURE__ */ i("style", { children: mn }),
|
|
4622
|
+
/* @__PURE__ */ i(pn, { ...r })
|
|
4623
|
+
] }), vn = (r) => zt(r), wn = (r) => zt(r), xn = (r) => zt(r), In = ({
|
|
4624
|
+
onCompositionLoading: r,
|
|
4625
|
+
onCompositionLoaded: a,
|
|
4626
|
+
onCompositionLoadError: l,
|
|
4627
|
+
onItemChange: s,
|
|
4628
|
+
onExtendModeOn: p,
|
|
4629
|
+
onExtendModeOff: f,
|
|
4630
|
+
onHotspotsOn: E,
|
|
4631
|
+
onHotspotsOff: e,
|
|
4632
|
+
onGalleryOpen: x,
|
|
4633
|
+
onGalleryClose: b,
|
|
4634
|
+
className: z,
|
|
4635
|
+
style: y = {},
|
|
4636
|
+
children: h,
|
|
4637
|
+
...o
|
|
4638
|
+
}) => {
|
|
4639
|
+
const L = et(() => {
|
|
4640
|
+
const A = vn(o);
|
|
4641
|
+
return z && Object.assign(A, { class: z }), A;
|
|
4642
|
+
}, [z, o]);
|
|
4643
|
+
return fe(() => {
|
|
4644
|
+
const A = o.eventPrefix ?? cr, k = (w) => `${A}${w}`, m = {
|
|
4645
|
+
[$t]: r,
|
|
4646
|
+
[er]: a,
|
|
4647
|
+
[tr]: l,
|
|
4648
|
+
[rr]: s,
|
|
4649
|
+
[or]: p,
|
|
4650
|
+
[nr]: f,
|
|
4651
|
+
[ar]: E,
|
|
4652
|
+
[ir]: e,
|
|
4653
|
+
[sr]: x,
|
|
4654
|
+
[lr]: b
|
|
4655
|
+
}, N = /* @__PURE__ */ new Map();
|
|
4656
|
+
return Object.entries(m).forEach(([w, d]) => {
|
|
4657
|
+
if (!d)
|
|
4658
|
+
return;
|
|
4659
|
+
const C = k(w), I = (O) => d(O.detail);
|
|
4660
|
+
N.set(C, I), document.addEventListener(C, I);
|
|
4661
|
+
}), () => {
|
|
4662
|
+
N.forEach((w, d) => {
|
|
4663
|
+
document.removeEventListener(d, w);
|
|
4664
|
+
});
|
|
4665
|
+
};
|
|
4666
|
+
}, [
|
|
4667
|
+
o.eventPrefix,
|
|
4668
|
+
r,
|
|
4669
|
+
a,
|
|
4670
|
+
l,
|
|
4671
|
+
s,
|
|
4672
|
+
p,
|
|
4673
|
+
f,
|
|
4674
|
+
E,
|
|
4675
|
+
e,
|
|
4676
|
+
x,
|
|
4677
|
+
b
|
|
4678
|
+
]), /* @__PURE__ */ i("cc-webplayer", { style: { display: "block", ...y }, ...L, children: h });
|
|
4679
|
+
}, Tn = ({ children: r, ...a }) => {
|
|
4680
|
+
const l = wn(a);
|
|
4681
|
+
return /* @__PURE__ */ i("cc-webplayer-custom-media", { ...l, children: r });
|
|
4682
|
+
}, Pn = ({
|
|
4683
|
+
children: r,
|
|
4684
|
+
...a
|
|
4685
|
+
}) => {
|
|
4686
|
+
const l = xn(a);
|
|
4687
|
+
return /* @__PURE__ */ i("cc-webplayer-icon", { ...l, children: r });
|
|
4688
|
+
};
|
|
4689
|
+
export {
|
|
4690
|
+
cr as D,
|
|
4691
|
+
$t as E,
|
|
4692
|
+
kn as W,
|
|
4693
|
+
Mn as a,
|
|
4694
|
+
Ln as b,
|
|
4695
|
+
Cn as c,
|
|
4696
|
+
St as d,
|
|
4697
|
+
Jt as e,
|
|
4698
|
+
Qt as f,
|
|
4699
|
+
In as g,
|
|
4700
|
+
Tn as h,
|
|
4701
|
+
Pn as i,
|
|
4702
|
+
er as j,
|
|
4703
|
+
tr as k,
|
|
4704
|
+
rr as l,
|
|
4705
|
+
or as m,
|
|
4706
|
+
nr as n,
|
|
4707
|
+
ar as o,
|
|
4708
|
+
ir as p,
|
|
4709
|
+
sr as q,
|
|
4710
|
+
lr as r,
|
|
4711
|
+
En as s
|
|
4712
|
+
};
|