@virtualdisplay.io/client 4.0.0-alpha.33 → 4.0.0-alpha.35
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.
|
@@ -222,48 +222,46 @@ var ue = class {
|
|
|
222
222
|
"en",
|
|
223
223
|
"nl",
|
|
224
224
|
"de"
|
|
225
|
-
],
|
|
226
|
-
globalThis.__paraglide = globalThis.__paraglide ?? {}
|
|
227
|
-
var
|
|
228
|
-
let e = h;
|
|
229
|
-
|
|
230
|
-
let t = _e(e, typeof window < "u" ? window.location?.href : void 0);
|
|
231
|
-
if (t) return ge || (_ = t, ge = !0, ye(t, { reload: !1 })), t;
|
|
225
|
+
], h = ["globalVariable", "baseLocale"], g = [], _ = typeof window > "u";
|
|
226
|
+
globalThis.__paraglide = globalThis.__paraglide ?? {};
|
|
227
|
+
var v, me = !1, y = () => {
|
|
228
|
+
let e = !_ && g.length > 0 && typeof window < "u" ? window.location?.href : void 0, t = he(e ? Me(e) : h, e);
|
|
229
|
+
if (t) return me || (v = t, me = !0, _e(t, { reload: !1 })), t;
|
|
232
230
|
throw Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
233
231
|
};
|
|
234
|
-
function
|
|
232
|
+
function he(e, t) {
|
|
235
233
|
let n;
|
|
236
234
|
for (let t of e) {
|
|
237
235
|
if (t === "baseLocale") n = "en";
|
|
238
|
-
else if (t === "globalVariable" &&
|
|
239
|
-
else if (
|
|
240
|
-
let e =
|
|
236
|
+
else if (t === "globalVariable" && v !== void 0) n = v;
|
|
237
|
+
else if (Ne(t) && S.has(t)) {
|
|
238
|
+
let e = S.get(t);
|
|
241
239
|
if (e) {
|
|
242
240
|
let t = e.getLocale();
|
|
243
241
|
if (t instanceof Promise) continue;
|
|
244
242
|
if (t !== void 0) return xe(t);
|
|
245
243
|
}
|
|
246
244
|
}
|
|
247
|
-
let e =
|
|
245
|
+
let e = b(n);
|
|
248
246
|
if (e) return e;
|
|
249
247
|
}
|
|
250
248
|
}
|
|
251
|
-
var
|
|
249
|
+
var ge = (e) => {
|
|
252
250
|
e ? window.location.href = e : window.location.reload();
|
|
253
|
-
},
|
|
251
|
+
}, _e = (e, t) => {
|
|
254
252
|
let n = {
|
|
255
253
|
reload: !0,
|
|
256
254
|
...t
|
|
257
255
|
}, r;
|
|
258
256
|
try {
|
|
259
|
-
r =
|
|
257
|
+
r = y();
|
|
260
258
|
} catch {}
|
|
261
259
|
let i = [], a = h;
|
|
262
|
-
!
|
|
263
|
-
for (let t of a) if (t === "globalVariable")
|
|
260
|
+
!_ && typeof window < "u" && window.location?.href && (a = Me(window.location.href));
|
|
261
|
+
for (let t of a) if (t === "globalVariable") v = e;
|
|
264
262
|
else if (t === "baseLocale") continue;
|
|
265
|
-
else if (
|
|
266
|
-
let n =
|
|
263
|
+
else if (Ne(t) && S.has(t)) {
|
|
264
|
+
let n = S.get(t);
|
|
267
265
|
if (n) {
|
|
268
266
|
let r = n.setLocale(e);
|
|
269
267
|
r instanceof Promise && (r = r.catch((e) => {
|
|
@@ -272,24 +270,30 @@ var ve = (e) => {
|
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
let o = () => {
|
|
275
|
-
!
|
|
273
|
+
!_ && n.reload && window.location && e !== r && ge(void 0);
|
|
276
274
|
};
|
|
277
275
|
if (i.length) return Promise.all(i).then(() => {
|
|
278
276
|
o();
|
|
279
277
|
});
|
|
280
278
|
o();
|
|
281
|
-
},
|
|
282
|
-
function
|
|
283
|
-
if (typeof e
|
|
284
|
-
|
|
285
|
-
|
|
279
|
+
}, ve = () => typeof window < "u" ? window.location.origin : "http://fallback.com", ye;
|
|
280
|
+
function b(e) {
|
|
281
|
+
if (typeof e == "string") return ye ??= be(), ye.get(e.toLowerCase());
|
|
282
|
+
}
|
|
283
|
+
function be() {
|
|
284
|
+
let e = /* @__PURE__ */ new Map();
|
|
285
|
+
for (let t of pe) {
|
|
286
|
+
let n = t.toLowerCase();
|
|
287
|
+
e.has(n) || e.set(n, t);
|
|
288
|
+
}
|
|
289
|
+
return e;
|
|
286
290
|
}
|
|
287
291
|
function xe(e) {
|
|
288
|
-
let t =
|
|
292
|
+
let t = b(e);
|
|
289
293
|
if (t) return t;
|
|
290
294
|
throw Error(`Invalid locale: ${e}. Expected one of: ${pe.join(", ")}`);
|
|
291
295
|
}
|
|
292
|
-
function
|
|
296
|
+
function x(e) {
|
|
293
297
|
return e;
|
|
294
298
|
}
|
|
295
299
|
function Se(e, t) {
|
|
@@ -299,26 +303,24 @@ function Ce() {
|
|
|
299
303
|
return 0;
|
|
300
304
|
}
|
|
301
305
|
function we(e) {
|
|
302
|
-
return
|
|
306
|
+
return g;
|
|
303
307
|
}
|
|
304
308
|
function Te(e, t) {
|
|
305
309
|
return e.exec(t.href);
|
|
306
310
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
function De(e) {
|
|
310
|
-
return Oe(e);
|
|
311
|
+
function Ee(e) {
|
|
312
|
+
return De(e);
|
|
311
313
|
}
|
|
312
|
-
function
|
|
313
|
-
let t =
|
|
314
|
-
return n.length > 0 &&
|
|
314
|
+
function De(e) {
|
|
315
|
+
let t = x(typeof e == "string" ? new URL(e, ve()) : new URL(e.href)), n = t.pathname.replace(/^\/+/, "").split("/");
|
|
316
|
+
return n.length > 0 && b(n[0]) && (t.pathname = "/" + n.slice(1).join("/")), x(t);
|
|
315
317
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
318
|
-
if (
|
|
318
|
+
var Oe = -1, ke, Ae;
|
|
319
|
+
function je(e) {
|
|
320
|
+
if (g.length === 0) return;
|
|
319
321
|
let t = typeof e == "string" ? e : e.href, n = Ce();
|
|
320
|
-
if (
|
|
321
|
-
let r =
|
|
322
|
+
if (ke === t && Oe === n) return Ae;
|
|
323
|
+
let r = x(new URL(t, "http://example.com")), i = Ee(r), a = i.href === r.href ? [r] : [r, i], o;
|
|
322
324
|
for (let e of a) {
|
|
323
325
|
for (let t of we(e)) if (Te(Se(t.match, e), e)) {
|
|
324
326
|
o = t;
|
|
@@ -326,57 +328,57 @@ function Me(e) {
|
|
|
326
328
|
}
|
|
327
329
|
if (o) break;
|
|
328
330
|
}
|
|
329
|
-
return
|
|
331
|
+
return Oe = n, ke = t, Ae = o, o;
|
|
330
332
|
}
|
|
331
|
-
function
|
|
332
|
-
let t =
|
|
333
|
+
function Me(e) {
|
|
334
|
+
let t = je(e);
|
|
333
335
|
return t && t.exclude !== !0 && Array.isArray(t.strategy) ? t.strategy : h;
|
|
334
336
|
}
|
|
335
|
-
var
|
|
336
|
-
function
|
|
337
|
+
var S = /* @__PURE__ */ new Map();
|
|
338
|
+
function Ne(e) {
|
|
337
339
|
return typeof e == "string" && /^custom-[A-Za-z0-9_-]+$/.test(e);
|
|
338
340
|
}
|
|
339
341
|
// ../client-core/src/attributes/label.ts
|
|
340
|
-
function
|
|
341
|
-
return
|
|
342
|
+
function Pe(e, t) {
|
|
343
|
+
return Fe(t !== void 0 && Object.hasOwn(t, e) ? t[e] : void 0) ?? C(e);
|
|
342
344
|
}
|
|
343
|
-
function
|
|
345
|
+
function Fe(e) {
|
|
344
346
|
if (e === void 0) return;
|
|
345
347
|
for (let t of [
|
|
346
|
-
|
|
348
|
+
y(),
|
|
347
349
|
"nl",
|
|
348
350
|
"en"
|
|
349
351
|
]) if (Object.hasOwn(e, t) && e[t] !== void 0) return e[t];
|
|
350
352
|
let [t] = Object.values(e);
|
|
351
353
|
return t;
|
|
352
354
|
}
|
|
353
|
-
function
|
|
355
|
+
function C(e) {
|
|
354
356
|
let t = e.replace(/([A-Z])/g, " $1").trim();
|
|
355
357
|
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
356
358
|
}
|
|
357
359
|
// ../client-core/src/client/error.ts
|
|
358
|
-
var
|
|
360
|
+
var w = {
|
|
359
361
|
NO_MAPPING: "NO_MAPPING",
|
|
360
362
|
ATTRIBUTE_NOT_FOUND: "ATTRIBUTE_NOT_FOUND",
|
|
361
363
|
VALUE_NOT_FOUND: "VALUE_NOT_FOUND",
|
|
362
364
|
PARENT_NOT_FOUND: "PARENT_NOT_FOUND",
|
|
363
365
|
INVALID_PARAMETER: "INVALID_PARAMETER",
|
|
364
366
|
SNAPSHOT_FAILED: "SNAPSHOT_FAILED"
|
|
365
|
-
},
|
|
367
|
+
}, T = class e extends Error {
|
|
366
368
|
code;
|
|
367
369
|
constructor(e, t) {
|
|
368
370
|
super(e), this.name = "VirtualdisplayError", this.code = t;
|
|
369
371
|
}
|
|
370
372
|
static valueNotFound(t, n) {
|
|
371
|
-
return new e(`Value "${n}" not found for attribute "${t}"`,
|
|
373
|
+
return new e(`Value "${n}" not found for attribute "${t}"`, w.VALUE_NOT_FOUND);
|
|
372
374
|
}
|
|
373
375
|
static parentNotFound(t) {
|
|
374
|
-
return new e(`Parent element not found: ${t}`,
|
|
376
|
+
return new e(`Parent element not found: ${t}`, w.PARENT_NOT_FOUND);
|
|
375
377
|
}
|
|
376
378
|
static invalidParameter(t) {
|
|
377
|
-
return new e(t,
|
|
379
|
+
return new e(t, w.INVALID_PARAMETER);
|
|
378
380
|
}
|
|
379
|
-
},
|
|
381
|
+
}, Ie = class {
|
|
380
382
|
name;
|
|
381
383
|
defaultValue;
|
|
382
384
|
values;
|
|
@@ -386,7 +388,7 @@ var C = {
|
|
|
386
388
|
this.name = e.name, this.defaultValue = e.defaultValue, this.onSelect = e.onSelect, this.values = this.createValues(e.values, e.labels);
|
|
387
389
|
}
|
|
388
390
|
select(e) {
|
|
389
|
-
if (!this.values.has(e)) throw
|
|
391
|
+
if (!this.values.has(e)) throw T.valueNotFound(this.name, e);
|
|
390
392
|
this.onSelect(this.name, e);
|
|
391
393
|
}
|
|
392
394
|
getValues() {
|
|
@@ -412,17 +414,17 @@ var C = {
|
|
|
412
414
|
createValues(e, t) {
|
|
413
415
|
let n = /* @__PURE__ */ new Map();
|
|
414
416
|
for (let r of e) {
|
|
415
|
-
let e = new de(r, this.name,
|
|
417
|
+
let e = new de(r, this.name, Pe(r, t));
|
|
416
418
|
r === this.defaultValue && e.setSelected(!0), n.set(r, e);
|
|
417
419
|
}
|
|
418
420
|
return n;
|
|
419
421
|
}
|
|
420
|
-
},
|
|
422
|
+
}, Le = class {
|
|
421
423
|
attributes = /* @__PURE__ */ new Map();
|
|
422
424
|
constructor(e, t, n) {
|
|
423
425
|
for (let n of e) {
|
|
424
426
|
let e = this.buildOptions(n, t);
|
|
425
|
-
this.attributes.set(n.name, new
|
|
427
|
+
this.attributes.set(n.name, new Ie(e));
|
|
426
428
|
}
|
|
427
429
|
this.onMutationFailed = n;
|
|
428
430
|
}
|
|
@@ -458,11 +460,11 @@ var C = {
|
|
|
458
460
|
defaultValue: e.defaultValue
|
|
459
461
|
};
|
|
460
462
|
}
|
|
461
|
-
},
|
|
463
|
+
}, E = 4096, D = 16384, Re = [
|
|
462
464
|
1024,
|
|
463
465
|
256,
|
|
464
466
|
64
|
|
465
|
-
],
|
|
467
|
+
], ze = 20, O = [
|
|
466
468
|
"timestamp",
|
|
467
469
|
"level",
|
|
468
470
|
"msg",
|
|
@@ -470,38 +472,38 @@ var C = {
|
|
|
470
472
|
"trace_id",
|
|
471
473
|
"span_id"
|
|
472
474
|
];
|
|
473
|
-
function
|
|
474
|
-
let t = new Date(e.timestamp).toLocaleTimeString("en-GB", { hour12: !1 }), n = e.level.toUpperCase().padEnd(5), r = e.trace_id?.slice(0, 8) ?? "--------", i = e.msg, a = Object.entries(e).filter(([e]) => !
|
|
475
|
+
function Be(e) {
|
|
476
|
+
let t = new Date(e.timestamp).toLocaleTimeString("en-GB", { hour12: !1 }), n = e.level.toUpperCase().padEnd(5), r = e.trace_id?.slice(0, 8) ?? "--------", i = e.msg, a = Object.entries(e).filter(([e]) => !O.includes(e)).map(([e, t]) => `${e}=${k(t, E).line}`).join(" ");
|
|
475
477
|
return `${t} ${n} [${r}] ${i}${a ? " " + a : ""}`;
|
|
476
478
|
}
|
|
477
|
-
function
|
|
478
|
-
for (let t of [
|
|
479
|
-
let { line: n, truncated: r } =
|
|
479
|
+
function Ve(e) {
|
|
480
|
+
for (let t of [E, ...Re]) {
|
|
481
|
+
let { line: n, truncated: r } = k(e, t);
|
|
480
482
|
if (!r) {
|
|
481
|
-
if (n.length <=
|
|
483
|
+
if (n.length <= D) return n;
|
|
482
484
|
continue;
|
|
483
485
|
}
|
|
484
|
-
let { line: i } =
|
|
486
|
+
let { line: i } = k({
|
|
485
487
|
...e,
|
|
486
488
|
log_truncated: !0
|
|
487
489
|
}, t);
|
|
488
|
-
if (i.length <=
|
|
490
|
+
if (i.length <= D) return i;
|
|
489
491
|
}
|
|
490
|
-
let t = Object.keys(e).filter((e) => !
|
|
491
|
-
...
|
|
492
|
+
let t = Object.keys(e).filter((e) => !O.includes(e)), n = {
|
|
493
|
+
...Ue(e, O),
|
|
492
494
|
log_truncated: !0,
|
|
493
495
|
log_dropped_count: t.length
|
|
494
|
-
}, r =
|
|
496
|
+
}, r = k({
|
|
495
497
|
...n,
|
|
496
|
-
log_dropped_attrs: t.slice(0,
|
|
497
|
-
},
|
|
498
|
-
return r.line.length <=
|
|
498
|
+
log_dropped_attrs: t.slice(0, ze)
|
|
499
|
+
}, E);
|
|
500
|
+
return r.line.length <= D ? r.line : k(n, E).line;
|
|
499
501
|
}
|
|
500
|
-
function
|
|
502
|
+
function k(e, t) {
|
|
501
503
|
let n = [], r = !1;
|
|
502
504
|
return {
|
|
503
505
|
line: JSON.stringify(e, function(e, i) {
|
|
504
|
-
if (typeof i == "string") return i.length > t && (r = !0),
|
|
506
|
+
if (typeof i == "string") return i.length > t && (r = !0), He(i, t);
|
|
505
507
|
if (typeof i == "bigint") return i.toString();
|
|
506
508
|
if (typeof i != "object" || !i) return i;
|
|
507
509
|
for (; n.length > 0 && n.at(-1) !== this;) n.pop();
|
|
@@ -510,80 +512,80 @@ function O(e, t) {
|
|
|
510
512
|
truncated: r
|
|
511
513
|
};
|
|
512
514
|
}
|
|
513
|
-
function
|
|
515
|
+
function He(e, t) {
|
|
514
516
|
return e.length <= t ? e : `${e.slice(0, t)}...[truncated ${e.length - t} chars]`;
|
|
515
517
|
}
|
|
516
|
-
function
|
|
518
|
+
function Ue(e, t) {
|
|
517
519
|
let n = {};
|
|
518
520
|
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
519
521
|
return n;
|
|
520
522
|
}
|
|
521
523
|
// ../logger/src/write.ts
|
|
522
|
-
function
|
|
523
|
-
let n = t ?
|
|
524
|
+
function We(e, t) {
|
|
525
|
+
let n = t ? Be(e) : Ve(e);
|
|
524
526
|
e.level === "error" ? console.error(n) : e.level === "warn" ? console.warn(n) : console.log(n);
|
|
525
527
|
}
|
|
526
528
|
// ../logger/src/serialise.ts
|
|
527
|
-
function
|
|
529
|
+
function Ge(e, t = 0) {
|
|
528
530
|
let n = {
|
|
529
531
|
name: e.name,
|
|
530
532
|
message: e.message
|
|
531
533
|
};
|
|
532
|
-
return e.stack !== void 0 && (n.stack = e.stack),
|
|
534
|
+
return e.stack !== void 0 && (n.stack = e.stack), qe(e, n), e.cause !== void 0 && e.cause !== null && (n.cause = e.cause instanceof Error && t < 5 ? Ge(e.cause, t + 1) : String(e.cause)), n;
|
|
533
535
|
}
|
|
534
|
-
var
|
|
536
|
+
var Ke = /* @__PURE__ */ new Set([
|
|
535
537
|
"name",
|
|
536
538
|
"message",
|
|
537
539
|
"stack",
|
|
538
540
|
"cause"
|
|
539
541
|
]);
|
|
540
|
-
function
|
|
542
|
+
function qe(e, t) {
|
|
541
543
|
for (let n of Object.getOwnPropertyNames(e)) {
|
|
542
|
-
if (
|
|
544
|
+
if (Ke.has(n)) continue;
|
|
543
545
|
let r = e[n];
|
|
544
546
|
r !== void 0 && (t[n] = r);
|
|
545
547
|
}
|
|
546
548
|
}
|
|
547
|
-
function
|
|
549
|
+
function Je(e) {
|
|
548
550
|
let t = {};
|
|
549
|
-
for (let [n, r] of Object.entries(e)) t[n] = r instanceof Error ?
|
|
551
|
+
for (let [n, r] of Object.entries(e)) t[n] = r instanceof Error ? Ge(r) : r;
|
|
550
552
|
return t;
|
|
551
553
|
}
|
|
552
554
|
// ../utils/src/now.ts
|
|
553
|
-
function
|
|
555
|
+
function Ye() {
|
|
554
556
|
return /* @__PURE__ */ new Date();
|
|
555
557
|
}
|
|
556
558
|
// ../utils/src/device.ts
|
|
557
|
-
function
|
|
559
|
+
function Xe() {
|
|
558
560
|
return typeof navigator > "u" ? "" : navigator.userAgent;
|
|
559
561
|
}
|
|
560
|
-
function
|
|
562
|
+
function Ze() {
|
|
561
563
|
return typeof navigator > "u" ? !1 : navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
562
564
|
}
|
|
565
|
+
function Qe() {
|
|
566
|
+
return /iPhone|iPad|iPod/i.test(Xe()) || Ze();
|
|
567
|
+
}
|
|
563
568
|
function $e() {
|
|
564
|
-
return /
|
|
569
|
+
return /Android/i.test(Xe());
|
|
565
570
|
}
|
|
566
571
|
function et() {
|
|
567
|
-
return
|
|
568
|
-
}
|
|
569
|
-
function tt() {
|
|
570
|
-
return $e() || et();
|
|
572
|
+
return Qe() || $e();
|
|
571
573
|
}
|
|
572
574
|
// ../logger/src/logger.ts
|
|
573
|
-
var
|
|
575
|
+
var tt = class {
|
|
574
576
|
config;
|
|
575
577
|
constructor(e) {
|
|
576
578
|
this.config = e;
|
|
577
579
|
}
|
|
578
580
|
log(e, t, n = {}) {
|
|
579
581
|
let r = this.config.traceProvider?.() ?? {};
|
|
580
|
-
|
|
581
|
-
timestamp:
|
|
582
|
+
We({
|
|
583
|
+
timestamp: Ye().toISOString(),
|
|
582
584
|
level: e,
|
|
583
585
|
msg: t,
|
|
584
586
|
service: this.config.service,
|
|
585
587
|
...r,
|
|
586
|
-
...
|
|
588
|
+
...Je(n)
|
|
587
589
|
}, this.config.isDev);
|
|
588
590
|
}
|
|
589
591
|
debug(e, t) {
|
|
@@ -599,34 +601,34 @@ var nt = class {
|
|
|
599
601
|
this.log("error", e, t);
|
|
600
602
|
}
|
|
601
603
|
};
|
|
602
|
-
function
|
|
603
|
-
return new
|
|
604
|
+
function nt(e, t) {
|
|
605
|
+
return new tt({
|
|
604
606
|
service: e,
|
|
605
607
|
isDev: t?.isDev === void 0 ? typeof process < "u" ? process.env.NODE_ENV !== "production" : !0 : t.isDev,
|
|
606
608
|
traceProvider: t?.traceProvider
|
|
607
609
|
});
|
|
608
610
|
}
|
|
609
611
|
// ../client-core/src/utils/logger.ts
|
|
610
|
-
function
|
|
612
|
+
function A(e) {
|
|
611
613
|
if (e !== void 0) return typeof e == "object" && e && !Array.isArray(e) && !(e instanceof Error) ? e : e instanceof Error ? { error: e.message } : { value: e };
|
|
612
614
|
}
|
|
613
|
-
function
|
|
615
|
+
function rt(e) {
|
|
614
616
|
return {
|
|
615
|
-
debug: (t, n) => e.debug(t,
|
|
616
|
-
info: (t, n) => e.info(t,
|
|
617
|
-
warn: (t, n) => e.warn(t,
|
|
618
|
-
error: (t, n) => e.error(t,
|
|
617
|
+
debug: (t, n) => e.debug(t, A(n)),
|
|
618
|
+
info: (t, n) => e.info(t, A(n)),
|
|
619
|
+
warn: (t, n) => e.warn(t, A(n)),
|
|
620
|
+
error: (t, n) => e.error(t, A(n))
|
|
619
621
|
};
|
|
620
622
|
}
|
|
621
|
-
var
|
|
622
|
-
function
|
|
623
|
-
|
|
623
|
+
var it = !1, j = rt(nt("client", { isDev: !1 }));
|
|
624
|
+
function at() {
|
|
625
|
+
it = !0, j = rt(nt("client", { isDev: !0 }));
|
|
624
626
|
}
|
|
625
|
-
function
|
|
626
|
-
return
|
|
627
|
+
function ot() {
|
|
628
|
+
return it;
|
|
627
629
|
}
|
|
628
630
|
// ../client-core/src/attributes/attributes.ts
|
|
629
|
-
var
|
|
631
|
+
var st = class {
|
|
630
632
|
send;
|
|
631
633
|
instance;
|
|
632
634
|
onMutationFailed;
|
|
@@ -636,7 +638,7 @@ var ct = class {
|
|
|
636
638
|
this.send = e, this.instance = t, this.onMutationFailed = n;
|
|
637
639
|
}
|
|
638
640
|
handleMappingReceived(e) {
|
|
639
|
-
|
|
641
|
+
j.debug("Initializing from server mapping", { attributeCount: e.attributes.length }), this.registry = new Le(e.attributes, (e, t) => this.sendMutation(e, t), this.onMutationFailed), this.replayPendingCallbacks();
|
|
640
642
|
}
|
|
641
643
|
handleMutationResult(e) {
|
|
642
644
|
this.registry?.handleResults(e.results);
|
|
@@ -668,7 +670,7 @@ var ct = class {
|
|
|
668
670
|
return;
|
|
669
671
|
}
|
|
670
672
|
let n = this.registry.get(e);
|
|
671
|
-
n === void 0 ?
|
|
673
|
+
n === void 0 ? j.warn(`onChange: attribute "${e}" not found — callback will not fire`) : n.onChange(t);
|
|
672
674
|
}
|
|
673
675
|
getAttribute(e) {
|
|
674
676
|
return this.registry?.get(e);
|
|
@@ -689,11 +691,11 @@ var ct = class {
|
|
|
689
691
|
replayPendingCallbacks() {
|
|
690
692
|
for (let { name: e, callback: t } of this.pendingCallbacks) {
|
|
691
693
|
let n = this.registry?.get(e);
|
|
692
|
-
n === void 0 &&
|
|
694
|
+
n === void 0 && j.warn(`onChange: attribute "${e}" not found — buffered callback will not fire`), n?.onChange(t);
|
|
693
695
|
}
|
|
694
696
|
this.pendingCallbacks.length = 0;
|
|
695
697
|
}
|
|
696
|
-
},
|
|
698
|
+
}, ct = class {
|
|
697
699
|
snapshot;
|
|
698
700
|
callbacks = [];
|
|
699
701
|
handleSnapshot(e) {
|
|
@@ -709,7 +711,7 @@ var ct = class {
|
|
|
709
711
|
get current() {
|
|
710
712
|
return this.snapshot ?? [];
|
|
711
713
|
}
|
|
712
|
-
},
|
|
714
|
+
}, lt = class {
|
|
713
715
|
send;
|
|
714
716
|
commands = [];
|
|
715
717
|
constructor(e) {
|
|
@@ -734,7 +736,7 @@ var ct = class {
|
|
|
734
736
|
}), this;
|
|
735
737
|
}
|
|
736
738
|
set() {
|
|
737
|
-
if (this.commands.length === 0) throw
|
|
739
|
+
if (this.commands.length === 0) throw T.invalidParameter("No camera commands to execute. Call rotate(), tilt(), or zoom() before set().");
|
|
738
740
|
let e = {
|
|
739
741
|
type: t.CAMERA,
|
|
740
742
|
commands: this.commands
|
|
@@ -742,7 +744,7 @@ var ct = class {
|
|
|
742
744
|
this.send(e), this.commands = [];
|
|
743
745
|
}
|
|
744
746
|
validateFiniteNumber(e, t) {
|
|
745
|
-
if (!Number.isFinite(e)) throw
|
|
747
|
+
if (!Number.isFinite(e)) throw T.invalidParameter(`${t}() requires a finite number, got ${String(e)}`);
|
|
746
748
|
}
|
|
747
749
|
reset() {
|
|
748
750
|
let e = {
|
|
@@ -751,7 +753,7 @@ var ct = class {
|
|
|
751
753
|
};
|
|
752
754
|
this.send(e);
|
|
753
755
|
}
|
|
754
|
-
},
|
|
756
|
+
}, ut = class {
|
|
755
757
|
state;
|
|
756
758
|
limitsState;
|
|
757
759
|
changeCallbacks = [];
|
|
@@ -811,20 +813,20 @@ var ct = class {
|
|
|
811
813
|
}
|
|
812
814
|
};
|
|
813
815
|
// ../client-core/src/configuration/pricing-rule.ts
|
|
814
|
-
function
|
|
815
|
-
let n = e.filter((e) =>
|
|
816
|
+
function dt(e, t) {
|
|
817
|
+
let n = e.filter((e) => ft(e, t));
|
|
816
818
|
if (n.length === 0) return;
|
|
817
|
-
let r = Math.max(...n.map(
|
|
819
|
+
let r = Math.max(...n.map(pt)), i = n.filter((e) => pt(e) === r);
|
|
818
820
|
return i.length === 1 ? i[0] : void 0;
|
|
819
821
|
}
|
|
820
|
-
function
|
|
822
|
+
function ft(e, t) {
|
|
821
823
|
return Object.entries(e.attributes).every(([e, n]) => t[e] === n);
|
|
822
824
|
}
|
|
823
|
-
function
|
|
825
|
+
function pt(e) {
|
|
824
826
|
return Object.keys(e.attributes).length;
|
|
825
827
|
}
|
|
826
828
|
// ../client-core/src/configuration/configuration.ts
|
|
827
|
-
var
|
|
829
|
+
var mt = class {
|
|
828
830
|
dispatchChange;
|
|
829
831
|
dispatchSubmit;
|
|
830
832
|
pricing;
|
|
@@ -893,7 +895,7 @@ var ht = class {
|
|
|
893
895
|
}
|
|
894
896
|
resolve() {
|
|
895
897
|
if (this.pricing === void 0) return;
|
|
896
|
-
let e =
|
|
898
|
+
let e = dt(this.pricing.rules, this.selection);
|
|
897
899
|
if (e !== void 0 && e.availability !== a.HIDDEN) return {
|
|
898
900
|
attributes: { ...this.selection },
|
|
899
901
|
reference: e.reference,
|
|
@@ -902,7 +904,7 @@ var ht = class {
|
|
|
902
904
|
availability: e.availability
|
|
903
905
|
};
|
|
904
906
|
}
|
|
905
|
-
},
|
|
907
|
+
}, ht = class {
|
|
906
908
|
send;
|
|
907
909
|
dispatch;
|
|
908
910
|
instance;
|
|
@@ -916,7 +918,7 @@ var ht = class {
|
|
|
916
918
|
return this.focused;
|
|
917
919
|
}
|
|
918
920
|
set(e) {
|
|
919
|
-
if (typeof e != "string" || e.length === 0) throw
|
|
921
|
+
if (typeof e != "string" || e.length === 0) throw T.invalidParameter(`set() requires a non-empty component name, got ${String(e)}`);
|
|
920
922
|
this.send({
|
|
921
923
|
type: t.FOCUS,
|
|
922
924
|
instance: this.instance,
|
|
@@ -943,7 +945,7 @@ var ht = class {
|
|
|
943
945
|
for (let e of this.changeCallbacks) e(t);
|
|
944
946
|
this.dispatch(t);
|
|
945
947
|
}
|
|
946
|
-
},
|
|
948
|
+
}, gt = class {
|
|
947
949
|
filename;
|
|
948
950
|
developedCallbacks = /* @__PURE__ */ new Set();
|
|
949
951
|
errorCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -972,7 +974,7 @@ var ht = class {
|
|
|
972
974
|
t(e);
|
|
973
975
|
}), this.developedCallbacks.clear(), this.errorCallbacks.clear());
|
|
974
976
|
}
|
|
975
|
-
},
|
|
977
|
+
}, _t = 3e4, vt = class {
|
|
976
978
|
send;
|
|
977
979
|
validExtensions = [".png"];
|
|
978
980
|
pendingPhotos = /* @__PURE__ */ new Map();
|
|
@@ -986,10 +988,10 @@ var ht = class {
|
|
|
986
988
|
return this.request(e, t);
|
|
987
989
|
}
|
|
988
990
|
request(e, n) {
|
|
989
|
-
this.validateFilename(e),
|
|
990
|
-
let r = new
|
|
991
|
-
this.pendingPhotos.delete(e),
|
|
992
|
-
},
|
|
991
|
+
this.validateFilename(e), j.debug("Taking snapshot", { filename: e });
|
|
992
|
+
let r = new gt(e), i = setTimeout(() => {
|
|
993
|
+
this.pendingPhotos.delete(e), j.warn("Snapshot timed out", { filename: e }), r.fail(new T(`Snapshot timed out: the viewer did not respond within ${_t}ms`, w.SNAPSHOT_FAILED));
|
|
994
|
+
}, _t);
|
|
993
995
|
return this.pendingPhotos.set(e, {
|
|
994
996
|
photo: r,
|
|
995
997
|
timeout: i
|
|
@@ -1002,7 +1004,7 @@ var ht = class {
|
|
|
1002
1004
|
handleSnapshotResult(e) {
|
|
1003
1005
|
let t = this.pendingPhotos.get(e.filename);
|
|
1004
1006
|
if (t === void 0) {
|
|
1005
|
-
|
|
1007
|
+
j.warn("No pending photo found for filename", {
|
|
1006
1008
|
filename: e.filename,
|
|
1007
1009
|
pendingFilenames: Array.from(this.pendingPhotos.keys())
|
|
1008
1010
|
});
|
|
@@ -1013,20 +1015,20 @@ var ht = class {
|
|
|
1013
1015
|
e.error === void 0 ? e.data !== void 0 && n.develop({
|
|
1014
1016
|
filename: e.filename,
|
|
1015
1017
|
data: e.data
|
|
1016
|
-
}) : n.fail(new
|
|
1018
|
+
}) : n.fail(new T(e.error, w.SNAPSHOT_FAILED));
|
|
1017
1019
|
}
|
|
1018
1020
|
clear() {
|
|
1019
1021
|
if (this.pendingPhotos.size === 0) return;
|
|
1020
|
-
let e = new
|
|
1022
|
+
let e = new T("Client destroyed before snapshot completed", w.SNAPSHOT_FAILED);
|
|
1021
1023
|
for (let { photo: t, timeout: n } of this.pendingPhotos.values()) clearTimeout(n), t.fail(e);
|
|
1022
1024
|
this.pendingPhotos.clear();
|
|
1023
1025
|
}
|
|
1024
1026
|
validateFilename(e) {
|
|
1025
|
-
if (e === "" || typeof e != "string") throw new
|
|
1026
|
-
if (!this.validExtensions.some((t) => e.toLowerCase().endsWith(t))) throw new
|
|
1027
|
-
if (e.includes("..") || e.includes("/") || e.includes("\\")) throw new
|
|
1027
|
+
if (e === "" || typeof e != "string") throw new T("Filename must be a non-empty string", w.INVALID_PARAMETER);
|
|
1028
|
+
if (!this.validExtensions.some((t) => e.toLowerCase().endsWith(t))) throw new T(`Invalid filename: "${e}". Filename must end with one of: ${this.validExtensions.join(", ")}`, w.INVALID_PARAMETER);
|
|
1029
|
+
if (e.includes("..") || e.includes("/") || e.includes("\\")) throw new T("Filename cannot contain path separators or \"..\"", w.INVALID_PARAMETER);
|
|
1028
1030
|
}
|
|
1029
|
-
},
|
|
1031
|
+
}, yt = class {
|
|
1030
1032
|
container = null;
|
|
1031
1033
|
attach(e) {
|
|
1032
1034
|
this.container = e;
|
|
@@ -1052,76 +1054,76 @@ var ht = class {
|
|
|
1052
1054
|
this.container?.removeEventListener(e, n);
|
|
1053
1055
|
};
|
|
1054
1056
|
}
|
|
1055
|
-
},
|
|
1056
|
-
let n = t.locale ??
|
|
1057
|
+
}, bt = ((e = {}, t = {}) => {
|
|
1058
|
+
let n = t.locale ?? y();
|
|
1057
1059
|
return n === "nl" ? "Bezig…" : n === "de" ? "Läuft…" : "Working…";
|
|
1058
|
-
}),
|
|
1059
|
-
let n = t.locale ??
|
|
1060
|
+
}), xt = ((e = {}, t = {}) => {
|
|
1061
|
+
let n = t.locale ?? y();
|
|
1060
1062
|
return n === "nl" ? "Mislukt" : n === "de" ? "Fehlgeschlagen" : "Failed";
|
|
1061
|
-
}),
|
|
1062
|
-
let n = t.locale ??
|
|
1063
|
+
}), St = ((e = {}, t = {}) => {
|
|
1064
|
+
let n = t.locale ?? y();
|
|
1063
1065
|
return n === "nl" ? "Gelukt" : n === "de" ? "Fertig" : "Done";
|
|
1064
|
-
}),
|
|
1065
|
-
let n = t.locale ??
|
|
1066
|
+
}), Ct = ((e = {}, t = {}) => {
|
|
1067
|
+
let n = t.locale ?? y();
|
|
1066
1068
|
return n === "nl" ? "Annotaties" : n === "de" ? "Anmerkungen" : "Annotations";
|
|
1067
|
-
}),
|
|
1068
|
-
let n = t.locale ??
|
|
1069
|
+
}), wt = ((e = {}, t = {}) => {
|
|
1070
|
+
let n = t.locale ?? y();
|
|
1069
1071
|
return n === "nl" ? "AR activeren" : n === "de" ? "AR aktivieren" : "Activate AR";
|
|
1070
|
-
}),
|
|
1071
|
-
let n = t.locale ??
|
|
1072
|
+
}), Tt = ((e = {}, t = {}) => {
|
|
1073
|
+
let n = t.locale ?? y();
|
|
1072
1074
|
return n === "nl" ? "Camera resetten" : n === "de" ? "Kamera zurücksetzen" : "Reset camera";
|
|
1073
|
-
}),
|
|
1074
|
-
let n = t.locale ??
|
|
1075
|
+
}), Et = ((e = {}, t = {}) => {
|
|
1076
|
+
let n = t.locale ?? y();
|
|
1075
1077
|
return n === "nl" ? "Naar links draaien" : n === "de" ? "Nach links drehen" : "Rotate left";
|
|
1076
|
-
}),
|
|
1077
|
-
let n = t.locale ??
|
|
1078
|
+
}), Dt = ((e = {}, t = {}) => {
|
|
1079
|
+
let n = t.locale ?? y();
|
|
1078
1080
|
return n === "nl" ? "Naar rechts draaien" : n === "de" ? "Nach rechts drehen" : "Rotate right";
|
|
1079
|
-
}),
|
|
1080
|
-
let n = t.locale ??
|
|
1081
|
+
}), Ot = ((e = {}, t = {}) => {
|
|
1082
|
+
let n = t.locale ?? y();
|
|
1081
1083
|
return n === "nl" ? "Omlaag kantelen" : n === "de" ? "Nach unten kippen" : "Tilt down";
|
|
1082
|
-
}),
|
|
1083
|
-
let n = t.locale ??
|
|
1084
|
+
}), kt = ((e = {}, t = {}) => {
|
|
1085
|
+
let n = t.locale ?? y();
|
|
1084
1086
|
return n === "nl" ? "Omhoog kantelen" : n === "de" ? "Nach oben kippen" : "Tilt up";
|
|
1085
|
-
}),
|
|
1086
|
-
let n = t.locale ??
|
|
1087
|
+
}), At = ((e = {}, t = {}) => {
|
|
1088
|
+
let n = t.locale ?? y();
|
|
1087
1089
|
return n === "nl" ? "Inzoomen" : n === "de" ? "Hineinzoomen" : "Zoom in";
|
|
1088
|
-
}),
|
|
1089
|
-
let n = t.locale ??
|
|
1090
|
+
}), jt = ((e = {}, t = {}) => {
|
|
1091
|
+
let n = t.locale ?? y();
|
|
1090
1092
|
return n === "nl" ? "Uitzoomen" : n === "de" ? "Herauszoomen" : "Zoom out";
|
|
1091
|
-
}),
|
|
1092
|
-
let n = t.locale ??
|
|
1093
|
+
}), Mt = ((e = {}, t = {}) => {
|
|
1094
|
+
let n = t.locale ?? y();
|
|
1093
1095
|
return n === "nl" ? "Sluiten" : n === "de" ? "Schließen" : "Close";
|
|
1094
|
-
}),
|
|
1095
|
-
let n = t.locale ??
|
|
1096
|
+
}), Nt = ((e = {}, t = {}) => {
|
|
1097
|
+
let n = t.locale ?? y();
|
|
1096
1098
|
return n === "nl" ? "Configureren" : n === "de" ? "Konfigurieren" : "Configure";
|
|
1097
|
-
}),
|
|
1098
|
-
let n = t.locale ??
|
|
1099
|
+
}), Pt = ((e = {}, t = {}) => {
|
|
1100
|
+
let n = t.locale ?? y();
|
|
1099
1101
|
return n === "nl" ? "Volledig scherm" : n === "de" ? "Vollbild" : "Fullscreen";
|
|
1100
|
-
}),
|
|
1101
|
-
let n = t.locale ??
|
|
1102
|
+
}), Ft = ((e = {}, t = {}) => {
|
|
1103
|
+
let n = t.locale ?? y();
|
|
1102
1104
|
return n === "nl" ? "Sluiten" : n === "de" ? "Schließen" : "Close";
|
|
1103
|
-
}),
|
|
1104
|
-
let n = t.locale ??
|
|
1105
|
+
}), It = ((e = {}, t = {}) => {
|
|
1106
|
+
let n = t.locale ?? y();
|
|
1105
1107
|
return n === "nl" ? "QR-code" : n === "de" ? "QR-Code" : "QR code";
|
|
1106
|
-
}),
|
|
1107
|
-
let n = t.locale ??
|
|
1108
|
+
}), Lt = ((e = {}, t = {}) => {
|
|
1109
|
+
let n = t.locale ?? y();
|
|
1108
1110
|
return n === "nl" ? "Gebruik de camera van je smartphone om deze QR-code te scannen" : n === "de" ? "Verwende die Kamera deines Smartphones, um diesen QR-Code zu scannen" : "Use your smartphone camera to scan this QR code";
|
|
1109
|
-
}),
|
|
1110
|
-
let n = t.locale ??
|
|
1111
|
+
}), Rt = ((e = {}, t = {}) => {
|
|
1112
|
+
let n = t.locale ?? y();
|
|
1111
1113
|
return n === "nl" ? "Je telefoon opent het 3D-model in AR-modus." : n === "de" ? "Dein Telefon öffnet das 3D-Modell im AR-Modus." : "Your phone will open the 3D model in AR mode.";
|
|
1112
|
-
}),
|
|
1113
|
-
let n = t.locale ??
|
|
1114
|
+
}), zt = ((e = {}, t = {}) => {
|
|
1115
|
+
let n = t.locale ?? y();
|
|
1114
1116
|
return n === "nl" ? "Scan om in AR te bekijken" : n === "de" ? "Scannen für AR-Ansicht" : "Scan to view in AR";
|
|
1115
|
-
}),
|
|
1116
|
-
let n = t.locale ??
|
|
1117
|
+
}), Bt = ((e = {}, t = {}) => {
|
|
1118
|
+
let n = t.locale ?? y();
|
|
1117
1119
|
return n === "nl" ? "We kunnen de QR-code nu niet tonen. Open deze link op je telefoon:" : n === "de" ? "Wir können den QR-Code gerade nicht anzeigen. Öffne diesen Link auf deinem Handy:" : "We can't show the QR code right now. Open this link on your phone:";
|
|
1118
|
-
}),
|
|
1119
|
-
let n = t.locale ??
|
|
1120
|
+
}), Vt = ((e = {}, t = {}) => (t.locale ?? y(), "Screenshot")), Ht = ((e = {}, t = {}) => {
|
|
1121
|
+
let n = t.locale ?? y();
|
|
1120
1122
|
return n === "nl" ? "Downloaden" : n === "de" ? "Herunterladen" : "Downloading";
|
|
1121
|
-
}),
|
|
1122
|
-
let n = t.locale ??
|
|
1123
|
+
}), Ut = ((e = {}, t = {}) => {
|
|
1124
|
+
let n = t.locale ?? y();
|
|
1123
1125
|
return n === "nl" ? "Laden mislukt. Ververs de pagina om het opnieuw te proberen." : n === "de" ? "Laden fehlgeschlagen. Lade die Seite neu, um es erneut zu versuchen." : "Load failed. Refresh the page to try again.";
|
|
1124
|
-
}),
|
|
1126
|
+
}), Wt = {
|
|
1125
1127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1126
1128
|
width: 24,
|
|
1127
1129
|
height: 24,
|
|
@@ -1131,50 +1133,50 @@ var ht = class {
|
|
|
1131
1133
|
"stroke-width": 2,
|
|
1132
1134
|
"stroke-linecap": "round",
|
|
1133
1135
|
"stroke-linejoin": "round"
|
|
1134
|
-
},
|
|
1136
|
+
}, Gt = ([e, t, n]) => {
|
|
1135
1137
|
let r = document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
1136
1138
|
return Object.keys(t).forEach((e) => {
|
|
1137
1139
|
r.setAttribute(e, String(t[e]));
|
|
1138
1140
|
}), n?.length && n.forEach((e) => {
|
|
1139
|
-
let t =
|
|
1141
|
+
let t = Gt(e);
|
|
1140
1142
|
r.appendChild(t);
|
|
1141
1143
|
}), r;
|
|
1142
|
-
},
|
|
1144
|
+
}, Kt = (e, t = {}) => Gt([
|
|
1143
1145
|
"svg",
|
|
1144
1146
|
{
|
|
1145
|
-
...
|
|
1147
|
+
...Wt,
|
|
1146
1148
|
...t
|
|
1147
1149
|
},
|
|
1148
1150
|
e
|
|
1149
|
-
]),
|
|
1151
|
+
]), qt = [
|
|
1150
1152
|
["path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" }],
|
|
1151
1153
|
["path", { d: "m3.3 7 8.7 5 8.7-5" }],
|
|
1152
1154
|
["path", { d: "M12 22V12" }]
|
|
1153
|
-
],
|
|
1155
|
+
], Jt = [["path", { d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }], ["circle", {
|
|
1154
1156
|
cx: "12",
|
|
1155
1157
|
cy: "13",
|
|
1156
1158
|
r: "3"
|
|
1157
|
-
}]],
|
|
1159
|
+
}]], M = [["path", { d: "m6 9 6 6 6-6" }]], Yt = [["path", { d: "m15 18-6-6 6-6" }]], Xt = [["path", { d: "m9 18 6-6-6-6" }]], Zt = [["path", { d: "m18 15-6-6-6 6" }]], Qt = [
|
|
1158
1160
|
["path", { d: "M12.75 7.09a3 3 0 0 1 2.16 2.16" }],
|
|
1159
1161
|
["path", { d: "M17.072 17.072c-1.634 2.17-3.527 3.912-4.471 4.727a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 1.432-4.568" }],
|
|
1160
1162
|
["path", { d: "m2 2 20 20" }],
|
|
1161
1163
|
["path", { d: "M8.475 2.818A8 8 0 0 1 20 10c0 1.183-.31 2.377-.81 3.533" }],
|
|
1162
1164
|
["path", { d: "M9.13 9.13a3 3 0 0 0 3.74 3.74" }]
|
|
1163
|
-
],
|
|
1165
|
+
], $t = [["path", { d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" }], ["circle", {
|
|
1164
1166
|
cx: "12",
|
|
1165
1167
|
cy: "10",
|
|
1166
1168
|
r: "3"
|
|
1167
|
-
}]],
|
|
1169
|
+
}]], en = [
|
|
1168
1170
|
["path", { d: "M15 3h6v6" }],
|
|
1169
1171
|
["path", { d: "m21 3-7 7" }],
|
|
1170
1172
|
["path", { d: "m3 21 7-7" }],
|
|
1171
1173
|
["path", { d: "M9 21H3v-6" }]
|
|
1172
|
-
],
|
|
1174
|
+
], tn = [
|
|
1173
1175
|
["path", { d: "m14 10 7-7" }],
|
|
1174
1176
|
["path", { d: "M20 10h-6V4" }],
|
|
1175
1177
|
["path", { d: "m3 21 7-7" }],
|
|
1176
1178
|
["path", { d: "M4 14h6v6" }]
|
|
1177
|
-
],
|
|
1179
|
+
], nn = [["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { d: "M3 3v5h5" }]], rn = [
|
|
1178
1180
|
["path", { d: "M10 5H3" }],
|
|
1179
1181
|
["path", { d: "M12 19H3" }],
|
|
1180
1182
|
["path", { d: "M14 3v4" }],
|
|
@@ -1184,7 +1186,7 @@ var ht = class {
|
|
|
1184
1186
|
["path", { d: "M21 5h-7" }],
|
|
1185
1187
|
["path", { d: "M8 10v4" }],
|
|
1186
1188
|
["path", { d: "M8 12H3" }]
|
|
1187
|
-
],
|
|
1189
|
+
], an = [["path", { d: "M18 6 6 18" }], ["path", { d: "m6 6 12 12" }]], on = [
|
|
1188
1190
|
["circle", {
|
|
1189
1191
|
cx: "11",
|
|
1190
1192
|
cy: "11",
|
|
@@ -1196,13 +1198,19 @@ var ht = class {
|
|
|
1196
1198
|
y1: "21",
|
|
1197
1199
|
y2: "16.65"
|
|
1198
1200
|
}],
|
|
1201
|
+
["line", {
|
|
1202
|
+
x1: "11",
|
|
1203
|
+
x2: "11",
|
|
1204
|
+
y1: "8",
|
|
1205
|
+
y2: "14"
|
|
1206
|
+
}],
|
|
1199
1207
|
["line", {
|
|
1200
1208
|
x1: "8",
|
|
1201
1209
|
x2: "14",
|
|
1202
1210
|
y1: "11",
|
|
1203
1211
|
y2: "11"
|
|
1204
1212
|
}]
|
|
1205
|
-
],
|
|
1213
|
+
], sn = [
|
|
1206
1214
|
["circle", {
|
|
1207
1215
|
cx: "11",
|
|
1208
1216
|
cy: "11",
|
|
@@ -1214,12 +1222,6 @@ var ht = class {
|
|
|
1214
1222
|
y1: "21",
|
|
1215
1223
|
y2: "16.65"
|
|
1216
1224
|
}],
|
|
1217
|
-
["line", {
|
|
1218
|
-
x1: "11",
|
|
1219
|
-
x2: "11",
|
|
1220
|
-
y1: "8",
|
|
1221
|
-
y2: "14"
|
|
1222
|
-
}],
|
|
1223
1225
|
["line", {
|
|
1224
1226
|
x1: "8",
|
|
1225
1227
|
x2: "14",
|
|
@@ -1228,30 +1230,31 @@ var ht = class {
|
|
|
1228
1230
|
}]
|
|
1229
1231
|
];
|
|
1230
1232
|
// ../ui/src/icons.ts
|
|
1231
|
-
function
|
|
1232
|
-
return
|
|
1233
|
+
function N(e, { size: t = 20, strokeWidth: n = 1.75 } = {}) {
|
|
1234
|
+
return Kt(e, {
|
|
1233
1235
|
width: t,
|
|
1234
1236
|
height: t,
|
|
1235
1237
|
"stroke-width": n
|
|
1236
1238
|
});
|
|
1237
1239
|
}
|
|
1238
|
-
var
|
|
1239
|
-
ar: (e) =>
|
|
1240
|
-
annotations: (e) =>
|
|
1241
|
-
annotationsOff: (e) =>
|
|
1242
|
-
fullscreen: (e) =>
|
|
1243
|
-
exitFullscreen: (e) =>
|
|
1244
|
-
screenshot: (e) =>
|
|
1245
|
-
tiltUp: (e) =>
|
|
1246
|
-
tiltDown: (e) =>
|
|
1247
|
-
rotateLeft: (e) =>
|
|
1248
|
-
rotateRight: (e) =>
|
|
1249
|
-
zoomIn: (e) =>
|
|
1250
|
-
zoomOut: (e) =>
|
|
1251
|
-
reset: (e) =>
|
|
1252
|
-
configurator: (e) =>
|
|
1253
|
-
close: (e) =>
|
|
1254
|
-
|
|
1240
|
+
var P = {
|
|
1241
|
+
ar: (e) => N(qt, e),
|
|
1242
|
+
annotations: (e) => N($t, e),
|
|
1243
|
+
annotationsOff: (e) => N(Qt, e),
|
|
1244
|
+
fullscreen: (e) => N(en, e),
|
|
1245
|
+
exitFullscreen: (e) => N(tn, e),
|
|
1246
|
+
screenshot: (e) => N(Jt, e),
|
|
1247
|
+
tiltUp: (e) => N(Zt, e),
|
|
1248
|
+
tiltDown: (e) => N(M, e),
|
|
1249
|
+
rotateLeft: (e) => N(Yt, e),
|
|
1250
|
+
rotateRight: (e) => N(Xt, e),
|
|
1251
|
+
zoomIn: (e) => N(on, e),
|
|
1252
|
+
zoomOut: (e) => N(sn, e),
|
|
1253
|
+
reset: (e) => N(nn, e),
|
|
1254
|
+
configurator: (e) => N(rn, e),
|
|
1255
|
+
close: (e) => N(an, e),
|
|
1256
|
+
expand: (e) => N(M, e)
|
|
1257
|
+
}, F = class {
|
|
1255
1258
|
element;
|
|
1256
1259
|
constructor({ variant: e = "default", size: t = "default", label: n, icon: r, onClick: i, disabled: a = !1 } = {}) {
|
|
1257
1260
|
this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${e} ui-btn--size-${t}`, n !== void 0 && (this.element.setAttribute("aria-label", n), this.element.title = n), r === void 0 ? n !== void 0 && (this.element.textContent = n) : this.element.appendChild(r), i && this.element.addEventListener("click", i), this.element.disabled = a;
|
|
@@ -1260,7 +1263,233 @@ var M = {
|
|
|
1260
1263
|
let t = this.element.querySelector("svg");
|
|
1261
1264
|
t === null ? this.element.appendChild(e) : t.replaceWith(e);
|
|
1262
1265
|
}
|
|
1263
|
-
}
|
|
1266
|
+
};
|
|
1267
|
+
// ../ui/src/vanilla/components/loading-indicator/wireframe-cube.ts
|
|
1268
|
+
function cn(e) {
|
|
1269
|
+
let t = Math.max(0, Math.min(1, e));
|
|
1270
|
+
return t * t * (3 - 2 * t);
|
|
1271
|
+
}
|
|
1272
|
+
function ln(e, t, n, r, i, a) {
|
|
1273
|
+
let [o, s, c] = e, l = Math.cos(t), u = Math.sin(t), ee = l * o + u * c, d = -u * o + l * c, f = Math.cos(n), p = Math.sin(n), te = f * s - p * d, ne = p * s + f * d, m = .55;
|
|
1274
|
+
return [
|
|
1275
|
+
r + ee * a * m,
|
|
1276
|
+
i - te * a * m,
|
|
1277
|
+
ne
|
|
1278
|
+
];
|
|
1279
|
+
}
|
|
1280
|
+
function un(e, t, n) {
|
|
1281
|
+
e.beginPath(), e.moveTo(t[0], t[1]), e.lineTo(n[0], n[1]), e.lineWidth = 2, e.stroke();
|
|
1282
|
+
}
|
|
1283
|
+
function dn(e, t, n, r, i) {
|
|
1284
|
+
let a = t(n), o = t(r);
|
|
1285
|
+
un(e, a, [
|
|
1286
|
+
a[0] + (o[0] - a[0]) * i,
|
|
1287
|
+
a[1] + (o[1] - a[1]) * i,
|
|
1288
|
+
a[2]
|
|
1289
|
+
]);
|
|
1290
|
+
}
|
|
1291
|
+
var I = [
|
|
1292
|
+
-1,
|
|
1293
|
+
-1,
|
|
1294
|
+
1
|
|
1295
|
+
], L = [
|
|
1296
|
+
1,
|
|
1297
|
+
-1,
|
|
1298
|
+
1
|
|
1299
|
+
], R = [
|
|
1300
|
+
1,
|
|
1301
|
+
-1,
|
|
1302
|
+
-1
|
|
1303
|
+
], z = [
|
|
1304
|
+
-1,
|
|
1305
|
+
-1,
|
|
1306
|
+
-1
|
|
1307
|
+
], B = [
|
|
1308
|
+
-1,
|
|
1309
|
+
1,
|
|
1310
|
+
1
|
|
1311
|
+
], V = [
|
|
1312
|
+
1,
|
|
1313
|
+
1,
|
|
1314
|
+
1
|
|
1315
|
+
], H = [
|
|
1316
|
+
1,
|
|
1317
|
+
1,
|
|
1318
|
+
-1
|
|
1319
|
+
], U = [
|
|
1320
|
+
-1,
|
|
1321
|
+
1,
|
|
1322
|
+
-1
|
|
1323
|
+
], W = [
|
|
1324
|
+
[I, L],
|
|
1325
|
+
[L, R],
|
|
1326
|
+
[R, z],
|
|
1327
|
+
[z, I],
|
|
1328
|
+
[I, B],
|
|
1329
|
+
[L, V],
|
|
1330
|
+
[R, H],
|
|
1331
|
+
[z, U],
|
|
1332
|
+
[B, V],
|
|
1333
|
+
[V, H],
|
|
1334
|
+
[H, U],
|
|
1335
|
+
[U, B]
|
|
1336
|
+
];
|
|
1337
|
+
function fn(e) {
|
|
1338
|
+
let t = e % 6 / 6, n = W.length;
|
|
1339
|
+
return t < .35 ? cn(t / .35) * n : t < .55 ? n : t < .9 ? (1 - cn((t - .55) / .35)) * n : 0;
|
|
1340
|
+
}
|
|
1341
|
+
function pn(e, { width: t, height: n }, r, i = "#000") {
|
|
1342
|
+
let a = t / 2, o = n * .44, s = Math.min(t, n) * .08, c = (e) => ln(e, .785, .615, a, o, s), l = fn(r);
|
|
1343
|
+
e.shadowBlur = 5, e.shadowColor = "rgba(30,30,30,0.08)", e.strokeStyle = i;
|
|
1344
|
+
for (let t = 0; t < W.length && !(t >= l); t++) {
|
|
1345
|
+
let n = W[t];
|
|
1346
|
+
if (n === void 0) continue;
|
|
1347
|
+
let r = Math.min(1, l - t);
|
|
1348
|
+
dn(e, c, n[0], n[1], r);
|
|
1349
|
+
}
|
|
1350
|
+
e.shadowBlur = 0;
|
|
1351
|
+
}
|
|
1352
|
+
// ../ui/src/vanilla/components/loading-indicator/index.ts
|
|
1353
|
+
var mn = 400, hn = 3e4, gn = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
|
|
1354
|
+
function _n(e) {
|
|
1355
|
+
let t = getComputedStyle(e).color, n = t === "" ? "#000" : t;
|
|
1356
|
+
return {
|
|
1357
|
+
surface: "transparent",
|
|
1358
|
+
ink: n,
|
|
1359
|
+
danger: n
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
function vn(e, t) {
|
|
1363
|
+
let n = document.createElement("div");
|
|
1364
|
+
Object.assign(n.style, {
|
|
1365
|
+
position: "absolute",
|
|
1366
|
+
inset: "0",
|
|
1367
|
+
display: "flex",
|
|
1368
|
+
flexDirection: "column",
|
|
1369
|
+
alignItems: "center",
|
|
1370
|
+
justifyContent: "center",
|
|
1371
|
+
background: e.surface,
|
|
1372
|
+
zIndex: "20",
|
|
1373
|
+
opacity: "0",
|
|
1374
|
+
transition: "opacity 0.3s ease-in-out"
|
|
1375
|
+
});
|
|
1376
|
+
let r = document.createElement("canvas");
|
|
1377
|
+
Object.assign(r.style, {
|
|
1378
|
+
width: "100%",
|
|
1379
|
+
height: "100%",
|
|
1380
|
+
position: "absolute",
|
|
1381
|
+
inset: "0"
|
|
1382
|
+
});
|
|
1383
|
+
let i = document.createElement("div");
|
|
1384
|
+
i.setAttribute("role", "status"), Object.assign(i.style, {
|
|
1385
|
+
position: "absolute",
|
|
1386
|
+
top: "56%",
|
|
1387
|
+
left: "0",
|
|
1388
|
+
right: "0",
|
|
1389
|
+
textAlign: "center",
|
|
1390
|
+
pointerEvents: "none"
|
|
1391
|
+
});
|
|
1392
|
+
let a = document.createElement("span");
|
|
1393
|
+
Object.assign(a.style, {
|
|
1394
|
+
fontSize: "13px",
|
|
1395
|
+
fontWeight: "400",
|
|
1396
|
+
color: e.ink,
|
|
1397
|
+
fontVariantNumeric: "tabular-nums",
|
|
1398
|
+
fontFamily: gn
|
|
1399
|
+
});
|
|
1400
|
+
let o = document.createElement("span");
|
|
1401
|
+
return Object.assign(o.style, {
|
|
1402
|
+
fontSize: "13px",
|
|
1403
|
+
color: e.ink,
|
|
1404
|
+
fontFamily: gn
|
|
1405
|
+
}), o.textContent = t, i.appendChild(a), i.appendChild(o), n.appendChild(r), n.appendChild(i), {
|
|
1406
|
+
overlay: n,
|
|
1407
|
+
canvas: r,
|
|
1408
|
+
pctEl: a,
|
|
1409
|
+
phaseEl: o
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
var yn = class {
|
|
1413
|
+
overlay;
|
|
1414
|
+
canvas;
|
|
1415
|
+
ctx;
|
|
1416
|
+
pctEl;
|
|
1417
|
+
phaseEl;
|
|
1418
|
+
animationId = null;
|
|
1419
|
+
showTimerId = null;
|
|
1420
|
+
noSignalTimerId = null;
|
|
1421
|
+
startTime;
|
|
1422
|
+
hidden = !1;
|
|
1423
|
+
visible = !1;
|
|
1424
|
+
errored = !1;
|
|
1425
|
+
noSignalErrored = !1;
|
|
1426
|
+
colours;
|
|
1427
|
+
text;
|
|
1428
|
+
constructor(e, t) {
|
|
1429
|
+
this.startTime = performance.now(), this.colours = t.colours ?? _n(e), this.text = t.text;
|
|
1430
|
+
let n = vn(this.colours, this.text.downloading());
|
|
1431
|
+
this.overlay = n.overlay, t.className !== void 0 && (this.overlay.className = t.className), this.canvas = n.canvas, this.pctEl = n.pctEl, this.phaseEl = n.phaseEl, e.appendChild(this.overlay), this.ctx = this.canvas.getContext("2d"), this.ctx !== null && (this.sizeCanvas(), this.tick()), this.showTimerId = setTimeout(() => {
|
|
1432
|
+
this.reveal();
|
|
1433
|
+
}, mn), this.noSignalTimerId = setTimeout(() => {
|
|
1434
|
+
this.hidden || (this.noSignalErrored = !0, this.showError(this.text.loadError()));
|
|
1435
|
+
}, hn);
|
|
1436
|
+
}
|
|
1437
|
+
viewerAlive() {
|
|
1438
|
+
this.cancelNoSignalTimer(), this.noSignalErrored && this.recoverFromNoSignal();
|
|
1439
|
+
}
|
|
1440
|
+
recoverFromNoSignal() {
|
|
1441
|
+
this.noSignalErrored = !1, this.errored = !1, this.pctEl.textContent = "", this.phaseEl.textContent = this.text.downloading(), this.phaseEl.style.color = this.colours.ink, this.ctx !== null && this.animationId === null && !this.hidden && this.tick();
|
|
1442
|
+
}
|
|
1443
|
+
recolour(e) {
|
|
1444
|
+
this.colours = e, this.overlay.style.background = e.surface, this.pctEl.style.color = e.ink, this.phaseEl.style.color = this.errored ? e.danger : e.ink, this.errored && this.clearCanvas();
|
|
1445
|
+
}
|
|
1446
|
+
updateProgress(e, t) {
|
|
1447
|
+
this.cancelNoSignalTimer(), this.hidden || this.errored || (this.pctEl.textContent = `${Math.round(e)}%`, this.phaseEl.textContent = t === "" ? "" : ` \u00B7 ${t}`);
|
|
1448
|
+
}
|
|
1449
|
+
showError(e) {
|
|
1450
|
+
this.cancelNoSignalTimer(), this.hidden = !1, this.errored = !0, this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.clearCanvas(), this.pctEl.textContent = "", this.phaseEl.textContent = e, this.phaseEl.style.color = this.colours.danger, this.reveal();
|
|
1451
|
+
}
|
|
1452
|
+
hide() {
|
|
1453
|
+
this.hidden || (this.hidden = !0, this.cancelShowTimer(), this.visible ? (this.overlay.style.opacity = "0", this.overlay.addEventListener("transitionend", () => {
|
|
1454
|
+
this.destroy();
|
|
1455
|
+
}, { once: !0 }), setTimeout(() => {
|
|
1456
|
+
this.destroy();
|
|
1457
|
+
}, 500)) : this.destroy());
|
|
1458
|
+
}
|
|
1459
|
+
destroy() {
|
|
1460
|
+
this.cancelShowTimer(), this.cancelNoSignalTimer(), this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.overlay.remove();
|
|
1461
|
+
}
|
|
1462
|
+
reveal() {
|
|
1463
|
+
this.hidden || this.visible || (this.visible = !0, this.overlay.style.opacity = "1");
|
|
1464
|
+
}
|
|
1465
|
+
clearCanvas() {
|
|
1466
|
+
if (this.ctx === null) return;
|
|
1467
|
+
let e = Math.min(devicePixelRatio, 2), t = this.canvas.width / e, n = this.canvas.height / e;
|
|
1468
|
+
this.ctx.clearRect(0, 0, t, n);
|
|
1469
|
+
}
|
|
1470
|
+
cancelShowTimer() {
|
|
1471
|
+
this.showTimerId !== null && (clearTimeout(this.showTimerId), this.showTimerId = null);
|
|
1472
|
+
}
|
|
1473
|
+
cancelNoSignalTimer() {
|
|
1474
|
+
this.noSignalTimerId !== null && (clearTimeout(this.noSignalTimerId), this.noSignalTimerId = null);
|
|
1475
|
+
}
|
|
1476
|
+
sizeCanvas() {
|
|
1477
|
+
if (this.ctx === null) return;
|
|
1478
|
+
let e = Math.min(devicePixelRatio, 2), t = this.overlay.clientWidth || 440, n = this.overlay.clientHeight || 360;
|
|
1479
|
+
this.canvas.width = t * e, this.canvas.height = n * e, this.ctx.scale(e, e), this.ctx.lineCap = "round", this.ctx.lineJoin = "round";
|
|
1480
|
+
}
|
|
1481
|
+
tick = () => {
|
|
1482
|
+
this.hidden || (this.drawFrame(), this.animationId = requestAnimationFrame(this.tick));
|
|
1483
|
+
};
|
|
1484
|
+
drawFrame() {
|
|
1485
|
+
if (this.ctx === null) return;
|
|
1486
|
+
let e = this.canvas.width / Math.min(devicePixelRatio, 2), t = this.canvas.height / Math.min(devicePixelRatio, 2), n = (performance.now() - this.startTime) / 1e3;
|
|
1487
|
+
this.ctx.clearRect(0, 0, e, t), pn(this.ctx, {
|
|
1488
|
+
width: e,
|
|
1489
|
+
height: t
|
|
1490
|
+
}, n, this.colours.ink);
|
|
1491
|
+
}
|
|
1492
|
+
}, bn = class {
|
|
1264
1493
|
element;
|
|
1265
1494
|
selectCallback = null;
|
|
1266
1495
|
constructor(e, t, n) {
|
|
@@ -1287,7 +1516,7 @@ var M = {
|
|
|
1287
1516
|
t.disabled = !n, t.setAttribute("aria-disabled", n ? "false" : "true");
|
|
1288
1517
|
}
|
|
1289
1518
|
}
|
|
1290
|
-
},
|
|
1519
|
+
}, xn = class {
|
|
1291
1520
|
element;
|
|
1292
1521
|
select;
|
|
1293
1522
|
constructor(e, t, n, r, i) {
|
|
@@ -1300,7 +1529,7 @@ var M = {
|
|
|
1300
1529
|
a.value = n, a.textContent = i?.[e] ?? n, n === r && (a.selected = !0, o = !0), this.select.appendChild(a);
|
|
1301
1530
|
}
|
|
1302
1531
|
o || (a.selected = !0);
|
|
1303
|
-
let s =
|
|
1532
|
+
let s = Kt(M, {
|
|
1304
1533
|
width: 16,
|
|
1305
1534
|
height: 16,
|
|
1306
1535
|
"stroke-width": 2
|
|
@@ -1318,7 +1547,7 @@ var M = {
|
|
|
1318
1547
|
setEnabled(e) {
|
|
1319
1548
|
for (let t of this.select.options) t.value !== "" && (t.disabled = e !== null && !e.includes(t.value));
|
|
1320
1549
|
}
|
|
1321
|
-
},
|
|
1550
|
+
}, Sn = class {
|
|
1322
1551
|
element;
|
|
1323
1552
|
input;
|
|
1324
1553
|
valueText;
|
|
@@ -1379,7 +1608,7 @@ var M = {
|
|
|
1379
1608
|
let t = this.labelAt(e);
|
|
1380
1609
|
return this.options.unit === void 0 ? t : `${t} ${this.options.unit}`;
|
|
1381
1610
|
}
|
|
1382
|
-
},
|
|
1611
|
+
}, G = {
|
|
1383
1612
|
neutral: {
|
|
1384
1613
|
50: "oklch(98.5% 0 0)",
|
|
1385
1614
|
100: "oklch(96.5% 0 0)",
|
|
@@ -1395,7 +1624,7 @@ var M = {
|
|
|
1395
1624
|
},
|
|
1396
1625
|
white: "oklch(100% 0 0)",
|
|
1397
1626
|
semantic: { error: "oklch(47% 0.17 25)" }
|
|
1398
|
-
},
|
|
1627
|
+
}, K = {
|
|
1399
1628
|
px: "1px",
|
|
1400
1629
|
0: "0",
|
|
1401
1630
|
.5: "0.125rem",
|
|
@@ -1417,7 +1646,7 @@ var M = {
|
|
|
1417
1646
|
16: "4rem",
|
|
1418
1647
|
20: "5rem",
|
|
1419
1648
|
24: "6rem"
|
|
1420
|
-
},
|
|
1649
|
+
}, q = {
|
|
1421
1650
|
fontFamily: {
|
|
1422
1651
|
sans: [
|
|
1423
1652
|
"Mona Sans",
|
|
@@ -1456,25 +1685,25 @@ var M = {
|
|
|
1456
1685
|
normal: "1.5",
|
|
1457
1686
|
relaxed: "1.75"
|
|
1458
1687
|
}
|
|
1459
|
-
},
|
|
1688
|
+
}, Cn = class {
|
|
1460
1689
|
element;
|
|
1461
1690
|
constructor() {
|
|
1462
1691
|
this.element = document.createElement("div"), Object.assign(this.element.style, {
|
|
1463
|
-
background:
|
|
1692
|
+
background: G.white,
|
|
1464
1693
|
borderRadius: "var(--radius)",
|
|
1465
|
-
padding:
|
|
1466
|
-
boxShadow: `0 ${
|
|
1694
|
+
padding: K[6],
|
|
1695
|
+
boxShadow: `0 ${K[2]} ${K[8]} oklch(0% 0 0 / 20%)`,
|
|
1467
1696
|
maxWidth: "20rem",
|
|
1468
1697
|
width: "100%"
|
|
1469
1698
|
});
|
|
1470
1699
|
}
|
|
1471
|
-
},
|
|
1700
|
+
}, wn = class {
|
|
1472
1701
|
options;
|
|
1473
1702
|
card;
|
|
1474
1703
|
backdrop;
|
|
1475
1704
|
keyHandler = null;
|
|
1476
1705
|
constructor(e = {}) {
|
|
1477
|
-
this.options = e, this.card = new
|
|
1706
|
+
this.options = e, this.card = new Cn(), this.backdrop = this.createBackdrop(), this.backdrop.appendChild(this.card.element);
|
|
1478
1707
|
}
|
|
1479
1708
|
get content() {
|
|
1480
1709
|
return this.card.element;
|
|
@@ -1491,7 +1720,7 @@ var M = {
|
|
|
1491
1720
|
let e = document.createElement("div");
|
|
1492
1721
|
return Object.assign(e.style, {
|
|
1493
1722
|
position: "fixed",
|
|
1494
|
-
inset:
|
|
1723
|
+
inset: K[0],
|
|
1495
1724
|
background: "oklch(0% 0 0 / 50%)",
|
|
1496
1725
|
zIndex: "9999",
|
|
1497
1726
|
display: "flex",
|
|
@@ -1501,7 +1730,7 @@ var M = {
|
|
|
1501
1730
|
t.target === e && this.close();
|
|
1502
1731
|
}), e;
|
|
1503
1732
|
}
|
|
1504
|
-
},
|
|
1733
|
+
}, J = q.fontFamily.sans.join(", "), Tn = `
|
|
1505
1734
|
:root {
|
|
1506
1735
|
--primary: oklch(5% 0 0);
|
|
1507
1736
|
--primary-foreground: oklch(100% 0 0);
|
|
@@ -1525,7 +1754,7 @@ var M = {
|
|
|
1525
1754
|
gap: 0.5rem;
|
|
1526
1755
|
border: 1px solid transparent;
|
|
1527
1756
|
border-radius: var(--radius);
|
|
1528
|
-
font-family: ${
|
|
1757
|
+
font-family: ${J};
|
|
1529
1758
|
font-size: 0.875rem;
|
|
1530
1759
|
font-weight: 600;
|
|
1531
1760
|
white-space: nowrap;
|
|
@@ -1582,7 +1811,7 @@ var M = {
|
|
|
1582
1811
|
border-radius: var(--radius);
|
|
1583
1812
|
background: var(--background);
|
|
1584
1813
|
color: var(--foreground);
|
|
1585
|
-
font-family: ${
|
|
1814
|
+
font-family: ${J};
|
|
1586
1815
|
font-size: 0.875rem;
|
|
1587
1816
|
font-weight: 600;
|
|
1588
1817
|
cursor: pointer;
|
|
@@ -1623,7 +1852,7 @@ var M = {
|
|
|
1623
1852
|
background: var(--background);
|
|
1624
1853
|
appearance: none;
|
|
1625
1854
|
color: var(--foreground);
|
|
1626
|
-
font-family: ${
|
|
1855
|
+
font-family: ${J};
|
|
1627
1856
|
font-size: 0.875rem;
|
|
1628
1857
|
font-weight: 400;
|
|
1629
1858
|
cursor: pointer;
|
|
@@ -1661,7 +1890,7 @@ var M = {
|
|
|
1661
1890
|
|
|
1662
1891
|
/* Tabular figures keep the readout and layout steady mid-drag. */
|
|
1663
1892
|
.ui-slider-value {
|
|
1664
|
-
font-family: ${
|
|
1893
|
+
font-family: ${J};
|
|
1665
1894
|
font-size: 0.875rem;
|
|
1666
1895
|
font-weight: 600;
|
|
1667
1896
|
color: var(--foreground);
|
|
@@ -1672,7 +1901,7 @@ var M = {
|
|
|
1672
1901
|
.ui-slider-ends {
|
|
1673
1902
|
display: flex;
|
|
1674
1903
|
justify-content: space-between;
|
|
1675
|
-
font-family: ${
|
|
1904
|
+
font-family: ${J};
|
|
1676
1905
|
font-size: 0.75rem;
|
|
1677
1906
|
color: var(--muted-foreground);
|
|
1678
1907
|
font-variant-numeric: tabular-nums;
|
|
@@ -1808,7 +2037,7 @@ var M = {
|
|
|
1808
2037
|
border: 2px solid oklch(100% 0 0);
|
|
1809
2038
|
background: var(--primary);
|
|
1810
2039
|
color: var(--primary-foreground);
|
|
1811
|
-
font-family: ${
|
|
2040
|
+
font-family: ${J};
|
|
1812
2041
|
font-size: 0.8125rem;
|
|
1813
2042
|
font-weight: 600;
|
|
1814
2043
|
cursor: pointer;
|
|
@@ -1897,7 +2126,7 @@ var M = {
|
|
|
1897
2126
|
}
|
|
1898
2127
|
|
|
1899
2128
|
.vd-annotation-popup-title {
|
|
1900
|
-
font-family: ${
|
|
2129
|
+
font-family: ${J};
|
|
1901
2130
|
font-size: 0.875rem;
|
|
1902
2131
|
font-weight: 600;
|
|
1903
2132
|
line-height: 1.25rem;
|
|
@@ -1945,7 +2174,7 @@ button.vd-annotation-popup-title:focus-visible {
|
|
|
1945
2174
|
}
|
|
1946
2175
|
|
|
1947
2176
|
.vd-annotation-popup-description {
|
|
1948
|
-
font-family: ${
|
|
2177
|
+
font-family: ${J};
|
|
1949
2178
|
font-size: 0.8125rem;
|
|
1950
2179
|
font-weight: 400;
|
|
1951
2180
|
line-height: 1.125rem;
|
|
@@ -1984,41 +2213,41 @@ button.vd-annotation-popup-title:focus-visible {
|
|
|
1984
2213
|
0%, 100% { opacity: 1; }
|
|
1985
2214
|
50% { opacity: 0.55; }
|
|
1986
2215
|
}
|
|
1987
|
-
`,
|
|
1988
|
-
function
|
|
1989
|
-
if (
|
|
1990
|
-
|
|
2216
|
+
`, En = !1;
|
|
2217
|
+
function Dn() {
|
|
2218
|
+
if (En || typeof document > "u") return;
|
|
2219
|
+
En = !0;
|
|
1991
2220
|
let e = document.createElement("style");
|
|
1992
|
-
e.id = "vd-ui-vanilla", e.textContent =
|
|
2221
|
+
e.id = "vd-ui-vanilla", e.textContent = Tn, document.head.appendChild(e);
|
|
1993
2222
|
}
|
|
1994
2223
|
// ../ui/src/vanilla/composites/qr-modal/index.ts
|
|
1995
|
-
var
|
|
2224
|
+
var On = q.fontFamily.sans.join(", "), kn = class {
|
|
1996
2225
|
qrLib = null;
|
|
1997
2226
|
dialog = null;
|
|
1998
2227
|
qrSlot = null;
|
|
1999
2228
|
show() {
|
|
2000
|
-
this.hide(),
|
|
2229
|
+
this.hide(), Dn(), this.dialog = new wn({ onClose: () => {
|
|
2001
2230
|
this.dialog = null, this.qrSlot = null;
|
|
2002
2231
|
} }), Object.assign(this.dialog.content.style, {
|
|
2003
2232
|
display: "flex",
|
|
2004
2233
|
flexDirection: "column",
|
|
2005
2234
|
alignItems: "center",
|
|
2006
|
-
gap:
|
|
2007
|
-
fontFamily:
|
|
2008
|
-
}), this.dialog.content.appendChild(this.createText(
|
|
2009
|
-
fontSize:
|
|
2010
|
-
fontWeight:
|
|
2011
|
-
color:
|
|
2012
|
-
})), this.dialog.content.appendChild(this.createText(
|
|
2013
|
-
fontSize:
|
|
2014
|
-
color:
|
|
2015
|
-
})), this.qrSlot = this.createQrSlot(), this.dialog.content.appendChild(this.qrSlot), this.dialog.content.appendChild(this.createText(
|
|
2016
|
-
fontSize:
|
|
2017
|
-
color:
|
|
2235
|
+
gap: K[3],
|
|
2236
|
+
fontFamily: On
|
|
2237
|
+
}), this.dialog.content.appendChild(this.createText(zt(), {
|
|
2238
|
+
fontSize: q.fontSize.base,
|
|
2239
|
+
fontWeight: q.fontWeight.semibold,
|
|
2240
|
+
color: G.neutral[900]
|
|
2241
|
+
})), this.dialog.content.appendChild(this.createText(Lt(), {
|
|
2242
|
+
fontSize: q.fontSize.sm,
|
|
2243
|
+
color: G.neutral[600]
|
|
2244
|
+
})), this.qrSlot = this.createQrSlot(), this.dialog.content.appendChild(this.qrSlot), this.dialog.content.appendChild(this.createText(Rt(), {
|
|
2245
|
+
fontSize: q.fontSize.xs,
|
|
2246
|
+
color: G.neutral[500]
|
|
2018
2247
|
}));
|
|
2019
|
-
let e = new
|
|
2248
|
+
let e = new F({
|
|
2020
2249
|
variant: "outline",
|
|
2021
|
-
label:
|
|
2250
|
+
label: Ft(),
|
|
2022
2251
|
onClick: () => {
|
|
2023
2252
|
this.hide();
|
|
2024
2253
|
}
|
|
@@ -2028,7 +2257,7 @@ var vn = I.fontFamily.sans.join(", "), yn = class {
|
|
|
2028
2257
|
async update(t) {
|
|
2029
2258
|
let n;
|
|
2030
2259
|
try {
|
|
2031
|
-
this.qrLib ??= await import("./browser-
|
|
2260
|
+
this.qrLib ??= await import("./browser-xDScqAR5.js").then((t) => /* @__PURE__ */ e(t.default, 1)), n = await this.qrLib.toDataURL(t, {
|
|
2032
2261
|
width: 256,
|
|
2033
2262
|
margin: 4,
|
|
2034
2263
|
errorCorrectionLevel: "M",
|
|
@@ -2043,12 +2272,12 @@ var vn = I.fontFamily.sans.join(", "), yn = class {
|
|
|
2043
2272
|
return this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(n)), !0);
|
|
2044
2273
|
}
|
|
2045
2274
|
showLink(e) {
|
|
2046
|
-
this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createText(
|
|
2047
|
-
fontSize:
|
|
2048
|
-
color:
|
|
2275
|
+
this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createText(Bt(), {
|
|
2276
|
+
fontSize: q.fontSize.sm,
|
|
2277
|
+
color: G.neutral[600]
|
|
2049
2278
|
}), this.createText(e, {
|
|
2050
|
-
fontSize:
|
|
2051
|
-
color:
|
|
2279
|
+
fontSize: q.fontSize.xs,
|
|
2280
|
+
color: G.neutral[900],
|
|
2052
2281
|
overflowWrap: "anywhere",
|
|
2053
2282
|
userSelect: "all"
|
|
2054
2283
|
})));
|
|
@@ -2070,223 +2299,9 @@ var vn = I.fontFamily.sans.join(", "), yn = class {
|
|
|
2070
2299
|
}
|
|
2071
2300
|
createQrImage(e) {
|
|
2072
2301
|
let t = document.createElement("img");
|
|
2073
|
-
return t.src = e, t.alt =
|
|
2074
|
-
}
|
|
2075
|
-
};
|
|
2076
|
-
// ../client-core/src/ui/wireframe-cube.ts
|
|
2077
|
-
function bn(e) {
|
|
2078
|
-
let t = Math.max(0, Math.min(1, e));
|
|
2079
|
-
return t * t * (3 - 2 * t);
|
|
2080
|
-
}
|
|
2081
|
-
function xn(e, t, n, r, i, a) {
|
|
2082
|
-
let [o, s, c] = e, l = Math.cos(t), u = Math.sin(t), ee = l * o + u * c, d = -u * o + l * c, f = Math.cos(n), p = Math.sin(n), te = f * s - p * d, ne = p * s + f * d, m = .55;
|
|
2083
|
-
return [
|
|
2084
|
-
r + ee * a * m,
|
|
2085
|
-
i - te * a * m,
|
|
2086
|
-
ne
|
|
2087
|
-
];
|
|
2088
|
-
}
|
|
2089
|
-
function Sn(e, t, n) {
|
|
2090
|
-
e.beginPath(), e.moveTo(t[0], t[1]), e.lineTo(n[0], n[1]), e.lineWidth = 2, e.stroke();
|
|
2091
|
-
}
|
|
2092
|
-
function Cn(e, t, n, r, i) {
|
|
2093
|
-
let a = t(n), o = t(r);
|
|
2094
|
-
Sn(e, a, [
|
|
2095
|
-
a[0] + (o[0] - a[0]) * i,
|
|
2096
|
-
a[1] + (o[1] - a[1]) * i,
|
|
2097
|
-
a[2]
|
|
2098
|
-
]);
|
|
2099
|
-
}
|
|
2100
|
-
var R = [
|
|
2101
|
-
-1,
|
|
2102
|
-
-1,
|
|
2103
|
-
1
|
|
2104
|
-
], z = [
|
|
2105
|
-
1,
|
|
2106
|
-
-1,
|
|
2107
|
-
1
|
|
2108
|
-
], B = [
|
|
2109
|
-
1,
|
|
2110
|
-
-1,
|
|
2111
|
-
-1
|
|
2112
|
-
], V = [
|
|
2113
|
-
-1,
|
|
2114
|
-
-1,
|
|
2115
|
-
-1
|
|
2116
|
-
], H = [
|
|
2117
|
-
-1,
|
|
2118
|
-
1,
|
|
2119
|
-
1
|
|
2120
|
-
], U = [
|
|
2121
|
-
1,
|
|
2122
|
-
1,
|
|
2123
|
-
1
|
|
2124
|
-
], W = [
|
|
2125
|
-
1,
|
|
2126
|
-
1,
|
|
2127
|
-
-1
|
|
2128
|
-
], G = [
|
|
2129
|
-
-1,
|
|
2130
|
-
1,
|
|
2131
|
-
-1
|
|
2132
|
-
], K = [
|
|
2133
|
-
[R, z],
|
|
2134
|
-
[z, B],
|
|
2135
|
-
[B, V],
|
|
2136
|
-
[V, R],
|
|
2137
|
-
[R, H],
|
|
2138
|
-
[z, U],
|
|
2139
|
-
[B, W],
|
|
2140
|
-
[V, G],
|
|
2141
|
-
[H, U],
|
|
2142
|
-
[U, W],
|
|
2143
|
-
[W, G],
|
|
2144
|
-
[G, H]
|
|
2145
|
-
];
|
|
2146
|
-
function wn(e) {
|
|
2147
|
-
let t = e % 6 / 6, n = K.length;
|
|
2148
|
-
return t < .35 ? bn(t / .35) * n : t < .55 ? n : t < .9 ? (1 - bn((t - .55) / .35)) * n : 0;
|
|
2149
|
-
}
|
|
2150
|
-
function Tn(e, { width: t, height: n }, r, i) {
|
|
2151
|
-
let a = t / 2, o = n * .44, s = Math.min(t, n) * .08, c = (e) => xn(e, .785, .615, a, o, s), l = wn(r);
|
|
2152
|
-
e.shadowBlur = 5, e.shadowColor = "rgba(30,30,30,0.08)", e.strokeStyle = i;
|
|
2153
|
-
for (let t = 0; t < K.length && !(t >= l); t++) {
|
|
2154
|
-
let n = K[t];
|
|
2155
|
-
if (n === void 0) continue;
|
|
2156
|
-
let r = Math.min(1, l - t);
|
|
2157
|
-
Cn(e, c, n[0], n[1], r);
|
|
2302
|
+
return t.src = e, t.alt = It(), t;
|
|
2158
2303
|
}
|
|
2159
|
-
|
|
2160
|
-
}
|
|
2161
|
-
// ../client-core/src/ui/loading.ts
|
|
2162
|
-
var En = 400, Dn = 3e4, On = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
|
|
2163
|
-
function kn(e) {
|
|
2164
|
-
let t = document.createElement("div");
|
|
2165
|
-
Object.assign(t.style, {
|
|
2166
|
-
position: "absolute",
|
|
2167
|
-
inset: "0",
|
|
2168
|
-
display: "flex",
|
|
2169
|
-
flexDirection: "column",
|
|
2170
|
-
alignItems: "center",
|
|
2171
|
-
justifyContent: "center",
|
|
2172
|
-
background: "transparent",
|
|
2173
|
-
color: e,
|
|
2174
|
-
zIndex: "20",
|
|
2175
|
-
opacity: "0",
|
|
2176
|
-
transition: "opacity 0.3s ease-in-out"
|
|
2177
|
-
});
|
|
2178
|
-
let n = document.createElement("canvas");
|
|
2179
|
-
Object.assign(n.style, {
|
|
2180
|
-
width: "100%",
|
|
2181
|
-
height: "100%",
|
|
2182
|
-
position: "absolute",
|
|
2183
|
-
inset: "0"
|
|
2184
|
-
});
|
|
2185
|
-
let r = document.createElement("div");
|
|
2186
|
-
Object.assign(r.style, {
|
|
2187
|
-
position: "absolute",
|
|
2188
|
-
top: "56%",
|
|
2189
|
-
left: "0",
|
|
2190
|
-
right: "0",
|
|
2191
|
-
textAlign: "center",
|
|
2192
|
-
pointerEvents: "none"
|
|
2193
|
-
});
|
|
2194
|
-
let i = document.createElement("span");
|
|
2195
|
-
Object.assign(i.style, {
|
|
2196
|
-
fontSize: "13px",
|
|
2197
|
-
fontWeight: "400",
|
|
2198
|
-
fontVariantNumeric: "tabular-nums",
|
|
2199
|
-
fontFamily: On
|
|
2200
|
-
});
|
|
2201
|
-
let a = document.createElement("span");
|
|
2202
|
-
return Object.assign(a.style, {
|
|
2203
|
-
fontSize: "13px",
|
|
2204
|
-
fontFamily: On
|
|
2205
|
-
}), a.textContent = Ut(), r.appendChild(i), r.appendChild(a), t.appendChild(n), t.appendChild(r), {
|
|
2206
|
-
overlay: t,
|
|
2207
|
-
canvas: n,
|
|
2208
|
-
pctEl: i,
|
|
2209
|
-
phaseEl: a
|
|
2210
|
-
};
|
|
2211
|
-
}
|
|
2212
|
-
var An = class {
|
|
2213
|
-
overlay;
|
|
2214
|
-
canvas;
|
|
2215
|
-
ctx;
|
|
2216
|
-
pctEl;
|
|
2217
|
-
phaseEl;
|
|
2218
|
-
animationId = null;
|
|
2219
|
-
showTimerId = null;
|
|
2220
|
-
noSignalTimerId = null;
|
|
2221
|
-
startTime;
|
|
2222
|
-
textColor;
|
|
2223
|
-
hidden = !1;
|
|
2224
|
-
visible = !1;
|
|
2225
|
-
errored = !1;
|
|
2226
|
-
noSignalErrored = !1;
|
|
2227
|
-
constructor(e) {
|
|
2228
|
-
this.startTime = performance.now();
|
|
2229
|
-
let t = getComputedStyle(e).color;
|
|
2230
|
-
this.textColor = t === "" ? "#000" : t;
|
|
2231
|
-
let n = kn(this.textColor);
|
|
2232
|
-
this.overlay = n.overlay, this.canvas = n.canvas, this.pctEl = n.pctEl, this.phaseEl = n.phaseEl, e.appendChild(this.overlay), this.ctx = this.canvas.getContext("2d"), this.ctx !== null && (this.sizeCanvas(), this.tick()), this.showTimerId = setTimeout(() => {
|
|
2233
|
-
this.reveal();
|
|
2234
|
-
}, En), this.noSignalTimerId = setTimeout(() => {
|
|
2235
|
-
this.hidden || (this.noSignalErrored = !0, this.showError(Wt()));
|
|
2236
|
-
}, Dn);
|
|
2237
|
-
}
|
|
2238
|
-
viewerAlive() {
|
|
2239
|
-
this.cancelNoSignalTimer(), this.noSignalErrored && this.recoverFromNoSignal();
|
|
2240
|
-
}
|
|
2241
|
-
recoverFromNoSignal() {
|
|
2242
|
-
this.noSignalErrored = !1, this.errored = !1, this.pctEl.textContent = "", this.phaseEl.textContent = Ut(), this.ctx !== null && this.animationId === null && !this.hidden && this.tick();
|
|
2243
|
-
}
|
|
2244
|
-
updateProgress(e, t) {
|
|
2245
|
-
this.cancelNoSignalTimer(), !(this.hidden || this.errored) && (this.pctEl.textContent = `${Math.round(e)}%`, this.phaseEl.textContent = t === "" ? "" : ` \u00B7 ${t}`);
|
|
2246
|
-
}
|
|
2247
|
-
showError(e) {
|
|
2248
|
-
if (this.cancelNoSignalTimer(), this.hidden = !1, this.errored = !0, this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.ctx !== null) {
|
|
2249
|
-
let e = Math.min(devicePixelRatio, 2), t = this.canvas.width / e, n = this.canvas.height / e;
|
|
2250
|
-
this.ctx.clearRect(0, 0, t, n);
|
|
2251
|
-
}
|
|
2252
|
-
this.pctEl.textContent = "", this.phaseEl.textContent = e, this.reveal();
|
|
2253
|
-
}
|
|
2254
|
-
hide() {
|
|
2255
|
-
this.hidden || (this.hidden = !0, this.cancelShowTimer(), this.visible ? (this.overlay.style.opacity = "0", this.overlay.addEventListener("transitionend", () => {
|
|
2256
|
-
this.destroy();
|
|
2257
|
-
}, { once: !0 }), setTimeout(() => {
|
|
2258
|
-
this.destroy();
|
|
2259
|
-
}, 500)) : this.destroy());
|
|
2260
|
-
}
|
|
2261
|
-
destroy() {
|
|
2262
|
-
this.cancelShowTimer(), this.cancelNoSignalTimer(), this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.overlay.remove();
|
|
2263
|
-
}
|
|
2264
|
-
reveal() {
|
|
2265
|
-
this.hidden || this.visible || (this.visible = !0, this.overlay.style.opacity = "1");
|
|
2266
|
-
}
|
|
2267
|
-
cancelShowTimer() {
|
|
2268
|
-
this.showTimerId !== null && (clearTimeout(this.showTimerId), this.showTimerId = null);
|
|
2269
|
-
}
|
|
2270
|
-
cancelNoSignalTimer() {
|
|
2271
|
-
this.noSignalTimerId !== null && (clearTimeout(this.noSignalTimerId), this.noSignalTimerId = null);
|
|
2272
|
-
}
|
|
2273
|
-
sizeCanvas() {
|
|
2274
|
-
if (this.ctx === null) return;
|
|
2275
|
-
let e = Math.min(devicePixelRatio, 2), t = this.overlay.clientWidth || 440, n = this.overlay.clientHeight || 360;
|
|
2276
|
-
this.canvas.width = t * e, this.canvas.height = n * e, this.ctx.scale(e, e), this.ctx.lineCap = "round", this.ctx.lineJoin = "round";
|
|
2277
|
-
}
|
|
2278
|
-
tick = () => {
|
|
2279
|
-
this.hidden || (this.drawFrame(), this.animationId = requestAnimationFrame(this.tick));
|
|
2280
|
-
};
|
|
2281
|
-
drawFrame() {
|
|
2282
|
-
if (this.ctx === null) return;
|
|
2283
|
-
let e = this.canvas.width / Math.min(devicePixelRatio, 2), t = this.canvas.height / Math.min(devicePixelRatio, 2), n = (performance.now() - this.startTime) / 1e3;
|
|
2284
|
-
this.ctx.clearRect(0, 0, e, t), Tn(this.ctx, {
|
|
2285
|
-
width: e,
|
|
2286
|
-
height: t
|
|
2287
|
-
}, n, this.textColor);
|
|
2288
|
-
}
|
|
2289
|
-
}, jn = class {
|
|
2304
|
+
}, An = class {
|
|
2290
2305
|
options;
|
|
2291
2306
|
element;
|
|
2292
2307
|
arBtn = null;
|
|
@@ -2303,7 +2318,7 @@ var An = class {
|
|
|
2303
2318
|
}, document.addEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2304
2319
|
}
|
|
2305
2320
|
setFullscreenIcon(e) {
|
|
2306
|
-
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ?
|
|
2321
|
+
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ? P.exitFullscreen() : P.fullscreen());
|
|
2307
2322
|
}
|
|
2308
2323
|
syncButton(e, t, n) {
|
|
2309
2324
|
if (t && e === null) {
|
|
@@ -2313,19 +2328,19 @@ var An = class {
|
|
|
2313
2328
|
return !t && e !== null ? (e.element.remove(), null) : e;
|
|
2314
2329
|
}
|
|
2315
2330
|
applySettings(e) {
|
|
2316
|
-
this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new
|
|
2331
|
+
this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new F({
|
|
2317
2332
|
variant: "outline",
|
|
2318
2333
|
size: "icon",
|
|
2319
|
-
label:
|
|
2320
|
-
icon:
|
|
2334
|
+
label: wt(),
|
|
2335
|
+
icon: P.ar(),
|
|
2321
2336
|
onClick: () => {
|
|
2322
2337
|
this.options.onAr?.();
|
|
2323
2338
|
}
|
|
2324
|
-
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new
|
|
2339
|
+
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new F({
|
|
2325
2340
|
variant: "outline",
|
|
2326
2341
|
size: "icon",
|
|
2327
|
-
label:
|
|
2328
|
-
icon:
|
|
2342
|
+
label: Pt(),
|
|
2343
|
+
icon: P.fullscreen(),
|
|
2329
2344
|
onClick: () => {
|
|
2330
2345
|
this.options.onFullscreen?.();
|
|
2331
2346
|
}
|
|
@@ -2333,11 +2348,11 @@ var An = class {
|
|
|
2333
2348
|
let t = e.annotations === "toggle-shown" || e.annotations === "toggle-hidden";
|
|
2334
2349
|
this.annotationsBtn = this.syncButton(this.annotationsBtn, t && this.options.onAnnotationsToggle !== void 0, () => {
|
|
2335
2350
|
this.annotationsShown = e.annotations === "toggle-shown";
|
|
2336
|
-
let t = new
|
|
2351
|
+
let t = new F({
|
|
2337
2352
|
variant: "outline",
|
|
2338
2353
|
size: "icon",
|
|
2339
|
-
label:
|
|
2340
|
-
icon: this.annotationsShown ?
|
|
2354
|
+
label: Ct(),
|
|
2355
|
+
icon: this.annotationsShown ? P.annotations() : P.annotationsOff(),
|
|
2341
2356
|
onClick: () => {
|
|
2342
2357
|
this.flipAnnotations();
|
|
2343
2358
|
}
|
|
@@ -2346,12 +2361,12 @@ var An = class {
|
|
|
2346
2361
|
});
|
|
2347
2362
|
}
|
|
2348
2363
|
flipAnnotations() {
|
|
2349
|
-
this.annotationsShown = !this.annotationsShown, this.annotationsBtn?.element.setAttribute("aria-pressed", String(this.annotationsShown)), this.annotationsBtn?.setIcon(this.annotationsShown ?
|
|
2364
|
+
this.annotationsShown = !this.annotationsShown, this.annotationsBtn?.element.setAttribute("aria-pressed", String(this.annotationsShown)), this.annotationsBtn?.setIcon(this.annotationsShown ? P.annotations() : P.annotationsOff()), this.options.onAnnotationsToggle?.(this.annotationsShown);
|
|
2350
2365
|
}
|
|
2351
2366
|
destroy() {
|
|
2352
2367
|
document.removeEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2353
2368
|
}
|
|
2354
|
-
},
|
|
2369
|
+
}, Y = .5, jn = class e {
|
|
2355
2370
|
element;
|
|
2356
2371
|
constructor(t, n) {
|
|
2357
2372
|
this.element = Object.assign(document.createElement("div"), { className: "vd-camera-controls" });
|
|
@@ -2382,18 +2397,18 @@ var An = class {
|
|
|
2382
2397
|
return a;
|
|
2383
2398
|
}
|
|
2384
2399
|
};
|
|
2385
|
-
function
|
|
2400
|
+
function Mn(e, t) {
|
|
2386
2401
|
let n = e;
|
|
2387
2402
|
for (; n < t;) n += 360;
|
|
2388
2403
|
for (; n >= t + 360;) n -= 360;
|
|
2389
2404
|
return n;
|
|
2390
2405
|
}
|
|
2391
|
-
function
|
|
2392
|
-
let r =
|
|
2406
|
+
function Nn(e, t, n) {
|
|
2407
|
+
let r = Mn(e, t);
|
|
2393
2408
|
return r <= n ? r : r - n <= t + 360 - r ? n : t;
|
|
2394
2409
|
}
|
|
2395
|
-
function
|
|
2396
|
-
return new
|
|
2410
|
+
function X(e, t, n) {
|
|
2411
|
+
return new F({
|
|
2397
2412
|
variant: "outline",
|
|
2398
2413
|
size: "icon",
|
|
2399
2414
|
label: e,
|
|
@@ -2401,14 +2416,14 @@ function J(e, t, n) {
|
|
|
2401
2416
|
onClick: n
|
|
2402
2417
|
});
|
|
2403
2418
|
}
|
|
2404
|
-
function
|
|
2419
|
+
function Pn(e, t) {
|
|
2405
2420
|
return Math.max(e.limits?.minZoom ?? 1, Math.min(e.limits?.maxZoom ?? Infinity, t));
|
|
2406
2421
|
}
|
|
2407
|
-
function
|
|
2422
|
+
function Fn(e, t) {
|
|
2408
2423
|
let n = e.limits?.minRotate, r = e.limits?.maxRotate;
|
|
2409
|
-
return n === void 0 || r === void 0 || r - n >= 360 ? t :
|
|
2424
|
+
return n === void 0 || r === void 0 || r - n >= 360 ? t : Nn(t, n, r);
|
|
2410
2425
|
}
|
|
2411
|
-
function
|
|
2426
|
+
function In(e, t, n, r) {
|
|
2412
2427
|
let i = t.limits?.minTilt, a = t.limits?.maxTilt;
|
|
2413
2428
|
if (i !== void 0 || a !== void 0) {
|
|
2414
2429
|
n.targetTilt = Math.max(i ?? 0, Math.min(a ?? 180, n.targetTilt + r)), e.tilt(n.targetTilt).set();
|
|
@@ -2419,124 +2434,149 @@ function Y(e, t, n, r) {
|
|
|
2419
2434
|
}
|
|
2420
2435
|
function Ln(e, t, n) {
|
|
2421
2436
|
let r = (r) => {
|
|
2422
|
-
n.targetZoom =
|
|
2437
|
+
n.targetZoom = Pn(t, n.targetZoom + r), e.zoom(n.targetZoom).set();
|
|
2423
2438
|
}, i = (r) => {
|
|
2424
|
-
n.targetRotation =
|
|
2439
|
+
n.targetRotation = Fn(t, n.targetRotation + r), e.rotate(n.targetRotation + n.thetaOffset).set();
|
|
2425
2440
|
};
|
|
2426
2441
|
return {
|
|
2427
|
-
zoomOut:
|
|
2442
|
+
zoomOut: X(jt(), P.zoomOut(), () => {
|
|
2428
2443
|
r(-10);
|
|
2429
2444
|
}),
|
|
2430
|
-
zoomIn:
|
|
2445
|
+
zoomIn: X(At(), P.zoomIn(), () => {
|
|
2431
2446
|
r(10);
|
|
2432
2447
|
}),
|
|
2433
|
-
tiltUp:
|
|
2434
|
-
|
|
2448
|
+
tiltUp: X(kt(), P.tiltUp(), () => {
|
|
2449
|
+
In(e, t, n, -15);
|
|
2435
2450
|
}),
|
|
2436
|
-
rotateLeft:
|
|
2451
|
+
rotateLeft: X(Et(), P.rotateLeft(), () => {
|
|
2437
2452
|
i(-15);
|
|
2438
2453
|
}),
|
|
2439
|
-
reset:
|
|
2454
|
+
reset: X(Tt(), P.reset(), () => {
|
|
2440
2455
|
n.thetaOffset = 0, e.reset();
|
|
2441
2456
|
}),
|
|
2442
|
-
rotateRight:
|
|
2457
|
+
rotateRight: X(Dt(), P.rotateRight(), () => {
|
|
2443
2458
|
i(15);
|
|
2444
2459
|
}),
|
|
2445
|
-
tiltDown:
|
|
2446
|
-
|
|
2460
|
+
tiltDown: X(Ot(), P.tiltDown(), () => {
|
|
2461
|
+
In(e, t, n, 15);
|
|
2447
2462
|
})
|
|
2448
2463
|
};
|
|
2449
2464
|
}
|
|
2450
2465
|
function Rn(e, t, n) {
|
|
2451
2466
|
let r = t.limits;
|
|
2452
2467
|
if (r === void 0) return;
|
|
2453
|
-
e.zoomOut.element.disabled = r.minZoom !== void 0 && n.zoom <= r.minZoom +
|
|
2468
|
+
e.zoomOut.element.disabled = r.minZoom !== void 0 && n.zoom <= r.minZoom + Y, e.zoomIn.element.disabled = r.maxZoom !== void 0 && n.zoom >= r.maxZoom - Y, e.tiltUp.element.disabled = r.minTilt !== void 0 && n.tilt <= r.minTilt + Y, e.tiltDown.element.disabled = r.maxTilt !== void 0 && n.tilt >= r.maxTilt - Y;
|
|
2454
2469
|
let { minRotate: i, maxRotate: a } = r;
|
|
2455
2470
|
if (i === void 0 || a === void 0 || a - i >= 360) {
|
|
2456
2471
|
e.rotateLeft.element.disabled = !1, e.rotateRight.element.disabled = !1;
|
|
2457
2472
|
return;
|
|
2458
2473
|
}
|
|
2459
|
-
let o =
|
|
2460
|
-
e.rotateLeft.element.disabled = o <= i +
|
|
2474
|
+
let o = Mn(n.rotation, i);
|
|
2475
|
+
e.rotateLeft.element.disabled = o <= i + Y, e.rotateRight.element.disabled = o >= a - Y;
|
|
2461
2476
|
}
|
|
2462
2477
|
// ../client-core/src/client/events.ts
|
|
2463
|
-
var
|
|
2478
|
+
var Z = {
|
|
2464
2479
|
SELECT: "vd:select",
|
|
2465
2480
|
SELECTED: "vd:selected",
|
|
2466
2481
|
FOCUS_CHANGE: "vd:focus-change",
|
|
2467
2482
|
CONFIGURATION_CHANGE: "vd:configuration-change",
|
|
2468
2483
|
CONFIGURATION_SUBMIT: "vd:configuration-submit"
|
|
2469
|
-
}
|
|
2470
|
-
mm: 1,
|
|
2471
|
-
cm: 10,
|
|
2472
|
-
m: 1e3,
|
|
2473
|
-
in: 25.4
|
|
2474
|
-
}, Bn = 3;
|
|
2475
|
-
function Vn(e) {
|
|
2476
|
-
let t = e.stepMm / zn[e.displayUnit];
|
|
2477
|
-
for (let e = 0; e <= Bn; e++) {
|
|
2478
|
-
let n = t * 10 ** e;
|
|
2479
|
-
if (Math.abs(n - Math.round(n)) < 1e-9) return e;
|
|
2480
|
-
}
|
|
2481
|
-
return Bn;
|
|
2482
|
-
}
|
|
2483
|
-
function Hn(e, t, n) {
|
|
2484
|
-
let r = Vn(t), i = e / zn[t.displayUnit];
|
|
2485
|
-
return new Intl.NumberFormat(n, {
|
|
2486
|
-
minimumFractionDigits: r,
|
|
2487
|
-
maximumFractionDigits: r
|
|
2488
|
-
}).format(i);
|
|
2489
|
-
}
|
|
2484
|
+
};
|
|
2490
2485
|
// ../client-core/src/ui/controls/measurement-group.ts
|
|
2491
|
-
function
|
|
2492
|
-
let s =
|
|
2486
|
+
function zn(e, t, n, r, i, a, o) {
|
|
2487
|
+
let s = e.values.find((t) => n.getValue(e.name, t)?.isSelected === !0) ?? e.defaultValue, c = new Sn(e.values, {
|
|
2493
2488
|
label: e.name,
|
|
2494
|
-
labels:
|
|
2495
|
-
unit: t.
|
|
2496
|
-
...
|
|
2489
|
+
labels: t.labels,
|
|
2490
|
+
unit: t.unit,
|
|
2491
|
+
...s !== void 0 && { initialSelected: s }
|
|
2497
2492
|
});
|
|
2498
|
-
return
|
|
2493
|
+
return c.onSelect((t) => {
|
|
2499
2494
|
i(e.name, t);
|
|
2500
|
-
}),
|
|
2501
|
-
r.dispatch(
|
|
2495
|
+
}), c.onSettle((t) => {
|
|
2496
|
+
r.dispatch(Z.SELECT, {
|
|
2502
2497
|
attribute: e.name,
|
|
2503
2498
|
value: t
|
|
2504
2499
|
}, !0).defaultPrevented || a(e.name, t);
|
|
2505
2500
|
}), o(e.name, (t) => {
|
|
2506
|
-
|
|
2501
|
+
c.setSelected(t.value), r.dispatch(Z.SELECTED, {
|
|
2507
2502
|
attribute: e.name,
|
|
2508
2503
|
value: t.value
|
|
2509
2504
|
});
|
|
2510
2505
|
}), {
|
|
2511
|
-
element:
|
|
2506
|
+
element: c.element,
|
|
2512
2507
|
setSelectable: () => {}
|
|
2513
2508
|
};
|
|
2514
2509
|
}
|
|
2510
|
+
// ../measurements/src/units.ts
|
|
2511
|
+
var Bn = {
|
|
2512
|
+
mm: 1,
|
|
2513
|
+
cm: 10,
|
|
2514
|
+
m: 1e3,
|
|
2515
|
+
in: 25.4
|
|
2516
|
+
};
|
|
2517
|
+
function Vn(e, t) {
|
|
2518
|
+
return e / Bn[t];
|
|
2519
|
+
}
|
|
2520
|
+
// ../client-core/src/ui/controls/measurement-format.ts
|
|
2521
|
+
var Hn = 3;
|
|
2522
|
+
function Un(e) {
|
|
2523
|
+
let t = Vn(e.stepMm, e.displayUnit);
|
|
2524
|
+
for (let e = 0; e <= Hn; e++) {
|
|
2525
|
+
let n = t * 10 ** e;
|
|
2526
|
+
if (Math.abs(n - Math.round(n)) < 1e-9) return e;
|
|
2527
|
+
}
|
|
2528
|
+
return Hn;
|
|
2529
|
+
}
|
|
2530
|
+
function Wn(e, t, n) {
|
|
2531
|
+
let r = Un(t), i = Vn(e, t.displayUnit);
|
|
2532
|
+
return new Intl.NumberFormat(n, {
|
|
2533
|
+
minimumFractionDigits: r,
|
|
2534
|
+
maximumFractionDigits: r
|
|
2535
|
+
}).format(i);
|
|
2536
|
+
}
|
|
2537
|
+
function Gn(e, t, n) {
|
|
2538
|
+
return {
|
|
2539
|
+
labels: e.values.map((e) => Wn(Number(e), t, n)),
|
|
2540
|
+
unit: t.displayUnit
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
var Kn = 20;
|
|
2544
|
+
function qn(e, t) {
|
|
2545
|
+
let n = new Intl.NumberFormat(t, { maximumFractionDigits: Kn });
|
|
2546
|
+
return {
|
|
2547
|
+
labels: e.numbers.map((e) => n.format(e)),
|
|
2548
|
+
unit: e.unit
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
2515
2551
|
// ../client-core/src/ui/controls/attribute-group.ts
|
|
2516
|
-
var
|
|
2517
|
-
function
|
|
2552
|
+
var Jn = 5, Yn = 0;
|
|
2553
|
+
function Xn(e, t, n, r, i, a) {
|
|
2518
2554
|
let o = document.createElement("div");
|
|
2519
2555
|
o.className = "vd-attribute", o.dataset.name = e.name;
|
|
2520
2556
|
let s = document.createElement("span");
|
|
2521
|
-
s.className = "vd-attribute-label", s.textContent =
|
|
2557
|
+
s.className = "vd-attribute-label", s.textContent = C(e.name), s.id = `vd-attribute-label-${Yn++}`, o.appendChild(s), o.setAttribute("role", "group"), o.setAttribute("aria-labelledby", s.id);
|
|
2522
2558
|
let c = (e) => {
|
|
2523
2559
|
o.style.display = e ? "none" : "";
|
|
2524
|
-
}, l = e
|
|
2525
|
-
return o.appendChild(
|
|
2560
|
+
}, l = Zn(e), u = l === void 0 ? Qn(e, t, n, r, a) : zn(e, l, t, n, i, r, a);
|
|
2561
|
+
return o.appendChild(u.element), {
|
|
2526
2562
|
element: o,
|
|
2527
|
-
setSelectable:
|
|
2563
|
+
setSelectable: u.setSelectable,
|
|
2528
2564
|
setHidden: c
|
|
2529
2565
|
};
|
|
2530
2566
|
}
|
|
2531
|
-
function
|
|
2532
|
-
|
|
2567
|
+
function Zn(e) {
|
|
2568
|
+
if (e.dimension !== void 0) return Gn(e, e.dimension, y());
|
|
2569
|
+
if (e.size !== void 0) return qn(e.size, y());
|
|
2570
|
+
}
|
|
2571
|
+
function Qn(e, t, n, r, i) {
|
|
2572
|
+
let a = e.values.find((n) => t.getValue(e.name, n)?.isSelected === !0), o = e.values.map((t) => Pe(t, e.labels)), s = e.values.length <= Jn ? new bn(e.values, a, o) : new xn(e.name, e.values, C(e.name), a, o);
|
|
2533
2573
|
return s.onSelect((t) => {
|
|
2534
|
-
n.dispatch(
|
|
2574
|
+
n.dispatch(Z.SELECT, {
|
|
2535
2575
|
attribute: e.name,
|
|
2536
2576
|
value: t
|
|
2537
2577
|
}, !0).defaultPrevented || r(e.name, t);
|
|
2538
2578
|
}), i(e.name, (t) => {
|
|
2539
|
-
s.setSelected(t.value), n.dispatch(
|
|
2579
|
+
s.setSelected(t.value), n.dispatch(Z.SELECTED, {
|
|
2540
2580
|
attribute: e.name,
|
|
2541
2581
|
value: t.value
|
|
2542
2582
|
});
|
|
@@ -2548,7 +2588,7 @@ function qn(e, t, n, r, i) {
|
|
|
2548
2588
|
};
|
|
2549
2589
|
}
|
|
2550
2590
|
// ../client-core/src/ui/commerce-panel.ts
|
|
2551
|
-
var
|
|
2591
|
+
var $n = 80, er = 2500, tr = class {
|
|
2552
2592
|
configuration;
|
|
2553
2593
|
element;
|
|
2554
2594
|
priceEl;
|
|
@@ -2560,7 +2600,7 @@ var Jn = 80, Yn = 2500, Xn = class {
|
|
|
2560
2600
|
constructor(e) {
|
|
2561
2601
|
this.configuration = e, this.element = document.createElement("div"), this.element.className = "vd-commerce vd-hidden";
|
|
2562
2602
|
let t = document.createElement("div");
|
|
2563
|
-
t.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", t.append(this.priceEl, this.vatEl), this.button = new
|
|
2603
|
+
t.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", t.append(this.priceEl, this.vatEl), this.button = new F({
|
|
2564
2604
|
variant: "default",
|
|
2565
2605
|
onClick: () => {
|
|
2566
2606
|
this.handleSubmit();
|
|
@@ -2578,23 +2618,23 @@ var Jn = 80, Yn = 2500, Xn = class {
|
|
|
2578
2618
|
this.unsubscribe(), this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.element.remove();
|
|
2579
2619
|
}
|
|
2580
2620
|
renderPrice(e) {
|
|
2581
|
-
e === void 0 ? (this.priceEl.textContent = "", this.vatEl.textContent = "") : (this.priceEl.textContent =
|
|
2621
|
+
e === void 0 ? (this.priceEl.textContent = "", this.vatEl.textContent = "") : (this.priceEl.textContent = nr(e.price, e.currency), this.vatEl.textContent = Q(this.configuration.vatDisplay));
|
|
2582
2622
|
}
|
|
2583
2623
|
renderButton() {
|
|
2584
2624
|
let e = this.configuration.submitEnabled;
|
|
2585
|
-
this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText(
|
|
2625
|
+
this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText(Q(this.configuration.buttonLabel));
|
|
2586
2626
|
}
|
|
2587
2627
|
async handleSubmit() {
|
|
2588
2628
|
if (this.state !== "busy") {
|
|
2589
|
-
this.setState("busy",
|
|
2629
|
+
this.setState("busy", bt());
|
|
2590
2630
|
try {
|
|
2591
|
-
await this.configuration.submit(), this.setState("success",
|
|
2631
|
+
await this.configuration.submit(), this.setState("success", St());
|
|
2592
2632
|
} catch (e) {
|
|
2593
2633
|
if (e instanceof DOMException && e.name === "AbortError") {
|
|
2594
|
-
this.setState("idle",
|
|
2634
|
+
this.setState("idle", Q(this.configuration.buttonLabel));
|
|
2595
2635
|
return;
|
|
2596
2636
|
}
|
|
2597
|
-
|
|
2637
|
+
j.warn("Commerce submit failed", { error: e }), this.setState("failed", xt());
|
|
2598
2638
|
}
|
|
2599
2639
|
this.scheduleReset();
|
|
2600
2640
|
}
|
|
@@ -2602,7 +2642,7 @@ var Jn = 80, Yn = 2500, Xn = class {
|
|
|
2602
2642
|
scheduleReset() {
|
|
2603
2643
|
this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.resetTimer = setTimeout(() => {
|
|
2604
2644
|
this.state = "idle", this.update();
|
|
2605
|
-
},
|
|
2645
|
+
}, er);
|
|
2606
2646
|
}
|
|
2607
2647
|
setState(e, t) {
|
|
2608
2648
|
this.state = e, this.element.dataset.submit = e, this.button.element.disabled = e === "busy", this.setButtonText(t);
|
|
@@ -2611,12 +2651,12 @@ var Jn = 80, Yn = 2500, Xn = class {
|
|
|
2611
2651
|
this.button.element.textContent = e, this.button.element.setAttribute("aria-label", e);
|
|
2612
2652
|
}
|
|
2613
2653
|
};
|
|
2614
|
-
function
|
|
2615
|
-
return (e ?? "").slice(0,
|
|
2654
|
+
function Q(e) {
|
|
2655
|
+
return (e ?? "").slice(0, $n);
|
|
2616
2656
|
}
|
|
2617
|
-
function
|
|
2657
|
+
function nr(e, t) {
|
|
2618
2658
|
try {
|
|
2619
|
-
let n = new Intl.NumberFormat(
|
|
2659
|
+
let n = new Intl.NumberFormat(y(), {
|
|
2620
2660
|
style: "currency",
|
|
2621
2661
|
currency: t
|
|
2622
2662
|
}), r = n.resolvedOptions().maximumFractionDigits ?? 2;
|
|
@@ -2626,7 +2666,7 @@ function Zn(e, t) {
|
|
|
2626
2666
|
}
|
|
2627
2667
|
}
|
|
2628
2668
|
// ../client-core/src/ui/layouts/inframe-layout.ts
|
|
2629
|
-
var
|
|
2669
|
+
var rr = class {
|
|
2630
2670
|
slot = null;
|
|
2631
2671
|
panel = null;
|
|
2632
2672
|
attach(e, t) {
|
|
@@ -2638,7 +2678,7 @@ var Qn = class {
|
|
|
2638
2678
|
destroy() {
|
|
2639
2679
|
this.slot?.remove(), this.slot = null, this.panel = null;
|
|
2640
2680
|
}
|
|
2641
|
-
},
|
|
2681
|
+
}, ir = 572, ar = class {
|
|
2642
2682
|
actionBarSlot;
|
|
2643
2683
|
element = null;
|
|
2644
2684
|
body = null;
|
|
@@ -2653,21 +2693,21 @@ var Qn = class {
|
|
|
2653
2693
|
this.actionBarSlot = e;
|
|
2654
2694
|
}
|
|
2655
2695
|
attach(e, t) {
|
|
2656
|
-
this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new
|
|
2696
|
+
this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new F({
|
|
2657
2697
|
variant: "ghost",
|
|
2658
2698
|
size: "icon-sm",
|
|
2659
|
-
label:
|
|
2660
|
-
icon:
|
|
2699
|
+
label: Mt(),
|
|
2700
|
+
icon: P.close({ size: 18 }),
|
|
2661
2701
|
onClick: () => {
|
|
2662
2702
|
this.expanded = !1, this.render();
|
|
2663
2703
|
}
|
|
2664
2704
|
});
|
|
2665
2705
|
let n = document.createElement("div");
|
|
2666
|
-
n.className = "vd-sidebar-header", n.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(t), this.element = document.createElement("div"), this.element.className = "vd-sidebar vd-hidden", this.element.append(n, this.body), e.appendChild(this.element), this.openButton = new
|
|
2706
|
+
n.className = "vd-sidebar-header", n.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(t), this.element = document.createElement("div"), this.element.className = "vd-sidebar vd-hidden", this.element.append(n, this.body), e.appendChild(this.element), this.openButton = new F({
|
|
2667
2707
|
variant: "outline",
|
|
2668
2708
|
size: "icon",
|
|
2669
|
-
label:
|
|
2670
|
-
icon:
|
|
2709
|
+
label: Nt(),
|
|
2710
|
+
icon: P.configurator({ size: 18 }),
|
|
2671
2711
|
onClick: () => {
|
|
2672
2712
|
this.expanded = !0, this.render();
|
|
2673
2713
|
}
|
|
@@ -2682,7 +2722,7 @@ var Qn = class {
|
|
|
2682
2722
|
observe() {
|
|
2683
2723
|
typeof ResizeObserver < "u" && this.container !== null && (this.observer = new ResizeObserver((e) => {
|
|
2684
2724
|
let t = e[0]?.contentRect.width ?? 0;
|
|
2685
|
-
this.setCollapsible(t > 0 && t <
|
|
2725
|
+
this.setCollapsible(t > 0 && t < ir);
|
|
2686
2726
|
}), this.observer.observe(this.container));
|
|
2687
2727
|
}
|
|
2688
2728
|
setCollapsible(e) {
|
|
@@ -2693,20 +2733,20 @@ var Qn = class {
|
|
|
2693
2733
|
let e = this.visible && this.expanded, t = this.visible && !this.expanded;
|
|
2694
2734
|
this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed", t), this.openButton.element.classList.toggle("vd-hidden", !t), this.closeButton.element.style.display = this.collapsible ? "" : "none", this.container.classList.toggle("vd-layout-sidebar-right", e), this.container.classList.toggle("vd-layout-sidebar-permanent", e && !this.collapsible);
|
|
2695
2735
|
}
|
|
2696
|
-
},
|
|
2736
|
+
}, or = class {
|
|
2697
2737
|
attach(e, t) {}
|
|
2698
2738
|
setVisible(e) {}
|
|
2699
2739
|
destroy() {}
|
|
2700
|
-
},
|
|
2701
|
-
"inframe-bottom-left": () => new
|
|
2702
|
-
"sidebar-right": (e) => new
|
|
2703
|
-
hidden: () => new
|
|
2740
|
+
}, sr = {
|
|
2741
|
+
"inframe-bottom-left": () => new rr(),
|
|
2742
|
+
"sidebar-right": (e) => new ar(e),
|
|
2743
|
+
hidden: () => new or()
|
|
2704
2744
|
};
|
|
2705
|
-
function
|
|
2706
|
-
return (
|
|
2745
|
+
function cr(e, t) {
|
|
2746
|
+
return (sr[e ?? ""] ?? (() => new rr()))(t);
|
|
2707
2747
|
}
|
|
2708
2748
|
// ../client-core/src/ui/styles.ts
|
|
2709
|
-
var
|
|
2749
|
+
var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display: flex;\n z-index: 10;\n transition: inset-inline-end 0.18s ease;\n", ur = `
|
|
2710
2750
|
/* Override browser's default black fullscreen backdrop */
|
|
2711
2751
|
.vd-container:fullscreen {
|
|
2712
2752
|
background: oklch(100% 0 0);
|
|
@@ -2714,52 +2754,52 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2714
2754
|
|
|
2715
2755
|
/* Layout slots — four corners */
|
|
2716
2756
|
.vd-slot-top-right {
|
|
2717
|
-
${
|
|
2718
|
-
inset-block-start: ${
|
|
2719
|
-
inset-inline-end: ${
|
|
2757
|
+
${lr}
|
|
2758
|
+
inset-block-start: ${K[3]};
|
|
2759
|
+
inset-inline-end: ${K[3]};
|
|
2720
2760
|
flex-direction: column;
|
|
2721
2761
|
align-items: flex-end;
|
|
2722
|
-
gap: ${
|
|
2762
|
+
gap: ${K[1.5]};
|
|
2723
2763
|
}
|
|
2724
2764
|
|
|
2725
2765
|
.vd-slot-bottom-left {
|
|
2726
|
-
${
|
|
2727
|
-
inset-block-end: ${
|
|
2728
|
-
inset-inline-start: ${
|
|
2766
|
+
${lr}
|
|
2767
|
+
inset-block-end: ${K[3]};
|
|
2768
|
+
inset-inline-start: ${K[3]};
|
|
2729
2769
|
flex-direction: column;
|
|
2730
2770
|
align-items: flex-start;
|
|
2731
|
-
gap: ${
|
|
2771
|
+
gap: ${K[1.5]};
|
|
2732
2772
|
}
|
|
2733
2773
|
|
|
2734
2774
|
.vd-slot-bottom-right {
|
|
2735
|
-
${
|
|
2736
|
-
inset-block-end: ${
|
|
2737
|
-
inset-inline-end: ${
|
|
2775
|
+
${lr}
|
|
2776
|
+
inset-block-end: ${K[3]};
|
|
2777
|
+
inset-inline-end: ${K[3]};
|
|
2738
2778
|
flex-direction: row;
|
|
2739
|
-
gap: ${
|
|
2779
|
+
gap: ${K[1.5]};
|
|
2740
2780
|
}
|
|
2741
2781
|
|
|
2742
2782
|
/* Component styles — no positioning */
|
|
2743
2783
|
.vd-camera-controls {
|
|
2744
2784
|
display: flex;
|
|
2745
2785
|
flex-direction: column;
|
|
2746
|
-
gap: ${
|
|
2747
|
-
background: color-mix(in oklch, ${
|
|
2786
|
+
gap: ${K[1]};
|
|
2787
|
+
background: color-mix(in oklch, ${G.white} 85%, transparent);
|
|
2748
2788
|
backdrop-filter: blur(8px);
|
|
2749
|
-
border-radius: ${
|
|
2750
|
-
padding: ${
|
|
2789
|
+
border-radius: ${K[2]};
|
|
2790
|
+
padding: ${K[2]};
|
|
2751
2791
|
}
|
|
2752
2792
|
|
|
2753
2793
|
.vd-zoom {
|
|
2754
2794
|
display: flex;
|
|
2755
|
-
gap: ${
|
|
2795
|
+
gap: ${K[.5]};
|
|
2756
2796
|
}
|
|
2757
2797
|
|
|
2758
2798
|
.vd-dpad {
|
|
2759
2799
|
display: grid;
|
|
2760
|
-
grid-template-columns: repeat(3, ${
|
|
2761
|
-
grid-template-rows: repeat(3, ${
|
|
2762
|
-
gap: ${
|
|
2800
|
+
grid-template-columns: repeat(3, ${K[9]});
|
|
2801
|
+
grid-template-rows: repeat(3, ${K[9]});
|
|
2802
|
+
gap: ${K[.5]};
|
|
2763
2803
|
}
|
|
2764
2804
|
|
|
2765
2805
|
.vd-dpad-up { grid-column: 2; grid-row: 1; }
|
|
@@ -2771,30 +2811,30 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2771
2811
|
.vd-attributes {
|
|
2772
2812
|
display: flex;
|
|
2773
2813
|
flex-direction: column;
|
|
2774
|
-
gap: ${
|
|
2775
|
-
background: color-mix(in oklch, ${
|
|
2814
|
+
gap: ${K[3]};
|
|
2815
|
+
background: color-mix(in oklch, ${G.white} 85%, transparent);
|
|
2776
2816
|
backdrop-filter: blur(8px);
|
|
2777
|
-
border: 1px solid color-mix(in oklch, ${
|
|
2778
|
-
border-radius: ${
|
|
2779
|
-
padding: ${
|
|
2780
|
-
box-shadow: 0 ${
|
|
2781
|
-
font-family: ${
|
|
2817
|
+
border: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
|
|
2818
|
+
border-radius: ${K[3]};
|
|
2819
|
+
padding: ${K[3]};
|
|
2820
|
+
box-shadow: 0 ${K[1]} ${K[4]} color-mix(in oklch, ${G.neutral[900]} 6%, transparent);
|
|
2821
|
+
font-family: ${$};
|
|
2782
2822
|
}
|
|
2783
2823
|
|
|
2784
2824
|
.vd-attribute {
|
|
2785
2825
|
display: flex;
|
|
2786
2826
|
flex-direction: column;
|
|
2787
|
-
gap: ${
|
|
2827
|
+
gap: ${K[1.5]};
|
|
2788
2828
|
}
|
|
2789
2829
|
|
|
2790
2830
|
/* Micro-label: recedes so the controls lead. */
|
|
2791
2831
|
.vd-attribute-label {
|
|
2792
|
-
font-size: ${
|
|
2793
|
-
font-weight: ${
|
|
2794
|
-
color: ${
|
|
2832
|
+
font-size: ${q.fontSize.xs};
|
|
2833
|
+
font-weight: ${q.fontWeight.medium};
|
|
2834
|
+
color: ${G.neutral[500]};
|
|
2795
2835
|
text-transform: uppercase;
|
|
2796
2836
|
letter-spacing: 0.05em;
|
|
2797
|
-
font-family: ${
|
|
2837
|
+
font-family: ${$};
|
|
2798
2838
|
}
|
|
2799
2839
|
|
|
2800
2840
|
/* sidebar-right layout — a docked, full-height right panel */
|
|
@@ -2830,10 +2870,10 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2830
2870
|
z-index: 11;
|
|
2831
2871
|
display: flex;
|
|
2832
2872
|
flex-direction: column;
|
|
2833
|
-
background: color-mix(in oklch, ${
|
|
2873
|
+
background: color-mix(in oklch, ${G.white} 90%, transparent);
|
|
2834
2874
|
backdrop-filter: blur(10px);
|
|
2835
|
-
border-inline-start: 1px solid color-mix(in oklch, ${
|
|
2836
|
-
box-shadow: -${
|
|
2875
|
+
border-inline-start: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
|
|
2876
|
+
box-shadow: -${K[1]} 0 ${K[4]} color-mix(in oklch, ${G.neutral[900]} 5%, transparent);
|
|
2837
2877
|
}
|
|
2838
2878
|
|
|
2839
2879
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -2845,13 +2885,13 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2845
2885
|
.vd-sidebar-header {
|
|
2846
2886
|
display: flex;
|
|
2847
2887
|
justify-content: flex-end;
|
|
2848
|
-
padding: ${
|
|
2888
|
+
padding: ${K[1.5]} ${K[1.5]} 0;
|
|
2849
2889
|
}
|
|
2850
2890
|
|
|
2851
2891
|
.vd-sidebar-body {
|
|
2852
2892
|
flex: 1;
|
|
2853
2893
|
overflow-y: auto;
|
|
2854
|
-
padding: ${
|
|
2894
|
+
padding: ${K[4]};
|
|
2855
2895
|
}
|
|
2856
2896
|
|
|
2857
2897
|
/* attributes inside the sidebar: flat and full-width — the panel provides the frosting */
|
|
@@ -2862,38 +2902,38 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2862
2902
|
border-radius: 0;
|
|
2863
2903
|
padding: 0;
|
|
2864
2904
|
box-shadow: none;
|
|
2865
|
-
gap: ${
|
|
2905
|
+
gap: ${K[5]};
|
|
2866
2906
|
}
|
|
2867
2907
|
|
|
2868
2908
|
/* while the panel is open, keep the corner controls clear of it */
|
|
2869
|
-
.vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${
|
|
2870
|
-
.vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${
|
|
2909
|
+
.vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${K[3]}); }
|
|
2910
|
+
.vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${K[3]}); }
|
|
2871
2911
|
|
|
2872
2912
|
/* Price + CTA — sit under the attribute controls, separated by a hairline */
|
|
2873
2913
|
.vd-commerce {
|
|
2874
2914
|
display: flex;
|
|
2875
2915
|
flex-direction: column;
|
|
2876
|
-
gap: ${
|
|
2877
|
-
padding-block-start: ${
|
|
2878
|
-
border-block-start: 1px solid color-mix(in oklch, ${
|
|
2879
|
-
font-family: ${
|
|
2916
|
+
gap: ${K[2]};
|
|
2917
|
+
padding-block-start: ${K[3]};
|
|
2918
|
+
border-block-start: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
|
|
2919
|
+
font-family: ${$};
|
|
2880
2920
|
}
|
|
2881
2921
|
|
|
2882
2922
|
.vd-commerce-price {
|
|
2883
2923
|
display: flex;
|
|
2884
2924
|
align-items: baseline;
|
|
2885
|
-
gap: ${
|
|
2925
|
+
gap: ${K[1.5]};
|
|
2886
2926
|
}
|
|
2887
2927
|
|
|
2888
2928
|
.vd-price {
|
|
2889
|
-
font-size: ${
|
|
2890
|
-
font-weight: ${
|
|
2891
|
-
color: ${
|
|
2929
|
+
font-size: ${q.fontSize.lg};
|
|
2930
|
+
font-weight: ${q.fontWeight.semibold};
|
|
2931
|
+
color: ${G.neutral[900]};
|
|
2892
2932
|
}
|
|
2893
2933
|
|
|
2894
2934
|
.vd-vat {
|
|
2895
|
-
font-size: ${
|
|
2896
|
-
color: ${
|
|
2935
|
+
font-size: ${q.fontSize.xs};
|
|
2936
|
+
color: ${G.neutral[500]};
|
|
2897
2937
|
}
|
|
2898
2938
|
|
|
2899
2939
|
.vd-cta {
|
|
@@ -2903,23 +2943,23 @@ var Q = I.fontFamily.sans.join(", "), $ = "\n position: absolute;\n display: f
|
|
|
2903
2943
|
|
|
2904
2944
|
/* Failed submit is the one place red belongs: a clear, recoverable error state. */
|
|
2905
2945
|
.vd-commerce[data-submit="failed"] .vd-cta {
|
|
2906
|
-
background: ${
|
|
2907
|
-
border-color: ${
|
|
2908
|
-
color: ${
|
|
2946
|
+
background: ${G.semantic.error};
|
|
2947
|
+
border-color: ${G.semantic.error};
|
|
2948
|
+
color: ${G.white};
|
|
2909
2949
|
}
|
|
2910
2950
|
|
|
2911
2951
|
`;
|
|
2912
|
-
function
|
|
2913
|
-
if (
|
|
2952
|
+
function dr() {
|
|
2953
|
+
if (Dn(), document.getElementById("vd-styles") !== null) return;
|
|
2914
2954
|
let e = document.createElement("style");
|
|
2915
|
-
e.id = "vd-styles", e.textContent =
|
|
2955
|
+
e.id = "vd-styles", e.textContent = ur, document.head.appendChild(e);
|
|
2916
2956
|
}
|
|
2917
2957
|
// ../client-core/src/ui/standard-interface.ts
|
|
2918
|
-
function
|
|
2958
|
+
function fr(e, t) {
|
|
2919
2959
|
let n = document.createElement("a");
|
|
2920
2960
|
n.href = `data:image/png;base64,${e}`, n.download = t, n.click();
|
|
2921
2961
|
}
|
|
2922
|
-
var
|
|
2962
|
+
var pr = class {
|
|
2923
2963
|
options;
|
|
2924
2964
|
settings = {};
|
|
2925
2965
|
container = null;
|
|
@@ -2936,19 +2976,23 @@ var sr = class {
|
|
|
2936
2976
|
lastSelectable = null;
|
|
2937
2977
|
layout = null;
|
|
2938
2978
|
commerce = null;
|
|
2979
|
+
ready = !1;
|
|
2939
2980
|
constructor(e) {
|
|
2940
2981
|
this.options = e;
|
|
2941
2982
|
}
|
|
2942
2983
|
attach(e) {
|
|
2943
|
-
|
|
2984
|
+
dr(), this.container = e, this.loading = new yn(e, { text: {
|
|
2985
|
+
downloading: () => Ht(),
|
|
2986
|
+
loadError: () => Ut()
|
|
2987
|
+
} }), this.slots.topRight = this.createSlot(e, "vd-slot-top-right"), this.slots.bottomRight = this.createSlot(e, "vd-slot-bottom-right");
|
|
2944
2988
|
}
|
|
2945
2989
|
onReady() {
|
|
2946
|
-
this.loading?.hide(), this.loading = null, this.mountToolbar(), this.cameraControls !== null && (this.cameraControls.element.style.display = "flex"), this.layout?.setVisible(!0);
|
|
2990
|
+
this.ready = !0, this.loading?.hide(), this.loading = null, this.mountToolbar(), this.cameraControls !== null && (this.cameraControls.element.style.display = "flex"), this.layout?.setVisible(!0);
|
|
2947
2991
|
}
|
|
2948
2992
|
mountToolbar() {
|
|
2949
2993
|
if (this.actionBar !== null || this.slots.bottomRight === null || this.container === null) return;
|
|
2950
2994
|
let e = typeof this.container.requestFullscreen == "function" && document.fullscreenEnabled !== !1;
|
|
2951
|
-
this.actionBar = new
|
|
2995
|
+
this.actionBar = new An({
|
|
2952
2996
|
onAr: this.options.onAr,
|
|
2953
2997
|
onFullscreen: e ? () => {
|
|
2954
2998
|
this.toggleFullscreen();
|
|
@@ -2958,7 +3002,7 @@ var sr = class {
|
|
|
2958
3002
|
}
|
|
2959
3003
|
toggleFullscreen() {
|
|
2960
3004
|
this.container !== null && (document.fullscreenElement === null ? (this.options.onFullscreenEnter?.(), this.container.requestFullscreen().catch((e) => {
|
|
2961
|
-
|
|
3005
|
+
j.warn("Fullscreen request refused", { error: e });
|
|
2962
3006
|
})) : document.exitFullscreen());
|
|
2963
3007
|
}
|
|
2964
3008
|
updateProgress(e, t) {
|
|
@@ -2971,18 +3015,21 @@ var sr = class {
|
|
|
2971
3015
|
this.loading?.viewerAlive();
|
|
2972
3016
|
}
|
|
2973
3017
|
applyViewerSettings(e) {
|
|
2974
|
-
this.settings = e, e.language !== void 0 &&
|
|
3018
|
+
this.settings = e, e.language !== void 0 && _e(e.language, { reload: !1 }), this.syncScreenshotButton(), this.actionBar?.applySettings(e), this.cameraControls !== null && (this.cameraControls.element.style.display = e.cameraControls === !0 ? "flex" : "none"), this.placeScreenshotButton();
|
|
2975
3019
|
}
|
|
2976
3020
|
renderModelControls(e, t) {
|
|
2977
|
-
if (this.container !== null && this.slots.topRight !== null && this.slots.bottomRight !== null && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.
|
|
3021
|
+
if (this.container !== null && this.slots.topRight !== null && this.slots.bottomRight !== null && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.mountCameraControls(this.slots.topRight), this.placeScreenshotButton(), t.length !== 0)) {
|
|
2978
3022
|
this.attributes = document.createElement("div"), this.attributes.className = "vd-attributes", this.groupHandles = /* @__PURE__ */ new Map();
|
|
2979
3023
|
for (let n of t) {
|
|
2980
|
-
let t =
|
|
3024
|
+
let t = Xn(n, e, this.options.eventBus, this.options.onSelect, this.options.onSelectTransient, this.options.onSubscribe);
|
|
2981
3025
|
this.groupHandles.set(n.name, t), this.attributes.appendChild(t.element);
|
|
2982
3026
|
}
|
|
2983
|
-
this.commerce = new
|
|
3027
|
+
this.commerce = new tr(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = cr(this.settings.configuratorLayout, this.slots.bottomRight), this.layout.attach(this.container, this.attributes), this.ready === !0 && this.layout.setVisible(!0), this.lastSelectable !== null && this.applySelectable(this.lastSelectable);
|
|
2984
3028
|
}
|
|
2985
3029
|
}
|
|
3030
|
+
mountCameraControls(e) {
|
|
3031
|
+
this.settings.cameraControls === !0 && (this.cameraControls = new jn(this.options.cameraApi, this.options.cameraPositionApi), this.cameraControls.element.style.display = this.ready ? "flex" : "none", e.appendChild(this.cameraControls.element));
|
|
3032
|
+
}
|
|
2986
3033
|
applySelectable(e) {
|
|
2987
3034
|
this.lastSelectable = e;
|
|
2988
3035
|
for (let [t, n] of this.groupHandles) {
|
|
@@ -3007,11 +3054,11 @@ var sr = class {
|
|
|
3007
3054
|
}
|
|
3008
3055
|
syncScreenshotButton() {
|
|
3009
3056
|
let e = this.settings.screenshot === !0;
|
|
3010
|
-
e && this.screenshotBtn === null && (this.screenshotBtn = new
|
|
3057
|
+
e && this.screenshotBtn === null && (this.screenshotBtn = new F({
|
|
3011
3058
|
variant: "outline",
|
|
3012
3059
|
size: "icon",
|
|
3013
|
-
label:
|
|
3014
|
-
icon:
|
|
3060
|
+
label: Vt(),
|
|
3061
|
+
icon: P.screenshot(),
|
|
3015
3062
|
onClick: () => {
|
|
3016
3063
|
this.takeScreenshot();
|
|
3017
3064
|
}
|
|
@@ -3020,15 +3067,15 @@ var sr = class {
|
|
|
3020
3067
|
takeScreenshot() {
|
|
3021
3068
|
let e = this.screenshotBtn;
|
|
3022
3069
|
e === null || e.element.disabled || (e.element.disabled = !0, this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data: t, filename: n }) => {
|
|
3023
|
-
e.element.disabled = !1,
|
|
3070
|
+
e.element.disabled = !1, fr(t, n);
|
|
3024
3071
|
}).onError((t) => {
|
|
3025
|
-
e.element.disabled = !1,
|
|
3072
|
+
e.element.disabled = !1, j.warn("Screenshot failed", { error: t });
|
|
3026
3073
|
}));
|
|
3027
3074
|
}
|
|
3028
3075
|
placeScreenshotButton() {
|
|
3029
3076
|
this.screenshotBtn !== null && this.slots.topRight !== null && (this.cameraControls === null ? this.slots.topRight.appendChild(this.screenshotBtn.element) : this.cameraControls.element.appendChild(this.screenshotBtn.element));
|
|
3030
3077
|
}
|
|
3031
|
-
},
|
|
3078
|
+
}, mr = class {
|
|
3032
3079
|
defaultServer = "https://server.virtualdisplay.io";
|
|
3033
3080
|
options;
|
|
3034
3081
|
serverHost;
|
|
@@ -3066,7 +3113,7 @@ var sr = class {
|
|
|
3066
3113
|
return t.toString();
|
|
3067
3114
|
}
|
|
3068
3115
|
setAddressParams(e) {
|
|
3069
|
-
this.options.app === void 0 ? (e.searchParams.set("license", this.options.license), e.searchParams.set("model", this.options.model)) : (e.searchParams.set("app", this.options.app), (this.options.license !== void 0 || this.options.model !== void 0) &&
|
|
3116
|
+
this.options.app === void 0 ? (e.searchParams.set("license", this.options.license), e.searchParams.set("model", this.options.model)) : (e.searchParams.set("app", this.options.app), (this.options.license !== void 0 || this.options.model !== void 0) && j.warn("Both `app` and `license`/`model` were supplied: `app` wins, the pair was ignored"));
|
|
3070
3117
|
}
|
|
3071
3118
|
getServerUrl() {
|
|
3072
3119
|
return this.serverHost === void 0 ? this.defaultServer : this.serverHost;
|
|
@@ -3074,15 +3121,15 @@ var sr = class {
|
|
|
3074
3121
|
getParentElement() {
|
|
3075
3122
|
if (typeof this.options.parent != "string") return this.options.parent;
|
|
3076
3123
|
let e = document.querySelector(this.options.parent);
|
|
3077
|
-
if (e === null) throw
|
|
3124
|
+
if (e === null) throw T.parentNotFound(this.options.parent);
|
|
3078
3125
|
return e;
|
|
3079
3126
|
}
|
|
3080
3127
|
};
|
|
3081
3128
|
// ../client-core/src/client/incoming-message-routing.ts
|
|
3082
|
-
function
|
|
3129
|
+
function hr(e) {
|
|
3083
3130
|
let { messenger: n } = e;
|
|
3084
3131
|
n.on(t.HANDSHAKE, (t) => {
|
|
3085
|
-
l(t) && (
|
|
3132
|
+
l(t) && (j.info("Server handshake received, flushing publisher queue"), n.markReady(), e.ui.viewerAlive());
|
|
3086
3133
|
}), n.on(t.SESSION, (t) => {
|
|
3087
3134
|
u(t) && e.onSession(t.sessionId);
|
|
3088
3135
|
}), n.on(t.MUTATION, (t) => {
|
|
@@ -3097,9 +3144,9 @@ function lr(e) {
|
|
|
3097
3144
|
ie(t) && e.applyConfig(t);
|
|
3098
3145
|
}), n.on(t.MAPPING, (t) => {
|
|
3099
3146
|
te(t) && (e.attributes.handleMappingReceived(t), e.configuration.handleSelectionChanged(e.attributes.getSelection()), e.ui.renderModelControls(e.attributes, t.attributes), e.readyStateTracker.handleMappingReceived());
|
|
3100
|
-
}),
|
|
3147
|
+
}), gr(e);
|
|
3101
3148
|
}
|
|
3102
|
-
function
|
|
3149
|
+
function gr(e) {
|
|
3103
3150
|
let { messenger: n } = e;
|
|
3104
3151
|
n.on(t.FOCUS, (t) => {
|
|
3105
3152
|
ae(t) && e.focus.handleStateReceived(t);
|
|
@@ -3114,14 +3161,14 @@ function ur(e) {
|
|
|
3114
3161
|
});
|
|
3115
3162
|
}
|
|
3116
3163
|
// ../client-core/src/client/ready-state-tracker.ts
|
|
3117
|
-
var
|
|
3164
|
+
var _r = class {
|
|
3118
3165
|
ready = !1;
|
|
3119
3166
|
onReady;
|
|
3120
3167
|
constructor(e) {
|
|
3121
3168
|
this.onReady = e;
|
|
3122
3169
|
}
|
|
3123
3170
|
handleMappingReceived() {
|
|
3124
|
-
this.ready || (this.ready = !0,
|
|
3171
|
+
this.ready || (this.ready = !0, j.info("Mapping received from server, client is now ready"), this.onReady?.());
|
|
3125
3172
|
}
|
|
3126
3173
|
get isReady() {
|
|
3127
3174
|
return this.ready;
|
|
@@ -3131,7 +3178,7 @@ var dr = class {
|
|
|
3131
3178
|
}
|
|
3132
3179
|
};
|
|
3133
3180
|
// ../client-core/src/client/base-client.ts
|
|
3134
|
-
function
|
|
3181
|
+
function vr(e) {
|
|
3135
3182
|
if (e === void 0) return;
|
|
3136
3183
|
let { annotations: t, ...n } = e;
|
|
3137
3184
|
return t === void 0 ? n : t === !0 ? {
|
|
@@ -3145,12 +3192,12 @@ function fr(e) {
|
|
|
3145
3192
|
annotations: t
|
|
3146
3193
|
};
|
|
3147
3194
|
}
|
|
3148
|
-
function
|
|
3195
|
+
function yr(e) {
|
|
3149
3196
|
if (!Array.isArray(e)) return {};
|
|
3150
3197
|
let t = e.filter((e) => typeof e == "string");
|
|
3151
3198
|
return t.length > 0 ? { features: t } : {};
|
|
3152
3199
|
}
|
|
3153
|
-
var
|
|
3200
|
+
var br = class {
|
|
3154
3201
|
attributes;
|
|
3155
3202
|
selectableState;
|
|
3156
3203
|
readyStateTracker;
|
|
@@ -3179,27 +3226,27 @@ var mr = class {
|
|
|
3179
3226
|
this.options = e;
|
|
3180
3227
|
let r = t ?? {};
|
|
3181
3228
|
this.serverHost = r.serverHost, this.iframeParams = r.iframeParams, this.initializeLogging(), this.messenger = new ce(() => this.iframe?.contentWindow ?? null, {
|
|
3182
|
-
onHandlerError: (e, t) =>
|
|
3229
|
+
onHandlerError: (e, t) => j.error(`Error handling ${e.type}`, t),
|
|
3183
3230
|
...r.messengerOptions
|
|
3184
3231
|
});
|
|
3185
3232
|
let i = (e) => {
|
|
3186
3233
|
this.messenger.send(e);
|
|
3187
3234
|
};
|
|
3188
|
-
this.attributes = new
|
|
3235
|
+
this.attributes = new st(i, n, (e, t) => {
|
|
3189
3236
|
this.notifyMutationFailed(e, t);
|
|
3190
|
-
}), this.selectableState = new
|
|
3237
|
+
}), this.selectableState = new ct(), this.snapshotApi = new vt(i), this.annotationsApi = new ue(i, n), this.cameraApi = new lt(i), this.cameraPositionApi = new ut(), this.focusApi = new ht(i, (e) => {
|
|
3191
3238
|
this.dispatchFocusChange(e);
|
|
3192
|
-
}, n), this.configurationApi = new
|
|
3239
|
+
}, n), this.configurationApi = new mt((e) => {
|
|
3193
3240
|
this.dispatchConfigurationChange(e);
|
|
3194
3241
|
}, (e) => {
|
|
3195
3242
|
this.dispatchConfigurationSubmit(e);
|
|
3196
|
-
}), this.eventBus = new
|
|
3243
|
+
}), this.eventBus = new yt(), this.arActivation = r.createArActivation?.(i), this.syncTracker = r.createSyncTracker?.(), this.readyStateTracker = new _r(() => {
|
|
3197
3244
|
this.notifyReady();
|
|
3198
3245
|
}), this.ui = this.createStandardInterface(), this.wireIncomingMessages(), r.registerHandlers?.(this.messenger, i), this.messenger.start(), this.mountIframe();
|
|
3199
3246
|
}
|
|
3200
3247
|
createStandardInterface() {
|
|
3201
3248
|
let e = this.arActivation;
|
|
3202
|
-
return new
|
|
3249
|
+
return new pr({
|
|
3203
3250
|
snapshotApi: this.snapshotApi,
|
|
3204
3251
|
cameraApi: this.cameraApi,
|
|
3205
3252
|
cameraPositionApi: this.cameraPositionApi,
|
|
@@ -3230,7 +3277,7 @@ var mr = class {
|
|
|
3230
3277
|
});
|
|
3231
3278
|
}
|
|
3232
3279
|
wireIncomingMessages() {
|
|
3233
|
-
|
|
3280
|
+
hr({
|
|
3234
3281
|
messenger: this.messenger,
|
|
3235
3282
|
attributes: this.attributes,
|
|
3236
3283
|
selectable: this.selectableState,
|
|
@@ -3255,7 +3302,7 @@ var mr = class {
|
|
|
3255
3302
|
name: e.name,
|
|
3256
3303
|
...e.slug !== void 0 && { slug: e.slug },
|
|
3257
3304
|
...e.submit !== void 0 && { submit: e.submit },
|
|
3258
|
-
...
|
|
3305
|
+
...yr(e.features)
|
|
3259
3306
|
});
|
|
3260
3307
|
}
|
|
3261
3308
|
});
|
|
@@ -3280,25 +3327,25 @@ var mr = class {
|
|
|
3280
3327
|
this.ui.onReady();
|
|
3281
3328
|
}
|
|
3282
3329
|
dispatchFocusChange(e) {
|
|
3283
|
-
this.container?.dispatchEvent(new CustomEvent(
|
|
3330
|
+
this.container?.dispatchEvent(new CustomEvent(Z.FOCUS_CHANGE, {
|
|
3284
3331
|
detail: e,
|
|
3285
3332
|
bubbles: !0
|
|
3286
3333
|
}));
|
|
3287
3334
|
}
|
|
3288
3335
|
dispatchConfigurationChange(e) {
|
|
3289
|
-
this.container?.dispatchEvent(new CustomEvent(
|
|
3336
|
+
this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_CHANGE, {
|
|
3290
3337
|
detail: e ?? null,
|
|
3291
3338
|
bubbles: !0
|
|
3292
3339
|
}));
|
|
3293
3340
|
}
|
|
3294
3341
|
dispatchConfigurationSubmit(e) {
|
|
3295
|
-
this.container?.dispatchEvent(new CustomEvent(
|
|
3342
|
+
this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_SUBMIT, {
|
|
3296
3343
|
detail: e,
|
|
3297
3344
|
bubbles: !0
|
|
3298
3345
|
}));
|
|
3299
3346
|
}
|
|
3300
3347
|
handleConfig(e) {
|
|
3301
|
-
let t = e.viewerSettings, n =
|
|
3348
|
+
let t = e.viewerSettings, n = vr(this.options.viewerSettings);
|
|
3302
3349
|
if (t !== void 0 || n !== void 0) {
|
|
3303
3350
|
let e = n === void 0 ? t : {
|
|
3304
3351
|
...t ?? {},
|
|
@@ -3306,7 +3353,7 @@ var mr = class {
|
|
|
3306
3353
|
};
|
|
3307
3354
|
if (n !== void 0 && t !== void 0) {
|
|
3308
3355
|
let e = Object.entries(n).filter(([e, n]) => t[e] !== n).map(([e, n]) => `${e} (metadata: ${t[e] ?? "undefined"}, override: ${n})`);
|
|
3309
|
-
e.length > 0 &&
|
|
3356
|
+
e.length > 0 && j.warn(`Viewer settings override active: ${e.join(", ")}`);
|
|
3310
3357
|
}
|
|
3311
3358
|
this.ui.applyViewerSettings(e), this.echoAnnotationsDifference(t?.annotations, e.annotations);
|
|
3312
3359
|
}
|
|
@@ -3319,15 +3366,11 @@ var mr = class {
|
|
|
3319
3366
|
this.messenger.send({ type: t.FULLSCREEN });
|
|
3320
3367
|
}
|
|
3321
3368
|
initializeLogging() {
|
|
3322
|
-
this.options.debug === !0 &&
|
|
3369
|
+
this.options.debug === !0 && at(), j.info("Initializing Virtualdisplay client", { ...this.options.app === void 0 ? { model: this.options.model } : { app: this.options.app } });
|
|
3323
3370
|
}
|
|
3324
3371
|
mountIframe() {
|
|
3325
|
-
let e = new
|
|
3326
|
-
this.container = e.container, this.iframe = e.iframe, this.eventBus.attach(this.container), this.ui.attach(this.container);
|
|
3327
|
-
try {
|
|
3328
|
-
let e = new URL(this.iframe.src).origin;
|
|
3329
|
-
this.messenger.setTargetOrigin(e);
|
|
3330
|
-
} catch {}
|
|
3372
|
+
let e = new mr(this.options, this.serverHost, this.iframeParams).create();
|
|
3373
|
+
this.container = e.container, this.iframe = e.iframe, this.eventBus.attach(this.container), this.ui.attach(this.container), this.messenger.setTargetOrigin(new URL(this.iframe.src).origin);
|
|
3331
3374
|
}
|
|
3332
3375
|
select(e, t) {
|
|
3333
3376
|
this.attributes.select(e, t);
|
|
@@ -3395,15 +3438,15 @@ var mr = class {
|
|
|
3395
3438
|
destroy() {
|
|
3396
3439
|
this.readyStateTracker.clear(), this.readyCallbacks = [], this.mutationFailedCallbacks.length = 0, this.snapshotApi.clear(), this.messenger.destroy(), this.arActivation?.destroy(), this.ui.destroy(), this.container?.parentElement !== null && this.container?.parentElement !== void 0 && this.container.parentElement.removeChild(this.container), this.container = void 0, this.iframe = void 0;
|
|
3397
3440
|
}
|
|
3398
|
-
},
|
|
3399
|
-
function
|
|
3400
|
-
let t = new URL(`https://${
|
|
3441
|
+
}, xr = "ar.virtualdisplay.io";
|
|
3442
|
+
function Sr(e) {
|
|
3443
|
+
let t = new URL(`https://${xr}/go`);
|
|
3401
3444
|
return e.sessionId === void 0 ? e.app === void 0 ? e.license !== void 0 && e.model !== void 0 && (t.searchParams.set("license", e.license), t.searchParams.set("model", e.model)) : t.searchParams.set("app", e.app) : t.searchParams.set("session", e.sessionId), t.toString();
|
|
3402
3445
|
}
|
|
3403
3446
|
// src/ar/ar-activation.ts
|
|
3404
|
-
var
|
|
3447
|
+
var Cr = 1500, wr = class {
|
|
3405
3448
|
options;
|
|
3406
|
-
qrModal = new
|
|
3449
|
+
qrModal = new kn();
|
|
3407
3450
|
sessionId;
|
|
3408
3451
|
waiters = [];
|
|
3409
3452
|
pendingTimers = /* @__PURE__ */ new Set();
|
|
@@ -3418,7 +3461,7 @@ var _r = 1500, vr = class {
|
|
|
3418
3461
|
for (let n of t) n(e);
|
|
3419
3462
|
}
|
|
3420
3463
|
activate() {
|
|
3421
|
-
|
|
3464
|
+
et() ? this.options.send({ type: t.AR_ACTIVATE }) : this.showQrCode();
|
|
3422
3465
|
}
|
|
3423
3466
|
destroy() {
|
|
3424
3467
|
this.destroyed = !0;
|
|
@@ -3429,7 +3472,7 @@ var _r = 1500, vr = class {
|
|
|
3429
3472
|
this.qrModal.show();
|
|
3430
3473
|
let e = await this.waitForSessionId();
|
|
3431
3474
|
if (this.destroyed) return;
|
|
3432
|
-
let n =
|
|
3475
|
+
let n = Sr({
|
|
3433
3476
|
sessionId: e,
|
|
3434
3477
|
app: this.options.app,
|
|
3435
3478
|
license: this.options.license,
|
|
@@ -3438,7 +3481,7 @@ var _r = 1500, vr = class {
|
|
|
3438
3481
|
try {
|
|
3439
3482
|
r = await this.qrModal.update(n);
|
|
3440
3483
|
} catch (e) {
|
|
3441
|
-
|
|
3484
|
+
j.warn("AR QR code could not be rendered", { error: e });
|
|
3442
3485
|
return;
|
|
3443
3486
|
}
|
|
3444
3487
|
this.destroyed ? this.qrModal.hide() : r && this.options.send({ type: t.QR_SHOWN });
|
|
@@ -3447,13 +3490,13 @@ var _r = 1500, vr = class {
|
|
|
3447
3490
|
return this.sessionId === void 0 ? new Promise((e) => {
|
|
3448
3491
|
let t = setTimeout(() => {
|
|
3449
3492
|
this.pendingTimers.delete(t), e(void 0);
|
|
3450
|
-
},
|
|
3493
|
+
}, Cr);
|
|
3451
3494
|
this.pendingTimers.add(t), this.waiters.push((n) => {
|
|
3452
3495
|
this.pendingTimers.delete(t), clearTimeout(t), e(n);
|
|
3453
3496
|
});
|
|
3454
3497
|
}) : Promise.resolve(this.sessionId);
|
|
3455
3498
|
}
|
|
3456
|
-
},
|
|
3499
|
+
}, Tr = class {
|
|
3457
3500
|
callbacks = [];
|
|
3458
3501
|
lastKnown;
|
|
3459
3502
|
handleSync(e) {
|
|
@@ -3463,12 +3506,12 @@ var _r = 1500, vr = class {
|
|
|
3463
3506
|
onChange(e) {
|
|
3464
3507
|
this.callbacks.push(e), this.lastKnown !== void 0 && e(this.lastKnown);
|
|
3465
3508
|
}
|
|
3466
|
-
},
|
|
3509
|
+
}, Er = class extends br {
|
|
3467
3510
|
syncStatusTracker;
|
|
3468
3511
|
constructor(e) {
|
|
3469
|
-
let t = new
|
|
3512
|
+
let t = new Tr();
|
|
3470
3513
|
super(e, {
|
|
3471
|
-
createArActivation: (t) => new
|
|
3514
|
+
createArActivation: (t) => new wr({
|
|
3472
3515
|
app: e.app,
|
|
3473
3516
|
license: e.license,
|
|
3474
3517
|
model: e.model,
|
|
@@ -3481,4 +3524,4 @@ var _r = 1500, vr = class {
|
|
|
3481
3524
|
this.syncStatusTracker.onChange(e);
|
|
3482
3525
|
}
|
|
3483
3526
|
};
|
|
3484
|
-
export { a as AVAILABILITY, ue as Annotations,
|
|
3527
|
+
export { a as AVAILABILITY, ue as Annotations, Ie as Attribute, de as AttributeValue, lt as Camera, ut as CameraPosition, mt as Configuration, w as ERROR_CODES, ht as Focus, gt as Photo, vt as Snapshot, Z as VD_EVENTS, Er as VirtualdisplayClient, T as VirtualdisplayError, at as enableDebugMode, ot as isDebugMode, j as logger };
|