@burdenoff/microfe-timecampus 2026.1203.2 → 2026.1204.1
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/timecampus/components/EmptyState.d.ts +7 -0
- package/dist/timecampus/components/EmptyState.js +3 -2
- package/dist/timecampus/components/EmptyState.js.map +1 -1
- package/dist/timecampus/components/FilterBar.js +1 -0
- package/dist/timecampus/pages/admin/AdminPage.js +264 -264
- package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +78 -78
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.js +34 -34
- package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +49 -48
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +107 -102
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +129 -124
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +94 -94
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js +97 -97
- package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +120 -120
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/geofencing/GeofencingPage.js +343 -343
- package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +25 -25
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +296 -296
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js +189 -189
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js +47 -46
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js +206 -206
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +72 -71
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js +32 -31
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +34 -34
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectDetailPage.js +163 -163
- package/dist/timecampus/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.js +193 -192
- package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/TasksPage.js +92 -92
- package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +60 -60
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/settings/IdleDetectionCard.js +33 -33
- package/dist/timecampus/pages/settings/IdleDetectionCard.js.map +1 -1
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js +32 -32
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +163 -163
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js +32 -32
- package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +84 -84
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +223 -223
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/shared/hooks/useConfirmedAction.d.ts +10 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js +14 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js.map +1 -0
- package/package.json +2 -2
|
@@ -5,50 +5,50 @@ import { Modal as r } from "../../components/Modal.js";
|
|
|
5
5
|
import "../../components/index.js";
|
|
6
6
|
import "../../components/maps/index.js";
|
|
7
7
|
import { ChartCard as i } from "../../components/ChartCard.js";
|
|
8
|
-
import { BarsChart as
|
|
9
|
-
import { DonutChart as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { useCreateGeofenceMutation as
|
|
12
|
-
import { DEFAULT_MAP_CENTER as
|
|
13
|
-
import { LocationGeofenceMap as
|
|
14
|
-
import { GeofenceEventType as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { Crosshair as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { GlassCard as
|
|
8
|
+
import { BarsChart as ee } from "../../components/charts/BarsChart.js";
|
|
9
|
+
import { DonutChart as a } from "../../components/charts/DonutChart.js";
|
|
10
|
+
import { cn as o, formatRelativeTime as te } from "../../utils/helpers.js";
|
|
11
|
+
import { useCreateGeofenceMutation as ne, useDeleteGeofenceMutation as re, useListGeofencesQuery as ie, useToggleGeofenceMutation as ae, useUpdateGeofenceMutation as oe } from "../../../generated/wspace-operations.js";
|
|
12
|
+
import { DEFAULT_MAP_CENTER as s, MAX_GEOFENCE_RADIUS_METERS as se, clampGeofenceRadius as ce, formatCoordinates as le, formatRadius as c, isValidGeofenceGeometry as l, parseStrictNumber as u, roundCoordinate as d, validateGeofenceForm as ue } from "../../components/maps/locationGeometry.js";
|
|
13
|
+
import { LocationGeofenceMap as de } from "../../components/maps/LocationGeofenceMap.js";
|
|
14
|
+
import { GeofenceEventType as f, GeofenceTrigger as p } from "../../../generated/wspace-types.js";
|
|
15
|
+
import { useMemo as m, useState as h } from "react";
|
|
16
|
+
import { Crosshair as g, LogIn as fe, LogOut as pe, MapPin as _, Pencil as me, Plus as he, Radio as ge, Search as _e, ShieldCheck as ve, Trash2 as ye, X as v } from "lucide-react";
|
|
17
|
+
import { Fragment as be, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
18
|
+
import { GlassCard as x, ThemedSelect as xe } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
// src/timecampus/pages/geofencing/GeofencingPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var S = 25, C = 5e3, w = {
|
|
21
21
|
name: "",
|
|
22
|
-
latitude: String(
|
|
23
|
-
longitude: String(
|
|
22
|
+
latitude: String(s[0]),
|
|
23
|
+
longitude: String(s[1]),
|
|
24
24
|
radius: "150",
|
|
25
|
-
trigger:
|
|
25
|
+
trigger: p.Both,
|
|
26
26
|
address: "",
|
|
27
27
|
isActive: !0
|
|
28
|
-
},
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */
|
|
28
|
+
}, T = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus";
|
|
29
|
+
function E({ checked: e, onChange: t, label: n, disabled: r }) {
|
|
30
|
+
return /* @__PURE__ */ y("button", {
|
|
31
31
|
type: "button",
|
|
32
32
|
role: "switch",
|
|
33
33
|
"aria-checked": e,
|
|
34
34
|
"aria-label": n,
|
|
35
35
|
disabled: r,
|
|
36
36
|
onClick: () => t(!e),
|
|
37
|
-
className:
|
|
38
|
-
children: /* @__PURE__ */
|
|
37
|
+
className: o("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:cursor-not-allowed disabled:opacity-50", e ? "border-transparent bg-action-primary-bg" : "border-border-subtle bg-bg-sunken"),
|
|
38
|
+
children: /* @__PURE__ */ y("span", { className: o("inline-block h-3.5 w-3.5 transform rounded-full shadow-sm transition-transform", e ? "translate-x-4 bg-action-primary-text" : "translate-x-0.5 bg-text-secondary") })
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function D(e, t) {
|
|
42
42
|
return e instanceof Error && e.message.trim() ? e.message : t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let { data:
|
|
46
|
-
limit:
|
|
44
|
+
function O() {
|
|
45
|
+
let { data: O, loading: Se, error: Ce, refetch: k, fetchMore: we } = ie({ variables: { pagination: {
|
|
46
|
+
limit: S,
|
|
47
47
|
offset: 0
|
|
48
|
-
} } }), [
|
|
49
|
-
let e =
|
|
50
|
-
return e ?
|
|
51
|
-
}, [
|
|
48
|
+
} } }), [Te, { loading: A }] = ne(), [j, { loading: M }] = oe(), [Ee, { loading: N }] = re(), [De] = ae(), [P, F] = h(!1), [I, L] = h(null), [R, z] = h(w), [B, V] = h({}), [H, U] = h(null), [W, G] = h(null), [K, q] = h(null), [J, Oe] = h(""), [ke, Ae] = h(!1), Y = m(() => O?.geofences?.items ?? [], [O?.geofences?.items]), je = O?.geofences?.hasMore ?? !1, Me = O?.geofences?.total ?? Y.length, Ne = m(() => {
|
|
49
|
+
let e = J.trim().toLowerCase();
|
|
50
|
+
return e ? Y.filter((t) => t.name.toLowerCase().includes(e) || (t.address ?? "").toLowerCase().includes(e)) : Y;
|
|
51
|
+
}, [Y, J]), Pe = m(() => Y.filter((e) => !I || e.id !== I.id).map((e) => ({
|
|
52
52
|
id: e.id,
|
|
53
53
|
name: e.name,
|
|
54
54
|
latitude: e.latitude,
|
|
@@ -58,10 +58,10 @@ function j() {
|
|
|
58
58
|
trigger: e.trigger,
|
|
59
59
|
address: e.address,
|
|
60
60
|
eventsCount: e.events.length
|
|
61
|
-
})), [
|
|
62
|
-
if (!
|
|
63
|
-
let e =
|
|
64
|
-
return e === null || t === null || n === null || !
|
|
61
|
+
})), [I, Y]), Fe = m(() => {
|
|
62
|
+
if (!P) return null;
|
|
63
|
+
let e = u(R.latitude), t = u(R.longitude), n = u(R.radius);
|
|
64
|
+
return e === null || t === null || n === null || !l({
|
|
65
65
|
latitude: e,
|
|
66
66
|
longitude: t,
|
|
67
67
|
radius: n
|
|
@@ -69,42 +69,42 @@ function j() {
|
|
|
69
69
|
latitude: e,
|
|
70
70
|
longitude: t,
|
|
71
71
|
radius: n,
|
|
72
|
-
name:
|
|
72
|
+
name: R.name.trim() || void 0
|
|
73
73
|
};
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
]),
|
|
81
|
-
for (let e of
|
|
82
|
-
let
|
|
75
|
+
P,
|
|
76
|
+
R.latitude,
|
|
77
|
+
R.longitude,
|
|
78
|
+
R.name,
|
|
79
|
+
R.radius
|
|
80
|
+
]), Ie = Y.filter((e) => e.isActive).length, Le = 0, X = 0;
|
|
81
|
+
for (let e of Y) for (let t of e.events) t.type === f.Enter ? Le += 1 : X += 1;
|
|
82
|
+
let Re = [
|
|
83
83
|
{
|
|
84
84
|
name: "Entry & exit",
|
|
85
|
-
value:
|
|
85
|
+
value: Y.filter((e) => e.trigger === p.Both).length
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: "On entry",
|
|
89
|
-
value:
|
|
89
|
+
value: Y.filter((e) => e.trigger === p.Enter).length
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
name: "On exit",
|
|
93
|
-
value:
|
|
93
|
+
value: Y.filter((e) => e.trigger === p.Exit).length
|
|
94
94
|
}
|
|
95
|
-
],
|
|
95
|
+
], ze = Y.map((e) => ({
|
|
96
96
|
zone: e.name,
|
|
97
97
|
events: e.events.length
|
|
98
|
-
})).filter((e) => e.events > 0).sort((e, t) => t.events - e.events).slice(0, 8),
|
|
99
|
-
|
|
100
|
-
let e =
|
|
101
|
-
|
|
102
|
-
...
|
|
103
|
-
latitude: String(
|
|
104
|
-
longitude: String(
|
|
105
|
-
}),
|
|
106
|
-
},
|
|
107
|
-
|
|
98
|
+
})).filter((e) => e.events > 0).sort((e, t) => t.events - e.events).slice(0, 8), Z = () => {
|
|
99
|
+
L(null), V({}), U(null);
|
|
100
|
+
let e = Y.find((e) => l(e));
|
|
101
|
+
z({
|
|
102
|
+
...w,
|
|
103
|
+
latitude: String(d(e ? e.latitude : s[0])),
|
|
104
|
+
longitude: String(d(e ? e.longitude : s[1]))
|
|
105
|
+
}), F(!0);
|
|
106
|
+
}, Be = (e) => {
|
|
107
|
+
L(e), q(e.id), V({}), U(null), z({
|
|
108
108
|
name: e.name,
|
|
109
109
|
latitude: String(e.latitude),
|
|
110
110
|
longitude: String(e.longitude),
|
|
@@ -112,93 +112,93 @@ function j() {
|
|
|
112
112
|
trigger: e.trigger,
|
|
113
113
|
address: e.address ?? "",
|
|
114
114
|
isActive: e.isActive
|
|
115
|
-
}),
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
115
|
+
}), F(!0);
|
|
116
|
+
}, Q = () => {
|
|
117
|
+
F(!1), L(null), V({}), U(null);
|
|
118
|
+
}, Ve = (e) => {
|
|
119
|
+
z((t) => ({
|
|
120
120
|
...t,
|
|
121
|
-
latitude: String(
|
|
122
|
-
longitude: String(
|
|
123
|
-
radius: String(
|
|
124
|
-
})),
|
|
121
|
+
latitude: String(d(e.latitude)),
|
|
122
|
+
longitude: String(d(e.longitude)),
|
|
123
|
+
radius: String(ce(e.radius))
|
|
124
|
+
})), V((e) => ({
|
|
125
125
|
...e,
|
|
126
126
|
latitude: void 0,
|
|
127
127
|
longitude: void 0,
|
|
128
128
|
radius: void 0
|
|
129
129
|
}));
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
let e =
|
|
130
|
+
}, He = async () => {
|
|
131
|
+
U(null);
|
|
132
|
+
let e = ue(R);
|
|
133
133
|
if (!e.valid || !e.parsed) {
|
|
134
|
-
|
|
134
|
+
V(e.errors);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
V({});
|
|
138
138
|
let t = {
|
|
139
139
|
name: e.parsed.name,
|
|
140
140
|
latitude: e.parsed.latitude,
|
|
141
141
|
longitude: e.parsed.longitude,
|
|
142
142
|
radius: e.parsed.radius,
|
|
143
|
-
trigger:
|
|
144
|
-
address:
|
|
145
|
-
isActive:
|
|
143
|
+
trigger: R.trigger,
|
|
144
|
+
address: R.address.trim() || void 0,
|
|
145
|
+
isActive: R.isActive
|
|
146
146
|
};
|
|
147
147
|
try {
|
|
148
|
-
if (
|
|
149
|
-
let e = (await
|
|
150
|
-
id:
|
|
148
|
+
if (I) {
|
|
149
|
+
let e = (await j({ variables: {
|
|
150
|
+
id: I.id,
|
|
151
151
|
input: t
|
|
152
|
-
} })).data?.updateGeofence?.id ??
|
|
153
|
-
|
|
152
|
+
} })).data?.updateGeofence?.id ?? I.id;
|
|
153
|
+
q(e);
|
|
154
154
|
} else {
|
|
155
|
-
let e = (await
|
|
156
|
-
e &&
|
|
155
|
+
let e = (await Te({ variables: { input: t } })).data?.createGeofence?.id ?? null;
|
|
156
|
+
e && q(e);
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
F(!1), L(null), await k();
|
|
159
159
|
} catch (e) {
|
|
160
|
-
|
|
160
|
+
U(D(e, "Failed to save geofence. Check permissions and values, then try again."));
|
|
161
161
|
}
|
|
162
|
-
},
|
|
163
|
-
if (
|
|
164
|
-
|
|
162
|
+
}, Ue = async () => {
|
|
163
|
+
if (W) {
|
|
164
|
+
U(null);
|
|
165
165
|
try {
|
|
166
|
-
await
|
|
166
|
+
await Ee({ variables: { id: W.id } }), K === W.id && q(null), G(null), await k();
|
|
167
167
|
} catch (e) {
|
|
168
|
-
|
|
168
|
+
U(D(e, "Failed to delete geofence. You may not have permission to modify zones.")), G(null);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
},
|
|
172
|
-
|
|
171
|
+
}, We = async (e) => {
|
|
172
|
+
U(null);
|
|
173
173
|
try {
|
|
174
|
-
await
|
|
174
|
+
await De({ variables: {
|
|
175
175
|
id: e.id,
|
|
176
176
|
isActive: !e.isActive
|
|
177
|
-
} }), await
|
|
177
|
+
} }), await k();
|
|
178
178
|
} catch (e) {
|
|
179
|
-
|
|
179
|
+
U(D(e, "Failed to update geofence active state."));
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, Ge = async (e, t, n) => {
|
|
182
182
|
if (!t && !n) return;
|
|
183
|
-
let r = t && n ?
|
|
183
|
+
let r = t && n ? p.Both : t ? p.Enter : p.Exit;
|
|
184
184
|
if (r !== e.trigger) {
|
|
185
|
-
|
|
185
|
+
U(null);
|
|
186
186
|
try {
|
|
187
|
-
await
|
|
187
|
+
await j({ variables: {
|
|
188
188
|
id: e.id,
|
|
189
189
|
input: { trigger: r }
|
|
190
|
-
} }), await
|
|
190
|
+
} }), await k();
|
|
191
191
|
} catch (e) {
|
|
192
|
-
|
|
192
|
+
U(D(e, "Failed to update geofence trigger."));
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
},
|
|
196
|
-
|
|
195
|
+
}, Ke = async () => {
|
|
196
|
+
Ae(!0);
|
|
197
197
|
try {
|
|
198
|
-
await
|
|
198
|
+
await we({
|
|
199
199
|
variables: { pagination: {
|
|
200
|
-
limit:
|
|
201
|
-
offset:
|
|
200
|
+
limit: S,
|
|
201
|
+
offset: Y.length
|
|
202
202
|
} },
|
|
203
203
|
updateQuery: (e, { fetchMoreResult: t }) => t ? { geofences: {
|
|
204
204
|
...t.geofences,
|
|
@@ -206,277 +206,277 @@ function j() {
|
|
|
206
206
|
} } : e
|
|
207
207
|
});
|
|
208
208
|
} finally {
|
|
209
|
-
|
|
209
|
+
Ae(!1);
|
|
210
210
|
}
|
|
211
|
-
},
|
|
211
|
+
}, qe = /* @__PURE__ */ b("button", {
|
|
212
212
|
type: "button",
|
|
213
|
-
onClick:
|
|
213
|
+
onClick: P ? Q : Z,
|
|
214
214
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
215
|
-
children: [
|
|
215
|
+
children: [y(P ? v : he, { className: "h-4 w-4" }), P ? "Close Editor" : "Create Geofence"]
|
|
216
216
|
});
|
|
217
|
-
if (
|
|
217
|
+
if (Se) return /* @__PURE__ */ y(e, {
|
|
218
218
|
title: "Geofencing",
|
|
219
219
|
description: "Set up location-based triggers and zones",
|
|
220
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ y(n, {
|
|
221
221
|
variant: "card",
|
|
222
222
|
count: 4
|
|
223
223
|
})
|
|
224
224
|
});
|
|
225
|
-
if (
|
|
225
|
+
if (Ce) return /* @__PURE__ */ y(e, {
|
|
226
226
|
title: "Geofencing",
|
|
227
227
|
description: "Set up location-based triggers and zones",
|
|
228
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ y("div", {
|
|
229
229
|
role: "alert",
|
|
230
230
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
231
231
|
children: "Failed to load geofences. Please check workspace permissions or try again later."
|
|
232
232
|
})
|
|
233
233
|
});
|
|
234
|
-
let
|
|
235
|
-
return /* @__PURE__ */
|
|
234
|
+
let $ = ce(u(R.radius) ?? 150);
|
|
235
|
+
return /* @__PURE__ */ b(e, {
|
|
236
236
|
title: "Geofencing",
|
|
237
237
|
description: "Set up location-based triggers and zones",
|
|
238
238
|
purpose: "Draw zones around your worksites — offices, client sites, job locations — and have time tracking start and stop automatically as people move in and out, so on-site hours record themselves.",
|
|
239
|
-
actions:
|
|
239
|
+
actions: qe,
|
|
240
240
|
children: [
|
|
241
|
-
|
|
241
|
+
H && !P && /* @__PURE__ */ b("div", {
|
|
242
242
|
role: "alert",
|
|
243
243
|
className: "mb-4 flex items-center justify-between gap-3 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ y("span", { children: H }), /* @__PURE__ */ y("button", {
|
|
245
245
|
type: "button",
|
|
246
|
-
onClick: () =>
|
|
246
|
+
onClick: () => U(null),
|
|
247
247
|
"aria-label": "Dismiss error",
|
|
248
248
|
className: "rounded p-1 hover:bg-bg-surface/20",
|
|
249
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
|
|
250
250
|
})]
|
|
251
251
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ b("div", {
|
|
253
253
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
254
254
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ y(t, {
|
|
256
256
|
featured: !0,
|
|
257
257
|
title: "Total Zones",
|
|
258
|
-
value: String(
|
|
259
|
-
icon: /* @__PURE__ */
|
|
258
|
+
value: String(Me),
|
|
259
|
+
icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" })
|
|
260
260
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ y(t, {
|
|
262
262
|
title: "Active Zones",
|
|
263
|
-
value: String(
|
|
264
|
-
icon: /* @__PURE__ */
|
|
263
|
+
value: String(Ie),
|
|
264
|
+
icon: /* @__PURE__ */ y(ge, { className: "h-5 w-5" }),
|
|
265
265
|
description: "Currently tracking"
|
|
266
266
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ y(t, {
|
|
268
268
|
title: "Entry Events",
|
|
269
|
-
value: String(
|
|
270
|
-
icon: /* @__PURE__ */
|
|
269
|
+
value: String(Le),
|
|
270
|
+
icon: /* @__PURE__ */ y(fe, { className: "h-5 w-5" })
|
|
271
271
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ y(t, {
|
|
273
273
|
title: "Exit Events",
|
|
274
|
-
value: String(
|
|
275
|
-
icon: /* @__PURE__ */
|
|
274
|
+
value: String(X),
|
|
275
|
+
icon: /* @__PURE__ */ y(pe, { className: "h-5 w-5" })
|
|
276
276
|
})
|
|
277
277
|
]
|
|
278
278
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ b("div", {
|
|
280
280
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-12",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ b("div", {
|
|
282
282
|
className: "min-w-0 lg:col-span-7 xl:col-span-8",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ b("div", {
|
|
284
284
|
className: "mb-3 flex flex-wrap items-center justify-between gap-2",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ b("div", {
|
|
286
286
|
className: "min-w-0",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
288
288
|
className: "text-base font-semibold text-text-primary",
|
|
289
289
|
children: "Geofence Map"
|
|
290
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ y("p", {
|
|
291
291
|
className: "text-xs text-text-secondary",
|
|
292
|
-
children:
|
|
292
|
+
children: P ? "Click on the map to place the center, or drag the center pin and outer radius handle." : "Select any zone on the map or list to inspect boundaries and triggers."
|
|
293
293
|
})]
|
|
294
|
-
}), !
|
|
294
|
+
}), !P && /* @__PURE__ */ b("button", {
|
|
295
295
|
type: "button",
|
|
296
|
-
onClick:
|
|
296
|
+
onClick: Z,
|
|
297
297
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" }), "Draw Zone on Map"]
|
|
299
299
|
})]
|
|
300
|
-
}), /* @__PURE__ */
|
|
301
|
-
geofences:
|
|
302
|
-
selectedGeofenceId:
|
|
303
|
-
onSelectGeofence: (e) =>
|
|
304
|
-
draftGeofence:
|
|
305
|
-
interactiveMode:
|
|
306
|
-
onDraftGeofenceChange:
|
|
300
|
+
}), /* @__PURE__ */ y(de, {
|
|
301
|
+
geofences: Pe,
|
|
302
|
+
selectedGeofenceId: P ? null : K,
|
|
303
|
+
onSelectGeofence: (e) => q(e),
|
|
304
|
+
draftGeofence: Fe,
|
|
305
|
+
interactiveMode: P ? "place-geofence" : "view",
|
|
306
|
+
onDraftGeofenceChange: Ve,
|
|
307
307
|
heightClassName: "h-[320px] sm:h-[420px] lg:h-[560px]",
|
|
308
308
|
ariaLabel: "Geofence zones map",
|
|
309
309
|
testId: "geofencing-map"
|
|
310
310
|
})]
|
|
311
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ b("div", {
|
|
312
312
|
className: "flex min-w-0 flex-col gap-4 lg:col-span-5 xl:col-span-4",
|
|
313
|
-
children: [
|
|
313
|
+
children: [P ? /* @__PURE__ */ b(x, {
|
|
314
314
|
treatment: "glass",
|
|
315
315
|
className: "flex flex-col p-5",
|
|
316
316
|
"data-testid": "geofence-editor-panel",
|
|
317
317
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ b("div", {
|
|
319
319
|
className: "flex items-start justify-between gap-3 border-b border-border-seam pb-3",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
|
|
321
321
|
className: "text-base font-semibold text-text-primary",
|
|
322
|
-
children:
|
|
323
|
-
}), /* @__PURE__ */
|
|
322
|
+
children: I ? "Edit Geofence" : "Create Geofence"
|
|
323
|
+
}), /* @__PURE__ */ y("p", {
|
|
324
324
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
325
325
|
children: "Place on the map or enter exact WGS-84 coordinates."
|
|
326
|
-
})] }), /* @__PURE__ */
|
|
326
|
+
})] }), /* @__PURE__ */ y("button", {
|
|
327
327
|
type: "button",
|
|
328
|
-
onClick:
|
|
328
|
+
onClick: Q,
|
|
329
329
|
"aria-label": "Close geofence editor",
|
|
330
330
|
className: "rounded-md p-1 text-text-secondary hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
331
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
|
|
332
332
|
})]
|
|
333
333
|
}),
|
|
334
|
-
|
|
334
|
+
H && /* @__PURE__ */ y("div", {
|
|
335
335
|
role: "alert",
|
|
336
336
|
className: "mt-3 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-xs text-status-error-text",
|
|
337
|
-
children:
|
|
337
|
+
children: H
|
|
338
338
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ b("form", {
|
|
340
340
|
className: "mt-4 space-y-3.5",
|
|
341
341
|
onSubmit: (e) => {
|
|
342
|
-
e.preventDefault(),
|
|
342
|
+
e.preventDefault(), He();
|
|
343
343
|
},
|
|
344
344
|
noValidate: !0,
|
|
345
345
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ b("div", { children: [
|
|
347
|
+
/* @__PURE__ */ y("label", {
|
|
348
348
|
htmlFor: "geofence-name",
|
|
349
349
|
className: "block text-xs font-medium text-text-primary",
|
|
350
350
|
children: "Name"
|
|
351
351
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ y("input", {
|
|
353
353
|
id: "geofence-name",
|
|
354
354
|
type: "text",
|
|
355
355
|
placeholder: "e.g. SF Headquarters",
|
|
356
|
-
value:
|
|
356
|
+
value: R.name,
|
|
357
357
|
onChange: (e) => {
|
|
358
|
-
|
|
359
|
-
...
|
|
358
|
+
z({
|
|
359
|
+
...R,
|
|
360
360
|
name: e.target.value
|
|
361
|
-
}),
|
|
361
|
+
}), V((e) => ({
|
|
362
362
|
...e,
|
|
363
363
|
name: void 0
|
|
364
364
|
}));
|
|
365
365
|
},
|
|
366
|
-
className:
|
|
366
|
+
className: T
|
|
367
367
|
}),
|
|
368
|
-
|
|
368
|
+
B.name && /* @__PURE__ */ y("p", {
|
|
369
369
|
role: "alert",
|
|
370
370
|
className: "mt-1 text-xs text-status-error-text",
|
|
371
|
-
children:
|
|
371
|
+
children: B.name
|
|
372
372
|
})
|
|
373
373
|
] }),
|
|
374
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ b("div", {
|
|
375
375
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ b("div", { children: [
|
|
377
|
+
/* @__PURE__ */ y("label", {
|
|
378
378
|
htmlFor: "geofence-lat",
|
|
379
379
|
className: "block text-xs font-medium text-text-primary",
|
|
380
380
|
children: "Latitude"
|
|
381
381
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ y("input", {
|
|
383
383
|
id: "geofence-lat",
|
|
384
384
|
type: "number",
|
|
385
385
|
step: "any",
|
|
386
386
|
min: -90,
|
|
387
387
|
max: 90,
|
|
388
388
|
placeholder: "37.774900",
|
|
389
|
-
value:
|
|
389
|
+
value: R.latitude,
|
|
390
390
|
onChange: (e) => {
|
|
391
|
-
|
|
392
|
-
...
|
|
391
|
+
z({
|
|
392
|
+
...R,
|
|
393
393
|
latitude: e.target.value
|
|
394
|
-
}),
|
|
394
|
+
}), V((e) => ({
|
|
395
395
|
...e,
|
|
396
396
|
latitude: void 0
|
|
397
397
|
}));
|
|
398
398
|
},
|
|
399
|
-
className:
|
|
399
|
+
className: T
|
|
400
400
|
}),
|
|
401
|
-
|
|
401
|
+
B.latitude && /* @__PURE__ */ y("p", {
|
|
402
402
|
role: "alert",
|
|
403
403
|
className: "mt-1 text-xs text-status-error-text",
|
|
404
|
-
children:
|
|
404
|
+
children: B.latitude
|
|
405
405
|
})
|
|
406
|
-
] }), /* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
406
|
+
] }), /* @__PURE__ */ b("div", { children: [
|
|
407
|
+
/* @__PURE__ */ y("label", {
|
|
408
408
|
htmlFor: "geofence-lng",
|
|
409
409
|
className: "block text-xs font-medium text-text-primary",
|
|
410
410
|
children: "Longitude"
|
|
411
411
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ y("input", {
|
|
413
413
|
id: "geofence-lng",
|
|
414
414
|
type: "number",
|
|
415
415
|
step: "any",
|
|
416
416
|
min: -180,
|
|
417
417
|
max: 180,
|
|
418
418
|
placeholder: "-122.419400",
|
|
419
|
-
value:
|
|
419
|
+
value: R.longitude,
|
|
420
420
|
onChange: (e) => {
|
|
421
|
-
|
|
422
|
-
...
|
|
421
|
+
z({
|
|
422
|
+
...R,
|
|
423
423
|
longitude: e.target.value
|
|
424
|
-
}),
|
|
424
|
+
}), V((e) => ({
|
|
425
425
|
...e,
|
|
426
426
|
longitude: void 0
|
|
427
427
|
}));
|
|
428
428
|
},
|
|
429
|
-
className:
|
|
429
|
+
className: T
|
|
430
430
|
}),
|
|
431
|
-
|
|
431
|
+
B.longitude && /* @__PURE__ */ y("p", {
|
|
432
432
|
role: "alert",
|
|
433
433
|
className: "mt-1 text-xs text-status-error-text",
|
|
434
|
-
children:
|
|
434
|
+
children: B.longitude
|
|
435
435
|
})
|
|
436
436
|
] })]
|
|
437
437
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ b("div", { children: [
|
|
439
|
+
/* @__PURE__ */ b("div", {
|
|
440
440
|
className: "flex items-center justify-between",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ y("label", {
|
|
442
442
|
htmlFor: "geofence-radius",
|
|
443
443
|
className: "block text-xs font-medium text-text-primary",
|
|
444
444
|
children: "Radius (meters)"
|
|
445
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ y("span", {
|
|
446
446
|
className: "font-mono text-xs text-text-secondary",
|
|
447
|
-
children:
|
|
447
|
+
children: c($)
|
|
448
448
|
})]
|
|
449
449
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ b("div", {
|
|
451
451
|
className: "mt-1 flex items-center gap-2",
|
|
452
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ y("input", {
|
|
453
453
|
id: "geofence-radius",
|
|
454
454
|
type: "number",
|
|
455
455
|
min: 10,
|
|
456
|
-
max:
|
|
457
|
-
value:
|
|
456
|
+
max: se,
|
|
457
|
+
value: R.radius,
|
|
458
458
|
onChange: (e) => {
|
|
459
|
-
|
|
460
|
-
...
|
|
459
|
+
z({
|
|
460
|
+
...R,
|
|
461
461
|
radius: e.target.value
|
|
462
|
-
}),
|
|
462
|
+
}), V((e) => ({
|
|
463
463
|
...e,
|
|
464
464
|
radius: void 0
|
|
465
465
|
}));
|
|
466
466
|
},
|
|
467
467
|
className: "w-28 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus"
|
|
468
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ y("input", {
|
|
469
469
|
type: "range",
|
|
470
470
|
"aria-label": "Adjust geofence radius",
|
|
471
471
|
min: 10,
|
|
472
|
-
max:
|
|
472
|
+
max: C,
|
|
473
473
|
step: 10,
|
|
474
|
-
value: Math.min(
|
|
474
|
+
value: Math.min(C, $),
|
|
475
475
|
onChange: (e) => {
|
|
476
|
-
|
|
477
|
-
...
|
|
476
|
+
z({
|
|
477
|
+
...R,
|
|
478
478
|
radius: e.target.value
|
|
479
|
-
}),
|
|
479
|
+
}), V((e) => ({
|
|
480
480
|
...e,
|
|
481
481
|
radius: void 0
|
|
482
482
|
}));
|
|
@@ -484,290 +484,290 @@ function j() {
|
|
|
484
484
|
className: "h-2 flex-1 cursor-pointer accent-action-primary-bg"
|
|
485
485
|
})]
|
|
486
486
|
}),
|
|
487
|
-
|
|
487
|
+
B.radius && /* @__PURE__ */ y("p", {
|
|
488
488
|
role: "alert",
|
|
489
489
|
className: "mt-1 text-xs text-status-error-text",
|
|
490
|
-
children:
|
|
490
|
+
children: B.radius
|
|
491
491
|
})
|
|
492
492
|
] }),
|
|
493
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ b("div", {
|
|
494
494
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
496
496
|
htmlFor: "geofence-trigger",
|
|
497
497
|
className: "block text-xs font-medium text-text-primary",
|
|
498
498
|
children: "Trigger"
|
|
499
|
-
}), /* @__PURE__ */
|
|
499
|
+
}), /* @__PURE__ */ b(xe, {
|
|
500
500
|
id: "geofence-trigger",
|
|
501
|
-
value:
|
|
502
|
-
onChange: (e) =>
|
|
503
|
-
...
|
|
501
|
+
value: R.trigger,
|
|
502
|
+
onChange: (e) => z({
|
|
503
|
+
...R,
|
|
504
504
|
trigger: e.target.value
|
|
505
505
|
}),
|
|
506
|
-
className:
|
|
506
|
+
className: T,
|
|
507
507
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
value:
|
|
508
|
+
/* @__PURE__ */ y("option", {
|
|
509
|
+
value: p.Enter,
|
|
510
510
|
children: "On entry"
|
|
511
511
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
value:
|
|
512
|
+
/* @__PURE__ */ y("option", {
|
|
513
|
+
value: p.Exit,
|
|
514
514
|
children: "On exit"
|
|
515
515
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
value:
|
|
516
|
+
/* @__PURE__ */ y("option", {
|
|
517
|
+
value: p.Both,
|
|
518
518
|
children: "Entry & exit"
|
|
519
519
|
})
|
|
520
520
|
]
|
|
521
|
-
})] }), /* @__PURE__ */
|
|
521
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
522
522
|
htmlFor: "geofence-address",
|
|
523
523
|
className: "block text-xs font-medium text-text-primary",
|
|
524
524
|
children: "Address (optional)"
|
|
525
|
-
}), /* @__PURE__ */
|
|
525
|
+
}), /* @__PURE__ */ y("input", {
|
|
526
526
|
id: "geofence-address",
|
|
527
527
|
type: "text",
|
|
528
528
|
placeholder: "San Francisco, USA",
|
|
529
|
-
value:
|
|
530
|
-
onChange: (e) =>
|
|
531
|
-
...
|
|
529
|
+
value: R.address,
|
|
530
|
+
onChange: (e) => z({
|
|
531
|
+
...R,
|
|
532
532
|
address: e.target.value
|
|
533
533
|
}),
|
|
534
|
-
className:
|
|
534
|
+
className: T
|
|
535
535
|
})] })]
|
|
536
536
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ b("label", {
|
|
538
538
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface/60 px-3 py-2",
|
|
539
|
-
children: [/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ y("span", {
|
|
540
540
|
className: "text-xs font-medium text-text-primary",
|
|
541
541
|
children: "Zone active"
|
|
542
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ y("input", {
|
|
543
543
|
type: "checkbox",
|
|
544
|
-
checked:
|
|
545
|
-
onChange: (e) =>
|
|
546
|
-
...
|
|
544
|
+
checked: R.isActive,
|
|
545
|
+
onChange: (e) => z({
|
|
546
|
+
...R,
|
|
547
547
|
isActive: e.target.checked
|
|
548
548
|
}),
|
|
549
549
|
className: "h-4 w-4 rounded border-border-subtle"
|
|
550
550
|
})]
|
|
551
551
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ b("div", {
|
|
553
553
|
className: "flex items-center justify-end gap-2 border-t border-border-seam pt-3",
|
|
554
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ y("button", {
|
|
555
555
|
type: "button",
|
|
556
|
-
onClick:
|
|
556
|
+
onClick: Q,
|
|
557
557
|
className: "rounded-md border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
558
558
|
children: "Cancel"
|
|
559
|
-
}), /* @__PURE__ */
|
|
559
|
+
}), /* @__PURE__ */ y("button", {
|
|
560
560
|
type: "submit",
|
|
561
|
-
disabled:
|
|
561
|
+
disabled: A || M,
|
|
562
562
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus disabled:opacity-50",
|
|
563
|
-
children:
|
|
563
|
+
children: A || M ? "Saving..." : I ? "Save Changes" : "Save Geofence"
|
|
564
564
|
})]
|
|
565
565
|
})
|
|
566
566
|
]
|
|
567
567
|
})
|
|
568
568
|
]
|
|
569
|
-
}) : /* @__PURE__ */
|
|
569
|
+
}) : /* @__PURE__ */ b(x, {
|
|
570
570
|
treatment: "glass",
|
|
571
571
|
className: "flex flex-col p-4",
|
|
572
572
|
children: [
|
|
573
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ b("div", {
|
|
574
574
|
className: "flex items-center justify-between gap-2 border-b border-border-seam pb-3",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
576
576
|
className: "text-base font-semibold text-text-primary",
|
|
577
577
|
children: [
|
|
578
578
|
"Geofences (",
|
|
579
|
-
|
|
579
|
+
Me,
|
|
580
580
|
")"
|
|
581
581
|
]
|
|
582
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ b("button", {
|
|
583
583
|
type: "button",
|
|
584
|
-
onClick:
|
|
584
|
+
onClick: Z,
|
|
585
585
|
className: "inline-flex items-center gap-1 rounded-md bg-action-primary-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [/* @__PURE__ */ y(he, { className: "h-3.5 w-3.5" }), "Add Geofence"]
|
|
587
587
|
})]
|
|
588
588
|
}),
|
|
589
|
-
|
|
589
|
+
Y.length > 0 && /* @__PURE__ */ b("div", {
|
|
590
590
|
className: "relative mt-3",
|
|
591
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ y(_e, { className: "pointer-events-none absolute start-2.5 top-2.5 h-3.5 w-3.5 text-text-muted" }), /* @__PURE__ */ y("input", {
|
|
592
592
|
type: "search",
|
|
593
593
|
"aria-label": "Filter geofences",
|
|
594
594
|
placeholder: "Filter zones by name or address...",
|
|
595
|
-
value:
|
|
596
|
-
onChange: (e) =>
|
|
595
|
+
value: J,
|
|
596
|
+
onChange: (e) => Oe(e.target.value),
|
|
597
597
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface py-1.5 ps-8 pe-3 text-xs text-text-primary placeholder:text-text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus"
|
|
598
598
|
})]
|
|
599
599
|
}),
|
|
600
|
-
|
|
600
|
+
Y.length === 0 ? /* @__PURE__ */ b("div", {
|
|
601
601
|
className: "mt-4 rounded-lg border border-dashed border-border-subtle bg-bg-surface/40 p-5 text-center",
|
|
602
602
|
children: [
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ y(_, { className: "mx-auto h-7 w-7 text-text-muted" }),
|
|
604
|
+
/* @__PURE__ */ y("p", {
|
|
605
605
|
className: "mt-2 text-sm font-medium text-text-primary",
|
|
606
606
|
children: "No geofences configured yet"
|
|
607
607
|
}),
|
|
608
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ y("p", {
|
|
609
609
|
className: "mt-1 text-xs text-text-secondary",
|
|
610
610
|
children: "Start drawing on the map to create your first worksite zone."
|
|
611
611
|
}),
|
|
612
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ b("button", {
|
|
613
613
|
type: "button",
|
|
614
|
-
onClick:
|
|
614
|
+
onClick: Z,
|
|
615
615
|
className: "mt-3 inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
616
|
-
children: [/* @__PURE__ */
|
|
616
|
+
children: [/* @__PURE__ */ y(g, { className: "h-3.5 w-3.5" }), "Place First Zone"]
|
|
617
617
|
})
|
|
618
618
|
]
|
|
619
|
-
}) :
|
|
619
|
+
}) : Ne.length === 0 ? /* @__PURE__ */ b("p", {
|
|
620
620
|
className: "mt-4 text-center text-xs text-text-secondary",
|
|
621
621
|
children: [
|
|
622
622
|
"No geofences match “",
|
|
623
|
-
|
|
623
|
+
J,
|
|
624
624
|
"”."
|
|
625
625
|
]
|
|
626
|
-
}) : /* @__PURE__ */
|
|
626
|
+
}) : /* @__PURE__ */ y("div", {
|
|
627
627
|
className: "mt-3 max-h-[430px] space-y-3 overflow-y-auto pe-1",
|
|
628
|
-
children:
|
|
629
|
-
let t = e.id ===
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
-
className:
|
|
628
|
+
children: Ne.map((e) => {
|
|
629
|
+
let t = e.id === K, n = e.trigger === p.Enter || e.trigger === p.Both, r = e.trigger === p.Exit || e.trigger === p.Both, i = e.events.filter((e) => e.type === f.Enter).length, ee = e.events.length - i, a = e.events.reduce((e, t) => t.timestamp > e ? t.timestamp : e, "");
|
|
630
|
+
return /* @__PURE__ */ b("div", {
|
|
631
|
+
className: o("rounded-xl border p-3.5 transition-colors", t ? "border-action-primary-bg bg-bg-surface" : "border-border-subtle bg-bg-surface/60 hover:bg-bg-surface"),
|
|
632
632
|
children: [
|
|
633
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ b("div", {
|
|
634
634
|
className: "flex items-start justify-between gap-2",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
635
|
+
children: [/* @__PURE__ */ b("button", {
|
|
636
636
|
type: "button",
|
|
637
|
-
onClick: () =>
|
|
637
|
+
onClick: () => q(e.id),
|
|
638
638
|
className: "flex min-w-0 flex-1 items-start gap-2 text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
639
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ y("span", {
|
|
640
640
|
className: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
641
|
-
children: /* @__PURE__ */
|
|
642
|
-
}), /* @__PURE__ */
|
|
641
|
+
children: /* @__PURE__ */ y(_, { className: "h-4 w-4" })
|
|
642
|
+
}), /* @__PURE__ */ b("div", {
|
|
643
643
|
className: "min-w-0",
|
|
644
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ y("p", {
|
|
645
645
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
646
646
|
children: e.name
|
|
647
|
-
}), /* @__PURE__ */
|
|
647
|
+
}), /* @__PURE__ */ b("p", {
|
|
648
648
|
className: "truncate text-xs text-text-secondary",
|
|
649
649
|
children: [
|
|
650
|
-
e.address ??
|
|
650
|
+
e.address ?? le(e.latitude, e.longitude),
|
|
651
651
|
" ",
|
|
652
652
|
"· ",
|
|
653
|
-
|
|
653
|
+
c(e.radius)
|
|
654
654
|
]
|
|
655
655
|
})]
|
|
656
656
|
})]
|
|
657
|
-
}), /* @__PURE__ */
|
|
657
|
+
}), /* @__PURE__ */ b("div", {
|
|
658
658
|
className: "flex shrink-0 flex-col items-end gap-1",
|
|
659
|
-
children: [/* @__PURE__ */
|
|
659
|
+
children: [/* @__PURE__ */ y(E, {
|
|
660
660
|
checked: e.isActive,
|
|
661
|
-
onChange: () => void
|
|
661
|
+
onChange: () => void We(e),
|
|
662
662
|
label: `Toggle ${e.name} active`
|
|
663
|
-
}), /* @__PURE__ */
|
|
664
|
-
className:
|
|
663
|
+
}), /* @__PURE__ */ y("span", {
|
|
664
|
+
className: o("text-[11px] font-medium", e.isActive ? "text-status-success-text" : "text-text-muted"),
|
|
665
665
|
children: e.isActive ? "Active" : "Inactive"
|
|
666
666
|
})]
|
|
667
667
|
})]
|
|
668
668
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ b("div", {
|
|
670
670
|
className: "mt-3 grid grid-cols-2 gap-2",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ b("div", {
|
|
672
672
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-sunken/40 px-2.5 py-1.5",
|
|
673
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ b("span", {
|
|
674
674
|
className: "flex items-center gap-1 text-[11px] font-medium text-text-secondary",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
676
|
-
}), /* @__PURE__ */
|
|
675
|
+
children: [/* @__PURE__ */ y(fe, { className: "h-3 w-3" }), "Enter"]
|
|
676
|
+
}), /* @__PURE__ */ y(E, {
|
|
677
677
|
checked: n,
|
|
678
|
-
onChange: (t) => void
|
|
678
|
+
onChange: (t) => void Ge(e, t, r),
|
|
679
679
|
label: `Enter trigger for ${e.name}`
|
|
680
680
|
})]
|
|
681
|
-
}), /* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ b("div", {
|
|
682
682
|
className: "flex items-center justify-between rounded-lg border border-border-subtle bg-bg-sunken/40 px-2.5 py-1.5",
|
|
683
|
-
children: [/* @__PURE__ */
|
|
683
|
+
children: [/* @__PURE__ */ b("span", {
|
|
684
684
|
className: "flex items-center gap-1 text-[11px] font-medium text-text-secondary",
|
|
685
|
-
children: [/* @__PURE__ */
|
|
686
|
-
}), /* @__PURE__ */
|
|
685
|
+
children: [/* @__PURE__ */ y(pe, { className: "h-3 w-3" }), "Exit"]
|
|
686
|
+
}), /* @__PURE__ */ y(E, {
|
|
687
687
|
checked: r,
|
|
688
|
-
onChange: (t) => void
|
|
688
|
+
onChange: (t) => void Ge(e, n, t),
|
|
689
689
|
label: `Exit trigger for ${e.name}`
|
|
690
690
|
})]
|
|
691
691
|
})]
|
|
692
692
|
}),
|
|
693
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ b("div", {
|
|
694
694
|
className: "mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-text-secondary",
|
|
695
695
|
children: [
|
|
696
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ b("span", { children: [
|
|
697
697
|
"Entries",
|
|
698
698
|
" ",
|
|
699
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ y("span", {
|
|
700
700
|
className: "font-semibold tabular-nums text-text-primary",
|
|
701
701
|
children: i
|
|
702
702
|
})
|
|
703
703
|
] }),
|
|
704
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ b("span", { children: [
|
|
705
705
|
"Exits",
|
|
706
706
|
" ",
|
|
707
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ y("span", {
|
|
708
708
|
className: "font-semibold tabular-nums text-text-primary",
|
|
709
|
-
children:
|
|
709
|
+
children: ee
|
|
710
710
|
})
|
|
711
711
|
] }),
|
|
712
|
-
|
|
712
|
+
a ? /* @__PURE__ */ b("span", {
|
|
713
713
|
className: "ms-auto",
|
|
714
714
|
children: [
|
|
715
715
|
"Last",
|
|
716
716
|
" ",
|
|
717
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ y("span", {
|
|
718
718
|
className: "text-text-primary",
|
|
719
|
-
children:
|
|
719
|
+
children: te(a)
|
|
720
720
|
})
|
|
721
721
|
]
|
|
722
|
-
}) : /* @__PURE__ */
|
|
722
|
+
}) : /* @__PURE__ */ y("span", {
|
|
723
723
|
className: "ms-auto text-text-muted",
|
|
724
724
|
children: "No events yet"
|
|
725
725
|
})
|
|
726
726
|
]
|
|
727
727
|
}),
|
|
728
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ b("div", {
|
|
729
729
|
className: "mt-3 flex items-center gap-2 border-t border-border-seam pt-2.5",
|
|
730
|
-
children: [/* @__PURE__ */
|
|
730
|
+
children: [/* @__PURE__ */ b("button", {
|
|
731
731
|
type: "button",
|
|
732
|
-
onClick: () =>
|
|
732
|
+
onClick: () => Be(e),
|
|
733
733
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-2 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
734
|
-
children: [/* @__PURE__ */
|
|
735
|
-
}), /* @__PURE__ */
|
|
734
|
+
children: [/* @__PURE__ */ y(me, { className: "h-3 w-3" }), "Edit"]
|
|
735
|
+
}), /* @__PURE__ */ b("button", {
|
|
736
736
|
type: "button",
|
|
737
|
-
onClick: () =>
|
|
737
|
+
onClick: () => G(e),
|
|
738
738
|
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-2 py-1 text-xs font-medium text-status-error-text hover:bg-status-error-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
739
|
-
children: [/* @__PURE__ */
|
|
739
|
+
children: [/* @__PURE__ */ y(ye, { className: "h-3 w-3" }), "Delete"]
|
|
740
740
|
})]
|
|
741
741
|
})
|
|
742
742
|
]
|
|
743
743
|
}, e.id);
|
|
744
744
|
})
|
|
745
745
|
}),
|
|
746
|
-
|
|
746
|
+
je && /* @__PURE__ */ y("div", {
|
|
747
747
|
className: "mt-3 flex justify-center",
|
|
748
|
-
children: /* @__PURE__ */
|
|
748
|
+
children: /* @__PURE__ */ y("button", {
|
|
749
749
|
type: "button",
|
|
750
|
-
onClick: () => void
|
|
751
|
-
disabled:
|
|
750
|
+
onClick: () => void Ke(),
|
|
751
|
+
disabled: ke,
|
|
752
752
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
|
|
753
|
-
children:
|
|
753
|
+
children: ke ? "Loading..." : "Load more"
|
|
754
754
|
})
|
|
755
755
|
})
|
|
756
756
|
]
|
|
757
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ y(x, {
|
|
758
758
|
treatment: "insight",
|
|
759
759
|
className: "p-4",
|
|
760
|
-
children: /* @__PURE__ */
|
|
760
|
+
children: /* @__PURE__ */ b("div", {
|
|
761
761
|
className: "flex items-start gap-3",
|
|
762
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ y("span", {
|
|
763
763
|
className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
764
|
-
children: /* @__PURE__ */
|
|
765
|
-
}), /* @__PURE__ */
|
|
764
|
+
children: /* @__PURE__ */ y(ve, { className: "h-4 w-4" })
|
|
765
|
+
}), /* @__PURE__ */ b("div", {
|
|
766
766
|
className: "min-w-0",
|
|
767
|
-
children: [/* @__PURE__ */
|
|
767
|
+
children: [/* @__PURE__ */ y("p", {
|
|
768
768
|
className: "text-xs font-semibold text-text-primary",
|
|
769
769
|
children: "Privacy first"
|
|
770
|
-
}), /* @__PURE__ */
|
|
770
|
+
}), /* @__PURE__ */ y("p", {
|
|
771
771
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
772
772
|
children: "Location data is encrypted. Activity is tracked only when entering or leaving defined geofences."
|
|
773
773
|
})]
|
|
@@ -776,23 +776,23 @@ function j() {
|
|
|
776
776
|
})]
|
|
777
777
|
})]
|
|
778
778
|
}),
|
|
779
|
-
|
|
779
|
+
Y.length > 0 && /* @__PURE__ */ b("div", {
|
|
780
780
|
className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
781
|
-
children: [/* @__PURE__ */
|
|
781
|
+
children: [/* @__PURE__ */ y(i, {
|
|
782
782
|
title: "Trigger configuration",
|
|
783
783
|
description: "How your zones fire",
|
|
784
|
-
children: /* @__PURE__ */
|
|
785
|
-
data:
|
|
784
|
+
children: /* @__PURE__ */ y(a, {
|
|
785
|
+
data: Re,
|
|
786
786
|
centerLabel: "Zones",
|
|
787
|
-
centerValue:
|
|
787
|
+
centerValue: Y.length,
|
|
788
788
|
ariaLabel: "Geofence trigger configuration mix",
|
|
789
789
|
emptyLabel: "No zones to summarize yet"
|
|
790
790
|
})
|
|
791
|
-
}), /* @__PURE__ */
|
|
791
|
+
}), /* @__PURE__ */ y(i, {
|
|
792
792
|
title: "Activity by zone",
|
|
793
793
|
description: "Recorded enter/exit events per zone",
|
|
794
|
-
children: /* @__PURE__ */
|
|
795
|
-
data:
|
|
794
|
+
children: /* @__PURE__ */ y(ee, {
|
|
795
|
+
data: ze,
|
|
796
796
|
xKey: "zone",
|
|
797
797
|
orientation: "horizontal",
|
|
798
798
|
series: [{
|
|
@@ -805,31 +805,31 @@ function j() {
|
|
|
805
805
|
})
|
|
806
806
|
})]
|
|
807
807
|
}),
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
open:
|
|
810
|
-
onClose: () =>
|
|
808
|
+
/* @__PURE__ */ y(r, {
|
|
809
|
+
open: W !== null,
|
|
810
|
+
onClose: () => G(null),
|
|
811
811
|
title: "Delete Geofence",
|
|
812
812
|
description: "This action cannot be undone.",
|
|
813
|
-
footer: /* @__PURE__ */
|
|
813
|
+
footer: /* @__PURE__ */ b(be, { children: [/* @__PURE__ */ y("button", {
|
|
814
814
|
type: "button",
|
|
815
|
-
onClick: () =>
|
|
815
|
+
onClick: () => G(null),
|
|
816
816
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
817
817
|
children: "Cancel"
|
|
818
|
-
}), /* @__PURE__ */
|
|
818
|
+
}), /* @__PURE__ */ y("button", {
|
|
819
819
|
type: "button",
|
|
820
|
-
onClick: () => void
|
|
821
|
-
disabled:
|
|
820
|
+
onClick: () => void Ue(),
|
|
821
|
+
disabled: N,
|
|
822
822
|
className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/80 disabled:opacity-50",
|
|
823
|
-
children:
|
|
823
|
+
children: N ? "Deleting..." : "Delete"
|
|
824
824
|
})] }),
|
|
825
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ b("p", {
|
|
826
826
|
className: "text-sm text-text-secondary",
|
|
827
827
|
children: [
|
|
828
828
|
"Are you sure you want to delete",
|
|
829
829
|
" ",
|
|
830
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ y("span", {
|
|
831
831
|
className: "font-medium text-text-primary",
|
|
832
|
-
children:
|
|
832
|
+
children: W?.name
|
|
833
833
|
}),
|
|
834
834
|
"? Any automatic tracking tied to this zone will stop."
|
|
835
835
|
]
|
|
@@ -838,6 +838,6 @@ function j() {
|
|
|
838
838
|
]
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
|
-
export {
|
|
841
|
+
export { O as GeofencingPage };
|
|
842
842
|
|
|
843
843
|
//# sourceMappingURL=GeofencingPage.js.map
|