@tesouro/embedded-components-react 0.5.292 → 0.5.294

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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +26 -1
  3. package/dist/lib/CounterpartsWidget.d.ts +2 -0
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +2 -0
  5. package/dist/lib/CustomersWidget.d.ts +2 -0
  6. package/dist/lib/ReceivablesWidget.d.ts +26 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +5 -88
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +70 -173
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +210 -17
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index17.js +29 -0
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +6 -7
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +142 -141
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +84 -54
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +21 -3
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +27 -27
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +2 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +13 -10
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +84 -80
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +32 -30
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +417 -414
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -66
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +133 -129
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +26 -22
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +16 -0
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +0 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +20 -22
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +1 -1
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +91 -85
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +1 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +119 -88
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +19 -16
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +130 -96
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +24 -8
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -0
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +101 -98
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +34 -20
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +4 -3
  47. package/dist/packages/shared-ui-shadcn/dist/index.js +15 -10
  48. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import { isLineItemTaxable as e } from "./lineItems.js";
2
2
  import { buildReceivableAttachmentDetailsView as t } from "./attachments.js";
3
3
  import { allocateDiscount as n, resolveDiscountAmount as r } from "./totals.js";
4
- import { buildReceivableNotesView as i, formatDate as a, formatMoney as o } from "./helpers.js";
5
- import { formatCountryName as s, formatDeduction as c } from "./preview.js";
6
- import { getPaymentAccountLineLabel as l } from "./bankAccounts.js";
4
+ import { buildReceivableNotesView as i, formatDate as a, formatMoney as o, getDaysOverdue as s } from "./helpers.js";
5
+ import { formatCountryName as c, formatDeduction as l } from "./preview.js";
6
+ import { getPaymentAccountLineLabel as u } from "./bankAccounts.js";
7
7
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js
8
- var u = {
8
+ var d = {
9
9
  draft: {
10
10
  primary: [
11
11
  "edit",
@@ -46,13 +46,13 @@ var u = {
46
46
  primary: [],
47
47
  overflow: []
48
48
  }
49
- }, d = /* @__PURE__ */ new Set([
49
+ }, f = /* @__PURE__ */ new Set([
50
50
  "issued",
51
51
  "overdue",
52
52
  "partially_paid",
53
53
  "paid",
54
54
  "uncollectible"
55
- ]), f = {
55
+ ]), p = {
56
56
  draft: "neutral",
57
57
  issuing: "info",
58
58
  issued: "info",
@@ -68,13 +68,6 @@ var u = {
68
68
  recurring: "neutral",
69
69
  deleted: "neutral"
70
70
  };
71
- function p(e, t = /* @__PURE__ */ new Date()) {
72
- if (!e) return 0;
73
- let n = new Date(e);
74
- if (Number.isNaN(n.getTime())) return 0;
75
- let r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), i = Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), a = Math.floor((r - i) / 864e5);
76
- return a > 0 ? a : 0;
77
- }
78
71
  function m(e, t) {
79
72
  let n = e.map((e) => `${e} ${e === 1 ? t.reminderUnitDay : t.reminderUnitDays}`);
80
73
  if (n.length <= 1) return n[0] ?? "";
@@ -98,7 +91,7 @@ function g(e, t) {
98
91
  year: t.detailsFrequencyYear
99
92
  }[e] ?? "";
100
93
  }
101
- function ee(e, t) {
94
+ function _(e, t) {
102
95
  return {
103
96
  day: t.detailsPeriodDay,
104
97
  week: t.detailsPeriodWeek,
@@ -107,7 +100,7 @@ function ee(e, t) {
107
100
  year: t.detailsPeriodYear
108
101
  }[e] ?? "";
109
102
  }
110
- function te(e, t) {
103
+ function v(e, t) {
111
104
  return {
112
105
  active: t.detailsSeriesStatusActive,
113
106
  paused: t.detailsSeriesStatusPaused,
@@ -115,17 +108,24 @@ function te(e, t) {
115
108
  completed: t.detailsSeriesStatusCompleted
116
109
  }[e] ?? "";
117
110
  }
118
- var ne = {
111
+ var y = {
119
112
  active: "info",
120
113
  paused: "warning",
121
114
  canceled: "danger",
122
115
  completed: "success"
123
- }, _ = {
116
+ };
117
+ function b(e, t) {
118
+ return {
119
+ label: v(e, t),
120
+ tone: y[e] ?? "neutral"
121
+ };
122
+ }
123
+ var x = {
124
124
  active: "forward",
125
125
  paused: "pause",
126
126
  canceled: "ban",
127
127
  completed: "check"
128
- }, v = {
128
+ }, S = {
129
129
  pending: "neutral",
130
130
  skipped: "warning",
131
131
  canceled: "danger",
@@ -133,7 +133,7 @@ var ne = {
133
133
  send_failed: "danger",
134
134
  completed: "success"
135
135
  };
136
- function y(e, t) {
136
+ function C(e, t) {
137
137
  return {
138
138
  pending: t.detailsIterationStatusPending,
139
139
  skipped: t.detailsIterationStatusSkipped,
@@ -143,13 +143,13 @@ function y(e, t) {
143
143
  completed: t.detailsIterationStatusCompleted
144
144
  }[e] ?? "";
145
145
  }
146
- function b(e, t, n) {
146
+ function w(e, t, n) {
147
147
  return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", g(t.frequency, n));
148
148
  }
149
- function x(e, t) {
149
+ function T(e, t) {
150
150
  return t[e] ?? t.unknown;
151
151
  }
152
- function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
152
+ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
153
153
  return (t.iterations ?? []).map((t, c) => {
154
154
  let l = t.issued_invoice_id, u = l ? n.get(l) : void 0, d = u ?? e;
155
155
  return {
@@ -162,12 +162,12 @@ function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
162
162
  }),
163
163
  chip: u ? {
164
164
  kind: "invoice",
165
- label: x(u.status, i),
165
+ label: T(u.status, i),
166
166
  status: u.status
167
167
  } : {
168
168
  kind: "iteration",
169
- label: y(t.status, a),
170
- tone: v[t.status] ?? "neutral"
169
+ label: C(t.status, a),
170
+ tone: S[t.status] ?? "neutral"
171
171
  },
172
172
  numberLabel: l ? u?.document_id ?? "" : a.detailsPending,
173
173
  onOpen: u ? () => s(u.id) : void 0,
@@ -175,16 +175,16 @@ function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
175
175
  };
176
176
  });
177
177
  }
178
- function re(e) {
178
+ function ee(e) {
179
179
  if (!e?.line1) return;
180
180
  let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
181
181
  return [
182
182
  e.line2 ? `${e.line1} ${e.line2}` : e.line1,
183
183
  t,
184
- e.country ? s(e.country) : void 0
184
+ e.country ? c(e.country) : void 0
185
185
  ].filter(Boolean).join(", ");
186
186
  }
187
- function C(e, t, n) {
187
+ function te(e, t, n) {
188
188
  let r = {
189
189
  label: n.detailsAmountReceived,
190
190
  value: t(e.amount_paid)
@@ -246,7 +246,7 @@ function C(e, t, n) {
246
246
  };
247
247
  }
248
248
  }
249
- function ie(t, i, a) {
249
+ function ne(t, i, a) {
250
250
  let o = t.line_items.reduce((t, n) => {
251
251
  let r = n.total_before_tax ?? 0;
252
252
  return e(n.tax_status) ? {
@@ -262,7 +262,7 @@ function ie(t, i, a) {
262
262
  }), s = r({
263
263
  discount: t.discount,
264
264
  subtotal: o.taxableItemsSubtotal + o.nonTaxableItemsSubtotal
265
- }), { taxableSubtotal: l, nonTaxableSubtotal: u } = n({
265
+ }), { taxableSubtotal: c, nonTaxableSubtotal: u } = n({
266
266
  ...o,
267
267
  discountAmount: s
268
268
  }), d = s > 0, f = o.taxableItemsSubtotal > 0, p = o.nonTaxableItemsSubtotal > 0, m = [{
@@ -271,14 +271,14 @@ function ie(t, i, a) {
271
271
  }];
272
272
  d && m.push({
273
273
  label: a.previewDiscount,
274
- value: c(s, t.currency)
274
+ value: l(s, t.currency)
275
275
  }), p && (f || d) && m.push({
276
276
  label: a.previewNonTaxableSubtotal,
277
277
  value: i(u),
278
278
  tone: "muted"
279
279
  }), f && (p || d) && m.push({
280
280
  label: a.previewTaxableSubtotal,
281
- value: i(l),
281
+ value: i(c),
282
282
  tone: "muted"
283
283
  });
284
284
  for (let e of t.total_tax_amounts ?? []) m.push({
@@ -291,174 +291,175 @@ function ie(t, i, a) {
291
291
  emphasis: !0
292
292
  }), m;
293
293
  }
294
- var ae = {
294
+ var re = {
295
295
  primary: [],
296
296
  overflow: []
297
297
  };
298
- function w({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: s, depositAccount: c, isAccountListIncomplete: m, recurrence: v, paymentRecords: y = [], isLoadingPaymentRecords: x = !1, iterationInvoices: w = /* @__PURE__ */ new Map(), auditHistory: T, statusLabels: E, messages: D, canRecordPayment: O, canWrite: k = !0, onOpenReceivable: A, onOpenCustomer: j, now: oe }) {
298
+ function D({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: c, depositAccount: l, isAccountListIncomplete: m, recurrence: b, paymentRecords: S = [], isLoadingPaymentRecords: C = !1, iterationInvoices: T = /* @__PURE__ */ new Map(), auditHistory: D, statusLabels: O, messages: k, canRecordPayment: A, hasBeenSent: ie = !1, canWrite: j = !0, onOpenReceivable: M, onOpenCustomer: N, now: ae }) {
299
299
  if (!e || e.type !== "invoice") return;
300
- let M = e, N = (e) => o({
300
+ let P = e, F = (e) => o({
301
301
  amount: e ?? 0,
302
- currency: M.currency,
302
+ currency: P.currency,
303
303
  fallback: ""
304
- }), P = (e) => a(e, "-"), F = (e) => e ? P(e) : D.detailsPending, { status: I } = M, L = I === "canceled", R = I === "recurring" ? v : void 0, z = M.recurrence_id && I !== "recurring" ? v : void 0, B = I === "overdue" ? p(M.due_date, oe) : 0, { amountTone: V, amountRows: H } = C(M, N, D), U = M.counterpart_contact, W = re(M.counterpart_billing_address), G = M.counterpart_id, K = M.counterpart_name ? {
305
- label: D.detailsCustomerName,
306
- name: M.counterpart_name,
307
- onOpen: j && G ? () => j(G) : void 0
308
- } : void 0, se = [
309
- ...U?.email ? [{
310
- label: D.detailsCustomerEmail,
311
- value: U.email
304
+ }), I = (e) => a(e, "-"), L = (e) => e ? I(e) : k.detailsPending, { status: R } = P, z = R === "canceled", B = R === "recurring" ? b : void 0, V = P.recurrence_id && R !== "recurring" ? b : void 0, H = R === "overdue" ? s(P.due_date, ae) : 0, { amountTone: oe, amountRows: U } = te(P, F, k), W = P.counterpart_contact, G = ee(P.counterpart_billing_address), K = P.counterpart_id, se = P.counterpart_name ? {
305
+ label: k.detailsCustomerName,
306
+ name: P.counterpart_name,
307
+ onOpen: N && K ? () => N(K) : void 0
308
+ } : void 0, ce = [
309
+ ...W?.email ? [{
310
+ label: k.detailsCustomerEmail,
311
+ value: W.email
312
312
  }] : [],
313
- ...U?.phone ? [{
314
- label: D.detailsCustomerPhone,
315
- value: U.phone
313
+ ...W?.phone ? [{
314
+ label: k.detailsCustomerPhone,
315
+ value: W.phone
316
316
  }] : [],
317
- ...W ? [{
318
- label: D.detailsCustomerAddress,
319
- value: W
317
+ ...G ? [{
318
+ label: k.detailsCustomerAddress,
319
+ value: G
320
320
  }] : []
321
321
  ], q = {
322
- label: D.detailsPaymentReminders,
322
+ label: k.detailsPaymentReminders,
323
323
  value: h({
324
324
  paymentReminder: r,
325
- overdueReminder: s,
326
- remindersConfigured: !!(M.payment_reminder_id || M.overdue_reminder_id),
327
- messages: D
325
+ overdueReminder: c,
326
+ remindersConfigured: !!(P.payment_reminder_id || P.overdue_reminder_id),
327
+ messages: k
328
328
  })
329
329
  }, J = {
330
- label: D.detailsDepositAccount,
331
- value: c ? l(c, D) : m && M.bank_account_id ? "-" : D.detailsNotProvided
330
+ label: k.detailsDepositAccount,
331
+ value: l ? u(l, k) : m && P.bank_account_id ? "-" : k.detailsNotProvided
332
332
  }, Y = {
333
- label: D.detailsPaymentTerms,
334
- value: M.payment_terms?.name ?? D.detailsPending
335
- }, ce = R ? [
333
+ label: k.detailsPaymentTerms,
334
+ value: P.payment_terms?.name ?? k.detailsPending
335
+ }, le = B ? [
336
336
  {
337
- label: D.detailsFrequency,
338
- value: g(R.frequency, D)
337
+ label: k.detailsFrequency,
338
+ value: g(B.frequency, k)
339
339
  },
340
340
  {
341
- label: D.detailsInvoiceAmount,
342
- value: N(M.total_amount)
341
+ label: k.detailsInvoiceAmount,
342
+ value: F(P.total_amount)
343
343
  },
344
344
  Y,
345
345
  q,
346
346
  {
347
- label: D.detailsPoNumber,
348
- value: M.purchase_order || D.detailsNotProvided
347
+ label: k.detailsPoNumber,
348
+ value: P.purchase_order || k.detailsNotProvided
349
349
  },
350
350
  J
351
351
  ] : [
352
- ...M.document_id ? [{
353
- label: D.detailsInvoiceNumber,
354
- value: M.document_id
352
+ ...P.document_id ? [{
353
+ label: k.detailsInvoiceNumber,
354
+ value: P.document_id
355
355
  }] : [],
356
356
  {
357
- label: D.detailsInvoiceAmount,
358
- value: N(M.total_amount)
357
+ label: k.detailsInvoiceAmount,
358
+ value: F(P.total_amount)
359
359
  },
360
360
  {
361
- label: D.detailsInvoiceDate,
362
- value: F(M.issue_date)
361
+ label: k.detailsInvoiceDate,
362
+ value: L(P.issue_date)
363
363
  },
364
364
  {
365
- label: D.detailsDueDate,
366
- value: F(M.due_date)
365
+ label: k.detailsDueDate,
366
+ value: L(P.due_date)
367
367
  },
368
368
  Y,
369
369
  q,
370
- ...M.purchase_order ? [{
371
- label: D.detailsPoNumber,
372
- value: M.purchase_order
370
+ ...P.purchase_order ? [{
371
+ label: k.detailsPoNumber,
372
+ value: P.purchase_order
373
373
  }] : [],
374
374
  J
375
- ], X = R ? void 0 : i(M), { primary: Z, overflow: Q } = k ? u[I] ?? {
375
+ ], X = B ? void 0 : i(P), { primary: Z, overflow: Q } = j ? d[R] ?? {
376
376
  primary: [],
377
377
  overflow: ["clone"]
378
- } : ae;
379
- if (R && k) {
380
- let e = R.status === "active" || R.status === "paused";
381
- Q = R.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : R.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
378
+ } : re;
379
+ if (B && j) {
380
+ let e = B.status === "active" || B.status === "paused";
381
+ Q = B.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : B.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
382
382
  }
383
- O || (Z = Z.filter((e) => e !== "recordPayment"));
384
- let le = d.has(I) ? {
385
- rows: y.map((e) => ({
383
+ A || (Z = Z.filter((e) => e !== "recordPayment"));
384
+ let ue = f.has(R) ? {
385
+ rows: S.map((e) => ({
386
386
  id: e.id,
387
- dateLabel: P(e.paid_at),
388
- amountLabel: N(e.amount)
387
+ dateLabel: I(e.paid_at),
388
+ amountLabel: F(e.amount)
389
389
  })),
390
- totalLabel: N(M.amount_paid),
391
- emptyTone: I === "overdue" ? "danger" : "default",
392
- isLoading: x
393
- } : void 0, ue = R ? {
394
- statusLabel: te(R.status, D),
395
- statusTone: ne[R.status] ?? "neutral",
396
- statusIcon: _[R.status],
397
- amountLabel: N(M.total_amount),
398
- amountPeriodLabel: ee(R.frequency, D),
399
- startsOnLabel: F(R.start_date),
400
- endsOnLabel: P(R.end_date),
401
- scheduleTitle: D.detailsScheduleTitle.replace("{frequency}", g(R.frequency, D)),
402
- schedule: S({
403
- invoice: M,
404
- recurrence: R,
405
- iterationInvoices: w,
406
- date: P,
407
- statusLabels: E,
408
- messages: D,
409
- onOpenReceivable: A
390
+ totalLabel: F(P.amount_paid),
391
+ emptyTone: R === "overdue" ? "danger" : "default",
392
+ isLoading: C
393
+ } : void 0, de = B ? {
394
+ statusLabel: v(B.status, k),
395
+ statusTone: y[B.status] ?? "neutral",
396
+ statusIcon: x[B.status],
397
+ amountLabel: F(P.total_amount),
398
+ amountPeriodLabel: _(B.frequency, k),
399
+ startsOnLabel: L(B.start_date),
400
+ endsOnLabel: I(B.end_date ?? (B.max_occurrences ? B.iterations?.at(-1)?.issue_at : void 0)),
401
+ scheduleTitle: k.detailsScheduleTitle.replace("{frequency}", g(B.frequency, k)),
402
+ schedule: E({
403
+ invoice: P,
404
+ recurrence: B,
405
+ iterationInvoices: T,
406
+ date: I,
407
+ statusLabels: O,
408
+ messages: k,
409
+ onOpenReceivable: M
410
410
  })
411
- } : void 0, $ = z ? b(M, z, D) : void 0, de = z && $ ? {
411
+ } : void 0, $ = V ? w(P, V, k) : void 0, fe = V && $ ? {
412
412
  title: $,
413
- backLabel: D.detailsSeriesBack.replace("{title}", $),
414
- onOpen: () => A(z.invoice_id)
413
+ backLabel: k.detailsSeriesBack.replace("{title}", $),
414
+ onOpen: () => M(V.invoice_id)
415
415
  } : void 0;
416
416
  return {
417
- id: M.id,
418
- type: M.type,
419
- title: R ? b(M, R, D) : M.counterpart_name ?? D.invoiceType,
420
- status: I,
421
- statusTone: f[I] ?? "neutral",
417
+ id: P.id,
418
+ type: P.type,
419
+ title: B ? w(P, B, k) : P.counterpart_name ?? k.invoiceType,
420
+ status: R,
421
+ statusTone: p[R] ?? "neutral",
422
422
  pdfUrl: n,
423
- lineItems: M.line_items.map((e, t) => ({
423
+ lineItems: P.line_items.map((e, t) => ({
424
424
  id: `${e.product.id ?? "item"}-${t}`,
425
425
  name: e.product.name,
426
426
  quantityLabel: String(e.quantity),
427
- unitPriceLabel: N(e.product.price?.value),
428
- totalLabel: N(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
427
+ unitPriceLabel: F(e.product.price?.value),
428
+ totalLabel: F(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
429
429
  })),
430
430
  panel: {
431
- subtitle: R ? D.detailsSeriesSubtitle : M.document_id ? D.detailsInvoiceSubtitle.replace("{number}", M.document_id) : void 0,
432
- statusLabel: I === "partially_paid" ? E.issued : E[I] ?? E.unknown,
433
- recurring: !!M.recurrence_id || I === "recurring",
434
- overdueLabel: B > 0 ? D.detailsDaysOverdue.replace("{days}", String(B)) : void 0,
435
- amountTone: V,
436
- amountRows: H,
437
- issueDateLabel: F(M.issue_date),
438
- dueDateLabel: L ? P(M.updated_at) : F(M.due_date),
439
- dueDateCaption: L ? D.detailsCancelledOnCaption : D.detailsDueDate,
440
- paymentHistory: le,
441
- customerName: K,
442
- customerContact: se,
443
- recurringSeries: ue,
444
- seriesLink: de,
445
- billingItems: ce,
446
- lineItemsSection: R ? void 0 : {
447
- countLabel: String(M.line_items.length),
448
- totals: ie(M, N, D)
431
+ subtitle: B ? k.detailsSeriesSubtitle : P.document_id ? k.detailsInvoiceSubtitle.replace("{number}", P.document_id) : void 0,
432
+ statusLabel: R === "partially_paid" ? O.issued : O[R] ?? O.unknown,
433
+ recurring: !!P.recurrence_id || R === "recurring",
434
+ overdueLabel: H > 0 ? k.detailsDaysOverdue.replace("{days}", String(H)) : void 0,
435
+ amountTone: oe,
436
+ amountRows: U,
437
+ issueDateLabel: L(P.issue_date),
438
+ dueDateLabel: z ? I(P.updated_at) : L(P.due_date),
439
+ dueDateCaption: z ? k.detailsCancelledOnCaption : k.detailsDueDate,
440
+ paymentHistory: ue,
441
+ customerName: se,
442
+ customerContact: ce,
443
+ recurringSeries: de,
444
+ seriesLink: fe,
445
+ billingItems: le,
446
+ lineItemsSection: B ? void 0 : {
447
+ countLabel: String(P.line_items.length),
448
+ totals: ne(P, F, k)
449
449
  },
450
450
  notes: X && {
451
451
  ...X,
452
452
  countLabel: String([X.opening, X.closing].filter(Boolean).length)
453
453
  },
454
- attachments: t(M, D),
455
- auditHistory: T,
454
+ attachments: t(P, k),
455
+ auditHistory: D,
456
456
  primaryActions: Z,
457
- overflowActions: Q
457
+ overflowActions: Q,
458
+ actionLabels: { send: ie ? k.detailsResendButton : k.detailsSendButton }
458
459
  }
459
460
  };
460
461
  }
461
- function T(e, t, n) {
462
+ function O(e, t, n) {
462
463
  if (!e) return {
463
464
  title: n.detailsNotFoundTitle,
464
465
  description: n.detailsNotFoundDescription.replace("{invoiceId}", t)
@@ -469,4 +470,4 @@ function T(e, t, n) {
469
470
  };
470
471
  }
471
472
  //#endregion
472
- export { T as buildDetailsMessageView, w as buildReceivableDetailsView, h as formatReminderSchedule, p as getDaysOverdue };
473
+ export { O as buildDetailsMessageView, D as buildReceivableDetailsView, b as buildSeriesStatusChipView, h as formatReminderSchedule };