@alfadocs/ui-kit-debug 1.123.0 → 1.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{contact-profile-card-BubJPyRB.js → contact-profile-card-Jz2aSh7T.js} +172 -168
- package/dist/_chunks/contact-profile-card-Jz2aSh7T.js.map +1 -0
- package/dist/_chunks/{map-view-BqJMJ0Bj.js → map-view-DRd_GRQf.js} +140 -136
- package/dist/_chunks/map-view-DRd_GRQf.js.map +1 -0
- package/dist/_chunks/{practice-results-D3yWSNq8.js → practice-results-CbxBCDaU.js} +2 -2
- package/dist/_chunks/{practice-results-D3yWSNq8.js.map → practice-results-CbxBCDaU.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/format-phone.d.ts +24 -0
- package/dist/components/_shared/format-phone.d.ts.map +1 -0
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +15 -3
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/format-phone/index.js +20 -0
- package/dist/format-phone/index.js.map +1 -0
- package/dist/index.js +1281 -1279
- package/dist/index.js.map +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/contact-profile-card-BubJPyRB.js.map +0 -1
- package/dist/_chunks/map-view-BqJMJ0Bj.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m, jsxs as N, Fragment as ht } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as gt, useRef as k, useMemo as R, useId as Oe, useState as C, useEffect as $, useCallback as D, useImperativeHandle as vt, useContext as Ge, useLayoutEffect as ce, createContext as bt } from "react";
|
|
3
3
|
import { createPortal as je } from "react-dom";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as Y } from "./index-D2ZczOXr.js";
|
|
5
5
|
import { useTranslation as B } from "react-i18next";
|
|
6
6
|
import { M as wt, A as yt, a as kt, b as Mt, u as De, c as W, d as Ze, e as Fe } from "./maps-core-gate-DKx96CC_.js";
|
|
7
7
|
import { B as Ue } from "./button-DohK_Ak_.js";
|
|
@@ -154,7 +154,7 @@ const St = {
|
|
|
154
154
|
description: "Sourced from the id prop."
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
},
|
|
157
|
+
}, X = 32, J = 40, ie = "M16 38C16 38 2 26 2 16A14 14 0 0 1 30 16C30 26 16 38 16 38Z", Ke = 2, He = 4, qe = "translate(8.25 8.25) scale(0.10473)", Xe = [
|
|
158
158
|
{
|
|
159
159
|
tag: "rect",
|
|
160
160
|
attrs: {
|
|
@@ -199,13 +199,13 @@ const St = {
|
|
|
199
199
|
}
|
|
200
200
|
], $t = (e) => Object.entries(e).map(([t, n]) => `${t}="${n}"`).join(" ");
|
|
201
201
|
function It(e, t, n, r = {
|
|
202
|
-
width:
|
|
203
|
-
height:
|
|
202
|
+
width: X,
|
|
203
|
+
height: J
|
|
204
204
|
}) {
|
|
205
205
|
const o = Xe.map(
|
|
206
206
|
({ tag: s, attrs: i }) => `<${s} ${$t(i)}/>`
|
|
207
207
|
).join("");
|
|
208
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${r.width}" height="${r.height}" viewBox="0 0 ${
|
|
208
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${r.width}" height="${r.height}" viewBox="0 0 ${X} ${J}"><path d="${ie}" fill="none" stroke="${n}" stroke-width="${He}" stroke-linejoin="round"/><path d="${ie}" fill="${e}" stroke="${t}" stroke-width="${Ke}" stroke-linejoin="round"/><g fill="${t}" transform="${qe}">${o}</g></svg>`;
|
|
209
209
|
}
|
|
210
210
|
const Je = 1.4, Ct = [
|
|
211
211
|
"ds:[gmp-advanced-marker:focus-visible_&]:outline-[length:var(--focus-ring-width)]",
|
|
@@ -215,7 +215,7 @@ const Je = 1.4, Ct = [
|
|
|
215
215
|
"ds:[gmp-advanced-marker:focus-visible_&]:forced-colors:outline-[CanvasText]"
|
|
216
216
|
].join(" ");
|
|
217
217
|
function Lt({ hovered: e }) {
|
|
218
|
-
const t = e ? Je : 1, n = e ? "ds:fill-[var(--map-marker-
|
|
218
|
+
const t = e ? Je : 1, n = e ? "ds:fill-[var(--map-marker-selected-color)]" : "ds:fill-[var(--map-marker-color)]";
|
|
219
219
|
return /* @__PURE__ */ m(
|
|
220
220
|
"span",
|
|
221
221
|
{
|
|
@@ -227,9 +227,9 @@ function Lt({ hovered: e }) {
|
|
|
227
227
|
"aria-hidden": "true",
|
|
228
228
|
focusable: "false",
|
|
229
229
|
"data-map-pin": e ? "hovered" : "normal",
|
|
230
|
-
width:
|
|
231
|
-
height:
|
|
232
|
-
viewBox: `0 0 ${
|
|
230
|
+
width: X * t,
|
|
231
|
+
height: J * t,
|
|
232
|
+
viewBox: `0 0 ${X} ${J}`,
|
|
233
233
|
className: `ds:block ds:fill-[var(--map-marker-hover-ring)] ds:forced-colors:fill-[Canvas] ${Ct}`,
|
|
234
234
|
children: [
|
|
235
235
|
/* @__PURE__ */ m(
|
|
@@ -293,11 +293,11 @@ function Ot(e, t, n = Tt) {
|
|
|
293
293
|
(a, l) => a.x - l.x || a.y - l.y || (a.marker.id < l.marker.id ? -1 : 1)
|
|
294
294
|
), o = [], s = /* @__PURE__ */ new Map(), i = (a) => Math.floor(a / n), u = n * n;
|
|
295
295
|
for (const a of r) {
|
|
296
|
-
const l = i(a.x),
|
|
296
|
+
const l = i(a.x), p = i(a.y);
|
|
297
297
|
let g = null, c = u;
|
|
298
298
|
for (let h = -1; h <= 1; h += 1)
|
|
299
299
|
for (let w = -1; w <= 1; w += 1)
|
|
300
|
-
for (const b of s.get(`${l + h}:${
|
|
300
|
+
for (const b of s.get(`${l + h}:${p + w}`) ?? []) {
|
|
301
301
|
const M = (b.x - a.x) ** 2 + (b.y - a.y) ** 2;
|
|
302
302
|
M <= c && (g = b, c = M);
|
|
303
303
|
}
|
|
@@ -320,18 +320,18 @@ function Ot(e, t, n = Tt) {
|
|
|
320
320
|
lng: a.marker.position.lng
|
|
321
321
|
};
|
|
322
322
|
o.push(h);
|
|
323
|
-
const w = `${l}:${
|
|
323
|
+
const w = `${l}:${p}`, b = s.get(w);
|
|
324
324
|
b ? b.push(h) : s.set(w, [h]);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
const
|
|
327
|
+
const f = [], d = [];
|
|
328
328
|
for (const a of o)
|
|
329
|
-
a.members.length === 1 ?
|
|
329
|
+
a.members.length === 1 ? f.push(a.members[0]) : d.push({
|
|
330
330
|
id: a.members[0].id,
|
|
331
331
|
position: { lat: a.lat, lng: a.lng },
|
|
332
332
|
members: a.members
|
|
333
333
|
});
|
|
334
|
-
return { singles:
|
|
334
|
+
return { singles: f, clusters: d };
|
|
335
335
|
}
|
|
336
336
|
function Ne(e) {
|
|
337
337
|
if (!(e instanceof Element)) return !1;
|
|
@@ -366,15 +366,15 @@ function Dt(e, t) {
|
|
|
366
366
|
d && r(null);
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
const
|
|
370
|
-
r((c) => c === null || c >= i.length || Math.abs(i[c] -
|
|
369
|
+
const p = Math.log(a / l), g = jt(i, p);
|
|
370
|
+
r((c) => c === null || c >= i.length || Math.abs(i[c] - p) - Math.abs(i[g] - p) > Gt ? g : c);
|
|
371
371
|
};
|
|
372
372
|
if (u(!0), typeof ResizeObserver > "u") return;
|
|
373
|
-
const
|
|
374
|
-
return
|
|
373
|
+
const f = new ResizeObserver(() => u(!1));
|
|
374
|
+
return f.observe(s), () => f.disconnect();
|
|
375
375
|
}, [t, o]), n;
|
|
376
376
|
}
|
|
377
|
-
const Zt =
|
|
377
|
+
const Zt = Y(
|
|
378
378
|
[
|
|
379
379
|
"ds:relative ds:overflow-hidden ds:block",
|
|
380
380
|
"ds:bg-[var(--muted)]",
|
|
@@ -403,7 +403,7 @@ const Zt = J(
|
|
|
403
403
|
},
|
|
404
404
|
defaultVariants: { size: "md", surface: "bordered" }
|
|
405
405
|
}
|
|
406
|
-
), Ft =
|
|
406
|
+
), Ft = Y("ds:block ds:w-full", {
|
|
407
407
|
variants: {
|
|
408
408
|
size: {
|
|
409
409
|
sm: "ds:[block-size:var(--map-block-size)]",
|
|
@@ -413,7 +413,7 @@ const Zt = J(
|
|
|
413
413
|
}
|
|
414
414
|
},
|
|
415
415
|
defaultVariants: { size: "md" }
|
|
416
|
-
}), Ut =
|
|
416
|
+
}), Ut = Y(
|
|
417
417
|
[
|
|
418
418
|
"ds:absolute ds:inset-0",
|
|
419
419
|
"ds:flex ds:flex-col ds:items-center ds:justify-center",
|
|
@@ -422,7 +422,7 @@ const Zt = J(
|
|
|
422
422
|
"ds:bg-[var(--muted)] ds:text-[var(--foreground)]",
|
|
423
423
|
"ds:text-center"
|
|
424
424
|
].join(" ")
|
|
425
|
-
), Wt =
|
|
425
|
+
), Wt = Y("type-heading-3 ds:m-0"), Te = Y(
|
|
426
426
|
"type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0"
|
|
427
427
|
);
|
|
428
428
|
function Bt({
|
|
@@ -473,9 +473,9 @@ function Kt({
|
|
|
473
473
|
};
|
|
474
474
|
i();
|
|
475
475
|
let u;
|
|
476
|
-
const
|
|
477
|
-
if (c instanceof PointerEvent && c.pointerType === "touch" && (c.type === "pointerdown" &&
|
|
478
|
-
|
|
476
|
+
const f = /* @__PURE__ */ new Set(), d = (c) => {
|
|
477
|
+
if (c instanceof PointerEvent && c.pointerType === "touch" && (c.type === "pointerdown" && f.add(c.pointerId), c.type === "pointerup" || c.type === "pointercancel")) {
|
|
478
|
+
f.delete(c.pointerId);
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
481
|
if (c instanceof PointerEvent && c.type === "pointermove" && c.buttons === 0 && c.pointerType !== "touch" || c instanceof KeyboardEvent && ![
|
|
@@ -495,7 +495,7 @@ function Kt({
|
|
|
495
495
|
return;
|
|
496
496
|
const h = document.fullscreenElement, w = !!(h && (h.contains(o) || o.contains(h)));
|
|
497
497
|
let b = c.type === "dblclick";
|
|
498
|
-
c instanceof PointerEvent && c.type === "pointermove" && (b = c.pointerType !== "touch" ||
|
|
498
|
+
c instanceof PointerEvent && c.type === "pointermove" && (b = c.pointerType !== "touch" || f.size >= 2 || w), c.type === "touchmove" && (b = c.touches.length >= 2 || w), c instanceof KeyboardEvent && (b = c.key !== "Enter" && c.key !== " "), c instanceof WheelEvent && (b = c.ctrlKey || c.metaKey || w), c.type === "click" && (b = c.target instanceof Element && c.target.closest('button, [role="button"]') != null), b && (t.current.programmatic = !1), t.current.pendingInput = !0, clearTimeout(u), u = setTimeout(() => {
|
|
499
499
|
t.current.pendingInput = !1;
|
|
500
500
|
}, 250);
|
|
501
501
|
}, a = () => {
|
|
@@ -508,7 +508,7 @@ function Kt({
|
|
|
508
508
|
(j) => c[j] !== s.bounds[j]
|
|
509
509
|
), L = s != null && (w !== s.zoom || h.lat !== s.center.lat || h.lng !== s.center.lng);
|
|
510
510
|
s = { bounds: c, center: h, zoom: w }, M && r.current(c, { userInteraction: b && L });
|
|
511
|
-
},
|
|
511
|
+
}, p = [
|
|
512
512
|
"pointerdown",
|
|
513
513
|
"pointermove",
|
|
514
514
|
"pointerup",
|
|
@@ -520,7 +520,7 @@ function Kt({
|
|
|
520
520
|
"wheel",
|
|
521
521
|
"keydown"
|
|
522
522
|
];
|
|
523
|
-
|
|
523
|
+
p.forEach(
|
|
524
524
|
(c) => o.addEventListener(c, d, { capture: !0, passive: !0 })
|
|
525
525
|
);
|
|
526
526
|
const g = [
|
|
@@ -532,7 +532,7 @@ function Kt({
|
|
|
532
532
|
n.addListener("idle", l)
|
|
533
533
|
];
|
|
534
534
|
return l(), () => {
|
|
535
|
-
g.forEach((c) => c.remove()),
|
|
535
|
+
g.forEach((c) => c.remove()), p.forEach(
|
|
536
536
|
(c) => o.removeEventListener(c, d, !0)
|
|
537
537
|
), clearTimeout(u), i();
|
|
538
538
|
};
|
|
@@ -549,20 +549,20 @@ function Ht(e, t) {
|
|
|
549
549
|
o(null);
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
552
|
-
const
|
|
552
|
+
const p = l.clientWidth, g = l.clientHeight, c = Ye * 2 ** a;
|
|
553
553
|
o({
|
|
554
554
|
id: e,
|
|
555
|
-
width:
|
|
555
|
+
width: p,
|
|
556
556
|
height: g,
|
|
557
|
-
x:
|
|
557
|
+
x: p / 2 + (i - d.lng) / 360 * c,
|
|
558
558
|
y: g / 2 - (ae(s) - ae(d.lat)) * c / (2 * Math.PI)
|
|
559
559
|
});
|
|
560
560
|
};
|
|
561
561
|
u();
|
|
562
|
-
const
|
|
562
|
+
const f = ["bounds_changed", "zoom_changed", "center_changed", "idle"].flatMap(
|
|
563
563
|
(d) => typeof n.addListener == "function" ? [n.addListener(d, u)] : []
|
|
564
564
|
);
|
|
565
|
-
return () =>
|
|
565
|
+
return () => f.forEach((d) => d.remove());
|
|
566
566
|
}, [n, e, s, i]), (r == null ? void 0 : r.id) === e ? r : null;
|
|
567
567
|
}
|
|
568
568
|
function qt({
|
|
@@ -577,7 +577,7 @@ function qt({
|
|
|
577
577
|
t
|
|
578
578
|
);
|
|
579
579
|
}
|
|
580
|
-
const Xt = 52, Jt = 12,
|
|
580
|
+
const Xt = 52, Jt = 12, se = 8;
|
|
581
581
|
function Yt({
|
|
582
582
|
anchor: e,
|
|
583
583
|
children: t,
|
|
@@ -592,7 +592,7 @@ function Yt({
|
|
|
592
592
|
(h) => (h == null ? void 0 : h.width) === c.offsetWidth && h.height === c.offsetHeight ? h : { width: c.offsetWidth, height: c.offsetHeight }
|
|
593
593
|
);
|
|
594
594
|
}, [t, e.id]), !(e.x >= 0 && e.x <= e.width && e.y >= 0 && e.y <= e.height)) return null;
|
|
595
|
-
const u = (o == null ? void 0 : o.width) ?? 0,
|
|
595
|
+
const u = (o == null ? void 0 : o.width) ?? 0, f = (o == null ? void 0 : o.height) ?? 0, d = Math.max(se, e.width - u - se), a = Math.min(Math.max(e.x - u / 2, se), d), l = e.y - Xt - f, p = l < se, g = p ? e.y + Jt : l;
|
|
596
596
|
return (
|
|
597
597
|
// The layer is `ltr` because the map is geographic: x is always measured
|
|
598
598
|
// from the physical left. The card inside takes the page direction.
|
|
@@ -609,7 +609,7 @@ function Yt({
|
|
|
609
609
|
ref: r,
|
|
610
610
|
"data-component": "map-view-marker-card",
|
|
611
611
|
"data-marker-id": e.id,
|
|
612
|
-
"data-placement":
|
|
612
|
+
"data-placement": p ? "below" : "above",
|
|
613
613
|
style: {
|
|
614
614
|
"--marker-card-x": `${a}px`,
|
|
615
615
|
"--marker-card-y": `${g}px`
|
|
@@ -638,31 +638,31 @@ function Qt({
|
|
|
638
638
|
onHover: s,
|
|
639
639
|
elements: i
|
|
640
640
|
}) {
|
|
641
|
-
const [u,
|
|
641
|
+
const [u, f] = C(null), { id: d } = e, a = k(!1);
|
|
642
642
|
return $(() => {
|
|
643
643
|
const l = re(u);
|
|
644
644
|
if (l && (l.style.outline = "none"), !l || !i) return;
|
|
645
|
-
const
|
|
646
|
-
return
|
|
647
|
-
|
|
645
|
+
const p = i.current;
|
|
646
|
+
return p.set(`pin:${e.id}`, l), () => {
|
|
647
|
+
p.delete(`pin:${e.id}`);
|
|
648
648
|
};
|
|
649
649
|
}, [u, i, e.id]), $(() => {
|
|
650
650
|
const l = re(u);
|
|
651
651
|
if (!l || !s) return;
|
|
652
|
-
const
|
|
652
|
+
const p = (h) => {
|
|
653
653
|
Ne(h.target) && s(d, !0, "focus");
|
|
654
654
|
}, g = (h) => {
|
|
655
655
|
l.contains(h.relatedTarget) || a.current || s(d, !1, "focus");
|
|
656
656
|
}, c = (h) => {
|
|
657
657
|
h.key === "Escape" && s(d, !1, "focus");
|
|
658
658
|
};
|
|
659
|
-
return l.addEventListener("focusin",
|
|
660
|
-
l.removeEventListener("focusin",
|
|
659
|
+
return l.addEventListener("focusin", p), l.addEventListener("focusout", g), l.addEventListener("keydown", c), () => {
|
|
660
|
+
l.removeEventListener("focusin", p), l.removeEventListener("focusout", g), l.removeEventListener("keydown", c);
|
|
661
661
|
};
|
|
662
662
|
}, [u, d, s]), /* @__PURE__ */ m(
|
|
663
663
|
Ze,
|
|
664
664
|
{
|
|
665
|
-
ref:
|
|
665
|
+
ref: f,
|
|
666
666
|
position: e.position,
|
|
667
667
|
title: t,
|
|
668
668
|
"aria-label": t,
|
|
@@ -675,8 +675,8 @@ function Qt({
|
|
|
675
675
|
} : void 0,
|
|
676
676
|
onMouseLeave: s ? () => {
|
|
677
677
|
a.current = !1;
|
|
678
|
-
const l = re(u),
|
|
679
|
-
l &&
|
|
678
|
+
const l = re(u), p = document.activeElement;
|
|
679
|
+
l && p && l.contains(p) && Ne(p) || s(d, !1, "pointer");
|
|
680
680
|
} : void 0,
|
|
681
681
|
children: /* @__PURE__ */ m(Lt, { hovered: r })
|
|
682
682
|
}
|
|
@@ -695,15 +695,15 @@ function nn(e) {
|
|
|
695
695
|
return { north: t, south: n, east: r, west: o };
|
|
696
696
|
}
|
|
697
697
|
function Qe(e, t, n, r, o) {
|
|
698
|
-
const { north: s, south: i, east: u, west:
|
|
699
|
-
if (s === i && u ===
|
|
698
|
+
const { north: s, south: i, east: u, west: f } = nn(e);
|
|
699
|
+
if (s === i && u === f)
|
|
700
700
|
return { center: { lat: s, lng: u }, zoom: o };
|
|
701
701
|
const d = ae(s), a = ae(i), l = {
|
|
702
702
|
lat: tn((d + a) / 2),
|
|
703
|
-
lng: (u +
|
|
704
|
-
},
|
|
705
|
-
|
|
706
|
-
|
|
703
|
+
lng: (u + f) / 2
|
|
704
|
+
}, p = (c, h) => h > 0 ? Math.log2(Math.max(c, 1) / Ye / h) : o, g = Math.min(
|
|
705
|
+
p(t - 2 * r, (u - f) / 360),
|
|
706
|
+
p(n - 2 * r, (d - a) / (2 * Math.PI)),
|
|
707
707
|
o
|
|
708
708
|
);
|
|
709
709
|
return { center: l, zoom: Math.max(0, Math.floor(g)) };
|
|
@@ -718,23 +718,23 @@ function on({
|
|
|
718
718
|
const o = W(), s = k(null), i = k(!1), u = k(null);
|
|
719
719
|
return $(() => {
|
|
720
720
|
if (!o) return;
|
|
721
|
-
const
|
|
721
|
+
const f = () => {
|
|
722
722
|
var c;
|
|
723
|
-
const a = u.current, l = (c = o.getCenter()) == null ? void 0 : c.toJSON(),
|
|
724
|
-
a != null &&
|
|
723
|
+
const a = u.current, l = (c = o.getCenter()) == null ? void 0 : c.toJSON(), p = o.getZoom();
|
|
724
|
+
a != null && p === a.zoom && l != null && Math.abs(l.lat - a.center.lat) < 1e-6 && Math.abs(l.lng - a.center.lng) < 1e-6 || (i.current = !0);
|
|
725
725
|
}, d = [
|
|
726
726
|
o.addListener("dragstart", () => {
|
|
727
727
|
i.current = !0;
|
|
728
728
|
}),
|
|
729
|
-
o.addListener("center_changed",
|
|
730
|
-
o.addListener("zoom_changed",
|
|
729
|
+
o.addListener("center_changed", f),
|
|
730
|
+
o.addListener("zoom_changed", f)
|
|
731
731
|
];
|
|
732
732
|
return () => d.forEach((a) => a.remove());
|
|
733
733
|
}, [o]), $(() => {
|
|
734
734
|
var w;
|
|
735
735
|
if (!o) return;
|
|
736
|
-
const
|
|
737
|
-
if ((
|
|
736
|
+
const f = ((w = s.current) == null ? void 0 : w.map) === o ? s.current : null;
|
|
737
|
+
if ((f == null ? void 0 : f.key) === t) return;
|
|
738
738
|
const d = new Set(e.map(et)), a = (b, M) => {
|
|
739
739
|
u.current = { center: b, zoom: M }, r(), o.moveCamera({ center: b, zoom: M }), i.current = !1;
|
|
740
740
|
};
|
|
@@ -742,27 +742,27 @@ function on({
|
|
|
742
742
|
s.current = { map: o, key: t, points: d };
|
|
743
743
|
return;
|
|
744
744
|
}
|
|
745
|
-
if (
|
|
745
|
+
if (f != null && f.points.size > 0 && [...f.points].every((b) => d.has(b)) && i.current) {
|
|
746
746
|
s.current = { map: o, key: t, points: d };
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
const
|
|
750
|
-
if (!(
|
|
749
|
+
const p = o.getDiv();
|
|
750
|
+
if (!(p instanceof Element)) return;
|
|
751
751
|
const g = () => {
|
|
752
752
|
s.current = { map: o, key: t, points: d };
|
|
753
753
|
const b = Math.min(
|
|
754
|
-
ge("--spacing-2xl",
|
|
755
|
-
|
|
756
|
-
|
|
754
|
+
ge("--spacing-2xl", p, 48),
|
|
755
|
+
p.clientWidth / 4,
|
|
756
|
+
p.clientHeight / 4
|
|
757
757
|
), { center: M, zoom: L } = Qe(
|
|
758
758
|
e,
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
p.clientWidth,
|
|
760
|
+
p.clientHeight,
|
|
761
761
|
b,
|
|
762
762
|
n
|
|
763
763
|
);
|
|
764
764
|
a(M, L);
|
|
765
|
-
}, c = () =>
|
|
765
|
+
}, c = () => p.clientWidth > 0 && p.clientHeight > 0;
|
|
766
766
|
if (c() || typeof ResizeObserver > "u") {
|
|
767
767
|
g();
|
|
768
768
|
return;
|
|
@@ -770,7 +770,7 @@ function on({
|
|
|
770
770
|
const h = new ResizeObserver(() => {
|
|
771
771
|
c() && (h.disconnect(), g());
|
|
772
772
|
});
|
|
773
|
-
return h.observe(
|
|
773
|
+
return h.observe(p), () => h.disconnect();
|
|
774
774
|
}, [o, t, e, n, r]), null;
|
|
775
775
|
}
|
|
776
776
|
const Pe = 10;
|
|
@@ -822,7 +822,7 @@ function an({ count: e }) {
|
|
|
822
822
|
}
|
|
823
823
|
);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function q(e, t) {
|
|
826
826
|
const n = document.createElement("span");
|
|
827
827
|
n.style.color = `var(${e})`, n.style.display = "none", (t.isConnected ? t : document.documentElement).append(n);
|
|
828
828
|
const r = getComputedStyle(n).color;
|
|
@@ -835,32 +835,33 @@ function cn(e) {
|
|
|
835
835
|
if (!e || !t) return;
|
|
836
836
|
const o = (a = t.getDiv) == null ? void 0 : a.call(t), s = o instanceof Element ? o : document.documentElement, i = () => {
|
|
837
837
|
const l = {
|
|
838
|
-
fill:
|
|
839
|
-
ink:
|
|
840
|
-
ring:
|
|
841
|
-
hover:
|
|
838
|
+
fill: q("--map-marker-color", s),
|
|
839
|
+
ink: q("--map-marker-hover-ring", s),
|
|
840
|
+
ring: q("--map-marker-hover-ring", s),
|
|
841
|
+
hover: q("--map-marker-hover-color", s),
|
|
842
|
+
selected: q("--map-marker-selected-color", s),
|
|
842
843
|
target: ge("--min-target-size", s, 44)
|
|
843
844
|
};
|
|
844
845
|
r(
|
|
845
|
-
(
|
|
846
|
+
(p) => p && p.fill === l.fill && p.ink === l.ink && p.ring === l.ring && p.hover === l.hover && p.selected === l.selected && p.target === l.target ? p : l
|
|
846
847
|
);
|
|
847
848
|
};
|
|
848
849
|
i();
|
|
849
|
-
const u = new MutationObserver(i),
|
|
850
|
+
const u = new MutationObserver(i), f = {
|
|
850
851
|
attributes: !0,
|
|
851
852
|
attributeFilter: ["class", "data-theme"]
|
|
852
853
|
};
|
|
853
|
-
u.observe(document.documentElement,
|
|
854
|
+
u.observe(document.documentElement, f);
|
|
854
855
|
const d = s.closest('[data-component="theme-root"]');
|
|
855
|
-
return d && u.observe(d,
|
|
856
|
+
return d && u.observe(d, f), () => u.disconnect();
|
|
856
857
|
}, [t, e]), n;
|
|
857
858
|
}
|
|
858
859
|
function ln(e, { fill: t, ink: n, ring: r, hover: o, target: s }) {
|
|
859
860
|
var l;
|
|
860
|
-
const i = Math.max(s, 20 + String(e).length * 12), u = `x="2" y="2" width="${i - 4}" height="${s - 4}" rx="${s / 2}"`,
|
|
861
|
+
const i = Math.max(s, 20 + String(e).length * 12), u = `x="2" y="2" width="${i - 4}" height="${s - 4}" rx="${s / 2}"`, f = `<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${s}"><rect ${u} fill="none" stroke="${o}" stroke-width="4"/><rect ${u} fill="${t}" stroke="${r}" stroke-width="2"/></svg>`, d = (l = globalThis.google) == null ? void 0 : l.maps;
|
|
861
862
|
return {
|
|
862
863
|
icon: {
|
|
863
|
-
url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(
|
|
864
|
+
url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(f)}`,
|
|
864
865
|
scaledSize: d ? new d.Size(i, s) : void 0,
|
|
865
866
|
anchor: d ? new d.Point(i / 2, s / 2) : void 0
|
|
866
867
|
},
|
|
@@ -875,13 +876,16 @@ function dn({
|
|
|
875
876
|
const n = cn(e);
|
|
876
877
|
return /* @__PURE__ */ m(ve.Provider, { value: n, children: t });
|
|
877
878
|
}
|
|
878
|
-
function un({ fill: e, ring: t, hover: n },
|
|
879
|
-
var
|
|
880
|
-
const
|
|
879
|
+
function un({ fill: e, ring: t, hover: n, selected: r }, o) {
|
|
880
|
+
var a;
|
|
881
|
+
const s = o ? Je : 1, i = X * s, u = J * s, f = It(o ? r : e, t, n, {
|
|
882
|
+
width: i,
|
|
883
|
+
height: u
|
|
884
|
+
}), d = (a = globalThis.google) == null ? void 0 : a.maps;
|
|
881
885
|
return {
|
|
882
|
-
url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(
|
|
883
|
-
scaledSize:
|
|
884
|
-
anchor:
|
|
886
|
+
url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(f)}`,
|
|
887
|
+
scaledSize: d ? new d.Size(i, u) : void 0,
|
|
888
|
+
anchor: d ? new d.Point(i / 2, u) : void 0
|
|
885
889
|
};
|
|
886
890
|
}
|
|
887
891
|
function mn({
|
|
@@ -917,15 +921,15 @@ function pn({
|
|
|
917
921
|
elements: o,
|
|
918
922
|
onActivate: s
|
|
919
923
|
}) {
|
|
920
|
-
const [i, u] = C(null),
|
|
924
|
+
const [i, u] = C(null), f = `cluster:${e.id}`;
|
|
921
925
|
$(() => {
|
|
922
926
|
const l = re(i);
|
|
923
927
|
if (!l) return;
|
|
924
|
-
const
|
|
925
|
-
return
|
|
926
|
-
|
|
928
|
+
const p = o.current;
|
|
929
|
+
return p.set(f, l), l.style.outline = "none", () => {
|
|
930
|
+
p.delete(f);
|
|
927
931
|
};
|
|
928
|
-
}, [i, o,
|
|
932
|
+
}, [i, o, f]);
|
|
929
933
|
const d = e.members.length, a = R(
|
|
930
934
|
() => n || !r ? null : ln(d, r),
|
|
931
935
|
[n, d, r]
|
|
@@ -964,11 +968,11 @@ function gn({
|
|
|
964
968
|
mapId: s,
|
|
965
969
|
frame: i,
|
|
966
970
|
elements: u,
|
|
967
|
-
labelFor:
|
|
971
|
+
labelFor: f,
|
|
968
972
|
onCameraMove: d,
|
|
969
973
|
onClusterClick: a
|
|
970
974
|
}) {
|
|
971
|
-
const l = W(), { t:
|
|
975
|
+
const l = W(), { t: p } = B("ui"), g = sn(t), c = Ge(ve), h = R(
|
|
972
976
|
() => Ot(e, g),
|
|
973
977
|
[e, g]
|
|
974
978
|
), { singles: w, clusters: b } = R(() => {
|
|
@@ -1002,7 +1006,7 @@ function gn({
|
|
|
1002
1006
|
ids: new Set(y.members.map((S) => S.id)),
|
|
1003
1007
|
centre: y.position
|
|
1004
1008
|
}, L(""), clearTimeout(G.current), G.current = setTimeout(
|
|
1005
|
-
() => L(
|
|
1009
|
+
() => L(p("mapView.clusterZoomed", { label: f(T) })),
|
|
1006
1010
|
fn
|
|
1007
1011
|
), d(), a == null || a({
|
|
1008
1012
|
count: T,
|
|
@@ -1016,7 +1020,7 @@ function gn({
|
|
|
1016
1020
|
const z = () => {
|
|
1017
1021
|
let I = null;
|
|
1018
1022
|
for (const _ of b) {
|
|
1019
|
-
if (!_.members.some((
|
|
1023
|
+
if (!_.members.some((Q) => y.ids.has(Q.id)))
|
|
1020
1024
|
continue;
|
|
1021
1025
|
const S = (_.position.lat - y.centre.lat) ** 2 + (_.position.lng - y.centre.lng) ** 2;
|
|
1022
1026
|
(!I || S < I.distance) && (I = { key: `cluster:${_.id}`, distance: S });
|
|
@@ -1045,7 +1049,7 @@ function gn({
|
|
|
1045
1049
|
pn,
|
|
1046
1050
|
{
|
|
1047
1051
|
cluster: y,
|
|
1048
|
-
label:
|
|
1052
|
+
label: f(y.members.length),
|
|
1049
1053
|
mapId: s,
|
|
1050
1054
|
iconTheme: c,
|
|
1051
1055
|
elements: u,
|
|
@@ -1104,7 +1108,7 @@ function nt({
|
|
|
1104
1108
|
ce(() => {
|
|
1105
1109
|
i(!0);
|
|
1106
1110
|
}, []);
|
|
1107
|
-
const u = (o !== null ? (a = e.sources) == null ? void 0 : a[o] : void 0) ?? e,
|
|
1111
|
+
const u = (o !== null ? (a = e.sources) == null ? void 0 : a[o] : void 0) ?? e, f = /* @__PURE__ */ m(
|
|
1108
1112
|
"img",
|
|
1109
1113
|
{
|
|
1110
1114
|
src: u.src,
|
|
@@ -1125,9 +1129,9 @@ function nt({
|
|
|
1125
1129
|
ref: r,
|
|
1126
1130
|
"data-testid": "map-view-preview-area",
|
|
1127
1131
|
className: "ds:absolute ds:inset-0",
|
|
1128
|
-
children: s ?
|
|
1132
|
+
children: s ? f : null
|
|
1129
1133
|
}
|
|
1130
|
-
) :
|
|
1134
|
+
) : f;
|
|
1131
1135
|
}
|
|
1132
1136
|
function vn({
|
|
1133
1137
|
children: e,
|
|
@@ -1157,7 +1161,7 @@ function wn({
|
|
|
1157
1161
|
openInGoogleMapsHref: s,
|
|
1158
1162
|
onUnmount: i
|
|
1159
1163
|
}) {
|
|
1160
|
-
const { t: u } = B("ui"),
|
|
1164
|
+
const { t: u } = B("ui"), f = Oe(), d = k(null);
|
|
1161
1165
|
return ot(d, i), /* @__PURE__ */ N(
|
|
1162
1166
|
"div",
|
|
1163
1167
|
{
|
|
@@ -1175,7 +1179,7 @@ function wn({
|
|
|
1175
1179
|
/* @__PURE__ */ m(
|
|
1176
1180
|
"p",
|
|
1177
1181
|
{
|
|
1178
|
-
id:
|
|
1182
|
+
id: f,
|
|
1179
1183
|
className: "type-meta ds:m-0 ds:min-w-0 ds:flex-1 ds:text-[var(--foreground)]",
|
|
1180
1184
|
children: o
|
|
1181
1185
|
}
|
|
@@ -1189,7 +1193,7 @@ function wn({
|
|
|
1189
1193
|
size: "sm",
|
|
1190
1194
|
className: "ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)]",
|
|
1191
1195
|
onClick: t,
|
|
1192
|
-
"aria-describedby":
|
|
1196
|
+
"aria-describedby": f,
|
|
1193
1197
|
"data-testid": "map-view-load-cta",
|
|
1194
1198
|
children: u("mapView.consentTitle")
|
|
1195
1199
|
}
|
|
@@ -1224,11 +1228,11 @@ function Ve({
|
|
|
1224
1228
|
consentCta: s,
|
|
1225
1229
|
onUnmount: i
|
|
1226
1230
|
}) {
|
|
1227
|
-
const { t: u } = B("ui"),
|
|
1228
|
-
return ot(
|
|
1231
|
+
const { t: u } = B("ui"), f = k(null);
|
|
1232
|
+
return ot(f, i), /* @__PURE__ */ N(
|
|
1229
1233
|
"div",
|
|
1230
1234
|
{
|
|
1231
|
-
ref:
|
|
1235
|
+
ref: f,
|
|
1232
1236
|
className: Ut(),
|
|
1233
1237
|
"data-testid": "map-view-consent",
|
|
1234
1238
|
children: [
|
|
@@ -1297,11 +1301,11 @@ const yn = gt(
|
|
|
1297
1301
|
selectedMarkerId: s,
|
|
1298
1302
|
hoveredMarkerId: i,
|
|
1299
1303
|
renderMarkerCard: u,
|
|
1300
|
-
onMarkerHover:
|
|
1304
|
+
onMarkerHover: f,
|
|
1301
1305
|
onMarkerClick: d,
|
|
1302
1306
|
onBoundsChange: a,
|
|
1303
1307
|
consentGranted: l = !1,
|
|
1304
|
-
onConsentRequest:
|
|
1308
|
+
onConsentRequest: p,
|
|
1305
1309
|
staticPreview: g,
|
|
1306
1310
|
address: c,
|
|
1307
1311
|
contentLang: h,
|
|
@@ -1320,10 +1324,10 @@ const yn = gt(
|
|
|
1320
1324
|
className: I,
|
|
1321
1325
|
...T
|
|
1322
1326
|
}, _) => {
|
|
1323
|
-
const { t: S, i18n:
|
|
1324
|
-
() => y ??
|
|
1325
|
-
[y,
|
|
1326
|
-
), Z =
|
|
1327
|
+
const { t: S, i18n: Q } = B("ui"), be = k(/* @__PURE__ */ new Map()), ee = R(() => j ?? [], [j]), st = R(
|
|
1328
|
+
() => y ?? ee.map((v) => `${et(v)}@${v.lat},${v.lng}`).sort().join("|"),
|
|
1329
|
+
[y, ee]
|
|
1330
|
+
), Z = ee.length > 0, we = k(Z), ye = Oe(), rt = R(
|
|
1327
1331
|
() => `map-${ye.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
1328
1332
|
[ye]
|
|
1329
1333
|
), [ke, it] = C(!1);
|
|
@@ -1342,7 +1346,7 @@ const yn = gt(
|
|
|
1342
1346
|
moved: !1,
|
|
1343
1347
|
programmatic: !0
|
|
1344
1348
|
};
|
|
1345
|
-
}, []),
|
|
1349
|
+
}, []), te = D(
|
|
1346
1350
|
(v) => {
|
|
1347
1351
|
K(), d == null || d(v);
|
|
1348
1352
|
},
|
|
@@ -1352,7 +1356,7 @@ const yn = gt(
|
|
|
1352
1356
|
[i, u, o]
|
|
1353
1357
|
), ct = D((v) => {
|
|
1354
1358
|
O.current = v;
|
|
1355
|
-
}, []), ze = k(!1), Ee = k(null), _e = k(0),
|
|
1359
|
+
}, []), ze = k(!1), Ee = k(null), _e = k(0), ne = D(
|
|
1356
1360
|
() => ({
|
|
1357
1361
|
panTo: (v) => {
|
|
1358
1362
|
var x;
|
|
@@ -1385,10 +1389,10 @@ const yn = gt(
|
|
|
1385
1389
|
}),
|
|
1386
1390
|
[]
|
|
1387
1391
|
);
|
|
1388
|
-
vt(_,
|
|
1392
|
+
vt(_, ne, [ne]);
|
|
1389
1393
|
const lt = R(
|
|
1390
|
-
() =>
|
|
1391
|
-
[
|
|
1394
|
+
() => ne(),
|
|
1395
|
+
[ne]
|
|
1392
1396
|
);
|
|
1393
1397
|
Et(St, lt, e), $(() => {
|
|
1394
1398
|
var x, U;
|
|
@@ -1404,8 +1408,8 @@ const yn = gt(
|
|
|
1404
1408
|
var v;
|
|
1405
1409
|
Z || (v = O.current) == null || v.setZoom(r);
|
|
1406
1410
|
}, [r, Z]);
|
|
1407
|
-
const [dt, Se] = C(!1),
|
|
1408
|
-
ze.current =
|
|
1411
|
+
const [dt, Se] = C(!1), oe = l || dt;
|
|
1412
|
+
ze.current = oe, Ee.current = s ?? null, _e.current = (o ?? []).length;
|
|
1409
1413
|
const [ut, mt] = C(null), F = g && g.src !== ut ? g : void 0, ue = g == null ? void 0 : g.src, me = D(() => {
|
|
1410
1414
|
ue && mt(ue);
|
|
1411
1415
|
}, [ue]), $e = k(null), pe = k(!1), fe = k(!1), Ie = D((v) => {
|
|
@@ -1413,17 +1417,17 @@ const yn = gt(
|
|
|
1413
1417
|
}, []);
|
|
1414
1418
|
$(() => {
|
|
1415
1419
|
var H;
|
|
1416
|
-
if (!
|
|
1420
|
+
if (!oe) return;
|
|
1417
1421
|
const v = document.activeElement, x = !v || v === document.body, U = pe.current || fe.current && x;
|
|
1418
1422
|
pe.current = !1, fe.current = !1, U && ((H = $e.current) == null || H.focus({ preventScroll: !0 }));
|
|
1419
|
-
}, [
|
|
1423
|
+
}, [oe]);
|
|
1420
1424
|
const Ce = D(() => {
|
|
1421
|
-
if (pe.current = !0,
|
|
1422
|
-
|
|
1425
|
+
if (pe.current = !0, p) {
|
|
1426
|
+
p(), Se(!0);
|
|
1423
1427
|
return;
|
|
1424
1428
|
}
|
|
1425
1429
|
Se(!0);
|
|
1426
|
-
}, [
|
|
1430
|
+
}, [p]), Le = (v) => {
|
|
1427
1431
|
const x = s != null && s === v.id, U = i != null && i === v.id, H = S("mapView.markerLabel", {
|
|
1428
1432
|
label: v.label ?? v.id
|
|
1429
1433
|
});
|
|
@@ -1434,8 +1438,8 @@ const yn = gt(
|
|
|
1434
1438
|
label: H,
|
|
1435
1439
|
isSelected: x,
|
|
1436
1440
|
isHovered: U,
|
|
1437
|
-
onSelect:
|
|
1438
|
-
onHover:
|
|
1441
|
+
onSelect: te,
|
|
1442
|
+
onHover: f,
|
|
1439
1443
|
elements: be
|
|
1440
1444
|
},
|
|
1441
1445
|
v.id
|
|
@@ -1446,8 +1450,8 @@ const yn = gt(
|
|
|
1446
1450
|
label: H,
|
|
1447
1451
|
isSelected: x,
|
|
1448
1452
|
isHovered: U,
|
|
1449
|
-
onSelect:
|
|
1450
|
-
onHover:
|
|
1453
|
+
onSelect: te,
|
|
1454
|
+
onHover: f
|
|
1451
1455
|
},
|
|
1452
1456
|
v.id
|
|
1453
1457
|
);
|
|
@@ -1471,7 +1475,7 @@ const yn = gt(
|
|
|
1471
1475
|
{
|
|
1472
1476
|
ref: at,
|
|
1473
1477
|
className: Ft({ size: L, className: "ds:relative" }),
|
|
1474
|
-
children:
|
|
1478
|
+
children: oe ? (
|
|
1475
1479
|
// A provider failure shows the consent placeholder (its "Open in
|
|
1476
1480
|
// Google Maps" link needs no script) with "Load map" as the
|
|
1477
1481
|
// retry, instead of unmounting the host's React tree. The gate
|
|
@@ -1506,7 +1510,7 @@ const yn = gt(
|
|
|
1506
1510
|
yt,
|
|
1507
1511
|
{
|
|
1508
1512
|
apiKey: t,
|
|
1509
|
-
language:
|
|
1513
|
+
language: Q.language,
|
|
1510
1514
|
children: /* @__PURE__ */ m(
|
|
1511
1515
|
vn,
|
|
1512
1516
|
{
|
|
@@ -1526,14 +1530,14 @@ const yn = gt(
|
|
|
1526
1530
|
mapId: M,
|
|
1527
1531
|
gestureHandling: "cooperative",
|
|
1528
1532
|
disableDefaultUI: !1,
|
|
1529
|
-
onClick: () =>
|
|
1533
|
+
onClick: () => te(null),
|
|
1530
1534
|
className: "ds:[inline-size:100%] ds:[block-size:100%]",
|
|
1531
1535
|
children: [
|
|
1532
1536
|
/* @__PURE__ */ m(
|
|
1533
1537
|
Bt,
|
|
1534
1538
|
{
|
|
1535
1539
|
onHandleReady: ct,
|
|
1536
|
-
onMarkerSelect:
|
|
1540
|
+
onMarkerSelect: te,
|
|
1537
1541
|
onCameraMove: K
|
|
1538
1542
|
}
|
|
1539
1543
|
),
|
|
@@ -1547,7 +1551,7 @@ const yn = gt(
|
|
|
1547
1551
|
j ? /* @__PURE__ */ m(
|
|
1548
1552
|
on,
|
|
1549
1553
|
{
|
|
1550
|
-
points:
|
|
1554
|
+
points: ee,
|
|
1551
1555
|
fitKey: st,
|
|
1552
1556
|
maxZoom: E,
|
|
1553
1557
|
onCameraMove: K
|
|
@@ -1558,7 +1562,7 @@ const yn = gt(
|
|
|
1558
1562
|
{
|
|
1559
1563
|
marker: de,
|
|
1560
1564
|
frame: xe,
|
|
1561
|
-
direction:
|
|
1565
|
+
direction: Q.dir(),
|
|
1562
1566
|
children: u(de.id)
|
|
1563
1567
|
}
|
|
1564
1568
|
) : null,
|
|
@@ -1623,4 +1627,4 @@ export {
|
|
|
1623
1627
|
yn as M,
|
|
1624
1628
|
Ne as i
|
|
1625
1629
|
};
|
|
1626
|
-
//# sourceMappingURL=map-view-
|
|
1630
|
+
//# sourceMappingURL=map-view-DRd_GRQf.js.map
|