@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.
Files changed (206) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/stories/Accessibility.stories.d.ts +13 -0
  3. package/dist/stories/Accessibility.stories.d.ts.map +1 -0
  4. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
  6. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
  7. package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
  8. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
  9. package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
  10. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  11. package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
  12. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  13. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
  15. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  16. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
  17. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
  18. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  19. package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
  20. package/dist/subscriberbot/components/Modal.js +43 -33
  21. package/dist/subscriberbot/components/Modal.js.map +1 -1
  22. package/dist/subscriberbot/components/PageLayout.d.ts +6 -0
  23. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
  24. package/dist/subscriberbot/components/PageLayout.js +2 -1
  25. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  26. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
  27. package/dist/subscriberbot/components/PostureOptions.js +10 -10
  28. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  29. package/dist/subscriberbot/components/StateViews.d.ts +2 -0
  30. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  31. package/dist/subscriberbot/components/StateViews.js +46 -37
  32. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  33. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
  34. package/dist/subscriberbot/components/StatusBadge.js +6 -6
  35. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  36. package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
  37. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
  38. package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
  39. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  40. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  41. package/dist/subscriberbot/components/mobile/MobileDashboard.js +143 -135
  42. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  43. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
  44. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
  45. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  46. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +3 -0
  47. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
  48. package/dist/subscriberbot/components/mobile/MobileScreen.js +5 -3
  49. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  50. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
  51. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
  52. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
  53. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  54. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
  55. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
  56. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  57. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
  58. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
  59. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  60. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
  61. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
  62. package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
  63. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  64. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
  65. package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
  66. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  67. package/dist/subscriberbot/components/viz.d.ts +1 -0
  68. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  69. package/dist/subscriberbot/components/viz.js +100 -101
  70. package/dist/subscriberbot/components/viz.js.map +1 -1
  71. package/dist/subscriberbot/hooks/index.js +1 -1
  72. package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
  73. package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
  74. package/dist/subscriberbot/hooks/useFormError.js +28 -0
  75. package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
  76. package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
  77. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
  78. package/dist/subscriberbot/hooks/useFormatters.js +13 -0
  79. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
  80. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  81. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
  82. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  83. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
  84. package/dist/subscriberbot/hooks/useTr.js +1 -1
  85. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  86. package/dist/subscriberbot/index.js +1 -1
  87. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  88. package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
  89. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  90. package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
  91. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  92. package/dist/subscriberbot/pages/DashboardPage.js +115 -98
  93. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  94. package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
  95. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  96. package/dist/subscriberbot/pages/InboxPage.js +421 -402
  97. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  98. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  99. package/dist/subscriberbot/pages/InsightsPage.js +130 -121
  100. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  101. package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
  102. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  103. package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
  104. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  105. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
  106. package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
  107. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  108. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
  109. package/dist/subscriberbot/pages/SavingsPage.js +57 -57
  110. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  111. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
  112. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  113. package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
  114. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
  116. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
  118. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  119. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
  120. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  121. package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
  122. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  123. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
  124. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  125. package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
  126. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  127. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
  128. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  129. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +272 -260
  130. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  131. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
  132. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
  133. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
  134. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  135. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
  136. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
  137. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
  138. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  139. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
  140. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
  141. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
  142. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  143. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
  144. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
  145. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
  146. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  147. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
  148. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
  149. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
  150. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  151. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
  152. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
  153. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
  154. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  155. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
  156. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
  157. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
  158. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  159. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
  160. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
  161. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
  162. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  163. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
  164. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
  165. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
  166. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  167. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
  168. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  169. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
  170. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  171. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
  172. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  173. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
  174. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  175. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
  176. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  177. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
  178. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  179. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
  180. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  181. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
  182. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  183. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
  184. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  185. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +112 -91
  186. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  187. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
  188. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  189. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
  190. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  191. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
  192. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
  193. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  194. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
  195. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
  196. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
  197. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  198. package/dist/subscriberbot/utils/formatters.d.ts +16 -5
  199. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
  200. package/dist/subscriberbot/utils/formatters.js +57 -25
  201. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  202. package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
  203. package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
  204. package/dist/subscriberbot/utils/plaidLink.js +21 -21
  205. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  206. 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';\nimport { formatEnumLabel } from '../utils/formatters';\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 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,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
+ {"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 { cn as t } from "../../utils/cn.js";
3
- import { useTr as n } from "../../hooks/useTr.js";
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 = n();
8
+ let r = t();
9
9
  return /* @__PURE__ */ o("div", {
10
10
  role: "note",
11
11
  "data-testid": "ai-disclaimer",
12
- className: t("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),
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 = n(), { navigateTo: u } = e();
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: t("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),
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":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAU1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA6B/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,CA0GA,CAAC;AAMF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA4EpF,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,CAoHA,CAAC"}
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 { cn as t } from "../../utils/cn.js";
3
- import { formatCurrency as n, formatEnumLabel as r, formatRelativeTime as i } from "../../utils/formatters.js";
4
- import { StatusBadge as a } from "../StatusBadge.js";
5
- import { Modal as o } from "../Modal.js";
6
- import { useTr as s } from "../../hooks/useTr.js";
7
- import { useApplyDecision as c, useDismissDecision as l } from "../../hooks/useSubscriberBotApi.js";
8
- import { DECISION_KIND_LABEL as u, RECOMMENDATION_LABEL as d, confidencePercent as f, evidenceSources as p, isActionable as m, isDestructive as h, relationshipSnapshot as g } from "./decisionModel.js";
9
- import { useState as _ } from "react";
10
- import { CheckCircle2 as v, ExternalLink as y, Gauge as b, PiggyBank as x, ShieldAlert as S, XCircle as C } from "lucide-react";
11
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
12
- import { GlassCard as E } from "@burdenoff/fe-libs/ui";
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 D(e, t) {
14
+ function T(e, t) {
15
15
  return e instanceof Error && e.message ? e.message : t;
16
16
  }
17
- function O(e) {
18
- let t = g(e), i = t.amount === null ? null : `${n(t.amount, t.currency ?? e.currency)}${t.interval ? ` / ${r(t.interval).toLowerCase()}` : ""}`;
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: t.label ?? e.relationshipId,
21
- amount: i
20
+ label: i.label ?? e.relationshipId,
21
+ amount: a
22
22
  };
23
23
  }
24
- var k = ({ decision: e, onClose: n, onApplied: r }) => {
25
- let i = s(), a = c(), [l, u] = _(!1), [f, p] = _(null), m = h(e.recommendation), g = O(e), v = d[e.recommendation], y = !a.isPending && (!m || l);
26
- return /* @__PURE__ */ w(o, {
27
- title: i("decisions.apply.title", "Apply: {{action}}", { action: i(v.key, v.fallback) }),
28
- description: i("decisions.apply.description", "This runs the same change you could make by hand on the relationship page."),
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__ */ T("div", {
30
+ children: /* @__PURE__ */ C("div", {
31
31
  className: "space-y-4",
32
32
  "data-testid": "apply-decision-dialog",
33
33
  children: [
34
- /* @__PURE__ */ T("div", {
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__ */ w("p", {
37
+ /* @__PURE__ */ S("p", {
38
38
  className: "text-xs text-text-secondary",
39
- children: i("decisions.apply.relationship", "Subscription")
39
+ children: s("decisions.apply.relationship", "Subscription")
40
40
  }),
41
- /* @__PURE__ */ w("p", {
41
+ /* @__PURE__ */ S("p", {
42
42
  className: "text-sm font-semibold text-text-primary",
43
43
  "data-testid": "confirm-label",
44
- children: g.label
44
+ children: _.label
45
45
  }),
46
- g.amount && /* @__PURE__ */ w("p", {
46
+ _.amount && /* @__PURE__ */ S("p", {
47
47
  className: "text-sm tabular-nums text-text-primary",
48
48
  "data-testid": "confirm-amount",
49
- children: g.amount
49
+ children: _.amount
50
50
  })
51
51
  ]
52
52
  }),
53
- /* @__PURE__ */ w("p", {
53
+ /* @__PURE__ */ S("p", {
54
54
  className: "text-sm text-text-secondary",
55
55
  children: e.rationale
56
56
  }),
57
- m && /* @__PURE__ */ T("label", {
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__ */ w("input", {
59
+ children: [/* @__PURE__ */ S("input", {
60
60
  type: "checkbox",
61
- checked: l,
62
- onChange: (e) => u(e.target.checked),
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__ */ w("span", { children: i("decisions.apply.acknowledgeCancel", "I want to cancel \"{{label}}\"{{amount}}. I understand the subscription will stop.", {
66
- label: g.label,
67
- amount: g.amount ? ` (${g.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__ */ w("div", {
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__ */ T("div", {
75
+ /* @__PURE__ */ C("div", {
75
76
  className: "flex justify-end gap-3",
76
- children: [/* @__PURE__ */ w("button", {
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: i("decisions.apply.back", "Not now")
81
- }), /* @__PURE__ */ w("button", {
81
+ children: s("decisions.apply.back", "Not now")
82
+ }), /* @__PURE__ */ S("button", {
82
83
  type: "button",
83
84
  onClick: () => {
84
- y && (p(null), a.mutate(e.id, {
85
+ y && (m(null), c.mutate(e.id, {
85
86
  onSuccess: (e) => {
86
- r?.(e.decision), n();
87
+ i?.(e.decision), n();
87
88
  },
88
- onError: (e) => p(D(e, i("decisions.apply.error", "Could not apply this decision.")))
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: t("rounded-lg px-4 py-2 text-sm font-medium hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50", m ? "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bg-hover" : "bg-action-primary-bg text-action-primary-text"),
94
- children: a.isPending ? i("decisions.apply.applying", "Applying…") : i("decisions.apply.submit", "Apply")
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
- }, A = ({ decision: e, onClose: t }) => {
101
- let n = s(), r = l(), [i, a] = _(""), [c, u] = _(null), d = O(e);
102
- return /* @__PURE__ */ w(o, {
103
- title: n("decisions.dismiss.title", "Dismiss recommendation"),
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: t,
106
- children: /* @__PURE__ */ T("form", {
107
- onSubmit: (a) => {
108
- a.preventDefault(), u(null), r.mutate({
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: i
111
+ reason: o
111
112
  }, {
112
- onSuccess: () => t(),
113
- onError: (e) => u(D(e, n("decisions.dismiss.error", "Could not dismiss this decision.")))
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__ */ T("div", { children: [/* @__PURE__ */ w("label", {
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: n("decisions.dismiss.reason", "Reason (optional)")
123
- }), /* @__PURE__ */ w("textarea", {
123
+ children: r("decisions.dismiss.reason", "Reason (optional)")
124
+ }), /* @__PURE__ */ S("textarea", {
124
125
  id: `dismiss-reason-${e.id}`,
125
- value: i,
126
- onChange: (e) => a(e.target.value),
126
+ value: o,
127
+ onChange: (e) => c(e.target.value),
127
128
  rows: 3,
128
129
  maxLength: 500,
129
- placeholder: n("decisions.dismiss.placeholder", "e.g. We still use this every week"),
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
- c && /* @__PURE__ */ w("div", {
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: c
136
+ children: l
135
137
  }),
136
- /* @__PURE__ */ T("div", {
138
+ /* @__PURE__ */ C("div", {
137
139
  className: "flex justify-end gap-3",
138
- children: [/* @__PURE__ */ w("button", {
140
+ children: [/* @__PURE__ */ S("button", {
139
141
  type: "button",
140
- onClick: t,
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: n("decisions.dismiss.back", "Back")
143
- }), /* @__PURE__ */ w("button", {
144
+ children: r("decisions.dismiss.back", "Back")
145
+ }), /* @__PURE__ */ S("button", {
144
146
  type: "submit",
145
- disabled: r.isPending,
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: r.isPending ? n("decisions.dismiss.dismissing", "Dismissing…") : n("decisions.dismiss.submit", "Dismiss")
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
- }, j = ({ decision: t, limit: n }) => {
155
- let r = s(), { navigateTo: i } = e(), a = p(t), o = n ? a.slice(0, n) : a, c = {
156
- relationship: r("decisions.sources.relationship", "Subscription"),
157
- keptRelationship: r("decisions.sources.keptRelationship", "Keep instead"),
158
- plan: r("decisions.sources.plan", "Current plan"),
159
- alternativePlan: r("decisions.sources.alternativePlan", "Suggested plan"),
160
- renewalEvent: r("decisions.sources.renewalEvent", "Renewal event"),
161
- entitlement: r("decisions.sources.entitlement", "Entitlement usage")
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__ */ T("div", { children: [/* @__PURE__ */ w("p", {
165
+ return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
164
166
  className: "text-[10px] font-medium uppercase tracking-wide text-text-secondary",
165
- children: r("decisions.sources.title", "Based on")
166
- }), /* @__PURE__ */ T("ul", {
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: [o.map((e) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("button", {
171
+ children: [s.map((e) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ C("button", {
170
172
  type: "button",
171
- onClick: () => i(e.path),
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-left text-[11px] text-text-secondary hover:text-text-primary",
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__ */ w("span", {
177
+ /* @__PURE__ */ S("span", {
176
178
  className: "font-medium text-text-primary",
177
179
  children: c[e.kind]
178
180
  }),
179
- /* @__PURE__ */ w("span", {
181
+ /* @__PURE__ */ S("span", {
180
182
  className: "truncate",
181
183
  children: e.title
182
184
  }),
183
- e.detail && /* @__PURE__ */ w("span", {
185
+ e.detail && /* @__PURE__ */ S("span", {
184
186
  className: "tabular-nums",
185
187
  children: e.detail
186
188
  }),
187
- /* @__PURE__ */ w(y, {
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}`)), n && a.length > n && /* @__PURE__ */ w("li", {
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: r("decisions.sources.more", "+{{count}} more", { count: a.length - n })
196
+ children: i("decisions.sources.more", "+{{count}} more", { count: o.length - r })
195
197
  })]
196
198
  })] });
197
- }, M = ({ decision: r, hideAgent: o = !1 }) => {
198
- let c = s(), { navigateTo: l } = e(), [p, g] = _(null), y = u[r.kind], D = d[r.recommendation], M = h(r.recommendation), N = m(r), P = O(r);
199
- return /* @__PURE__ */ T(E, {
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": r.id,
204
- "data-recommendation": r.recommendation,
205
- "data-status": r.status,
205
+ "data-decision-id": a.id,
206
+ "data-recommendation": a.recommendation,
207
+ "data-status": a.status,
206
208
  children: [
207
- /* @__PURE__ */ T("div", {
209
+ /* @__PURE__ */ C("div", {
208
210
  className: "flex flex-wrap items-start justify-between gap-2",
209
- children: [/* @__PURE__ */ T("div", {
211
+ children: [/* @__PURE__ */ C("div", {
210
212
  className: "min-w-0",
211
213
  children: [
212
- /* @__PURE__ */ T("p", {
214
+ /* @__PURE__ */ C("p", {
213
215
  className: "text-[11px] font-medium uppercase tracking-wide text-text-secondary",
214
- children: [c(y.key, y.fallback), !o && r.agent ? ` · ${r.agent.name}` : ""]
216
+ children: [m(j.key, j.fallback), !o && a.agent ? ` · ${a.agent.name}` : ""]
215
217
  }),
216
- /* @__PURE__ */ T("button", {
218
+ /* @__PURE__ */ C("button", {
217
219
  type: "button",
218
- onClick: () => l(`/decisions/${r.id}`),
219
- className: "mt-0.5 flex items-center gap-1.5 text-left text-sm font-semibold text-text-primary hover:underline",
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
- M && /* @__PURE__ */ w(S, {
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
- c(D.key, D.fallback),
227
+ m(M.key, M.fallback),
226
228
  ": ",
227
- P.label
229
+ F.label
228
230
  ]
229
231
  }),
230
- P.amount && /* @__PURE__ */ w("p", {
232
+ F.amount && /* @__PURE__ */ S("p", {
231
233
  className: "text-xs tabular-nums text-text-secondary",
232
- children: P.amount
234
+ children: F.amount
233
235
  })
234
236
  ]
235
- }), /* @__PURE__ */ w(a, { status: r.status })]
237
+ }), /* @__PURE__ */ S(i, { status: a.status })]
236
238
  }),
237
- /* @__PURE__ */ w("p", {
239
+ /* @__PURE__ */ S("p", {
238
240
  className: "text-sm text-text-secondary",
239
- children: r.rationale
241
+ children: a.rationale
240
242
  }),
241
- /* @__PURE__ */ T("div", {
243
+ /* @__PURE__ */ C("div", {
242
244
  className: "flex flex-wrap gap-2 text-xs",
243
245
  children: [
244
- /* @__PURE__ */ T("span", {
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__ */ w(b, {
248
+ children: [/* @__PURE__ */ S(v, {
247
249
  className: "h-3.5 w-3.5",
248
250
  "aria-hidden": !0
249
- }), c("decisions.card.confidence", "Confidence {{pct}}%", { pct: f(r.confidence) })]
251
+ }), m("decisions.card.confidence", "Confidence {{pct}}%", { pct: u(a.confidence) })]
250
252
  }),
251
- r.estimatedSavings > 0 && /* @__PURE__ */ T("span", {
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__ */ w(x, {
255
+ children: [/* @__PURE__ */ S(y, {
254
256
  className: "h-3.5 w-3.5",
255
257
  "aria-hidden": !0
256
- }), c("decisions.card.savings", "Saves {{amount}} a year", { amount: n(r.estimatedSavings, r.currency) })]
258
+ }), m("decisions.card.savings", "Saves {{amount}} a year", { amount: s(a.estimatedSavings, a.currency) })]
257
259
  }),
258
- /* @__PURE__ */ w("span", {
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: i(r.createdAt)
262
+ children: d(a.createdAt)
261
263
  })
262
264
  ]
263
265
  }),
264
- /* @__PURE__ */ w(j, {
265
- decision: r,
266
+ /* @__PURE__ */ S(k, {
267
+ decision: a,
266
268
  limit: 4
267
269
  }),
268
- r.status === "FLAGGED" && r.validationErrors.length > 0 && /* @__PURE__ */ T("p", {
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
- c("decisions.card.flagged", "Held back: failed validation"),
273
+ m("decisions.card.flagged", "Held back: failed validation"),
272
274
  " —",
273
275
  " ",
274
- r.validationErrors.join("; ")
276
+ a.validationErrors.join("; ")
275
277
  ]
276
278
  }),
277
- r.status === "DISMISSED" && r.dismissedReason && /* @__PURE__ */ w("p", {
279
+ a.status === "DISMISSED" && a.dismissedReason && /* @__PURE__ */ S("p", {
278
280
  className: "text-xs text-text-secondary",
279
- children: c("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason: r.dismissedReason })
281
+ children: m("decisions.card.dismissedReason", "Dismissed: {{reason}}", { reason: a.dismissedReason })
280
282
  }),
281
- N && /* @__PURE__ */ T("div", {
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__ */ T("button", {
285
+ children: [/* @__PURE__ */ C("button", {
284
286
  type: "button",
285
- onClick: () => g("dismiss"),
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__ */ w(C, {
290
+ children: [/* @__PURE__ */ S(x, {
289
291
  className: "h-3.5 w-3.5",
290
292
  "aria-hidden": !0
291
- }), c("decisions.card.dismiss", "Dismiss")]
292
- }), /* @__PURE__ */ T("button", {
293
+ }), m("decisions.card.dismiss", "Dismiss")]
294
+ }), /* @__PURE__ */ C("button", {
293
295
  type: "button",
294
- onClick: () => g("apply"),
296
+ onClick: () => A("apply"),
295
297
  "data-testid": "apply-decision",
296
- className: t("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium hover:opacity-90", M ? "border border-status-error-text/40 bg-status-error-bg-subtle text-status-error-text" : "bg-action-primary-bg text-action-primary-text"),
297
- children: [/* @__PURE__ */ w(v, {
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
- }), c("decisions.card.apply", "Review and apply")]
302
+ }), m("decisions.card.apply", "Review and apply")]
301
303
  })]
302
304
  }),
303
- p === "apply" && /* @__PURE__ */ w(k, {
304
- decision: r,
305
- onClose: () => g(null)
305
+ T === "apply" && /* @__PURE__ */ S(D, {
306
+ decision: a,
307
+ onClose: () => A(null)
306
308
  }),
307
- p === "dismiss" && /* @__PURE__ */ w(A, {
308
- decision: r,
309
- onClose: () => g(null)
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 { k as ApplyDecisionDialog, M as DecisionCard, j as DecisionSources, A as DismissDecisionDialog };
317
+ export { D as ApplyDecisionDialog, A as DecisionCard, k as DecisionSources, O as DismissDecisionDialog };
316
318
 
317
319
  //# sourceMappingURL=DecisionCard.js.map