@brightlocal/ui-components 2.15.0 → 2.16.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/map.js CHANGED
@@ -1,21 +1,21 @@
1
- import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { cva as M } from "class-variance-authority";
4
- import { RefreshCw as N, TriangleAlert as T, Store as C } from "@brightlocal/icons";
5
- import { GlobeyFixingFault as P, MapBackground as S } from "@brightlocal/illustrations";
6
- import { Button as b } from "@brightlocal/ui-components/button";
7
- import { Card as L, CardContent as R } from "@brightlocal/ui-components/card";
8
- import { cn as p } from "@brightlocal/ui-components/lib/utils";
9
- import { Popover as A, PopoverAnchor as E, PopoverContent as I } from "@brightlocal/ui-components/popover";
10
- const ae = {
1
+ import { jsx as c, jsxs as y } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { cva as K } from "class-variance-authority";
4
+ import { RefreshCw as U, TriangleAlert as W, Store as Y } from "@brightlocal/icons";
5
+ import { GlobeyFixingFault as Z, MapBackground as q } from "@brightlocal/illustrations";
6
+ import { Button as T } from "@brightlocal/ui-components/button";
7
+ import { Card as H, CardContent as J } from "@brightlocal/ui-components/card";
8
+ import { cn as g } from "@brightlocal/ui-components/lib/utils";
9
+ import { Popover as Q, PopoverAnchor as X, PopoverContent as ee } from "@brightlocal/ui-components/popover";
10
+ const Se = {
11
11
  /** Default road map view */
12
12
  ROADMAP: "roadmap",
13
13
  /** @deprecated Satellite imagery — prefer cloud-based map styling via Map ID */
14
14
  SATELLITE: "satellite"
15
- }, j = ["water", "landscape", "road", "poi", "transit"];
16
- function D(e, t) {
15
+ }, te = ["water", "landscape", "road", "poi", "transit"];
16
+ function re(e, t) {
17
17
  return [
18
- ...j.map((a) => ({
18
+ ...te.map((a) => ({
19
19
  featureType: a,
20
20
  elementType: "geometry",
21
21
  stylers: [{ saturation: e, lightness: t }]
@@ -30,7 +30,7 @@ function D(e, t) {
30
30
  }
31
31
  ];
32
32
  }
33
- const h = [
33
+ const $ = [
34
34
  { elementType: "geometry", stylers: [{ color: "#444444" }] },
35
35
  { elementType: "labels.text.fill", stylers: [{ color: "#aaaaaa" }] },
36
36
  { elementType: "labels.text.stroke", stylers: [{ color: "#323232" }] },
@@ -65,96 +65,136 @@ const h = [
65
65
  stylers: [{ color: "#505050" }]
66
66
  },
67
67
  { elementType: "labels.icon", stylers: [{ visibility: "off" }] }
68
- ], B = {
69
- default: { light: [], dark: h },
70
- muted: { light: D(-40, 20), dark: h }
71
- };
72
- function k() {
73
- const [e, t] = d.useState(
74
- () => typeof document < "u" && document.body.classList.contains("dark")
68
+ ], ae = {
69
+ default: { light: [], dark: $ },
70
+ muted: { light: re(-40, 20), dark: $ }
71
+ }, w = /* @__PURE__ */ new Set();
72
+ let M = typeof document < "u" && document.body.classList.contains("dark"), S = !1;
73
+ function oe() {
74
+ if (S || typeof document > "u") return;
75
+ S = !0, new MutationObserver(() => {
76
+ const t = document.body.classList.contains("dark");
77
+ if (t !== M) {
78
+ M = t;
79
+ for (const a of w) a();
80
+ }
81
+ }).observe(document.body, {
82
+ attributes: !0,
83
+ attributeFilter: ["class"]
84
+ });
85
+ }
86
+ function ne(e) {
87
+ return w.add(e), oe(), () => {
88
+ w.delete(e);
89
+ };
90
+ }
91
+ function se() {
92
+ return M;
93
+ }
94
+ function le() {
95
+ return !1;
96
+ }
97
+ function E() {
98
+ return u.useSyncExternalStore(
99
+ ne,
100
+ se,
101
+ le
75
102
  );
76
- return d.useEffect(() => {
77
- const a = new MutationObserver(() => {
78
- t(document.body.classList.contains("dark"));
79
- });
80
- return a.observe(document.body, {
81
- attributes: !0,
82
- attributeFilter: ["class"]
83
- }), () => a.disconnect();
84
- }, []), e;
85
103
  }
86
- function re(e = "default") {
87
- const t = k();
88
- return B[e][t ? "dark" : "light"];
104
+ function Te(e = "default") {
105
+ const t = E();
106
+ return ae[e][t ? "dark" : "light"];
89
107
  }
90
- const v = {
108
+ const R = {
91
109
  primary: "strong",
92
110
  secondary: "moderate",
93
111
  warning: "moderate",
94
112
  destructive: "unranked",
95
113
  outline: "unranked"
96
114
  };
97
- function z(e) {
98
- return e in v;
115
+ function ie(e) {
116
+ return e in R;
99
117
  }
100
- function $(e) {
101
- return z(e) ? v[e] : e;
118
+ function ce(e) {
119
+ return ie(e) ? R[e] : e;
102
120
  }
103
- const y = {
104
- strong: "bg-primary dark:bg-green-400",
105
- moderate: "bg-chart-4",
106
- weak: "bg-orange-400",
107
- unranked: "bg-red-600",
108
- error: "bg-warning-background dark:bg-orange-200"
109
- }, F = M(
121
+ const x = {
122
+ strong: {
123
+ className: "bg-primary dark:bg-green-400",
124
+ cssVar: "--ds-tailwind-colors-green-400",
125
+ fallback: "#2ae855"
126
+ },
127
+ moderate: {
128
+ className: "bg-chart-4",
129
+ cssVar: "--ds-tailwind-colors-yellow-400",
130
+ fallback: "#facc15"
131
+ },
132
+ weak: {
133
+ className: "bg-orange-400",
134
+ cssVar: "--ds-tailwind-colors-orange-400",
135
+ fallback: "#fb923c"
136
+ },
137
+ unranked: {
138
+ className: "bg-red-600",
139
+ cssVar: "--ds-tailwind-colors-red-600",
140
+ fallback: "#dc2626"
141
+ },
142
+ error: {
143
+ className: "bg-warning-background dark:bg-orange-200",
144
+ cssVar: "--ds-tailwind-colors-orange-200",
145
+ fallback: "#fed7aa"
146
+ }
147
+ }, h = Object.fromEntries(
148
+ Object.entries(x).map(([e, t]) => [e, t.className])
149
+ ), de = K(
110
150
  "inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-200 ease-out hover:shadow-md",
111
151
  {
112
152
  variants: {
113
153
  variant: {
114
- strong: `${y.strong}`,
115
- moderate: `${y.moderate}`,
116
- weak: `${y.weak}`,
117
- unranked: `${y.unranked} text-white dark:text-white`,
118
- error: `${y.error}`
154
+ strong: `${h.strong}`,
155
+ moderate: `${h.moderate}`,
156
+ weak: `${h.weak}`,
157
+ unranked: `${h.unranked} text-white dark:text-white`,
158
+ error: `${h.error}`
119
159
  }
120
160
  },
121
161
  defaultVariants: {
122
162
  variant: "strong"
123
163
  }
124
164
  }
125
- ), x = d.forwardRef(
165
+ ), O = u.forwardRef(
126
166
  ({
127
167
  value: e,
128
168
  variant: t = "strong",
129
169
  loading: a = !1,
130
- pulse: n,
170
+ pulse: s,
131
171
  // eslint-disable-line @typescript-eslint/no-unused-vars -- absorbed from ...props to prevent DOM passthrough
132
- dataHook: l,
133
- className: s,
172
+ dataHook: n,
173
+ className: o,
134
174
  trackingEl: r,
135
175
  trackingLabel: i,
136
- style: c,
137
- ...m
138
- }, u) => {
139
- const g = $(t);
140
- return /* @__PURE__ */ o(
176
+ style: l,
177
+ ...d
178
+ }, f) => {
179
+ const m = ce(t);
180
+ return /* @__PURE__ */ c(
141
181
  "div",
142
182
  {
143
- ref: u,
144
- className: p(
145
- a ? "border-border bg-accent rounded-full border" : F({ variant: g }),
183
+ ref: f,
184
+ className: g(
185
+ a ? "border-border bg-accent rounded-full border" : de({ variant: m }),
146
186
  "size-8 p-0",
147
- s
187
+ o
148
188
  ),
149
- "data-hook": l,
189
+ "data-hook": n,
150
190
  "data-slot": "map-grid-pin",
151
191
  "data-state": a ? "loading" : void 0,
152
192
  "data-tracking-el": r || "map-grid-pin",
153
193
  "data-tracking-label": i,
154
- style: c,
155
- ...m,
156
- children: g === "error" && !a ? /* @__PURE__ */ o(
157
- T,
194
+ style: l,
195
+ ...d,
196
+ children: m === "error" && !a ? /* @__PURE__ */ c(
197
+ W,
158
198
  {
159
199
  "aria-hidden": "true",
160
200
  className: "text-warning-foreground",
@@ -165,58 +205,170 @@ const y = {
165
205
  );
166
206
  }
167
207
  );
168
- x.displayName = "MapGridPin";
169
- const G = d.forwardRef(
208
+ O.displayName = "MapGridPin";
209
+ function j() {
210
+ const t = {
211
+ colors: Object.fromEntries(
212
+ Object.entries(x).map(([s, n]) => [s, n.fallback])
213
+ ),
214
+ fontFamily: "Inter, system-ui, sans-serif",
215
+ textColor: "#111412"
216
+ };
217
+ if (typeof document > "u") return t;
218
+ const a = getComputedStyle(document.documentElement);
219
+ return {
220
+ colors: Object.fromEntries(
221
+ Object.entries(x).map(([s, { cssVar: n, fallback: o }]) => [
222
+ s,
223
+ a.getPropertyValue(n).trim() || o
224
+ ])
225
+ ),
226
+ fontFamily: a.getPropertyValue("--ds-font-font-sans").trim() || t.fontFamily,
227
+ textColor: a.getPropertyValue("--ds-tailwind-colors-neutral-950").trim() || t.textColor
228
+ };
229
+ }
230
+ function Ee() {
231
+ return j().colors;
232
+ }
233
+ const Re = Object.fromEntries(
234
+ Object.entries(x).map(([e, t]) => [e, t.fallback])
235
+ ), N = [
236
+ "strong",
237
+ "moderate",
238
+ "weak",
239
+ "unranked",
240
+ "error"
241
+ ];
242
+ function L(e, t) {
243
+ const { colors: a, fontFamily: s, textColor: n } = j(), o = 40, r = o / 2, i = 2, l = r - i, d = l * 0.55, m = [...e].sort(
244
+ (p, b) => N.indexOf(p.variant) - N.indexOf(b.variant)
245
+ ).filter((p) => p.count > 0), I = m.reduce((p, b) => p + b.count, 0) || 1, V = Math.max(Number(t) || 0, 1);
246
+ let k;
247
+ const C = m[0];
248
+ if (m.length <= 1) {
249
+ const p = C ? a[C.variant] : "#e5e7eb";
250
+ k = `<circle cx="${r}" cy="${r}" r="${l}" fill="${p}"/>`;
251
+ } else {
252
+ k = "";
253
+ let p = -Math.PI / 2;
254
+ for (const b of m) {
255
+ const P = b.count / I * Math.PI * 2, v = p + P, F = r + l * Math.cos(p), _ = r + l * Math.sin(p), z = r + l * Math.cos(v), B = r + l * Math.sin(v), G = P > Math.PI ? 1 : 0;
256
+ k += `<path d="M${r},${r}L${F.toFixed(2)},${_.toFixed(2)}A${l},${l} 0 ${G} 1 ${z.toFixed(2)},${B.toFixed(2)}Z" fill="${a[b.variant]}"/>`, p = v;
257
+ }
258
+ }
259
+ const D = Math.round(o * 0.3);
260
+ return [
261
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}" style="filter:drop-shadow(0 1px 2px rgba(0,0,0,.15))">`,
262
+ `<circle cx="${r}" cy="${r}" r="${r}" fill="white"/>`,
263
+ k,
264
+ `<circle cx="${r}" cy="${r}" r="${l}" fill="none" stroke="white" stroke-width="${i}"/>`,
265
+ `<circle cx="${r}" cy="${r}" r="${d}" fill="white"/>`,
266
+ `<text x="${r}" y="${r}" text-anchor="middle" dominant-baseline="central" font-family="${s}" font-size="${D}" font-weight="600" fill="${n}">${V}</text>`,
267
+ "</svg>"
268
+ ].join("");
269
+ }
270
+ function Oe(e) {
271
+ if (typeof DOMParser > "u")
272
+ throw new Error(
273
+ "createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR."
274
+ );
275
+ const { markers: t, count: a, getVariant: s } = e, n = /* @__PURE__ */ new Map();
276
+ for (const f of t) {
277
+ const m = s(f);
278
+ n.set(m, (n.get(m) ?? 0) + 1);
279
+ }
280
+ const o = [];
281
+ for (const f of N) {
282
+ const m = n.get(f);
283
+ m && o.push({ variant: f, count: m });
284
+ }
285
+ const r = L(o, a), d = new DOMParser().parseFromString(r, "image/svg+xml").documentElement;
286
+ if (!(d instanceof SVGElement))
287
+ throw new Error("createClusterPinElement: failed to parse SVG");
288
+ return d;
289
+ }
290
+ const me = u.forwardRef(
291
+ ({
292
+ segments: e,
293
+ count: t,
294
+ dataHook: a,
295
+ className: s,
296
+ trackingEl: n,
297
+ trackingLabel: o,
298
+ ...r
299
+ }, i) => {
300
+ const l = JSON.stringify(e), d = u.useMemo(
301
+ () => L(e, t),
302
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- serialised key for stable comparison
303
+ [l, t]
304
+ );
305
+ return /* @__PURE__ */ c(
306
+ "div",
307
+ {
308
+ dangerouslySetInnerHTML: { __html: d },
309
+ ref: i,
310
+ className: g("inline-flex items-center justify-center", s),
311
+ "data-hook": a,
312
+ "data-slot": "map-cluster-pin",
313
+ "data-tracking-el": n || "map-cluster-pin",
314
+ "data-tracking-label": o,
315
+ ...r
316
+ }
317
+ );
318
+ }
319
+ );
320
+ me.displayName = "MapClusterPin";
321
+ const ue = u.forwardRef(
170
322
  ({
171
323
  icon: e,
172
324
  animateIn: t = !1,
173
325
  value: a,
174
- variant: n,
175
- pulse: l,
176
- dataHook: s,
326
+ variant: s,
327
+ pulse: n,
328
+ dataHook: o,
177
329
  className: r,
178
330
  trackingEl: i,
179
- trackingLabel: c,
180
- ariaLabel: m,
181
- ...u
182
- }, g) => a !== void 0 || n !== void 0 || l !== void 0 ? /* @__PURE__ */ o(
183
- x,
331
+ trackingLabel: l,
332
+ ariaLabel: d,
333
+ ...f
334
+ }, m) => a !== void 0 || s !== void 0 || n !== void 0 ? /* @__PURE__ */ c(
335
+ O,
184
336
  {
185
- ref: g,
337
+ ref: m,
186
338
  className: r,
187
- dataHook: s,
188
- pulse: l,
339
+ dataHook: o,
340
+ pulse: n,
189
341
  trackingEl: i,
190
- trackingLabel: c,
342
+ trackingLabel: l,
191
343
  value: a ?? 1,
192
- variant: n,
193
- ...u
344
+ variant: s,
345
+ ...f
194
346
  }
195
- ) : /* @__PURE__ */ o(
347
+ ) : /* @__PURE__ */ c(
196
348
  "div",
197
349
  {
198
- ref: g,
199
- "aria-label": m ?? "Location",
200
- className: p(
350
+ ref: m,
351
+ "aria-label": d ?? "Location",
352
+ className: g(
201
353
  "relative inline-flex h-[46px] w-[38px] items-start justify-center",
202
354
  r
203
355
  ),
204
- "data-hook": s,
356
+ "data-hook": o,
205
357
  "data-slot": "map-location-pin",
206
358
  "data-tracking-el": i || "map-location-pin",
207
- "data-tracking-label": c,
359
+ "data-tracking-label": l,
208
360
  role: "img",
209
- ...u,
210
- children: /* @__PURE__ */ f(
361
+ ...f,
362
+ children: /* @__PURE__ */ y(
211
363
  "span",
212
364
  {
213
365
  "aria-hidden": "true",
214
- className: p(
366
+ className: g(
215
367
  "relative flex size-full",
216
368
  t && "animate-pop-in origin-bottom will-change-transform motion-reduce:animate-none"
217
369
  ),
218
370
  children: [
219
- /* @__PURE__ */ f(
371
+ /* @__PURE__ */ y(
220
372
  "svg",
221
373
  {
222
374
  "aria-hidden": "true",
@@ -224,140 +376,140 @@ const G = d.forwardRef(
224
376
  fill: "none",
225
377
  viewBox: "0 0 38 46",
226
378
  children: [
227
- /* @__PURE__ */ o(
379
+ /* @__PURE__ */ c(
228
380
  "path",
229
381
  {
230
382
  className: "fill-white",
231
383
  d: "M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"
232
384
  }
233
385
  ),
234
- /* @__PURE__ */ o("circle", { className: "fill-sky-500", cx: "19", cy: "19", r: "16" })
386
+ /* @__PURE__ */ c("circle", { className: "fill-sky-500", cx: "19", cy: "19", r: "16" })
235
387
  ]
236
388
  }
237
389
  ),
238
- /* @__PURE__ */ o("span", { className: "absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white", children: e ?? /* @__PURE__ */ o(C, { size: 16 }) })
390
+ /* @__PURE__ */ c("span", { className: "absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white", children: e ?? /* @__PURE__ */ c(Y, { size: 16 }) })
239
391
  ]
240
392
  }
241
393
  )
242
394
  }
243
395
  )
244
396
  );
245
- G.displayName = "MapLocationPin";
246
- const V = d.forwardRef(
397
+ ue.displayName = "MapLocationPin";
398
+ const fe = u.forwardRef(
247
399
  ({
248
400
  className: e,
249
401
  dataHook: t,
250
402
  trackingEl: a,
251
- trackingLabel: n,
252
- children: l,
253
- iconOnly: s = !0,
403
+ trackingLabel: s,
404
+ children: n,
405
+ iconOnly: o = !0,
254
406
  ...r
255
407
  }, i) => {
256
- const c = k();
257
- return /* @__PURE__ */ o(
258
- b,
408
+ const l = E();
409
+ return /* @__PURE__ */ c(
410
+ T,
259
411
  {
260
412
  ref: i,
261
413
  className: e,
262
414
  "data-slot": "map-control-button",
263
415
  dataHook: t,
264
- iconOnly: s,
416
+ iconOnly: o,
265
417
  trackingEl: a || "map-control-button",
266
- trackingLabel: n,
267
- variant: c ? "secondary" : "outline",
418
+ trackingLabel: s,
419
+ variant: l ? "secondary" : "outline",
268
420
  ...r,
269
- children: l
421
+ children: n
270
422
  }
271
423
  );
272
424
  }
273
425
  );
274
- V.displayName = "MapControlButton";
275
- const O = d.forwardRef(
426
+ fe.displayName = "MapControlButton";
427
+ const pe = u.forwardRef(
276
428
  ({
277
429
  className: e,
278
430
  children: t,
279
431
  dataHook: a,
280
- trackingEl: n,
281
- trackingLabel: l,
282
- ariaLabel: s,
432
+ trackingEl: s,
433
+ trackingLabel: n,
434
+ ariaLabel: o,
283
435
  ...r
284
- }, i) => /* @__PURE__ */ f(
436
+ }, i) => /* @__PURE__ */ y(
285
437
  "div",
286
438
  {
287
439
  ref: i,
288
- "aria-label": s ?? "Loading map",
289
- className: p(
440
+ "aria-label": o ?? "Loading map",
441
+ className: g(
290
442
  "border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",
291
443
  e
292
444
  ),
293
445
  "data-hook": a,
294
446
  "data-slot": "map-loading-state",
295
- "data-tracking-el": n || "map-loading-state",
296
- "data-tracking-label": l,
447
+ "data-tracking-el": s || "map-loading-state",
448
+ "data-tracking-label": n,
297
449
  role: "status",
298
450
  ...r,
299
451
  children: [
300
- /* @__PURE__ */ o(w, {}),
301
- t && /* @__PURE__ */ o("div", { className: "relative", children: t })
452
+ /* @__PURE__ */ c(A, {}),
453
+ t && /* @__PURE__ */ c("div", { className: "relative", children: t })
302
454
  ]
303
455
  }
304
456
  )
305
457
  );
306
- O.displayName = "MapLoadingState";
307
- const w = d.memo(function({
458
+ pe.displayName = "MapLoadingState";
459
+ const A = u.memo(function({
308
460
  rounded: t
309
461
  }) {
310
- return /* @__PURE__ */ o(
311
- S,
462
+ return /* @__PURE__ */ c(
463
+ q,
312
464
  {
313
465
  "aria-hidden": "true",
314
- className: p(
466
+ className: g(
315
467
  "absolute inset-0 h-full w-full object-cover",
316
468
  t && "rounded-[inherit]"
317
469
  ),
318
470
  mode: "auto"
319
471
  }
320
472
  );
321
- }), _ = d.forwardRef(
473
+ }), ge = u.forwardRef(
322
474
  ({
323
475
  className: e,
324
476
  title: t = "We couldn't load your map rankings.",
325
477
  message: a = "Reloading usually fixes it, and it won't use any credits",
326
- onRetry: n,
327
- retryLoading: l = !1,
328
- retryLabel: s = "Reload",
478
+ onRetry: s,
479
+ retryLoading: n = !1,
480
+ retryLabel: o = "Reload",
329
481
  dataHook: r,
330
482
  trackingEl: i,
331
- trackingLabel: c,
332
- ...m
333
- }, u) => /* @__PURE__ */ f(
483
+ trackingLabel: l,
484
+ ...d
485
+ }, f) => /* @__PURE__ */ y(
334
486
  "div",
335
487
  {
336
- ref: u,
337
- className: p(
488
+ ref: f,
489
+ className: g(
338
490
  "border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8",
339
491
  e
340
492
  ),
341
493
  "data-hook": r,
342
494
  "data-slot": "map-error-state",
343
495
  "data-tracking-el": i || "map-error-state",
344
- "data-tracking-label": c,
496
+ "data-tracking-label": l,
345
497
  role: "alert",
346
- ...m,
498
+ ...d,
347
499
  children: [
348
- /* @__PURE__ */ o(w, { rounded: !0 }),
349
- /* @__PURE__ */ f("div", { className: "relative flex flex-col items-center gap-4 sm:gap-6", children: [
350
- /* @__PURE__ */ o(
500
+ /* @__PURE__ */ c(A, { rounded: !0 }),
501
+ /* @__PURE__ */ y("div", { className: "relative flex flex-col items-center gap-4 sm:gap-6", children: [
502
+ /* @__PURE__ */ c(
351
503
  "div",
352
504
  {
353
505
  "aria-hidden": "true",
354
506
  className: "flex items-center justify-center",
355
507
  "data-slot": "map-error-illustration",
356
- children: /* @__PURE__ */ o(P, { className: "h-auto w-full max-w-41" })
508
+ children: /* @__PURE__ */ c(Z, { className: "h-auto w-full max-w-41" })
357
509
  }
358
510
  ),
359
- /* @__PURE__ */ f("div", { className: "flex flex-col gap-2", children: [
360
- /* @__PURE__ */ o(
511
+ /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
512
+ /* @__PURE__ */ c(
361
513
  "h3",
362
514
  {
363
515
  className: "text-foreground text-lg font-medium",
@@ -365,7 +517,7 @@ const w = d.memo(function({
365
517
  children: t
366
518
  }
367
519
  ),
368
- a && /* @__PURE__ */ o(
520
+ a && /* @__PURE__ */ c(
369
521
  "p",
370
522
  {
371
523
  className: "text-muted-foreground text-sm",
@@ -374,18 +526,18 @@ const w = d.memo(function({
374
526
  }
375
527
  )
376
528
  ] }),
377
- n && /* @__PURE__ */ f(
378
- b,
529
+ s && /* @__PURE__ */ y(
530
+ T,
379
531
  {
380
532
  className: "mt-1",
381
533
  dataHook: `${r}-retry`,
382
- loading: l,
534
+ loading: n,
383
535
  size: "sm",
384
536
  variant: "primary",
385
- onClick: n,
537
+ onClick: s,
386
538
  children: [
387
- !l && /* @__PURE__ */ o(N, { "aria-hidden": "true" }),
388
- s
539
+ !n && /* @__PURE__ */ c(U, { "aria-hidden": "true" }),
540
+ o
389
541
  ]
390
542
  }
391
543
  )
@@ -394,138 +546,142 @@ const w = d.memo(function({
394
546
  }
395
547
  )
396
548
  );
397
- _.displayName = "MapErrorState";
398
- const W = d.forwardRef(
399
- ({ variant: e, color: t, dataHook: a, className: n, children: l, ...s }, r) => {
400
- const i = e ? y[e] : t;
401
- return /* @__PURE__ */ f(
549
+ ge.displayName = "MapErrorState";
550
+ const ye = u.forwardRef(
551
+ ({ variant: e, color: t, dataHook: a, className: s, children: n, ...o }, r) => {
552
+ const i = e ? h[e] : t;
553
+ return /* @__PURE__ */ y(
402
554
  "span",
403
555
  {
404
556
  ref: r,
405
- className: p(
557
+ className: g(
406
558
  "text-foreground flex items-center gap-1 font-sans text-xs",
407
- n
559
+ s
408
560
  ),
409
561
  "data-hook": a,
410
562
  "data-slot": "map-legend-item",
411
- ...s,
563
+ ...o,
412
564
  children: [
413
- /* @__PURE__ */ o(
565
+ /* @__PURE__ */ c(
414
566
  "span",
415
567
  {
416
568
  "aria-hidden": "true",
417
- className: p("inline-block size-2 shrink-0 rounded-full", i)
569
+ className: g("inline-block size-2 shrink-0 rounded-full", i)
418
570
  }
419
571
  ),
420
- l
572
+ n
421
573
  ]
422
574
  }
423
575
  );
424
576
  }
425
577
  );
426
- W.displayName = "MapLegendItem";
427
- const Y = d.forwardRef(
578
+ ye.displayName = "MapLegendItem";
579
+ const be = u.forwardRef(
428
580
  ({
429
581
  className: e,
430
582
  dataHook: t,
431
583
  trackingEl: a,
432
- trackingLabel: n,
433
- ariaLabel: l,
434
- children: s,
584
+ trackingLabel: s,
585
+ ariaLabel: n,
586
+ children: o,
435
587
  ...r
436
- }, i) => /* @__PURE__ */ o(
437
- L,
588
+ }, i) => /* @__PURE__ */ c(
589
+ H,
438
590
  {
439
591
  ref: i,
440
- "aria-label": l ?? "Map legend",
441
- className: p(
442
- "inline-flex w-auto flex-row items-center bg-white font-sans dark:bg-neutral-800",
592
+ "aria-label": n ?? "Map legend",
593
+ className: g(
594
+ "inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800",
443
595
  e
444
596
  ),
445
597
  "data-slot": "map-legend",
446
598
  dataHook: t,
447
599
  density: "condensed",
448
- maxWidth: "none",
449
600
  role: "group",
450
601
  trackingEl: a || "map-legend",
451
- trackingLabel: n,
602
+ trackingLabel: s,
452
603
  variant: "border",
453
604
  ...r,
454
- children: /* @__PURE__ */ o(R, { className: "flex items-center gap-3", children: s })
605
+ children: /* @__PURE__ */ c(J, { className: "flex items-center gap-3", children: o })
455
606
  }
456
607
  )
457
608
  );
458
- Y.displayName = "MapLegend";
459
- function oe(e) {
460
- const { hoverWhenOpen: t = !1 } = e ?? {}, [a, n] = d.useState(null), [l, s] = d.useState(null), r = d.useCallback((m) => {
461
- s(m), n(m);
462
- }, []), i = d.useCallback(() => {
463
- n(null);
464
- }, []), c = d.useCallback(
465
- (m) => {
466
- const u = {
467
- onClick: () => r(m)
609
+ be.displayName = "MapLegend";
610
+ function je(e) {
611
+ const { hoverWhenOpen: t = !1 } = e ?? {}, [a, s] = u.useState(null), [n, o] = u.useState(null), r = u.useCallback((d) => {
612
+ o(d), s(d);
613
+ }, []), i = u.useCallback(() => {
614
+ s(null);
615
+ }, []), l = u.useCallback(
616
+ (d) => {
617
+ const f = {
618
+ onClick: () => r(d)
468
619
  };
469
- return t && (u.onPointerEnter = (g) => {
470
- g.pointerType === "mouse" && a != null && r(m);
471
- }), u;
620
+ return t && (f.onPointerEnter = (m) => {
621
+ m.pointerType === "mouse" && a != null && r(d);
622
+ }), f;
472
623
  },
473
624
  [t, r, a]
474
625
  );
475
626
  return {
476
627
  activeItem: a,
477
- anchorItem: l,
628
+ anchorItem: n,
478
629
  showItem: r,
479
630
  close: i,
480
- getInteractionProps: c
631
+ getInteractionProps: l
481
632
  };
482
633
  }
483
- const ne = A, K = E;
484
- K.displayName = "MapPopoverAnchor";
485
- const U = d.forwardRef(
634
+ const Le = Q, he = X;
635
+ he.displayName = "MapPopoverAnchor";
636
+ const ke = u.forwardRef(
486
637
  ({
487
638
  className: e,
488
639
  side: t = "top",
489
640
  sideOffset: a = 4,
490
- dataHook: n,
491
- trackingEl: l,
492
- trackingLabel: s,
641
+ dataHook: s,
642
+ trackingEl: n,
643
+ trackingLabel: o,
493
644
  ...r
494
- }, i) => /* @__PURE__ */ o(
495
- I,
645
+ }, i) => /* @__PURE__ */ c(
646
+ ee,
496
647
  {
497
648
  ref: i,
498
- className: p(
649
+ className: g(
499
650
  "w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",
500
651
  e
501
652
  ),
502
653
  "data-slot": "map-popover-content",
503
- "data-tracking-el": l || "map-popover",
504
- "data-tracking-label": s,
505
- dataHook: n,
654
+ "data-tracking-el": n || "map-popover",
655
+ "data-tracking-label": o,
656
+ dataHook: s,
506
657
  side: t,
507
658
  sideOffset: a,
508
- onCloseAutoFocus: (c) => c.preventDefault(),
509
- onOpenAutoFocus: (c) => c.preventDefault(),
659
+ onCloseAutoFocus: (l) => l.preventDefault(),
660
+ onOpenAutoFocus: (l) => l.preventDefault(),
510
661
  ...r
511
662
  }
512
663
  )
513
664
  );
514
- U.displayName = "MapPopoverContent";
665
+ ke.displayName = "MapPopoverContent";
515
666
  export {
516
- B as MAP_STYLES,
517
- V as MapControlButton,
518
- _ as MapErrorState,
519
- x as MapGridPin,
520
- Y as MapLegend,
521
- W as MapLegendItem,
522
- O as MapLoadingState,
523
- G as MapLocationPin,
524
- ne as MapPopover,
525
- K as MapPopoverAnchor,
526
- U as MapPopoverContent,
527
- ae as MapTypeId,
528
- y as mapGridPinColorMap,
529
- oe as useMapPopoverClick,
530
- re as useMapStyles
667
+ ae as MAP_STYLES,
668
+ me as MapClusterPin,
669
+ fe as MapControlButton,
670
+ ge as MapErrorState,
671
+ O as MapGridPin,
672
+ be as MapLegend,
673
+ ye as MapLegendItem,
674
+ pe as MapLoadingState,
675
+ ue as MapLocationPin,
676
+ Le as MapPopover,
677
+ he as MapPopoverAnchor,
678
+ ke as MapPopoverContent,
679
+ Se as MapTypeId,
680
+ Re as clusterPinHexColors,
681
+ Oe as createClusterPinElement,
682
+ L as createClusterPinSvg,
683
+ h as mapGridPinColorMap,
684
+ Ee as resolveClusterPinColors,
685
+ je as useMapPopoverClick,
686
+ Te as useMapStyles
531
687
  };