@burdenoff/microfe-timecampus 2026.1031.10 → 2026.1031.11

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 (77) hide show
  1. package/dist/generated/wspace-operations.d.ts +45 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +710 -672
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +731 -0
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/generated/wspace-types.js +14 -12
  8. package/dist/generated/wspace-types.js.map +1 -1
  9. package/dist/index.js +7 -7
  10. package/dist/timecampus/analytics/index.d.ts +3 -0
  11. package/dist/timecampus/analytics/index.d.ts.map +1 -0
  12. package/dist/timecampus/analytics/index.js +3 -0
  13. package/dist/timecampus/analytics/timecampusAnalytics.d.ts +83 -0
  14. package/dist/timecampus/analytics/timecampusAnalytics.d.ts.map +1 -0
  15. package/dist/timecampus/analytics/timecampusAnalytics.js +175 -0
  16. package/dist/timecampus/analytics/timecampusAnalytics.js.map +1 -0
  17. package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts +16 -0
  18. package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts.map +1 -0
  19. package/dist/timecampus/analytics/useTimeCampusAnalytics.js +48 -0
  20. package/dist/timecampus/analytics/useTimeCampusAnalytics.js.map +1 -0
  21. package/dist/timecampus/components/ActivationCard.d.ts +3 -0
  22. package/dist/timecampus/components/ActivationCard.d.ts.map +1 -0
  23. package/dist/timecampus/components/ActivationCard.js +156 -0
  24. package/dist/timecampus/components/ActivationCard.js.map +1 -0
  25. package/dist/timecampus/index.js +7 -7
  26. package/dist/timecampus/pages/HomePage.d.ts.map +1 -1
  27. package/dist/timecampus/pages/HomePage.js +142 -139
  28. package/dist/timecampus/pages/HomePage.js.map +1 -1
  29. package/dist/timecampus/pages/client-portal/ClientPortalPage.d.ts.map +1 -1
  30. package/dist/timecampus/pages/client-portal/ClientPortalPage.js +244 -228
  31. package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
  32. package/dist/timecampus/pages/dashboard/AnalyticsPage.d.ts.map +1 -1
  33. package/dist/timecampus/pages/dashboard/AnalyticsPage.js +117 -112
  34. package/dist/timecampus/pages/dashboard/AnalyticsPage.js.map +1 -1
  35. package/dist/timecampus/pages/dashboard/ReportsPage.d.ts.map +1 -1
  36. package/dist/timecampus/pages/dashboard/ReportsPage.js +105 -102
  37. package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
  38. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.d.ts.map +1 -1
  39. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +209 -192
  40. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
  41. package/dist/timecampus/pages/focus-score/FocusScorePage.d.ts.map +1 -1
  42. package/dist/timecampus/pages/focus-score/FocusScorePage.js +71 -68
  43. package/dist/timecampus/pages/focus-score/FocusScorePage.js.map +1 -1
  44. package/dist/timecampus/pages/invoicing/InvoicingPage.d.ts.map +1 -1
  45. package/dist/timecampus/pages/invoicing/InvoicingPage.js +157 -150
  46. package/dist/timecampus/pages/invoicing/InvoicingPage.js.map +1 -1
  47. package/dist/timecampus/pages/meetings/MeetingCreatePage.d.ts.map +1 -1
  48. package/dist/timecampus/pages/meetings/MeetingCreatePage.js +58 -52
  49. package/dist/timecampus/pages/meetings/MeetingCreatePage.js.map +1 -1
  50. package/dist/timecampus/pages/meetings/MeetingsPage.d.ts.map +1 -1
  51. package/dist/timecampus/pages/meetings/MeetingsPage.js +51 -45
  52. package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
  53. package/dist/timecampus/pages/pomodoro/PomodoroPage.d.ts.map +1 -1
  54. package/dist/timecampus/pages/pomodoro/PomodoroPage.js +55 -51
  55. package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
  56. package/dist/timecampus/pages/projects/ProjectCreatePage.d.ts.map +1 -1
  57. package/dist/timecampus/pages/projects/ProjectCreatePage.js +59 -49
  58. package/dist/timecampus/pages/projects/ProjectCreatePage.js.map +1 -1
  59. package/dist/timecampus/pages/projects/ProjectsPage.d.ts.map +1 -1
  60. package/dist/timecampus/pages/projects/ProjectsPage.js +165 -155
  61. package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
  62. package/dist/timecampus/pages/time/TimeEntriesPage.d.ts.map +1 -1
  63. package/dist/timecampus/pages/time/TimeEntriesPage.js +194 -186
  64. package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
  65. package/dist/timecampus/pages/time/TimeTrackingPage.d.ts.map +1 -1
  66. package/dist/timecampus/pages/time/TimeTrackingPage.js +139 -126
  67. package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
  68. package/dist/timecampus/pages/time/TimerPage.d.ts.map +1 -1
  69. package/dist/timecampus/pages/time/TimerPage.js +48 -35
  70. package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
  71. package/dist/timecampus/pages/time-approval/TimeApprovalPage.d.ts.map +1 -1
  72. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +60 -50
  73. package/dist/timecampus/pages/time-approval/TimeApprovalPage.js.map +1 -1
  74. package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
  75. package/dist/timecampus/pages/timeline/TimelinePage.js +223 -219
  76. package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
  77. package/package.json +1 -1
@@ -3,23 +3,25 @@ import { formatCurrency as t, formatDate as n } from "../../utils/helpers.js";
3
3
  import { StatCard as r } from "../../components/StatCard.js";
4
4
  import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
5
5
  import { EmptyState as a } from "../../components/EmptyState.js";
6
- import { useDeleteInvoiceDraftMutation as o, useGenerateInvoiceDraftMutation as ee, useGetInvoiceStatsQuery as s, useListInvoicesQuery as te, useUpdateInvoiceStatusMutation as ne } from "../../../generated/wspace-operations.js";
7
- import { PageLayout as c } from "../../components/PageLayout.js";
8
- import { StatusBadge as re } from "../../components/StatusBadge.js";
9
- import { Modal as l } from "../../components/Modal.js";
10
- import { ToastContainer as ie, useToast as ae } from "../../components/Toast.js";
6
+ import { useDeleteInvoiceDraftMutation as o, useGenerateInvoiceDraftMutation as ee, useGetInvoiceStatsQuery as te, useListInvoicesQuery as ne, useUpdateInvoiceStatusMutation as re } from "../../../generated/wspace-operations.js";
7
+ import { useTimeCampusAnalytics as ie } from "../../analytics/useTimeCampusAnalytics.js";
8
+ import "../../analytics/index.js";
9
+ import { PageLayout as s } from "../../components/PageLayout.js";
10
+ import { StatusBadge as ae } from "../../components/StatusBadge.js";
11
+ import { Modal as c } from "../../components/Modal.js";
12
+ import { ToastContainer as oe, useToast as l } from "../../components/Toast.js";
11
13
  import { TimeCampusInvoiceStatus as u } from "../../../generated/wspace-types.js";
12
14
  import { useState as d } from "react";
13
- import { AlertTriangle as oe, CheckCircle2 as se, DollarSign as ce, Download as f, Eye as le, FileText as p, Plus as ue, Send as de, Trash2 as fe } from "lucide-react";
15
+ import { AlertTriangle as se, CheckCircle2 as ce, DollarSign as le, Download as f, Eye as ue, FileText as p, Plus as de, Send as fe, Trash2 as pe } from "lucide-react";
14
16
  import { gql as m } from "@apollo/client";
15
17
  import { useApolloClient as h } from "@apollo/client/react";
16
18
  import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
17
19
  //#region src/timecampus/pages/invoicing/InvoicingPage.tsx
18
- var y = 25, b = "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", pe = m`
20
+ var y = 25, b = "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", me = m`
19
21
  query TimeCampusInvoicing_GetInvoiceHtml($id: ID!, $workspaceId: ID!) {
20
22
  timeCampusInvoiceHtml(id: $id, workspaceId: $workspaceId)
21
23
  }
22
- `, me = m`
24
+ `, he = m`
23
25
  query TimeCampusInvoicing_GetInvoicePdf($id: ID!, $workspaceId: ID!) {
24
26
  timeCampusInvoicePdf(id: $id, workspaceId: $workspaceId)
25
27
  }
@@ -43,14 +45,14 @@ var C = {
43
45
  notes: "",
44
46
  projectIds: ""
45
47
  };
46
- function he(e, t) {
48
+ function ge(e, t) {
47
49
  let n = atob(e), r = new Uint8Array(n.length);
48
50
  for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
49
51
  let i = new Blob([r], { type: "application/pdf" }), a = URL.createObjectURL(i), o = document.createElement("a");
50
52
  o.href = a, o.download = t, document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(a);
51
53
  }
52
54
  function w() {
53
- let { workspaceId: m = "" } = e(), { toasts: w, addToast: T, dismissToast: ge } = ae(), E = h(), { data: D, loading: O, error: _e, refetch: ve, fetchMore: ye } = te({
55
+ let { workspaceId: m = "" } = e(), { toasts: w, addToast: T, dismissToast: _e } = l(), E = h(), { data: D, loading: O, error: ve, refetch: ye, fetchMore: be } = ne({
54
56
  variables: {
55
57
  workspaceId: m,
56
58
  pagination: {
@@ -59,17 +61,17 @@ function w() {
59
61
  }
60
62
  },
61
63
  notifyOnNetworkStatusChange: !0
62
- }), { data: be, loading: xe, refetch: Se } = s({ variables: { workspaceId: m } }), [Ce, { loading: k }] = ee(), [A] = ne(), [we, { loading: j }] = o(), M = D?.timeCampusInvoices?.items ?? [], Te = D?.timeCampusInvoices?.total ?? 0, N = be?.timeCampusInvoiceStats, [P, F] = d(!1), [Ee, De] = d(!0), [Oe, I] = d(!1), [L, R] = d(C), [z, B] = d(null), [V, H] = d(null), [ke, U] = d(!1), [W, G] = d(null), [K, q] = d(null), [Ae, J] = d(null), Y = async () => {
63
- await Promise.all([ve(), Se()]);
64
- }, je = () => {
65
- R({
64
+ }), { data: xe, loading: Se, refetch: Ce } = te({ variables: { workspaceId: m } }), [k, { loading: A }] = ee(), we = ie(), [j] = re(), [Te, { loading: M }] = o(), N = D?.timeCampusInvoices?.items ?? [], Ee = D?.timeCampusInvoices?.total ?? 0, P = xe?.timeCampusInvoiceStats, [F, I] = d(!1), [De, Oe] = d(!0), [ke, L] = d(!1), [R, z] = d(C), [B, V] = d(null), [H, U] = d(null), [Ae, W] = d(!1), [G, K] = d(null), [q, J] = d(null), [je, Y] = d(null), X = async () => {
65
+ await Promise.all([ye(), Ce()]);
66
+ }, Me = () => {
67
+ z({
66
68
  ...C,
67
69
  periodStart: S(),
68
70
  periodEnd: x()
69
- }), I(!0);
70
- }, X = () => I(!1), Me = async () => {
71
- if (!L.clientName.trim() || !L.periodStart || !L.periodEnd) return;
72
- let e = Number(L.taxRatePercent || "0") / 100;
71
+ }), L(!0);
72
+ }, Z = () => L(!1), Ne = async () => {
73
+ if (!R.clientName.trim() || !R.periodStart || !R.periodEnd) return;
74
+ let e = Number(R.taxRatePercent || "0") / 100;
73
75
  if (Number.isNaN(e) || e < 0 || e > 1) {
74
76
  T({
75
77
  title: "Tax rate must be between 0 and 100%",
@@ -78,106 +80,111 @@ function w() {
78
80
  return;
79
81
  }
80
82
  try {
81
- await Ce({ variables: { input: {
83
+ let t = (await k({ variables: { input: {
82
84
  workspaceId: m,
83
- clientName: L.clientName.trim(),
84
- clientEmail: L.clientEmail.trim() || void 0,
85
- clientAddress: L.clientAddress.trim() || void 0,
86
- periodStart: new Date(L.periodStart).toISOString(),
87
- periodEnd: (/* @__PURE__ */ new Date(new Date(L.periodEnd).getTime() + 864e5 - 1)).toISOString(),
85
+ clientName: R.clientName.trim(),
86
+ clientEmail: R.clientEmail.trim() || void 0,
87
+ clientAddress: R.clientAddress.trim() || void 0,
88
+ periodStart: new Date(R.periodStart).toISOString(),
89
+ periodEnd: (/* @__PURE__ */ new Date(new Date(R.periodEnd).getTime() + 864e5 - 1)).toISOString(),
88
90
  taxRate: e,
89
- currency: L.currency.trim() || "USD",
90
- dueDate: L.dueDate ? new Date(L.dueDate).toISOString() : void 0,
91
- notes: L.notes.trim() || void 0,
92
- projectIds: L.projectIds.trim() ? L.projectIds.split(",").map((e) => e.trim()).filter(Boolean) : void 0
93
- } } }), T({
91
+ currency: R.currency.trim() || "USD",
92
+ dueDate: R.dueDate ? new Date(R.dueDate).toISOString() : void 0,
93
+ notes: R.notes.trim() || void 0,
94
+ projectIds: R.projectIds.trim() ? R.projectIds.split(",").map((e) => e.trim()).filter(Boolean) : void 0
95
+ } } })).data?.generateTimeCampusInvoiceDraft;
96
+ if (!t) throw Error("Failed to generate invoice — check the billing period has un-invoiced billable time");
97
+ we.invoiceCreated({
98
+ invoiceId: t.id,
99
+ lineItemCount: t.lineItems?.length ?? 0
100
+ }), T({
94
101
  title: "Draft invoice generated",
95
102
  variant: "success"
96
- }), X(), await Y();
103
+ }), Z(), await X();
97
104
  } catch (e) {
98
105
  T({
99
106
  title: e instanceof Error ? e.message : "Failed to generate invoice — check the billing period has un-invoiced billable time",
100
107
  variant: "error"
101
108
  });
102
109
  }
103
- }, Z = async (e) => {
104
- J(e.id);
110
+ }, Pe = async (e) => {
111
+ Y(e.id);
105
112
  try {
106
- await A({ variables: { input: {
113
+ await j({ variables: { input: {
107
114
  id: e.id,
108
115
  workspaceId: m,
109
116
  status: u.Sent
110
117
  } } }), T({
111
118
  title: "Invoice marked as sent",
112
119
  variant: "success"
113
- }), await Y();
120
+ }), await X();
114
121
  } catch {
115
122
  T({
116
123
  title: "Failed to update invoice status",
117
124
  variant: "error"
118
125
  });
119
126
  } finally {
120
- J(null);
127
+ Y(null);
121
128
  }
122
- }, Ne = async (e) => {
123
- J(e.id);
129
+ }, Fe = async (e) => {
130
+ Y(e.id);
124
131
  try {
125
- await A({ variables: { input: {
132
+ await j({ variables: { input: {
126
133
  id: e.id,
127
134
  workspaceId: m,
128
135
  status: u.Paid
129
136
  } } }), T({
130
137
  title: "Invoice marked as paid",
131
138
  variant: "success"
132
- }), await Y();
139
+ }), await X();
133
140
  } catch {
134
141
  T({
135
142
  title: "Failed to update invoice status",
136
143
  variant: "error"
137
144
  });
138
145
  } finally {
139
- J(null);
146
+ Y(null);
140
147
  }
141
- }, Pe = async () => {
142
- if (K) try {
143
- await we({ variables: {
144
- id: K.id,
148
+ }, Ie = async () => {
149
+ if (q) try {
150
+ await Te({ variables: {
151
+ id: q.id,
145
152
  workspaceId: m
146
153
  } }), T({
147
154
  title: "Draft invoice deleted",
148
155
  variant: "success"
149
- }), q(null), await Y();
156
+ }), J(null), await X();
150
157
  } catch {
151
158
  T({
152
159
  title: "Failed to delete invoice",
153
160
  variant: "error"
154
161
  });
155
162
  }
156
- }, Fe = async (e) => {
157
- B(e), H(null), U(!0);
163
+ }, Le = async (e) => {
164
+ V(e), U(null), W(!0);
158
165
  try {
159
166
  let { data: t } = await E.query({
160
- query: pe,
167
+ query: me,
161
168
  variables: {
162
169
  id: e.id,
163
170
  workspaceId: m
164
171
  },
165
172
  fetchPolicy: "no-cache"
166
173
  }), n = t?.timeCampusInvoiceHtml;
167
- H(n ?? null);
174
+ U(n ?? null);
168
175
  } catch {
169
176
  T({
170
177
  title: "Failed to load invoice preview",
171
178
  variant: "error"
172
179
  });
173
180
  } finally {
174
- U(!1);
181
+ W(!1);
175
182
  }
176
183
  }, Q = async (e) => {
177
- G(e.id);
184
+ K(e.id);
178
185
  try {
179
186
  let { data: t } = await E.query({
180
- query: me,
187
+ query: he,
181
188
  variables: {
182
189
  id: e.id,
183
190
  workspaceId: m
@@ -185,24 +192,24 @@ function w() {
185
192
  fetchPolicy: "no-cache"
186
193
  }), n = t?.timeCampusInvoicePdf;
187
194
  if (!n) throw Error("Empty PDF payload");
188
- he(n, `${e.invoiceNumber}.pdf`);
195
+ ge(n, `${e.invoiceNumber}.pdf`);
189
196
  } catch {
190
197
  T({
191
198
  title: "Failed to download PDF",
192
199
  variant: "error"
193
200
  });
194
201
  } finally {
195
- G(null);
202
+ K(null);
196
203
  }
197
- }, Ie = async () => {
198
- F(!0);
204
+ }, Re = async () => {
205
+ I(!0);
199
206
  try {
200
- ((await ye({
207
+ ((await be({
201
208
  variables: {
202
209
  workspaceId: m,
203
210
  pagination: {
204
211
  limit: y,
205
- offset: M.length
212
+ offset: N.length
206
213
  }
207
214
  },
208
215
  updateQuery: (e, { fetchMoreResult: t }) => t ? {
@@ -212,12 +219,12 @@ function w() {
212
219
  items: [...e.timeCampusInvoices.items, ...t.timeCampusInvoices.items]
213
220
  }
214
221
  } : e
215
- })).data?.timeCampusInvoices?.items?.length ?? 0) < y && De(!1);
222
+ })).data?.timeCampusInvoices?.items?.length ?? 0) < y && Oe(!1);
216
223
  } finally {
217
- F(!1);
224
+ I(!1);
218
225
  }
219
226
  };
220
- if (O && xe && M.length === 0) return /* @__PURE__ */ _(c, {
227
+ if (O && Se && N.length === 0) return /* @__PURE__ */ _(s, {
221
228
  title: "Invoicing",
222
229
  description: "Bill clients for billable time",
223
230
  children: /* @__PURE__ */ _(i, {
@@ -225,7 +232,7 @@ function w() {
225
232
  count: 4
226
233
  })
227
234
  });
228
- if (_e) return /* @__PURE__ */ _(c, {
235
+ if (ve) return /* @__PURE__ */ _(s, {
229
236
  title: "Invoicing",
230
237
  description: "Bill clients for billable time",
231
238
  children: /* @__PURE__ */ _("div", {
@@ -234,11 +241,11 @@ function w() {
234
241
  })
235
242
  });
236
243
  let $ = /* @__PURE__ */ v("button", {
237
- onClick: je,
244
+ onClick: Me,
238
245
  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",
239
- children: [/* @__PURE__ */ _(ue, { className: "h-4 w-4" }), "Generate Invoice"]
246
+ children: [/* @__PURE__ */ _(de, { className: "h-4 w-4" }), "Generate Invoice"]
240
247
  });
241
- return /* @__PURE__ */ v(c, {
248
+ return /* @__PURE__ */ v(s, {
242
249
  title: "Invoicing",
243
250
  description: "Bill clients for billable time",
244
251
  purpose: "Turn logged, billable hours into a real invoice — pick a client and a billing period, and TimeCampus aggregates every un-invoiced billable time entry by project and task, applying each entry's own rate, into a draft you can review, send, and mark paid.",
@@ -250,28 +257,28 @@ function w() {
250
257
  /* @__PURE__ */ _(r, {
251
258
  featured: !0,
252
259
  title: "Total Invoiced",
253
- value: t(N?.totalInvoiced ?? 0),
254
- icon: /* @__PURE__ */ _(ce, { className: "h-5 w-5" })
260
+ value: t(P?.totalInvoiced ?? 0),
261
+ icon: /* @__PURE__ */ _(le, { className: "h-5 w-5" })
255
262
  }),
256
263
  /* @__PURE__ */ _(r, {
257
264
  title: "Outstanding",
258
- value: t(N?.totalOutstanding ?? 0),
259
- description: `${N?.sentCount ?? 0} sent, awaiting payment`
265
+ value: t(P?.totalOutstanding ?? 0),
266
+ description: `${P?.sentCount ?? 0} sent, awaiting payment`
260
267
  }),
261
268
  /* @__PURE__ */ _(r, {
262
269
  title: "Paid",
263
- value: t(N?.totalPaid ?? 0),
264
- description: `${N?.paidCount ?? 0} invoices paid`
270
+ value: t(P?.totalPaid ?? 0),
271
+ description: `${P?.paidCount ?? 0} invoices paid`
265
272
  }),
266
273
  /* @__PURE__ */ _(r, {
267
274
  title: "Drafts",
268
- value: String(N?.draftCount ?? 0),
275
+ value: String(P?.draftCount ?? 0),
269
276
  icon: /* @__PURE__ */ _(p, { className: "h-5 w-5" }),
270
277
  description: "not yet sent"
271
278
  })
272
279
  ]
273
280
  }),
274
- M.length === 0 && !O ? /* @__PURE__ */ _(a, {
281
+ N.length === 0 && !O ? /* @__PURE__ */ _(a, {
275
282
  illustration: "empty-data",
276
283
  title: "No invoices yet",
277
284
  description: "Generate a draft invoice from real billable time entries to bill a client.",
@@ -280,8 +287,8 @@ function w() {
280
287
  className: "mt-4 rounded-xl border border-border-seam bg-gloss-card shadow-pop",
281
288
  children: /* @__PURE__ */ _("div", {
282
289
  className: "divide-y divide-border",
283
- children: M.map((e) => {
284
- let r = Ae === e.id, i = e.status === u.Draft, a = e.status === u.Sent;
290
+ children: N.map((e) => {
291
+ let r = je === e.id, i = e.status === u.Draft, a = e.status === u.Sent;
285
292
  return /* @__PURE__ */ v("div", {
286
293
  className: "flex flex-col gap-3 p-4 hover:bg-bg-sunken/50 transition-colors sm:flex-row sm:items-center sm:justify-between",
287
294
  children: [/* @__PURE__ */ v("div", {
@@ -310,28 +317,28 @@ function w() {
310
317
  className: "text-sm font-medium text-text-primary",
311
318
  children: t(e.total, e.currency)
312
319
  }),
313
- /* @__PURE__ */ _(re, {
320
+ /* @__PURE__ */ _(ae, {
314
321
  label: e.status.toLowerCase(),
315
322
  status: e.status.toLowerCase()
316
323
  }),
317
324
  e.isOverdue && /* @__PURE__ */ v("span", {
318
325
  title: "Past due date",
319
326
  className: "inline-flex items-center gap-1 text-xs font-medium text-status-error-text",
320
- children: [/* @__PURE__ */ _(oe, { className: "h-3.5 w-3.5" }), "Overdue"]
327
+ children: [/* @__PURE__ */ _(se, { className: "h-3.5 w-3.5" }), "Overdue"]
321
328
  }),
322
329
  /* @__PURE__ */ v("div", {
323
330
  className: "flex items-center gap-1",
324
331
  children: [
325
332
  /* @__PURE__ */ _("button", {
326
333
  type: "button",
327
- onClick: () => void Fe(e),
334
+ onClick: () => void Le(e),
328
335
  title: "View invoice",
329
336
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken",
330
- children: /* @__PURE__ */ _(le, { className: "h-4 w-4" })
337
+ children: /* @__PURE__ */ _(ue, { className: "h-4 w-4" })
331
338
  }),
332
339
  /* @__PURE__ */ _("button", {
333
340
  type: "button",
334
- disabled: W === e.id,
341
+ disabled: G === e.id,
335
342
  onClick: () => void Q(e),
336
343
  title: "Download PDF",
337
344
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken disabled:opacity-50",
@@ -340,25 +347,25 @@ function w() {
340
347
  i && /* @__PURE__ */ _("button", {
341
348
  type: "button",
342
349
  disabled: r,
343
- onClick: () => Z(e),
350
+ onClick: () => Pe(e),
344
351
  title: "Mark as sent",
345
352
  className: "rounded-md p-1.5 text-status-info-text hover:bg-status-info-bg disabled:opacity-50",
346
- children: /* @__PURE__ */ _(de, { className: "h-4 w-4" })
353
+ children: /* @__PURE__ */ _(fe, { className: "h-4 w-4" })
347
354
  }),
348
355
  a && /* @__PURE__ */ _("button", {
349
356
  type: "button",
350
357
  disabled: r,
351
- onClick: () => Ne(e),
358
+ onClick: () => Fe(e),
352
359
  title: "Mark as paid",
353
360
  className: "rounded-md p-1.5 text-status-success-text hover:bg-status-success-bg disabled:opacity-50",
354
- children: /* @__PURE__ */ _(se, { className: "h-4 w-4" })
361
+ children: /* @__PURE__ */ _(ce, { className: "h-4 w-4" })
355
362
  }),
356
363
  i && /* @__PURE__ */ _("button", {
357
364
  type: "button",
358
- onClick: () => q(e),
365
+ onClick: () => J(e),
359
366
  title: "Delete draft",
360
367
  className: "rounded-md p-1.5 text-status-error-text hover:bg-status-error-bg",
361
- children: /* @__PURE__ */ _(fe, { className: "h-4 w-4" })
368
+ children: /* @__PURE__ */ _(pe, { className: "h-4 w-4" })
362
369
  })
363
370
  ]
364
371
  })
@@ -367,29 +374,29 @@ function w() {
367
374
  }, e.id);
368
375
  })
369
376
  })
370
- }), Ee && M.length < Te && /* @__PURE__ */ _("div", {
377
+ }), De && N.length < Ee && /* @__PURE__ */ _("div", {
371
378
  className: "mt-4 flex justify-center",
372
379
  children: /* @__PURE__ */ _("button", {
373
- onClick: Ie,
374
- disabled: P,
380
+ onClick: Re,
381
+ disabled: F,
375
382
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
376
- children: P ? "Loading..." : "Load more"
383
+ children: F ? "Loading..." : "Load more"
377
384
  })
378
385
  })] }),
379
- /* @__PURE__ */ _(l, {
380
- open: Oe,
381
- onClose: X,
386
+ /* @__PURE__ */ _(c, {
387
+ open: ke,
388
+ onClose: Z,
382
389
  title: "Generate Invoice",
383
390
  description: "Aggregates every billable, un-invoiced time entry in the selected period into a draft invoice.",
384
391
  footer: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
385
- onClick: X,
392
+ onClick: Z,
386
393
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
387
394
  children: "Cancel"
388
395
  }), /* @__PURE__ */ _("button", {
389
- onClick: Me,
390
- disabled: k || !L.clientName.trim() || !L.periodStart || !L.periodEnd,
396
+ onClick: Ne,
397
+ disabled: A || !R.clientName.trim() || !R.periodStart || !R.periodEnd,
391
398
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
392
- children: k ? "Generating..." : "Generate Draft"
399
+ children: A ? "Generating..." : "Generate Draft"
393
400
  })] }),
394
401
  children: /* @__PURE__ */ v("div", {
395
402
  className: "space-y-4",
@@ -400,9 +407,9 @@ function w() {
400
407
  }), /* @__PURE__ */ _("input", {
401
408
  type: "text",
402
409
  placeholder: "Acme Corp",
403
- value: L.clientName,
404
- onChange: (e) => R({
405
- ...L,
410
+ value: R.clientName,
411
+ onChange: (e) => z({
412
+ ...R,
406
413
  clientName: e.target.value
407
414
  }),
408
415
  className: b
@@ -415,9 +422,9 @@ function w() {
415
422
  }), /* @__PURE__ */ _("input", {
416
423
  type: "email",
417
424
  placeholder: "billing@acme.com",
418
- value: L.clientEmail,
419
- onChange: (e) => R({
420
- ...L,
425
+ value: R.clientEmail,
426
+ onChange: (e) => z({
427
+ ...R,
421
428
  clientEmail: e.target.value
422
429
  }),
423
430
  className: b
@@ -427,9 +434,9 @@ function w() {
427
434
  }), /* @__PURE__ */ _("input", {
428
435
  type: "text",
429
436
  placeholder: "USD",
430
- value: L.currency,
431
- onChange: (e) => R({
432
- ...L,
437
+ value: R.currency,
438
+ onChange: (e) => z({
439
+ ...R,
433
440
  currency: e.target.value
434
441
  }),
435
442
  className: b
@@ -441,9 +448,9 @@ function w() {
441
448
  }), /* @__PURE__ */ _("input", {
442
449
  type: "text",
443
450
  placeholder: "Optional billing address",
444
- value: L.clientAddress,
445
- onChange: (e) => R({
446
- ...L,
451
+ value: R.clientAddress,
452
+ onChange: (e) => z({
453
+ ...R,
447
454
  clientAddress: e.target.value
448
455
  }),
449
456
  className: b
@@ -455,9 +462,9 @@ function w() {
455
462
  children: "Billing period start"
456
463
  }), /* @__PURE__ */ _("input", {
457
464
  type: "date",
458
- value: L.periodStart,
459
- onChange: (e) => R({
460
- ...L,
465
+ value: R.periodStart,
466
+ onChange: (e) => z({
467
+ ...R,
461
468
  periodStart: e.target.value
462
469
  }),
463
470
  className: b
@@ -466,9 +473,9 @@ function w() {
466
473
  children: "Billing period end"
467
474
  }), /* @__PURE__ */ _("input", {
468
475
  type: "date",
469
- value: L.periodEnd,
470
- onChange: (e) => R({
471
- ...L,
476
+ value: R.periodEnd,
477
+ onChange: (e) => z({
478
+ ...R,
472
479
  periodEnd: e.target.value
473
480
  }),
474
481
  className: b
@@ -484,9 +491,9 @@ function w() {
484
491
  min: 0,
485
492
  max: 100,
486
493
  step: "0.1",
487
- value: L.taxRatePercent,
488
- onChange: (e) => R({
489
- ...L,
494
+ value: R.taxRatePercent,
495
+ onChange: (e) => z({
496
+ ...R,
490
497
  taxRatePercent: e.target.value
491
498
  }),
492
499
  className: b
@@ -495,9 +502,9 @@ function w() {
495
502
  children: "Due date"
496
503
  }), /* @__PURE__ */ _("input", {
497
504
  type: "date",
498
- value: L.dueDate,
499
- onChange: (e) => R({
500
- ...L,
505
+ value: R.dueDate,
506
+ onChange: (e) => z({
507
+ ...R,
501
508
  dueDate: e.target.value
502
509
  }),
503
510
  className: b
@@ -509,9 +516,9 @@ function w() {
509
516
  }), /* @__PURE__ */ _("input", {
510
517
  type: "text",
511
518
  placeholder: "Optional, comma-separated. Leave blank for all projects.",
512
- value: L.projectIds,
513
- onChange: (e) => R({
514
- ...L,
519
+ value: R.projectIds,
520
+ onChange: (e) => z({
521
+ ...R,
515
522
  projectIds: e.target.value
516
523
  }),
517
524
  className: b
@@ -522,9 +529,9 @@ function w() {
522
529
  }), /* @__PURE__ */ _("textarea", {
523
530
  rows: 2,
524
531
  placeholder: "Optional notes printed on the invoice",
525
- value: L.notes,
526
- onChange: (e) => R({
527
- ...L,
532
+ value: R.notes,
533
+ onChange: (e) => z({
534
+ ...R,
528
535
  notes: e.target.value
529
536
  }),
530
537
  className: b
@@ -532,28 +539,28 @@ function w() {
532
539
  ]
533
540
  })
534
541
  }),
535
- /* @__PURE__ */ _(l, {
536
- open: z !== null,
537
- onClose: () => B(null),
538
- title: z ? `Invoice ${z.invoiceNumber}` : "Invoice",
539
- description: z?.clientName,
542
+ /* @__PURE__ */ _(c, {
543
+ open: B !== null,
544
+ onClose: () => V(null),
545
+ title: B ? `Invoice ${B.invoiceNumber}` : "Invoice",
546
+ description: B?.clientName,
540
547
  size: "xl",
541
- footer: z && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
542
- onClick: () => B(null),
548
+ footer: B && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
549
+ onClick: () => V(null),
543
550
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
544
551
  children: "Close"
545
552
  }), /* @__PURE__ */ v("button", {
546
- onClick: () => void Q(z),
547
- disabled: W === z.id,
553
+ onClick: () => void Q(B),
554
+ disabled: G === B.id,
548
555
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
549
- children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), W === z.id ? "Downloading..." : "Download PDF"]
556
+ children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), G === B.id ? "Downloading..." : "Download PDF"]
550
557
  })] }),
551
- children: ke ? /* @__PURE__ */ _(i, {
558
+ children: Ae ? /* @__PURE__ */ _(i, {
552
559
  variant: "detail",
553
560
  count: 1
554
- }) : V ? /* @__PURE__ */ _("iframe", {
561
+ }) : H ? /* @__PURE__ */ _("iframe", {
555
562
  title: "Invoice preview",
556
- srcDoc: V,
563
+ srcDoc: H,
557
564
  sandbox: "",
558
565
  className: "h-[60vh] w-full rounded-md border border-border-subtle bg-white"
559
566
  }) : /* @__PURE__ */ _("p", {
@@ -561,30 +568,30 @@ function w() {
561
568
  children: "Failed to load invoice preview."
562
569
  })
563
570
  }),
564
- /* @__PURE__ */ _(l, {
565
- open: K !== null,
566
- onClose: () => q(null),
571
+ /* @__PURE__ */ _(c, {
572
+ open: q !== null,
573
+ onClose: () => J(null),
567
574
  title: "Delete draft invoice?",
568
- description: K ? `${K.invoiceNumber} · ${t(K.total, K.currency)} will be removed and its time entries released back to the un-invoiced pool.` : void 0,
575
+ description: q ? `${q.invoiceNumber} · ${t(q.total, q.currency)} will be removed and its time entries released back to the un-invoiced pool.` : void 0,
569
576
  size: "sm",
570
577
  footer: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
571
- onClick: () => q(null),
578
+ onClick: () => J(null),
572
579
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
573
580
  children: "Cancel"
574
581
  }), /* @__PURE__ */ _("button", {
575
- onClick: Pe,
576
- disabled: j,
582
+ onClick: Ie,
583
+ disabled: M,
577
584
  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",
578
- children: j ? "Deleting..." : "Delete"
585
+ children: M ? "Deleting..." : "Delete"
579
586
  })] }),
580
587
  children: /* @__PURE__ */ _("p", {
581
588
  className: "text-sm text-text-secondary",
582
589
  children: "This permanently removes the draft. This action cannot be undone."
583
590
  })
584
591
  }),
585
- /* @__PURE__ */ _(ie, {
592
+ /* @__PURE__ */ _(oe, {
586
593
  toasts: w,
587
- onDismiss: ge
594
+ onDismiss: _e
588
595
  })
589
596
  ]
590
597
  });