@mindbill/react 0.30.0 → 0.31.1

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/README.md CHANGED
@@ -8,7 +8,7 @@ npm install @mindbill/react @mindbill/node
8
8
 
9
9
  ## Connected lifecycle
10
10
 
11
- `ConnectedBillLifecycle` starts after `BillSubmissionForm` atomically submits an immutable bill. Its only bill input is `billId`; `getSession` returns the short-lived token. The component fetches the submitted snapshot, progress, human-readable history, EOR/remittance amounts, payments, and available actions from MindBill. Do not pass lifecycle seed data or duplicate this state in the host app. The only persistent header action is **Download packet**; status-dependent actions remain visible in a sticky bottom action bar when MindBill makes them available. Actions that require input open a focused form dialog.
11
+ `ConnectedBillLifecycle` starts after `BillSubmissionForm` atomically submits an immutable bill. Its only bill input is `billId`; `getSession` returns the short-lived token. The component fetches the submitted snapshot, progress, human-readable history, rejection details, EOR/remittance amounts, payments, and available actions from MindBill. Do not pass lifecycle seed data or duplicate this state in the host app. The only persistent header action is **Download packet**, which opens the authenticated PDF packet directly in a new browser tab; status-dependent actions remain visible in a sticky bottom action bar when MindBill makes them available. Actions that require input open a focused form dialog.
12
12
 
13
13
  ```tsx
14
14
  import { ConnectedBillLifecycle } from "@mindbill/react";
@@ -95,6 +95,8 @@ import { BillReadOnlyForm } from "@mindbill/react";
95
95
 
96
96
  `ConnectedBillLifecycle` composes this component with the Details / Bill history switch, so most partners should not assemble these pieces themselves.
97
97
 
98
+ `BillRejectionNotice` is also exported for custom lifecycle layouts. It renders the API-provided rejection reason, acknowledgement code, source, and receipt time as an accessible alert. The connected lifecycle includes it automatically whenever the current state is `rejected`.
99
+
98
100
  ## Lifecycle actions
99
101
 
100
102
  MindBill returns the actions that are valid for the bill's current state. Render that server-authoritative list instead of duplicating rejection, EOR, denial, review, payment, and closure rules in your application.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { MindBillAppearance, MindBillEventDetail, MindBillErrorDetail } from '@mindbill/embed';
2
2
  export { MindBillAppearance, MindBillErrorDetail, MindBillEventDetail } from '@mindbill/embed';
3
3
  import { CSSProperties, ReactElement, ReactNode } from 'react';
4
- import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
5
- export { BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRemittanceSummary, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, ReopenBillInput, SubmitSecondReviewInput, createBillLifecycleClient } from '@mindbill/browser';
4
+ import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
5
+ export { BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRejection, BillRemittanceSummary, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, ReopenBillInput, SubmitSecondReviewInput, createBillLifecycleClient } from '@mindbill/browser';
6
6
 
7
7
  type MindBillThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue" | "midnight-cyan";
8
8
  type MindBillReactAppearance = MindBillAppearance & {
@@ -865,6 +865,12 @@ type BillLifecycleProgressProps = SurfaceProps & {
865
865
  agingDays?: number | null;
866
866
  };
867
867
  declare function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }: BillLifecycleProgressProps): ReactElement;
868
+ type BillRejectionNoticeProps = SurfaceProps & {
869
+ rejection: BillRejection;
870
+ title?: string;
871
+ };
872
+ /** A prominent, end-user-readable explanation of a rejected submission. */
873
+ declare function BillRejectionNotice({ rejection, title, appearance, className, style }: BillRejectionNoticeProps): ReactElement;
868
874
  type BillSnapshotSummaryProps = SurfaceProps & Pick<BillLifecycleData, "bill" | "patient" | "injury" | "delivery">;
869
875
  declare function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }: BillSnapshotSummaryProps): ReactElement;
870
876
  type BillRemittanceCardProps = SurfaceProps & {
@@ -945,4 +951,4 @@ type MindBillWidgetProps = {
945
951
  declare function MindBillBillTimeline(props: MindBillWidgetProps): ReactElement;
946
952
  declare function MindBillBillReview(props: MindBillWidgetProps): ReactElement;
947
953
 
948
- export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, formatBillSubmissionDate, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
954
+ export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, formatBillSubmissionDate, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
package/dist/index.js CHANGED
@@ -3491,6 +3491,20 @@ function billLifecycleStage(state) {
3491
3491
  if (value.includes("accepted")) return "accepted";
3492
3492
  return "submitted";
3493
3493
  }
3494
+ function billLifecycleProgressSteps(state) {
3495
+ if (state.toLowerCase() === "rejected") {
3496
+ return [
3497
+ { id: "submitted", label: "Sent", status: "complete" },
3498
+ { id: "rejected", label: "Rejected", status: "current" }
3499
+ ];
3500
+ }
3501
+ const current = billLifecycleStage(state);
3502
+ const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
3503
+ return lifecycleStages.map((stage, index) => ({
3504
+ ...stage,
3505
+ status: index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming"
3506
+ }));
3507
+ }
3494
3508
  function billLifecycleDisplayLabel(state, nativeStatus) {
3495
3509
  const value = state.toLowerCase();
3496
3510
  if (value === "submitted") return "Sent";
@@ -3502,24 +3516,35 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
3502
3516
  return humanize(state || nativeStatus || "submitted");
3503
3517
  }
3504
3518
  function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
3505
- const current = billLifecycleStage(state);
3506
- const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
3507
- return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3519
+ const rejected = state.toLowerCase() === "rejected";
3520
+ const steps = billLifecycleProgressSteps(state);
3521
+ return /* @__PURE__ */ jsxs8("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3508
3522
  /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3509
3523
  /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3510
3524
  /* @__PURE__ */ jsx8("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
3511
- /* @__PURE__ */ jsxs8("span", { children: [
3512
- submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted",
3513
- typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
3514
- ] })
3525
+ /* @__PURE__ */ jsx8("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
3515
3526
  ] }) }),
3516
- /* @__PURE__ */ jsx8("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
3517
- const status = index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming";
3518
- return /* @__PURE__ */ jsxs8("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
3519
- /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
3520
- /* @__PURE__ */ jsx8("b", { children: stage.label })
3521
- ] }, stage.id);
3522
- }) })
3527
+ /* @__PURE__ */ jsx8("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs8("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
3528
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
3529
+ /* @__PURE__ */ jsx8("b", { children: step.label })
3530
+ ] }, step.id)) })
3531
+ ] });
3532
+ }
3533
+ function BillRejectionNotice({ rejection, title = "Why it was rejected", appearance, className, style }) {
3534
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reason", children: [
3535
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3536
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3537
+ /* @__PURE__ */ jsx8("strong", { children: title }),
3538
+ /* @__PURE__ */ jsx8("span", { children: "Correct this issue before resubmitting." })
3539
+ ] }) }),
3540
+ /* @__PURE__ */ jsxs8("div", { className: "mb-rejection-reason", children: [
3541
+ rejection.code ? /* @__PURE__ */ jsx8("span", { className: "mb-rejection-code", children: rejection.code }) : null,
3542
+ /* @__PURE__ */ jsx8("p", { children: rejection.reason })
3543
+ ] }),
3544
+ rejection.receivedAt || rejection.source ? /* @__PURE__ */ jsxs8("p", { className: "mb-rejection-meta", children: [
3545
+ rejection.receivedAt ? `Received ${defaultFormatDate(rejection.receivedAt)}` : "Received from payer",
3546
+ rejection.source ? ` \xB7 ${rejection.source}` : ""
3547
+ ] }) : null
3523
3548
  ] });
3524
3549
  }
3525
3550
  function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }) {
@@ -3791,6 +3816,8 @@ var lifecycleSurfaceStyles = `
3791
3816
  .mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}.mb-lifecycle-action{display:grid;gap:5px;max-width:260px}.mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}.mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}.mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}.mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-action-button:disabled{cursor:not-allowed;opacity:.55}.mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
3792
3817
  .mb-activity-list{list-style:none;margin:0;padding:0}.mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}.mb-activity-item:last-child{padding-bottom:0}.mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}.mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}.mb-activity-content{display:grid;gap:4px;min-width:0}.mb-activity-content strong{font-size:15px;line-height:1.35}.mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}.mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}.mb-activity-empty,.mb-empty{margin:0}
3793
3818
  .mb-progress-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));list-style:none;margin:0;padding:0}.mb-progress-list li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-muted);font-size:12px}.mb-progress-list li:not(:last-child)::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-border)}.mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-accent)}.mb-progress-list li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border:2px solid var(--mb-border);border-radius:50%;background:var(--mb-surface);font-weight:800}.mb-progress-list li.is-complete>span,.mb-progress-list li.is-current>span{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-progress-list li.is-current{color:var(--mb-text)}
3819
+ .mb-progress.is-rejected{border-color:color-mix(in srgb,var(--mb-danger) 34%,var(--mb-border));background:color-mix(in srgb,var(--mb-danger) 3%,var(--mb-surface));box-shadow:0 8px 24px color-mix(in srgb,var(--mb-danger) 8%,transparent)}.mb-progress.is-rejected .mb-surface-heading strong,.mb-progress.is-rejected .mb-progress-list li.is-current{color:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-current>span{border-color:var(--mb-danger);background:var(--mb-danger);color:#fff}
3820
+ .mb-rejection-notice{border-left:5px solid var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 6%,var(--mb-surface));padding-left:18px}.mb-rejection-notice .mb-surface-heading{margin-bottom:12px}.mb-rejection-notice .mb-surface-heading strong{color:var(--mb-danger)}.mb-rejection-reason{display:flex;align-items:flex-start;gap:10px}.mb-rejection-reason p{margin:1px 0 0;font-size:15px;line-height:1.5}.mb-rejection-code{flex:0 0 auto;border:1px solid color-mix(in srgb,var(--mb-danger) 35%,var(--mb-border));border-radius:999px;background:var(--mb-surface);color:var(--mb-danger);font-size:12px;font-weight:800;padding:3px 8px}.mb-rejection-meta{margin:12px 0 0;color:var(--mb-muted);font-size:12px}
3794
3821
  .mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0}.mb-remittance dl{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:1px;background:var(--mb-border)}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{display:grid;gap:3px;padding:10px 14px;border-left:1px solid var(--mb-border)}.mb-remittance dl>div{border:0;background:var(--mb-surface)}.mb-snapshot dl>div:nth-child(3n+1),.mb-contacts dl>div:first-child{border-left:0}.mb-snapshot dt,.mb-remittance dt,.mb-contacts dt,.mb-payment-list dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-snapshot dd,.mb-remittance dd,.mb-contacts dd,.mb-payment-list dd{font-size:14px;font-weight:750;margin:0;overflow-wrap:anywhere}.mb-contacts a{color:var(--mb-accent)}.mb-denial{margin-top:16px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px}.mb-denial p{margin:4px 0 0}
3795
3822
  .mb-payment-list{display:grid}.mb-payment-list article{display:grid;grid-template-columns:minmax(120px,.35fr) 1fr;gap:14px 24px;padding:16px 0;border-top:1px solid var(--mb-border)}.mb-payment-list article:first-child{border-top:0}.mb-payment-amount{display:grid;align-content:start;gap:2px}.mb-payment-amount strong{font-size:1.2rem}.mb-payment-list article>dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}.mb-payment-list article>dl>div{display:grid;align-content:start;gap:3px}.mb-payment-list article span{color:var(--mb-muted);font-size:12px}.mb-payment-list article p{grid-column:1/-1;margin:0;color:var(--mb-muted);font-size:13px}
3796
3823
  .mb-eor-review{border-top:4px solid var(--mb-accent);padding-top:17px}.mb-eor-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 18px;border:1px solid var(--mb-border);border-radius:10px;overflow:hidden}.mb-eor-metrics>div{display:grid;gap:4px;padding:13px 15px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border)}.mb-eor-metrics>div:nth-child(-n+4){border-top:0}.mb-eor-metrics>div:nth-child(4n+1){border-left:0}.mb-eor-metrics dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-eor-metrics dd{margin:0;font-size:15px;font-weight:800}.mb-eor-metrics .is-balance{background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface))}.mb-eor-table-wrap{overflow-x:auto;border:1px solid var(--mb-border);border-radius:10px}.mb-eor-table{width:100%;min-width:1080px;border-collapse:collapse;font-size:12px}.mb-eor-table th,.mb-eor-table td{padding:10px 12px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border);text-align:left;vertical-align:top}.mb-eor-table th:first-child,.mb-eor-table td:first-child{border-left:0}.mb-eor-table thead th{background:var(--mb-soft);color:var(--mb-muted);font-weight:800}.mb-eor-table .mb-eor-groups th{border-top:0;background:color-mix(in srgb,var(--mb-accent) 13%,var(--mb-surface));color:var(--mb-text);text-align:center}.mb-eor-table td>strong,.mb-eor-table td>span{display:block}.mb-eor-table td>span{margin-top:3px;color:var(--mb-muted)}.mb-eor-link,.mb-eor-documents button{border:0;background:transparent;color:var(--mb-accent);font:inherit;font-weight:750;padding:0;text-align:left;text-decoration:underline;cursor:pointer;overflow-wrap:anywhere}.mb-eor-documents{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
@@ -3823,14 +3850,9 @@ function reservePreviewWindow() {
3823
3850
  }
3824
3851
  return preview;
3825
3852
  }
3826
- function renderPreview(preview, title, body) {
3827
- preview.document.open();
3828
- preview.document.write(`<!doctype html><title>${title}</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html,body{height:100%;margin:0;background:#202124;font:14px system-ui}iframe{width:100%;height:100%;border:0}.fallback{position:fixed;right:12px;top:12px;z-index:2;border-radius:8px;background:#fff;padding:9px 12px;color:#17282d;text-decoration:none;box-shadow:0 2px 12px #0005}</style>${body}`);
3829
- preview.document.close();
3830
- }
3831
3853
  function previewBlob(blob, preview) {
3832
3854
  const url = URL.createObjectURL(blob);
3833
- if (preview) renderPreview(preview, "PDF preview", `<a class="fallback" href="${url}" target="_self">Open PDF directly</a><iframe title="PDF preview" src="${url}"></iframe>`);
3855
+ if (preview) preview.location.replace(url);
3834
3856
  else {
3835
3857
  const link = document.createElement("a");
3836
3858
  link.href = url;
@@ -3845,7 +3867,7 @@ async function openPdfFromUserGesture(loadPdf) {
3845
3867
  try {
3846
3868
  previewBlob(await loadPdf(), preview);
3847
3869
  } catch (error) {
3848
- if (preview) renderPreview(preview, "PDF unavailable", '<p style="margin:0;padding:32px;color:#fff">The PDF could not be opened. Close this tab and try again.</p>');
3870
+ preview?.close();
3849
3871
  throw error;
3850
3872
  }
3851
3873
  }
@@ -4060,6 +4082,7 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4060
4082
  return /* @__PURE__ */ jsxs9("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
4061
4083
  /* @__PURE__ */ jsx9("style", { children: CONNECTED_LIFECYCLE_STYLES }),
4062
4084
  /* @__PURE__ */ jsx9(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4085
+ data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx9(BillRejectionNotice, { rejection: data.rejection, ...appearance ? { appearance } : {} }) : null,
4063
4086
  /* @__PURE__ */ jsxs9("header", { className: "mb-lifecycle-head", children: [
4064
4087
  /* @__PURE__ */ jsxs9("div", { children: [
4065
4088
  /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs9("h2", { children: [
@@ -4285,6 +4308,7 @@ export {
4285
4308
  BillPayerContactCard,
4286
4309
  BillPaymentLedger,
4287
4310
  BillReadOnlyForm,
4311
+ BillRejectionNotice,
4288
4312
  BillRemittanceCard,
4289
4313
  BillReviewForm,
4290
4314
  BillSnapshotSummary,