@burdenoff/microfe-housingvista 2026.1102.1 → 2026.1102.2

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.
Files changed (32) hide show
  1. package/dist/housingvista/hooks/index.d.ts +12 -14
  2. package/dist/housingvista/hooks/index.d.ts.map +1 -1
  3. package/dist/housingvista/hooks/index.js +288 -280
  4. package/dist/housingvista/hooks/index.js.map +1 -1
  5. package/dist/housingvista/pages/amc/AMCManagementPage.d.ts.map +1 -1
  6. package/dist/housingvista/pages/amc/AMCManagementPage.js +205 -194
  7. package/dist/housingvista/pages/amc/AMCManagementPage.js.map +1 -1
  8. package/dist/housingvista/pages/amc/AmcContractFormDialog.d.ts.map +1 -1
  9. package/dist/housingvista/pages/amc/AmcContractFormDialog.js +95 -90
  10. package/dist/housingvista/pages/amc/AmcContractFormDialog.js.map +1 -1
  11. package/dist/housingvista/pages/amc/amcDates.d.ts +2 -0
  12. package/dist/housingvista/pages/amc/amcDates.d.ts.map +1 -1
  13. package/dist/housingvista/pages/amc/amcDates.js +4 -1
  14. package/dist/housingvista/pages/amc/amcDates.js.map +1 -1
  15. package/dist/housingvista/pages/amc/amcStats.d.ts +16 -0
  16. package/dist/housingvista/pages/amc/amcStats.d.ts.map +1 -0
  17. package/dist/housingvista/pages/amc/amcStats.js +18 -0
  18. package/dist/housingvista/pages/amc/amcStats.js.map +1 -0
  19. package/dist/housingvista/pages/amc/useAmcManagement.d.ts +6 -1
  20. package/dist/housingvista/pages/amc/useAmcManagement.d.ts.map +1 -1
  21. package/dist/housingvista/pages/amc/useAmcManagement.js +28 -25
  22. package/dist/housingvista/pages/amc/useAmcManagement.js.map +1 -1
  23. package/dist/housingvista/pages/analytics/AnalyticsPage.d.ts.map +1 -1
  24. package/dist/housingvista/pages/analytics/AnalyticsPage.js +109 -105
  25. package/dist/housingvista/pages/analytics/AnalyticsPage.js.map +1 -1
  26. package/dist/housingvista/pages/investments/InvestmentsPage.d.ts.map +1 -1
  27. package/dist/housingvista/pages/investments/InvestmentsPage.js +6 -2
  28. package/dist/housingvista/pages/investments/InvestmentsPage.js.map +1 -1
  29. package/dist/housingvista/utils/helpers.d.ts +2 -0
  30. package/dist/housingvista/utils/helpers.d.ts.map +1 -1
  31. package/dist/housingvista/utils/helpers.js.map +1 -1
  32. package/package.json +1 -1
@@ -4,22 +4,24 @@ import { StatCard as r } from "../../components/StatCard.js";
4
4
  import { StatusBadge as i } from "../../components/StatusBadge.js";
5
5
  import { EmptyState as a } from "../../components/EmptyState.js";
6
6
  import { FilterBar as o } from "../../components/FilterBar.js";
7
- import { useTrackPageView as s } from "../../hooks/useHousingVistaAnalytics.js";
8
- import { useAMCContracts as c, useCreateAmcContract as ee, useMaintenanceRequests as te } from "../../hooks/index.js";
9
- import { notify as l } from "../../lib/toast.js";
7
+ import { LoadingSkeleton as ee } from "../../components/LoadingSkeleton.js";
8
+ import { useTrackPageView as te } from "../../hooks/useHousingVistaAnalytics.js";
9
+ import { useAMCContracts as s, useAllAmcContracts as ne, useCreateAmcContract as re, useMaintenanceRequests as ie } from "../../hooks/index.js";
10
+ import { notify as c } from "../../lib/toast.js";
10
11
  import "../../components/index.js";
11
- import { useServerPagination as u } from "../../hooks/useServerPagination.js";
12
- import { calendarDaysUntil as d, formatCalendarDate as f } from "./amcDates.js";
13
- import { AmcContractFormDialog as p } from "./AmcContractFormDialog.js";
14
- import { AmcCancelDialog as m, AmcDeleteDialog as h, AmcRenewDialog as g } from "./AmcContractActionDialogs.js";
15
- import { useAmcManagement as ne } from "./useAmcManagement.js";
16
- import { useEffect as _, useMemo as v, useState as y } from "react";
17
- import { AlertTriangle as re, Ban as b, Calendar as x, Clock as S, DollarSign as C, Download as ie, MapPin as w, Pencil as T, Plus as E, RotateCcw as D, Shield as O, Trash2 as ae, Wrench as k } from "lucide-react";
18
- import { useNavigate as A } from "react-router";
19
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
20
- import { Button as P, EmphasisPanel as F, NextSteps as I, Pagination as L } from "@burdenoff/fe-libs/ui";
12
+ import { useServerPagination as ae } from "../../hooks/useServerPagination.js";
13
+ import { calendarDaysUntil as oe, formatCalendarDate as l } from "./amcDates.js";
14
+ import { AmcContractFormDialog as se } from "./AmcContractFormDialog.js";
15
+ import { AmcCancelDialog as u, AmcDeleteDialog as d, AmcRenewDialog as f } from "./AmcContractActionDialogs.js";
16
+ import { useAmcManagement as p } from "./useAmcManagement.js";
17
+ import { computeAmcStats as m, listScheduledServices as h } from "./amcStats.js";
18
+ import { useEffect as g, useMemo as _, useState as v } from "react";
19
+ import { AlertTriangle as ce, Ban as le, Calendar as y, Clock as ue, Download as de, IndianRupee as fe, MapPin as pe, Pencil as me, Plus as b, RotateCcw as x, Shield as S, Trash2 as he, Wrench as C } from "lucide-react";
20
+ import { useNavigate as ge } from "react-router";
21
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
22
+ import { Button as D, EmphasisPanel as O, NextSteps as k, Pagination as A } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/housingvista/pages/amc/AMCManagementPage.tsx
22
- function R(e) {
24
+ function j(e) {
23
25
  switch (e) {
24
26
  case "active": return "success";
25
27
  case "expiring_soon": return "warning";
@@ -28,36 +30,48 @@ function R(e) {
28
30
  default: return "muted";
29
31
  }
30
32
  }
31
- function z() {
32
- s("housingvista.amc.viewed");
33
- let z = A(), B = u(10), [V, H] = y(""), [U, W] = y("");
34
- _(() => {
35
- let e = setTimeout(() => W(V), 300);
33
+ function M({ onRetry: e }) {
34
+ return /* @__PURE__ */ E("div", {
35
+ role: "alert",
36
+ className: "flex flex-wrap items-center gap-3 text-sm text-status-error-text",
37
+ children: [/* @__PURE__ */ T("span", { children: "Couldn't load every contract, so totals and the schedule are hidden." }), /* @__PURE__ */ T("button", {
38
+ type: "button",
39
+ onClick: e,
40
+ className: "rounded-md border border-border-subtle px-3 py-1 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken",
41
+ children: "Retry"
42
+ })]
43
+ });
44
+ }
45
+ function N() {
46
+ te("housingvista.amc.viewed");
47
+ let N = ge(), P = ae(10), [F, I] = v(""), [L, _e] = v("");
48
+ g(() => {
49
+ let e = setTimeout(() => _e(F), 300);
36
50
  return () => clearTimeout(e);
37
- }, [V]);
38
- let { data: G, loading: K } = c({
39
- filter: { search: U.trim() || void 0 },
40
- pagination: B.pagination
41
- }), { page: q, setPage: J } = B;
42
- _(() => {
43
- !K && G.length === 0 && q > 1 && J(q - 1);
51
+ }, [F]);
52
+ let { data: R, loading: z } = s({
53
+ filter: { search: L.trim() || void 0 },
54
+ pagination: P.pagination
55
+ }), { page: B, setPage: V } = P;
56
+ g(() => {
57
+ !z && R.length === 0 && B > 1 && V(B - 1);
44
58
  }, [
45
- K,
46
- G.length,
47
- q,
48
- J
59
+ z,
60
+ R.length,
61
+ B,
62
+ V
49
63
  ]);
50
- let { createAmcContract: oe, loading: se } = ee(), { data: ce } = te({
64
+ let { data: H, loading: ve, error: U, refetch: W } = ne(), { createAmcContract: ye, loading: be } = re(), { data: xe } = ie({
51
65
  filter: { status: "open" },
52
66
  pagination: {
53
67
  limit: 100,
54
68
  offset: 0
55
69
  }
56
- }), le = ce.length, ue = (e) => {
57
- H(e), B.setPage(1);
58
- }, de = () => {
59
- if (G.length === 0) {
60
- l.warning("Nothing to export", "There are no contracts to export yet.");
70
+ }), Se = xe.length, Ce = (e) => {
71
+ I(e), P.setPage(1);
72
+ }, we = () => {
73
+ if (R.length === 0) {
74
+ c.warning("Nothing to export", "There are no contracts to export yet.");
61
75
  return;
62
76
  }
63
77
  let e = (e) => `"${e.replace(/"/g, "\"\"")}"`, t = [
@@ -69,7 +83,7 @@ function z() {
69
83
  "End",
70
84
  "Status",
71
85
  "Services"
72
- ], n = G.map((t) => [
86
+ ], n = R.map((t) => [
73
87
  t.packageName,
74
88
  t.propertyTitle,
75
89
  t.providerName,
@@ -79,10 +93,10 @@ function z() {
79
93
  t.status,
80
94
  t.servicesIncluded.join("; ")
81
95
  ].map((t) => e(String(t))).join(",")), r = [t.map(e).join(","), ...n].join("\n"), i = new Blob([r], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(i), o = document.createElement("a");
82
- o.href = a, o.download = `housingvista-amc-contracts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a), l.success("Export ready", `${G.length} contracts exported to CSV.`);
83
- }, [fe, Y] = y(!1), X = ne(), pe = async (e) => {
96
+ o.href = a, o.download = `housingvista-amc-contracts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a), c.success("Export ready", `${R.length} contracts exported to CSV.`);
97
+ }, [Te, G] = v(!1), K = p({ onChanged: () => void W() }), Ee = async (e) => {
84
98
  try {
85
- await oe({
99
+ await ye({
86
100
  propertyId: e.propertyId || void 0,
87
101
  marketplaceServiceId: e.marketplaceServiceId || void 0,
88
102
  propertyTitle: e.propertyTitle,
@@ -94,14 +108,14 @@ function z() {
94
108
  status: "active",
95
109
  nextServiceDate: e.nextServiceDate || void 0,
96
110
  servicesIncluded: e.servicesIncluded.length > 0 ? e.servicesIncluded : void 0
97
- }), l.success("Contract created", `${e.packageName} added for ${e.propertyTitle}.`), Y(!1);
111
+ }), c.success("Contract created", `${e.packageName} added for ${e.propertyTitle}.`), G(!1), W();
98
112
  } catch (e) {
99
- l.error("Could not create contract", e.message);
113
+ c.error("Could not create contract", e.message);
100
114
  }
101
- }, me = async (e) => {
102
- let t = X.editTarget;
115
+ }, q = async (e) => {
116
+ let t = K.editTarget;
103
117
  if (t) try {
104
- await X.updateAmcContract(t.id, {
118
+ await K.updateAmcContract(t.id, {
105
119
  propertyId: e.propertyId || null,
106
120
  marketplaceServiceId: e.marketplaceServiceId || null,
107
121
  propertyTitle: e.propertyTitle,
@@ -112,277 +126,274 @@ function z() {
112
126
  endDate: e.endDate,
113
127
  nextServiceDate: e.nextServiceDate || null,
114
128
  servicesIncluded: e.servicesIncluded
115
- }), l.success("Contract updated", `${e.packageName} saved.`), X.setEditTarget(null);
129
+ }), c.success("Contract updated", `${e.packageName} saved.`), K.setEditTarget(null);
116
130
  } catch (e) {
117
- l.error("Could not update contract", e.message);
131
+ c.error("Could not update contract", e.message);
118
132
  }
119
- }, Z = () => Y(!0), Q = v(() => G.filter((e) => e.nextServiceDate && (e.status === "active" || e.status === "expiring_soon")).sort((e, t) => new Date(e.nextServiceDate).getTime() - new Date(t.nextServiceDate).getTime()), [G]), $ = v(() => ({
120
- activeContracts: G.filter((e) => e.status === "active" || e.status === "expiring_soon").length,
121
- pendingRenewals: G.filter((e) => e.status === "expiring_soon").length,
122
- totalMonthlySpent: G.filter((e) => e.status === "active" || e.status === "expiring_soon").reduce((e, t) => e + t.monthlyCost, 0),
123
- upcomingServices: Q.filter((e) => {
124
- let t = d(e.nextServiceDate);
125
- return t >= 0 && t <= 30;
126
- }).length
127
- }), [G, Q]), he = {
133
+ }, J = () => G(!0), Y = _(() => h(H), [H]), X = _(() => m(H, /* @__PURE__ */ new Date(), Y), [H, Y]), Z = !!U || ve && H.length === 0, Q = (e) => Z ? "—" : e, $ = U ? /* @__PURE__ */ T(M, { onRetry: () => void W() }) : null, De = {
128
134
  active: "border-l-4 border-l-status-success-border",
129
135
  expiring_soon: "border-l-4 border-l-status-warning-border bg-status-warning-bg-subtle/30",
130
136
  expired: "border-l-4 border-l-status-error-border",
131
137
  cancelled: "border-l-4 border-l-border-strong"
132
138
  };
133
- return /* @__PURE__ */ N(n, {
139
+ return /* @__PURE__ */ E(n, {
134
140
  title: "AMC Management",
135
141
  description: "Manage Annual Maintenance Contracts and service packages",
136
142
  purpose: "Keep your properties maintained without surprises. Track every Annual Maintenance Contract, see what each covers and costs, get ahead of renewals, and know which services are due in the next 30 days so nothing slips.",
137
- actions: /* @__PURE__ */ N("div", {
143
+ actions: /* @__PURE__ */ E("div", {
138
144
  className: "flex items-center gap-2",
139
- children: [/* @__PURE__ */ N("button", {
140
- onClick: de,
145
+ children: [/* @__PURE__ */ E("button", {
146
+ onClick: we,
141
147
  className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
142
- children: [/* @__PURE__ */ M(ie, { className: "h-4 w-4" }), "Export"]
143
- }), /* @__PURE__ */ N(P, {
148
+ children: [/* @__PURE__ */ T(de, { className: "h-4 w-4" }), "Export"]
149
+ }), /* @__PURE__ */ E(D, {
144
150
  type: "button",
145
- onClick: Z,
151
+ onClick: J,
146
152
  className: "gap-2",
147
- children: [/* @__PURE__ */ M(E, { className: "h-4 w-4" }), "New Contract"]
153
+ children: [/* @__PURE__ */ T(b, { className: "h-4 w-4" }), "New Contract"]
148
154
  })]
149
155
  }),
150
156
  children: [
151
- /* @__PURE__ */ M(F, {
157
+ /* @__PURE__ */ E(O, {
152
158
  className: "p-4",
153
- children: /* @__PURE__ */ N("div", {
159
+ children: [/* @__PURE__ */ E("div", {
154
160
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
155
161
  children: [
156
- /* @__PURE__ */ M(r, {
162
+ /* @__PURE__ */ T(r, {
157
163
  label: "Active Contracts",
158
- value: $.activeContracts,
159
- icon: /* @__PURE__ */ M(O, { className: "h-4 w-4" })
164
+ value: Q(X.activeContracts),
165
+ icon: /* @__PURE__ */ T(S, { className: "h-4 w-4" })
160
166
  }),
161
- /* @__PURE__ */ M(r, {
167
+ /* @__PURE__ */ T(r, {
162
168
  label: "Pending Renewals",
163
- value: $.pendingRenewals,
164
- icon: /* @__PURE__ */ M(D, { className: "h-4 w-4" })
169
+ value: Q(X.pendingRenewals),
170
+ icon: /* @__PURE__ */ T(x, { className: "h-4 w-4" })
165
171
  }),
166
- /* @__PURE__ */ M(r, {
172
+ /* @__PURE__ */ T(r, {
167
173
  label: "Total Monthly Spent",
168
- value: $.totalMonthlySpent,
169
- prefix: "$",
170
- icon: /* @__PURE__ */ M(C, { className: "h-4 w-4" })
174
+ value: Z ? "—" : t(X.totalMonthlySpent),
175
+ icon: /* @__PURE__ */ T(fe, { className: "h-4 w-4" })
171
176
  }),
172
- /* @__PURE__ */ M(r, {
177
+ /* @__PURE__ */ T(r, {
173
178
  label: "Upcoming Services",
174
- value: $.upcomingServices,
175
- icon: /* @__PURE__ */ M(x, { className: "h-4 w-4" })
179
+ value: Q(X.upcomingServices),
180
+ icon: /* @__PURE__ */ T(y, { className: "h-4 w-4" })
176
181
  })
177
182
  ]
178
- })
183
+ }), $ && /* @__PURE__ */ T("div", {
184
+ className: "mt-3",
185
+ children: $
186
+ })]
179
187
  }),
180
- /* @__PURE__ */ M(I, {
188
+ /* @__PURE__ */ T(k, {
181
189
  storageKey: "housingvista-amc",
182
190
  steps: [
183
191
  {
184
192
  id: "pick-property",
185
193
  label: "Add coverage for a property",
186
194
  description: "Choose a property to set up a new maintenance contract.",
187
- onClick: Z
195
+ onClick: J
188
196
  },
189
197
  {
190
198
  id: "compare-providers",
191
199
  label: "Compare your providers",
192
200
  description: "Search by provider name to weigh coverage and monthly cost.",
193
201
  onClick: () => {
194
- let e = G[0]?.providerName;
195
- e && (H(e), B.setPage(1));
202
+ let e = R[0]?.providerName;
203
+ e && (I(e), P.setPage(1));
196
204
  }
197
205
  },
198
206
  {
199
207
  id: "check-legal",
200
208
  label: "Review contract paperwork",
201
209
  description: "Open the legal hub to manage the underlying documents.",
202
- onClick: () => z("../legal")
210
+ onClick: () => N("../legal")
203
211
  }
204
212
  ]
205
213
  }),
206
- /* @__PURE__ */ N("div", {
214
+ /* @__PURE__ */ E("div", {
207
215
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
208
- children: [/* @__PURE__ */ N("div", {
216
+ children: [/* @__PURE__ */ E("div", {
209
217
  className: "space-y-4 lg:col-span-2",
210
- children: [/* @__PURE__ */ N("div", {
218
+ children: [/* @__PURE__ */ E("div", {
211
219
  className: "flex flex-col gap-3",
212
- children: [/* @__PURE__ */ M("h2", {
220
+ children: [/* @__PURE__ */ T("h2", {
213
221
  className: "text-lg font-semibold text-text-primary",
214
222
  children: "All Contracts"
215
- }), /* @__PURE__ */ M(o, {
216
- searchValue: V,
217
- onSearchChange: ue,
223
+ }), /* @__PURE__ */ T(o, {
224
+ searchValue: F,
225
+ onSearchChange: Ce,
218
226
  searchPlaceholder: "Search contracts, providers, properties..."
219
227
  })]
220
- }), G.length > 0 ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("div", {
228
+ }), R.length > 0 ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
221
229
  className: "space-y-3",
222
- children: G.map((n) => /* @__PURE__ */ N("div", {
223
- className: e("rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm", he[n.status]),
230
+ children: R.map((n) => /* @__PURE__ */ E("div", {
231
+ className: e("rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm", De[n.status]),
224
232
  children: [
225
- /* @__PURE__ */ N("div", {
233
+ /* @__PURE__ */ E("div", {
226
234
  className: "flex flex-wrap items-start justify-between gap-2",
227
- children: [/* @__PURE__ */ N("div", {
235
+ children: [/* @__PURE__ */ E("div", {
228
236
  className: "min-w-0",
229
237
  children: [
230
- /* @__PURE__ */ N("p", {
238
+ /* @__PURE__ */ E("p", {
231
239
  className: "flex items-center gap-1 text-xs text-text-secondary",
232
- children: [/* @__PURE__ */ M(w, { className: "h-3 w-3" }), "Property"]
240
+ children: [/* @__PURE__ */ T(pe, { className: "h-3 w-3" }), "Property"]
233
241
  }),
234
- n.propertyId ? /* @__PURE__ */ M("button", {
242
+ n.propertyId ? /* @__PURE__ */ T("button", {
235
243
  type: "button",
236
- onClick: () => z(`../properties/${n.propertyId}`),
244
+ onClick: () => N(`../properties/${n.propertyId}`),
237
245
  className: "block max-w-full truncate text-left text-base font-semibold text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
238
246
  children: n.propertyTitle
239
- }) : /* @__PURE__ */ M("h3", {
247
+ }) : /* @__PURE__ */ T("h3", {
240
248
  className: "truncate text-base font-semibold text-text-primary",
241
249
  children: n.propertyTitle
242
250
  }),
243
- /* @__PURE__ */ M("p", {
251
+ /* @__PURE__ */ T("p", {
244
252
  className: "text-xs text-text-secondary",
245
253
  children: n.packageName
246
254
  })
247
255
  ]
248
- }), /* @__PURE__ */ M(i, {
256
+ }), /* @__PURE__ */ T(i, {
249
257
  label: n.status.replace("_", " "),
250
- variant: R(n.status),
258
+ variant: j(n.status),
251
259
  dot: !0
252
260
  })]
253
261
  }),
254
- /* @__PURE__ */ N("div", {
262
+ /* @__PURE__ */ E("div", {
255
263
  className: "mt-4 grid grid-cols-2 gap-4 border-t border-border-subtle pt-4 sm:grid-cols-4",
256
264
  children: [
257
- /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
265
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
258
266
  className: "text-xs text-text-secondary",
259
267
  children: "Provider"
260
- }), n.marketplaceServiceId ? /* @__PURE__ */ M("button", {
268
+ }), n.marketplaceServiceId ? /* @__PURE__ */ T("button", {
261
269
  type: "button",
262
- onClick: () => z(`../marketplace/${n.marketplaceServiceId}`),
270
+ onClick: () => N(`../marketplace/${n.marketplaceServiceId}`),
263
271
  className: "mt-0.5 block max-w-full truncate text-left text-sm font-medium text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
264
272
  children: n.providerName
265
- }) : /* @__PURE__ */ M("p", {
273
+ }) : /* @__PURE__ */ T("p", {
266
274
  className: "mt-0.5 text-sm font-medium text-text-primary",
267
275
  children: n.providerName
268
276
  })] }),
269
- /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
277
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
270
278
  className: "text-xs text-text-secondary",
271
279
  children: "Coverage"
272
- }), /* @__PURE__ */ N("p", {
280
+ }), /* @__PURE__ */ E("p", {
273
281
  className: "mt-0.5 truncate text-sm font-medium text-text-primary",
274
282
  children: [n.servicesIncluded.length > 0 ? n.servicesIncluded.slice(0, 2).join(", ") : "—", n.servicesIncluded.length > 2 ? ` +${n.servicesIncluded.length - 2}` : ""]
275
283
  })] }),
276
- /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
284
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
277
285
  className: "text-xs text-text-secondary",
278
286
  children: "Monthly Cost"
279
- }), /* @__PURE__ */ N("p", {
287
+ }), /* @__PURE__ */ E("p", {
280
288
  className: "mt-0.5 text-sm font-semibold text-text-primary",
281
- children: [t(n.monthlyCost), /* @__PURE__ */ M("span", {
289
+ children: [t(n.monthlyCost), /* @__PURE__ */ T("span", {
282
290
  className: "text-xs font-normal text-text-secondary",
283
291
  children: "/mo"
284
292
  })]
285
293
  })] }),
286
- /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
294
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
287
295
  className: "text-xs text-text-secondary",
288
296
  children: "Renewal Date"
289
- }), /* @__PURE__ */ M("p", {
297
+ }), /* @__PURE__ */ T("p", {
290
298
  className: "mt-0.5 text-sm font-medium text-text-primary",
291
- children: f(n.endDate)
299
+ children: l(n.endDate)
292
300
  })] })
293
301
  ]
294
302
  }),
295
- n.nextServiceDate && /* @__PURE__ */ N("p", {
303
+ n.nextServiceDate && /* @__PURE__ */ E("p", {
296
304
  className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary",
297
305
  children: [
298
- /* @__PURE__ */ M(x, { className: "h-3.5 w-3.5" }),
306
+ /* @__PURE__ */ T(y, { className: "h-3.5 w-3.5" }),
299
307
  "Next service ",
300
- f(n.nextServiceDate)
308
+ l(n.nextServiceDate)
301
309
  ]
302
310
  }),
303
- /* @__PURE__ */ N("div", {
311
+ /* @__PURE__ */ E("div", {
304
312
  className: "mt-3 flex flex-wrap items-center gap-2 border-t border-border-subtle pt-3",
305
313
  children: [
306
- /* @__PURE__ */ N(P, {
314
+ /* @__PURE__ */ E(D, {
307
315
  type: "button",
308
316
  variant: "outline",
309
317
  size: "sm",
310
- onClick: () => X.setEditTarget(n),
311
- children: [/* @__PURE__ */ M(T, { className: "mr-1.5 h-3.5 w-3.5" }), "Edit"]
318
+ onClick: () => K.setEditTarget(n),
319
+ children: [/* @__PURE__ */ T(me, { className: "mr-1.5 h-3.5 w-3.5" }), "Edit"]
312
320
  }),
313
- n.status !== "cancelled" && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N(P, {
321
+ n.status !== "cancelled" && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E(D, {
314
322
  type: "button",
315
323
  variant: "outline",
316
324
  size: "sm",
317
- onClick: () => X.openRenew(n),
318
- children: [/* @__PURE__ */ M(D, { className: "mr-1.5 h-3.5 w-3.5" }), "Renew"]
319
- }), /* @__PURE__ */ N(P, {
325
+ onClick: () => K.openRenew(n),
326
+ children: [/* @__PURE__ */ T(x, { className: "mr-1.5 h-3.5 w-3.5" }), "Renew"]
327
+ }), /* @__PURE__ */ E(D, {
320
328
  type: "button",
321
329
  variant: "outline",
322
330
  size: "sm",
323
- onClick: () => X.setCancelTarget(n),
324
- children: [/* @__PURE__ */ M(b, { className: "mr-1.5 h-3.5 w-3.5" }), "Cancel"]
331
+ onClick: () => K.setCancelTarget(n),
332
+ children: [/* @__PURE__ */ T(le, { className: "mr-1.5 h-3.5 w-3.5" }), "Cancel"]
325
333
  })] }),
326
- /* @__PURE__ */ N(P, {
334
+ /* @__PURE__ */ E(D, {
327
335
  type: "button",
328
336
  variant: "outline",
329
337
  size: "sm",
330
338
  className: "ml-auto text-status-error-text",
331
- onClick: () => X.setDeleteTarget(n),
332
- children: [/* @__PURE__ */ M(ae, { className: "mr-1.5 h-3.5 w-3.5" }), "Delete"]
339
+ onClick: () => K.setDeleteTarget(n),
340
+ children: [/* @__PURE__ */ T(he, { className: "mr-1.5 h-3.5 w-3.5" }), "Delete"]
333
341
  })
334
342
  ]
335
343
  })
336
344
  ]
337
345
  }, n.id))
338
- }), /* @__PURE__ */ M(L, {
339
- page: B.page,
340
- pageSize: B.pageSize,
341
- hasNextPage: G.length >= B.pageSize,
342
- hasPreviousPage: B.page > 1,
343
- onPageChange: B.setPage,
344
- onPageSizeChange: B.setPageSize
345
- })] }) : /* @__PURE__ */ M(a, {
346
+ }), /* @__PURE__ */ T(A, {
347
+ page: P.page,
348
+ pageSize: P.pageSize,
349
+ hasNextPage: R.length >= P.pageSize,
350
+ hasPreviousPage: P.page > 1,
351
+ onPageChange: P.setPage,
352
+ onPageSizeChange: P.setPageSize
353
+ })] }) : /* @__PURE__ */ T(a, {
346
354
  illustration: "empty-search",
347
- icon: /* @__PURE__ */ M(O, { className: "h-12 w-12" }),
355
+ icon: /* @__PURE__ */ T(S, { className: "h-12 w-12" }),
348
356
  title: "No contracts found",
349
357
  description: "Try adjusting your search criteria or create a new contract.",
350
- action: /* @__PURE__ */ N(P, {
358
+ action: /* @__PURE__ */ E(D, {
351
359
  type: "button",
352
- onClick: Z,
360
+ onClick: J,
353
361
  className: "gap-2",
354
- children: [/* @__PURE__ */ M(E, { className: "h-4 w-4" }), "New Contract"]
362
+ children: [/* @__PURE__ */ T(b, { className: "h-4 w-4" }), "New Contract"]
355
363
  })
356
364
  })]
357
- }), /* @__PURE__ */ N("aside", {
365
+ }), /* @__PURE__ */ E("aside", {
358
366
  className: "space-y-6 lg:col-span-1",
359
- children: [/* @__PURE__ */ N("div", {
367
+ children: [/* @__PURE__ */ E("div", {
360
368
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
361
- children: [/* @__PURE__ */ M("h3", {
369
+ children: [/* @__PURE__ */ T("h3", {
362
370
  className: "mb-4 text-base font-semibold text-text-primary",
363
371
  children: "Upcoming Service Schedule"
364
- }), Q.length === 0 ? /* @__PURE__ */ M(a, {
372
+ }), $ || (Z ? /* @__PURE__ */ T(ee, {
373
+ variant: "card",
374
+ count: 2
375
+ }) : Y.length === 0 ? /* @__PURE__ */ T(a, {
365
376
  illustration: "empty-generic",
366
377
  title: "No services scheduled",
367
378
  description: "Upcoming service dates from your active contracts will appear here.",
368
379
  className: "border-0 bg-transparent p-4"
369
- }) : /* @__PURE__ */ M("ol", {
380
+ }) : /* @__PURE__ */ T("ol", {
370
381
  className: "space-y-4",
371
- children: Q.map((t) => {
372
- let n = d(t.nextServiceDate), r = n <= 7, i = n < 0;
373
- return /* @__PURE__ */ N("li", {
382
+ children: Y.map((t) => {
383
+ let n = oe(t.nextServiceDate), r = n <= 7, i = n < 0;
384
+ return /* @__PURE__ */ E("li", {
374
385
  className: "flex gap-3",
375
- children: [/* @__PURE__ */ M("div", {
386
+ children: [/* @__PURE__ */ T("div", {
376
387
  className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", i ? "bg-status-error-bg-subtle" : r ? "bg-status-warning-bg-subtle" : "bg-status-info-bg-subtle"),
377
- children: i ? /* @__PURE__ */ M(re, { className: "h-4 w-4 text-status-error-text" }) : r ? /* @__PURE__ */ M(S, { className: "h-4 w-4 text-status-warning-text" }) : /* @__PURE__ */ M(k, { className: "h-4 w-4 text-status-info-text" })
378
- }), /* @__PURE__ */ N("div", {
388
+ children: i ? /* @__PURE__ */ T(ce, { className: "h-4 w-4 text-status-error-text" }) : r ? /* @__PURE__ */ T(ue, { className: "h-4 w-4 text-status-warning-text" }) : /* @__PURE__ */ T(C, { className: "h-4 w-4 text-status-info-text" })
389
+ }), /* @__PURE__ */ E("div", {
379
390
  className: "min-w-0",
380
391
  children: [
381
- /* @__PURE__ */ M("p", {
392
+ /* @__PURE__ */ T("p", {
382
393
  className: "text-sm font-medium text-text-primary",
383
- children: f(t.nextServiceDate)
394
+ children: l(t.nextServiceDate)
384
395
  }),
385
- /* @__PURE__ */ N("p", {
396
+ /* @__PURE__ */ E("p", {
386
397
  className: "truncate text-sm text-text-primary",
387
398
  children: [
388
399
  t.packageName,
@@ -390,11 +401,11 @@ function z() {
390
401
  t.propertyTitle
391
402
  ]
392
403
  }),
393
- /* @__PURE__ */ M("p", {
404
+ /* @__PURE__ */ T("p", {
394
405
  className: "truncate text-xs text-text-secondary",
395
406
  children: t.providerName
396
407
  }),
397
- /* @__PURE__ */ M("p", {
408
+ /* @__PURE__ */ T("p", {
398
409
  className: e("text-xs font-medium", i ? "text-status-error-text" : r ? "text-status-warning-text" : "text-text-secondary"),
399
410
  children: i ? `${Math.abs(n)} days overdue` : n === 0 ? "Today" : `In ${n} days`
400
411
  })
@@ -402,57 +413,57 @@ function z() {
402
413
  })]
403
414
  }, t.id);
404
415
  })
405
- })]
406
- }), /* @__PURE__ */ N("button", {
416
+ }))]
417
+ }), /* @__PURE__ */ E("button", {
407
418
  type: "button",
408
- onClick: () => z("../rental"),
419
+ onClick: () => N("../rental"),
409
420
  className: "flex w-full items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4 text-left shadow-sm transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
410
- children: [/* @__PURE__ */ M("div", {
421
+ children: [/* @__PURE__ */ T("div", {
411
422
  className: "rounded-lg bg-status-info-bg-subtle p-2.5",
412
- children: /* @__PURE__ */ M(k, { className: "h-5 w-5 text-status-info-text" })
413
- }), /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("p", {
423
+ children: /* @__PURE__ */ T(C, { className: "h-5 w-5 text-status-info-text" })
424
+ }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
414
425
  className: "text-sm text-text-secondary",
415
426
  children: "Open maintenance requests"
416
- }), /* @__PURE__ */ M("p", {
427
+ }), /* @__PURE__ */ T("p", {
417
428
  className: "text-xl font-bold text-text-primary",
418
- children: le
429
+ children: Se
419
430
  })] })]
420
431
  })]
421
432
  })]
422
433
  }),
423
- /* @__PURE__ */ M(p, {
424
- open: fe || X.editTarget !== null,
434
+ /* @__PURE__ */ T(se, {
435
+ open: Te || K.editTarget !== null,
425
436
  onOpenChange: (e) => {
426
- e || (Y(!1), X.setEditTarget(null));
437
+ e || (G(!1), K.setEditTarget(null));
427
438
  },
428
- contract: X.editTarget,
429
- saving: se || X.updating,
430
- onSubmit: X.editTarget ? me : pe
439
+ contract: K.editTarget,
440
+ saving: be || K.updating,
441
+ onSubmit: K.editTarget ? q : Ee
431
442
  }),
432
- /* @__PURE__ */ M(g, {
433
- contract: X.renewTarget,
434
- endDate: X.renewEnd,
435
- onEndDateChange: X.setRenewEnd,
436
- onClose: () => X.setRenewTarget(null),
437
- onSubmit: X.handleRenew,
438
- busy: X.renewing
443
+ /* @__PURE__ */ T(f, {
444
+ contract: K.renewTarget,
445
+ endDate: K.renewEnd,
446
+ onEndDateChange: K.setRenewEnd,
447
+ onClose: () => K.setRenewTarget(null),
448
+ onSubmit: K.handleRenew,
449
+ busy: K.renewing
439
450
  }),
440
- /* @__PURE__ */ M(m, {
441
- contract: X.cancelTarget,
442
- onClose: () => X.setCancelTarget(null),
443
- onConfirm: X.confirmCancel,
444
- busy: X.updating
451
+ /* @__PURE__ */ T(u, {
452
+ contract: K.cancelTarget,
453
+ onClose: () => K.setCancelTarget(null),
454
+ onConfirm: K.confirmCancel,
455
+ busy: K.updating
445
456
  }),
446
- /* @__PURE__ */ M(h, {
447
- contract: X.deleteTarget,
448
- onClose: () => X.setDeleteTarget(null),
449
- onConfirm: X.confirmDelete,
450
- busy: X.deleting
457
+ /* @__PURE__ */ T(d, {
458
+ contract: K.deleteTarget,
459
+ onClose: () => K.setDeleteTarget(null),
460
+ onConfirm: K.confirmDelete,
461
+ busy: K.deleting
451
462
  })
452
463
  ]
453
464
  });
454
465
  }
455
466
  //#endregion
456
- export { z as AMCManagementPage };
467
+ export { N as AMCManagementPage };
457
468
 
458
469
  //# sourceMappingURL=AMCManagementPage.js.map