@opensite/ui 3.5.4 → 3.5.6
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/contact-map.cjs +62 -5
- package/dist/contact-map.js +62 -5
- package/dist/registry.cjs +68 -11
- package/dist/registry.js +68 -11
- package/dist/stats-growth-timeline.cjs +6 -6
- package/dist/stats-growth-timeline.js +6 -6
- package/package.json +1 -1
package/dist/contact-map.cjs
CHANGED
|
@@ -495,6 +495,46 @@ var DEFAULT_FORM_FIELDS = [
|
|
|
495
495
|
columnSpan: 12
|
|
496
496
|
}
|
|
497
497
|
];
|
|
498
|
+
function coerceCoordinate(value) {
|
|
499
|
+
if (typeof value === "number") {
|
|
500
|
+
return Number.isFinite(value) ? value : null;
|
|
501
|
+
}
|
|
502
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
503
|
+
const parsed = Number(value);
|
|
504
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
505
|
+
}
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
function sanitizeMarker(marker) {
|
|
509
|
+
const markerWithAliases = marker;
|
|
510
|
+
const latitude = coerceCoordinate(
|
|
511
|
+
markerWithAliases.latitude ?? markerWithAliases.lat
|
|
512
|
+
);
|
|
513
|
+
const longitude = coerceCoordinate(
|
|
514
|
+
markerWithAliases.longitude ?? markerWithAliases.lng
|
|
515
|
+
);
|
|
516
|
+
if (latitude === null || longitude === null) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
...marker,
|
|
521
|
+
latitude,
|
|
522
|
+
longitude
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
function sanitizeCluster(cluster) {
|
|
526
|
+
const markers = cluster.markers.map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
527
|
+
if (markers.length === 0) {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
const latitude = coerceCoordinate(cluster.latitude);
|
|
531
|
+
const longitude = coerceCoordinate(cluster.longitude);
|
|
532
|
+
return {
|
|
533
|
+
...cluster,
|
|
534
|
+
markers,
|
|
535
|
+
...latitude !== null && longitude !== null ? { latitude, longitude } : {}
|
|
536
|
+
};
|
|
537
|
+
}
|
|
498
538
|
function ContactMap({
|
|
499
539
|
sectionId = "contact-map",
|
|
500
540
|
heading,
|
|
@@ -530,10 +570,24 @@ function ContactMap({
|
|
|
530
570
|
}
|
|
531
571
|
);
|
|
532
572
|
}, [formEngineSetup]);
|
|
573
|
+
const sanitizedMapData = React4__namespace.useMemo(() => {
|
|
574
|
+
const markers = (mapProps?.markers ?? []).map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
575
|
+
const clusters = (mapProps?.clusters ?? []).map((cluster) => sanitizeCluster(cluster)).filter((cluster) => cluster !== null);
|
|
576
|
+
return {
|
|
577
|
+
markers,
|
|
578
|
+
clusters,
|
|
579
|
+
hasRenderableMap: markers.length > 0 || clusters.length > 0
|
|
580
|
+
};
|
|
581
|
+
}, [mapProps?.clusters, mapProps?.markers]);
|
|
533
582
|
const resolvedMapProps = React4__namespace.useMemo(() => {
|
|
583
|
+
if (!sanitizedMapData.hasRenderableMap) {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
534
586
|
return {
|
|
535
587
|
panelPosition: "top-left",
|
|
536
588
|
...mapProps,
|
|
589
|
+
markers: sanitizedMapData.markers,
|
|
590
|
+
clusters: sanitizedMapData.clusters,
|
|
537
591
|
// Don't override mapWrapperClassName if it's provided in mapProps
|
|
538
592
|
mapWrapperClassName: mapProps?.mapWrapperClassName,
|
|
539
593
|
className: cn(mapClassName, mapProps?.className),
|
|
@@ -542,7 +596,8 @@ function ContactMap({
|
|
|
542
596
|
IconComponent: DynamicIcon,
|
|
543
597
|
ImgComponent: img.Img
|
|
544
598
|
};
|
|
545
|
-
}, [mapClassName, mapProps, optixFlowConfig]);
|
|
599
|
+
}, [mapClassName, mapProps, optixFlowConfig, sanitizedMapData]);
|
|
600
|
+
const hasMap = resolvedMapProps !== null;
|
|
546
601
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
547
602
|
Section,
|
|
548
603
|
{
|
|
@@ -557,8 +612,10 @@ function ContactMap({
|
|
|
557
612
|
"div",
|
|
558
613
|
{
|
|
559
614
|
className: cn(
|
|
560
|
-
"mx-auto grid max-w-full
|
|
561
|
-
|
|
615
|
+
"mx-auto grid max-w-full gap-8",
|
|
616
|
+
hasMap && "md:max-w-7xl lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",
|
|
617
|
+
contentGridClassName,
|
|
618
|
+
!hasMap && "md:max-w-3xl lg:grid-cols-1"
|
|
562
619
|
),
|
|
563
620
|
children: [
|
|
564
621
|
/* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("shadow-lg rounded-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: cardContentClassName, children: [
|
|
@@ -586,7 +643,7 @@ function ContactMap({
|
|
|
586
643
|
] }),
|
|
587
644
|
renderForm
|
|
588
645
|
] }) }),
|
|
589
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
+
resolvedMapProps ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
590
647
|
"div",
|
|
591
648
|
{
|
|
592
649
|
className: cn(
|
|
@@ -600,7 +657,7 @@ function ContactMap({
|
|
|
600
657
|
},
|
|
601
658
|
children: /* @__PURE__ */ jsxRuntime.jsx(maps.GeoMap, { ...resolvedMapProps })
|
|
602
659
|
}
|
|
603
|
-
)
|
|
660
|
+
) : null
|
|
604
661
|
]
|
|
605
662
|
}
|
|
606
663
|
)
|
package/dist/contact-map.js
CHANGED
|
@@ -474,6 +474,46 @@ var DEFAULT_FORM_FIELDS = [
|
|
|
474
474
|
columnSpan: 12
|
|
475
475
|
}
|
|
476
476
|
];
|
|
477
|
+
function coerceCoordinate(value) {
|
|
478
|
+
if (typeof value === "number") {
|
|
479
|
+
return Number.isFinite(value) ? value : null;
|
|
480
|
+
}
|
|
481
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
482
|
+
const parsed = Number(value);
|
|
483
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
484
|
+
}
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
function sanitizeMarker(marker) {
|
|
488
|
+
const markerWithAliases = marker;
|
|
489
|
+
const latitude = coerceCoordinate(
|
|
490
|
+
markerWithAliases.latitude ?? markerWithAliases.lat
|
|
491
|
+
);
|
|
492
|
+
const longitude = coerceCoordinate(
|
|
493
|
+
markerWithAliases.longitude ?? markerWithAliases.lng
|
|
494
|
+
);
|
|
495
|
+
if (latitude === null || longitude === null) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
...marker,
|
|
500
|
+
latitude,
|
|
501
|
+
longitude
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function sanitizeCluster(cluster) {
|
|
505
|
+
const markers = cluster.markers.map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
506
|
+
if (markers.length === 0) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
const latitude = coerceCoordinate(cluster.latitude);
|
|
510
|
+
const longitude = coerceCoordinate(cluster.longitude);
|
|
511
|
+
return {
|
|
512
|
+
...cluster,
|
|
513
|
+
markers,
|
|
514
|
+
...latitude !== null && longitude !== null ? { latitude, longitude } : {}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
477
517
|
function ContactMap({
|
|
478
518
|
sectionId = "contact-map",
|
|
479
519
|
heading,
|
|
@@ -509,10 +549,24 @@ function ContactMap({
|
|
|
509
549
|
}
|
|
510
550
|
);
|
|
511
551
|
}, [formEngineSetup]);
|
|
552
|
+
const sanitizedMapData = React4.useMemo(() => {
|
|
553
|
+
const markers = (mapProps?.markers ?? []).map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
554
|
+
const clusters = (mapProps?.clusters ?? []).map((cluster) => sanitizeCluster(cluster)).filter((cluster) => cluster !== null);
|
|
555
|
+
return {
|
|
556
|
+
markers,
|
|
557
|
+
clusters,
|
|
558
|
+
hasRenderableMap: markers.length > 0 || clusters.length > 0
|
|
559
|
+
};
|
|
560
|
+
}, [mapProps?.clusters, mapProps?.markers]);
|
|
512
561
|
const resolvedMapProps = React4.useMemo(() => {
|
|
562
|
+
if (!sanitizedMapData.hasRenderableMap) {
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
513
565
|
return {
|
|
514
566
|
panelPosition: "top-left",
|
|
515
567
|
...mapProps,
|
|
568
|
+
markers: sanitizedMapData.markers,
|
|
569
|
+
clusters: sanitizedMapData.clusters,
|
|
516
570
|
// Don't override mapWrapperClassName if it's provided in mapProps
|
|
517
571
|
mapWrapperClassName: mapProps?.mapWrapperClassName,
|
|
518
572
|
className: cn(mapClassName, mapProps?.className),
|
|
@@ -521,7 +575,8 @@ function ContactMap({
|
|
|
521
575
|
IconComponent: DynamicIcon,
|
|
522
576
|
ImgComponent: Img
|
|
523
577
|
};
|
|
524
|
-
}, [mapClassName, mapProps, optixFlowConfig]);
|
|
578
|
+
}, [mapClassName, mapProps, optixFlowConfig, sanitizedMapData]);
|
|
579
|
+
const hasMap = resolvedMapProps !== null;
|
|
525
580
|
return /* @__PURE__ */ jsx(
|
|
526
581
|
Section,
|
|
527
582
|
{
|
|
@@ -536,8 +591,10 @@ function ContactMap({
|
|
|
536
591
|
"div",
|
|
537
592
|
{
|
|
538
593
|
className: cn(
|
|
539
|
-
"mx-auto grid max-w-full
|
|
540
|
-
|
|
594
|
+
"mx-auto grid max-w-full gap-8",
|
|
595
|
+
hasMap && "md:max-w-7xl lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",
|
|
596
|
+
contentGridClassName,
|
|
597
|
+
!hasMap && "md:max-w-3xl lg:grid-cols-1"
|
|
541
598
|
),
|
|
542
599
|
children: [
|
|
543
600
|
/* @__PURE__ */ jsx(Card, { className: cn("shadow-lg rounded-xl", cardClassName), children: /* @__PURE__ */ jsxs(CardContent, { className: cardContentClassName, children: [
|
|
@@ -565,7 +622,7 @@ function ContactMap({
|
|
|
565
622
|
] }),
|
|
566
623
|
renderForm
|
|
567
624
|
] }) }),
|
|
568
|
-
/* @__PURE__ */ jsx(
|
|
625
|
+
resolvedMapProps ? /* @__PURE__ */ jsx(
|
|
569
626
|
"div",
|
|
570
627
|
{
|
|
571
628
|
className: cn(
|
|
@@ -579,7 +636,7 @@ function ContactMap({
|
|
|
579
636
|
},
|
|
580
637
|
children: /* @__PURE__ */ jsx(GeoMap, { ...resolvedMapProps })
|
|
581
638
|
}
|
|
582
|
-
)
|
|
639
|
+
) : null
|
|
583
640
|
]
|
|
584
641
|
}
|
|
585
642
|
)
|
package/dist/registry.cjs
CHANGED
|
@@ -16674,6 +16674,46 @@ var DEFAULT_FORM_FIELDS23 = [
|
|
|
16674
16674
|
columnSpan: 12
|
|
16675
16675
|
}
|
|
16676
16676
|
];
|
|
16677
|
+
function coerceCoordinate(value) {
|
|
16678
|
+
if (typeof value === "number") {
|
|
16679
|
+
return Number.isFinite(value) ? value : null;
|
|
16680
|
+
}
|
|
16681
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
16682
|
+
const parsed = Number(value);
|
|
16683
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
16684
|
+
}
|
|
16685
|
+
return null;
|
|
16686
|
+
}
|
|
16687
|
+
function sanitizeMarker(marker) {
|
|
16688
|
+
const markerWithAliases = marker;
|
|
16689
|
+
const latitude = coerceCoordinate(
|
|
16690
|
+
markerWithAliases.latitude ?? markerWithAliases.lat
|
|
16691
|
+
);
|
|
16692
|
+
const longitude = coerceCoordinate(
|
|
16693
|
+
markerWithAliases.longitude ?? markerWithAliases.lng
|
|
16694
|
+
);
|
|
16695
|
+
if (latitude === null || longitude === null) {
|
|
16696
|
+
return null;
|
|
16697
|
+
}
|
|
16698
|
+
return {
|
|
16699
|
+
...marker,
|
|
16700
|
+
latitude,
|
|
16701
|
+
longitude
|
|
16702
|
+
};
|
|
16703
|
+
}
|
|
16704
|
+
function sanitizeCluster(cluster) {
|
|
16705
|
+
const markers = cluster.markers.map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
16706
|
+
if (markers.length === 0) {
|
|
16707
|
+
return null;
|
|
16708
|
+
}
|
|
16709
|
+
const latitude = coerceCoordinate(cluster.latitude);
|
|
16710
|
+
const longitude = coerceCoordinate(cluster.longitude);
|
|
16711
|
+
return {
|
|
16712
|
+
...cluster,
|
|
16713
|
+
markers,
|
|
16714
|
+
...latitude !== null && longitude !== null ? { latitude, longitude } : {}
|
|
16715
|
+
};
|
|
16716
|
+
}
|
|
16677
16717
|
function ContactMap({
|
|
16678
16718
|
sectionId = "contact-map",
|
|
16679
16719
|
heading,
|
|
@@ -16709,10 +16749,24 @@ function ContactMap({
|
|
|
16709
16749
|
}
|
|
16710
16750
|
);
|
|
16711
16751
|
}, [formEngineSetup]);
|
|
16752
|
+
const sanitizedMapData = React30__namespace.useMemo(() => {
|
|
16753
|
+
const markers = (mapProps?.markers ?? []).map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
16754
|
+
const clusters = (mapProps?.clusters ?? []).map((cluster) => sanitizeCluster(cluster)).filter((cluster) => cluster !== null);
|
|
16755
|
+
return {
|
|
16756
|
+
markers,
|
|
16757
|
+
clusters,
|
|
16758
|
+
hasRenderableMap: markers.length > 0 || clusters.length > 0
|
|
16759
|
+
};
|
|
16760
|
+
}, [mapProps?.clusters, mapProps?.markers]);
|
|
16712
16761
|
const resolvedMapProps = React30__namespace.useMemo(() => {
|
|
16762
|
+
if (!sanitizedMapData.hasRenderableMap) {
|
|
16763
|
+
return null;
|
|
16764
|
+
}
|
|
16713
16765
|
return {
|
|
16714
16766
|
panelPosition: "top-left",
|
|
16715
16767
|
...mapProps,
|
|
16768
|
+
markers: sanitizedMapData.markers,
|
|
16769
|
+
clusters: sanitizedMapData.clusters,
|
|
16716
16770
|
// Don't override mapWrapperClassName if it's provided in mapProps
|
|
16717
16771
|
mapWrapperClassName: mapProps?.mapWrapperClassName,
|
|
16718
16772
|
className: cn(mapClassName, mapProps?.className),
|
|
@@ -16721,7 +16775,8 @@ function ContactMap({
|
|
|
16721
16775
|
IconComponent: DynamicIcon,
|
|
16722
16776
|
ImgComponent: img.Img
|
|
16723
16777
|
};
|
|
16724
|
-
}, [mapClassName, mapProps, optixFlowConfig]);
|
|
16778
|
+
}, [mapClassName, mapProps, optixFlowConfig, sanitizedMapData]);
|
|
16779
|
+
const hasMap = resolvedMapProps !== null;
|
|
16725
16780
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16726
16781
|
Section,
|
|
16727
16782
|
{
|
|
@@ -16736,8 +16791,10 @@ function ContactMap({
|
|
|
16736
16791
|
"div",
|
|
16737
16792
|
{
|
|
16738
16793
|
className: cn(
|
|
16739
|
-
"mx-auto grid max-w-full
|
|
16740
|
-
|
|
16794
|
+
"mx-auto grid max-w-full gap-8",
|
|
16795
|
+
hasMap && "md:max-w-7xl lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",
|
|
16796
|
+
contentGridClassName,
|
|
16797
|
+
!hasMap && "md:max-w-3xl lg:grid-cols-1"
|
|
16741
16798
|
),
|
|
16742
16799
|
children: [
|
|
16743
16800
|
/* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("shadow-lg rounded-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: cardContentClassName, children: [
|
|
@@ -16765,7 +16822,7 @@ function ContactMap({
|
|
|
16765
16822
|
] }),
|
|
16766
16823
|
renderForm
|
|
16767
16824
|
] }) }),
|
|
16768
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16825
|
+
resolvedMapProps ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
16769
16826
|
"div",
|
|
16770
16827
|
{
|
|
16771
16828
|
className: cn(
|
|
@@ -16779,7 +16836,7 @@ function ContactMap({
|
|
|
16779
16836
|
},
|
|
16780
16837
|
children: /* @__PURE__ */ jsxRuntime.jsx(maps.GeoMap, { ...resolvedMapProps })
|
|
16781
16838
|
}
|
|
16782
|
-
)
|
|
16839
|
+
) : null
|
|
16783
16840
|
]
|
|
16784
16841
|
}
|
|
16785
16842
|
)
|
|
@@ -97870,8 +97927,8 @@ function StatsGrowthTimeline({
|
|
|
97870
97927
|
}
|
|
97871
97928
|
),
|
|
97872
97929
|
milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : milestone.title),
|
|
97873
|
-
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 text-
|
|
97874
|
-
milestone.metric && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-
|
|
97930
|
+
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 opacity-70 text-balance", children: milestone.description }) : milestone.description),
|
|
97931
|
+
milestone.metric && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-card text-card-foreground p-4 shadow-sm", children: [
|
|
97875
97932
|
renderMilestoneIcon(milestone),
|
|
97876
97933
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
97877
97934
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-semibold", children: milestone.metric.value }),
|
|
@@ -97932,8 +97989,8 @@ function StatsGrowthTimeline({
|
|
|
97932
97989
|
futureClassName
|
|
97933
97990
|
),
|
|
97934
97991
|
children: [
|
|
97935
|
-
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "
|
|
97936
|
-
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "
|
|
97992
|
+
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold", children: futureHeading }) : futureHeading),
|
|
97993
|
+
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-full md:max-w-md text-balance", children: futureDescription }) : futureDescription),
|
|
97937
97994
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
97938
97995
|
BlockActions,
|
|
97939
97996
|
{
|
|
@@ -97978,12 +98035,12 @@ function StatsGrowthTimeline({
|
|
|
97978
98035
|
),
|
|
97979
98036
|
children: heading
|
|
97980
98037
|
}
|
|
97981
|
-
) :
|
|
98038
|
+
) : heading),
|
|
97982
98039
|
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
97983
98040
|
"p",
|
|
97984
98041
|
{
|
|
97985
98042
|
className: cn(
|
|
97986
|
-
"
|
|
98043
|
+
"max-w-full md:max-w-md text-base md:text-lg text-balance",
|
|
97987
98044
|
descriptionClassName
|
|
97988
98045
|
),
|
|
97989
98046
|
children: description
|
package/dist/registry.js
CHANGED
|
@@ -16634,6 +16634,46 @@ var DEFAULT_FORM_FIELDS23 = [
|
|
|
16634
16634
|
columnSpan: 12
|
|
16635
16635
|
}
|
|
16636
16636
|
];
|
|
16637
|
+
function coerceCoordinate(value) {
|
|
16638
|
+
if (typeof value === "number") {
|
|
16639
|
+
return Number.isFinite(value) ? value : null;
|
|
16640
|
+
}
|
|
16641
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
16642
|
+
const parsed = Number(value);
|
|
16643
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
16644
|
+
}
|
|
16645
|
+
return null;
|
|
16646
|
+
}
|
|
16647
|
+
function sanitizeMarker(marker) {
|
|
16648
|
+
const markerWithAliases = marker;
|
|
16649
|
+
const latitude = coerceCoordinate(
|
|
16650
|
+
markerWithAliases.latitude ?? markerWithAliases.lat
|
|
16651
|
+
);
|
|
16652
|
+
const longitude = coerceCoordinate(
|
|
16653
|
+
markerWithAliases.longitude ?? markerWithAliases.lng
|
|
16654
|
+
);
|
|
16655
|
+
if (latitude === null || longitude === null) {
|
|
16656
|
+
return null;
|
|
16657
|
+
}
|
|
16658
|
+
return {
|
|
16659
|
+
...marker,
|
|
16660
|
+
latitude,
|
|
16661
|
+
longitude
|
|
16662
|
+
};
|
|
16663
|
+
}
|
|
16664
|
+
function sanitizeCluster(cluster) {
|
|
16665
|
+
const markers = cluster.markers.map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
16666
|
+
if (markers.length === 0) {
|
|
16667
|
+
return null;
|
|
16668
|
+
}
|
|
16669
|
+
const latitude = coerceCoordinate(cluster.latitude);
|
|
16670
|
+
const longitude = coerceCoordinate(cluster.longitude);
|
|
16671
|
+
return {
|
|
16672
|
+
...cluster,
|
|
16673
|
+
markers,
|
|
16674
|
+
...latitude !== null && longitude !== null ? { latitude, longitude } : {}
|
|
16675
|
+
};
|
|
16676
|
+
}
|
|
16637
16677
|
function ContactMap({
|
|
16638
16678
|
sectionId = "contact-map",
|
|
16639
16679
|
heading,
|
|
@@ -16669,10 +16709,24 @@ function ContactMap({
|
|
|
16669
16709
|
}
|
|
16670
16710
|
);
|
|
16671
16711
|
}, [formEngineSetup]);
|
|
16712
|
+
const sanitizedMapData = React30.useMemo(() => {
|
|
16713
|
+
const markers = (mapProps?.markers ?? []).map((marker) => sanitizeMarker(marker)).filter((marker) => marker !== null);
|
|
16714
|
+
const clusters = (mapProps?.clusters ?? []).map((cluster) => sanitizeCluster(cluster)).filter((cluster) => cluster !== null);
|
|
16715
|
+
return {
|
|
16716
|
+
markers,
|
|
16717
|
+
clusters,
|
|
16718
|
+
hasRenderableMap: markers.length > 0 || clusters.length > 0
|
|
16719
|
+
};
|
|
16720
|
+
}, [mapProps?.clusters, mapProps?.markers]);
|
|
16672
16721
|
const resolvedMapProps = React30.useMemo(() => {
|
|
16722
|
+
if (!sanitizedMapData.hasRenderableMap) {
|
|
16723
|
+
return null;
|
|
16724
|
+
}
|
|
16673
16725
|
return {
|
|
16674
16726
|
panelPosition: "top-left",
|
|
16675
16727
|
...mapProps,
|
|
16728
|
+
markers: sanitizedMapData.markers,
|
|
16729
|
+
clusters: sanitizedMapData.clusters,
|
|
16676
16730
|
// Don't override mapWrapperClassName if it's provided in mapProps
|
|
16677
16731
|
mapWrapperClassName: mapProps?.mapWrapperClassName,
|
|
16678
16732
|
className: cn(mapClassName, mapProps?.className),
|
|
@@ -16681,7 +16735,8 @@ function ContactMap({
|
|
|
16681
16735
|
IconComponent: DynamicIcon,
|
|
16682
16736
|
ImgComponent: Img
|
|
16683
16737
|
};
|
|
16684
|
-
}, [mapClassName, mapProps, optixFlowConfig]);
|
|
16738
|
+
}, [mapClassName, mapProps, optixFlowConfig, sanitizedMapData]);
|
|
16739
|
+
const hasMap = resolvedMapProps !== null;
|
|
16685
16740
|
return /* @__PURE__ */ jsx(
|
|
16686
16741
|
Section,
|
|
16687
16742
|
{
|
|
@@ -16696,8 +16751,10 @@ function ContactMap({
|
|
|
16696
16751
|
"div",
|
|
16697
16752
|
{
|
|
16698
16753
|
className: cn(
|
|
16699
|
-
"mx-auto grid max-w-full
|
|
16700
|
-
|
|
16754
|
+
"mx-auto grid max-w-full gap-8",
|
|
16755
|
+
hasMap && "md:max-w-7xl lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",
|
|
16756
|
+
contentGridClassName,
|
|
16757
|
+
!hasMap && "md:max-w-3xl lg:grid-cols-1"
|
|
16701
16758
|
),
|
|
16702
16759
|
children: [
|
|
16703
16760
|
/* @__PURE__ */ jsx(Card, { className: cn("shadow-lg rounded-xl", cardClassName), children: /* @__PURE__ */ jsxs(CardContent, { className: cardContentClassName, children: [
|
|
@@ -16725,7 +16782,7 @@ function ContactMap({
|
|
|
16725
16782
|
] }),
|
|
16726
16783
|
renderForm
|
|
16727
16784
|
] }) }),
|
|
16728
|
-
/* @__PURE__ */ jsx(
|
|
16785
|
+
resolvedMapProps ? /* @__PURE__ */ jsx(
|
|
16729
16786
|
"div",
|
|
16730
16787
|
{
|
|
16731
16788
|
className: cn(
|
|
@@ -16739,7 +16796,7 @@ function ContactMap({
|
|
|
16739
16796
|
},
|
|
16740
16797
|
children: /* @__PURE__ */ jsx(GeoMap, { ...resolvedMapProps })
|
|
16741
16798
|
}
|
|
16742
|
-
)
|
|
16799
|
+
) : null
|
|
16743
16800
|
]
|
|
16744
16801
|
}
|
|
16745
16802
|
)
|
|
@@ -97830,8 +97887,8 @@ function StatsGrowthTimeline({
|
|
|
97830
97887
|
}
|
|
97831
97888
|
),
|
|
97832
97889
|
milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : milestone.title),
|
|
97833
|
-
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-
|
|
97834
|
-
milestone.metric && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-
|
|
97890
|
+
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 opacity-70 text-balance", children: milestone.description }) : milestone.description),
|
|
97891
|
+
milestone.metric && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-card text-card-foreground p-4 shadow-sm", children: [
|
|
97835
97892
|
renderMilestoneIcon(milestone),
|
|
97836
97893
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
97837
97894
|
/* @__PURE__ */ jsx("div", { className: "text-2xl font-semibold", children: milestone.metric.value }),
|
|
@@ -97892,8 +97949,8 @@ function StatsGrowthTimeline({
|
|
|
97892
97949
|
futureClassName
|
|
97893
97950
|
),
|
|
97894
97951
|
children: [
|
|
97895
|
-
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "
|
|
97896
|
-
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "
|
|
97952
|
+
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold", children: futureHeading }) : futureHeading),
|
|
97953
|
+
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "max-w-full md:max-w-md text-balance", children: futureDescription }) : futureDescription),
|
|
97897
97954
|
/* @__PURE__ */ jsx(
|
|
97898
97955
|
BlockActions,
|
|
97899
97956
|
{
|
|
@@ -97938,12 +97995,12 @@ function StatsGrowthTimeline({
|
|
|
97938
97995
|
),
|
|
97939
97996
|
children: heading
|
|
97940
97997
|
}
|
|
97941
|
-
) :
|
|
97998
|
+
) : heading),
|
|
97942
97999
|
description && (typeof description === "string" ? /* @__PURE__ */ jsx(
|
|
97943
98000
|
"p",
|
|
97944
98001
|
{
|
|
97945
98002
|
className: cn(
|
|
97946
|
-
"
|
|
98003
|
+
"max-w-full md:max-w-md text-base md:text-lg text-balance",
|
|
97947
98004
|
descriptionClassName
|
|
97948
98005
|
),
|
|
97949
98006
|
children: description
|
|
@@ -603,8 +603,8 @@ function StatsGrowthTimeline({
|
|
|
603
603
|
}
|
|
604
604
|
),
|
|
605
605
|
milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : milestone.title),
|
|
606
|
-
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 text-
|
|
607
|
-
milestone.metric && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-
|
|
606
|
+
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 opacity-70 text-balance", children: milestone.description }) : milestone.description),
|
|
607
|
+
milestone.metric && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-card text-card-foreground p-4 shadow-sm", children: [
|
|
608
608
|
renderMilestoneIcon(milestone),
|
|
609
609
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
610
610
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-semibold", children: milestone.metric.value }),
|
|
@@ -665,8 +665,8 @@ function StatsGrowthTimeline({
|
|
|
665
665
|
futureClassName
|
|
666
666
|
),
|
|
667
667
|
children: [
|
|
668
|
-
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "
|
|
669
|
-
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "
|
|
668
|
+
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xl font-bold", children: futureHeading }) : futureHeading),
|
|
669
|
+
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-full md:max-w-md text-balance", children: futureDescription }) : futureDescription),
|
|
670
670
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
671
671
|
BlockActions,
|
|
672
672
|
{
|
|
@@ -711,12 +711,12 @@ function StatsGrowthTimeline({
|
|
|
711
711
|
),
|
|
712
712
|
children: heading
|
|
713
713
|
}
|
|
714
|
-
) :
|
|
714
|
+
) : heading),
|
|
715
715
|
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
716
716
|
"p",
|
|
717
717
|
{
|
|
718
718
|
className: cn(
|
|
719
|
-
"
|
|
719
|
+
"max-w-full md:max-w-md text-base md:text-lg text-balance",
|
|
720
720
|
descriptionClassName
|
|
721
721
|
),
|
|
722
722
|
children: description
|
|
@@ -582,8 +582,8 @@ function StatsGrowthTimeline({
|
|
|
582
582
|
}
|
|
583
583
|
),
|
|
584
584
|
milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : milestone.title),
|
|
585
|
-
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-
|
|
586
|
-
milestone.metric && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-
|
|
585
|
+
milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 opacity-70 text-balance", children: milestone.description }) : milestone.description),
|
|
586
|
+
milestone.metric && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-card text-card-foreground p-4 shadow-sm", children: [
|
|
587
587
|
renderMilestoneIcon(milestone),
|
|
588
588
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
589
589
|
/* @__PURE__ */ jsx("div", { className: "text-2xl font-semibold", children: milestone.metric.value }),
|
|
@@ -644,8 +644,8 @@ function StatsGrowthTimeline({
|
|
|
644
644
|
futureClassName
|
|
645
645
|
),
|
|
646
646
|
children: [
|
|
647
|
-
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "
|
|
648
|
-
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "
|
|
647
|
+
futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold", children: futureHeading }) : futureHeading),
|
|
648
|
+
futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "max-w-full md:max-w-md text-balance", children: futureDescription }) : futureDescription),
|
|
649
649
|
/* @__PURE__ */ jsx(
|
|
650
650
|
BlockActions,
|
|
651
651
|
{
|
|
@@ -690,12 +690,12 @@ function StatsGrowthTimeline({
|
|
|
690
690
|
),
|
|
691
691
|
children: heading
|
|
692
692
|
}
|
|
693
|
-
) :
|
|
693
|
+
) : heading),
|
|
694
694
|
description && (typeof description === "string" ? /* @__PURE__ */ jsx(
|
|
695
695
|
"p",
|
|
696
696
|
{
|
|
697
697
|
className: cn(
|
|
698
|
-
"
|
|
698
|
+
"max-w-full md:max-w-md text-base md:text-lg text-balance",
|
|
699
699
|
descriptionClassName
|
|
700
700
|
),
|
|
701
701
|
children: description
|