@mindbill/react 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -72,6 +72,23 @@ var mindBillThemePresets = {
72
72
  successColor: "#389e0d",
73
73
  warningColor: "#d48806",
74
74
  fontFamily: "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
75
+ },
76
+ "midnight-cyan": {
77
+ accentColor: "#05092e",
78
+ accentTextColor: "#ffffff",
79
+ backgroundColor: "#edf6ff",
80
+ surfaceColor: "#ffffff",
81
+ inputBackgroundColor: "#ffffff",
82
+ textColor: "#05092e",
83
+ mutedColor: "#596078",
84
+ borderColor: "#d9dae1",
85
+ borderRadius: "0px",
86
+ controlRadius: "999px",
87
+ shadow: "0 1px 2px rgba(5,9,46,.04)",
88
+ dangerColor: "#b42318",
89
+ successColor: "#167a58",
90
+ warningColor: "#9a6418",
91
+ fontFamily: "Geist, Inter, ui-sans-serif, system-ui, sans-serif"
75
92
  }
76
93
  };
77
94
  function resolveMindBillAppearance(appearance) {
@@ -1770,9 +1787,9 @@ var css = `
1770
1787
  .mbsf-payer-status{display:flex;align-items:center;gap:7px;color:#087f5b;font-size:13px;font-weight:650}.mbsf-payer-intro{margin:4px 0 0;color:var(--mb-muted)}.mbsf-payer-list{display:grid;gap:8px}.mbsf-payer-option{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface))}.mbsf-payer-option-main{display:grid;gap:5px;min-width:0}.mbsf-payer-option-main strong{overflow-wrap:anywhere}.mbsf-payer-signals{display:flex;flex-wrap:wrap;gap:6px}.mbsf-payer-signal{padding:2px 7px;border:1px solid var(--mb-border);border-radius:999px;color:var(--mb-muted);font-size:12px}.mbsf-payer-signal[data-state=match]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));color:#087f5b}.mbsf-payer-signal[data-state=warning]{border-color:color-mix(in srgb,#c56a00 55%,var(--mb-border));color:#9a5200}
1771
1788
  .mbsf-chips,.mbsf-quick-picks{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:8px}.mbsf-chip,.mbsf-quick-pick{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-input)}.mbsf-chip button{border:0;background:transparent;color:var(--mb-muted);cursor:pointer;font:inherit}.mbsf-quick-pick{color:var(--mb-text);font:inherit;cursor:pointer}.mbsf-quick-pick[data-selected=true]{border-color:var(--mb-accent);color:var(--mb-accent)}
1772
1789
  .mbsf-segments{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:hidden}.mbsf-segment{min-height:44px;border:0;border-right:1px solid var(--mb-border);background:var(--mb-input);color:var(--mb-text);font:inherit;font-weight:700;cursor:pointer}.mbsf-segment:last-child{border-right:0}.mbsf-segment[aria-pressed=true]{background:var(--mb-accent);color:var(--mb-accent-contrast)}
1773
- .mbsf-lines{margin-top:18px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:visible}.mbsf-lines[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-line-head,.mbsf-line{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(220px,1.5fr) 100px 120px 42px;gap:12px;align-items:start;padding:12px}.mbsf-line-head{color:var(--mb-muted);font-size:13px;font-weight:700;border-bottom:1px solid var(--mb-border)}.mbsf-line{border-bottom:1px solid var(--mb-border)}.mbsf-line:last-child{border-bottom:0}.mbsf-line [data-invalid=true] .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-money{padding-top:12px;text-align:right;font-variant-numeric:tabular-nums}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
1790
+ .mbsf-lines{margin-top:18px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:visible}.mbsf-lines[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-line-head,.mbsf-line{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(190px,1.3fr) minmax(112px,.7fr) 100px 120px 42px;gap:12px;align-items:start;padding:12px}.mbsf-line-head{color:var(--mb-muted);font-size:13px;font-weight:700;border-bottom:1px solid var(--mb-border)}.mbsf-line{border-bottom:1px solid var(--mb-border)}.mbsf-line:last-child{border-bottom:0}.mbsf-line [data-invalid=true] .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-money{padding-top:12px;text-align:right;font-variant-numeric:tabular-nums}.mbsf-dx{display:flex;flex-wrap:wrap;gap:5px;padding-top:6px}.mbsf-dx-chip{width:30px;height:30px;border:1px solid var(--mb-border);border-radius:8px;background:var(--mb-surface);color:var(--mb-muted);font:inherit;font-size:13px;font-weight:750;cursor:pointer}.mbsf-dx-chip[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-accent)}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
1774
1791
  .mbsf-icon-btn{width:40px;height:42px;border:0;background:transparent;color:var(--mb-text);font-size:22px;cursor:pointer}.mbsf-secondary{min-height:40px;padding:8px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:680;cursor:pointer}.mbsf-attach-list{display:grid;gap:10px;margin-bottom:18px}.mbsf-attach-row{padding:14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius)}.mbsf-attach-row[data-auto=true]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));background:color-mix(in srgb,#159447 5%,var(--mb-surface))}.mbsf-attach-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.mbsf-attach-type{width:min(360px,32vw);flex:0 1 360px}.mbsf-attach-type .mbsf-label{display:block;margin-bottom:6px;font-size:12px}.mbsf-attach-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.mbsf-file{min-width:0}.mbsf-file strong{overflow-wrap:anywhere}.mbsf-badge{display:inline-block;margin-left:8px;padding:2px 7px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-muted);font-size:12px;font-weight:600}.mbsf-drop{display:grid;width:100%;place-items:center;min-height:210px;padding:30px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));color:var(--mb-text);font:inherit;text-align:center;cursor:pointer}.mbsf-drop[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}.mbsf-alert{padding:12px 14px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger)}.mbsf-actions{justify-content:flex-end}.mbsf-submit{min-width:180px;min-height:48px;padding:11px 24px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:780;cursor:pointer}
1775
- @media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-payer-option{align-items:flex-start}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start;flex-basis:calc(100% - 150px)}.mbsf-attach-type{width:100%;flex-basis:100%;order:3}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
1792
+ @media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2),.mbsf-line>div:nth-child(3){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-payer-option{align-items:flex-start}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start;flex-basis:calc(100% - 150px)}.mbsf-attach-type{width:100%;flex-basis:100%;order:3}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
1776
1793
  `;
1777
1794
  function RequiredMark() {
1778
1795
  return /* @__PURE__ */ jsx3("span", { className: "mbsf-star", children: " *" });
@@ -2219,6 +2236,10 @@ function BillSubmissionForm({
2219
2236
  /* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Injury & claim" }),
2220
2237
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
2221
2238
  /* @__PURE__ */ jsx3(Field2, { path: "service.date", label: "Date of service", required: true, error: errors["service.date"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of service", value: bill.service.date, disabled: locked, required: true, onChange: (date2) => setBill((c) => ({ ...c, service: { ...c.service, date: date2 } })) }) }),
2239
+ /* @__PURE__ */ jsxs3(Field2, { label: "Treatment authorization # (optional)", children: [
2240
+ text(bill.service.authorizationNumber, (authorizationNumber) => setBill((c) => ({ ...c, service: { ...c.service, authorizationNumber } })), { placeholder: "Utilization-review authorization number" }),
2241
+ /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Rides on the bill as CMS-1500 Box 23 / 837 REF*G1." })
2242
+ ] }),
2222
2243
  /* @__PURE__ */ jsx3(Field2, { path: "claim.dateOfInjury", label: "Date of injury", required: true, error: errors["claim.dateOfInjury"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, required: true, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
2223
2244
  /* @__PURE__ */ jsx3(Field2, { path: "claim.employer", label: "Employer name", required: true, error: errors["claim.employer"], children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
2224
2245
  /* @__PURE__ */ jsx3(Field2, { path: "claim.claimNumber", label: "Claim number", required: true, error: errors["claim.claimNumber"], children: text(bill.claim.claimNumber, (claimNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, claimNumber } }))) }),
@@ -2323,6 +2344,7 @@ function BillSubmissionForm({
2323
2344
  /* @__PURE__ */ jsx3(RequiredMark, {})
2324
2345
  ] }),
2325
2346
  /* @__PURE__ */ jsx3("span", { children: "Modifiers" }),
2347
+ /* @__PURE__ */ jsx3("span", { children: "Dx" }),
2326
2348
  /* @__PURE__ */ jsxs3("span", { children: [
2327
2349
  "Units",
2328
2350
  /* @__PURE__ */ jsx3(RequiredMark, {})
@@ -2348,6 +2370,11 @@ function BillSubmissionForm({
2348
2370
  ] }, modifier)) }),
2349
2371
  /* @__PURE__ */ jsx3(ComboBox, { ariaLabel: `Modifiers ${index + 1}`, disabled: locked, value: "", placeholder: line.modifiers?.length ?? 0 ? `${line.modifiers.length} modifier${line.modifiers.length === 1 ? "" : "s"}` : "Add modifiers\u2026", options: modifiers.filter((item) => !(line.modifiers ?? []).includes(item.code)).map((item) => ({ id: item.code, label: `\u2212${item.code}`, detail: item.description })), onSelect: (option) => setLine(index, { modifiers: [.../* @__PURE__ */ new Set([...line.modifiers ?? [], option.id])] }) })
2350
2372
  ] }),
2373
+ /* @__PURE__ */ jsx3("div", { "data-label": "Dx", children: /* @__PURE__ */ jsx3("div", { className: "mbsf-dx", children: (bill.diagnoses ?? []).length ? (bill.diagnoses ?? []).map((code, dxIndex) => {
2374
+ const pointer = dxIndex + 1;
2375
+ const active = (line.diagnosisPointers ?? []).includes(pointer);
2376
+ return /* @__PURE__ */ jsx3("button", { type: "button", className: "mbsf-dx-chip", "data-active": active, title: `${String.fromCharCode(64 + pointer)} \u2014 ${code}`, "aria-pressed": active, "aria-label": `Point line ${index + 1} at diagnosis ${code}`, onClick: () => setLine(index, { diagnosisPointers: active ? (line.diagnosisPointers ?? []).filter((item) => item !== pointer) : [...line.diagnosisPointers ?? [], pointer].sort((left, right) => left - right) }), children: String.fromCharCode(64 + pointer) }, code);
2377
+ }) : /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Add diagnoses above" }) }) }),
2351
2378
  /* @__PURE__ */ jsxs3("div", { "data-label": "Units", "data-field-path": `serviceLines.${index}.units`, "data-invalid": Boolean(errors[`serviceLines.${index}.units`]), children: [
2352
2379
  /* @__PURE__ */ jsx3("input", { className: "mbsf-input", "aria-label": `Units ${index + 1}`, "aria-invalid": Boolean(errors[`serviceLines.${index}.units`]), type: "number", min: 1, value: line.units ?? 1, onChange: (event) => setLine(index, { units: Number(event.target.value) }) }),
2353
2380
  errors[`serviceLines.${index}.units`] ? /* @__PURE__ */ jsx3("small", { className: "mbsf-error", role: "alert", children: errors[`serviceLines.${index}.units`] }) : null
@@ -2710,11 +2737,150 @@ function BillingReport({ bills, groupBy = "status", heading = "Billing report",
2710
2737
  ] }) });
2711
2738
  }
2712
2739
 
2740
+ // src/status-aging-matrix.tsx
2741
+ import { useMemo as useMemo4 } from "react";
2742
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2743
+ var BILL_STATUS_AGING_BUCKETS = [
2744
+ { id: "current", label: "0\u201330 days" },
2745
+ { id: "31-60", label: "31\u201360 days" },
2746
+ { id: "61-90", label: "61\u201390 days" },
2747
+ { id: "91+", label: "91+ days" }
2748
+ ];
2749
+ var DEFAULT_STATE_ORDER = [
2750
+ "draft",
2751
+ "incomplete",
2752
+ "created",
2753
+ "sent",
2754
+ "submitted",
2755
+ "accepted",
2756
+ "processed",
2757
+ "paid",
2758
+ "underpaid",
2759
+ "denied",
2760
+ "rejected",
2761
+ "appealing",
2762
+ "second_review",
2763
+ "ibr",
2764
+ "lien",
2765
+ "closed"
2766
+ ];
2767
+ var money4 = (value) => Number(value || 0).toLocaleString(void 0, { style: "currency", currency: "USD" });
2768
+ var stateLabel2 = (state) => state.replaceAll("_", " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
2769
+ var emptyCell = (state, bucket) => ({ state, bucket, count: 0, balance: 0, bills: [] });
2770
+ function buildBillStatusAgingMatrix(bills, stateOrder = DEFAULT_STATE_ORDER, now = /* @__PURE__ */ new Date()) {
2771
+ const orderIndex = new Map(stateOrder.map((state, index) => [state.toLowerCase(), index]));
2772
+ const states = [...new Set(bills.map((bill) => bill.state))].sort((a, b) => {
2773
+ const left = orderIndex.get(a.toLowerCase()) ?? stateOrder.length;
2774
+ const right = orderIndex.get(b.toLowerCase()) ?? stateOrder.length;
2775
+ return left - right || a.localeCompare(b);
2776
+ });
2777
+ const columnTotals = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell("all", bucket.id));
2778
+ const grandTotal = emptyCell("all", "total");
2779
+ const rows = states.map((state) => {
2780
+ const cells = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell(state, bucket.id));
2781
+ const total = emptyCell(state, "total");
2782
+ return { state, label: stateLabel2(state), cells, total };
2783
+ });
2784
+ const rowByState = new Map(rows.map((row) => [row.state, row]));
2785
+ for (const bill of bills) {
2786
+ const row = rowByState.get(bill.state);
2787
+ const bucketIndex = BILL_STATUS_AGING_BUCKETS.findIndex((bucket) => bucket.id === billAgingBucket(bill, now));
2788
+ const balance = Number(bill.balanceDue || 0);
2789
+ for (const cell of [row.cells[bucketIndex], row.total, columnTotals[bucketIndex], grandTotal]) {
2790
+ cell.count += 1;
2791
+ cell.balance += balance;
2792
+ cell.bills.push(bill);
2793
+ }
2794
+ }
2795
+ return { rows, columnTotals, grandTotal };
2796
+ }
2797
+ function buildBillStatusAgingCsv(bills, stateOrder) {
2798
+ const matrix = buildBillStatusAgingMatrix(bills, stateOrder);
2799
+ const escape = (value) => `"${String(value).replaceAll('"', '""')}"`;
2800
+ const header = ["Status", ...BILL_STATUS_AGING_BUCKETS.map((bucket) => bucket.label), "Total"];
2801
+ const lines = matrix.rows.map((row) => [row.label, ...row.cells.map((cell) => cell.count), row.total.count]);
2802
+ lines.push(["Total", ...matrix.columnTotals.map((cell) => cell.count), matrix.grandTotal.count]);
2803
+ return [header, ...lines].map((line) => line.map(escape).join(",")).join("\n");
2804
+ }
2805
+ var css3 = `
2806
+ .mbmx{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbmx *{box-sizing:border-box}.mbmx h2,.mbmx p{margin:0}
2807
+ .mbmx-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:16px}.mbmx-head h2{font-size:24px}.mbmx-copy{color:var(--mb-muted);margin-top:5px!important}
2808
+ .mbmx-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:auto}
2809
+ .mbmx-table{width:100%;border-collapse:collapse;min-width:640px}
2810
+ .mbmx-table th{padding:13px 16px;border-bottom:1px solid var(--mb-border);color:var(--mb-muted);font-size:12px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;text-align:right}
2811
+ .mbmx-table th:first-child{text-align:left}
2812
+ .mbmx-table td{padding:0;border-bottom:1px solid var(--mb-border);border-left:1px solid color-mix(in srgb,var(--mb-border) 55%,transparent);text-align:right;vertical-align:middle}
2813
+ .mbmx-table td:first-child{border-left:0;padding:14px 16px;text-align:left;white-space:nowrap}
2814
+ .mbmx-table tr:last-child td{border-bottom:0}
2815
+ .mbmx-state{display:inline-flex;padding:4px 9px;border-radius:999px;background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-text);font-size:12px;font-weight:720}
2816
+ .mbmx-cell{display:block;width:100%;min-height:56px;padding:9px 16px;border:0;background:none;color:var(--mb-text);font:inherit;text-align:right}
2817
+ .mbmx-cell[data-clickable=true]{cursor:pointer}.mbmx-cell[data-clickable=true]:hover{background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
2818
+ .mbmx-count{display:block;font-size:17px;font-weight:760;font-variant-numeric:tabular-nums}
2819
+ .mbmx-balance{display:block;margin-top:2px;color:var(--mb-muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
2820
+ .mbmx-zero{color:var(--mb-muted)}
2821
+ .mbmx-total td,.mbmx-table td.mbmx-rowtotal{background:var(--mb-soft);font-weight:760}
2822
+ `;
2823
+ function BillStatusAgingMatrix({
2824
+ bills,
2825
+ heading = "Bills by status and age",
2826
+ description = "Every bill grouped by lifecycle status, then by days outstanding.",
2827
+ stateOrder,
2828
+ showBalances = true,
2829
+ onSelectCell,
2830
+ appearance,
2831
+ className = "",
2832
+ style
2833
+ }) {
2834
+ const matrix = useMemo4(() => buildBillStatusAgingMatrix(bills, stateOrder), [bills, stateOrder]);
2835
+ const clickable = Boolean(onSelectCell);
2836
+ const cell = (data, key, isTotal = false) => /* @__PURE__ */ jsx5("td", { className: isTotal ? "mbmx-rowtotal" : void 0, children: /* @__PURE__ */ jsxs5(
2837
+ "button",
2838
+ {
2839
+ type: "button",
2840
+ className: "mbmx-cell",
2841
+ "data-clickable": clickable && data.count > 0,
2842
+ onClick: () => data.count > 0 && onSelectCell?.(data),
2843
+ disabled: !clickable || data.count === 0,
2844
+ "aria-label": `${stateLabel2(data.state)} \xB7 ${data.bucket === "total" ? "all ages" : data.bucket}: ${data.count} bills`,
2845
+ children: [
2846
+ /* @__PURE__ */ jsx5("span", { className: `mbmx-count ${data.count === 0 ? "mbmx-zero" : ""}`.trim(), children: data.count === 0 ? "\u2014" : data.count }),
2847
+ showBalances && data.count > 0 ? /* @__PURE__ */ jsx5("span", { className: "mbmx-balance", children: money4(data.balance) }) : null
2848
+ ]
2849
+ }
2850
+ ) }, key);
2851
+ return /* @__PURE__ */ jsxs5("div", { className: `mbmx ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
2852
+ /* @__PURE__ */ jsx5("style", { children: css3 }),
2853
+ /* @__PURE__ */ jsx5("div", { className: "mbmx-head", children: /* @__PURE__ */ jsxs5("div", { children: [
2854
+ /* @__PURE__ */ jsx5("h2", { children: heading }),
2855
+ /* @__PURE__ */ jsx5("p", { className: "mbmx-copy", children: description })
2856
+ ] }) }),
2857
+ /* @__PURE__ */ jsx5("div", { className: "mbmx-card", children: /* @__PURE__ */ jsxs5("table", { className: "mbmx-table", children: [
2858
+ /* @__PURE__ */ jsx5("thead", { children: /* @__PURE__ */ jsxs5("tr", { children: [
2859
+ /* @__PURE__ */ jsx5("th", { children: "Status" }),
2860
+ BILL_STATUS_AGING_BUCKETS.map((bucket) => /* @__PURE__ */ jsx5("th", { children: bucket.label }, bucket.id)),
2861
+ /* @__PURE__ */ jsx5("th", { children: "Total" })
2862
+ ] }) }),
2863
+ /* @__PURE__ */ jsxs5("tbody", { children: [
2864
+ matrix.rows.map((row) => /* @__PURE__ */ jsxs5("tr", { children: [
2865
+ /* @__PURE__ */ jsx5("td", { children: /* @__PURE__ */ jsx5("span", { className: "mbmx-state", children: row.label }) }),
2866
+ row.cells.map((data) => cell(data, `${row.state}-${data.bucket}`)),
2867
+ cell(row.total, `${row.state}-total`, true)
2868
+ ] }, row.state)),
2869
+ /* @__PURE__ */ jsxs5("tr", { className: "mbmx-total", children: [
2870
+ /* @__PURE__ */ jsx5("td", { children: "Total" }),
2871
+ matrix.columnTotals.map((data) => cell(data, `all-${data.bucket}`)),
2872
+ cell(matrix.grandTotal, "all-total", true)
2873
+ ] })
2874
+ ] })
2875
+ ] }) })
2876
+ ] });
2877
+ }
2878
+
2713
2879
  // src/connected-bill-status.tsx
2714
2880
  import {
2715
2881
  useCallback as useCallback2,
2716
2882
  useEffect as useEffect4,
2717
- useMemo as useMemo4,
2883
+ useMemo as useMemo5,
2718
2884
  useRef as useRef3,
2719
2885
  useState as useState5
2720
2886
  } from "react";
@@ -2722,7 +2888,7 @@ import {
2722
2888
  DEFAULT_API_BASE_URL,
2723
2889
  DEFAULT_SESSION_ENDPOINT
2724
2890
  } from "@mindbill/browser";
2725
- import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2891
+ import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2726
2892
  var DEFAULT_REFRESH_INTERVAL = 6e4;
2727
2893
  async function responseError(response, fallback) {
2728
2894
  const body = await response.json().catch(() => null);
@@ -2855,7 +3021,7 @@ function useBillStatus({
2855
3021
  initialData = null,
2856
3022
  fetch: fetchOverride
2857
3023
  }) {
2858
- const client = useMemo4(() => createBillStatusClient({
3024
+ const client = useMemo5(() => createBillStatusClient({
2859
3025
  billId,
2860
3026
  sessionEndpoint,
2861
3027
  ...getSession ? { getSession } : {},
@@ -2943,17 +3109,17 @@ function ConnectedBillStatus({
2943
3109
  }) {
2944
3110
  const status = useBillStatus(options);
2945
3111
  if (status.isLoading && !status.data) {
2946
- return /* @__PURE__ */ jsx5(Fragment4, { children: loadingFallback ?? /* @__PURE__ */ jsx5("div", { role: "status", children: "Loading bill status\u2026" }) });
3112
+ return /* @__PURE__ */ jsx6(Fragment4, { children: loadingFallback ?? /* @__PURE__ */ jsx6("div", { role: "status", children: "Loading bill status\u2026" }) });
2947
3113
  }
2948
3114
  if (status.error && !status.data) {
2949
- return /* @__PURE__ */ jsx5(Fragment4, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs5("div", { role: "alert", children: [
3115
+ return /* @__PURE__ */ jsx6(Fragment4, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs6("div", { role: "alert", children: [
2950
3116
  status.error.message,
2951
3117
  " ",
2952
- /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
3118
+ /* @__PURE__ */ jsx6("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
2953
3119
  ] }) });
2954
3120
  }
2955
3121
  if (!status.data) return null;
2956
- return /* @__PURE__ */ jsx5(
3122
+ return /* @__PURE__ */ jsx6(
2957
3123
  BillStatusSummary,
2958
3124
  {
2959
3125
  status: status.data.state,
@@ -2972,7 +3138,7 @@ function ConnectedBillStatus({
2972
3138
  }
2973
3139
 
2974
3140
  // src/bill-lifecycle-surfaces.tsx
2975
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
3141
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2976
3142
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
2977
3143
  return actions.filter((action) => action.enabled || showUnavailable);
2978
3144
  }
@@ -2987,11 +3153,11 @@ function BillLifecycleActions({
2987
3153
  }) {
2988
3154
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
2989
3155
  if (!visible.length) return null;
2990
- return /* @__PURE__ */ jsxs6("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
2991
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
2992
- visible.map((action) => /* @__PURE__ */ jsxs6("div", { className: "mb-lifecycle-action", children: [
2993
- /* @__PURE__ */ jsx6("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
2994
- !action.enabled && action.reason ? /* @__PURE__ */ jsx6("span", { className: "mb-action-reason", children: action.reason }) : null
3156
+ return /* @__PURE__ */ jsxs7("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
3157
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3158
+ visible.map((action) => /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-action", children: [
3159
+ /* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
3160
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx7("span", { className: "mb-action-reason", children: action.reason }) : null
2995
3161
  ] }, action.id))
2996
3162
  ] });
2997
3163
  }
@@ -3021,18 +3187,18 @@ function defaultFormatDate(createdAt) {
3021
3187
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
3022
3188
  }
3023
3189
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
3024
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3025
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3026
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3027
- /* @__PURE__ */ jsx6("strong", { children: "Bill history" }),
3028
- /* @__PURE__ */ jsx6("span", { children: "Submission, payer responses, follow-up, and payments." })
3190
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3191
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3192
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3193
+ /* @__PURE__ */ jsx7("strong", { children: "Bill history" }),
3194
+ /* @__PURE__ */ jsx7("span", { children: "Submission, payer responses, follow-up, and payments." })
3029
3195
  ] }) }),
3030
- !events.length ? /* @__PURE__ */ jsx6("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx6("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs6("li", { className: "mb-activity-item", children: [
3031
- /* @__PURE__ */ jsx6("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3032
- /* @__PURE__ */ jsxs6("div", { className: "mb-activity-content", children: [
3033
- /* @__PURE__ */ jsx6("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3034
- event.description ? /* @__PURE__ */ jsx6("p", { children: event.description }) : null,
3035
- /* @__PURE__ */ jsxs6("span", { children: [
3196
+ !events.length ? /* @__PURE__ */ jsx7("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx7("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs7("li", { className: "mb-activity-item", children: [
3197
+ /* @__PURE__ */ jsx7("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3198
+ /* @__PURE__ */ jsxs7("div", { className: "mb-activity-content", children: [
3199
+ /* @__PURE__ */ jsx7("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3200
+ event.description ? /* @__PURE__ */ jsx7("p", { children: event.description }) : null,
3201
+ /* @__PURE__ */ jsxs7("span", { children: [
3036
3202
  formatDate(event.createdAt),
3037
3203
  event.actor ? ` \xB7 ${event.actor}` : ""
3038
3204
  ] })
@@ -3067,20 +3233,20 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
3067
3233
  function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
3068
3234
  const current = billLifecycleStage(state);
3069
3235
  const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
3070
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3071
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3072
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3073
- /* @__PURE__ */ jsx6("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
3074
- /* @__PURE__ */ jsxs6("span", { children: [
3236
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3237
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3238
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3239
+ /* @__PURE__ */ jsx7("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
3240
+ /* @__PURE__ */ jsxs7("span", { children: [
3075
3241
  submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted",
3076
3242
  typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
3077
3243
  ] })
3078
3244
  ] }) }),
3079
- /* @__PURE__ */ jsx6("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
3245
+ /* @__PURE__ */ jsx7("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
3080
3246
  const status = index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming";
3081
- return /* @__PURE__ */ jsxs6("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
3082
- /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
3083
- /* @__PURE__ */ jsx6("b", { children: stage.label })
3247
+ return /* @__PURE__ */ jsxs7("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
3248
+ /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
3249
+ /* @__PURE__ */ jsx7("b", { children: stage.label })
3084
3250
  ] }, stage.id);
3085
3251
  }) })
3086
3252
  ] });
@@ -3094,18 +3260,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
3094
3260
  ["Charged", currency(bill.totalCharge)],
3095
3261
  ["Balance", currency(bill.balanceDue)]
3096
3262
  ];
3097
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
3098
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3099
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3100
- /* @__PURE__ */ jsx6("strong", { children: "Bill snapshot" }),
3101
- /* @__PURE__ */ jsxs6("span", { children: [
3263
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
3264
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3265
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3266
+ /* @__PURE__ */ jsx7("strong", { children: "Bill snapshot" }),
3267
+ /* @__PURE__ */ jsxs7("span", { children: [
3102
3268
  "Bill #",
3103
3269
  bill.billNumber
3104
3270
  ] })
3105
3271
  ] }) }),
3106
- /* @__PURE__ */ jsx6("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs6("div", { children: [
3107
- /* @__PURE__ */ jsx6("dt", { children: label }),
3108
- /* @__PURE__ */ jsx6("dd", { children: value })
3272
+ /* @__PURE__ */ jsx7("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs7("div", { children: [
3273
+ /* @__PURE__ */ jsx7("dt", { children: label }),
3274
+ /* @__PURE__ */ jsx7("dd", { children: value })
3109
3275
  ] }, label)) })
3110
3276
  ] });
3111
3277
  }
@@ -3120,140 +3286,140 @@ function BillExplanationOfReview({
3120
3286
  style
3121
3287
  }) {
3122
3288
  const rows = payments.length ? payments : [null];
3123
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
3124
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3125
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3126
- /* @__PURE__ */ jsx6("strong", { children: "Explanation of Review" }),
3127
- /* @__PURE__ */ jsx6("span", { children: "Payer response and payment reconciliation." })
3289
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
3290
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3291
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3292
+ /* @__PURE__ */ jsx7("strong", { children: "Explanation of Review" }),
3293
+ /* @__PURE__ */ jsx7("span", { children: "Payer response and payment reconciliation." })
3128
3294
  ] }) }),
3129
- /* @__PURE__ */ jsxs6("dl", { className: "mb-eor-metrics", children: [
3130
- /* @__PURE__ */ jsxs6("div", { children: [
3131
- /* @__PURE__ */ jsx6("dt", { children: "Amount billed" }),
3132
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.billedAmount) })
3295
+ /* @__PURE__ */ jsxs7("dl", { className: "mb-eor-metrics", children: [
3296
+ /* @__PURE__ */ jsxs7("div", { children: [
3297
+ /* @__PURE__ */ jsx7("dt", { children: "Amount billed" }),
3298
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.billedAmount) })
3133
3299
  ] }),
3134
- /* @__PURE__ */ jsxs6("div", { children: [
3135
- /* @__PURE__ */ jsx6("dt", { children: "Payer allowed" }),
3136
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3300
+ /* @__PURE__ */ jsxs7("div", { children: [
3301
+ /* @__PURE__ */ jsx7("dt", { children: "Payer allowed" }),
3302
+ /* @__PURE__ */ jsx7("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3137
3303
  ] }),
3138
- /* @__PURE__ */ jsxs6("div", { children: [
3139
- /* @__PURE__ */ jsx6("dt", { children: "Payer reported paid" }),
3140
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3304
+ /* @__PURE__ */ jsxs7("div", { children: [
3305
+ /* @__PURE__ */ jsx7("dt", { children: "Payer reported paid" }),
3306
+ /* @__PURE__ */ jsx7("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3141
3307
  ] }),
3142
- /* @__PURE__ */ jsxs6("div", { className: "is-balance", children: [
3143
- /* @__PURE__ */ jsx6("dt", { children: "Balance due" }),
3144
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.balanceDue) })
3308
+ /* @__PURE__ */ jsxs7("div", { className: "is-balance", children: [
3309
+ /* @__PURE__ */ jsx7("dt", { children: "Balance due" }),
3310
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.balanceDue) })
3145
3311
  ] }),
3146
- /* @__PURE__ */ jsxs6("div", { children: [
3147
- /* @__PURE__ */ jsx6("dt", { children: "Payment posted" }),
3148
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedPrincipal) })
3312
+ /* @__PURE__ */ jsxs7("div", { children: [
3313
+ /* @__PURE__ */ jsx7("dt", { children: "Payment posted" }),
3314
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedPrincipal) })
3149
3315
  ] }),
3150
- /* @__PURE__ */ jsxs6("div", { children: [
3151
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3152
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedAdditional) })
3316
+ /* @__PURE__ */ jsxs7("div", { children: [
3317
+ /* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
3318
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedAdditional) })
3153
3319
  ] }),
3154
- /* @__PURE__ */ jsxs6("div", { children: [
3155
- /* @__PURE__ */ jsx6("dt", { children: "Total received" }),
3156
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.totalPostedCash) })
3320
+ /* @__PURE__ */ jsxs7("div", { children: [
3321
+ /* @__PURE__ */ jsx7("dt", { children: "Total received" }),
3322
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.totalPostedCash) })
3157
3323
  ] }),
3158
- /* @__PURE__ */ jsxs6("div", { children: [
3159
- /* @__PURE__ */ jsx6("dt", { children: "Expected" }),
3160
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.expectedAmount) })
3324
+ /* @__PURE__ */ jsxs7("div", { children: [
3325
+ /* @__PURE__ */ jsx7("dt", { children: "Expected" }),
3326
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.expectedAmount) })
3161
3327
  ] })
3162
3328
  ] }),
3163
- remittance.denialReason ? /* @__PURE__ */ jsxs6("div", { className: "mb-denial", children: [
3164
- /* @__PURE__ */ jsx6("strong", { children: "Denial reason" }),
3165
- /* @__PURE__ */ jsx6("p", { children: remittance.denialReason })
3329
+ remittance.denialReason ? /* @__PURE__ */ jsxs7("div", { className: "mb-denial", children: [
3330
+ /* @__PURE__ */ jsx7("strong", { children: "Denial reason" }),
3331
+ /* @__PURE__ */ jsx7("p", { children: remittance.denialReason })
3166
3332
  ] }) : null,
3167
- /* @__PURE__ */ jsx6("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs6("table", { className: "mb-eor-table", children: [
3168
- /* @__PURE__ */ jsxs6("thead", { children: [
3169
- /* @__PURE__ */ jsxs6("tr", { className: "mb-eor-groups", children: [
3170
- /* @__PURE__ */ jsx6("th", { colSpan: 2, children: "Submission" }),
3171
- /* @__PURE__ */ jsx6("th", { colSpan: 5, children: "EOR payment information" }),
3172
- /* @__PURE__ */ jsx6("th", { colSpan: 2, children: "EOR post" }),
3173
- /* @__PURE__ */ jsx6("th", { children: "EOR" })
3333
+ /* @__PURE__ */ jsx7("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs7("table", { className: "mb-eor-table", children: [
3334
+ /* @__PURE__ */ jsxs7("thead", { children: [
3335
+ /* @__PURE__ */ jsxs7("tr", { className: "mb-eor-groups", children: [
3336
+ /* @__PURE__ */ jsx7("th", { colSpan: 2, children: "Submission" }),
3337
+ /* @__PURE__ */ jsx7("th", { colSpan: 5, children: "EOR payment information" }),
3338
+ /* @__PURE__ */ jsx7("th", { colSpan: 2, children: "EOR post" }),
3339
+ /* @__PURE__ */ jsx7("th", { children: "EOR" })
3174
3340
  ] }),
3175
- /* @__PURE__ */ jsxs6("tr", { children: [
3176
- /* @__PURE__ */ jsx6("th", { children: "Submission" }),
3177
- /* @__PURE__ */ jsx6("th", { children: "Submission payment" }),
3178
- /* @__PURE__ */ jsx6("th", { children: "Payment method" }),
3179
- /* @__PURE__ */ jsx6("th", { children: "Reference" }),
3180
- /* @__PURE__ */ jsx6("th", { children: "Effective date" }),
3181
- /* @__PURE__ */ jsx6("th", { children: "Payment total" }),
3182
- /* @__PURE__ */ jsx6("th", { children: "Deposit date" }),
3183
- /* @__PURE__ */ jsx6("th", { children: "Post date" }),
3184
- /* @__PURE__ */ jsx6("th", { children: "Source" }),
3185
- /* @__PURE__ */ jsx6("th", { children: "Document" })
3341
+ /* @__PURE__ */ jsxs7("tr", { children: [
3342
+ /* @__PURE__ */ jsx7("th", { children: "Submission" }),
3343
+ /* @__PURE__ */ jsx7("th", { children: "Submission payment" }),
3344
+ /* @__PURE__ */ jsx7("th", { children: "Payment method" }),
3345
+ /* @__PURE__ */ jsx7("th", { children: "Reference" }),
3346
+ /* @__PURE__ */ jsx7("th", { children: "Effective date" }),
3347
+ /* @__PURE__ */ jsx7("th", { children: "Payment total" }),
3348
+ /* @__PURE__ */ jsx7("th", { children: "Deposit date" }),
3349
+ /* @__PURE__ */ jsx7("th", { children: "Post date" }),
3350
+ /* @__PURE__ */ jsx7("th", { children: "Source" }),
3351
+ /* @__PURE__ */ jsx7("th", { children: "Document" })
3186
3352
  ] })
3187
3353
  ] }),
3188
- /* @__PURE__ */ jsx6("tbody", { children: rows.map((payment, index) => {
3354
+ /* @__PURE__ */ jsx7("tbody", { children: rows.map((payment, index) => {
3189
3355
  const eor = eors[index] ?? eors[0];
3190
- return /* @__PURE__ */ jsxs6("tr", { children: [
3191
- /* @__PURE__ */ jsxs6("td", { "data-label": "Submission", children: [
3192
- /* @__PURE__ */ jsx6("strong", { children: "Original bill" }),
3193
- submittedAt ? /* @__PURE__ */ jsxs6("span", { children: [
3356
+ return /* @__PURE__ */ jsxs7("tr", { children: [
3357
+ /* @__PURE__ */ jsxs7("td", { "data-label": "Submission", children: [
3358
+ /* @__PURE__ */ jsx7("strong", { children: "Original bill" }),
3359
+ submittedAt ? /* @__PURE__ */ jsxs7("span", { children: [
3194
3360
  "Sent ",
3195
3361
  defaultFormatDate(submittedAt)
3196
3362
  ] }) : null
3197
3363
  ] }),
3198
- /* @__PURE__ */ jsx6("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
3199
- /* @__PURE__ */ jsx6("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
3200
- /* @__PURE__ */ jsx6("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
3201
- /* @__PURE__ */ jsx6("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
3202
- /* @__PURE__ */ jsx6("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
3203
- /* @__PURE__ */ jsx6("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
3204
- /* @__PURE__ */ jsx6("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
3205
- /* @__PURE__ */ jsx6("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
3206
- /* @__PURE__ */ jsx6("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx6("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
3364
+ /* @__PURE__ */ jsx7("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
3365
+ /* @__PURE__ */ jsx7("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
3366
+ /* @__PURE__ */ jsx7("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
3367
+ /* @__PURE__ */ jsx7("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
3368
+ /* @__PURE__ */ jsx7("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
3369
+ /* @__PURE__ */ jsx7("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
3370
+ /* @__PURE__ */ jsx7("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
3371
+ /* @__PURE__ */ jsx7("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
3372
+ /* @__PURE__ */ jsx7("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
3207
3373
  ] }, payment?.id ?? `empty-${index}`);
3208
3374
  }) })
3209
3375
  ] }) }),
3210
- eors.length > rows.length ? /* @__PURE__ */ jsx6("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx6("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
3376
+ eors.length > rows.length ? /* @__PURE__ */ jsx7("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
3211
3377
  ] });
3212
3378
  }
3213
3379
  function BillRemittanceCard({ remittance, appearance, className, style }) {
3214
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
3215
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3216
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3217
- /* @__PURE__ */ jsx6("strong", { children: "Remittance" }),
3218
- /* @__PURE__ */ jsx6("span", { children: "Amounts reported by the payer and posted to the bill." })
3380
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
3381
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3382
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3383
+ /* @__PURE__ */ jsx7("strong", { children: "Remittance" }),
3384
+ /* @__PURE__ */ jsx7("span", { children: "Amounts reported by the payer and posted to the bill." })
3219
3385
  ] }) }),
3220
- /* @__PURE__ */ jsxs6("dl", { children: [
3221
- /* @__PURE__ */ jsxs6("div", { children: [
3222
- /* @__PURE__ */ jsx6("dt", { children: "Amount billed" }),
3223
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.billedAmount) })
3386
+ /* @__PURE__ */ jsxs7("dl", { children: [
3387
+ /* @__PURE__ */ jsxs7("div", { children: [
3388
+ /* @__PURE__ */ jsx7("dt", { children: "Amount billed" }),
3389
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.billedAmount) })
3224
3390
  ] }),
3225
- /* @__PURE__ */ jsxs6("div", { children: [
3226
- /* @__PURE__ */ jsx6("dt", { children: "Expected" }),
3227
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.expectedAmount) })
3391
+ /* @__PURE__ */ jsxs7("div", { children: [
3392
+ /* @__PURE__ */ jsx7("dt", { children: "Expected" }),
3393
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.expectedAmount) })
3228
3394
  ] }),
3229
- /* @__PURE__ */ jsxs6("div", { children: [
3230
- /* @__PURE__ */ jsx6("dt", { children: "Payer allowed" }),
3231
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3395
+ /* @__PURE__ */ jsxs7("div", { children: [
3396
+ /* @__PURE__ */ jsx7("dt", { children: "Payer allowed" }),
3397
+ /* @__PURE__ */ jsx7("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3232
3398
  ] }),
3233
- /* @__PURE__ */ jsxs6("div", { children: [
3234
- /* @__PURE__ */ jsx6("dt", { children: "Payer reported paid" }),
3235
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3399
+ /* @__PURE__ */ jsxs7("div", { children: [
3400
+ /* @__PURE__ */ jsx7("dt", { children: "Payer reported paid" }),
3401
+ /* @__PURE__ */ jsx7("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3236
3402
  ] }),
3237
- /* @__PURE__ */ jsxs6("div", { children: [
3238
- /* @__PURE__ */ jsx6("dt", { children: "Payment posted" }),
3239
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedPrincipal) })
3403
+ /* @__PURE__ */ jsxs7("div", { children: [
3404
+ /* @__PURE__ */ jsx7("dt", { children: "Payment posted" }),
3405
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedPrincipal) })
3240
3406
  ] }),
3241
- /* @__PURE__ */ jsxs6("div", { children: [
3242
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3243
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedAdditional) })
3407
+ /* @__PURE__ */ jsxs7("div", { children: [
3408
+ /* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
3409
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedAdditional) })
3244
3410
  ] }),
3245
- /* @__PURE__ */ jsxs6("div", { children: [
3246
- /* @__PURE__ */ jsx6("dt", { children: "Total received" }),
3247
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.totalPostedCash) })
3411
+ /* @__PURE__ */ jsxs7("div", { children: [
3412
+ /* @__PURE__ */ jsx7("dt", { children: "Total received" }),
3413
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.totalPostedCash) })
3248
3414
  ] }),
3249
- /* @__PURE__ */ jsxs6("div", { children: [
3250
- /* @__PURE__ */ jsx6("dt", { children: "Balance due" }),
3251
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.balanceDue) })
3415
+ /* @__PURE__ */ jsxs7("div", { children: [
3416
+ /* @__PURE__ */ jsx7("dt", { children: "Balance due" }),
3417
+ /* @__PURE__ */ jsx7("dd", { children: currency(remittance.balanceDue) })
3252
3418
  ] })
3253
3419
  ] }),
3254
- remittance.denialReason ? /* @__PURE__ */ jsxs6("div", { className: "mb-denial", children: [
3255
- /* @__PURE__ */ jsx6("strong", { children: "Denial reason" }),
3256
- /* @__PURE__ */ jsx6("p", { children: remittance.denialReason })
3420
+ remittance.denialReason ? /* @__PURE__ */ jsxs7("div", { className: "mb-denial", children: [
3421
+ /* @__PURE__ */ jsx7("strong", { children: "Denial reason" }),
3422
+ /* @__PURE__ */ jsx7("p", { children: remittance.denialReason })
3257
3423
  ] }) : null
3258
3424
  ] });
3259
3425
  }
@@ -3268,72 +3434,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
3268
3434
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
3269
3435
  ].filter(Boolean);
3270
3436
  if (!delivery.payerName && !contacts.length) return null;
3271
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
3272
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3273
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3274
- /* @__PURE__ */ jsx6("strong", { children: delivery.payerName || "Claims administrator" }),
3275
- /* @__PURE__ */ jsx6("span", { children: "Billing and follow-up contacts." })
3437
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
3438
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3439
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3440
+ /* @__PURE__ */ jsx7("strong", { children: delivery.payerName || "Claims administrator" }),
3441
+ /* @__PURE__ */ jsx7("span", { children: "Billing and follow-up contacts." })
3276
3442
  ] }) }),
3277
- !contacts.length ? /* @__PURE__ */ jsx6("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx6("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs6("div", { children: [
3278
- /* @__PURE__ */ jsx6("dt", { children: label }),
3279
- /* @__PURE__ */ jsx6("dd", { children: href ? /* @__PURE__ */ jsx6("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
3443
+ !contacts.length ? /* @__PURE__ */ jsx7("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx7("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs7("div", { children: [
3444
+ /* @__PURE__ */ jsx7("dt", { children: label }),
3445
+ /* @__PURE__ */ jsx7("dd", { children: href ? /* @__PURE__ */ jsx7("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
3280
3446
  ] }, label)) })
3281
3447
  ] });
3282
3448
  }
3283
3449
  function BillPaymentLedger({ payments, appearance, className, style }) {
3284
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
3285
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3286
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3287
- /* @__PURE__ */ jsx6("strong", { children: "Payments" }),
3288
- /* @__PURE__ */ jsx6("span", { children: "Funds recorded against this bill." })
3450
+ return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
3451
+ /* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
3452
+ /* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
3453
+ /* @__PURE__ */ jsx7("strong", { children: "Payments" }),
3454
+ /* @__PURE__ */ jsx7("span", { children: "Funds recorded against this bill." })
3289
3455
  ] }) }),
3290
- !payments.length ? /* @__PURE__ */ jsx6("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx6("div", { className: "mb-payment-list", children: payments.map((payment) => {
3456
+ !payments.length ? /* @__PURE__ */ jsx7("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx7("div", { className: "mb-payment-list", children: payments.map((payment) => {
3291
3457
  const additional = payment.feeAmount ?? 0;
3292
- return /* @__PURE__ */ jsxs6("article", { children: [
3293
- /* @__PURE__ */ jsxs6("div", { className: "mb-payment-amount", children: [
3294
- /* @__PURE__ */ jsx6("strong", { children: currency(payment.amount) }),
3295
- /* @__PURE__ */ jsx6("span", { children: "Total received" })
3458
+ return /* @__PURE__ */ jsxs7("article", { children: [
3459
+ /* @__PURE__ */ jsxs7("div", { className: "mb-payment-amount", children: [
3460
+ /* @__PURE__ */ jsx7("strong", { children: currency(payment.amount) }),
3461
+ /* @__PURE__ */ jsx7("span", { children: "Total received" })
3296
3462
  ] }),
3297
- /* @__PURE__ */ jsxs6("dl", { children: [
3298
- /* @__PURE__ */ jsxs6("div", { children: [
3299
- /* @__PURE__ */ jsx6("dt", { children: "Applied to bill" }),
3300
- /* @__PURE__ */ jsx6("dd", { children: currency(payment.principalAmount) })
3463
+ /* @__PURE__ */ jsxs7("dl", { children: [
3464
+ /* @__PURE__ */ jsxs7("div", { children: [
3465
+ /* @__PURE__ */ jsx7("dt", { children: "Applied to bill" }),
3466
+ /* @__PURE__ */ jsx7("dd", { children: currency(payment.principalAmount) })
3301
3467
  ] }),
3302
- additional > 0 ? /* @__PURE__ */ jsxs6("div", { children: [
3303
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3304
- /* @__PURE__ */ jsx6("dd", { children: currency(additional) })
3468
+ additional > 0 ? /* @__PURE__ */ jsxs7("div", { children: [
3469
+ /* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
3470
+ /* @__PURE__ */ jsx7("dd", { children: currency(additional) })
3305
3471
  ] }) : null,
3306
- /* @__PURE__ */ jsxs6("div", { children: [
3307
- /* @__PURE__ */ jsx6("dt", { children: "Method" }),
3308
- /* @__PURE__ */ jsx6("dd", { children: payment.method.toUpperCase() })
3472
+ /* @__PURE__ */ jsxs7("div", { children: [
3473
+ /* @__PURE__ */ jsx7("dt", { children: "Method" }),
3474
+ /* @__PURE__ */ jsx7("dd", { children: payment.method.toUpperCase() })
3309
3475
  ] }),
3310
- /* @__PURE__ */ jsxs6("div", { children: [
3311
- /* @__PURE__ */ jsx6("dt", { children: "Reference" }),
3312
- /* @__PURE__ */ jsx6("dd", { children: payment.checkNumber || "\u2014" })
3476
+ /* @__PURE__ */ jsxs7("div", { children: [
3477
+ /* @__PURE__ */ jsx7("dt", { children: "Reference" }),
3478
+ /* @__PURE__ */ jsx7("dd", { children: payment.checkNumber || "\u2014" })
3313
3479
  ] }),
3314
- /* @__PURE__ */ jsxs6("div", { children: [
3315
- /* @__PURE__ */ jsx6("dt", { children: "Effective date" }),
3316
- /* @__PURE__ */ jsx6("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
3480
+ /* @__PURE__ */ jsxs7("div", { children: [
3481
+ /* @__PURE__ */ jsx7("dt", { children: "Effective date" }),
3482
+ /* @__PURE__ */ jsx7("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
3317
3483
  ] }),
3318
- /* @__PURE__ */ jsxs6("div", { children: [
3319
- /* @__PURE__ */ jsx6("dt", { children: "Deposit date" }),
3320
- /* @__PURE__ */ jsx6("dd", { children: payment.depositDate || "Not recorded" })
3484
+ /* @__PURE__ */ jsxs7("div", { children: [
3485
+ /* @__PURE__ */ jsx7("dt", { children: "Deposit date" }),
3486
+ /* @__PURE__ */ jsx7("dd", { children: payment.depositDate || "Not recorded" })
3321
3487
  ] }),
3322
- /* @__PURE__ */ jsxs6("div", { children: [
3323
- /* @__PURE__ */ jsx6("dt", { children: "Posted" }),
3324
- /* @__PURE__ */ jsxs6("dd", { children: [
3488
+ /* @__PURE__ */ jsxs7("div", { children: [
3489
+ /* @__PURE__ */ jsx7("dt", { children: "Posted" }),
3490
+ /* @__PURE__ */ jsxs7("dd", { children: [
3325
3491
  defaultFormatDate(payment.postedAt),
3326
3492
  " \xB7 ",
3327
3493
  payment.source.toUpperCase()
3328
3494
  ] })
3329
3495
  ] }),
3330
- /* @__PURE__ */ jsxs6("div", { children: [
3331
- /* @__PURE__ */ jsx6("dt", { children: "Status" }),
3332
- /* @__PURE__ */ jsx6("dd", { children: humanize(payment.status || "posted") })
3496
+ /* @__PURE__ */ jsxs7("div", { children: [
3497
+ /* @__PURE__ */ jsx7("dt", { children: "Status" }),
3498
+ /* @__PURE__ */ jsx7("dd", { children: humanize(payment.status || "posted") })
3333
3499
  ] })
3334
3500
  ] }),
3335
- payment.feeReason ? /* @__PURE__ */ jsx6("p", { children: payment.feeReason }) : null,
3336
- payment.note ? /* @__PURE__ */ jsx6("p", { children: payment.note }) : null
3501
+ payment.feeReason ? /* @__PURE__ */ jsx7("p", { children: payment.feeReason }) : null,
3502
+ payment.note ? /* @__PURE__ */ jsx7("p", { children: payment.note }) : null
3337
3503
  ] }, payment.id);
3338
3504
  }) })
3339
3505
  ] });
@@ -3364,7 +3530,7 @@ var lifecycleSurfaceStyles = `
3364
3530
  import {
3365
3531
  useCallback as useCallback3,
3366
3532
  useEffect as useEffect5,
3367
- useMemo as useMemo5,
3533
+ useMemo as useMemo6,
3368
3534
  useRef as useRef4,
3369
3535
  useState as useState6
3370
3536
  } from "react";
@@ -3374,7 +3540,7 @@ import {
3374
3540
  createBillLifecycleClient
3375
3541
  } from "@mindbill/browser";
3376
3542
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
3377
- import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3543
+ import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3378
3544
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
3379
3545
  function reservePreviewWindow() {
3380
3546
  const preview = window.open("about:blank", "_blank");
@@ -3427,7 +3593,7 @@ function useBillLifecycle({
3427
3593
  const [isRefreshing, setIsRefreshing] = useState6(false);
3428
3594
  const [isMutating, setIsMutating] = useState6(false);
3429
3595
  const mounted = useRef4(true);
3430
- const client = useMemo5(() => createBillLifecycleClient({
3596
+ const client = useMemo6(() => createBillLifecycleClient({
3431
3597
  billId: providedBillId,
3432
3598
  sessionEndpoint,
3433
3599
  getSession,
@@ -3538,8 +3704,8 @@ function LifecycleDialog({ children, title, onClose }) {
3538
3704
  previous?.focus();
3539
3705
  };
3540
3706
  }, [onClose]);
3541
- return /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs7("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
3542
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
3707
+ return /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs8("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
3708
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
3543
3709
  children
3544
3710
  ] }) });
3545
3711
  }
@@ -3596,13 +3762,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
3596
3762
  attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
3597
3763
  }));
3598
3764
  }, [data, onChanged]);
3599
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx7(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
3765
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx8(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
3600
3766
  if (!data) {
3601
3767
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
3602
- return /* @__PURE__ */ jsx7(Fragment5, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-error", role: "alert", children: [
3603
- /* @__PURE__ */ jsx7("strong", { children: "Billing is unavailable." }),
3604
- /* @__PURE__ */ jsx7("span", { children: error.message }),
3605
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
3768
+ return /* @__PURE__ */ jsx8(Fragment5, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-error", role: "alert", children: [
3769
+ /* @__PURE__ */ jsx8("strong", { children: "Billing is unavailable." }),
3770
+ /* @__PURE__ */ jsx8("span", { children: error.message }),
3771
+ /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
3606
3772
  ] }) });
3607
3773
  }
3608
3774
  const complete = async (message, task) => {
@@ -3620,170 +3786,170 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
3620
3786
  const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
3621
3787
  const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
3622
3788
  const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
3623
- return /* @__PURE__ */ jsxs7("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
3624
- /* @__PURE__ */ jsx7("style", { children: CONNECTED_LIFECYCLE_STYLES }),
3625
- /* @__PURE__ */ jsx7(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
3626
- /* @__PURE__ */ jsxs7("header", { className: "mb-lifecycle-head", children: [
3627
- /* @__PURE__ */ jsxs7("div", { children: [
3628
- /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs7("h2", { children: [
3789
+ return /* @__PURE__ */ jsxs8("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
3790
+ /* @__PURE__ */ jsx8("style", { children: CONNECTED_LIFECYCLE_STYLES }),
3791
+ /* @__PURE__ */ jsx8(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
3792
+ /* @__PURE__ */ jsxs8("header", { className: "mb-lifecycle-head", children: [
3793
+ /* @__PURE__ */ jsxs8("div", { children: [
3794
+ /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs8("h2", { children: [
3629
3795
  "Bill #",
3630
3796
  data.bill.billNumber
3631
3797
  ] }) }),
3632
- /* @__PURE__ */ jsxs7("p", { children: [
3798
+ /* @__PURE__ */ jsxs8("p", { children: [
3633
3799
  "Claim ",
3634
3800
  data.injury.claimNumber || "\u2014",
3635
3801
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
3636
3802
  ] })
3637
3803
  ] }),
3638
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
3804
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
3639
3805
  ] }),
3640
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
3641
- /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
3642
- /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
3806
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
3807
+ /* @__PURE__ */ jsx8("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
3808
+ /* @__PURE__ */ jsx8("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
3643
3809
  ] }),
3644
- tab === "details" ? /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
3645
- data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx7(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
3646
- showSandboxControls ? /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
3647
- /* @__PURE__ */ jsxs7("div", { children: [
3648
- /* @__PURE__ */ jsx7("span", { children: "Sandbox demo controls" }),
3649
- /* @__PURE__ */ jsx7("h3", { children: "Simulate the next payer response" }),
3650
- /* @__PURE__ */ jsx7("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
3810
+ tab === "details" ? /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
3811
+ data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx8(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
3812
+ showSandboxControls ? /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
3813
+ /* @__PURE__ */ jsxs8("div", { children: [
3814
+ /* @__PURE__ */ jsx8("span", { children: "Sandbox demo controls" }),
3815
+ /* @__PURE__ */ jsx8("h3", { children: "Simulate the next payer response" }),
3816
+ /* @__PURE__ */ jsx8("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
3651
3817
  ] }),
3652
- simulations.length ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs7("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
3653
- /* @__PURE__ */ jsx7("strong", { children: scenario.label }),
3654
- /* @__PURE__ */ jsx7("span", { children: scenario.detail })
3655
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx7("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
3818
+ simulations.length ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs8("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
3819
+ /* @__PURE__ */ jsx8("strong", { children: scenario.label }),
3820
+ /* @__PURE__ */ jsx8("span", { children: scenario.detail })
3821
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx8("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
3656
3822
  ] }) : null,
3657
- /* @__PURE__ */ jsx7(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
3658
- ] }) : /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx7(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
3659
- viewEor || actions.length ? /* @__PURE__ */ jsxs7("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
3660
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
3661
- actions.map((action) => /* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
3823
+ /* @__PURE__ */ jsx8(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
3824
+ ] }) : /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx8(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
3825
+ viewEor || actions.length ? /* @__PURE__ */ jsxs8("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
3826
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
3827
+ actions.map((action) => /* @__PURE__ */ jsx8("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
3662
3828
  const next = actionPanel(action);
3663
3829
  if (next) setPanel(next);
3664
3830
  }, children: action.label }, action.id))
3665
3831
  ] }) : null,
3666
- panel === "resubmit" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3667
- /* @__PURE__ */ jsxs7("div", { children: [
3668
- /* @__PURE__ */ jsx7("h3", { children: "Correct and resubmit" }),
3669
- /* @__PURE__ */ jsx7("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
3832
+ panel === "resubmit" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
3833
+ /* @__PURE__ */ jsxs8("div", { children: [
3834
+ /* @__PURE__ */ jsx8("h3", { children: "Correct and resubmit" }),
3835
+ /* @__PURE__ */ jsx8("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
3670
3836
  ] }),
3671
- /* @__PURE__ */ jsxs7("label", { children: [
3672
- /* @__PURE__ */ jsx7("span", { children: "Correction note (optional)" }),
3673
- /* @__PURE__ */ jsx7("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
3837
+ /* @__PURE__ */ jsxs8("label", { children: [
3838
+ /* @__PURE__ */ jsx8("span", { children: "Correction note (optional)" }),
3839
+ /* @__PURE__ */ jsx8("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
3674
3840
  ] }),
3675
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3676
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3677
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
3841
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
3842
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3843
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
3678
3844
  ] })
3679
3845
  ] }) }) : null,
3680
- panel === "second_review" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3681
- /* @__PURE__ */ jsxs7("div", { children: [
3682
- /* @__PURE__ */ jsx7("h3", { children: "Submit Second Review" }),
3683
- /* @__PURE__ */ jsx7("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
3846
+ panel === "second_review" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
3847
+ /* @__PURE__ */ jsxs8("div", { children: [
3848
+ /* @__PURE__ */ jsx8("h3", { children: "Submit Second Review" }),
3849
+ /* @__PURE__ */ jsx8("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
3684
3850
  ] }),
3685
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-fields two", children: [
3686
- /* @__PURE__ */ jsxs7("label", { className: "full", children: [
3687
- /* @__PURE__ */ jsx7("span", { children: "Reason" }),
3688
- /* @__PURE__ */ jsx7("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
3851
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-fields two", children: [
3852
+ /* @__PURE__ */ jsxs8("label", { className: "full", children: [
3853
+ /* @__PURE__ */ jsx8("span", { children: "Reason" }),
3854
+ /* @__PURE__ */ jsx8("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
3689
3855
  ] }),
3690
- /* @__PURE__ */ jsxs7("label", { children: [
3691
- /* @__PURE__ */ jsx7("span", { children: "Payer claim control number" }),
3692
- /* @__PURE__ */ jsx7("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
3856
+ /* @__PURE__ */ jsxs8("label", { children: [
3857
+ /* @__PURE__ */ jsx8("span", { children: "Payer claim control number" }),
3858
+ /* @__PURE__ */ jsx8("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
3693
3859
  ] }),
3694
- /* @__PURE__ */ jsxs7("label", { children: [
3695
- /* @__PURE__ */ jsx7("span", { children: "Disputed amount" }),
3696
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
3860
+ /* @__PURE__ */ jsxs8("label", { children: [
3861
+ /* @__PURE__ */ jsx8("span", { children: "Disputed amount" }),
3862
+ /* @__PURE__ */ jsx8("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
3697
3863
  ] }),
3698
- /* @__PURE__ */ jsxs7("label", { children: [
3699
- /* @__PURE__ */ jsx7("span", { children: "Send via" }),
3700
- /* @__PURE__ */ jsxs7("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
3701
- /* @__PURE__ */ jsx7("option", { value: "ebill", children: "E-bill" }),
3702
- /* @__PURE__ */ jsx7("option", { value: "fax", children: "Fax" }),
3703
- /* @__PURE__ */ jsx7("option", { value: "mail", children: "Mail" }),
3704
- /* @__PURE__ */ jsx7("option", { value: "email", children: "Email" })
3864
+ /* @__PURE__ */ jsxs8("label", { children: [
3865
+ /* @__PURE__ */ jsx8("span", { children: "Send via" }),
3866
+ /* @__PURE__ */ jsxs8("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
3867
+ /* @__PURE__ */ jsx8("option", { value: "ebill", children: "E-bill" }),
3868
+ /* @__PURE__ */ jsx8("option", { value: "fax", children: "Fax" }),
3869
+ /* @__PURE__ */ jsx8("option", { value: "mail", children: "Mail" }),
3870
+ /* @__PURE__ */ jsx8("option", { value: "email", children: "Email" })
3705
3871
  ] })
3706
3872
  ] })
3707
3873
  ] }),
3708
- /* @__PURE__ */ jsxs7("fieldset", { className: "mb-lifecycle-packet", children: [
3709
- /* @__PURE__ */ jsx7("legend", { children: "Supporting packet" }),
3710
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs7("label", { children: [
3711
- /* @__PURE__ */ jsx7("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
3712
- /* @__PURE__ */ jsxs7("span", { children: [
3713
- /* @__PURE__ */ jsx7("strong", { children: attachment.filename }),
3714
- /* @__PURE__ */ jsx7("small", { children: attachment.description || attachment.documentType })
3874
+ /* @__PURE__ */ jsxs8("fieldset", { className: "mb-lifecycle-packet", children: [
3875
+ /* @__PURE__ */ jsx8("legend", { children: "Supporting packet" }),
3876
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs8("label", { children: [
3877
+ /* @__PURE__ */ jsx8("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
3878
+ /* @__PURE__ */ jsxs8("span", { children: [
3879
+ /* @__PURE__ */ jsx8("strong", { children: attachment.filename }),
3880
+ /* @__PURE__ */ jsx8("small", { children: attachment.description || attachment.documentType })
3715
3881
  ] }),
3716
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
3882
+ /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
3717
3883
  ] }, attachment.id))
3718
3884
  ] }),
3719
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3720
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3721
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
3885
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
3886
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3887
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
3722
3888
  ] })
3723
3889
  ] }) }) : null,
3724
- panel === "payment" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3725
- /* @__PURE__ */ jsxs7("div", { children: [
3726
- /* @__PURE__ */ jsx7("h3", { children: "Post payment" }),
3727
- /* @__PURE__ */ jsx7("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
3890
+ panel === "payment" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
3891
+ /* @__PURE__ */ jsxs8("div", { children: [
3892
+ /* @__PURE__ */ jsx8("h3", { children: "Post payment" }),
3893
+ /* @__PURE__ */ jsx8("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
3728
3894
  ] }),
3729
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-fields two", children: [
3730
- /* @__PURE__ */ jsxs7("label", { children: [
3731
- /* @__PURE__ */ jsx7("span", { children: "Amount applied to bill" }),
3732
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
3895
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-fields two", children: [
3896
+ /* @__PURE__ */ jsxs8("label", { children: [
3897
+ /* @__PURE__ */ jsx8("span", { children: "Amount applied to bill" }),
3898
+ /* @__PURE__ */ jsx8("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
3733
3899
  ] }),
3734
- /* @__PURE__ */ jsxs7("label", { children: [
3735
- /* @__PURE__ */ jsx7("span", { children: "Penalty" }),
3736
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
3900
+ /* @__PURE__ */ jsxs8("label", { children: [
3901
+ /* @__PURE__ */ jsx8("span", { children: "Penalty" }),
3902
+ /* @__PURE__ */ jsx8("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
3737
3903
  ] }),
3738
- /* @__PURE__ */ jsxs7("label", { children: [
3739
- /* @__PURE__ */ jsx7("span", { children: "Interest" }),
3740
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
3904
+ /* @__PURE__ */ jsxs8("label", { children: [
3905
+ /* @__PURE__ */ jsx8("span", { children: "Interest" }),
3906
+ /* @__PURE__ */ jsx8("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
3741
3907
  ] }),
3742
- /* @__PURE__ */ jsxs7("label", { children: [
3743
- /* @__PURE__ */ jsx7("span", { children: "Method" }),
3744
- /* @__PURE__ */ jsxs7("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
3745
- /* @__PURE__ */ jsx7("option", { value: "check", children: "Check" }),
3746
- /* @__PURE__ */ jsx7("option", { value: "eft", children: "EFT" })
3908
+ /* @__PURE__ */ jsxs8("label", { children: [
3909
+ /* @__PURE__ */ jsx8("span", { children: "Method" }),
3910
+ /* @__PURE__ */ jsxs8("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
3911
+ /* @__PURE__ */ jsx8("option", { value: "check", children: "Check" }),
3912
+ /* @__PURE__ */ jsx8("option", { value: "eft", children: "EFT" })
3747
3913
  ] })
3748
3914
  ] }),
3749
- /* @__PURE__ */ jsxs7("label", { children: [
3750
- /* @__PURE__ */ jsx7("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
3751
- /* @__PURE__ */ jsx7("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
3915
+ /* @__PURE__ */ jsxs8("label", { children: [
3916
+ /* @__PURE__ */ jsx8("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
3917
+ /* @__PURE__ */ jsx8("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
3752
3918
  ] }),
3753
- /* @__PURE__ */ jsxs7("label", { children: [
3754
- /* @__PURE__ */ jsx7("span", { children: "Deposit date" }),
3755
- /* @__PURE__ */ jsx7("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
3919
+ /* @__PURE__ */ jsxs8("label", { children: [
3920
+ /* @__PURE__ */ jsx8("span", { children: "Deposit date" }),
3921
+ /* @__PURE__ */ jsx8("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
3756
3922
  ] }),
3757
- /* @__PURE__ */ jsxs7("label", { className: "full", children: [
3758
- /* @__PURE__ */ jsx7("span", { children: "Note (optional)" }),
3759
- /* @__PURE__ */ jsx7("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
3923
+ /* @__PURE__ */ jsxs8("label", { className: "full", children: [
3924
+ /* @__PURE__ */ jsx8("span", { children: "Note (optional)" }),
3925
+ /* @__PURE__ */ jsx8("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
3760
3926
  ] })
3761
3927
  ] }),
3762
- /* @__PURE__ */ jsxs7("div", { className: "mb-payment-total", children: [
3763
- /* @__PURE__ */ jsx7("span", { children: "Total received" }),
3764
- /* @__PURE__ */ jsx7("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
3928
+ /* @__PURE__ */ jsxs8("div", { className: "mb-payment-total", children: [
3929
+ /* @__PURE__ */ jsx8("span", { children: "Total received" }),
3930
+ /* @__PURE__ */ jsx8("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
3765
3931
  ] }),
3766
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3767
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3768
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
3932
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
3933
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3934
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
3769
3935
  ] })
3770
3936
  ] }) }) : null,
3771
- panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3772
- /* @__PURE__ */ jsxs7("div", { children: [
3773
- /* @__PURE__ */ jsx7("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
3774
- /* @__PURE__ */ jsx7("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
3937
+ panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
3938
+ /* @__PURE__ */ jsxs8("div", { children: [
3939
+ /* @__PURE__ */ jsx8("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
3940
+ /* @__PURE__ */ jsx8("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
3775
3941
  ] }),
3776
- /* @__PURE__ */ jsxs7("label", { children: [
3777
- /* @__PURE__ */ jsx7("span", { children: "Reason" }),
3778
- /* @__PURE__ */ jsx7("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
3942
+ /* @__PURE__ */ jsxs8("label", { children: [
3943
+ /* @__PURE__ */ jsx8("span", { children: "Reason" }),
3944
+ /* @__PURE__ */ jsx8("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
3779
3945
  ] }),
3780
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3781
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3782
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
3946
+ /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
3947
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3948
+ /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
3783
3949
  ] })
3784
3950
  ] }) }) : null,
3785
- notice ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
3786
- lifecycle.error ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
3951
+ notice ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
3952
+ lifecycle.error ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
3787
3953
  ] });
3788
3954
  }
3789
3955
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -3834,6 +4000,7 @@ function MindBillBillReview(props) {
3834
4000
  return widget("mindbill-bill-review", props);
3835
4001
  }
3836
4002
  export {
4003
+ BILL_STATUS_AGING_BUCKETS,
3837
4004
  BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS,
3838
4005
  BILL_SUBMISSION_DOCUMENT_TYPES,
3839
4006
  BILL_SUBMISSION_REPORT_TYPES,
@@ -3850,6 +4017,7 @@ export {
3850
4017
  BillRemittanceCard,
3851
4018
  BillReviewForm,
3852
4019
  BillSnapshotSummary,
4020
+ BillStatusAgingMatrix,
3853
4021
  BillStatusSummary,
3854
4022
  BillSubmissionActions,
3855
4023
  BillSubmissionAttachmentsSection,
@@ -3878,6 +4046,8 @@ export {
3878
4046
  billLifecycleDisplayLabel,
3879
4047
  billLifecycleStage,
3880
4048
  buildBillReviewSaveInput,
4049
+ buildBillStatusAgingCsv,
4050
+ buildBillStatusAgingMatrix,
3881
4051
  buildBillingReportCsv,
3882
4052
  buildBillingReportRows,
3883
4053
  calculateBillSubmissionAllowedAmount,