@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.2
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 +3 -3
- package/dist/stories/Accessibility.stories.d.ts +13 -0
- package/dist/stories/Accessibility.stories.d.ts.map +1 -0
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
- package/dist/subscriberbot/components/Modal.js +43 -33
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts +6 -0
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +2 -1
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +10 -10
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts +2 -0
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +46 -37
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -6
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +143 -135
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +3 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +5 -3
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +1 -0
- package/dist/subscriberbot/components/viz.d.ts.map +1 -1
- package/dist/subscriberbot/components/viz.js +100 -101
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormError.js +28 -0
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.js +13 -0
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -1
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +115 -98
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +421 -402
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +130 -121
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +57 -57
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +272 -260
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +112 -91
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +16 -5
- package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +57 -25
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -21
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge for Subscriber Bot domain statuses (relationship lifecycle,\n * invoice status, agent posture, channel verification, provider status,\n * workflow state) with semantic color mapping. Accepts the raw server enum\n * value (e.g. \"ACTIVE\", \"PAST_DUE\", \"SUGGEST_ONLY\").\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["import { useFormatters } from '../hooks/useFormatters';\n/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge for Subscriber Bot domain statuses (relationship lifecycle,\n * invoice status, agent posture, channel verification, provider status,\n * workflow state) with semantic color mapping. Accepts the raw server enum\n * value (e.g. \"ACTIVE\", \"PAST_DUE\", \"SUGGEST_ONLY\").\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses that represent a \"live\" / in-progress condition get a subtle,\n// opacity-only glow pulse (reduced-motion safe via motion-safe:).\nconst liveStatuses = new Set(['ACTIVE', 'AUTONOMOUS', 'TRIAL', 'EXPIRING']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Relationship lifecycle\n ACTIVE: 'success',\n TRIAL: 'info',\n PAUSED: 'warning',\n PAST_DUE: 'destructive',\n LAPSED: 'warning',\n EXPIRED: 'secondary',\n CANCELLED: 'destructive',\n\n // Invoice status\n DRAFT: 'secondary',\n ISSUED: 'info',\n PAID: 'success',\n OVERDUE: 'destructive',\n FAILED: 'destructive',\n REFUNDED: 'outline',\n\n // Bank connections (BOFF-4161)\n NEEDS_REAUTH: 'warning',\n ERROR: 'destructive',\n DISCONNECTED: 'secondary',\n\n // Agent posture\n AUTONOMOUS: 'success',\n SUGGEST_ONLY: 'info',\n DISABLED: 'secondary',\n\n // Channel verification / payment instrument\n VERIFIED: 'success',\n PENDING: 'warning',\n EXPIRING: 'warning',\n REMOVED: 'outline',\n\n // Provider status\n CLAIMED: 'success',\n UNVERIFIED: 'secondary',\n DEPRECATED: 'outline',\n\n // Workflow status\n ARCHIVED: 'outline',\n\n // Adapter submission / marketplace report moderation status\n APPROVED: 'success',\n REJECTED: 'destructive',\n DISMISSED: 'outline',\n RESOLVED: 'success',\n\n // AI decision status (DISMISSED shared with moderation above)\n PROPOSED: 'info',\n APPLYING: 'warning',\n APPLIED: 'success',\n STALE: 'secondary',\n FLAGGED: 'warning',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const { formatEnumLabel } = useFormatters();\n\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAqBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;AACX,GAIM,IAAe,IAAI,IAAI;CAAC;CAAU;CAAc;CAAS;AAAU,CAAC,GAEpE,IAAiD;CAErD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,WAAW;CAGX,OAAO;CACP,QAAQ;CACR,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CAGV,cAAc;CACd,OAAO;CACP,cAAc;CAGd,YAAY;CACZ,cAAc;CACd,UAAU;CAGV,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;CAGT,SAAS;CACT,YAAY;CACZ,YAAY;CAGZ,UAAU;CAGV,UAAU;CACV,UAAU;CACV,WAAW;CACX,UAAU;CAGV,UAAU;CACV,UAAU;CACV,SAAS;CACT,OAAO;CACP,SAAS;AACX,GAEa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,EAAE,uBAAoB,EAAc,GAEpC,IAAM,EAAO,YAAY,GACzB,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,CAAG;CAEnC,OACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,CACF;YALF,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA,GAEF,EAAgB,CAAM,CACnB;;AAEV"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
4
|
import { AlertTriangle as r, Info as i } from "lucide-react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/subscriberbot/components/decisions/DecisionBanners.tsx
|
|
7
7
|
var s = ({ className: e }) => {
|
|
8
|
-
let r =
|
|
8
|
+
let r = t();
|
|
9
9
|
return /* @__PURE__ */ o("div", {
|
|
10
10
|
role: "note",
|
|
11
11
|
"data-testid": "ai-disclaimer",
|
|
12
|
-
className:
|
|
12
|
+
className: n("flex items-start gap-2.5 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs text-text-secondary", e),
|
|
13
13
|
children: [/* @__PURE__ */ a(i, {
|
|
14
14
|
className: "mt-0.5 h-4 w-4 shrink-0 text-text-secondary",
|
|
15
15
|
"aria-hidden": !0
|
|
@@ -23,11 +23,11 @@ var s = ({ className: e }) => {
|
|
|
23
23
|
] })]
|
|
24
24
|
});
|
|
25
25
|
}, c = ({ message: i, onRetry: s, className: c }) => {
|
|
26
|
-
let l =
|
|
26
|
+
let l = t(), { navigateTo: u } = e();
|
|
27
27
|
return /* @__PURE__ */ o("div", {
|
|
28
28
|
role: "status",
|
|
29
29
|
"data-testid": "decisions-unavailable",
|
|
30
|
-
className:
|
|
30
|
+
className: n("flex flex-col gap-3 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-sm text-status-warning-text sm:flex-row sm:items-center sm:justify-between", c),
|
|
31
31
|
children: [/* @__PURE__ */ o("div", {
|
|
32
32
|
className: "flex items-start gap-2.5",
|
|
33
33
|
children: [/* @__PURE__ */ a(r, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionCard.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecisionCard.d.ts","sourceRoot":"","sources":["../../../../src/subscriberbot/components/decisions/DecisionCard.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAU1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA+B/C,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC;IACnC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;CAC7C,CA6GA,CAAC;AAMF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA+EpF,CAAC;AAMF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA6CzE,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAC5B,QAAQ,EAAE,WAAW,CAAC;IACtB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAsHA,CAAC"}
|
|
@@ -1,317 +1,319 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useApplyDecision as
|
|
8
|
-
import { DECISION_KIND_LABEL as
|
|
9
|
-
import { useState as
|
|
10
|
-
import { CheckCircle2 as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { GlassCard as
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
+
import { cn as r } from "../../utils/cn.js";
|
|
5
|
+
import { StatusBadge as i } from "../StatusBadge.js";
|
|
6
|
+
import { Modal as a } from "../Modal.js";
|
|
7
|
+
import { useApplyDecision as o, useDismissDecision as s } from "../../hooks/useSubscriberBotApi.js";
|
|
8
|
+
import { DECISION_KIND_LABEL as c, RECOMMENDATION_LABEL as l, confidencePercent as u, evidenceSources as d, isActionable as f, isDestructive as p, relationshipSnapshot as m } from "./decisionModel.js";
|
|
9
|
+
import { useState as h } from "react";
|
|
10
|
+
import { CheckCircle2 as g, ExternalLink as _, Gauge as v, PiggyBank as y, ShieldAlert as b, XCircle as x } from "lucide-react";
|
|
11
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { GlassCard as w } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/subscriberbot/components/decisions/DecisionCard.tsx
|
|
14
|
-
function
|
|
14
|
+
function T(e, t) {
|
|
15
15
|
return e instanceof Error && e.message ? e.message : t;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let t =
|
|
17
|
+
function E(e) {
|
|
18
|
+
let { formatCurrency: t, formatEnumLabel: r } = n(), i = m(e), a = i.amount === null ? null : `${t(i.amount, i.currency ?? e.currency)}${i.interval ? ` / ${r(i.interval).toLowerCase()}` : ""}`;
|
|
19
19
|
return {
|
|
20
|
-
label:
|
|
21
|
-
amount:
|
|
20
|
+
label: i.label ?? e.relationshipId,
|
|
21
|
+
amount: a
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
24
|
+
var D = ({ decision: e, onClose: n, onApplied: i }) => {
|
|
25
|
+
let s = t(), c = o(), [u, d] = h(!1), [f, m] = h(null), g = p(e.recommendation), _ = E(e), v = l[e.recommendation], y = !c.isPending && (!g || u);
|
|
26
|
+
return /* @__PURE__ */ S(a, {
|
|
27
|
+
title: s("decisions.apply.title", "Apply: {{action}}", { action: s(v.key, v.fallback) }),
|
|
28
|
+
description: s("decisions.apply.description", "This runs the same change you could make by hand on the relationship page."),
|
|
29
29
|
onClose: n,
|
|
30
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ C("div", {
|
|
31
31
|
className: "space-y-4",
|
|
32
32
|
"data-testid": "apply-decision-dialog",
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ C("div", {
|
|
35
35
|
className: "rounded-lg border border-border-subtle bg-bg-sunken px-4 py-3",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ S("p", {
|
|
38
38
|
className: "text-xs text-text-secondary",
|
|
39
|
-
children:
|
|
39
|
+
children: s("decisions.apply.relationship", "Subscription")
|
|
40
40
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ S("p", {
|
|
42
42
|
className: "text-sm font-semibold text-text-primary",
|
|
43
43
|
"data-testid": "confirm-label",
|
|
44
|
-
children:
|
|
44
|
+
children: _.label
|
|
45
45
|
}),
|
|
46
|
-
|
|
46
|
+
_.amount && /* @__PURE__ */ S("p", {
|
|
47
47
|
className: "text-sm tabular-nums text-text-primary",
|
|
48
48
|
"data-testid": "confirm-amount",
|
|
49
|
-
children:
|
|
49
|
+
children: _.amount
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ S("p", {
|
|
54
54
|
className: "text-sm text-text-secondary",
|
|
55
55
|
children: e.rationale
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
g && /* @__PURE__ */ C("label", {
|
|
58
58
|
className: "flex items-start gap-2.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ S("input", {
|
|
60
60
|
type: "checkbox",
|
|
61
|
-
checked:
|
|
62
|
-
onChange: (e) =>
|
|
61
|
+
checked: u,
|
|
62
|
+
onChange: (e) => d(e.target.checked),
|
|
63
63
|
className: "mt-0.5 size-4 shrink-0 rounded border-border-subtle",
|
|
64
64
|
"data-testid": "confirm-destructive"
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
label:
|
|
67
|
-
amount:
|
|
65
|
+
}), /* @__PURE__ */ S("span", { children: s("decisions.apply.acknowledgeCancel", "I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.", {
|
|
66
|
+
label: _.label,
|
|
67
|
+
amount: _.amount ? ` (${_.amount})` : ""
|
|
68
68
|
}) })]
|
|
69
69
|
}),
|
|
70
|
-
f && /* @__PURE__ */
|
|
70
|
+
f && /* @__PURE__ */ S("div", {
|
|
71
|
+
role: "alert",
|
|
71
72
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
72
73
|
children: f
|
|
73
74
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ C("div", {
|
|
75
76
|
className: "flex justify-end gap-3",
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ S("button", {
|
|
77
78
|
type: "button",
|
|
78
79
|
onClick: n,
|
|
79
80
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
80
|
-
children:
|
|
81
|
-
}), /* @__PURE__ */
|
|
81
|
+
children: s("decisions.apply.back", "Not now")
|
|
82
|
+
}), /* @__PURE__ */ S("button", {
|
|
82
83
|
type: "button",
|
|
83
84
|
onClick: () => {
|
|
84
|
-
y && (
|
|
85
|
+
y && (m(null), c.mutate(e.id, {
|
|
85
86
|
onSuccess: (e) => {
|
|
86
|
-
|
|
87
|
+
i?.(e.decision), n();
|
|
87
88
|
},
|
|
88
|
-
onError: (e) =>
|
|
89
|
+
onError: (e) => m(T(e, s("decisions.apply.error", "Could not apply this decision.")))
|
|
89
90
|
}));
|
|
90
91
|
},
|
|
91
92
|
disabled: !y,
|
|
92
93
|
"data-testid": "confirm-apply",
|
|
93
|
-
className:
|
|
94
|
-
children:
|
|
94
|
+
className: r("rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50", g ? "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover" : "bg-action-primary-bg text-action-primary-text"),
|
|
95
|
+
children: c.isPending ? s("decisions.apply.applying", "Applying…") : s("decisions.apply.submit", "Apply")
|
|
95
96
|
})]
|
|
96
97
|
})
|
|
97
98
|
]
|
|
98
99
|
})
|
|
99
100
|
});
|
|
100
|
-
},
|
|
101
|
-
let
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
title:
|
|
101
|
+
}, O = ({ decision: e, onClose: n }) => {
|
|
102
|
+
let r = t(), i = s(), [o, c] = h(""), [l, u] = h(null), d = E(e);
|
|
103
|
+
return /* @__PURE__ */ S(a, {
|
|
104
|
+
title: r("decisions.dismiss.title", "Dismiss recommendation"),
|
|
104
105
|
description: d.label,
|
|
105
|
-
onClose:
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
onSubmit: (
|
|
108
|
-
|
|
106
|
+
onClose: n,
|
|
107
|
+
children: /* @__PURE__ */ C("form", {
|
|
108
|
+
onSubmit: (t) => {
|
|
109
|
+
t.preventDefault(), u(null), i.mutate({
|
|
109
110
|
id: e.id,
|
|
110
|
-
reason:
|
|
111
|
+
reason: o
|
|
111
112
|
}, {
|
|
112
|
-
onSuccess: () =>
|
|
113
|
-
onError: (e) => u(
|
|
113
|
+
onSuccess: () => n(),
|
|
114
|
+
onError: (e) => u(T(e, r("decisions.dismiss.error", "Could not dismiss this decision.")))
|
|
114
115
|
});
|
|
115
116
|
},
|
|
116
117
|
className: "space-y-4",
|
|
117
118
|
"data-testid": "dismiss-decision-dialog",
|
|
118
119
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
120
121
|
htmlFor: `dismiss-reason-${e.id}`,
|
|
121
122
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
122
|
-
children:
|
|
123
|
-
}), /* @__PURE__ */
|
|
123
|
+
children: r("decisions.dismiss.reason", "Reason (optional)")
|
|
124
|
+
}), /* @__PURE__ */ S("textarea", {
|
|
124
125
|
id: `dismiss-reason-${e.id}`,
|
|
125
|
-
value:
|
|
126
|
-
onChange: (e) =>
|
|
126
|
+
value: o,
|
|
127
|
+
onChange: (e) => c(e.target.value),
|
|
127
128
|
rows: 3,
|
|
128
129
|
maxLength: 500,
|
|
129
|
-
placeholder:
|
|
130
|
+
placeholder: r("decisions.dismiss.placeholder", "e.g. We still use this every week"),
|
|
130
131
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
131
132
|
})] }),
|
|
132
|
-
|
|
133
|
+
l && /* @__PURE__ */ S("div", {
|
|
134
|
+
role: "alert",
|
|
133
135
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
134
|
-
children:
|
|
136
|
+
children: l
|
|
135
137
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ C("div", {
|
|
137
139
|
className: "flex justify-end gap-3",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ S("button", {
|
|
139
141
|
type: "button",
|
|
140
|
-
onClick:
|
|
142
|
+
onClick: n,
|
|
141
143
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
142
|
-
children:
|
|
143
|
-
}), /* @__PURE__ */
|
|
144
|
+
children: r("decisions.dismiss.back", "Back")
|
|
145
|
+
}), /* @__PURE__ */ S("button", {
|
|
144
146
|
type: "submit",
|
|
145
|
-
disabled:
|
|
147
|
+
disabled: i.isPending,
|
|
146
148
|
"data-testid": "confirm-dismiss",
|
|
147
149
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
148
|
-
children:
|
|
150
|
+
children: i.isPending ? r("decisions.dismiss.dismissing", "Dismissing…") : r("decisions.dismiss.submit", "Dismiss")
|
|
149
151
|
})]
|
|
150
152
|
})
|
|
151
153
|
]
|
|
152
154
|
})
|
|
153
155
|
});
|
|
154
|
-
},
|
|
155
|
-
let
|
|
156
|
-
relationship:
|
|
157
|
-
keptRelationship:
|
|
158
|
-
plan:
|
|
159
|
-
alternativePlan:
|
|
160
|
-
renewalEvent:
|
|
161
|
-
entitlement:
|
|
156
|
+
}, k = ({ decision: n, limit: r }) => {
|
|
157
|
+
let i = t(), { navigateTo: a } = e(), o = d(n), s = r ? o.slice(0, r) : o, c = {
|
|
158
|
+
relationship: i("decisions.sources.relationship", "Subscription"),
|
|
159
|
+
keptRelationship: i("decisions.sources.keptRelationship", "Keep instead"),
|
|
160
|
+
plan: i("decisions.sources.plan", "Current plan"),
|
|
161
|
+
alternativePlan: i("decisions.sources.alternativePlan", "Suggested plan"),
|
|
162
|
+
renewalEvent: i("decisions.sources.renewalEvent", "Renewal event"),
|
|
163
|
+
entitlement: i("decisions.sources.entitlement", "Entitlement usage")
|
|
162
164
|
};
|
|
163
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
164
166
|
className: "text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
165
|
-
children:
|
|
166
|
-
}), /* @__PURE__ */
|
|
167
|
+
children: i("decisions.sources.title", "Based on")
|
|
168
|
+
}), /* @__PURE__ */ C("ul", {
|
|
167
169
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
168
170
|
"data-testid": "decision-sources",
|
|
169
|
-
children: [
|
|
171
|
+
children: [s.map((e) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ C("button", {
|
|
170
172
|
type: "button",
|
|
171
|
-
onClick: () =>
|
|
173
|
+
onClick: () => a(e.path),
|
|
172
174
|
"data-source-kind": e.kind,
|
|
173
|
-
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-
|
|
175
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-start text-[11px] text-text-secondary hover:text-text-primary",
|
|
174
176
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ S("span", {
|
|
176
178
|
className: "font-medium text-text-primary",
|
|
177
179
|
children: c[e.kind]
|
|
178
180
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ S("span", {
|
|
180
182
|
className: "truncate",
|
|
181
183
|
children: e.title
|
|
182
184
|
}),
|
|
183
|
-
e.detail && /* @__PURE__ */
|
|
185
|
+
e.detail && /* @__PURE__ */ S("span", {
|
|
184
186
|
className: "tabular-nums",
|
|
185
187
|
children: e.detail
|
|
186
188
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ S(_, {
|
|
188
190
|
className: "h-3 w-3 shrink-0",
|
|
189
191
|
"aria-hidden": !0
|
|
190
192
|
})
|
|
191
193
|
]
|
|
192
|
-
}) }, `${e.kind}-${e.id}`)),
|
|
194
|
+
}) }, `${e.kind}-${e.id}`)), r && o.length > r && /* @__PURE__ */ S("li", {
|
|
193
195
|
className: "px-1 py-0.5 text-[11px] text-text-secondary",
|
|
194
|
-
children:
|
|
196
|
+
children: i("decisions.sources.more", "+{{count}} more", { count: o.length - r })
|
|
195
197
|
})]
|
|
196
198
|
})] });
|
|
197
|
-
},
|
|
198
|
-
let
|
|
199
|
-
return /* @__PURE__ */
|
|
199
|
+
}, A = ({ decision: a, hideAgent: o = !1 }) => {
|
|
200
|
+
let { formatCurrency: s, formatRelativeTime: d } = n(), m = t(), { navigateTo: _ } = e(), [T, A] = h(null), j = c[a.kind], M = l[a.recommendation], N = p(a.recommendation), P = f(a), F = E(a);
|
|
201
|
+
return /* @__PURE__ */ C(w, {
|
|
200
202
|
treatment: "metric",
|
|
201
203
|
className: "flex flex-col gap-3 p-4",
|
|
202
204
|
"data-testid": "decision-card",
|
|
203
|
-
"data-decision-id":
|
|
204
|
-
"data-recommendation":
|
|
205
|
-
"data-status":
|
|
205
|
+
"data-decision-id": a.id,
|
|
206
|
+
"data-recommendation": a.recommendation,
|
|
207
|
+
"data-status": a.status,
|
|
206
208
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ C("div", {
|
|
208
210
|
className: "flex flex-wrap items-start justify-between gap-2",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ C("div", {
|
|
210
212
|
className: "min-w-0",
|
|
211
213
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ C("p", {
|
|
213
215
|
className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
|
|
214
|
-
children: [
|
|
216
|
+
children: [m(j.key, j.fallback), !o && a.agent ? ` · ${a.agent.name}` : ""]
|
|
215
217
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ C("button", {
|
|
217
219
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
className: "mt-0.5 flex items-center gap-1.5 text-
|
|
220
|
+
onClick: () => _(`/decisions/${a.id}`),
|
|
221
|
+
className: "mt-0.5 flex items-center gap-1.5 text-start text-sm font-semibold text-text-primary hover:underline",
|
|
220
222
|
children: [
|
|
221
|
-
|
|
223
|
+
N && /* @__PURE__ */ S(b, {
|
|
222
224
|
className: "h-4 w-4 shrink-0 text-status-error-text",
|
|
223
225
|
"aria-hidden": !0
|
|
224
226
|
}),
|
|
225
|
-
|
|
227
|
+
m(M.key, M.fallback),
|
|
226
228
|
": ",
|
|
227
|
-
|
|
229
|
+
F.label
|
|
228
230
|
]
|
|
229
231
|
}),
|
|
230
|
-
|
|
232
|
+
F.amount && /* @__PURE__ */ S("p", {
|
|
231
233
|
className: "text-xs tabular-nums text-text-secondary",
|
|
232
|
-
children:
|
|
234
|
+
children: F.amount
|
|
233
235
|
})
|
|
234
236
|
]
|
|
235
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ S(i, { status: a.status })]
|
|
236
238
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ S("p", {
|
|
238
240
|
className: "text-sm text-text-secondary",
|
|
239
|
-
children:
|
|
241
|
+
children: a.rationale
|
|
240
242
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ C("div", {
|
|
242
244
|
className: "flex flex-wrap gap-2 text-xs",
|
|
243
245
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ C("span", {
|
|
245
247
|
className: "inline-flex items-center gap-1.5 rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ S(v, {
|
|
247
249
|
className: "h-3.5 w-3.5",
|
|
248
250
|
"aria-hidden": !0
|
|
249
|
-
}),
|
|
251
|
+
}), m("decisions.card.confidence", "Confidence {{pct}}%", { pct: u(a.confidence) })]
|
|
250
252
|
}),
|
|
251
|
-
|
|
253
|
+
a.estimatedSavings > 0 && /* @__PURE__ */ C("span", {
|
|
252
254
|
className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-2 py-0.5 font-medium text-status-success-text tabular-nums",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ S(y, {
|
|
254
256
|
className: "h-3.5 w-3.5",
|
|
255
257
|
"aria-hidden": !0
|
|
256
|
-
}),
|
|
258
|
+
}), m("decisions.card.savings", "Saves {{amount}} a year", { amount: s(a.estimatedSavings, a.currency) })]
|
|
257
259
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ S("span", {
|
|
259
261
|
className: "inline-flex items-center rounded-md bg-bg-sunken px-2 py-0.5 text-text-secondary",
|
|
260
|
-
children:
|
|
262
|
+
children: d(a.createdAt)
|
|
261
263
|
})
|
|
262
264
|
]
|
|
263
265
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
decision:
|
|
266
|
+
/* @__PURE__ */ S(k, {
|
|
267
|
+
decision: a,
|
|
266
268
|
limit: 4
|
|
267
269
|
}),
|
|
268
|
-
|
|
270
|
+
a.status === "FLAGGED" && a.validationErrors.length > 0 && /* @__PURE__ */ C("p", {
|
|
269
271
|
className: "rounded-md bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
270
272
|
children: [
|
|
271
|
-
|
|
273
|
+
m("decisions.card.flagged", "Held back: failed validation"),
|
|
272
274
|
" —",
|
|
273
275
|
" ",
|
|
274
|
-
|
|
276
|
+
a.validationErrors.join("; ")
|
|
275
277
|
]
|
|
276
278
|
}),
|
|
277
|
-
|
|
279
|
+
a.status === "DISMISSED" && a.dismissedReason && /* @__PURE__ */ S("p", {
|
|
278
280
|
className: "text-xs text-text-secondary",
|
|
279
|
-
children:
|
|
281
|
+
children: m("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason: a.dismissedReason })
|
|
280
282
|
}),
|
|
281
|
-
|
|
283
|
+
P && /* @__PURE__ */ C("div", {
|
|
282
284
|
className: "flex flex-wrap justify-end gap-2 border-t border-border-subtle pt-3",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ C("button", {
|
|
284
286
|
type: "button",
|
|
285
|
-
onClick: () =>
|
|
287
|
+
onClick: () => A("dismiss"),
|
|
286
288
|
"data-testid": "dismiss-decision",
|
|
287
289
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ S(x, {
|
|
289
291
|
className: "h-3.5 w-3.5",
|
|
290
292
|
"aria-hidden": !0
|
|
291
|
-
}),
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), m("decisions.card.dismiss", "Dismiss")]
|
|
294
|
+
}), /* @__PURE__ */ C("button", {
|
|
293
295
|
type: "button",
|
|
294
|
-
onClick: () =>
|
|
296
|
+
onClick: () => A("apply"),
|
|
295
297
|
"data-testid": "apply-decision",
|
|
296
|
-
className:
|
|
297
|
-
children: [/* @__PURE__ */
|
|
298
|
+
className: r("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90", N ? "border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text" : "bg-action-primary-bg text-action-primary-text"),
|
|
299
|
+
children: [/* @__PURE__ */ S(g, {
|
|
298
300
|
className: "h-3.5 w-3.5",
|
|
299
301
|
"aria-hidden": !0
|
|
300
|
-
}),
|
|
302
|
+
}), m("decisions.card.apply", "Review and apply")]
|
|
301
303
|
})]
|
|
302
304
|
}),
|
|
303
|
-
|
|
304
|
-
decision:
|
|
305
|
-
onClose: () =>
|
|
305
|
+
T === "apply" && /* @__PURE__ */ S(D, {
|
|
306
|
+
decision: a,
|
|
307
|
+
onClose: () => A(null)
|
|
306
308
|
}),
|
|
307
|
-
|
|
308
|
-
decision:
|
|
309
|
-
onClose: () =>
|
|
309
|
+
T === "dismiss" && /* @__PURE__ */ S(O, {
|
|
310
|
+
decision: a,
|
|
311
|
+
onClose: () => A(null)
|
|
310
312
|
})
|
|
311
313
|
]
|
|
312
314
|
});
|
|
313
315
|
};
|
|
314
316
|
//#endregion
|
|
315
|
-
export {
|
|
317
|
+
export { D as ApplyDecisionDialog, A as DecisionCard, k as DecisionSources, O as DismissDecisionDialog };
|
|
316
318
|
|
|
317
319
|
//# sourceMappingURL=DecisionCard.js.map
|