@sfperusacdev/sf-ui 0.1.35 → 0.1.36
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/sf-ui.css +1 -1
- package/dist/sf-ui.js +595 -447
- package/dist/sf-ui.js.map +1 -1
- package/dist/sf-ui.umd.cjs +7 -7
- package/dist/sf-ui.umd.cjs.map +1 -1
- package/dist/types/src/components/cards/MetricBar.d.ts +6 -2
- package/dist/types/src/components/cards/index.d.ts +1 -1
- package/dist/types/src/components/cards/types.d.ts +4 -0
- package/dist/types/src/components/dashboard/AlertSummaryList.d.ts +8 -1
- package/dist/types/src/components/dashboard/DonutBreakdown.d.ts +25 -0
- package/dist/types/src/components/dashboard/DonutBreakdown.test.d.ts +1 -0
- package/dist/types/src/components/dashboard/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/sf-ui.js
CHANGED
|
@@ -9749,12 +9749,15 @@ var yr = (e) => {
|
|
|
9749
9749
|
})]
|
|
9750
9750
|
})]
|
|
9751
9751
|
});
|
|
9752
|
-
}, ks = ({ metrics: e, small: t = !1, className: n }) => /* @__PURE__ */
|
|
9752
|
+
}, ks = ({ metrics: e, small: t = !1, className: n, footnote: r }) => /* @__PURE__ */ y("div", {
|
|
9753
9753
|
className: (0, X.default)("flex w-full flex-col gap-3", n),
|
|
9754
|
-
children: e.map((e, n) => /* @__PURE__ */ v(Os, {
|
|
9754
|
+
children: [e.map((e, n) => /* @__PURE__ */ v(Os, {
|
|
9755
9755
|
item: e,
|
|
9756
9756
|
small: t
|
|
9757
|
-
}, `${e.label}-${n}`))
|
|
9757
|
+
}, `${e.label}-${n}`)), r && /* @__PURE__ */ v("p", {
|
|
9758
|
+
className: (0, X.default)("sf-metric-list__footnote", `sf-metric-list__footnote--${r.tone ?? "amber"}`),
|
|
9759
|
+
children: r.text
|
|
9760
|
+
})]
|
|
9758
9761
|
}), As = {
|
|
9759
9762
|
default: "sf-entity-card--default",
|
|
9760
9763
|
featured: "sf-entity-card--featured",
|
|
@@ -10364,26 +10367,131 @@ var yr = (e) => {
|
|
|
10364
10367
|
size: e.size ?? t
|
|
10365
10368
|
}, n))
|
|
10366
10369
|
}), _c = {
|
|
10370
|
+
xs: 56,
|
|
10371
|
+
sm: 80,
|
|
10372
|
+
md: 110,
|
|
10373
|
+
lg: 150
|
|
10374
|
+
}, vc = {
|
|
10375
|
+
xs: 6,
|
|
10376
|
+
sm: 8,
|
|
10377
|
+
md: 10,
|
|
10378
|
+
lg: 13
|
|
10379
|
+
}, yc = {
|
|
10380
|
+
xs: 13,
|
|
10381
|
+
sm: 18,
|
|
10382
|
+
md: 24,
|
|
10383
|
+
lg: 34
|
|
10384
|
+
}, bc = {
|
|
10385
|
+
xs: 8,
|
|
10386
|
+
sm: 10,
|
|
10387
|
+
md: 11,
|
|
10388
|
+
lg: 13
|
|
10389
|
+
}, xc = [
|
|
10390
|
+
"var(--sf-primary)",
|
|
10391
|
+
"var(--sf-info)",
|
|
10392
|
+
"var(--sf-warning)",
|
|
10393
|
+
"var(--sf-accent)"
|
|
10394
|
+
], Sc = ({ segments: e, centerValue: t, centerLabel: n, size: r = "md", strokeWidth: i, showLegend: a = !0, className: o }) => {
|
|
10395
|
+
let s = e.reduce((e, t) => e + Math.max(0, t.value), 0), c = _c[r], l = i ?? vc[r], u = (c - l) / 2, d = c / 2, f = 2 * Math.PI * u, p = 0, m = e.map((e, t) => {
|
|
10396
|
+
let n = Math.max(0, e.value), r = s > 0 ? n / s : 0, i = f * r, a = f * (1 - p);
|
|
10397
|
+
return p += r, {
|
|
10398
|
+
...e,
|
|
10399
|
+
pct: r,
|
|
10400
|
+
color: e.color ?? xc[t % xc.length],
|
|
10401
|
+
dasharray: `${i} ${f - i}`,
|
|
10402
|
+
dashoffset: a
|
|
10403
|
+
};
|
|
10404
|
+
});
|
|
10405
|
+
return /* @__PURE__ */ y("div", {
|
|
10406
|
+
className: (0, X.default)("sf-donut-breakdown", o),
|
|
10407
|
+
children: [/* @__PURE__ */ y("div", {
|
|
10408
|
+
className: "relative",
|
|
10409
|
+
style: {
|
|
10410
|
+
width: c,
|
|
10411
|
+
height: c
|
|
10412
|
+
},
|
|
10413
|
+
children: [/* @__PURE__ */ v("svg", {
|
|
10414
|
+
width: c,
|
|
10415
|
+
height: c,
|
|
10416
|
+
viewBox: `0 0 ${c} ${c}`,
|
|
10417
|
+
className: "-rotate-90",
|
|
10418
|
+
"aria-hidden": "true",
|
|
10419
|
+
children: s <= 0 ? /* @__PURE__ */ v("circle", {
|
|
10420
|
+
cx: d,
|
|
10421
|
+
cy: d,
|
|
10422
|
+
r: u,
|
|
10423
|
+
fill: "none",
|
|
10424
|
+
stroke: "var(--sf-gauge-track)",
|
|
10425
|
+
strokeWidth: l
|
|
10426
|
+
}) : m.map((e, t) => /* @__PURE__ */ v("circle", {
|
|
10427
|
+
cx: d,
|
|
10428
|
+
cy: d,
|
|
10429
|
+
r: u,
|
|
10430
|
+
fill: "none",
|
|
10431
|
+
stroke: e.color,
|
|
10432
|
+
strokeWidth: l,
|
|
10433
|
+
strokeDasharray: e.dasharray,
|
|
10434
|
+
strokeDashoffset: e.dashoffset
|
|
10435
|
+
}, `${e.label}-${t}`))
|
|
10436
|
+
}), /* @__PURE__ */ y("div", {
|
|
10437
|
+
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
10438
|
+
children: [/* @__PURE__ */ v("span", {
|
|
10439
|
+
className: "sf-donut-breakdown__value",
|
|
10440
|
+
style: { fontSize: yc[r] },
|
|
10441
|
+
children: t ?? s.toLocaleString("es-PE")
|
|
10442
|
+
}), n && /* @__PURE__ */ v("span", {
|
|
10443
|
+
className: "sf-donut-breakdown__label",
|
|
10444
|
+
style: { fontSize: bc[r] },
|
|
10445
|
+
children: n
|
|
10446
|
+
})]
|
|
10447
|
+
})]
|
|
10448
|
+
}), a && /* @__PURE__ */ v("ul", {
|
|
10449
|
+
className: "sf-donut-breakdown__legend",
|
|
10450
|
+
children: m.map((e, t) => /* @__PURE__ */ y("li", {
|
|
10451
|
+
className: "sf-donut-breakdown__legend-item",
|
|
10452
|
+
children: [
|
|
10453
|
+
/* @__PURE__ */ v("span", {
|
|
10454
|
+
className: "sf-donut-breakdown__legend-dot",
|
|
10455
|
+
style: { backgroundColor: e.color },
|
|
10456
|
+
"aria-hidden": "true"
|
|
10457
|
+
}),
|
|
10458
|
+
/* @__PURE__ */ v("span", {
|
|
10459
|
+
className: "sf-donut-breakdown__legend-label",
|
|
10460
|
+
children: e.label
|
|
10461
|
+
}),
|
|
10462
|
+
/* @__PURE__ */ v("span", {
|
|
10463
|
+
className: "sf-donut-breakdown__legend-value",
|
|
10464
|
+
children: e.value.toLocaleString("es-PE")
|
|
10465
|
+
}),
|
|
10466
|
+
/* @__PURE__ */ y("span", {
|
|
10467
|
+
className: "sf-donut-breakdown__legend-pct",
|
|
10468
|
+
children: [Math.round(e.pct * 100), "%"]
|
|
10469
|
+
})
|
|
10470
|
+
]
|
|
10471
|
+
}, `${e.label}-${t}`))
|
|
10472
|
+
})]
|
|
10473
|
+
});
|
|
10474
|
+
}, Cc = {
|
|
10367
10475
|
success: "sf-event-log__dot--success",
|
|
10368
10476
|
warning: "sf-event-log__dot--warning",
|
|
10369
10477
|
danger: "sf-event-log__dot--danger",
|
|
10370
10478
|
info: "sf-event-log__dot--info",
|
|
10371
10479
|
default: "sf-event-log__dot--default"
|
|
10372
|
-
},
|
|
10480
|
+
}, wc = {
|
|
10373
10481
|
success: "sf-event-log__icon-wrap--success",
|
|
10374
10482
|
warning: "sf-event-log__icon-wrap--warning",
|
|
10375
10483
|
danger: "sf-event-log__icon-wrap--danger",
|
|
10376
10484
|
info: "sf-event-log__icon-wrap--info",
|
|
10377
10485
|
default: "sf-event-log__icon-wrap--default"
|
|
10378
|
-
},
|
|
10486
|
+
}, Tc = {
|
|
10379
10487
|
success: "sf-alert-row-list__meta--success",
|
|
10380
10488
|
warning: "sf-alert-row-list__meta--warning",
|
|
10381
10489
|
danger: "sf-alert-row-list__meta--danger",
|
|
10382
10490
|
info: "sf-alert-row-list__meta--info",
|
|
10383
10491
|
default: "sf-alert-row-list__meta--default"
|
|
10384
|
-
},
|
|
10492
|
+
}, Ec = (e, t) => {
|
|
10385
10493
|
t && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
10386
|
-
},
|
|
10494
|
+
}, Dc = ({ events: e, title: t, maxHeight: n, compact: r = !1, showTimeline: i = !0, viewAllLabel: a, onViewAll: o, className: s }) => {
|
|
10387
10495
|
let c = r ? "text-[11px]" : "text-xs", l = r ? "text-[10px]" : "text-[11px]", u = r ? "text-[9px]" : "text-[10px]", d = r ? "py-1.5" : "py-2.5";
|
|
10388
10496
|
return /* @__PURE__ */ y("div", {
|
|
10389
10497
|
className: (0, X.default)("sf-event-log", s),
|
|
@@ -10424,11 +10532,11 @@ var yr = (e) => {
|
|
|
10424
10532
|
/* @__PURE__ */ v("div", {
|
|
10425
10533
|
className: "mt-0.5 shrink-0",
|
|
10426
10534
|
children: t.icon ? /* @__PURE__ */ v("div", {
|
|
10427
|
-
className: (0, X.default)("sf-event-log__icon-wrap",
|
|
10535
|
+
className: (0, X.default)("sf-event-log__icon-wrap", wc[r]),
|
|
10428
10536
|
"aria-hidden": "true",
|
|
10429
10537
|
children: t.icon
|
|
10430
10538
|
}) : /* @__PURE__ */ v("div", {
|
|
10431
|
-
className: (0, X.default)("sf-event-log__dot",
|
|
10539
|
+
className: (0, X.default)("sf-event-log__dot", Cc[r]),
|
|
10432
10540
|
"aria-hidden": "true"
|
|
10433
10541
|
})
|
|
10434
10542
|
}),
|
|
@@ -10462,16 +10570,16 @@ var yr = (e) => {
|
|
|
10462
10570
|
})]
|
|
10463
10571
|
})]
|
|
10464
10572
|
});
|
|
10465
|
-
},
|
|
10573
|
+
}, Oc = {
|
|
10466
10574
|
time: "Hora",
|
|
10467
10575
|
vehicle: "Vehículo",
|
|
10468
10576
|
description: "Descripción"
|
|
10469
|
-
},
|
|
10577
|
+
}, kc = {
|
|
10470
10578
|
critical: "sf-alert-row-list__severity--critical",
|
|
10471
10579
|
warning: "sf-alert-row-list__severity--warning",
|
|
10472
10580
|
info: !1
|
|
10473
|
-
},
|
|
10474
|
-
let t =
|
|
10581
|
+
}, Ac = ({ severity: e }) => {
|
|
10582
|
+
let t = kc[e];
|
|
10475
10583
|
return t ? /* @__PURE__ */ v("span", {
|
|
10476
10584
|
className: (0, X.default)("sf-alert-row-list__severity", t),
|
|
10477
10585
|
"aria-hidden": "true",
|
|
@@ -10506,7 +10614,7 @@ var yr = (e) => {
|
|
|
10506
10614
|
})] })
|
|
10507
10615
|
})
|
|
10508
10616
|
}) : null;
|
|
10509
|
-
},
|
|
10617
|
+
}, jc = ({ actions: e }) => /* @__PURE__ */ v("span", {
|
|
10510
10618
|
className: "sf-alert-row-list__actions",
|
|
10511
10619
|
children: e.map((e, t) => /* @__PURE__ */ v("button", {
|
|
10512
10620
|
type: "button",
|
|
@@ -10516,9 +10624,9 @@ var yr = (e) => {
|
|
|
10516
10624
|
},
|
|
10517
10625
|
children: e.label
|
|
10518
10626
|
}, t))
|
|
10519
|
-
}),
|
|
10627
|
+
}), Mc = ({ items: e, maxHeight: t, className: n, columns: r = !1, headerLabels: i, density: a = "comfortable", emptyMessage: o = "Sin alertas" }) => {
|
|
10520
10628
|
let s = {
|
|
10521
|
-
...
|
|
10629
|
+
...Oc,
|
|
10522
10630
|
...i
|
|
10523
10631
|
};
|
|
10524
10632
|
return /* @__PURE__ */ y("div", {
|
|
@@ -10552,13 +10660,13 @@ var yr = (e) => {
|
|
|
10552
10660
|
role: a ? "button" : "listitem",
|
|
10553
10661
|
tabIndex: a ? 0 : void 0,
|
|
10554
10662
|
onClick: a ? e.onClick : void 0,
|
|
10555
|
-
onKeyDown: a ? (t) =>
|
|
10663
|
+
onKeyDown: a ? (t) => Ec(t, e.onClick) : void 0
|
|
10556
10664
|
};
|
|
10557
10665
|
return r ? /* @__PURE__ */ y("div", {
|
|
10558
10666
|
...o,
|
|
10559
10667
|
children: [
|
|
10560
10668
|
/* @__PURE__ */ v("span", {
|
|
10561
|
-
className: (0, X.default)("sf-event-log__dot",
|
|
10669
|
+
className: (0, X.default)("sf-event-log__dot", Cc[n]),
|
|
10562
10670
|
"aria-hidden": "true"
|
|
10563
10671
|
}),
|
|
10564
10672
|
/* @__PURE__ */ v("span", {
|
|
@@ -10567,7 +10675,7 @@ var yr = (e) => {
|
|
|
10567
10675
|
}),
|
|
10568
10676
|
/* @__PURE__ */ y("span", {
|
|
10569
10677
|
className: "sf-alert-row-list__vehicle",
|
|
10570
|
-
children: [e.severity && /* @__PURE__ */ v(
|
|
10678
|
+
children: [e.severity && /* @__PURE__ */ v(Ac, { severity: e.severity }), e.vehicle]
|
|
10571
10679
|
}),
|
|
10572
10680
|
/* @__PURE__ */ y("span", {
|
|
10573
10681
|
className: "sf-alert-row-list__description",
|
|
@@ -10578,17 +10686,17 @@ var yr = (e) => {
|
|
|
10578
10686
|
children: e.icon
|
|
10579
10687
|
}), e.label]
|
|
10580
10688
|
}), e.meta && /* @__PURE__ */ v("span", {
|
|
10581
|
-
className: (0, X.default)("sf-alert-row-list__meta",
|
|
10689
|
+
className: (0, X.default)("sf-alert-row-list__meta", Tc[n]),
|
|
10582
10690
|
children: e.meta
|
|
10583
10691
|
})]
|
|
10584
10692
|
}),
|
|
10585
|
-
i && /* @__PURE__ */ v(
|
|
10693
|
+
i && /* @__PURE__ */ v(jc, { actions: e.actions })
|
|
10586
10694
|
]
|
|
10587
10695
|
}, t) : /* @__PURE__ */ y("div", {
|
|
10588
10696
|
...o,
|
|
10589
10697
|
children: [
|
|
10590
10698
|
/* @__PURE__ */ v("span", {
|
|
10591
|
-
className: (0, X.default)("sf-event-log__dot",
|
|
10699
|
+
className: (0, X.default)("sf-event-log__dot", Cc[n]),
|
|
10592
10700
|
"aria-hidden": "true"
|
|
10593
10701
|
}),
|
|
10594
10702
|
/* @__PURE__ */ y("span", {
|
|
@@ -10599,20 +10707,20 @@ var yr = (e) => {
|
|
|
10599
10707
|
}), e.label]
|
|
10600
10708
|
}),
|
|
10601
10709
|
e.meta && /* @__PURE__ */ v("span", {
|
|
10602
|
-
className: (0, X.default)("sf-alert-row-list__meta",
|
|
10710
|
+
className: (0, X.default)("sf-alert-row-list__meta", Tc[n]),
|
|
10603
10711
|
children: e.meta
|
|
10604
10712
|
}),
|
|
10605
10713
|
e.time && /* @__PURE__ */ v("span", {
|
|
10606
10714
|
className: "sf-alert-row-list__time",
|
|
10607
10715
|
children: e.time
|
|
10608
10716
|
}),
|
|
10609
|
-
i && /* @__PURE__ */ v(
|
|
10717
|
+
i && /* @__PURE__ */ v(jc, { actions: e.actions })
|
|
10610
10718
|
]
|
|
10611
10719
|
}, t);
|
|
10612
10720
|
})
|
|
10613
10721
|
]
|
|
10614
10722
|
});
|
|
10615
|
-
},
|
|
10723
|
+
}, Nc = {
|
|
10616
10724
|
success: {
|
|
10617
10725
|
color: "#1F8A4C",
|
|
10618
10726
|
halo: "#EAF5EE"
|
|
@@ -10633,17 +10741,17 @@ var yr = (e) => {
|
|
|
10633
10741
|
color: "var(--sf-text-subtle, #5C7180)",
|
|
10634
10742
|
halo: "var(--sf-surface-alt, #EEF0F2)"
|
|
10635
10743
|
}
|
|
10636
|
-
},
|
|
10744
|
+
}, Pc = {
|
|
10637
10745
|
display: "flex",
|
|
10638
10746
|
gap: 12,
|
|
10639
10747
|
flexWrap: "wrap"
|
|
10640
|
-
},
|
|
10748
|
+
}, Fc = ({ items: e, className: t }) => /* @__PURE__ */ v("div", {
|
|
10641
10749
|
className: (0, X.default)("sf-alert-lane", t),
|
|
10642
|
-
style:
|
|
10750
|
+
style: Pc,
|
|
10643
10751
|
role: "list",
|
|
10644
10752
|
"aria-label": "Alertas",
|
|
10645
10753
|
children: e.map((e, t) => {
|
|
10646
|
-
let n =
|
|
10754
|
+
let n = Nc[e.status ?? "default"], r = e.color ?? n.color, i = e.halo ?? n.halo;
|
|
10647
10755
|
return /* @__PURE__ */ y("div", {
|
|
10648
10756
|
role: "listitem",
|
|
10649
10757
|
style: {
|
|
@@ -10714,30 +10822,70 @@ var yr = (e) => {
|
|
|
10714
10822
|
]
|
|
10715
10823
|
}, e.id ?? t);
|
|
10716
10824
|
})
|
|
10717
|
-
}),
|
|
10825
|
+
}), Ic = ({ tone: e = "default" }) => /* @__PURE__ */ v("span", {
|
|
10826
|
+
className: (0, X.default)("sf-alert-summary-row__icon", `sf-alert-summary-row__icon--${e}`),
|
|
10827
|
+
"aria-hidden": "true",
|
|
10828
|
+
children: /* @__PURE__ */ y("svg", {
|
|
10829
|
+
viewBox: "0 0 16 16",
|
|
10830
|
+
width: "14",
|
|
10831
|
+
height: "14",
|
|
10832
|
+
fill: "none",
|
|
10833
|
+
stroke: "currentColor",
|
|
10834
|
+
strokeWidth: "1.6",
|
|
10835
|
+
strokeLinecap: "round",
|
|
10836
|
+
children: [/* @__PURE__ */ v("circle", {
|
|
10837
|
+
cx: "8",
|
|
10838
|
+
cy: "8",
|
|
10839
|
+
r: "6.4"
|
|
10840
|
+
}), e === "danger" || e === "warning" ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("line", {
|
|
10841
|
+
x1: "8",
|
|
10842
|
+
y1: "5",
|
|
10843
|
+
x2: "8",
|
|
10844
|
+
y2: "8.6"
|
|
10845
|
+
}), /* @__PURE__ */ v("line", {
|
|
10846
|
+
x1: "8",
|
|
10847
|
+
y1: "10.8",
|
|
10848
|
+
x2: "8",
|
|
10849
|
+
y2: "10.81"
|
|
10850
|
+
})] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("line", {
|
|
10851
|
+
x1: "8",
|
|
10852
|
+
y1: "7",
|
|
10853
|
+
x2: "8",
|
|
10854
|
+
y2: "11"
|
|
10855
|
+
}), /* @__PURE__ */ v("line", {
|
|
10856
|
+
x1: "8",
|
|
10857
|
+
y1: "4.7",
|
|
10858
|
+
x2: "8",
|
|
10859
|
+
y2: "4.71"
|
|
10860
|
+
})] })]
|
|
10861
|
+
})
|
|
10862
|
+
}), Lc = ({ items: e, className: t, density: n = "comfortable", emptyMessage: r = "Sin alertas", showIcon: i = !1 }) => /* @__PURE__ */ y("div", {
|
|
10718
10863
|
className: (0, X.default)("sf-alert-summary-list", t),
|
|
10719
10864
|
children: [e.length === 0 && /* @__PURE__ */ v("p", {
|
|
10720
10865
|
className: "sf-alert-summary-list__empty",
|
|
10721
10866
|
role: "status",
|
|
10722
10867
|
children: r
|
|
10723
10868
|
}), e.map((e, t) => {
|
|
10724
|
-
let r = !!e.actions?.length,
|
|
10869
|
+
let r = !!e.actions?.length, a = !r && !!e.onClick;
|
|
10725
10870
|
return /* @__PURE__ */ y("div", {
|
|
10726
|
-
className: (0, X.default)("sf-alert-summary-row", `sf-alert-summary-row--${e.tone ?? "default"}`, n === "compact" && "sf-alert-summary-row--compact",
|
|
10727
|
-
onClick:
|
|
10728
|
-
role:
|
|
10729
|
-
tabIndex:
|
|
10730
|
-
onKeyDown:
|
|
10871
|
+
className: (0, X.default)("sf-alert-summary-row", `sf-alert-summary-row--${e.tone ?? "default"}`, n === "compact" && "sf-alert-summary-row--compact", a && "sf-alert-summary-row--clickable"),
|
|
10872
|
+
onClick: a ? e.onClick : void 0,
|
|
10873
|
+
role: a ? "button" : void 0,
|
|
10874
|
+
tabIndex: a ? 0 : void 0,
|
|
10875
|
+
onKeyDown: a ? (t) => {
|
|
10731
10876
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.onClick?.());
|
|
10732
10877
|
} : void 0,
|
|
10733
10878
|
children: [/* @__PURE__ */ y("div", {
|
|
10734
|
-
className: "min-w-0",
|
|
10735
|
-
children: [/* @__PURE__ */ v("
|
|
10736
|
-
className: "
|
|
10737
|
-
children:
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10879
|
+
className: "flex min-w-0 items-start gap-2",
|
|
10880
|
+
children: [i && (e.icon ?? /* @__PURE__ */ v(Ic, { tone: e.tone })), /* @__PURE__ */ y("div", {
|
|
10881
|
+
className: "min-w-0",
|
|
10882
|
+
children: [/* @__PURE__ */ v("p", {
|
|
10883
|
+
className: "sf-alert-summary-row__label",
|
|
10884
|
+
children: e.label
|
|
10885
|
+
}), e.description && /* @__PURE__ */ v("p", {
|
|
10886
|
+
className: "sf-alert-summary-row__description",
|
|
10887
|
+
children: e.description
|
|
10888
|
+
})]
|
|
10741
10889
|
})]
|
|
10742
10890
|
}), /* @__PURE__ */ y("div", {
|
|
10743
10891
|
className: "flex shrink-0 items-center gap-3",
|
|
@@ -10758,7 +10906,7 @@ var yr = (e) => {
|
|
|
10758
10906
|
})]
|
|
10759
10907
|
}, `${e.label}-${t}`);
|
|
10760
10908
|
})]
|
|
10761
|
-
}),
|
|
10909
|
+
}), Rc = ({ items: e, confidence: t, updatedAt: n, className: r }) => {
|
|
10762
10910
|
let i = [
|
|
10763
10911
|
...e.map((e, t) => /* @__PURE__ */ y("span", {
|
|
10764
10912
|
className: "sf-evidence-footnote__item",
|
|
@@ -10795,7 +10943,7 @@ var yr = (e) => {
|
|
|
10795
10943
|
}), e]
|
|
10796
10944
|
}, t))
|
|
10797
10945
|
});
|
|
10798
|
-
},
|
|
10946
|
+
}, zc = (e) => e.toLocaleString("es-PE"), Bc = ({ rows: e, planLabel: t = "Plan", realLabel: n = "Real", className: r }) => /* @__PURE__ */ y("table", {
|
|
10799
10947
|
className: (0, X.default)("sf-comparison-table", r),
|
|
10800
10948
|
children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", { children: [
|
|
10801
10949
|
/* @__PURE__ */ v("th", { className: "sf-comparison-table__th sf-comparison-table__th--label" }),
|
|
@@ -10812,7 +10960,7 @@ var yr = (e) => {
|
|
|
10812
10960
|
children: "Desviación"
|
|
10813
10961
|
})
|
|
10814
10962
|
] }) }), /* @__PURE__ */ v("tbody", { children: e.map((e) => {
|
|
10815
|
-
let t = e.valueFormat ??
|
|
10963
|
+
let t = e.valueFormat ?? zc, n = e.direction ?? "up-good", r = e.real - e.plan, i = e.plan === 0 ? 0 : r / Math.abs(e.plan) * 100, a = n === "neutral" ? null : n === "up-good" ? r >= 0 : r <= 0;
|
|
10816
10964
|
return /* @__PURE__ */ y("tr", {
|
|
10817
10965
|
className: "sf-comparison-table__row",
|
|
10818
10966
|
children: [
|
|
@@ -10843,40 +10991,40 @@ var yr = (e) => {
|
|
|
10843
10991
|
]
|
|
10844
10992
|
}, e.key);
|
|
10845
10993
|
}) })]
|
|
10846
|
-
}),
|
|
10994
|
+
}), Vc = {
|
|
10847
10995
|
default: "",
|
|
10848
10996
|
accent: "sf-card--accent",
|
|
10849
10997
|
critical: "sf-card--critical",
|
|
10850
10998
|
warning: "sf-card--warning",
|
|
10851
10999
|
success: "sf-card--success"
|
|
10852
|
-
},
|
|
11000
|
+
}, Hc = {
|
|
10853
11001
|
1: "col-span-1",
|
|
10854
11002
|
2: "col-span-1 sm:col-span-2",
|
|
10855
11003
|
3: "col-span-1 sm:col-span-2 lg:col-span-3",
|
|
10856
11004
|
4: "col-span-1 sm:col-span-2 lg:col-span-4",
|
|
10857
11005
|
5: "col-span-1 sm:col-span-2 lg:col-span-5",
|
|
10858
11006
|
6: "col-span-1 sm:col-span-2 lg:col-span-6"
|
|
10859
|
-
},
|
|
11007
|
+
}, Uc = {
|
|
10860
11008
|
none: "",
|
|
10861
11009
|
sm: "p-3",
|
|
10862
11010
|
md: "p-4",
|
|
10863
11011
|
lg: "p-5"
|
|
10864
|
-
},
|
|
11012
|
+
}, Wc = {
|
|
10865
11013
|
visible: "",
|
|
10866
11014
|
auto: "overflow-auto",
|
|
10867
11015
|
hidden: "overflow-hidden"
|
|
10868
|
-
},
|
|
11016
|
+
}, Gc = () => /* @__PURE__ */ v("div", {
|
|
10869
11017
|
className: "sf-card-state__spinner",
|
|
10870
11018
|
role: "status",
|
|
10871
11019
|
"aria-label": "Cargando",
|
|
10872
11020
|
children: /* @__PURE__ */ v("span", { className: "sf-card-state__spinner-ring" })
|
|
10873
|
-
}),
|
|
11021
|
+
}), Kc = ({ title: e, subtitle: t, icon: n, headerAction: r, variant: i = "default", span: a = 1, padding: o = "md", headerSize: s = "sm", headerWrap: c = !1, footer: l, state: u = "idle", loadingMessage: d = "Cargando…", errorMessage: f = "No se pudo cargar la información.", emptyMessage: p = "Sin datos para mostrar.", onRetry: m, retryLabel: h = "Reintentar", minHeight: g, bodyOverflow: b = "visible", className: x, children: S }) => {
|
|
10874
11022
|
let C = g === void 0 ? void 0 : { minHeight: g }, w = u !== "idle" && /* @__PURE__ */ y("div", {
|
|
10875
11023
|
className: "sf-card-state",
|
|
10876
11024
|
style: C,
|
|
10877
11025
|
role: u === "error" ? "alert" : u === "empty" ? "status" : void 0,
|
|
10878
11026
|
children: [
|
|
10879
|
-
u === "loading" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(
|
|
11027
|
+
u === "loading" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(Gc, {}), d && /* @__PURE__ */ v("p", {
|
|
10880
11028
|
className: "sf-card-state__message",
|
|
10881
11029
|
children: d
|
|
10882
11030
|
})] }),
|
|
@@ -10898,7 +11046,7 @@ var yr = (e) => {
|
|
|
10898
11046
|
return /* @__PURE__ */ y("div", {
|
|
10899
11047
|
role: e ? "region" : void 0,
|
|
10900
11048
|
"aria-label": e,
|
|
10901
|
-
className: (0, X.default)("sf-card flex flex-col overflow-hidden",
|
|
11049
|
+
className: (0, X.default)("sf-card flex flex-col overflow-hidden", Vc[i], Hc[a], x),
|
|
10902
11050
|
children: [
|
|
10903
11051
|
(e || n || r) && /* @__PURE__ */ y("div", {
|
|
10904
11052
|
className: (0, X.default)("sf-card-header", s === "md" && "sf-card-header--md", c && "sf-card-header--wrap"),
|
|
@@ -10929,7 +11077,7 @@ var yr = (e) => {
|
|
|
10929
11077
|
]
|
|
10930
11078
|
}),
|
|
10931
11079
|
/* @__PURE__ */ v("div", {
|
|
10932
|
-
className: (0, X.default)("flex-1",
|
|
11080
|
+
className: (0, X.default)("flex-1", Uc[o], Wc[b]),
|
|
10933
11081
|
style: u === "idle" ? C : void 0,
|
|
10934
11082
|
children: u === "idle" ? S : w
|
|
10935
11083
|
}),
|
|
@@ -10939,24 +11087,24 @@ var yr = (e) => {
|
|
|
10939
11087
|
})
|
|
10940
11088
|
]
|
|
10941
11089
|
});
|
|
10942
|
-
},
|
|
11090
|
+
}, qc = {
|
|
10943
11091
|
2: "grid-cols-1 sm:grid-cols-2",
|
|
10944
11092
|
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
10945
11093
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
|
|
10946
11094
|
5: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",
|
|
10947
11095
|
6: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-6"
|
|
10948
|
-
},
|
|
11096
|
+
}, Jc = {
|
|
10949
11097
|
sm: "gap-2",
|
|
10950
11098
|
md: "gap-3",
|
|
10951
11099
|
lg: "gap-5"
|
|
10952
|
-
},
|
|
11100
|
+
}, Yc = {
|
|
10953
11101
|
stretch: "items-stretch",
|
|
10954
11102
|
start: "items-start"
|
|
10955
|
-
},
|
|
10956
|
-
className: (0, X.default)("grid", !r &&
|
|
11103
|
+
}, Xc = ({ cols: e = 4, gap: t = "md", alignItems: n = "stretch", minColWidth: r, className: i, children: a }) => /* @__PURE__ */ v("div", {
|
|
11104
|
+
className: (0, X.default)("grid", !r && qc[e], Jc[t], Yc[n], i),
|
|
10957
11105
|
style: r ? { gridTemplateColumns: `repeat(auto-fit, minmax(${r}, 1fr))` } : void 0,
|
|
10958
11106
|
children: a
|
|
10959
|
-
}),
|
|
11107
|
+
}), Zc = ({ title: e, subtitle: t, action: n, className: r, children: i }) => /* @__PURE__ */ y("section", {
|
|
10960
11108
|
className: (0, X.default)("flex flex-col gap-3", r),
|
|
10961
11109
|
"aria-label": e,
|
|
10962
11110
|
children: [/* @__PURE__ */ y("div", {
|
|
@@ -10972,13 +11120,13 @@ var yr = (e) => {
|
|
|
10972
11120
|
children: n
|
|
10973
11121
|
})]
|
|
10974
11122
|
}), i]
|
|
10975
|
-
}),
|
|
11123
|
+
}), Qc = {
|
|
10976
11124
|
slate: "sf-stat-tone--slate",
|
|
10977
11125
|
emerald: "sf-stat-tone--emerald",
|
|
10978
11126
|
amber: "sf-stat-tone--amber",
|
|
10979
11127
|
red: "sf-stat-tone--red",
|
|
10980
11128
|
blue: "sf-stat-tone--blue"
|
|
10981
|
-
},
|
|
11129
|
+
}, $c = ({ items: e, className: t }) => /* @__PURE__ */ v("div", {
|
|
10982
11130
|
role: "list",
|
|
10983
11131
|
"aria-label": "Resumen de métricas",
|
|
10984
11132
|
className: (0, X.default)("flex flex-wrap items-center gap-5 border-t border-[var(--sf-border)] bg-[var(--sf-card-bg)] px-4 py-2", t),
|
|
@@ -10987,7 +11135,7 @@ var yr = (e) => {
|
|
|
10987
11135
|
role: "listitem",
|
|
10988
11136
|
children: [
|
|
10989
11137
|
e.tone && /* @__PURE__ */ v("span", {
|
|
10990
|
-
className: (0, X.default)("h-1.5 w-1.5 shrink-0 rounded-full",
|
|
11138
|
+
className: (0, X.default)("h-1.5 w-1.5 shrink-0 rounded-full", Qc[e.tone]),
|
|
10991
11139
|
"aria-hidden": "true"
|
|
10992
11140
|
}),
|
|
10993
11141
|
/* @__PURE__ */ y("span", {
|
|
@@ -11000,7 +11148,7 @@ var yr = (e) => {
|
|
|
11000
11148
|
})
|
|
11001
11149
|
]
|
|
11002
11150
|
}, t))
|
|
11003
|
-
}),
|
|
11151
|
+
}), el = ({ header: e, sidebar: t, statBar: n, className: r, children: i }) => /* @__PURE__ */ y("div", {
|
|
11004
11152
|
className: "sf-card flex min-h-[480px] flex-col overflow-hidden bg-[var(--sf-page-bg)]",
|
|
11005
11153
|
role: "region",
|
|
11006
11154
|
"aria-label": "Dashboard",
|
|
@@ -11025,7 +11173,7 @@ var yr = (e) => {
|
|
|
11025
11173
|
children: n
|
|
11026
11174
|
})
|
|
11027
11175
|
]
|
|
11028
|
-
}),
|
|
11176
|
+
}), tl = ({ title: e, onClose: t, headerAction: n, icon: r, iconSize: i = "sm", heading: a, badge: o, rows: s = [], align: c = "stack", actions: l, sectionTitle: u, items: d = [], width: f = 320, className: p }) => {
|
|
11029
11177
|
let m = typeof f == "number" ? `${f}px` : f;
|
|
11030
11178
|
return /* @__PURE__ */ y("aside", {
|
|
11031
11179
|
className: (0, X.default)("sf-detail-side-panel", p),
|
|
@@ -11118,7 +11266,7 @@ var yr = (e) => {
|
|
|
11118
11266
|
})
|
|
11119
11267
|
]
|
|
11120
11268
|
});
|
|
11121
|
-
},
|
|
11269
|
+
}, nl = ({ title: e, icon: t, tone: n = "default", rows: r = [], children: i, className: a, density: o = "md" }) => {
|
|
11122
11270
|
let s = r.length > 0 || !!i;
|
|
11123
11271
|
return /* @__PURE__ */ y("section", {
|
|
11124
11272
|
className: (0, X.default)("sf-detail-section", n !== "default" && `sf-detail-section--${n}`, o === "sm" && "sf-detail-section--sm", a),
|
|
@@ -11159,15 +11307,15 @@ var yr = (e) => {
|
|
|
11159
11307
|
})]
|
|
11160
11308
|
})]
|
|
11161
11309
|
});
|
|
11162
|
-
},
|
|
11310
|
+
}, rl = ({ small: e, error: t }) => (0, X.default)("sf-input", "sf-input--otp", e && "sf-input--sm", t && "sf-input--error"), il = (e, t) => {
|
|
11163
11311
|
let n = rn(String(e ?? ""), t);
|
|
11164
11312
|
return Array.from({ length: t }, (e, t) => n[t] ?? "");
|
|
11165
|
-
},
|
|
11313
|
+
}, al = ({ form: e, name: t, label: n, info: r, required: i, disabled: a, small: o, className: s, length: c = 6, onChange: l }) => {
|
|
11166
11314
|
let u = b({
|
|
11167
11315
|
name: t,
|
|
11168
11316
|
control: e.control
|
|
11169
|
-
}), d = m([]), [f, p] = h(() =>
|
|
11170
|
-
u.field.value !== g && (_(u.field.value), p(
|
|
11317
|
+
}), d = m([]), [f, p] = h(() => il(u.field.value, c)), [g, _] = h(u.field.value);
|
|
11318
|
+
u.field.value !== g && (_(u.field.value), p(il(u.field.value, c)));
|
|
11171
11319
|
let y = String(t), x = u.fieldState.error?.message ? String(u.fieldState.error.message) : void 0, S = (e) => {
|
|
11172
11320
|
p(e);
|
|
11173
11321
|
let t = e.join("");
|
|
@@ -11211,7 +11359,7 @@ var yr = (e) => {
|
|
|
11211
11359
|
onBlur: () => u.field.onBlur(),
|
|
11212
11360
|
onChange: (e) => C(t, e.target.value),
|
|
11213
11361
|
onKeyDown: (e) => w(t, e),
|
|
11214
|
-
className:
|
|
11362
|
+
className: rl({
|
|
11215
11363
|
small: o,
|
|
11216
11364
|
error: !!x,
|
|
11217
11365
|
disabled: a
|
|
@@ -11219,15 +11367,15 @@ var yr = (e) => {
|
|
|
11219
11367
|
}, t))
|
|
11220
11368
|
})
|
|
11221
11369
|
});
|
|
11222
|
-
},
|
|
11370
|
+
}, ol = (e) => {
|
|
11223
11371
|
let [t, n] = e.slice(0, 10).split("-").map(Number), r = new Date(t, n, 0).getDate();
|
|
11224
11372
|
return `${t}-${String(n).padStart(2, "0")}-${String(r).padStart(2, "0")}`;
|
|
11225
|
-
},
|
|
11373
|
+
}, sl = ({ form: e, startName: t, endName: n, startLabel: r = "Desde", endLabel: i = "Hasta", required: a, endRequired: o, small: s, readOnlyEnd: c, adjustEnd: l = "start", onEndAdjusted: u, className: d }) => {
|
|
11226
11374
|
let f = String(e.watch(t) ?? ""), p = (t, r) => {
|
|
11227
11375
|
if (l === "none") return;
|
|
11228
11376
|
let i = t.slice(0, 10), a = r.slice(0, 10);
|
|
11229
11377
|
if (!Dn(i) || !Dn(a) || a >= i) return;
|
|
11230
|
-
let o = l === "month-end" ?
|
|
11378
|
+
let o = l === "month-end" ? ol(i) : i;
|
|
11231
11379
|
e.setValue(n, o, { shouldValidate: !1 }), u?.(o);
|
|
11232
11380
|
};
|
|
11233
11381
|
return /* @__PURE__ */ y("div", {
|
|
@@ -11252,16 +11400,16 @@ var yr = (e) => {
|
|
|
11252
11400
|
onChange: (n) => p(String(e.getValues(t) ?? ""), n)
|
|
11253
11401
|
})]
|
|
11254
11402
|
});
|
|
11255
|
-
},
|
|
11403
|
+
}, cl = (e) => /* @__PURE__ */ v(Nn, {
|
|
11256
11404
|
...e,
|
|
11257
11405
|
utc: !0
|
|
11258
|
-
}),
|
|
11406
|
+
}), ll = () => ({
|
|
11259
11407
|
start: "",
|
|
11260
11408
|
end: ""
|
|
11261
|
-
}),
|
|
11409
|
+
}), ul = () => ({
|
|
11262
11410
|
start: "",
|
|
11263
11411
|
end: ""
|
|
11264
|
-
}),
|
|
11412
|
+
}), dl = 0, fl = () => (dl += 1, `photo_${Date.now()}_${dl}`), pl = (e, t) => {
|
|
11265
11413
|
if (!t || t === "*") return !0;
|
|
11266
11414
|
let n = t.replace(/\s/g, "").split(","), r = `.${e.name.split(".").pop()?.toLowerCase() ?? ""}`, i = e.type.toLowerCase();
|
|
11267
11415
|
return n.some((e) => {
|
|
@@ -11273,20 +11421,20 @@ var yr = (e) => {
|
|
|
11273
11421
|
}
|
|
11274
11422
|
return i === t;
|
|
11275
11423
|
});
|
|
11276
|
-
},
|
|
11424
|
+
}, ml = (e, t = !1) => new Promise((n) => {
|
|
11277
11425
|
let r = document.createElement("input");
|
|
11278
11426
|
r.type = "file", r.accept = e, r.multiple = t, r.style.display = "none", r.onchange = () => {
|
|
11279
11427
|
n(Array.from(r.files ?? [])), r.remove();
|
|
11280
11428
|
}, document.body.appendChild(r), r.click();
|
|
11281
|
-
}),
|
|
11282
|
-
id:
|
|
11429
|
+
}), hl = (e) => ({
|
|
11430
|
+
id: fl(),
|
|
11283
11431
|
preview: URL.createObjectURL(e),
|
|
11284
11432
|
file: e
|
|
11285
|
-
}),
|
|
11433
|
+
}), gl = (e) => {
|
|
11286
11434
|
URL.revokeObjectURL(e.preview);
|
|
11287
|
-
},
|
|
11288
|
-
e.forEach(
|
|
11289
|
-
},
|
|
11435
|
+
}, _l = (e) => {
|
|
11436
|
+
e.forEach(gl);
|
|
11437
|
+
}, vl = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string" && typeof e.preview == "string" && e.file instanceof File) : [], yl = (e, t = .92) => new Promise((n, r) => {
|
|
11290
11438
|
let i = URL.createObjectURL(e), a = new Image();
|
|
11291
11439
|
a.onload = () => {
|
|
11292
11440
|
let o = Math.min(a.width, a.height), s = (a.width - o) / 2, c = (a.height - o) / 2, l = document.createElement("canvas");
|
|
@@ -11309,7 +11457,7 @@ var yr = (e) => {
|
|
|
11309
11457
|
}, a.onerror = () => {
|
|
11310
11458
|
URL.revokeObjectURL(i), r(/* @__PURE__ */ Error("Imagen inválida"));
|
|
11311
11459
|
}, a.src = i;
|
|
11312
|
-
}),
|
|
11460
|
+
}), bl = (e) => e.length === 0 ? "Arrastra archivos o haz clic" : e.length === 1 ? e[0].name : `${e.length} archivos seleccionados`, xl = (e) => `${e.name}-${e.lastModified}-${e.size}`, Sl = ({ form: e, name: t, label: n, info: r, required: i, accept: a = "*", multiple: o = !1, maxSizeMb: s = 10, dropLabel: c, readOnly: l, disabled: u, small: d, className: f, onChange: p, onUpload: g, onRefresh: _ }) => {
|
|
11313
11461
|
let x = m(null), S = b({
|
|
11314
11462
|
name: t,
|
|
11315
11463
|
control: e.control
|
|
@@ -11318,7 +11466,7 @@ var yr = (e) => {
|
|
|
11318
11466
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
11319
11467
|
})(), L = async (e) => {
|
|
11320
11468
|
if (g) for (let t of e) {
|
|
11321
|
-
let e =
|
|
11469
|
+
let e = xl(t);
|
|
11322
11470
|
O((t) => new Set(t).add(e)), E((t) => ({
|
|
11323
11471
|
...t,
|
|
11324
11472
|
[e]: 0
|
|
@@ -11343,7 +11491,7 @@ var yr = (e) => {
|
|
|
11343
11491
|
}
|
|
11344
11492
|
}
|
|
11345
11493
|
}, ee = (e) => {
|
|
11346
|
-
let t = s * 1024 * 1024, n = e.filter((e) => e.size <= t &&
|
|
11494
|
+
let t = s * 1024 * 1024, n = e.filter((e) => e.size <= t && pl(e, a)), r = e.length - n.length;
|
|
11347
11495
|
if (A(r > 0 ? `${r} archivo(s) no cumplen tipo o tamaño máximo.` : null), o) {
|
|
11348
11496
|
let e = [...I, ...n];
|
|
11349
11497
|
S.field.onChange(e), p?.(e), L(n);
|
|
@@ -11397,7 +11545,7 @@ var yr = (e) => {
|
|
|
11397
11545
|
className: (0, X.default)("sf-file-drop", C && "sf-file-drop--dragging", !P && "sf-file-drop--interactive", P && "sf-file-drop--disabled", d ? "sf-file-drop--sm" : "sf-file-drop--md", N && "sf-file-drop--error"),
|
|
11398
11546
|
children: [/* @__PURE__ */ v("span", {
|
|
11399
11547
|
className: "sf-file-drop__title",
|
|
11400
|
-
children: C ? "Suelta aquí" : c ??
|
|
11548
|
+
children: C ? "Suelta aquí" : c ?? bl(I)
|
|
11401
11549
|
}), /* @__PURE__ */ y("span", {
|
|
11402
11550
|
className: "sf-file-drop__hint",
|
|
11403
11551
|
children: [
|
|
@@ -11412,7 +11560,7 @@ var yr = (e) => {
|
|
|
11412
11560
|
className: "sf-file-list",
|
|
11413
11561
|
"aria-label": "Archivos seleccionados",
|
|
11414
11562
|
children: I.map((e) => {
|
|
11415
|
-
let t =
|
|
11563
|
+
let t = xl(e), n = T[t], r = D.has(t);
|
|
11416
11564
|
return /* @__PURE__ */ y("li", {
|
|
11417
11565
|
className: "sf-file-list__item",
|
|
11418
11566
|
children: [/* @__PURE__ */ y("span", {
|
|
@@ -11441,7 +11589,7 @@ var yr = (e) => {
|
|
|
11441
11589
|
]
|
|
11442
11590
|
})
|
|
11443
11591
|
});
|
|
11444
|
-
},
|
|
11592
|
+
}, Cl = ({ form: e, name: t, label: n, info: r, required: i, capture: a, maxSizeMb: o = 5, readOnly: c, disabled: l, small: d, className: f, onChange: g, onRefresh: _ }) => {
|
|
11445
11593
|
let x = m(null), S = b({
|
|
11446
11594
|
name: t,
|
|
11447
11595
|
control: e.control
|
|
@@ -11531,7 +11679,7 @@ var yr = (e) => {
|
|
|
11531
11679
|
]
|
|
11532
11680
|
})
|
|
11533
11681
|
});
|
|
11534
|
-
},
|
|
11682
|
+
}, wl = ({ form: e, name: t, label: n, info: r, required: i, width: a = 400, height: o = 160, readOnly: c, disabled: l, className: d, onChange: f, onRefresh: p }) => {
|
|
11535
11683
|
let g = m(null), _ = m(!1), x = m(null), S = m(void 0), C = b({
|
|
11536
11684
|
name: t,
|
|
11537
11685
|
control: e.control
|
|
@@ -11623,11 +11771,11 @@ var yr = (e) => {
|
|
|
11623
11771
|
})]
|
|
11624
11772
|
})
|
|
11625
11773
|
});
|
|
11626
|
-
},
|
|
11774
|
+
}, Tl = ({ form: e, name: t, label: n, info: r, required: i, max: a = 10, maxSizeMb: o = 5, camera: c = !1, readOnly: l, disabled: d, small: f, className: g, onChange: _, onRefresh: x }) => {
|
|
11627
11775
|
let S = m(null), C = b({
|
|
11628
11776
|
name: t,
|
|
11629
11777
|
control: e.control
|
|
11630
|
-
}), w = String(t), T = C.fieldState.error?.message ? String(C.fieldState.error.message) : void 0, [E, D] = h(null), O = T ?? E ?? void 0, k = l || d, A = p(() =>
|
|
11778
|
+
}), w = String(t), T = C.fieldState.error?.message ? String(C.fieldState.error.message) : void 0, [E, D] = h(null), O = T ?? E ?? void 0, k = l || d, A = p(() => vl(C.field.value), [C.field.value]), j = p(() => !k && A.length < a, [
|
|
11631
11779
|
k,
|
|
11632
11780
|
a,
|
|
11633
11781
|
A.length
|
|
@@ -11635,7 +11783,7 @@ var yr = (e) => {
|
|
|
11635
11783
|
u(() => {
|
|
11636
11784
|
N.current = A;
|
|
11637
11785
|
}, [A]), u(() => () => {
|
|
11638
|
-
for (let e of N.current)
|
|
11786
|
+
for (let e of N.current) gl(e);
|
|
11639
11787
|
}, []);
|
|
11640
11788
|
let P = s((e) => {
|
|
11641
11789
|
C.field.onChange(e), _?.(e);
|
|
@@ -11650,7 +11798,7 @@ var yr = (e) => {
|
|
|
11650
11798
|
D(`Hay imágenes que superan ${o} MB.`);
|
|
11651
11799
|
return;
|
|
11652
11800
|
}
|
|
11653
|
-
let r = a - A.length, i = n.slice(0, r).map((e) =>
|
|
11801
|
+
let r = a - A.length, i = n.slice(0, r).map((e) => hl(e));
|
|
11654
11802
|
if (n.length > r) {
|
|
11655
11803
|
D(`Solo puedes agregar ${r} imagen(es) más.`);
|
|
11656
11804
|
return;
|
|
@@ -11663,7 +11811,7 @@ var yr = (e) => {
|
|
|
11663
11811
|
A
|
|
11664
11812
|
]), I = s((e) => {
|
|
11665
11813
|
let t = A.find((t) => t.id === e);
|
|
11666
|
-
t &&
|
|
11814
|
+
t && gl(t), P(A.filter((t) => t.id !== e));
|
|
11667
11815
|
}, [P, A]);
|
|
11668
11816
|
return /* @__PURE__ */ v(Z, {
|
|
11669
11817
|
id: w,
|
|
@@ -11735,19 +11883,19 @@ var yr = (e) => {
|
|
|
11735
11883
|
]
|
|
11736
11884
|
})
|
|
11737
11885
|
});
|
|
11738
|
-
},
|
|
11886
|
+
}, El = (e) => {
|
|
11739
11887
|
switch (e.kind) {
|
|
11740
|
-
case "photo": return /* @__PURE__ */ v(
|
|
11741
|
-
case "multiPhoto": return /* @__PURE__ */ v(
|
|
11742
|
-
case "signature": return /* @__PURE__ */ v(
|
|
11888
|
+
case "photo": return /* @__PURE__ */ v(Cl, { ...e });
|
|
11889
|
+
case "multiPhoto": return /* @__PURE__ */ v(Tl, { ...e });
|
|
11890
|
+
case "signature": return /* @__PURE__ */ v(wl, { ...e });
|
|
11743
11891
|
case "file": return /* @__PURE__ */ v(Rn, { ...e });
|
|
11744
11892
|
default: return null;
|
|
11745
11893
|
}
|
|
11746
|
-
},
|
|
11894
|
+
}, Dl = (e) => new Promise((t, n) => {
|
|
11747
11895
|
let r = new Image();
|
|
11748
11896
|
r.addEventListener("load", () => t(r)), r.addEventListener("error", () => n(/* @__PURE__ */ Error("No se pudo cargar la imagen"))), r.setAttribute("crossOrigin", "anonymous"), r.src = e;
|
|
11749
|
-
}),
|
|
11750
|
-
let i = await
|
|
11897
|
+
}), Ol = async (e, t, n, r = "image/jpeg") => {
|
|
11898
|
+
let i = await Dl(e), a = document.createElement("canvas");
|
|
11751
11899
|
a.width = t.width, a.height = t.height;
|
|
11752
11900
|
let o = a.getContext("2d");
|
|
11753
11901
|
if (!o) throw Error("Canvas no disponible");
|
|
@@ -11760,7 +11908,7 @@ var yr = (e) => {
|
|
|
11760
11908
|
e(new File([i], n, { type: r }));
|
|
11761
11909
|
}, r, .92);
|
|
11762
11910
|
});
|
|
11763
|
-
},
|
|
11911
|
+
}, kl = ({ imageUrl: e, fileName: t, aspect: n = 1, onCancel: r, onConfirm: i, className: a }) => {
|
|
11764
11912
|
let [o, c] = h({
|
|
11765
11913
|
x: 0,
|
|
11766
11914
|
y: 0
|
|
@@ -11771,7 +11919,7 @@ var yr = (e) => {
|
|
|
11771
11919
|
m(!0);
|
|
11772
11920
|
try {
|
|
11773
11921
|
let n = t.toLowerCase().endsWith(".png") ? "image/png" : "image/jpeg";
|
|
11774
|
-
i(await
|
|
11922
|
+
i(await Ol(e, d, t, n));
|
|
11775
11923
|
} finally {
|
|
11776
11924
|
m(!1);
|
|
11777
11925
|
}
|
|
@@ -11822,7 +11970,7 @@ var yr = (e) => {
|
|
|
11822
11970
|
})
|
|
11823
11971
|
]
|
|
11824
11972
|
});
|
|
11825
|
-
},
|
|
11973
|
+
}, Al = ({ form: e, name: t, label: n, info: r, required: i, maxSizeMb: a = 5, interactive: o = !0, aspect: c = 1, readOnly: l, disabled: d, small: f, className: g, onChange: _, onRefresh: x }) => {
|
|
11826
11974
|
let S = m(null), C = b({
|
|
11827
11975
|
name: t,
|
|
11828
11976
|
control: e.control
|
|
@@ -11851,7 +11999,7 @@ var yr = (e) => {
|
|
|
11851
11999
|
}
|
|
11852
12000
|
T(!0);
|
|
11853
12001
|
try {
|
|
11854
|
-
let t = await
|
|
12002
|
+
let t = await yl(e);
|
|
11855
12003
|
I(t);
|
|
11856
12004
|
} finally {
|
|
11857
12005
|
T(!1);
|
|
@@ -11943,7 +12091,7 @@ var yr = (e) => {
|
|
|
11943
12091
|
role: "dialog",
|
|
11944
12092
|
"aria-modal": "true",
|
|
11945
12093
|
"aria-label": "Editor de recorte",
|
|
11946
|
-
children: /* @__PURE__ */ v(
|
|
12094
|
+
children: /* @__PURE__ */ v(kl, {
|
|
11947
12095
|
imageUrl: E.url,
|
|
11948
12096
|
fileName: E.fileName,
|
|
11949
12097
|
aspect: c,
|
|
@@ -11955,7 +12103,7 @@ var yr = (e) => {
|
|
|
11955
12103
|
})]
|
|
11956
12104
|
})]
|
|
11957
12105
|
});
|
|
11958
|
-
},
|
|
12106
|
+
}, jl = () => [], Ml = ({ title: e, description: t, className: n, children: r }) => /* @__PURE__ */ y("section", {
|
|
11959
12107
|
className: (0, X.default)("sf-neutral-map-frame", n),
|
|
11960
12108
|
children: [(e || t) && /* @__PURE__ */ y("div", {
|
|
11961
12109
|
className: "sf-neutral-map-frame__header",
|
|
@@ -11967,11 +12115,11 @@ var yr = (e) => {
|
|
|
11967
12115
|
children: t
|
|
11968
12116
|
})]
|
|
11969
12117
|
}), r]
|
|
11970
|
-
}),
|
|
12118
|
+
}), Nl = ({ tone: e = "info", children: t }) => /* @__PURE__ */ v("p", {
|
|
11971
12119
|
className: (0, X.default)("sf-neutral-map-status", `sf-neutral-map-status--${e}`),
|
|
11972
12120
|
role: e === "error" ? "alert" : "status",
|
|
11973
12121
|
children: t
|
|
11974
|
-
}),
|
|
12122
|
+
}), Pl = ({ items: e, className: t }) => /* @__PURE__ */ v("div", {
|
|
11975
12123
|
className: (0, X.default)("sf-map-legend", t),
|
|
11976
12124
|
role: "list",
|
|
11977
12125
|
"aria-label": "Leyenda del mapa",
|
|
@@ -11998,7 +12146,7 @@ var yr = (e) => {
|
|
|
11998
12146
|
})
|
|
11999
12147
|
]
|
|
12000
12148
|
}, t))
|
|
12001
|
-
}),
|
|
12149
|
+
}), Fl = ({ mapType: e, onMapTypeChange: t, onFullscreen: n, onLayers: r, className: i }) => /* @__PURE__ */ y("div", {
|
|
12002
12150
|
className: (0, X.default)("sf-map-toolbar", i),
|
|
12003
12151
|
children: [
|
|
12004
12152
|
/* @__PURE__ */ y("div", {
|
|
@@ -12036,7 +12184,7 @@ var yr = (e) => {
|
|
|
12036
12184
|
children: /* @__PURE__ */ v(ot, { "aria-hidden": "true" })
|
|
12037
12185
|
})
|
|
12038
12186
|
]
|
|
12039
|
-
}),
|
|
12187
|
+
}), Il = ({ title: e, subtitle: t, statusLabel: n, statusColor: r, speedKmh: i, onClick: a, className: o }) => /* @__PURE__ */ y("div", {
|
|
12040
12188
|
className: (0, X.default)("sf-map-vehicle-popup", a && "sf-map-vehicle-popup--interactive", o),
|
|
12041
12189
|
onClick: a,
|
|
12042
12190
|
onKeyDown: (e) => {
|
|
@@ -12076,59 +12224,59 @@ var yr = (e) => {
|
|
|
12076
12224
|
]
|
|
12077
12225
|
})
|
|
12078
12226
|
]
|
|
12079
|
-
}),
|
|
12227
|
+
}), Ll = "Maps config not found. Wrap your app with <SfProvider maps={...}>.", Rl = {
|
|
12080
12228
|
lat: -12.0464,
|
|
12081
12229
|
lng: -77.0428
|
|
12082
|
-
},
|
|
12230
|
+
}, zl = 13, Bl = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", Vl = "© <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" rel=\"noreferrer\">OpenStreetMap</a>", Hl = {
|
|
12083
12231
|
drawing: "basic",
|
|
12084
12232
|
streetView: "none",
|
|
12085
12233
|
clustering: "none",
|
|
12086
12234
|
heatmap: "none"
|
|
12087
|
-
},
|
|
12235
|
+
}, Ul = {
|
|
12088
12236
|
drawing: "basic",
|
|
12089
12237
|
streetView: "interactive",
|
|
12090
12238
|
clustering: "client",
|
|
12091
12239
|
heatmap: "weighted"
|
|
12092
|
-
},
|
|
12240
|
+
}, Wl = "sf-google-maps-script", Gl = ({ apiKey: e, language: t = "es", region: n = "PE", libraries: r = [] }) => {
|
|
12093
12241
|
let i = new URLSearchParams({
|
|
12094
12242
|
key: e,
|
|
12095
12243
|
language: t,
|
|
12096
12244
|
region: n
|
|
12097
12245
|
});
|
|
12098
12246
|
return r.length > 0 && i.set("libraries", r.join(",")), `https://maps.googleapis.com/maps/api/js?${i.toString()}`;
|
|
12099
|
-
},
|
|
12247
|
+
}, Kl = (e) => {
|
|
12100
12248
|
let t = window;
|
|
12101
12249
|
return t.google?.maps ? Promise.resolve(t.google) : (t.__sfGoogleMapsPromise ||= new Promise((n, r) => {
|
|
12102
|
-
let i = document.getElementById(
|
|
12250
|
+
let i = document.getElementById(Wl);
|
|
12103
12251
|
if (i) {
|
|
12104
12252
|
i.addEventListener("load", () => n(t.google ?? {})), i.addEventListener("error", () => r(/* @__PURE__ */ Error("No se pudo cargar Google Maps.")));
|
|
12105
12253
|
return;
|
|
12106
12254
|
}
|
|
12107
12255
|
let a = document.createElement("script");
|
|
12108
|
-
a.id =
|
|
12256
|
+
a.id = Wl, a.src = Gl(e), a.async = !0, a.defer = !0, a.addEventListener("load", () => n(t.google ?? {})), a.addEventListener("error", () => r(/* @__PURE__ */ Error("No se pudo cargar Google Maps."))), document.head.appendChild(a);
|
|
12109
12257
|
}), t.__sfGoogleMapsPromise);
|
|
12110
|
-
},
|
|
12258
|
+
}, ql = (e, t = "") => {
|
|
12111
12259
|
let n = e.match(/^var\((--[^,)]+)\)$/);
|
|
12112
12260
|
return !n || typeof document > "u" ? t || e : getComputedStyle(document.documentElement).getPropertyValue(n[1]).trim() || t || e;
|
|
12113
|
-
},
|
|
12261
|
+
}, Jl = (e, t) => ({
|
|
12114
12262
|
map: t,
|
|
12115
12263
|
paths: e.points,
|
|
12116
|
-
strokeColor: e.color ??
|
|
12117
|
-
fillColor: e.fillColor ?? e.color ??
|
|
12264
|
+
strokeColor: e.color ?? ql("var(--sf-map-area-stroke)"),
|
|
12265
|
+
fillColor: e.fillColor ?? e.color ?? ql("var(--sf-map-area-fill)"),
|
|
12118
12266
|
fillOpacity: .14,
|
|
12119
12267
|
strokeWeight: 2.5
|
|
12120
|
-
}),
|
|
12268
|
+
}), Yl = (e, t) => ({
|
|
12121
12269
|
map: t,
|
|
12122
12270
|
path: e.points,
|
|
12123
|
-
strokeColor: e.color ??
|
|
12271
|
+
strokeColor: e.color ?? ql("var(--sf-map-route-stroke)"),
|
|
12124
12272
|
strokeWeight: 3.5
|
|
12125
|
-
}),
|
|
12273
|
+
}), Xl = (e, t, n) => ({
|
|
12126
12274
|
map: t,
|
|
12127
12275
|
position: e.position,
|
|
12128
12276
|
title: e.title ?? e.label,
|
|
12129
12277
|
label: e.label ? e.label.slice(0, 1).toUpperCase() : void 0,
|
|
12130
12278
|
draggable: !n && e.options?.draggable
|
|
12131
|
-
}),
|
|
12279
|
+
}), Zl = ({ config: e, center: t = Rl, zoom: n = 13, markers: r = [], routes: i = [], areas: a = [], height: o = 320, className: s, readOnly: c, onClick: l, onMarkerClick: d, onMarkerDoubleClick: f, onMarkerDrag: p, onMarkerDragEnd: g }) => {
|
|
12132
12280
|
let _ = m(null), y = m(null), b = m(/* @__PURE__ */ new Map()), x = m(/* @__PURE__ */ new Map()), S = m(/* @__PURE__ */ new Map()), C = m({
|
|
12133
12281
|
onMarkerClick: d,
|
|
12134
12282
|
onMarkerDoubleClick: f,
|
|
@@ -12161,9 +12309,9 @@ var yr = (e) => {
|
|
|
12161
12309
|
return;
|
|
12162
12310
|
}
|
|
12163
12311
|
let t = !1;
|
|
12164
|
-
return D("loading"),
|
|
12312
|
+
return D("loading"), Kl(e).then((n) => {
|
|
12165
12313
|
t || !_.current || !n.maps?.Map || (y.current = new n.maps.Map(_.current, {
|
|
12166
|
-
center:
|
|
12314
|
+
center: Rl,
|
|
12167
12315
|
zoom: 13,
|
|
12168
12316
|
mapId: e.mapId,
|
|
12169
12317
|
disableDefaultUI: c
|
|
@@ -12182,7 +12330,7 @@ var yr = (e) => {
|
|
|
12182
12330
|
}, []), u(() => {
|
|
12183
12331
|
if (E !== "ready" || !e?.apiKey || !y.current) return;
|
|
12184
12332
|
let t = !1;
|
|
12185
|
-
return
|
|
12333
|
+
return Kl(e).then((e) => {
|
|
12186
12334
|
if (t || !e.maps?.Marker) return;
|
|
12187
12335
|
let n = new Set(r.map((e) => e.id));
|
|
12188
12336
|
b.current.forEach((e, t) => {
|
|
@@ -12191,10 +12339,10 @@ var yr = (e) => {
|
|
|
12191
12339
|
x.current.set(t.id, t);
|
|
12192
12340
|
let n = b.current.get(t.id);
|
|
12193
12341
|
if (n) {
|
|
12194
|
-
n.marker.setPosition?.(t.position), n.marker.setOptions?.(
|
|
12342
|
+
n.marker.setPosition?.(t.position), n.marker.setOptions?.(Xl(t, y.current, c));
|
|
12195
12343
|
return;
|
|
12196
12344
|
}
|
|
12197
|
-
let r = new e.maps.Marker(
|
|
12345
|
+
let r = new e.maps.Marker(Xl(t, y.current, c)), i = () => x.current.get(t.id) ?? t, a = [
|
|
12198
12346
|
r.addListener?.("click", () => {
|
|
12199
12347
|
C.current.onMarkerClick?.({ marker: i() });
|
|
12200
12348
|
}),
|
|
@@ -12238,7 +12386,7 @@ var yr = (e) => {
|
|
|
12238
12386
|
]), u(() => {
|
|
12239
12387
|
if (E !== "ready" || !e?.apiKey || !y.current) return;
|
|
12240
12388
|
let t = !1;
|
|
12241
|
-
return
|
|
12389
|
+
return Kl(e).then((e) => {
|
|
12242
12390
|
if (t || !e.maps?.Polyline || !e.maps.Polygon) return;
|
|
12243
12391
|
let n = /* @__PURE__ */ new Set([...a.map((e) => `area:${e.id}`), ...i.map((e) => `route:${e.id}`)]);
|
|
12244
12392
|
S.current.forEach((e, t) => {
|
|
@@ -12246,22 +12394,22 @@ var yr = (e) => {
|
|
|
12246
12394
|
}), a.forEach((t) => {
|
|
12247
12395
|
let n = `area:${t.id}`, r = S.current.get(n);
|
|
12248
12396
|
if (r?.kind === "area") {
|
|
12249
|
-
r.shape.setPaths?.(t.points), r.shape.setOptions?.(
|
|
12397
|
+
r.shape.setPaths?.(t.points), r.shape.setOptions?.(Jl(t, y.current));
|
|
12250
12398
|
return;
|
|
12251
12399
|
}
|
|
12252
12400
|
r?.shape.setMap?.(null), S.current.set(n, {
|
|
12253
12401
|
kind: "area",
|
|
12254
|
-
shape: new e.maps.Polygon(
|
|
12402
|
+
shape: new e.maps.Polygon(Jl(t, y.current))
|
|
12255
12403
|
});
|
|
12256
12404
|
}), i.forEach((t) => {
|
|
12257
12405
|
let n = `route:${t.id}`, r = S.current.get(n);
|
|
12258
12406
|
if (r?.kind === "route") {
|
|
12259
|
-
r.shape.setPath?.(t.points), r.shape.setOptions?.(
|
|
12407
|
+
r.shape.setPath?.(t.points), r.shape.setOptions?.(Yl(t, y.current));
|
|
12260
12408
|
return;
|
|
12261
12409
|
}
|
|
12262
12410
|
r?.shape.setMap?.(null), S.current.set(n, {
|
|
12263
12411
|
kind: "route",
|
|
12264
|
-
shape: new e.maps.Polyline(
|
|
12412
|
+
shape: new e.maps.Polyline(Yl(t, y.current))
|
|
12265
12413
|
});
|
|
12266
12414
|
});
|
|
12267
12415
|
}), () => {
|
|
@@ -12275,7 +12423,7 @@ var yr = (e) => {
|
|
|
12275
12423
|
]), u(() => {
|
|
12276
12424
|
if (E !== "ready" || !e?.apiKey || !y.current || !l || c) return;
|
|
12277
12425
|
let t = !1, n;
|
|
12278
|
-
return
|
|
12426
|
+
return Kl(e).then(() => {
|
|
12279
12427
|
let e = y.current;
|
|
12280
12428
|
t || !e?.addListener || (n = e.addListener("click", (e) => {
|
|
12281
12429
|
e.latLng && l({ location: {
|
|
@@ -12304,25 +12452,25 @@ var yr = (e) => {
|
|
|
12304
12452
|
"aria-busy": E !== "ready" || void 0
|
|
12305
12453
|
})
|
|
12306
12454
|
});
|
|
12307
|
-
},
|
|
12455
|
+
}, Ql = (e) => ({
|
|
12308
12456
|
id: "google",
|
|
12309
|
-
capabilities:
|
|
12310
|
-
createRenderer: () => (t) => /* @__PURE__ */ v(
|
|
12457
|
+
capabilities: Ul,
|
|
12458
|
+
createRenderer: () => (t) => /* @__PURE__ */ v(Zl, {
|
|
12311
12459
|
...t,
|
|
12312
12460
|
config: e
|
|
12313
12461
|
})
|
|
12314
|
-
}),
|
|
12462
|
+
}), $l = (e) => [e.lat, e.lng], eu = (e) => ie.divIcon({
|
|
12315
12463
|
className: "",
|
|
12316
12464
|
html: `<div class="sf-neutral-map-marker" style="${e ? `--sf-neutral-map-marker-bg:${e};` : ""}"></div>`,
|
|
12317
12465
|
iconSize: [18, 18],
|
|
12318
12466
|
iconAnchor: [9, 9]
|
|
12319
|
-
}),
|
|
12467
|
+
}), tu = ({ readOnly: e, onClick: t }) => (re({ click(n) {
|
|
12320
12468
|
e || t?.({ location: {
|
|
12321
12469
|
lat: n.latlng.lat,
|
|
12322
12470
|
lng: n.latlng.lng
|
|
12323
12471
|
} });
|
|
12324
|
-
} }), null),
|
|
12325
|
-
let g = To(), _ = p(() =>
|
|
12472
|
+
} }), null), nu = ({ center: e = Rl, zoom: t = 13, markers: n = [], routes: r = [], areas: i = [], height: a = 320, className: o, readOnly: s, tileUrl: c = Bl, attribution: l = Vl, onClick: u, onMarkerClick: d, onMarkerDoubleClick: f, onMarkerDrag: m, onMarkerDragEnd: h }) => {
|
|
12473
|
+
let g = To(), _ = p(() => $l(e), [e]), b = typeof a == "number" ? { height: `${a}px` } : { height: a };
|
|
12326
12474
|
return g ? /* @__PURE__ */ v("div", {
|
|
12327
12475
|
className: o,
|
|
12328
12476
|
style: b,
|
|
@@ -12337,29 +12485,29 @@ var yr = (e) => {
|
|
|
12337
12485
|
attribution: l,
|
|
12338
12486
|
url: c
|
|
12339
12487
|
}),
|
|
12340
|
-
/* @__PURE__ */ v(
|
|
12488
|
+
/* @__PURE__ */ v(tu, {
|
|
12341
12489
|
readOnly: s,
|
|
12342
12490
|
onClick: u
|
|
12343
12491
|
}),
|
|
12344
12492
|
i.map((e) => /* @__PURE__ */ v(ne, {
|
|
12345
|
-
positions: e.points.map(
|
|
12493
|
+
positions: e.points.map($l),
|
|
12346
12494
|
pathOptions: {
|
|
12347
|
-
color: e.color ??
|
|
12348
|
-
fillColor: e.fillColor ?? e.color ??
|
|
12495
|
+
color: e.color ?? ql("var(--sf-map-area-stroke)"),
|
|
12496
|
+
fillColor: e.fillColor ?? e.color ?? ql("var(--sf-map-area-fill)"),
|
|
12349
12497
|
fillOpacity: .14,
|
|
12350
12498
|
weight: 2.5
|
|
12351
12499
|
}
|
|
12352
12500
|
}, e.id)),
|
|
12353
12501
|
r.map((e) => /* @__PURE__ */ v(V, {
|
|
12354
|
-
positions: e.points.map(
|
|
12502
|
+
positions: e.points.map($l),
|
|
12355
12503
|
pathOptions: {
|
|
12356
|
-
color: e.color ??
|
|
12504
|
+
color: e.color ?? ql("var(--sf-map-route-stroke)"),
|
|
12357
12505
|
weight: 3.5
|
|
12358
12506
|
}
|
|
12359
12507
|
}, e.id)),
|
|
12360
12508
|
n.map((e) => /* @__PURE__ */ v(te, {
|
|
12361
|
-
position:
|
|
12362
|
-
icon:
|
|
12509
|
+
position: $l(e.position),
|
|
12510
|
+
icon: eu(e.color),
|
|
12363
12511
|
title: e.title ?? e.label,
|
|
12364
12512
|
draggable: !s && e.options?.draggable,
|
|
12365
12513
|
bubblingMouseEvents: !1,
|
|
@@ -12396,18 +12544,18 @@ var yr = (e) => {
|
|
|
12396
12544
|
style: b,
|
|
12397
12545
|
children: "Cargando mapa…"
|
|
12398
12546
|
});
|
|
12399
|
-
},
|
|
12547
|
+
}, ru = (e) => ({
|
|
12400
12548
|
id: "leaflet",
|
|
12401
|
-
capabilities:
|
|
12402
|
-
createRenderer: () => (t) => /* @__PURE__ */ v(
|
|
12549
|
+
capabilities: Hl,
|
|
12550
|
+
createRenderer: () => (t) => /* @__PURE__ */ v(nu, {
|
|
12403
12551
|
...t,
|
|
12404
12552
|
tileUrl: e?.tileUrl,
|
|
12405
12553
|
attribution: e?.attribution
|
|
12406
12554
|
})
|
|
12407
|
-
}),
|
|
12408
|
-
let n =
|
|
12409
|
-
return 2 *
|
|
12410
|
-
},
|
|
12555
|
+
}), iu = 6371e3, au = (e) => e * Math.PI / 180, ou = (e, t) => {
|
|
12556
|
+
let n = au(t.lat - e.lat), r = au(t.lng - e.lng), i = au(e.lat), a = au(t.lat), o = Math.sin(n / 2) ** 2 + Math.sin(r / 2) ** 2 * Math.cos(i) * Math.cos(a);
|
|
12557
|
+
return 2 * iu * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o));
|
|
12558
|
+
}, su = () => ({
|
|
12411
12559
|
id: "basic",
|
|
12412
12560
|
capabilities: {
|
|
12413
12561
|
distance: "point-to-point",
|
|
@@ -12415,12 +12563,12 @@ var yr = (e) => {
|
|
|
12415
12563
|
},
|
|
12416
12564
|
async calculateDistance(e) {
|
|
12417
12565
|
let t = e.origins[0], n = e.destinations[0];
|
|
12418
|
-
return { distanceMeters: t && n ?
|
|
12566
|
+
return { distanceMeters: t && n ? ou(t, n) : 0 };
|
|
12419
12567
|
}
|
|
12420
|
-
}),
|
|
12568
|
+
}), cu = (e) => ({
|
|
12421
12569
|
lat: e.lat(),
|
|
12422
12570
|
lng: e.lng()
|
|
12423
|
-
}),
|
|
12571
|
+
}), lu = (e) => {
|
|
12424
12572
|
let t = e.geometry?.location;
|
|
12425
12573
|
if (!t) return null;
|
|
12426
12574
|
let n = e.formatted_address ?? e.place_id ?? "Ubicación Google Maps";
|
|
@@ -12428,45 +12576,45 @@ var yr = (e) => {
|
|
|
12428
12576
|
id: e.place_id ?? n,
|
|
12429
12577
|
label: n,
|
|
12430
12578
|
address: e.formatted_address,
|
|
12431
|
-
location:
|
|
12579
|
+
location: cu(t),
|
|
12432
12580
|
provider: "google",
|
|
12433
12581
|
raw: e
|
|
12434
12582
|
};
|
|
12435
|
-
},
|
|
12583
|
+
}, uu = (e) => ({
|
|
12436
12584
|
id: "google",
|
|
12437
12585
|
capabilities: { geocoding: "full" },
|
|
12438
12586
|
async geocode(t) {
|
|
12439
|
-
let n = (await
|
|
12587
|
+
let n = (await Kl(e)).maps?.Geocoder;
|
|
12440
12588
|
return n ? new Promise((e) => {
|
|
12441
12589
|
new n().geocode({ address: t }, (t) => {
|
|
12442
|
-
e((t ?? []).map((e) =>
|
|
12590
|
+
e((t ?? []).map((e) => lu(e)).filter((e) => !!e));
|
|
12443
12591
|
});
|
|
12444
12592
|
}) : [];
|
|
12445
12593
|
},
|
|
12446
12594
|
async reverseGeocode(t) {
|
|
12447
|
-
let n = (await
|
|
12595
|
+
let n = (await Kl(e)).maps?.Geocoder;
|
|
12448
12596
|
return n ? new Promise((e) => {
|
|
12449
12597
|
new n().geocode({ location: t }, (t) => {
|
|
12450
|
-
e(
|
|
12598
|
+
e(lu(t?.[0] ?? {}));
|
|
12451
12599
|
});
|
|
12452
12600
|
}) : null;
|
|
12453
12601
|
}
|
|
12454
|
-
}),
|
|
12602
|
+
}), du = (e) => e.toFixed(6), fu = (e, t, n) => Math.min(Math.max(e, t), n), pu = (e) => fu(e, -90, 90), mu = (e) => fu(e, -180, 180), hu = (e, t = 0) => {
|
|
12455
12603
|
if (typeof e == "number") return Number.isFinite(e) ? e : t;
|
|
12456
12604
|
let n = Number.parseFloat(e.trim().replace(",", "."));
|
|
12457
12605
|
return Number.isFinite(n) ? n : t;
|
|
12458
|
-
},
|
|
12606
|
+
}, gu = (e) => `${du(e.lat)}, ${du(e.lng)}`, _u = (e, t) => {
|
|
12459
12607
|
if (!e || typeof e != "object" || !("lat" in e) || !("lng" in e)) return t;
|
|
12460
|
-
let n =
|
|
12608
|
+
let n = hu(e.lat, t.lat), r = hu(e.lng, t.lng);
|
|
12461
12609
|
return {
|
|
12462
|
-
lat:
|
|
12463
|
-
lng:
|
|
12610
|
+
lat: pu(n),
|
|
12611
|
+
lng: mu(r)
|
|
12464
12612
|
};
|
|
12465
|
-
},
|
|
12613
|
+
}, vu = (e, t = "Ubicación") => ({
|
|
12466
12614
|
id: `${e.lat}:${e.lng}`,
|
|
12467
12615
|
position: e,
|
|
12468
12616
|
label: t
|
|
12469
|
-
}),
|
|
12617
|
+
}), yu = () => ({
|
|
12470
12618
|
id: "nominatim",
|
|
12471
12619
|
capabilities: { geocoding: "basic" },
|
|
12472
12620
|
async geocode(e) {
|
|
@@ -12490,13 +12638,13 @@ var yr = (e) => {
|
|
|
12490
12638
|
provider: "nominatim"
|
|
12491
12639
|
};
|
|
12492
12640
|
}
|
|
12493
|
-
}),
|
|
12641
|
+
}), bu = (e) => ({
|
|
12494
12642
|
id: e.id,
|
|
12495
12643
|
capabilities: { places: e.capabilities.geocoding === "none" ? "none" : "basic" },
|
|
12496
12644
|
searchPlaces(t) {
|
|
12497
12645
|
return e.geocode(t);
|
|
12498
12646
|
}
|
|
12499
|
-
}),
|
|
12647
|
+
}), xu = () => ({
|
|
12500
12648
|
id: "basic",
|
|
12501
12649
|
capabilities: {
|
|
12502
12650
|
routing: "basic",
|
|
@@ -12514,31 +12662,31 @@ var yr = (e) => {
|
|
|
12514
12662
|
]
|
|
12515
12663
|
};
|
|
12516
12664
|
}
|
|
12517
|
-
}),
|
|
12665
|
+
}), Su = i({}), Cu = (e) => {
|
|
12518
12666
|
let t = e.services?.geocoding ?? e.defaultEngine, n = e.engines.google;
|
|
12519
|
-
return t === "google" && n ?
|
|
12520
|
-
},
|
|
12521
|
-
let t = e.defaultEngine === "google" ?
|
|
12667
|
+
return t === "google" && n ? uu(n) : yu();
|
|
12668
|
+
}, wu = (e) => {
|
|
12669
|
+
let t = e.defaultEngine === "google" ? Ql(e.engines.google) : ru(e.engines.leaflet), n = Cu(e);
|
|
12522
12670
|
return {
|
|
12523
12671
|
config: e,
|
|
12524
12672
|
engine: t,
|
|
12525
12673
|
geocodingService: n,
|
|
12526
|
-
placesService:
|
|
12527
|
-
routingService:
|
|
12528
|
-
distanceService:
|
|
12674
|
+
placesService: bu(n),
|
|
12675
|
+
routingService: xu(),
|
|
12676
|
+
distanceService: su()
|
|
12529
12677
|
};
|
|
12530
|
-
},
|
|
12531
|
-
let n = p(() => ({ maps: e ?
|
|
12532
|
-
return /* @__PURE__ */ v(
|
|
12678
|
+
}, Tu = ({ maps: e, children: t }) => {
|
|
12679
|
+
let n = p(() => ({ maps: e ? wu(e) : void 0 }), [e]);
|
|
12680
|
+
return /* @__PURE__ */ v(Su.Provider, {
|
|
12533
12681
|
value: n,
|
|
12534
12682
|
children: t
|
|
12535
12683
|
});
|
|
12536
|
-
},
|
|
12537
|
-
let e =
|
|
12538
|
-
if (!e.maps) throw Error(
|
|
12684
|
+
}, Eu = () => c(Su), Du = () => {
|
|
12685
|
+
let e = Eu();
|
|
12686
|
+
if (!e.maps) throw Error(Ll);
|
|
12539
12687
|
return e.maps;
|
|
12540
|
-
},
|
|
12541
|
-
let e =
|
|
12688
|
+
}, Ou = () => {
|
|
12689
|
+
let e = Du(), [t, n] = h(!1), [r, i] = h([]), [a, o] = h(null), c = m(0);
|
|
12542
12690
|
return {
|
|
12543
12691
|
loading: t,
|
|
12544
12692
|
results: r,
|
|
@@ -12562,18 +12710,18 @@ var yr = (e) => {
|
|
|
12562
12710
|
}
|
|
12563
12711
|
}, [e.geocodingService])
|
|
12564
12712
|
};
|
|
12565
|
-
},
|
|
12566
|
-
let e =
|
|
12713
|
+
}, ku = () => {
|
|
12714
|
+
let e = Du();
|
|
12567
12715
|
return p(() => ({
|
|
12568
12716
|
id: e.engine.id,
|
|
12569
12717
|
capabilities: e.engine.capabilities,
|
|
12570
12718
|
renderer: e.engine.createRenderer()
|
|
12571
12719
|
}), [e.engine]);
|
|
12572
|
-
},
|
|
12720
|
+
}, Au = () => Du().config, ju = (e) => e && typeof e == "object" && "label" in e ? String(e.label ?? "") : "", Mu = ({ form: e, name: t, label: n, info: r, required: i, placeholder: a = "Buscar dirección", readOnly: o, disabled: s, className: c, onChange: l, onRefresh: u }) => {
|
|
12573
12721
|
let d = b({
|
|
12574
12722
|
name: t,
|
|
12575
12723
|
control: e.control
|
|
12576
|
-
}), { loading: f, results: p, error: m, search: g } =
|
|
12724
|
+
}), { loading: f, results: p, error: m, search: g } = Ou(), [_, x] = h(() => ju(d.field.value)), S = String(t), C = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, w = o || s, T = (e) => {
|
|
12577
12725
|
d.field.onChange(e), l?.(e);
|
|
12578
12726
|
};
|
|
12579
12727
|
return /* @__PURE__ */ v(Z, {
|
|
@@ -12640,9 +12788,9 @@ var yr = (e) => {
|
|
|
12640
12788
|
]
|
|
12641
12789
|
})
|
|
12642
12790
|
});
|
|
12643
|
-
},
|
|
12644
|
-
let g =
|
|
12645
|
-
return /* @__PURE__ */ v(
|
|
12791
|
+
}, Nu = ({ title: e, description: t, center: n = Rl, zoom: r = 13, markers: i = [], routes: a = [], areas: o = [], height: s = 360, className: c, readOnly: l, onClick: u, onMarkerClick: d, onMarkerDoubleClick: f, onMarkerDrag: m, onMarkerDragEnd: h }) => {
|
|
12792
|
+
let g = ku(), _ = p(() => g.renderer, [g.renderer]);
|
|
12793
|
+
return /* @__PURE__ */ v(Ml, {
|
|
12646
12794
|
title: e,
|
|
12647
12795
|
description: t,
|
|
12648
12796
|
className: c,
|
|
@@ -12661,16 +12809,16 @@ var yr = (e) => {
|
|
|
12661
12809
|
onMarkerDragEnd: h
|
|
12662
12810
|
})
|
|
12663
12811
|
});
|
|
12664
|
-
},
|
|
12812
|
+
}, Pu = ({ form: e, name: t, label: n, info: r, required: i, zoom: a = 13, readOnly: o, disabled: s, className: c, onChange: l, onRefresh: u }) => {
|
|
12665
12813
|
let [d, f] = h(!1), [p, m] = h(null), g = b({
|
|
12666
12814
|
name: t,
|
|
12667
12815
|
control: e.control
|
|
12668
|
-
}), _ = String(t), x = g.fieldState.error?.message ? String(g.fieldState.error.message) : void 0, S = o || s, C =
|
|
12816
|
+
}), _ = String(t), x = g.fieldState.error?.message ? String(g.fieldState.error.message) : void 0, S = o || s, C = _u(g.field.value, Rl), w = (e) => {
|
|
12669
12817
|
g.field.onChange(e), l?.(e);
|
|
12670
12818
|
}, T = (e, t) => {
|
|
12671
12819
|
w({
|
|
12672
12820
|
...C,
|
|
12673
|
-
[e]:
|
|
12821
|
+
[e]: hu(t, C[e])
|
|
12674
12822
|
});
|
|
12675
12823
|
};
|
|
12676
12824
|
return /* @__PURE__ */ v(Z, {
|
|
@@ -12693,7 +12841,7 @@ var yr = (e) => {
|
|
|
12693
12841
|
id: `${_}-lat`,
|
|
12694
12842
|
type: "text",
|
|
12695
12843
|
inputMode: "decimal",
|
|
12696
|
-
value:
|
|
12844
|
+
value: du(C.lat),
|
|
12697
12845
|
readOnly: S,
|
|
12698
12846
|
disabled: s,
|
|
12699
12847
|
"aria-invalid": !!x || void 0,
|
|
@@ -12713,7 +12861,7 @@ var yr = (e) => {
|
|
|
12713
12861
|
id: `${_}-lng`,
|
|
12714
12862
|
type: "text",
|
|
12715
12863
|
inputMode: "decimal",
|
|
12716
|
-
value:
|
|
12864
|
+
value: du(C.lng),
|
|
12717
12865
|
readOnly: S,
|
|
12718
12866
|
disabled: s,
|
|
12719
12867
|
"aria-invalid": !!x || void 0,
|
|
@@ -12732,8 +12880,8 @@ var yr = (e) => {
|
|
|
12732
12880
|
onClick: () => {
|
|
12733
12881
|
!navigator.geolocation || d || S || (f(!0), m(null), navigator.geolocation.getCurrentPosition((e) => {
|
|
12734
12882
|
let t = {
|
|
12735
|
-
lat: Number(
|
|
12736
|
-
lng: Number(
|
|
12883
|
+
lat: Number(du(e.coords.latitude)),
|
|
12884
|
+
lng: Number(du(e.coords.longitude))
|
|
12737
12885
|
};
|
|
12738
12886
|
w(t), m(e.coords.accuracy > 200 ? `Precisión aproximada: ${Math.round(e.coords.accuracy)} m.` : null), f(!1);
|
|
12739
12887
|
}, () => {
|
|
@@ -12754,7 +12902,7 @@ var yr = (e) => {
|
|
|
12754
12902
|
role: "status",
|
|
12755
12903
|
children: p
|
|
12756
12904
|
}),
|
|
12757
|
-
/* @__PURE__ */ v(
|
|
12905
|
+
/* @__PURE__ */ v(Nu, {
|
|
12758
12906
|
center: C,
|
|
12759
12907
|
zoom: a,
|
|
12760
12908
|
height: 220,
|
|
@@ -12766,8 +12914,8 @@ var yr = (e) => {
|
|
|
12766
12914
|
}],
|
|
12767
12915
|
onClick: (e) => {
|
|
12768
12916
|
w({
|
|
12769
|
-
lat: Number(
|
|
12770
|
-
lng: Number(
|
|
12917
|
+
lat: Number(du(e.location.lat)),
|
|
12918
|
+
lng: Number(du(e.location.lng))
|
|
12771
12919
|
}), g.field.onBlur();
|
|
12772
12920
|
}
|
|
12773
12921
|
}),
|
|
@@ -12778,19 +12926,19 @@ var yr = (e) => {
|
|
|
12778
12926
|
]
|
|
12779
12927
|
})
|
|
12780
12928
|
});
|
|
12781
|
-
},
|
|
12929
|
+
}, Fu = (e) => /* @__PURE__ */ v(Pu, { ...e }), Iu = (e) => Array.isArray(e) ? e.map((e) => _u(e, Rl)) : [], Lu = (e) => e.length === 0 ? "Sin puntos" : e.length === 1 ? "1 punto" : `${e.length} puntos`, Ru = "var(--sf-map-area-stroke)", zu = "var(--sf-map-area-fill)", Bu = "var(--sf-map-route-stroke)", Vu = ({ form: e, name: t, mode: n, label: r, info: i, required: a = !0, zoom: o = 13, readOnly: s, disabled: c, className: l, onChange: u, onRefresh: d }) => {
|
|
12782
12930
|
let f = n === "area" ? 3 : 2, p = `Dibuja al menos ${f} puntos para ${n === "area" ? "un área" : "una ruta"}.`, m = b({
|
|
12783
12931
|
name: t,
|
|
12784
12932
|
control: e.control,
|
|
12785
12933
|
rules: { validate: (e) => {
|
|
12786
|
-
let t =
|
|
12934
|
+
let t = Iu(e).length;
|
|
12787
12935
|
return t === 0 && !a ? !0 : t < f ? p : !0;
|
|
12788
12936
|
} }
|
|
12789
|
-
}), h = String(t), g = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, _ = s || c, x =
|
|
12937
|
+
}), h = String(t), g = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, _ = s || c, x = Iu(m.field.value), S = x.at(-1) ?? Rl, C = {
|
|
12790
12938
|
id: `${h}-${n}`,
|
|
12791
12939
|
points: x,
|
|
12792
|
-
color: n === "area" ?
|
|
12793
|
-
fillColor: n === "area" ?
|
|
12940
|
+
color: n === "area" ? Ru : Bu,
|
|
12941
|
+
fillColor: n === "area" ? zu : void 0
|
|
12794
12942
|
}, w = (e) => {
|
|
12795
12943
|
m.field.onChange(e), u?.(e);
|
|
12796
12944
|
}, T = () => w(x.slice(0, -1)), E = () => w([]), D = (e, t, n) => e.map((e, r) => r === t ? n : e), O = (e) => {
|
|
@@ -12823,7 +12971,7 @@ var yr = (e) => {
|
|
|
12823
12971
|
children: "Limpiar"
|
|
12824
12972
|
})]
|
|
12825
12973
|
}),
|
|
12826
|
-
/* @__PURE__ */ v(
|
|
12974
|
+
/* @__PURE__ */ v(Nu, {
|
|
12827
12975
|
center: S,
|
|
12828
12976
|
zoom: o,
|
|
12829
12977
|
height: 260,
|
|
@@ -12832,7 +12980,7 @@ var yr = (e) => {
|
|
|
12832
12980
|
id: `${h}-point-${t}`,
|
|
12833
12981
|
position: e,
|
|
12834
12982
|
label: String(t + 1),
|
|
12835
|
-
color: n === "area" ?
|
|
12983
|
+
color: n === "area" ? Ru : Bu,
|
|
12836
12984
|
options: { draggable: !_ }
|
|
12837
12985
|
})),
|
|
12838
12986
|
areas: n === "area" && x.length >= 3 ? [C] : [],
|
|
@@ -12855,7 +13003,7 @@ var yr = (e) => {
|
|
|
12855
13003
|
className: "sf-map-hint",
|
|
12856
13004
|
"aria-live": "polite",
|
|
12857
13005
|
children: [
|
|
12858
|
-
|
|
13006
|
+
Lu(x),
|
|
12859
13007
|
" · Clic para añadir. Arrastra un punto para moverlo. Doble clic para eliminar.",
|
|
12860
13008
|
" ",
|
|
12861
13009
|
/* @__PURE__ */ v("span", {
|
|
@@ -12867,38 +13015,38 @@ var yr = (e) => {
|
|
|
12867
13015
|
]
|
|
12868
13016
|
})
|
|
12869
13017
|
});
|
|
12870
|
-
},
|
|
13018
|
+
}, Hu = (e) => /* @__PURE__ */ v(Vu, {
|
|
12871
13019
|
...e,
|
|
12872
13020
|
mode: "area"
|
|
12873
|
-
}),
|
|
13021
|
+
}), Uu = (e) => /* @__PURE__ */ v(Vu, {
|
|
12874
13022
|
...e,
|
|
12875
13023
|
mode: "route"
|
|
12876
|
-
}),
|
|
13024
|
+
}), Wu = (e) => {
|
|
12877
13025
|
switch (e.kind) {
|
|
12878
|
-
case "coordinates": return /* @__PURE__ */ v(
|
|
12879
|
-
case "location": return /* @__PURE__ */ v(
|
|
12880
|
-
case "address": return /* @__PURE__ */ v(
|
|
12881
|
-
case "area": return /* @__PURE__ */ v(
|
|
12882
|
-
case "route": return /* @__PURE__ */ v(
|
|
13026
|
+
case "coordinates": return /* @__PURE__ */ v(Fu, { ...e });
|
|
13027
|
+
case "location": return /* @__PURE__ */ v(Pu, { ...e });
|
|
13028
|
+
case "address": return /* @__PURE__ */ v(Mu, { ...e });
|
|
13029
|
+
case "area": return /* @__PURE__ */ v(Hu, { ...e });
|
|
13030
|
+
case "route": return /* @__PURE__ */ v(Uu, { ...e });
|
|
12883
13031
|
default: return null;
|
|
12884
13032
|
}
|
|
12885
|
-
},
|
|
13033
|
+
}, Gu = /^#[0-9a-fA-F]{6}$/, Ku = "#".padEnd(7, "0"), qu = () => {
|
|
12886
13034
|
if (typeof document > "u") return "";
|
|
12887
13035
|
let e = getComputedStyle(document.documentElement).getPropertyValue("--sf-primary").trim();
|
|
12888
|
-
return
|
|
12889
|
-
},
|
|
13036
|
+
return Gu.test(e) ? e.toLowerCase() : "";
|
|
13037
|
+
}, Ju = (e, t, n) => Math.min(n, Math.max(t, e)), Yu = (e, t) => t?.formatValue ? t.formatValue(e) : t?.suffix ? `${e} ${t.suffix}` : String(e), Xu = () => [], Zu = (e) => Array.isArray(e) ? e.map((e) => String(e ?? "").trim()).filter(Boolean) : [], Qu = () => [], $u = (e) => Array.isArray(e) ? e.map((e) => {
|
|
12890
13038
|
if (typeof e != "object" || !e) return null;
|
|
12891
13039
|
let t = e;
|
|
12892
13040
|
return {
|
|
12893
13041
|
key: String(t.key ?? ""),
|
|
12894
13042
|
value: String(t.value ?? "")
|
|
12895
13043
|
};
|
|
12896
|
-
}).filter((e) => e != null) : [],
|
|
13044
|
+
}).filter((e) => e != null) : [], ed = (e = 0, t = 100) => ({
|
|
12897
13045
|
start: e,
|
|
12898
13046
|
end: t
|
|
12899
|
-
}),
|
|
13047
|
+
}), td = (e, t = 0, n = 100) => {
|
|
12900
13048
|
if (e && typeof e == "object" && "start" in e && "end" in e) {
|
|
12901
|
-
let r = e, i =
|
|
13049
|
+
let r = e, i = Ju(Number(r.start), t, n), a = Ju(Number(r.end), t, n);
|
|
12902
13050
|
return i <= a ? {
|
|
12903
13051
|
start: i,
|
|
12904
13052
|
end: a
|
|
@@ -12907,15 +13055,15 @@ var yr = (e) => {
|
|
|
12907
13055
|
end: i
|
|
12908
13056
|
};
|
|
12909
13057
|
}
|
|
12910
|
-
return
|
|
12911
|
-
},
|
|
12912
|
-
let n =
|
|
12913
|
-
return
|
|
12914
|
-
},
|
|
13058
|
+
return ed(t, n);
|
|
13059
|
+
}, nd = (e, t) => {
|
|
13060
|
+
let n = qu(), r = String(t ?? (n || Ku)).trim(), i = Gu.test(r) ? r.toLowerCase() : Ku, a = String(e ?? i).trim();
|
|
13061
|
+
return Gu.test(a) ? a.toLowerCase() : i;
|
|
13062
|
+
}, rd = (e, t, n) => n <= t ? 0 : Math.round((Ju(e, t, n) - t) / (n - t) * 100), id = (e) => (0, X.default)("sf-range-input", e && "pointer-events-none"), ad = ({ form: e, name: t, label: n, info: r, required: i, min: a = 0, max: o = 100, step: s = 1, suffix: c, readOnly: l, disabled: u, className: d, formatValue: f, onChange: p, onRefresh: m }) => {
|
|
12915
13063
|
let h = b({
|
|
12916
13064
|
name: t,
|
|
12917
13065
|
control: e.control
|
|
12918
|
-
}), g = String(t), _ = h.fieldState.error?.message ? String(h.fieldState.error.message) : void 0, x = l || u, S =
|
|
13066
|
+
}), g = String(t), _ = h.fieldState.error?.message ? String(h.fieldState.error.message) : void 0, x = l || u, S = Ju(Number(h.field.value ?? a), a, o), C = (e) => {
|
|
12919
13067
|
h.field.onChange(e), p?.(e);
|
|
12920
13068
|
};
|
|
12921
13069
|
return /* @__PURE__ */ v(Z, {
|
|
@@ -12939,17 +13087,17 @@ var yr = (e) => {
|
|
|
12939
13087
|
"aria-invalid": !!_ || void 0,
|
|
12940
13088
|
onBlur: () => h.field.onBlur(),
|
|
12941
13089
|
onChange: (e) => C(Number(e.target.value)),
|
|
12942
|
-
className:
|
|
13090
|
+
className: id(x)
|
|
12943
13091
|
}), /* @__PURE__ */ v("span", {
|
|
12944
13092
|
className: "sf-slider__value",
|
|
12945
|
-
children:
|
|
13093
|
+
children: Yu(S, {
|
|
12946
13094
|
suffix: c,
|
|
12947
13095
|
formatValue: f
|
|
12948
13096
|
})
|
|
12949
13097
|
})]
|
|
12950
13098
|
})
|
|
12951
13099
|
});
|
|
12952
|
-
},
|
|
13100
|
+
}, od = {
|
|
12953
13101
|
slate: {
|
|
12954
13102
|
wrap: "border-slate-300 bg-white",
|
|
12955
13103
|
button: "bg-slate-50 text-slate-600 hover:bg-slate-100",
|
|
@@ -12970,7 +13118,7 @@ var yr = (e) => {
|
|
|
12970
13118
|
button: "bg-blue-50 text-blue-700 hover:bg-blue-100",
|
|
12971
13119
|
value: "text-blue-700"
|
|
12972
13120
|
}
|
|
12973
|
-
},
|
|
13121
|
+
}, sd = {
|
|
12974
13122
|
sm: {
|
|
12975
13123
|
button: "h-6 w-6",
|
|
12976
13124
|
icon: "h-3 w-3",
|
|
@@ -12981,13 +13129,13 @@ var yr = (e) => {
|
|
|
12981
13129
|
icon: "h-3.5 w-3.5",
|
|
12982
13130
|
value: "min-w-[2.5rem] px-1.5 text-sm"
|
|
12983
13131
|
}
|
|
12984
|
-
},
|
|
13132
|
+
}, cd = (e, t) => {
|
|
12985
13133
|
let n = (String(t).split(".")[1] ?? "").length;
|
|
12986
13134
|
return Number(e.toFixed(n));
|
|
12987
|
-
},
|
|
12988
|
-
let f =
|
|
13135
|
+
}, ld = ({ value: e, onChange: t, min: n = 0, max: r = Infinity, step: i = 1, tone: a = "slate", size: o = "md", disabled: s = !1, readOnly: c = !1, ariaLabel: l, formatValue: u, className: d }) => {
|
|
13136
|
+
let f = od[a], p = sd[o], m = s || c, h = (a) => {
|
|
12989
13137
|
if (m) return;
|
|
12990
|
-
let o = Math.min(r, Math.max(n,
|
|
13138
|
+
let o = Math.min(r, Math.max(n, cd(a, i)));
|
|
12991
13139
|
o !== e && t(o);
|
|
12992
13140
|
}, g = e <= n, _ = e >= r, b = u ? u(e) : String(e), x = (0, X.default)("flex items-center justify-center font-bold leading-none transition-colors disabled:cursor-not-allowed disabled:opacity-40", f.button, p.button);
|
|
12993
13141
|
return /* @__PURE__ */ y("div", {
|
|
@@ -13023,11 +13171,11 @@ var yr = (e) => {
|
|
|
13023
13171
|
})
|
|
13024
13172
|
]
|
|
13025
13173
|
});
|
|
13026
|
-
},
|
|
13174
|
+
}, ud = (e) => (0, X.default)("sf-range-input", e && "pointer-events-none"), dd = ({ form: e, name: t, label: n, info: r, required: i, min: a = 0, max: o = 100, step: s = 1, suffix: c, readOnly: l, disabled: u, className: d, formatValue: f, onChange: p, onRefresh: m }) => {
|
|
13027
13175
|
let h = b({
|
|
13028
13176
|
name: t,
|
|
13029
13177
|
control: e.control
|
|
13030
|
-
}), g = String(t), _ = h.fieldState.error?.message ? String(h.fieldState.error.message) : void 0, x = l || u, S =
|
|
13178
|
+
}), g = String(t), _ = h.fieldState.error?.message ? String(h.fieldState.error.message) : void 0, x = l || u, S = td(h.field.value, a, o), C = (e) => {
|
|
13031
13179
|
h.field.onChange(e), p?.(e);
|
|
13032
13180
|
}, w = {
|
|
13033
13181
|
suffix: c,
|
|
@@ -13045,7 +13193,7 @@ var yr = (e) => {
|
|
|
13045
13193
|
children: [
|
|
13046
13194
|
/* @__PURE__ */ v("span", {
|
|
13047
13195
|
className: "sf-slider__value sf-slider__value--sm",
|
|
13048
|
-
children:
|
|
13196
|
+
children: Yu(S.start, w)
|
|
13049
13197
|
}),
|
|
13050
13198
|
/* @__PURE__ */ y("div", {
|
|
13051
13199
|
className: "grid flex-1 gap-2",
|
|
@@ -13067,7 +13215,7 @@ var yr = (e) => {
|
|
|
13067
13215
|
end: Math.max(t, S.end)
|
|
13068
13216
|
});
|
|
13069
13217
|
},
|
|
13070
|
-
className:
|
|
13218
|
+
className: ud(x)
|
|
13071
13219
|
}), /* @__PURE__ */ v("input", {
|
|
13072
13220
|
id: `${g}-end`,
|
|
13073
13221
|
type: "range",
|
|
@@ -13086,21 +13234,21 @@ var yr = (e) => {
|
|
|
13086
13234
|
end: t
|
|
13087
13235
|
});
|
|
13088
13236
|
},
|
|
13089
|
-
className:
|
|
13237
|
+
className: ud(x)
|
|
13090
13238
|
})]
|
|
13091
13239
|
}),
|
|
13092
13240
|
/* @__PURE__ */ v("span", {
|
|
13093
13241
|
className: "sf-slider__value sf-slider__value--sm",
|
|
13094
|
-
children:
|
|
13242
|
+
children: Yu(S.end, w)
|
|
13095
13243
|
})
|
|
13096
13244
|
]
|
|
13097
13245
|
})
|
|
13098
13246
|
});
|
|
13099
|
-
},
|
|
13247
|
+
}, fd = ({ form: e, name: t, label: n, info: r, required: i, min: a = 0, max: o = 100, suffix: s, className: c, formatValue: l, onRefresh: u }) => {
|
|
13100
13248
|
let d = b({
|
|
13101
13249
|
name: t,
|
|
13102
13250
|
control: e.control
|
|
13103
|
-
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m =
|
|
13251
|
+
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m = Ju(Number(d.field.value ?? a), a, o), h = rd(m, a, o);
|
|
13104
13252
|
return /* @__PURE__ */ v(Z, {
|
|
13105
13253
|
id: f,
|
|
13106
13254
|
label: n,
|
|
@@ -13123,21 +13271,21 @@ var yr = (e) => {
|
|
|
13123
13271
|
})
|
|
13124
13272
|
}), /* @__PURE__ */ v("span", {
|
|
13125
13273
|
className: "sf-progress-bar__value",
|
|
13126
|
-
children:
|
|
13274
|
+
children: Yu(m, {
|
|
13127
13275
|
suffix: s,
|
|
13128
13276
|
formatValue: l
|
|
13129
13277
|
})
|
|
13130
13278
|
})]
|
|
13131
13279
|
})
|
|
13132
13280
|
});
|
|
13133
|
-
},
|
|
13281
|
+
}, pd = {
|
|
13134
13282
|
default: "sf-progress-bar-readonly__fill--default",
|
|
13135
13283
|
success: "sf-progress-bar-readonly__fill--success",
|
|
13136
13284
|
warning: "sf-progress-bar-readonly__fill--warning",
|
|
13137
13285
|
danger: "sf-progress-bar-readonly__fill--danger",
|
|
13138
13286
|
info: "sf-progress-bar-readonly__fill--info"
|
|
13139
|
-
},
|
|
13140
|
-
let u =
|
|
13287
|
+
}, md = ({ value: e, min: t = 0, max: n = 100, label: r, showValue: i = !0, suffix: a, formatValue: o, tone: s = "default", size: c = "md", className: l }) => {
|
|
13288
|
+
let u = Ju(e, t, n), d = rd(u, t, n), f = Yu(u, {
|
|
13141
13289
|
suffix: a,
|
|
13142
13290
|
formatValue: o
|
|
13143
13291
|
});
|
|
@@ -13151,7 +13299,7 @@ var yr = (e) => {
|
|
|
13151
13299
|
/* @__PURE__ */ v("div", {
|
|
13152
13300
|
className: "sf-progress-bar-readonly__track",
|
|
13153
13301
|
children: /* @__PURE__ */ v("div", {
|
|
13154
|
-
className: (0, X.default)("sf-progress-bar-readonly__fill",
|
|
13302
|
+
className: (0, X.default)("sf-progress-bar-readonly__fill", pd[s]),
|
|
13155
13303
|
style: { width: `${d}%` },
|
|
13156
13304
|
role: "progressbar",
|
|
13157
13305
|
"aria-label": r ?? "Progreso",
|
|
@@ -13166,11 +13314,11 @@ var yr = (e) => {
|
|
|
13166
13314
|
})
|
|
13167
13315
|
]
|
|
13168
13316
|
});
|
|
13169
|
-
},
|
|
13317
|
+
}, hd = ({ form: e, name: t, label: n, info: r, required: i, stars: a = 5, readOnly: o, disabled: s, small: c, className: l, onChange: u, onRefresh: d }) => {
|
|
13170
13318
|
let [f, p] = h(0), m = b({
|
|
13171
13319
|
name: t,
|
|
13172
13320
|
control: e.control
|
|
13173
|
-
}), g = String(t), _ = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, y = o || s, x =
|
|
13321
|
+
}), g = String(t), _ = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, y = o || s, x = gd(Number(m.field.value ?? 0), a), S = f || x, C = (e) => {
|
|
13174
13322
|
m.field.onChange(e), u?.(e), m.field.onBlur();
|
|
13175
13323
|
}, w = (e, t) => {
|
|
13176
13324
|
if (y) return;
|
|
@@ -13210,12 +13358,12 @@ var yr = (e) => {
|
|
|
13210
13358
|
}, e))
|
|
13211
13359
|
})
|
|
13212
13360
|
});
|
|
13213
|
-
},
|
|
13361
|
+
}, gd = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : Math.min(t, Math.round(e)), _d = ({ form: e, name: t, label: n, info: r, required: i, readOnly: a, disabled: o, small: s, className: c, onChange: l, onRefresh: u }) => {
|
|
13214
13362
|
let d = b({
|
|
13215
13363
|
name: t,
|
|
13216
13364
|
control: e.control
|
|
13217
|
-
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m = a || o, h =
|
|
13218
|
-
let t =
|
|
13365
|
+
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m = a || o, h = nd(d.field.value), g = (e) => {
|
|
13366
|
+
let t = nd(e, h);
|
|
13219
13367
|
d.field.onChange(t), l?.(t);
|
|
13220
13368
|
};
|
|
13221
13369
|
return /* @__PURE__ */ v(Z, {
|
|
@@ -13258,11 +13406,11 @@ var yr = (e) => {
|
|
|
13258
13406
|
})]
|
|
13259
13407
|
})
|
|
13260
13408
|
});
|
|
13261
|
-
},
|
|
13409
|
+
}, vd = ({ form: e, name: t, label: n, info: r, required: i, placeholder: a = "Escribe y presiona Enter", maxItems: o, readOnly: s, disabled: c, className: l, onChange: u, onRefresh: d }) => {
|
|
13262
13410
|
let [f, p] = h(""), m = b({
|
|
13263
13411
|
name: t,
|
|
13264
13412
|
control: e.control
|
|
13265
|
-
}), g = String(t), _ = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, x = s || c, S =
|
|
13413
|
+
}), g = String(t), _ = m.fieldState.error?.message ? String(m.fieldState.error.message) : void 0, x = s || c, S = Zu(m.field.value), C = o != null && S.length >= o, w = (e) => {
|
|
13266
13414
|
m.field.onChange(e), u?.(e);
|
|
13267
13415
|
}, T = () => {
|
|
13268
13416
|
let e = f.trim();
|
|
@@ -13314,11 +13462,11 @@ var yr = (e) => {
|
|
|
13314
13462
|
})]
|
|
13315
13463
|
})
|
|
13316
13464
|
});
|
|
13317
|
-
},
|
|
13465
|
+
}, yd = ({ form: e, name: t, label: n, info: r, required: i, readOnly: a, disabled: o, small: s, className: c, onChange: l, onRefresh: u }) => {
|
|
13318
13466
|
let d = b({
|
|
13319
13467
|
name: t,
|
|
13320
13468
|
control: e.control
|
|
13321
|
-
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m = a || o, h =
|
|
13469
|
+
}), f = String(t), p = d.fieldState.error?.message ? String(d.fieldState.error.message) : void 0, m = a || o, h = $u(d.field.value), g = (e) => {
|
|
13322
13470
|
d.field.onChange(e), l?.(e);
|
|
13323
13471
|
}, _ = (e, t, n) => {
|
|
13324
13472
|
g(h.map((r, i) => i === e ? {
|
|
@@ -13403,7 +13551,7 @@ var yr = (e) => {
|
|
|
13403
13551
|
})]
|
|
13404
13552
|
})
|
|
13405
13553
|
});
|
|
13406
|
-
},
|
|
13554
|
+
}, bd = ({ items: e, onReorder: t, className: n }) => {
|
|
13407
13555
|
let [r, i] = h(null), a = (n) => (a) => {
|
|
13408
13556
|
if (a.preventDefault(), !r) return;
|
|
13409
13557
|
let o = e.findIndex((e) => e.id === r);
|
|
@@ -13429,7 +13577,7 @@ var yr = (e) => {
|
|
|
13429
13577
|
})]
|
|
13430
13578
|
}, e.id))
|
|
13431
13579
|
});
|
|
13432
|
-
},
|
|
13580
|
+
}, xd = ({ value: e, onChange: t, options: n, name: r = "card-radio-group", className: i, ariaLabel: a = "Opciones" }) => /* @__PURE__ */ v("div", {
|
|
13433
13581
|
className: (0, X.default)("sf-card-radio-group", i),
|
|
13434
13582
|
role: "radiogroup",
|
|
13435
13583
|
"aria-label": a,
|
|
@@ -13474,7 +13622,7 @@ var yr = (e) => {
|
|
|
13474
13622
|
]
|
|
13475
13623
|
}, n.value);
|
|
13476
13624
|
})
|
|
13477
|
-
}),
|
|
13625
|
+
}), Sd = ({ value: e, onChange: t, zones: n, label: r, disabled: i, className: a }) => {
|
|
13478
13626
|
let o = Math.max(0, n.findIndex((t) => t.value === e)), s = n[o], c = n.length > 1 ? o / (n.length - 1) * 100 : 0;
|
|
13479
13627
|
return /* @__PURE__ */ y("div", {
|
|
13480
13628
|
className: (0, X.default)("sf-semantic-slider", a),
|
|
@@ -13505,19 +13653,19 @@ var yr = (e) => {
|
|
|
13505
13653
|
})
|
|
13506
13654
|
]
|
|
13507
13655
|
});
|
|
13508
|
-
},
|
|
13656
|
+
}, Cd = {
|
|
13509
13657
|
slate: "var(--sf-metric-tone-slate)",
|
|
13510
13658
|
emerald: "var(--sf-metric-tone-emerald)",
|
|
13511
13659
|
amber: "var(--sf-metric-tone-amber)",
|
|
13512
13660
|
red: "var(--sf-metric-tone-red)",
|
|
13513
13661
|
blue: "var(--sf-metric-tone-blue)"
|
|
13514
|
-
},
|
|
13662
|
+
}, wd = [
|
|
13515
13663
|
"slate",
|
|
13516
13664
|
"blue",
|
|
13517
13665
|
"amber",
|
|
13518
13666
|
"emerald",
|
|
13519
13667
|
"red"
|
|
13520
|
-
],
|
|
13668
|
+
], Td = ({ segments: e, onChange: t, unit: n, valueFormat: r, className: i }) => {
|
|
13521
13669
|
let a = m(null), o = m(null), [s, c] = h(null), l = e.reduce((e, t) => e + t.value, 0), u = r ?? ((e) => `${e.toLocaleString("es-PE")}${n ? ` ${n}` : ""}`), d = (n, r, i) => {
|
|
13522
13670
|
t && t(e.map((e, t) => t === n ? {
|
|
13523
13671
|
...e,
|
|
@@ -13559,14 +13707,14 @@ var yr = (e) => {
|
|
|
13559
13707
|
ref: a,
|
|
13560
13708
|
className: "sf-allocation-bar__track",
|
|
13561
13709
|
children: e.map((n, r) => {
|
|
13562
|
-
let i = l > 0 ? n.value / l * 100 : 0, a = b[r], o = n.tone ??
|
|
13710
|
+
let i = l > 0 ? n.value / l * 100 : 0, a = b[r], o = n.tone ?? wd[r % wd.length], c = r === e.length - 1, d = c ? 0 : n.value + e[r + 1].value, m = d > 0 ? Math.round(n.value / d * 100) : 50;
|
|
13563
13711
|
return /* @__PURE__ */ y("div", {
|
|
13564
13712
|
className: "contents",
|
|
13565
13713
|
children: [/* @__PURE__ */ v("div", {
|
|
13566
13714
|
className: "sf-allocation-bar__seg",
|
|
13567
13715
|
style: {
|
|
13568
13716
|
width: `${i}%`,
|
|
13569
|
-
backgroundColor:
|
|
13717
|
+
backgroundColor: Cd[o]
|
|
13570
13718
|
},
|
|
13571
13719
|
title: `${n.label} · ${u(n.value)} (${Math.round(i)}%)`
|
|
13572
13720
|
}), !c && t && /* @__PURE__ */ v("div", {
|
|
@@ -13596,7 +13744,7 @@ var yr = (e) => {
|
|
|
13596
13744
|
children: [
|
|
13597
13745
|
/* @__PURE__ */ v("span", {
|
|
13598
13746
|
className: "sf-allocation-bar__label-dot",
|
|
13599
|
-
style: { backgroundColor:
|
|
13747
|
+
style: { backgroundColor: Cd[t.tone ?? wd[e.indexOf(t) % wd.length]] },
|
|
13600
13748
|
"aria-hidden": "true"
|
|
13601
13749
|
}),
|
|
13602
13750
|
t.label,
|
|
@@ -13610,11 +13758,11 @@ var yr = (e) => {
|
|
|
13610
13758
|
})
|
|
13611
13759
|
})]
|
|
13612
13760
|
});
|
|
13613
|
-
},
|
|
13761
|
+
}, Ed = (e) => new Date(e).toLocaleTimeString("es-PE", {
|
|
13614
13762
|
hour: "2-digit",
|
|
13615
13763
|
minute: "2-digit"
|
|
13616
|
-
}),
|
|
13617
|
-
let u = o ??
|
|
13764
|
+
}), Dd = ({ value: e, onChange: t, min: n, max: r, step: i, marks: a, formatValue: o, label: s, disabled: c, className: l }) => {
|
|
13765
|
+
let u = o ?? Ed, d = r > n ? Math.min(100, Math.max(0, (e - n) / (r - n) * 100)) : 0, f = i ?? Math.max(1, Math.round((r - n) / 200));
|
|
13618
13766
|
return /* @__PURE__ */ y("div", {
|
|
13619
13767
|
className: (0, X.default)("sf-temporal-scrub", l),
|
|
13620
13768
|
children: [s && /* @__PURE__ */ v("p", {
|
|
@@ -13656,7 +13804,7 @@ var yr = (e) => {
|
|
|
13656
13804
|
]
|
|
13657
13805
|
})]
|
|
13658
13806
|
});
|
|
13659
|
-
},
|
|
13807
|
+
}, Od = {
|
|
13660
13808
|
group: {
|
|
13661
13809
|
label: "Grupo / Entidad",
|
|
13662
13810
|
labelShort: "GRP",
|
|
@@ -13675,7 +13823,7 @@ var yr = (e) => {
|
|
|
13675
13823
|
rowClass: "sf-org-tree-row--role",
|
|
13676
13824
|
barClass: "sf-org-tree-bar--role"
|
|
13677
13825
|
}
|
|
13678
|
-
},
|
|
13826
|
+
}, kd = (e) => {
|
|
13679
13827
|
let t = /* @__PURE__ */ new Map(), n = new Set(e.map((e) => e.id));
|
|
13680
13828
|
for (let n of e) {
|
|
13681
13829
|
let e = n.parentId == null || n.parentId === "" ? null : n.parentId, r = t.get(e) ?? [];
|
|
@@ -13702,16 +13850,16 @@ var yr = (e) => {
|
|
|
13702
13850
|
hasChildren: !1
|
|
13703
13851
|
});
|
|
13704
13852
|
return r;
|
|
13705
|
-
},
|
|
13853
|
+
}, Ad = (e, t = Od) => t[e] ?? Od[e] ?? null, jd = (e) => e.length, Md = (e) => {
|
|
13706
13854
|
let t = new Set(e.map((e) => e.id));
|
|
13707
13855
|
return e.filter((e) => {
|
|
13708
13856
|
let n = e.parentId == null || e.parentId === "" ? null : e.parentId;
|
|
13709
13857
|
return n == null || !t.has(n);
|
|
13710
13858
|
});
|
|
13711
|
-
},
|
|
13859
|
+
}, Nd = ({ type: e, className: t }) => v(e === "group" ? bt : e === "role" ? Je : J, {
|
|
13712
13860
|
className: t,
|
|
13713
13861
|
"aria-hidden": "true"
|
|
13714
|
-
}),
|
|
13862
|
+
}), Pd = ({ nodes: e, title: t = "Estructura", subtitle: n, loading: r = !1, error: i = null, onRefresh: a, canEdit: o = !1, onAddNode: c, onEditNode: l, onDeleteNode: d, showLegend: f = !1, themes: g = Od, onRenderNode: _, maxHeight: b = 480, className: x }) => {
|
|
13715
13863
|
let [S, C] = h(/* @__PURE__ */ new Set()), [w, T] = h({
|
|
13716
13864
|
visible: !1,
|
|
13717
13865
|
x: 0,
|
|
@@ -13734,7 +13882,7 @@ var yr = (e) => {
|
|
|
13734
13882
|
window.removeEventListener("mousedown", e), window.removeEventListener("keydown", t);
|
|
13735
13883
|
};
|
|
13736
13884
|
}, [w.visible]);
|
|
13737
|
-
let D = p(() =>
|
|
13885
|
+
let D = p(() => kd(e), [e]), O = s((e) => {
|
|
13738
13886
|
let t = e.parentId == null || e.parentId === "" ? null : e.parentId;
|
|
13739
13887
|
for (; t != null;) {
|
|
13740
13888
|
if (S.has(t)) return !0;
|
|
@@ -13821,7 +13969,7 @@ var yr = (e) => {
|
|
|
13821
13969
|
className: "sf-org-tree__empty",
|
|
13822
13970
|
children: "Sin nodos"
|
|
13823
13971
|
}), k.map((e) => {
|
|
13824
|
-
let t =
|
|
13972
|
+
let t = Ad(e.type, g);
|
|
13825
13973
|
return /* @__PURE__ */ v("li", {
|
|
13826
13974
|
role: "treeitem",
|
|
13827
13975
|
"aria-level": e.depth + 1,
|
|
@@ -13841,7 +13989,7 @@ var yr = (e) => {
|
|
|
13841
13989
|
tabIndex: e.hasChildren ? 0 : -1,
|
|
13842
13990
|
children: S.has(e.id) ? /* @__PURE__ */ v(mt, { className: "h-4 w-4" }) : /* @__PURE__ */ v(gt, { className: "h-4 w-4" })
|
|
13843
13991
|
}),
|
|
13844
|
-
/* @__PURE__ */ v(
|
|
13992
|
+
/* @__PURE__ */ v(Nd, {
|
|
13845
13993
|
type: e.type,
|
|
13846
13994
|
className: "h-4 w-4 shrink-0 opacity-70"
|
|
13847
13995
|
}),
|
|
@@ -13926,7 +14074,7 @@ var yr = (e) => {
|
|
|
13926
14074
|
})
|
|
13927
14075
|
]
|
|
13928
14076
|
});
|
|
13929
|
-
},
|
|
14077
|
+
}, Fd = {
|
|
13930
14078
|
street: {
|
|
13931
14079
|
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
13932
14080
|
attribution: "© <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" rel=\"noreferrer\">OpenStreetMap</a>"
|
|
@@ -13935,27 +14083,27 @@ var yr = (e) => {
|
|
|
13935
14083
|
url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
|
|
13936
14084
|
attribution: "Tiles © Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community"
|
|
13937
14085
|
}
|
|
13938
|
-
},
|
|
14086
|
+
}, Id = {
|
|
13939
14087
|
default: "Nodo",
|
|
13940
14088
|
nap: "NAP",
|
|
13941
14089
|
olt: "OLT",
|
|
13942
14090
|
splitter: "Splitter"
|
|
13943
|
-
},
|
|
14091
|
+
}, Ld = {
|
|
13944
14092
|
default: "var(--sf-accent)",
|
|
13945
14093
|
nap: "var(--sf-network-kind-nap)",
|
|
13946
14094
|
olt: "var(--sf-network-kind-olt)",
|
|
13947
14095
|
splitter: "var(--sf-network-kind-splitter)"
|
|
13948
|
-
},
|
|
14096
|
+
}, Rd = {
|
|
13949
14097
|
normal: "var(--sf-network-status-normal)",
|
|
13950
14098
|
warning: "var(--sf-network-status-warning)",
|
|
13951
14099
|
critical: "var(--sf-network-status-critical)",
|
|
13952
14100
|
maintenance: "var(--sf-network-status-maintenance)"
|
|
13953
|
-
},
|
|
14101
|
+
}, zd = {
|
|
13954
14102
|
normal: "Normal",
|
|
13955
14103
|
warning: "Advertencia",
|
|
13956
14104
|
critical: "Crítico",
|
|
13957
14105
|
maintenance: "Mantenimiento"
|
|
13958
|
-
},
|
|
14106
|
+
}, Bd = {
|
|
13959
14107
|
backbone: {
|
|
13960
14108
|
color: "var(--sf-network-edge-backbone)",
|
|
13961
14109
|
weight: 2.5
|
|
@@ -13969,7 +14117,7 @@ var yr = (e) => {
|
|
|
13969
14117
|
weight: 1.5,
|
|
13970
14118
|
dashArray: "6 4"
|
|
13971
14119
|
}
|
|
13972
|
-
},
|
|
14120
|
+
}, Vd = ql, Hd = (e) => {
|
|
13973
14121
|
if (!Array.isArray(e)) return [];
|
|
13974
14122
|
let t = [];
|
|
13975
14123
|
for (let n of e) {
|
|
@@ -13978,24 +14126,24 @@ var yr = (e) => {
|
|
|
13978
14126
|
if (!r) continue;
|
|
13979
14127
|
let i = Number(e.lat), a = Number(e.lng);
|
|
13980
14128
|
if (!Number.isFinite(i) || !Number.isFinite(a)) continue;
|
|
13981
|
-
let o = String(e.status ?? "normal"), s = o in
|
|
14129
|
+
let o = String(e.status ?? "normal"), s = o in Rd ? o : "normal", c = {
|
|
13982
14130
|
id: r,
|
|
13983
14131
|
label: String(e.label ?? ""),
|
|
13984
14132
|
lat: i,
|
|
13985
14133
|
lng: a,
|
|
13986
14134
|
status: s
|
|
13987
14135
|
}, l = e.kind == null ? r.startsWith("nap:") ? "nap" : "default" : String(e.kind);
|
|
13988
|
-
l in
|
|
14136
|
+
l in Id && (c.kind = l), e.value != null && Number.isFinite(Number(e.value)) && (c.value = Number(e.value)), e.icon != null && (c.icon = String(e.icon)), t.push(c);
|
|
13989
14137
|
}
|
|
13990
14138
|
return t;
|
|
13991
|
-
},
|
|
14139
|
+
}, Ud = (e) => {
|
|
13992
14140
|
if (!Array.isArray(e)) return [];
|
|
13993
14141
|
let t = [];
|
|
13994
14142
|
for (let n of e) {
|
|
13995
14143
|
if (typeof n != "object" || !n) continue;
|
|
13996
14144
|
let e = n, r = String(e.from ?? ""), i = String(e.to ?? "");
|
|
13997
14145
|
if (!r || !i) continue;
|
|
13998
|
-
let a = String(e.type ?? "backbone"), o = a in
|
|
14146
|
+
let a = String(e.type ?? "backbone"), o = a in Bd ? a : "backbone";
|
|
13999
14147
|
t.push({
|
|
14000
14148
|
from: r,
|
|
14001
14149
|
to: i,
|
|
@@ -14003,7 +14151,7 @@ var yr = (e) => {
|
|
|
14003
14151
|
});
|
|
14004
14152
|
}
|
|
14005
14153
|
return t;
|
|
14006
|
-
},
|
|
14154
|
+
}, Wd = (e) => {
|
|
14007
14155
|
let t = {
|
|
14008
14156
|
normal: 0,
|
|
14009
14157
|
warning: 0,
|
|
@@ -14012,18 +14160,18 @@ var yr = (e) => {
|
|
|
14012
14160
|
};
|
|
14013
14161
|
for (let n of e) t[n.status] += 1;
|
|
14014
14162
|
return t;
|
|
14015
|
-
},
|
|
14163
|
+
}, Gd = (e) => {
|
|
14016
14164
|
if (e.length === 0) return null;
|
|
14017
14165
|
let t = e.map((e) => e.lat), n = e.map((e) => e.lng);
|
|
14018
14166
|
return [[Math.min(...t), Math.min(...n)], [Math.max(...t), Math.max(...n)]];
|
|
14019
|
-
},
|
|
14167
|
+
}, Kd = (e) => Object.fromEntries(e.map((e) => [e.id, [e.lat, e.lng]])), qd = (e, t) => e.flatMap((e) => {
|
|
14020
14168
|
let n = t[e.from], r = t[e.to];
|
|
14021
14169
|
return !n || !r ? [] : [{
|
|
14022
14170
|
edge: e,
|
|
14023
14171
|
line: [n, r]
|
|
14024
14172
|
}];
|
|
14025
|
-
}),
|
|
14026
|
-
let i =
|
|
14173
|
+
}), Jd = ({ nodes: e, edges: t = [], placement: n = "bottom-left", className: r }) => {
|
|
14174
|
+
let i = Wd(e), a = Array.from(new Set(t.map((e) => e.type ?? "backbone")));
|
|
14027
14175
|
return /* @__PURE__ */ y("div", {
|
|
14028
14176
|
className: (0, X.default)("sf-network-legend", n === "bottom-right" ? "sf-network-legend--right" : "sf-network-legend--left", r),
|
|
14029
14177
|
role: "region",
|
|
@@ -14035,15 +14183,15 @@ var yr = (e) => {
|
|
|
14035
14183
|
}),
|
|
14036
14184
|
/* @__PURE__ */ v("ul", {
|
|
14037
14185
|
className: "space-y-1",
|
|
14038
|
-
children: Object.keys(
|
|
14186
|
+
children: Object.keys(zd).map((e) => /* @__PURE__ */ y("li", {
|
|
14039
14187
|
className: "sf-network-legend__item",
|
|
14040
14188
|
children: [/* @__PURE__ */ y("span", {
|
|
14041
14189
|
className: "flex items-center gap-2",
|
|
14042
14190
|
children: [/* @__PURE__ */ v("span", {
|
|
14043
14191
|
className: "inline-block h-2.5 w-2.5 rounded-full",
|
|
14044
|
-
style: { background:
|
|
14192
|
+
style: { background: Rd[e] },
|
|
14045
14193
|
"aria-hidden": "true"
|
|
14046
|
-
}),
|
|
14194
|
+
}), zd[e]]
|
|
14047
14195
|
}), /* @__PURE__ */ v("span", {
|
|
14048
14196
|
className: "sf-network-legend__count",
|
|
14049
14197
|
children: i[e]
|
|
@@ -14056,7 +14204,7 @@ var yr = (e) => {
|
|
|
14056
14204
|
}), /* @__PURE__ */ v("ul", {
|
|
14057
14205
|
className: "space-y-1",
|
|
14058
14206
|
children: a.map((e) => {
|
|
14059
|
-
let t =
|
|
14207
|
+
let t = Bd[e ?? "backbone"];
|
|
14060
14208
|
return /* @__PURE__ */ y("li", {
|
|
14061
14209
|
className: "sf-network-legend__item sf-network-legend__item--edge",
|
|
14062
14210
|
children: [/* @__PURE__ */ v("span", {
|
|
@@ -14076,19 +14224,19 @@ var yr = (e) => {
|
|
|
14076
14224
|
})
|
|
14077
14225
|
]
|
|
14078
14226
|
});
|
|
14079
|
-
},
|
|
14080
|
-
let n = e.status, r = e.kind ?? "default", i = r === "nap" ? "NAP" : e.value == null ? e.icon ??
|
|
14227
|
+
}, Yd = [-12.0464, -77.0428], Xd = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), Zd = (e, t) => {
|
|
14228
|
+
let n = e.status, r = e.kind ?? "default", i = r === "nap" ? "NAP" : e.value == null ? e.icon ?? Id[r].slice(0, 3).toUpperCase() : `${e.value}%`, a = Xd(e.label.length > 40 ? `${e.label.slice(0, 37)}…` : e.label), o = t ? " sf-network-marker--selected" : "";
|
|
14081
14229
|
return ie.divIcon({
|
|
14082
14230
|
className: "sf-network-marker-root",
|
|
14083
14231
|
iconAnchor: [24, 42],
|
|
14084
14232
|
iconSize: [48, 48],
|
|
14085
14233
|
html: `<div class="sf-network-marker${o}">
|
|
14086
14234
|
<div class="sf-network-marker__label">${a}</div>
|
|
14087
|
-
<div class="sf-network-marker__dot sf-network-marker__dot--status-${n} sf-network-marker__dot--kind-${r}">${
|
|
14235
|
+
<div class="sf-network-marker__dot sf-network-marker__dot--status-${n} sf-network-marker__dot--kind-${r}">${Xd(String(i))}</div>
|
|
14088
14236
|
</div>`
|
|
14089
14237
|
});
|
|
14090
|
-
},
|
|
14091
|
-
let t = U(), n =
|
|
14238
|
+
}, Qd = ({ nodes: e }) => {
|
|
14239
|
+
let t = U(), n = Gd(e);
|
|
14092
14240
|
return u(() => {
|
|
14093
14241
|
n && t.fitBounds(n, {
|
|
14094
14242
|
padding: [32, 32],
|
|
@@ -14099,8 +14247,8 @@ var yr = (e) => {
|
|
|
14099
14247
|
t,
|
|
14100
14248
|
e
|
|
14101
14249
|
]), null;
|
|
14102
|
-
},
|
|
14103
|
-
let g = To(), [_, b] = h("street"), x = l ?? _, S =
|
|
14250
|
+
}, $d = ({ nodes: e, edges: t = [], center: n = Yd, zoom: r = 12, height: i = 420, selectedNodeId: a, onNodeClick: o, showLegend: s = !0, fitBoundsToNodes: c = !0, basemap: l, onBasemapChange: u, showBasemapSwitcher: d = !1, ariaLabel: f = "Mapa de red", className: m }) => {
|
|
14251
|
+
let g = To(), [_, b] = h("street"), x = l ?? _, S = Fd[x], C = p(() => Kd(e), [e]), w = p(() => qd(t, C), [t, C]), T = (e) => {
|
|
14104
14252
|
l === void 0 && b(e), u?.(e);
|
|
14105
14253
|
};
|
|
14106
14254
|
return /* @__PURE__ */ y("div", {
|
|
@@ -14119,13 +14267,13 @@ var yr = (e) => {
|
|
|
14119
14267
|
attribution: S.attribution,
|
|
14120
14268
|
url: S.url
|
|
14121
14269
|
}),
|
|
14122
|
-
c && e.length > 0 && /* @__PURE__ */ v(
|
|
14270
|
+
c && e.length > 0 && /* @__PURE__ */ v(Qd, { nodes: e }),
|
|
14123
14271
|
w.map(({ edge: e, line: t }) => {
|
|
14124
|
-
let n =
|
|
14272
|
+
let n = Bd[e.type ?? "backbone"];
|
|
14125
14273
|
return /* @__PURE__ */ v(V, {
|
|
14126
14274
|
positions: t,
|
|
14127
14275
|
pathOptions: {
|
|
14128
|
-
color:
|
|
14276
|
+
color: Vd(n.color),
|
|
14129
14277
|
weight: n.weight,
|
|
14130
14278
|
dashArray: n.dashArray
|
|
14131
14279
|
}
|
|
@@ -14133,7 +14281,7 @@ var yr = (e) => {
|
|
|
14133
14281
|
}),
|
|
14134
14282
|
e.map((e) => /* @__PURE__ */ v(te, {
|
|
14135
14283
|
position: C[e.id],
|
|
14136
|
-
icon:
|
|
14284
|
+
icon: Zd(e, e.id === a),
|
|
14137
14285
|
title: e.label,
|
|
14138
14286
|
alt: `${e.label}, estado ${e.status}`,
|
|
14139
14287
|
keyboard: !!o,
|
|
@@ -14157,17 +14305,17 @@ var yr = (e) => {
|
|
|
14157
14305
|
children: e === "street" ? "Mapa" : "Satélite"
|
|
14158
14306
|
}, e))
|
|
14159
14307
|
}),
|
|
14160
|
-
s && e.length > 0 && /* @__PURE__ */ v(
|
|
14308
|
+
s && e.length > 0 && /* @__PURE__ */ v(Jd, {
|
|
14161
14309
|
nodes: e,
|
|
14162
14310
|
edges: t
|
|
14163
14311
|
})
|
|
14164
14312
|
]
|
|
14165
14313
|
});
|
|
14166
|
-
},
|
|
14314
|
+
}, ef = {
|
|
14167
14315
|
edit: "sf-audit-timeline__icon-wrap--edit",
|
|
14168
14316
|
sync: "sf-audit-timeline__icon-wrap--sync",
|
|
14169
14317
|
create: "sf-audit-timeline__icon-wrap--create"
|
|
14170
|
-
},
|
|
14318
|
+
}, tf = ({ items: e, sectionTitle: t = "Historial de movimientos", eventCountLabel: n, ariaLabel: r = "Historial de movimientos", emptyMessage: i = "Sin eventos", className: a }) => {
|
|
14171
14319
|
let o = n ?? `${e.length} evento${e.length === 1 ? "" : "s"}`;
|
|
14172
14320
|
return /* @__PURE__ */ y("section", {
|
|
14173
14321
|
className: (0, X.default)("sf-audit-timeline", a),
|
|
@@ -14206,11 +14354,11 @@ var yr = (e) => {
|
|
|
14206
14354
|
/* @__PURE__ */ v("div", {
|
|
14207
14355
|
className: "sf-audit-timeline__marker",
|
|
14208
14356
|
children: t.icon ? /* @__PURE__ */ v("span", {
|
|
14209
|
-
className: (0, X.default)("sf-audit-timeline__icon-wrap",
|
|
14357
|
+
className: (0, X.default)("sf-audit-timeline__icon-wrap", ef[r]),
|
|
14210
14358
|
"aria-hidden": "true",
|
|
14211
14359
|
children: t.icon
|
|
14212
14360
|
}) : /* @__PURE__ */ v("span", {
|
|
14213
|
-
className: (0, X.default)("sf-audit-timeline__icon-wrap",
|
|
14361
|
+
className: (0, X.default)("sf-audit-timeline__icon-wrap", ef[r]),
|
|
14214
14362
|
"aria-hidden": "true"
|
|
14215
14363
|
})
|
|
14216
14364
|
}),
|
|
@@ -14246,16 +14394,16 @@ var yr = (e) => {
|
|
|
14246
14394
|
})]
|
|
14247
14395
|
})]
|
|
14248
14396
|
});
|
|
14249
|
-
},
|
|
14397
|
+
}, nf = {
|
|
14250
14398
|
info: "sf-record-list__icon--info",
|
|
14251
14399
|
warning: "sf-record-list__icon--warning",
|
|
14252
14400
|
success: "sf-record-list__icon--success",
|
|
14253
14401
|
neutral: "sf-record-list__icon--neutral"
|
|
14254
|
-
},
|
|
14402
|
+
}, rf = ({ icon: e, iconTone: t = "info", title: n, subtitle: r, badge: i, actions: a, className: o }) => /* @__PURE__ */ y("article", {
|
|
14255
14403
|
className: (0, X.default)("sf-record-list__item", o),
|
|
14256
14404
|
children: [
|
|
14257
14405
|
e && /* @__PURE__ */ v("span", {
|
|
14258
|
-
className: (0, X.default)("sf-record-list__icon",
|
|
14406
|
+
className: (0, X.default)("sf-record-list__icon", nf[t]),
|
|
14259
14407
|
"aria-hidden": "true",
|
|
14260
14408
|
children: e
|
|
14261
14409
|
}),
|
|
@@ -14280,7 +14428,7 @@ var yr = (e) => {
|
|
|
14280
14428
|
children: a
|
|
14281
14429
|
})
|
|
14282
14430
|
]
|
|
14283
|
-
}),
|
|
14431
|
+
}), af = ({ title: e, action: t, items: n, className: r, ariaLabel: i }) => /* @__PURE__ */ y("section", {
|
|
14284
14432
|
className: (0, X.default)("sf-record-list", r),
|
|
14285
14433
|
"aria-label": i ?? (typeof e == "string" ? e : void 0),
|
|
14286
14434
|
children: [(e || t) && /* @__PURE__ */ y("div", {
|
|
@@ -14294,9 +14442,9 @@ var yr = (e) => {
|
|
|
14294
14442
|
})]
|
|
14295
14443
|
}), /* @__PURE__ */ v("div", {
|
|
14296
14444
|
className: "sf-record-list__items",
|
|
14297
|
-
children: n.map((e, t) => /* @__PURE__ */ v(
|
|
14445
|
+
children: n.map((e, t) => /* @__PURE__ */ v(rf, { ...e }, e.id ?? t))
|
|
14298
14446
|
})]
|
|
14299
|
-
}),
|
|
14447
|
+
}), of = ({ label: e, pulse: t = !0, className: n }) => /* @__PURE__ */ y("span", {
|
|
14300
14448
|
className: (0, X.default)("sf-live-chip", n),
|
|
14301
14449
|
children: [/* @__PURE__ */ v("span", {
|
|
14302
14450
|
className: (0, X.default)("sf-live-chip__dot", t && "sf-live-chip__dot--pulse"),
|
|
@@ -14305,12 +14453,12 @@ var yr = (e) => {
|
|
|
14305
14453
|
className: "sf-live-chip__label",
|
|
14306
14454
|
children: e
|
|
14307
14455
|
})]
|
|
14308
|
-
}),
|
|
14456
|
+
}), sf = {
|
|
14309
14457
|
default: "var(--sf-text, #1B2A38)",
|
|
14310
14458
|
success: "#1F8A4C",
|
|
14311
14459
|
warning: "#C76A12",
|
|
14312
14460
|
danger: "#C0392B"
|
|
14313
|
-
},
|
|
14461
|
+
}, cf = {
|
|
14314
14462
|
display: "flex",
|
|
14315
14463
|
alignItems: "center",
|
|
14316
14464
|
justifyContent: "space-between",
|
|
@@ -14321,110 +14469,110 @@ var yr = (e) => {
|
|
|
14321
14469
|
border: "1px solid var(--sf-border, #E2E8EC)",
|
|
14322
14470
|
borderRadius: 13,
|
|
14323
14471
|
boxShadow: "0 1px 3px rgba(12,33,49,.06), 0 1px 2px rgba(12,33,49,.04)"
|
|
14324
|
-
},
|
|
14472
|
+
}, lf = {
|
|
14325
14473
|
display: "flex",
|
|
14326
14474
|
alignItems: "center",
|
|
14327
14475
|
gap: 14,
|
|
14328
14476
|
flexWrap: "wrap"
|
|
14329
|
-
},
|
|
14477
|
+
}, uf = {
|
|
14330
14478
|
width: 1,
|
|
14331
14479
|
height: 20,
|
|
14332
14480
|
background: "var(--sf-border, #DCE3E7)"
|
|
14333
|
-
},
|
|
14481
|
+
}, df = {
|
|
14334
14482
|
fontSize: 13,
|
|
14335
14483
|
fontWeight: 600,
|
|
14336
14484
|
color: "var(--sf-text-subtle, #8A98A4)"
|
|
14337
|
-
},
|
|
14485
|
+
}, ff = {
|
|
14338
14486
|
fontSize: 15,
|
|
14339
14487
|
fontWeight: 800,
|
|
14340
14488
|
color: "var(--sf-text, #1B2A38)",
|
|
14341
14489
|
fontVariantNumeric: "tabular-nums"
|
|
14342
|
-
},
|
|
14490
|
+
}, pf = {
|
|
14343
14491
|
fontSize: 12.5,
|
|
14344
14492
|
fontWeight: 800,
|
|
14345
14493
|
color: "#C76A12"
|
|
14346
|
-
},
|
|
14494
|
+
}, mf = {
|
|
14347
14495
|
fontSize: 13,
|
|
14348
14496
|
fontWeight: 700,
|
|
14349
14497
|
color: "var(--sf-text-subtle, #5C7180)"
|
|
14350
|
-
},
|
|
14498
|
+
}, hf = {
|
|
14351
14499
|
display: "flex",
|
|
14352
14500
|
alignItems: "center",
|
|
14353
14501
|
gap: 22,
|
|
14354
14502
|
margin: 0
|
|
14355
|
-
},
|
|
14503
|
+
}, gf = {
|
|
14356
14504
|
display: "flex",
|
|
14357
14505
|
alignItems: "baseline",
|
|
14358
14506
|
gap: 6
|
|
14359
|
-
},
|
|
14507
|
+
}, _f = {
|
|
14360
14508
|
fontSize: 10.5,
|
|
14361
14509
|
fontWeight: 700,
|
|
14362
14510
|
letterSpacing: ".05em",
|
|
14363
14511
|
textTransform: "uppercase",
|
|
14364
14512
|
color: "var(--sf-text-subtle, #8A98A4)"
|
|
14365
|
-
},
|
|
14513
|
+
}, vf = ({ liveLabel: e, metrics: t, nextDeparture: n, className: r, ariaLabel: i = "Estado en vivo" }) => /* @__PURE__ */ y("section", {
|
|
14366
14514
|
className: (0, X.default)("sf-live-status-bar", r),
|
|
14367
14515
|
"aria-label": i,
|
|
14368
|
-
style:
|
|
14516
|
+
style: cf,
|
|
14369
14517
|
children: [/* @__PURE__ */ y("div", {
|
|
14370
|
-
style:
|
|
14518
|
+
style: lf,
|
|
14371
14519
|
children: [
|
|
14372
|
-
/* @__PURE__ */ v(
|
|
14520
|
+
/* @__PURE__ */ v(of, { label: "En vivo" }),
|
|
14373
14521
|
/* @__PURE__ */ v("span", {
|
|
14374
|
-
style:
|
|
14522
|
+
style: mf,
|
|
14375
14523
|
children: e
|
|
14376
14524
|
}),
|
|
14377
14525
|
n && /* @__PURE__ */ y(_, { children: [
|
|
14378
14526
|
/* @__PURE__ */ v("span", {
|
|
14379
|
-
style:
|
|
14527
|
+
style: uf,
|
|
14380
14528
|
"aria-hidden": "true"
|
|
14381
14529
|
}),
|
|
14382
14530
|
/* @__PURE__ */ v("span", {
|
|
14383
|
-
style:
|
|
14531
|
+
style: df,
|
|
14384
14532
|
children: n.label ?? "Próxima salida"
|
|
14385
14533
|
}),
|
|
14386
14534
|
/* @__PURE__ */ v("span", {
|
|
14387
|
-
style:
|
|
14535
|
+
style: ff,
|
|
14388
14536
|
children: n.time
|
|
14389
14537
|
}),
|
|
14390
14538
|
n.countdown != null && /* @__PURE__ */ v("span", {
|
|
14391
|
-
style:
|
|
14539
|
+
style: pf,
|
|
14392
14540
|
children: n.countdown
|
|
14393
14541
|
})
|
|
14394
14542
|
] })
|
|
14395
14543
|
]
|
|
14396
14544
|
}), /* @__PURE__ */ v("dl", {
|
|
14397
|
-
style:
|
|
14545
|
+
style: hf,
|
|
14398
14546
|
children: t.map((e, t) => /* @__PURE__ */ y("div", {
|
|
14399
|
-
style:
|
|
14547
|
+
style: gf,
|
|
14400
14548
|
children: [/* @__PURE__ */ v("dd", {
|
|
14401
14549
|
style: {
|
|
14402
14550
|
margin: 0,
|
|
14403
14551
|
fontSize: 20,
|
|
14404
14552
|
fontWeight: 800,
|
|
14405
14553
|
fontVariantNumeric: "tabular-nums",
|
|
14406
|
-
color:
|
|
14554
|
+
color: sf[e.accent ?? "default"]
|
|
14407
14555
|
},
|
|
14408
14556
|
children: e.value
|
|
14409
14557
|
}), /* @__PURE__ */ v("dt", {
|
|
14410
|
-
style:
|
|
14558
|
+
style: _f,
|
|
14411
14559
|
children: e.label
|
|
14412
14560
|
})]
|
|
14413
14561
|
}, e.id ?? `${e.label}-${t}`))
|
|
14414
14562
|
})]
|
|
14415
|
-
}),
|
|
14563
|
+
}), yf = {
|
|
14416
14564
|
success: "sf-timeline__dot--success",
|
|
14417
14565
|
warning: "sf-timeline__dot--warning",
|
|
14418
14566
|
danger: "sf-timeline__dot--danger",
|
|
14419
14567
|
info: "sf-timeline__dot--info",
|
|
14420
14568
|
default: "sf-timeline__dot--default"
|
|
14421
|
-
},
|
|
14569
|
+
}, bf = {
|
|
14422
14570
|
success: "sf-timeline__icon-wrap--success",
|
|
14423
14571
|
warning: "sf-timeline__icon-wrap--warning",
|
|
14424
14572
|
danger: "sf-timeline__icon-wrap--danger",
|
|
14425
14573
|
info: "sf-timeline__icon-wrap--info",
|
|
14426
14574
|
default: "sf-timeline__icon-wrap--default"
|
|
14427
|
-
},
|
|
14575
|
+
}, xf = ({ items: e, ariaLabel: t = "Línea de tiempo", emptyMessage: n = "Sin eventos", className: r }) => /* @__PURE__ */ y("ol", {
|
|
14428
14576
|
className: (0, X.default)("sf-timeline", r),
|
|
14429
14577
|
"aria-label": t,
|
|
14430
14578
|
children: [e.length === 0 && /* @__PURE__ */ v("li", {
|
|
@@ -14443,11 +14591,11 @@ var yr = (e) => {
|
|
|
14443
14591
|
/* @__PURE__ */ v("div", {
|
|
14444
14592
|
className: "sf-timeline__marker",
|
|
14445
14593
|
children: t.icon ? /* @__PURE__ */ v("span", {
|
|
14446
|
-
className: (0, X.default)("sf-timeline__icon-wrap",
|
|
14594
|
+
className: (0, X.default)("sf-timeline__icon-wrap", bf[r]),
|
|
14447
14595
|
"aria-hidden": "true",
|
|
14448
14596
|
children: t.icon
|
|
14449
14597
|
}) : /* @__PURE__ */ v("span", {
|
|
14450
|
-
className: (0, X.default)("sf-timeline__dot",
|
|
14598
|
+
className: (0, X.default)("sf-timeline__dot", yf[r]),
|
|
14451
14599
|
"aria-hidden": "true"
|
|
14452
14600
|
})
|
|
14453
14601
|
}),
|
|
@@ -14470,7 +14618,7 @@ var yr = (e) => {
|
|
|
14470
14618
|
]
|
|
14471
14619
|
}, t.id ?? n);
|
|
14472
14620
|
})]
|
|
14473
|
-
}),
|
|
14621
|
+
}), Sf = ({ items: e, autoPlay: t = !1, intervalMs: n = 4e3, showDots: r = !0, showArrows: i = !0, className: a }) => {
|
|
14474
14622
|
let o = m(null), [c, l] = h(0), d = s((t) => {
|
|
14475
14623
|
let n = o.current;
|
|
14476
14624
|
if (!n || e.length === 0) return;
|
|
@@ -14532,7 +14680,7 @@ var yr = (e) => {
|
|
|
14532
14680
|
})
|
|
14533
14681
|
]
|
|
14534
14682
|
});
|
|
14535
|
-
},
|
|
14683
|
+
}, Cf = ({ src: e, alt: t, aspectRatio: n = "16/9", fit: r = "cover", overlay: i = "none", children: a, rounded: o = !0, loading: s = "lazy", fallback: c, className: l, imgProps: u }) => {
|
|
14536
14684
|
let [d, f] = h(!1), p = !!e && !d;
|
|
14537
14685
|
return /* @__PURE__ */ y("div", {
|
|
14538
14686
|
className: (0, X.default)("sf-media-panel", o && "sf-media-panel--rounded", l),
|
|
@@ -14559,19 +14707,19 @@ var yr = (e) => {
|
|
|
14559
14707
|
})
|
|
14560
14708
|
]
|
|
14561
14709
|
});
|
|
14562
|
-
},
|
|
14710
|
+
}, wf = {
|
|
14563
14711
|
top: 8,
|
|
14564
14712
|
right: 8,
|
|
14565
14713
|
left: 0,
|
|
14566
14714
|
bottom: 0
|
|
14567
|
-
},
|
|
14715
|
+
}, Tf = {
|
|
14568
14716
|
top: 20,
|
|
14569
14717
|
right: 8,
|
|
14570
14718
|
left: 0,
|
|
14571
14719
|
bottom: 0
|
|
14572
|
-
},
|
|
14720
|
+
}, Ef = (e, t) => {
|
|
14573
14721
|
if (t !== "none") return e.stackId ?? "sf-stack";
|
|
14574
|
-
},
|
|
14722
|
+
}, Df = (e) => e?.map((e, t) => {
|
|
14575
14723
|
let n = e.color ?? "var(--sf-chart-reference)", r = {
|
|
14576
14724
|
stroke: n,
|
|
14577
14725
|
strokeDasharray: e.strokeDasharray ?? "4 4",
|
|
@@ -14602,7 +14750,7 @@ var yr = (e) => {
|
|
|
14602
14750
|
}
|
|
14603
14751
|
})
|
|
14604
14752
|
}, `ref-${t}`);
|
|
14605
|
-
}),
|
|
14753
|
+
}), Of = ({ type: e, data: t, xKey: n, series: r, height: i = 280, ariaLabel: a, emptyMessage: o = "Sin datos para mostrar", className: s, showGrid: c = !0, showTooltip: l = !0, showLegend: u = r.length > 1, orientation: d = "vertical", stacking: f = "none", unit: m, yDomain: h, xAxisFormat: g, yAxisFormat: b, tooltipFormat: x, valueLabelFormat: S, showValueLabels: C = !1, referenceLines: w, onDataPointClick: T }) => {
|
|
14606
14754
|
let E = e === "bar" && d === "horizontal", D = e === "line" ? "none" : f, O = D === "stacked-100", k = p(() => O ? is(t, r) : t, [
|
|
14607
14755
|
t,
|
|
14608
14756
|
r,
|
|
@@ -14637,7 +14785,7 @@ var yr = (e) => {
|
|
|
14637
14785
|
0,
|
|
14638
14786
|
0
|
|
14639
14787
|
],
|
|
14640
|
-
stackId:
|
|
14788
|
+
stackId: Ef(e, D),
|
|
14641
14789
|
maxBarSize: D === "none" ? 48 : void 0,
|
|
14642
14790
|
children: R(e.key)
|
|
14643
14791
|
}, e.key))
|
|
@@ -14673,7 +14821,7 @@ var yr = (e) => {
|
|
|
14673
14821
|
fill: n,
|
|
14674
14822
|
fillOpacity: .15,
|
|
14675
14823
|
strokeWidth: 2,
|
|
14676
|
-
stackId:
|
|
14824
|
+
stackId: Ef(e, D),
|
|
14677
14825
|
children: R(e.key)
|
|
14678
14826
|
}, e.key);
|
|
14679
14827
|
})
|
|
@@ -14690,7 +14838,7 @@ var yr = (e) => {
|
|
|
14690
14838
|
children: /* @__PURE__ */ y(z, {
|
|
14691
14839
|
data: k,
|
|
14692
14840
|
layout: E ? "vertical" : "horizontal",
|
|
14693
|
-
margin: C ?
|
|
14841
|
+
margin: C ? Tf : wf,
|
|
14694
14842
|
onClick: ee,
|
|
14695
14843
|
children: [
|
|
14696
14844
|
c && /* @__PURE__ */ v(ce, {
|
|
@@ -14728,7 +14876,7 @@ var yr = (e) => {
|
|
|
14728
14876
|
formatter: L
|
|
14729
14877
|
}),
|
|
14730
14878
|
u && /* @__PURE__ */ v(de, { wrapperStyle: $o }),
|
|
14731
|
-
|
|
14879
|
+
Df(w),
|
|
14732
14880
|
B()
|
|
14733
14881
|
]
|
|
14734
14882
|
})
|
|
@@ -14738,7 +14886,7 @@ var yr = (e) => {
|
|
|
14738
14886
|
children: o
|
|
14739
14887
|
})
|
|
14740
14888
|
});
|
|
14741
|
-
},
|
|
14889
|
+
}, kf = ({ x: e, y: t, payload: n, data: r, showValues: i, format: a, color: o }) => {
|
|
14742
14890
|
let s = r.find((e) => e.label === n.value);
|
|
14743
14891
|
return /* @__PURE__ */ y("g", { children: [/* @__PURE__ */ v("text", {
|
|
14744
14892
|
x: e,
|
|
@@ -14759,7 +14907,7 @@ var yr = (e) => {
|
|
|
14759
14907
|
},
|
|
14760
14908
|
children: a(s.value, s.key)
|
|
14761
14909
|
})] });
|
|
14762
|
-
},
|
|
14910
|
+
}, Af = ({ data: e, max: t = 100, color: n, height: r = 280, ariaLabel: i = "Diagnóstico", emptyMessage: a = "Sin datos para mostrar", className: o, showTooltip: s = !0, showLegend: c = !1, showValues: l = !1, valueFormat: u }) => {
|
|
14763
14911
|
let d = e.length > 0, f = Xo({ color: n }, 0), p = u ?? ts();
|
|
14764
14912
|
return /* @__PURE__ */ v("div", {
|
|
14765
14913
|
className: (0, X.default)("sf-chart", o),
|
|
@@ -14776,7 +14924,7 @@ var yr = (e) => {
|
|
|
14776
14924
|
/* @__PURE__ */ v(he, { stroke: "var(--sf-chart-grid)" }),
|
|
14777
14925
|
/* @__PURE__ */ v(me, {
|
|
14778
14926
|
dataKey: "label",
|
|
14779
|
-
tick: /* @__PURE__ */ v(
|
|
14927
|
+
tick: /* @__PURE__ */ v(kf, {
|
|
14780
14928
|
x: 0,
|
|
14781
14929
|
y: 0,
|
|
14782
14930
|
payload: { value: "" },
|
|
@@ -14814,8 +14962,8 @@ var yr = (e) => {
|
|
|
14814
14962
|
children: a
|
|
14815
14963
|
})
|
|
14816
14964
|
});
|
|
14817
|
-
},
|
|
14818
|
-
let l = o ?? ts(i), u = Math.abs(e - t) || Math.abs(t) * .1 || 1, d = n ?? Math.min(e, t) - u * .5, f = r ?? Math.max(e, t) + u * .5, p = (e) => f > d ?
|
|
14965
|
+
}, jf = (e) => Math.min(100, Math.max(0, e)), Mf = ({ value: e, average: t, min: n, max: r, unit: i, label: a, valueFormat: o, direction: s = "down-good", className: c }) => {
|
|
14966
|
+
let l = o ?? ts(i), u = Math.abs(e - t) || Math.abs(t) * .1 || 1, d = n ?? Math.min(e, t) - u * .5, f = r ?? Math.max(e, t) + u * .5, p = (e) => f > d ? jf((e - d) / (f - d) * 100) : 50, m = p(e), h = p(t), g = t === 0 ? 0 : (e - t) / Math.abs(t) * 100, _ = s === "neutral" ? null : s === "down-good" ? g <= 0 : g >= 0, b = Math.abs(g) >= .5;
|
|
14819
14967
|
return /* @__PURE__ */ y("div", {
|
|
14820
14968
|
className: (0, X.default)("sf-deviation-band", c),
|
|
14821
14969
|
children: [
|
|
@@ -14855,7 +15003,7 @@ var yr = (e) => {
|
|
|
14855
15003
|
})
|
|
14856
15004
|
]
|
|
14857
15005
|
});
|
|
14858
|
-
},
|
|
15006
|
+
}, Nf = (e, { initialPageSize: t = 10 } = {}) => {
|
|
14859
15007
|
let [n, r] = h(""), [i, a] = h(0), [o, s] = h(t), c = p(() => {
|
|
14860
15008
|
let t = n.trim().toLowerCase();
|
|
14861
15009
|
return t ? e.filter((e) => Object.values(e).some((e) => String(e ?? "").toLowerCase().includes(t))) : e;
|
|
@@ -14882,37 +15030,37 @@ var yr = (e) => {
|
|
|
14882
15030
|
]),
|
|
14883
15031
|
totalItems: l
|
|
14884
15032
|
};
|
|
14885
|
-
},
|
|
14886
|
-
let n =
|
|
15033
|
+
}, Pf = (e) => String(e ?? "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim(), Ff = (e) => typeof e == "string" || typeof e == "number", If = (e, t) => {
|
|
15034
|
+
let n = Pf(t);
|
|
14887
15035
|
return typeof t == "number" && (n = `#${n}`), e.toLowerCase().endsWith("codigo") && !n.startsWith("#") && (n = `.${n}`), n;
|
|
14888
|
-
},
|
|
15036
|
+
}, Lf = (e, t, n) => {
|
|
14889
15037
|
if (t?.length) return [...t];
|
|
14890
15038
|
let r = new Set(n), i = [];
|
|
14891
|
-
for (let t in e) r.has(t) ||
|
|
15039
|
+
for (let t in e) r.has(t) || Ff(e[t]) && i.push(t);
|
|
14892
15040
|
return i;
|
|
14893
|
-
},
|
|
14894
|
-
let r = "", i =
|
|
15041
|
+
}, Rf = (e, t, n) => {
|
|
15042
|
+
let r = "", i = Lf(e, t, n);
|
|
14895
15043
|
for (let t of i) {
|
|
14896
15044
|
let n = e[t];
|
|
14897
|
-
if (!
|
|
14898
|
-
let i =
|
|
15045
|
+
if (!Ff(n)) continue;
|
|
15046
|
+
let i = If(t, n);
|
|
14899
15047
|
i && (r += `${i} `);
|
|
14900
15048
|
}
|
|
14901
15049
|
return r;
|
|
14902
|
-
},
|
|
15050
|
+
}, zf = (e) => {
|
|
14903
15051
|
let t = e.split(";"), n = [];
|
|
14904
15052
|
for (let e of t) {
|
|
14905
|
-
let t =
|
|
15053
|
+
let t = Pf(e);
|
|
14906
15054
|
t.length >= 2 && n.push(t);
|
|
14907
15055
|
}
|
|
14908
15056
|
return n;
|
|
14909
|
-
},
|
|
14910
|
-
let [n, r] = h(""), i = l(n), a = t?.filters, o = t?.searchableKeys, s = t?.ignoredKeys, c = p(() =>
|
|
15057
|
+
}, Bf = (e, t) => {
|
|
15058
|
+
let [n, r] = h(""), i = l(n), a = t?.filters, o = t?.searchableKeys, s = t?.ignoredKeys, c = p(() => zf(i), [i]), u = p(() => {
|
|
14911
15059
|
if (!e?.length) return [];
|
|
14912
15060
|
let t = [];
|
|
14913
15061
|
for (let n of e) t.push({
|
|
14914
15062
|
item: n,
|
|
14915
|
-
searchIndex:
|
|
15063
|
+
searchIndex: Rf(n, o, s)
|
|
14916
15064
|
});
|
|
14917
15065
|
return t;
|
|
14918
15066
|
}, [
|
|
@@ -14954,15 +15102,15 @@ var yr = (e) => {
|
|
|
14954
15102
|
};
|
|
14955
15103
|
//#endregion
|
|
14956
15104
|
//#region src/hooks/useArrayPaginator.ts
|
|
14957
|
-
function
|
|
15105
|
+
function Vf(e, t, n) {
|
|
14958
15106
|
if (t <= 0) return [];
|
|
14959
15107
|
let r = Math.max(0, n);
|
|
14960
15108
|
return r >= e.length ? [] : e.slice(r, r + t);
|
|
14961
15109
|
}
|
|
14962
|
-
var
|
|
15110
|
+
var Hf = (e, t, n) => {
|
|
14963
15111
|
let r = e?.[n], i = t?.[n];
|
|
14964
15112
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : typeof r == "boolean" && typeof i == "boolean" ? Number(r) - Number(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : typeof r == "string" && typeof i == "string" ? r.localeCompare(i, void 0, { sensitivity: "base" }) : String(r).localeCompare(String(i), void 0, { sensitivity: "base" });
|
|
14965
|
-
},
|
|
15113
|
+
}, Uf = (e, t) => {
|
|
14966
15114
|
let [n, r] = h([]), [i, a] = h(() => ({
|
|
14967
15115
|
limit: Math.max(1, t?.limit ?? 100),
|
|
14968
15116
|
offset: 0
|
|
@@ -14975,7 +15123,7 @@ var Ff = (e, t, n) => {
|
|
|
14975
15123
|
if (e.length === 0) return [];
|
|
14976
15124
|
let r = [...e];
|
|
14977
15125
|
if (n.length > 0) {
|
|
14978
|
-
let e = t?.onSortFunc ??
|
|
15126
|
+
let e = t?.onSortFunc ?? Hf, i = t?.strictSort ?? !1;
|
|
14979
15127
|
r.sort((t, r) => {
|
|
14980
15128
|
for (let { id: a, desc: o } of n) {
|
|
14981
15129
|
if (i && (!(typeof t == "object" && t) || !(typeof r == "object" && r) || !(a in t) || !(a in r))) continue;
|
|
@@ -14985,7 +15133,7 @@ var Ff = (e, t, n) => {
|
|
|
14985
15133
|
return 0;
|
|
14986
15134
|
});
|
|
14987
15135
|
}
|
|
14988
|
-
return
|
|
15136
|
+
return Vf(r, o, c);
|
|
14989
15137
|
}, [
|
|
14990
15138
|
e,
|
|
14991
15139
|
o,
|
|
@@ -15004,7 +15152,7 @@ var Ff = (e, t, n) => {
|
|
|
15004
15152
|
onSortChange: r,
|
|
15005
15153
|
pageData: u
|
|
15006
15154
|
};
|
|
15007
|
-
},
|
|
15155
|
+
}, Wf = (e, t) => {
|
|
15008
15156
|
if (typeof window > "u") return t;
|
|
15009
15157
|
try {
|
|
15010
15158
|
let n = window.localStorage.getItem(e);
|
|
@@ -15012,8 +15160,8 @@ var Ff = (e, t, n) => {
|
|
|
15012
15160
|
} catch {
|
|
15013
15161
|
return t;
|
|
15014
15162
|
}
|
|
15015
|
-
},
|
|
15016
|
-
let [n, r] = h(() =>
|
|
15163
|
+
}, Gf = (e, t) => {
|
|
15164
|
+
let [n, r] = h(() => Wf(e, t));
|
|
15017
15165
|
return [n, (t) => {
|
|
15018
15166
|
r((n) => {
|
|
15019
15167
|
let r = typeof t == "function" ? t(n) : t;
|
|
@@ -15023,52 +15171,52 @@ var Ff = (e, t, n) => {
|
|
|
15023
15171
|
return r;
|
|
15024
15172
|
});
|
|
15025
15173
|
}];
|
|
15026
|
-
},
|
|
15174
|
+
}, Kf = (e) => typeof window > "u" ? null : new URL(window.location.href).searchParams.get(e), qf = (e, t) => {
|
|
15027
15175
|
if (typeof window > "u") return;
|
|
15028
15176
|
let n = new URL(window.location.href);
|
|
15029
15177
|
t != null && t !== "" ? n.searchParams.set(e, t) : n.searchParams.delete(e), window.history.replaceState(null, "", n.toString());
|
|
15030
|
-
},
|
|
15031
|
-
|
|
15032
|
-
},
|
|
15178
|
+
}, Jf = (e) => {
|
|
15179
|
+
qf(e, null);
|
|
15180
|
+
}, Yf = (e, t) => {
|
|
15033
15181
|
let [n, r] = h(() => {
|
|
15034
15182
|
let n = typeof e == "function" ? e() : e;
|
|
15035
15183
|
if (!t) return n;
|
|
15036
|
-
let r =
|
|
15037
|
-
return r == null || r === "" ? (
|
|
15184
|
+
let r = Kf(t);
|
|
15185
|
+
return r == null || r === "" ? (qf(t, n), n) : r;
|
|
15038
15186
|
});
|
|
15039
15187
|
return [n, (e) => {
|
|
15040
15188
|
r((n) => {
|
|
15041
15189
|
let r = typeof e == "function" ? e(n) : e;
|
|
15042
|
-
return t &&
|
|
15190
|
+
return t && qf(t, r), r;
|
|
15043
15191
|
});
|
|
15044
15192
|
}];
|
|
15045
|
-
},
|
|
15193
|
+
}, Xf = () => {
|
|
15046
15194
|
let e = globalThis.process?.env?.NODE_ENV;
|
|
15047
15195
|
return e != null && e === "development";
|
|
15048
|
-
},
|
|
15196
|
+
}, Zf = (e, t) => {
|
|
15049
15197
|
let n = x({
|
|
15050
15198
|
resolver: Te(e),
|
|
15051
15199
|
defaultValues: t?.defaultValues
|
|
15052
15200
|
}), r = (e, t) => n.handleSubmit(e, (e, n) => {
|
|
15053
|
-
|
|
15201
|
+
Xf() && console.log(e), t?.(e, n);
|
|
15054
15202
|
});
|
|
15055
15203
|
return {
|
|
15056
15204
|
...n,
|
|
15057
15205
|
handleSubmit: r
|
|
15058
15206
|
};
|
|
15059
|
-
},
|
|
15207
|
+
}, Qf = (e) => {
|
|
15060
15208
|
let t = String(e ?? ""), n = 0;
|
|
15061
15209
|
for (; n < t.length && t.charCodeAt(n) <= 32;) n += 1;
|
|
15062
15210
|
let r = t.slice(n);
|
|
15063
15211
|
return /^[=+\-@]/.test(r) ? `'${t}` : t;
|
|
15064
|
-
},
|
|
15065
|
-
let t =
|
|
15212
|
+
}, $f = (e) => {
|
|
15213
|
+
let t = Qf(e);
|
|
15066
15214
|
return /[",\n\r]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
15067
|
-
},
|
|
15215
|
+
}, ep = (e, t) => {
|
|
15068
15216
|
if (typeof document > "u") return;
|
|
15069
|
-
let n = `\uFEFF${[t.columns.map((e) =>
|
|
15217
|
+
let n = `\uFEFF${[t.columns.map((e) => $f(e.header)).join(","), ...e.map((e) => t.columns.map((t) => $f(t.getValue(e))).join(","))].join("\n")}`, r = new Blob([n], { type: "text/csv;charset=utf-8" }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
15070
15218
|
a.href = i, a.download = t.filename ?? "export.csv", a.click(), URL.revokeObjectURL(i);
|
|
15071
|
-
},
|
|
15219
|
+
}, tp = (e) => Qf(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), np = (e) => typeof e == "number" && Number.isFinite(e) ? "Number" : "String", rp = (e, t) => {
|
|
15072
15220
|
if (typeof document > "u") return;
|
|
15073
15221
|
let { columns: n, filename: r = "export.xls" } = t, i = `<?xml version="1.0"?>
|
|
15074
15222
|
<?mso-application progid="Excel.Sheet"?>
|
|
@@ -15081,51 +15229,51 @@ var Ff = (e, t, n) => {
|
|
|
15081
15229
|
</Styles>
|
|
15082
15230
|
<Worksheet ss:Name="Export">
|
|
15083
15231
|
<Table>
|
|
15084
|
-
<Row>${n.map((e) => `<Cell ss:StyleID="Header"><Data ss:Type="String">${
|
|
15232
|
+
<Row>${n.map((e) => `<Cell ss:StyleID="Header"><Data ss:Type="String">${tp(e.header)}</Data></Cell>`).join("")}</Row>
|
|
15085
15233
|
${e.map((e) => `<Row>${n.map((t) => {
|
|
15086
|
-
let n = t.getValue(e), r =
|
|
15087
|
-
return `<Cell><Data ss:Type="${r}">${r === "Number" ? String(n) :
|
|
15234
|
+
let n = t.getValue(e), r = np(n);
|
|
15235
|
+
return `<Cell><Data ss:Type="${r}">${r === "Number" ? String(n) : tp(n)}</Data></Cell>`;
|
|
15088
15236
|
}).join("")}</Row>`).join("")}
|
|
15089
15237
|
</Table>
|
|
15090
15238
|
</Worksheet>
|
|
15091
15239
|
</Workbook>`, a = new Blob([i], { type: "application/vnd.ms-excel" }), o = URL.createObjectURL(a), s = document.createElement("a");
|
|
15092
15240
|
s.href = o, s.download = r.endsWith(".xls") || r.endsWith(".xlsx") ? r : `${r}.xls`, s.click(), URL.revokeObjectURL(o);
|
|
15093
|
-
},
|
|
15241
|
+
}, ip = "Este campo es requerido", ap = "Introduce una dirección de correo electrónico válida", op = "El correo electrónico es obligatorio", sp = "El valor de este campo es inválido", cp = "Introduce un número de celular válido", lp = (e) => e == null ? null : typeof e == "string" ? e.trim() === "" ? null : e.trim() : e, up = (e = ip) => G.string().transform(lp).required(e), dp = () => G.string().transform(lp).default(null).nullable(), fp = (e = op) => G.string().transform(lp).email(ap).required(e), pp = (e = ap) => G.string().transform(lp).test("emailTest", e, (e) => e == null || e === "" || G.string().email().isValidSync(e)).default(null).nullable(), mp = (e, t = sp, n = ip) => G.string().transform(lp).trim().test("rgxValidation", t, (t) => t == null || t === "" || t.match(e) != null).required(n), hp = (e, t = sp) => G.string().transform(lp).test("rgxValidation", t, (t) => t == null || t === "" || t.match(e) != null).default(null).nullable(), gp = (e) => {
|
|
15094
15242
|
let t = e?.minLength == null ? void 0 : Math.max(1, e.minLength);
|
|
15095
15243
|
return {
|
|
15096
15244
|
minLength: t,
|
|
15097
15245
|
maxLength: e?.maxLength == null ? void 0 : Math.max(t ?? 1, e.maxLength)
|
|
15098
15246
|
};
|
|
15099
|
-
},
|
|
15100
|
-
let { minLength: t, maxLength: n } =
|
|
15247
|
+
}, _p = (e) => {
|
|
15248
|
+
let { minLength: t, maxLength: n } = gp(e), r = /^[0-9]+$/, i = G.string().transform(lp).test("rgxValidation", (e, t) => e == null || e === "" || e.match(r) != null || t.createError({ message: "El campo debe contener solo caracteres numéricos" }));
|
|
15101
15249
|
return t != null && (i = i.min(t, `El campo debe tener al menos ${t} caracteres`)), n != null && (i = i.max(n, `La longitud máxima permitida es de ${n} caracteres`)), i;
|
|
15102
|
-
},
|
|
15250
|
+
}, vp = (e) => _p(e).required(ip), yp = (e) => _p(e).default(null).nullable(), bp = (e = ip) => G.boolean().typeError("El tipo de dato debe ser booleano").required(e), xp = () => G.boolean().typeError("El tipo de dato debe ser booleano").default(null).nullable(), Sp = (e, t) => t == null || t === "" ? null : Number.isNaN(e) ? void 0 : e, Cp = (e = ip) => G.number().transform(Sp).typeError("Debe ser numérico").required(e), wp = () => G.number().transform(Sp).typeError("Debe ser numérico").default(null).nullable().notRequired(), Tp = (e = ip) => G.number().transform(Sp).typeError("Este campo debe ser un valor número").min(0, "Este campo debe ser un valor número positivo").required(e), Ep = (e = ip) => Tp(e).integer("Este campo debe ser un número entero"), Dp = () => G.number().transform(Sp).typeError("Este campo debe ser un valor número").min(0, "Este campo debe ser un valor número positivo").default(null).nullable(), Op = () => Dp().integer("Este campo debe ser un número entero"), kp = (e) => {
|
|
15103
15251
|
let t = /^(?:\+51)\s?[0-9]{3}\s?[0-9]{3}\s?[0-9]{3}$/;
|
|
15104
15252
|
return G.string().transform((e) => e == null ? null : typeof e == "string" ? e.trim() === "" ? null : e.trim().startsWith("+") ? e.trim() : `+51 ${e.trim()}` : e).test("rgxValidation", e, (e) => e == null || e === "" || e.match(t) != null).default(null);
|
|
15105
|
-
},
|
|
15106
|
-
transformNullIfEmpty:
|
|
15107
|
-
requiredString:
|
|
15108
|
-
nullableString:
|
|
15109
|
-
requiredEmail:
|
|
15110
|
-
nullableEmail:
|
|
15111
|
-
requiredMatchString:
|
|
15112
|
-
nullableOrMatchString:
|
|
15113
|
-
requiredStringNumbersOnly:
|
|
15114
|
-
nullableStringNumbersOnly:
|
|
15115
|
-
requiredBoolean:
|
|
15116
|
-
nullableBoolean:
|
|
15117
|
-
requiredNumber:
|
|
15118
|
-
nullableNumber:
|
|
15119
|
-
requiredPositiveNumber:
|
|
15120
|
-
requiredPositiveInteger:
|
|
15121
|
-
nullablePositiveNumber:
|
|
15122
|
-
nullablePositiveInteger:
|
|
15123
|
-
nullableCelular:
|
|
15124
|
-
requiredCelular:
|
|
15125
|
-
requiredStringArray:
|
|
15126
|
-
nullableStringArray:
|
|
15127
|
-
},
|
|
15253
|
+
}, Ap = (e = cp) => kp(e).nullable(), jp = (e = cp) => kp(e).required(ip), Mp = (e = ip) => G.array().of(up()).min(1, "Debe contener al menos un elemento").required(e), Np = () => G.array().of(dp()).default(null).nullable(), Pp = {
|
|
15254
|
+
transformNullIfEmpty: lp,
|
|
15255
|
+
requiredString: up,
|
|
15256
|
+
nullableString: dp,
|
|
15257
|
+
requiredEmail: fp,
|
|
15258
|
+
nullableEmail: pp,
|
|
15259
|
+
requiredMatchString: mp,
|
|
15260
|
+
nullableOrMatchString: hp,
|
|
15261
|
+
requiredStringNumbersOnly: vp,
|
|
15262
|
+
nullableStringNumbersOnly: yp,
|
|
15263
|
+
requiredBoolean: bp,
|
|
15264
|
+
nullableBoolean: xp,
|
|
15265
|
+
requiredNumber: Cp,
|
|
15266
|
+
nullableNumber: wp,
|
|
15267
|
+
requiredPositiveNumber: Tp,
|
|
15268
|
+
requiredPositiveInteger: Ep,
|
|
15269
|
+
nullablePositiveNumber: Dp,
|
|
15270
|
+
nullablePositiveInteger: Op,
|
|
15271
|
+
nullableCelular: Ap,
|
|
15272
|
+
requiredCelular: jp,
|
|
15273
|
+
requiredStringArray: Mp,
|
|
15274
|
+
nullableStringArray: Np
|
|
15275
|
+
}, Fp = (e) => G.object().shape(e(Pp));
|
|
15128
15276
|
//#endregion
|
|
15129
|
-
export { Qr as AccessDenied, ra as Accordion, Hr as ActionButton, Dr as ActiveFiltersBar,
|
|
15277
|
+
export { Qr as AccessDenied, ra as Accordion, Hr as ActionButton, Dr as ActiveFiltersBar, Mu as AddressSearchInput, Wr as Alert, Fc as AlertLane, Mc as AlertRowList, Lc as AlertSummaryList, Td as AllocationBar, go as AppBarContainer, ho as AppShell, uo as AppsGridIcon, Hu as AreaInput, xn as AsyncCardSelect, vr as AsyncCustomTable, yn as AsyncSearchSelect, wn as AsyncSearchTableSelect, tf as AuditTimeline, Da as Avatar, Oa as AvatarGroup, ja as Badge, $t as BooleanCheckbox, ta as Breadcrumb, $ as Button, Lr as ButtonGroup, Yo as CHART_SERIES_COLORS, nn as COUNTRY_DIAL_CODES, tn as CURRENCY_SYMBOLS, ac as Calendar, xd as CardRadioGroup, bn as CardSelect, Sf as Carousel, Of as Chart, Jt as Checkbox, Yt as CheckboxGroup, ko as CodeEditor, _d as ColorInput, Ii as CommandPalette, Bc as ComparisonTable, di as ConfirmDialog, wi as ContextMenuProvider, Fu as CoordinatesInput, fn as CurrencyInput, _r as CustomTable, Kc as DashboardCard, Xc as DashboardGrid, el as DashboardLayout, Zc as DashboardSection, $c as DashboardStatBar, Mt as DateInput, Lt as DatePicker, sl as DateRangeFields, Nn as DateRangeInput, cl as DateRangeUtcInput, oo as DateWeekStrip, nl as DetailSection, tl as DetailSidePanel, Mf as DeviationBand, Af as DiagnosticRadar, Bn as DisplayField, sn as DniInput, Sc as DonutBreakdown, hc as DonutGauge, gc as DonutGaugeRow, Mi as Drawer, gi as DropdownMenu, _i as DropdownMenuItem, Nr as EditableDataGrid, Gr as EmptyState, zs as EntityCard, Vs as EntityCardGrid, qr as ErrorView, Dc as EventLog, Rc as EvidenceFootnote, Ir as ExpandableTableSection, Z as FieldLayout, Sl as FileDropInput, Rn as FileInput, va as FilterBar, ba as FilterBarDate, ya as FilterBarField, xa as FilterBarSelect, Sa as FilterBarText, Br as FormActions, ha as FormWizard, Xi as HeightProvider, kt as Input, Ta as ItineraryEditor, vs as KPICard, bs as KPIGrid, yd as KeyValueInput, of as LiveChip, Za as LiveRouteBoard, vf as LiveStatusBar, Xr as LoadingView, Pu as LocationPicker, jo as MIN_MAP_GEOCODER_QUERY_LENGTH, Qs as MONTH_NAMES, Ca as MaestroLayout, Ml as MapFrame, Pl as MapLegend, Jo as MapPicker, Nl as MapStatus, Fl as MapToolbar, Il as MapVehiclePopup, Nu as MapView, _a as MasterDetailLayout, ga as MasterDetailListItem, Cf as MediaPanel, pi as MessageDialog, ks as MetricBarList, Os as MetricBarRow, li as Modal, qs as ModuleCard, Js as ModuleCardGrid, Tl as MultiPhotoInput, Fd as NETWORK_BASEMAPS, Bd as NETWORK_EDGE_STYLES, Ld as NETWORK_KIND_COLORS, Id as NETWORK_KIND_LABELS, Rd as NETWORK_STATUS_COLORS, zd as NETWORK_STATUS_LABELS, nr as NUMBER_FILTER_OPS, Jd as NetworkLegend, $d as NetworkMap, ki as NotificationBell, jt as NumberInput, ld as NumberStepper, Od as ORG_TREE_DEFAULT_THEMES, vi as OptionItem, Pd as OrgTree, al as OtpInput, zi as PageContainer, Vi as PageHeader, er as PaginationRangeInput, za as PassengerBoardCard, zt as PasswordInput, un as PhoneInput, Al as PhotoCropInput, Cl as PhotoInput, Nt as Popover, Ri as ProductTour, fd as ProgressBar, md as ProgressBarReadonly, Di as QRView, Ts as QuickActionGrid, ws as QuickActionTile, Xt as RadioGroup, dd as RangeSliderInput, hd as RatingInput, Ws as RecommendationCard, af as RecordList, rf as RecordListItem, Zr as RetryBlock, Co as RichTextEditor, Uu as RouteInput, zr as RowActions, cn as RucInput, Rl as SF_DEFAULT_MAP_CENTER, zl as SF_DEFAULT_MAP_ZOOM, Ul as SF_GOOGLE_ENGINE_CAPABILITIES, Hl as SF_LEAFLET_ENGINE_CAPABILITIES, Ll as SF_MAPS_CONFIG_ERROR, Vl as SF_OSM_ATTRIBUTION, Bl as SF_OSM_TILE_URL, tr as STRING_FILTER_OPS, ia as ScrollArea, _n as SearchSelect, Cn as SearchTableSelect, qt as Select, Sd as SemanticSlider, ea as Separator, Tu as SfProvider, Ni as Sheet, Hi as SidePanel, Ji as SidePanelContainer, wl as SignaturePad, ei as Skeleton, ad as SliderInput, Fn as SmartDateInput, pn as SmartInput, Wu as SmartMapInput, El as SmartMediaInput, Tn as SmartSelect, bd as SortableList, as as Sparkline, Yr as Spinner, Cs as SplitBar, Zs as StatCard, fa as Stepper, aa as SummaryItem, fo as SyncIcon, yi as TabMenuOption, Er as TableColumnSettings, or as TableFiltersPanel, Bi as TablePageLayout, sr as TableSortingPanel, Ui as Tabs, vd as TagsInput, Dd as TemporalScrub, At as TextArea, Pn as TimeRangeInput, xf as Timeline, oi as ToastProvider, Zt as Toggle, Qt as ToggleCard, Rr as ToolbarButton, Ai as Tooltip, Ys as TramoCard, Kt as Transfer, Wt as TreeSelect, Qa as UnitSelector, Qi as Visibility, $i as Visivility, $s as WEEKDAY_LABELS, lo as WeekdayToggleStrip, en as YesNoSelect, ka as badgeClassName, Aa as badgeDotClassName, Ar as buildActiveFilterChips, ts as buildDefaultFormatter, nc as buildMonthGrid, kd as buildOrgTreeRows, Gt as buttonClassName, Mn as calcTimeDuration, Ju as clampNumber, Eo as codeEditorClassName, ar as columnFilterFn, Wd as countNetworkStatus, jd as countOrgTreeNodes, Fp as createFormSchema, Yn as createLocalStorageAsyncStateStore, hl as createPhotoItem, yl as cropImageToSquare, Hf as defaultOnSortFunc, ll as emptyDateRange, Qu as emptyKeyValuePairs, ed as emptyNumberRange, jl as emptyPhotoItems, Xu as emptyTags, ul as emptyTimeRange, ep as exportTableCsv, rp as exportTableXlsx, Q as fieldClassName, kr as formatColumnFilterValue, No as formatMapGeocoderLabel, Yu as formatSliderLabel, kn as fromUtcDateIso, ir as inferInitialFilterValue, Dt as inputFocusTransition, Mr as isBlankRow, rr as isColumnFilterValue, Dn as isValidDateString, pl as isValidFileType, qd as networkEdgeLines, Gd as networkMapBounds, Kd as networkNodePositions, fl as nextPhotoId, An as normalizeDateRange, nd as normalizeHexColor, $u as normalizeKeyValuePairs, Ud as normalizeNetworkEdges, Hd as normalizeNetworkNodes, td as normalizeNumberRange, vl as normalizePhotoItems, Zu as normalizeTags, jn as normalizeTimeRange, xp as nullableBoolean, Ap as nullableCelular, pp as nullableEmail, wp as nullableNumber, hp as nullableOrMatchString, Op as nullablePositiveInteger, Dp as nullablePositiveNumber, dp as nullableString, Np as nullableStringArray, yp as nullableStringNumbersOnly, Md as orgTreeRootNodes, tc as parseYMD, rd as progressPercent, rs as rawValueKey, Kf as readQueryValue, Jf as removeQueryValue, bp as requiredBoolean, jp as requiredCelular, fp as requiredEmail, mp as requiredMatchString, Cp as requiredNumber, Ep as requiredPositiveInteger, Tp as requiredPositiveNumber, up as requiredString, Mp as requiredStringArray, vp as requiredStringNumbersOnly, Ad as resolveOrgTreeTheme, Xo as resolveSeriesColor, gl as revokePhotoPreview, _l as revokePhotoPreviews, rn as sanitizeDigits, Mo as searchMapAddresses, pu as sfClampLatitude, mu as sfClampLongitude, du as sfFormatCoordinate, gu as sfLatLngToString, vu as sfMarkerFromLatLng, _u as sfNormalizeLatLng, hu as sfParseCoordinate, ml as showFilePicker, Ot as textareaClassName, to as toIsoDate, En as toLocalDateYMD, ec as toLocalYMD, is as toStacked100Data, Ut as toStringArray, On as toUtcDateIso, lp as transformNullIfEmpty, qf as updateQueryValue, Ou as useAddressSearch, Uf as useArrayPaginator, vn as useAsyncOptions, bi as useClickAway, Zi as useContainerHeight, Ei as useContextMenu, Zf as useCustomForm, yr as useCustomTableController, hi as useDropdownClose, Bf as useFilterData, ma as useFormWizard, To as useIsClient, Nf as useMaestroFilter, ku as useMapEngine, Au as useMapsConfig, ui as useModal, Yf as useQueryStringState, Eu as useSf, Du as useSfMaps, Ki as useSidePanelContainer, Wi as useSidePanelHandle, Gf as useStoredState, wr as useTableColumnSettings, si as useToast, on as validateDni, an as validateRuc, Pp as validators };
|
|
15130
15278
|
|
|
15131
15279
|
//# sourceMappingURL=sf-ui.js.map
|