@burdenoff/microfe-timecampus 2026.1206.1 → 2026.1206.3

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