@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.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/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +4 -2
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/stories/Accessibility.stories.d.ts +2 -4
- package/dist/stories/EmptyState.stories.d.ts +0 -2
- package/dist/stories/MetricsCard.stories.d.ts +0 -2
- package/dist/stories/StatusBadge.stories.d.ts +0 -2
- package/dist/stories/pages/AgentDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/AgentsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/AssetVaultPage.stories.d.ts +0 -2
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/DashboardPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/DecisionsPage.stories.d.ts +0 -2
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxPage.stories.d.ts +0 -2
- package/dist/stories/pages/InboxReadState.stories.d.ts +1 -3
- package/dist/stories/pages/InsightsPage.stories.d.ts +0 -2
- package/dist/stories/pages/InvoicesPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/NegotiationsPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProcurementPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProviderNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/ProvidersListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts +0 -2
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +0 -2
- package/dist/stories/pages/RenewalsPage.stories.d.ts +0 -2
- package/dist/stories/pages/SavingsPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +0 -2
- package/dist/stories/pages/WorkflowsPage.stories.d.ts +0 -2
- package/dist/stories/support/PageHarness.d.ts +0 -2
- package/dist/stories/support/bankingFixtures.d.ts +0 -2
- package/dist/stories/support/fixtures.d.ts +0 -2
- package/dist/stories/support/graphqlMock.d.ts +0 -2
- package/dist/stories/support/handlers.d.ts +0 -2
- package/dist/stories/support/negotiationFixtures.d.ts +0 -2
- package/dist/stories/support/phoneViewport.d.ts +0 -2
- package/dist/stories/support/play.d.ts +0 -2
- package/dist/stories/support/procurementFixtures.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts +0 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts +0 -2
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts +0 -2
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.d.ts +0 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.d.ts +0 -2
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts +0 -2
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts +0 -2
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts +0 -2
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +1 -3
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts +0 -2
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts +0 -2
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts +0 -2
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.d.ts +0 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.d.ts +0 -1
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +0 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.d.ts +0 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts +0 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.d.ts +0 -2
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.d.ts +0 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.d.ts +0 -2
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts +0 -2
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.d.ts +0 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.d.ts +0 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +0 -2
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts +0 -2
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.d.ts +0 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.d.ts +0 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +0 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts +0 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +0 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts +0 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.d.ts +0 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts +0 -2
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +1 -2
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +1 -2
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts +0 -2
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts +1 -3
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +1 -2
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +1 -2
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +1 -2
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts +2 -3
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +1 -2
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +1 -3
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +0 -2
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.d.ts +0 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts +1 -3
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/types/assistant.d.ts +0 -2
- package/dist/subscriberbot/types/banking.d.ts +0 -2
- package/dist/subscriberbot/types/index.d.ts +0 -2
- package/dist/subscriberbot/types/negotiation.d.ts +0 -2
- package/dist/subscriberbot/types/procurement.d.ts +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts +0 -2
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.d.ts +0 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.d.ts +0 -2
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +0 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/index.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts +0 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts +0 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +0 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +0 -2
- package/dist/subscriberbot/utils/portfolio.js +5 -6
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.d.ts +0 -2
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +73 -56
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/stories/Accessibility.stories.d.ts.map +0 -1
- package/dist/stories/EmptyState.stories.d.ts.map +0 -1
- package/dist/stories/MetricsCard.stories.d.ts.map +0 -1
- package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AgentsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/AssetVaultPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/DecisionsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InboxReadState.stories.d.ts.map +0 -1
- package/dist/stories/pages/InsightsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/InvoicesPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/NegotiationsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProcurementPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProviderNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/ProvidersListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipDetailPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipNewPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/RenewalsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/SavingsPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +0 -1
- package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +0 -1
- package/dist/stories/support/PageHarness.d.ts.map +0 -1
- package/dist/stories/support/bankingFixtures.d.ts.map +0 -1
- package/dist/stories/support/fixtures.d.ts.map +0 -1
- package/dist/stories/support/graphqlMock.d.ts.map +0 -1
- package/dist/stories/support/handlers.d.ts.map +0 -1
- package/dist/stories/support/negotiationFixtures.d.ts.map +0 -1
- package/dist/stories/support/phoneViewport.d.ts.map +0 -1
- package/dist/stories/support/play.d.ts.map +0 -1
- package/dist/stories/support/procurementFixtures.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +0 -1
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/admin/AdminRoot.d.ts.map +0 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +0 -1
- package/dist/subscriberbot/admin/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/EmptyState.d.ts.map +0 -1
- package/dist/subscriberbot/components/MetricsCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +0 -1
- package/dist/subscriberbot/components/PageLayout.d.ts.map +0 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +0 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +0 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/decisions/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +0 -1
- package/dist/subscriberbot/components/mobile/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/negotiations/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/procurement/labels.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/index.d.ts.map +0 -1
- package/dist/subscriberbot/components/savings/savingsModel.d.ts.map +0 -1
- package/dist/subscriberbot/components/viz.d.ts.map +0 -1
- package/dist/subscriberbot/config/assistantUsecases.d.ts.map +0 -1
- package/dist/subscriberbot/context/SubscriberBotContext.d.ts.map +0 -1
- package/dist/subscriberbot/context/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/index.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useBankingApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useProcurementApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +0 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +0 -1
- package/dist/subscriberbot/index.d.ts.map +0 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InsightsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +0 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +0 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts.map +0 -1
- package/dist/subscriberbot/store/index.d.ts.map +0 -1
- package/dist/subscriberbot/store/subscriberbotStore.d.ts.map +0 -1
- package/dist/subscriberbot/types/assistant.d.ts.map +0 -1
- package/dist/subscriberbot/types/banking.d.ts.map +0 -1
- package/dist/subscriberbot/types/index.d.ts.map +0 -1
- package/dist/subscriberbot/types/negotiation.d.ts.map +0 -1
- package/dist/subscriberbot/types/procurement.d.ts.map +0 -1
- package/dist/subscriberbot/utils/bankRedirectLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/chartScale.d.ts.map +0 -1
- package/dist/subscriberbot/utils/cn.d.ts.map +0 -1
- package/dist/subscriberbot/utils/formatters.d.ts.map +0 -1
- package/dist/subscriberbot/utils/index.d.ts.map +0 -1
- package/dist/subscriberbot/utils/navigation.d.ts.map +0 -1
- package/dist/subscriberbot/utils/pageContext.d.ts.map +0 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +0 -1
- package/dist/subscriberbot/utils/portfolio.d.ts.map +0 -1
- package/dist/subscriberbot/utils/renewals.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisionModel.js","names":[],"sources":["../../../../src/subscriberbot/components/decisions/decisionModel.ts"],"sourcesContent":["/**\n * Decision view-model helpers\n * @module subscriberbot/components/decisions\n *\n * Pure functions that turn a `SubDecision` (as returned by the BOFF-3634\n * decision engine) into what the decision cards render: whether applying it is\n * destructive, which source rows it reasoned over, and the labels for its\n * enums. `evidence` is `JSON!` on the svc contract, so every read here is\n * defensive: a missing or malformed field yields nothing rather than a guess.\n */\n\nimport type {\n SubAgentKind,\n SubDecision,\n SubDecisionKind,\n SubDecisionRecommendation,\n SubDecisionStatus,\n} from '../../types';\n\n/** Agent kinds the decision engine implements; the rest are refused server-side. */\nexport const RUNNABLE_AGENT_KINDS: ReadonlySet<SubAgentKind> = new Set<SubAgentKind>([\n 'COST',\n 'RENEWAL',\n 'VENDOR',\n 'DISCOVERY',\n]);\n\nexport const DECISION_KINDS: SubDecisionKind[] = [\n 'CANCEL_CANDIDATE',\n 'RENEWAL_TRIAGE',\n 'PLAN_RIGHT_SIZE',\n 'TRIAL_EXPIRY',\n 'CONSOLIDATE_OVERLAP',\n];\n\nexport const DECISION_STATUSES: SubDecisionStatus[] = [\n 'PROPOSED',\n 'APPLIED',\n 'DISMISSED',\n 'STALE',\n 'FLAGGED',\n 'APPLYING',\n];\n\nexport const DECISION_KIND_LABEL: Record<SubDecisionKind, { key: string; fallback: string }> = {\n CANCEL_CANDIDATE: { key: 'decisions.kinds.cancelCandidate', fallback: 'Cancel candidate' },\n RENEWAL_TRIAGE: { key: 'decisions.kinds.renewalTriage', fallback: 'Renewal triage' },\n PLAN_RIGHT_SIZE: { key: 'decisions.kinds.planRightSize', fallback: 'Plan right-sizing' },\n TRIAL_EXPIRY: { key: 'decisions.kinds.trialExpiry', fallback: 'Trial expiry' },\n CONSOLIDATE_OVERLAP: {\n key: 'decisions.kinds.consolidateOverlap',\n fallback: 'Overlap consolidation',\n },\n};\n\nexport const RECOMMENDATION_LABEL: Record<\n SubDecisionRecommendation,\n { key: string; fallback: string }\n> = {\n CANCEL: { key: 'decisions.recommendations.cancel', fallback: 'Cancel subscription' },\n PAUSE: { key: 'decisions.recommendations.pause', fallback: 'Pause subscription' },\n RENEW: { key: 'decisions.recommendations.renew', fallback: 'Let it renew' },\n DOWNGRADE: { key: 'decisions.recommendations.downgrade', fallback: 'Downgrade plan' },\n SWITCH_TO_ANNUAL: {\n key: 'decisions.recommendations.switchToAnnual',\n fallback: 'Switch to annual billing',\n },\n CONVERT_TRIAL: { key: 'decisions.recommendations.convertTrial', fallback: 'Keep after trial' },\n};\n\n/**\n * Recommendations whose apply ends a paid relationship. These need an\n * explicit, acknowledged confirmation that names the relationship and amount.\n */\nexport function isDestructive(recommendation: SubDecisionRecommendation): boolean {\n return recommendation === 'CANCEL';\n}\n\n/** Only PROPOSED decisions can be applied or dismissed. */\nexport function isActionable(decision: Pick<SubDecision, 'status'>): boolean {\n return decision.status === 'PROPOSED';\n}\n\n/** Confidence (0..1) as a whole percentage, clamped. */\nexport function confidencePercent(confidence: number): number {\n if (!Number.isFinite(confidence)) return 0;\n return Math.round(Math.min(1, Math.max(0, confidence)) * 100);\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction asString(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null;\n}\n\nfunction asNumber(value: unknown): number | null {\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\n/** The relationship facts a decision was made against (its evidence snapshot). */\nexport interface RelationshipSnapshot {\n id: string;\n label: string | null;\n status: string | null;\n amount: number | null;\n currency: string | null;\n interval: string | null;\n providerId: string | null;\n planId: string | null;\n}\n\nexport function relationshipSnapshot(decision: SubDecision): RelationshipSnapshot {\n const snap = asRecord(asRecord(decision.evidence)?.relationship);\n const live = decision.relationship ?? null;\n return {\n id: asString(snap?.id) ?? decision.relationshipId,\n label: asString(snap?.label) ?? live?.label ?? null,\n status: asString(snap?.status) ?? live?.status ?? null,\n amount: asNumber(snap?.amount) ?? live?.amount ?? null,\n currency: asString(snap?.currency) ?? live?.currency ?? decision.currency,\n interval: asString(snap?.interval) ?? live?.interval ?? null,\n providerId: asString(snap?.providerId) ?? live?.providerId ?? null,\n planId: asString(snap?.planId) ?? live?.planId ?? null,\n };\n}\n\n/** One source row a decision reasoned over, with the in-app page that shows it. */\nexport interface EvidenceSource {\n kind:\n | 'relationship'\n | 'keptRelationship'\n | 'plan'\n | 'alternativePlan'\n | 'renewalEvent'\n | 'entitlement';\n id: string;\n title: string;\n detail: string | null;\n /** MFE-relative path (`navigateTo`) of the page where this row is visible. */\n path: string;\n}\n\nfunction planSource(\n kind: 'plan' | 'alternativePlan',\n raw: unknown,\n providerId: string | null,\n relationshipPath: string\n): EvidenceSource | null {\n const plan = asRecord(raw);\n const id = asString(plan?.id);\n if (!plan || !id) return null;\n const amount = asNumber(plan.amount);\n const currency = asString(plan.currency);\n const interval = asString(plan.interval);\n return {\n kind,\n id,\n title: asString(plan.name) ?? id,\n detail:\n amount !== null\n ? `${amount.toFixed(2)}${currency ? ` ${currency}` : ''}${interval ? ` / ${interval.toLowerCase()}` : ''}`\n : null,\n // Plans are listed on their provider's page; without a provider the\n // relationship page still shows the plan the subscription is on.\n path: providerId ? `/providers/${providerId}` : relationshipPath,\n };\n}\n\n/**\n * Every source row in a decision's evidence, in reading order: the\n * relationship, the relationship to keep instead (overlap consolidation,\n * BOFF-3703), its current plan, the alternative plan (if any), then the\n * renewal events and entitlements the strategy inspected.\n */\nexport function evidenceSources(decision: SubDecision): EvidenceSource[] {\n const evidence = asRecord(decision.evidence);\n const snap = relationshipSnapshot(decision);\n const relationshipPath = `/relationships/${snap.id}`;\n const sources: EvidenceSource[] = [\n {\n kind: 'relationship',\n id: snap.id,\n title: snap.label ?? snap.id,\n detail:\n snap.amount !== null\n ? `${snap.amount.toFixed(2)}${snap.currency ? ` ${snap.currency}` : ''}${snap.interval ? ` / ${snap.interval.toLowerCase()}` : ''}`\n : null,\n path: relationshipPath,\n },\n ];\n if (!evidence) return sources;\n\n const keepId = asString(evidence.keepRelationshipId);\n if (keepId && keepId !== snap.id) {\n sources.push({\n kind: 'keptRelationship',\n id: keepId,\n title: asString(evidence.keepLabel) ?? keepId,\n detail: null,\n path: `/relationships/${keepId}`,\n });\n }\n\n const plan = planSource('plan', evidence.plan, snap.providerId, relationshipPath);\n if (plan) sources.push(plan);\n const alternative = planSource(\n 'alternativePlan',\n evidence.alternativePlan,\n snap.providerId,\n relationshipPath\n );\n if (alternative) sources.push(alternative);\n\n if (Array.isArray(evidence.renewalEvents)) {\n for (const raw of evidence.renewalEvents) {\n const ev = asRecord(raw);\n const id = asString(ev?.id);\n if (!ev || !id) continue;\n const amount = asNumber(ev.amount);\n const occursAt = asString(ev.occursAt);\n sources.push({\n kind: 'renewalEvent',\n id,\n title: asString(ev.eventType) ?? id,\n detail:\n [\n occursAt ? occursAt.slice(0, 10) : null,\n amount !== null\n ? `${amount.toFixed(2)}${asString(ev.currency) ? ` ${String(ev.currency)}` : ''}`\n : null,\n ]\n .filter(Boolean)\n .join(' · ') || null,\n path: relationshipPath,\n });\n }\n }\n\n if (Array.isArray(evidence.entitlements)) {\n for (const raw of evidence.entitlements) {\n const ent = asRecord(raw);\n const id = asString(ent?.id);\n if (!ent || !id) continue;\n const used = asNumber(ent.used);\n const quota = asNumber(ent.quota);\n sources.push({\n kind: 'entitlement',\n id,\n title: asString(ent.name) ?? id,\n detail: used !== null ? `${used}${quota !== null ? ` / ${quota}` : ''} used` : null,\n path: relationshipPath,\n });\n }\n }\n return sources;\n}\n"],"mappings":";AAoBA,IAAa,IAAkD,IAAI,IAAkB;CACnF;CACA;CACA;CACA;AACF,CAAC,GAEY,IAAoC;CAC/C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,EAAS,EAAI,IAAI,KAAK;GAC7B,QAAQ,MAAS,OAA8D,OAAvD,GAAG,IAAO,MAAU,OAAuB,KAAhB,MAAM,IAAa;GACtE,MAAM;EACR,CAAC;CACH;CAEF,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"decisionModel.js","names":["RUNNABLE_AGENT_KINDS","DECISION_KINDS","DECISION_KIND_LABEL","RECOMMENDATION_LABEL","isDestructive","recommendation","isActionable","decision","confidencePercent","confidence","asRecord","value","asString","asNumber","relationshipSnapshot","snap","live","planSource","plan","raw","id","amount","currency","interval","providerId","relationshipPath","evidenceSources","evidence","sources","keepId","alternative","ev","occursAt","ent","used","quota"],"sources":["../../../../src/subscriberbot/components/decisions/decisionModel.ts"],"sourcesContent":["/**\n * Decision view-model helpers\n * @module subscriberbot/components/decisions\n *\n * Pure functions that turn a `SubDecision` (as returned by the BOFF-3634\n * decision engine) into what the decision cards render: whether applying it is\n * destructive, which source rows it reasoned over, and the labels for its\n * enums. `evidence` is `JSON!` on the svc contract, so every read here is\n * defensive: a missing or malformed field yields nothing rather than a guess.\n */\n\nimport type {\n SubAgentKind,\n SubDecision,\n SubDecisionKind,\n SubDecisionRecommendation,\n SubDecisionStatus,\n} from '../../types';\n\n/** Agent kinds the decision engine implements; the rest are refused server-side. */\nexport const RUNNABLE_AGENT_KINDS: ReadonlySet<SubAgentKind> = new Set<SubAgentKind>([\n 'COST',\n 'RENEWAL',\n 'VENDOR',\n 'DISCOVERY',\n]);\n\nexport const DECISION_KINDS: SubDecisionKind[] = [\n 'CANCEL_CANDIDATE',\n 'RENEWAL_TRIAGE',\n 'PLAN_RIGHT_SIZE',\n 'TRIAL_EXPIRY',\n 'CONSOLIDATE_OVERLAP',\n];\n\nexport const DECISION_STATUSES: SubDecisionStatus[] = [\n 'PROPOSED',\n 'APPLIED',\n 'DISMISSED',\n 'STALE',\n 'FLAGGED',\n 'APPLYING',\n];\n\nexport const DECISION_KIND_LABEL: Record<SubDecisionKind, { key: string; fallback: string }> = {\n CANCEL_CANDIDATE: { key: 'decisions.kinds.cancelCandidate', fallback: 'Cancel candidate' },\n RENEWAL_TRIAGE: { key: 'decisions.kinds.renewalTriage', fallback: 'Renewal triage' },\n PLAN_RIGHT_SIZE: { key: 'decisions.kinds.planRightSize', fallback: 'Plan right-sizing' },\n TRIAL_EXPIRY: { key: 'decisions.kinds.trialExpiry', fallback: 'Trial expiry' },\n CONSOLIDATE_OVERLAP: {\n key: 'decisions.kinds.consolidateOverlap',\n fallback: 'Overlap consolidation',\n },\n};\n\nexport const RECOMMENDATION_LABEL: Record<\n SubDecisionRecommendation,\n { key: string; fallback: string }\n> = {\n CANCEL: { key: 'decisions.recommendations.cancel', fallback: 'Cancel subscription' },\n PAUSE: { key: 'decisions.recommendations.pause', fallback: 'Pause subscription' },\n RENEW: { key: 'decisions.recommendations.renew', fallback: 'Let it renew' },\n DOWNGRADE: { key: 'decisions.recommendations.downgrade', fallback: 'Downgrade plan' },\n SWITCH_TO_ANNUAL: {\n key: 'decisions.recommendations.switchToAnnual',\n fallback: 'Switch to annual billing',\n },\n CONVERT_TRIAL: { key: 'decisions.recommendations.convertTrial', fallback: 'Keep after trial' },\n};\n\n/**\n * Recommendations whose apply ends a paid relationship. These need an\n * explicit, acknowledged confirmation that names the relationship and amount.\n */\nexport function isDestructive(recommendation: SubDecisionRecommendation): boolean {\n return recommendation === 'CANCEL';\n}\n\n/** Only PROPOSED decisions can be applied or dismissed. */\nexport function isActionable(decision: Pick<SubDecision, 'status'>): boolean {\n return decision.status === 'PROPOSED';\n}\n\n/** Confidence (0..1) as a whole percentage, clamped. */\nexport function confidencePercent(confidence: number): number {\n if (!Number.isFinite(confidence)) return 0;\n return Math.round(Math.min(1, Math.max(0, confidence)) * 100);\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction asString(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null;\n}\n\nfunction asNumber(value: unknown): number | null {\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\n/** The relationship facts a decision was made against (its evidence snapshot). */\nexport interface RelationshipSnapshot {\n id: string;\n label: string | null;\n status: string | null;\n amount: number | null;\n currency: string | null;\n interval: string | null;\n providerId: string | null;\n planId: string | null;\n}\n\nexport function relationshipSnapshot(decision: SubDecision): RelationshipSnapshot {\n const snap = asRecord(asRecord(decision.evidence)?.relationship);\n const live = decision.relationship ?? null;\n return {\n id: asString(snap?.id) ?? decision.relationshipId,\n label: asString(snap?.label) ?? live?.label ?? null,\n status: asString(snap?.status) ?? live?.status ?? null,\n amount: asNumber(snap?.amount) ?? live?.amount ?? null,\n currency: asString(snap?.currency) ?? live?.currency ?? decision.currency,\n interval: asString(snap?.interval) ?? live?.interval ?? null,\n providerId: asString(snap?.providerId) ?? live?.providerId ?? null,\n planId: asString(snap?.planId) ?? live?.planId ?? null,\n };\n}\n\n/** One source row a decision reasoned over, with the in-app page that shows it. */\nexport interface EvidenceSource {\n kind:\n | 'relationship'\n | 'keptRelationship'\n | 'plan'\n | 'alternativePlan'\n | 'renewalEvent'\n | 'entitlement';\n id: string;\n title: string;\n detail: string | null;\n /** MFE-relative path (`navigateTo`) of the page where this row is visible. */\n path: string;\n}\n\nfunction planSource(\n kind: 'plan' | 'alternativePlan',\n raw: unknown,\n providerId: string | null,\n relationshipPath: string\n): EvidenceSource | null {\n const plan = asRecord(raw);\n const id = asString(plan?.id);\n if (!plan || !id) return null;\n const amount = asNumber(plan.amount);\n const currency = asString(plan.currency);\n const interval = asString(plan.interval);\n return {\n kind,\n id,\n title: asString(plan.name) ?? id,\n detail:\n amount !== null\n ? `${amount.toFixed(2)}${currency ? ` ${currency}` : ''}${interval ? ` / ${interval.toLowerCase()}` : ''}`\n : null,\n // Plans are listed on their provider's page; without a provider the\n // relationship page still shows the plan the subscription is on.\n path: providerId ? `/providers/${providerId}` : relationshipPath,\n };\n}\n\n/**\n * Every source row in a decision's evidence, in reading order: the\n * relationship, the relationship to keep instead (overlap consolidation,\n * BOFF-3703), its current plan, the alternative plan (if any), then the\n * renewal events and entitlements the strategy inspected.\n */\nexport function evidenceSources(decision: SubDecision): EvidenceSource[] {\n const evidence = asRecord(decision.evidence);\n const snap = relationshipSnapshot(decision);\n const relationshipPath = `/relationships/${snap.id}`;\n const sources: EvidenceSource[] = [\n {\n kind: 'relationship',\n id: snap.id,\n title: snap.label ?? snap.id,\n detail:\n snap.amount !== null\n ? `${snap.amount.toFixed(2)}${snap.currency ? ` ${snap.currency}` : ''}${snap.interval ? ` / ${snap.interval.toLowerCase()}` : ''}`\n : null,\n path: relationshipPath,\n },\n ];\n if (!evidence) return sources;\n\n const keepId = asString(evidence.keepRelationshipId);\n if (keepId && keepId !== snap.id) {\n sources.push({\n kind: 'keptRelationship',\n id: keepId,\n title: asString(evidence.keepLabel) ?? keepId,\n detail: null,\n path: `/relationships/${keepId}`,\n });\n }\n\n const plan = planSource('plan', evidence.plan, snap.providerId, relationshipPath);\n if (plan) sources.push(plan);\n const alternative = planSource(\n 'alternativePlan',\n evidence.alternativePlan,\n snap.providerId,\n relationshipPath\n );\n if (alternative) sources.push(alternative);\n\n if (Array.isArray(evidence.renewalEvents)) {\n for (const raw of evidence.renewalEvents) {\n const ev = asRecord(raw);\n const id = asString(ev?.id);\n if (!ev || !id) continue;\n const amount = asNumber(ev.amount);\n const occursAt = asString(ev.occursAt);\n sources.push({\n kind: 'renewalEvent',\n id,\n title: asString(ev.eventType) ?? id,\n detail:\n [\n occursAt ? occursAt.slice(0, 10) : null,\n amount !== null\n ? `${amount.toFixed(2)}${asString(ev.currency) ? ` ${String(ev.currency)}` : ''}`\n : null,\n ]\n .filter(Boolean)\n .join(' · ') || null,\n path: relationshipPath,\n });\n }\n }\n\n if (Array.isArray(evidence.entitlements)) {\n for (const raw of evidence.entitlements) {\n const ent = asRecord(raw);\n const id = asString(ent?.id);\n if (!ent || !id) continue;\n const used = asNumber(ent.used);\n const quota = asNumber(ent.quota);\n sources.push({\n kind: 'entitlement',\n id,\n title: asString(ent.name) ?? id,\n detail: used !== null ? `${used}${quota !== null ? ` / ${quota}` : ''} used` : null,\n path: relationshipPath,\n });\n }\n }\n return sources;\n}\n"],"mappings":";AAoBA,IAAaA,oBAAkD,IAAI,IAAkB;CACnF;CACA;CACA;CACA;AACF,CAAC,GAEYC,IAAoC;CAC/C;CACA;CACA;CACA;CACA;AACF,GAWaC,IAAkF;CAC7F,kBAAkB;EAAE,KAAK;EAAmC,UAAU;CAAmB;CACzF,gBAAgB;EAAE,KAAK;EAAiC,UAAU;CAAiB;CACnF,iBAAiB;EAAE,KAAK;EAAiC,UAAU;CAAoB;CACvF,cAAc;EAAE,KAAK;EAA+B,UAAU;CAAe;CAC7E,qBAAqB;EACnB,KAAK;EACL,UAAU;CACZ;AACF,GAEaC,IAGT;CACF,QAAQ;EAAE,KAAK;EAAoC,UAAU;CAAsB;CACnF,OAAO;EAAE,KAAK;EAAmC,UAAU;CAAqB;CAChF,OAAO;EAAE,KAAK;EAAmC,UAAU;CAAe;CAC1E,WAAW;EAAE,KAAK;EAAuC,UAAU;CAAiB;CACpF,kBAAkB;EAChB,KAAK;EACL,UAAU;CACZ;CACA,eAAe;EAAE,KAAK;EAA0C,UAAU;CAAmB;AAC/F;AAMA,SAAgBC,EAAc,GAAoD;CAChF,OAAOC,MAAmB;AAC5B;AAGA,SAAgBC,EAAa,GAAgD;CAC3E,OAAOC,EAAS,WAAW;AAC7B;AAGA,SAAgBC,EAAkB,GAA4B;CAE5D,OADK,OAAO,SAASC,CAAU,IACxB,KAAK,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGA,CAAU,CAAC,IAAI,GAAG,IADnB;AAE3C;AAEA,SAASC,EAAS,GAAgD;CAChE,OAAOC,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,IAC5DA,IACD;AACN;AAEA,SAASC,EAAS,GAA+B;CAC/C,OAAO,OAAOD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AAIT,EAASmB,EAAG,QAAQ,IAAI,IAAI,OAAOA,EAAG,QAAQ,MAAM,IAEjF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,KAAK,KAAK;GACpB,MAAMN;EACR,CAAC;CACH;CAGF,IAAI,MAAM,QAAQE,EAAS,YAAY,GACrC,KAAK,IAAMR,KAAOQ,EAAS,cAAc;EACvC,IAAMM,IAAMvB,EAASS,CAAG,GAClBC,IAAKR,EAASqB,GAAK,EAAE;EAC3B,IAAI,CAACA,KAAO,CAACb,GAAI;EACjB,IAAMc,IAAOrB,EAASoB,EAAI,IAAI,GACxBE,IAAQtB,EAASoB,EAAI,KAAK;EAChC,EAAQ,KAAK;GACX,MAAM;GACN;GACA,OAAOrB,EAASqB,EAAI,IAAI,KAAKb;GAC7B,QAAQc,MAAS,OAA8D,OAAvD,GAAGA,IAAOC,MAAU,OAAuB,KAAhB,MAAMA,IAAa;GACtE,MAAMV;EACR,CAAC;CACH;CAEF,OAAOG;AACT"}
|
|
@@ -6,4 +6,3 @@ export { DecisionCard, DecisionSources, ApplyDecisionDialog, DismissDecisionDial
|
|
|
6
6
|
export { AiDisclaimer, DecisionsUnavailableBanner } from './DecisionBanners';
|
|
7
7
|
export { DECISION_KINDS, DECISION_STATUSES, DECISION_KIND_LABEL, RECOMMENDATION_LABEL, RUNNABLE_AGENT_KINDS, confidencePercent, evidenceSources, isActionable, isDestructive, relationshipSnapshot, } from './decisionModel';
|
|
8
8
|
export type { EvidenceSource, RelationshipSnapshot } from './decisionModel';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import "./decisionModel.js";
|
|
2
|
-
import "./DecisionCard.js";
|
|
3
|
-
import "./DecisionBanners.js";
|
|
1
|
+
import { DECISION_KINDS as e, DECISION_KIND_LABEL as t, RECOMMENDATION_LABEL as n, RUNNABLE_AGENT_KINDS as r, confidencePercent as i, isDestructive as a, relationshipSnapshot as o } from "./decisionModel.js";
|
|
2
|
+
import { ApplyDecisionDialog as s, DecisionCard as c, DecisionSources as l, DismissDecisionDialog as u } from "./DecisionCard.js";
|
|
3
|
+
import { AiDisclaimer as d, DecisionsUnavailableBanner as f } from "./DecisionBanners.js";
|
|
4
|
+
export { d as AiDisclaimer, s as ApplyDecisionDialog, e as DECISION_KINDS, t as DECISION_KIND_LABEL, c as DecisionCard, l as DecisionSources, f as DecisionsUnavailableBanner, u as DismissDecisionDialog, n as RECOMMENDATION_LABEL, r as RUNNABLE_AGENT_KINDS, i as confidencePercent, a as isDestructive, o as relationshipSnapshot };
|
|
@@ -13,4 +13,3 @@ export type { PostureOptionsProps } from './PostureOptions';
|
|
|
13
13
|
export { LoadingView, ErrorView, Section } from './StateViews';
|
|
14
14
|
export { Donut, Legend, BarList, Sparkline, Gauge, Timeline, MiniProgress, PriceHistoryChart, CHART_COLORS, } from './viz';
|
|
15
15
|
export type { Segment, TimelineItem, PriceChartPoint, PriceChartSeries } from './viz';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "./PageLayout.js";
|
|
2
|
-
import "./MetricsCard.js";
|
|
3
|
-
import "./StatusBadge.js";
|
|
4
|
-
import "./EmptyState.js";
|
|
5
|
-
import "./Modal.js";
|
|
1
|
+
import { PageLayout as e } from "./PageLayout.js";
|
|
2
|
+
import { MetricsCard as t } from "./MetricsCard.js";
|
|
3
|
+
import { StatusBadge as n } from "./StatusBadge.js";
|
|
4
|
+
import { EmptyState as r } from "./EmptyState.js";
|
|
5
|
+
import { Modal as i } from "./Modal.js";
|
|
6
6
|
import "./PostureOptions.js";
|
|
7
|
-
import "./StateViews.js";
|
|
8
|
-
import "./viz.js";
|
|
7
|
+
import { ErrorView as a, LoadingView as o, Section as s } from "./StateViews.js";
|
|
8
|
+
import { BarList as c, Donut as l, Gauge as u, Legend as d, MiniProgress as f, PriceHistoryChart as p, Sparkline as m, Timeline as h } from "./viz.js";
|
|
9
|
+
export { c as BarList, l as Donut, r as EmptyState, a as ErrorView, u as Gauge, d as Legend, o as LoadingView, t as MetricsCard, f as MiniProgress, i as Modal, e as PageLayout, p as PriceHistoryChart, s as Section, m as Sparkline, n as StatusBadge, h as Timeline };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { RecurringSpend, UpcomingRenewal } from '../../utils/portfolio';
|
|
3
3
|
import { SubDecision, SubInboxMessage } from '../../types';
|
|
4
|
-
|
|
5
4
|
export interface MobileDashboardProps {
|
|
6
5
|
greetingName?: string;
|
|
7
6
|
spend: RecurringSpend;
|
|
@@ -15,4 +14,3 @@ export interface MobileDashboardProps {
|
|
|
15
14
|
navigateTo: (relativePath: string) => void;
|
|
16
15
|
}
|
|
17
16
|
export declare const MobileDashboard: FC<MobileDashboardProps>;
|
|
18
|
-
//# sourceMappingURL=MobileDashboard.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { StatusBadge as t } from "../StatusBadge.js";
|
|
3
|
+
import { MobileScreen as n, MobileSection as r } from "./MobileScreen.js";
|
|
4
|
+
import { RelationshipGlyph as i } from "./RelationshipGlyph.js";
|
|
5
|
+
import { RECOMMENDATION_LABEL as a } from "../decisions/decisionModel.js";
|
|
6
|
+
import { useTr as o } from "../../hooks/useTr.js";
|
|
7
|
+
import { cn as s } from "../../utils/cn.js";
|
|
8
|
+
import { daysUntil as c, renewalCountdown as l } from "../../utils/portfolio.js";
|
|
9
9
|
import { AlertTriangle as u, ArrowRight as d, Bot as f, ChevronRight as p, Inbox as m, Lightbulb as h, PiggyBank as g, Plus as _, ShieldCheck as v } from "lucide-react";
|
|
10
10
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/subscriberbot/components/mobile/MobileDashboard.tsx
|
|
12
12
|
var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken", S = "inline-flex items-center gap-0.5 text-sm font-medium text-text-link", C = ({ greetingName: C, spend: w, upcoming: T, actionMessages: E, decisions: D, relationshipLabel: O, openInvoiceCount: k, openInvoiceTotal: A, navigateTo: j }) => {
|
|
13
|
-
let { formatCurrency: M, formatIntervalSuffix: N } =
|
|
13
|
+
let { formatCurrency: M, formatIntervalSuffix: N } = e(), P = o(), F = [
|
|
14
14
|
{
|
|
15
15
|
id: "add",
|
|
16
16
|
label: P("mobile.dashboard.quick.add", "Add subscription"),
|
|
@@ -36,7 +36,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
36
36
|
path: "/agents"
|
|
37
37
|
}
|
|
38
38
|
];
|
|
39
|
-
return /* @__PURE__ */ b(
|
|
39
|
+
return /* @__PURE__ */ b(n, {
|
|
40
40
|
dataTour: "subscriberbot-home",
|
|
41
41
|
testId: "sb-mobile-dashboard",
|
|
42
42
|
title: P("dashboard.title", "Overview"),
|
|
@@ -67,7 +67,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
67
67
|
]
|
|
68
68
|
}),
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */ y(
|
|
70
|
+
/* @__PURE__ */ y(r, {
|
|
71
71
|
dataTour: "subscriberbot-home-renewals",
|
|
72
72
|
title: P("dashboard.renewals.title", "Upcoming renewals"),
|
|
73
73
|
action: T.length > 0 ? /* @__PURE__ */ b("button", {
|
|
@@ -81,19 +81,19 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
81
81
|
]
|
|
82
82
|
}) : void 0,
|
|
83
83
|
children: T.length === 0 ? /* @__PURE__ */ y("div", {
|
|
84
|
-
className:
|
|
84
|
+
className: s(x, "text-sm text-text-secondary"),
|
|
85
85
|
children: P("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
86
86
|
}) : /* @__PURE__ */ y("ul", {
|
|
87
87
|
className: "space-y-3",
|
|
88
88
|
"data-testid": "sb-mobile-renewals",
|
|
89
89
|
children: T.slice(0, 5).map((e) => {
|
|
90
|
-
let t =
|
|
90
|
+
let t = c(e.when), n = t == null ? null : l(t);
|
|
91
91
|
return /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
92
92
|
type: "button",
|
|
93
93
|
className: x,
|
|
94
94
|
onClick: () => j(`/relationships/${e.relationshipId}`),
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */ y(
|
|
96
|
+
/* @__PURE__ */ y(i, { kind: e.kind }),
|
|
97
97
|
/* @__PURE__ */ b("span", {
|
|
98
98
|
className: "min-w-0 flex-1",
|
|
99
99
|
children: [
|
|
@@ -105,9 +105,9 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
105
105
|
className: "block text-base tabular-nums text-text-primary",
|
|
106
106
|
children: [M(e.amount, e.currency ?? w.currency), e.interval ? N(e.interval) : ""]
|
|
107
107
|
}),
|
|
108
|
-
|
|
109
|
-
className:
|
|
110
|
-
children: P(
|
|
108
|
+
n && /* @__PURE__ */ y("span", {
|
|
109
|
+
className: s("block text-sm", n.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
110
|
+
children: P(n.key, n.fallback, n.params)
|
|
111
111
|
})
|
|
112
112
|
]
|
|
113
113
|
}),
|
|
@@ -117,7 +117,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
117
117
|
})
|
|
118
118
|
})
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */ y(
|
|
120
|
+
/* @__PURE__ */ y(r, {
|
|
121
121
|
dataTour: "subscriberbot-home-needs-attention",
|
|
122
122
|
title: P("mobile.dashboard.needsAction", "Needs action"),
|
|
123
123
|
action: /* @__PURE__ */ b("button", {
|
|
@@ -160,14 +160,14 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
160
160
|
className: "block truncate text-sm text-text-secondary",
|
|
161
161
|
children: e.preview
|
|
162
162
|
})]
|
|
163
|
-
}), /* @__PURE__ */ y(
|
|
163
|
+
}), /* @__PURE__ */ y(t, {
|
|
164
164
|
status: e.category,
|
|
165
165
|
className: "shrink-0"
|
|
166
166
|
})]
|
|
167
167
|
}) }, e.id))
|
|
168
168
|
})
|
|
169
169
|
}),
|
|
170
|
-
D.length > 0 && /* @__PURE__ */ y(
|
|
170
|
+
D.length > 0 && /* @__PURE__ */ y(r, {
|
|
171
171
|
title: P("mobile.dashboard.recommendations", "AI recommendations"),
|
|
172
172
|
action: /* @__PURE__ */ b("button", {
|
|
173
173
|
type: "button",
|
|
@@ -183,7 +183,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
183
183
|
className: "space-y-3",
|
|
184
184
|
"data-testid": "sb-mobile-decisions",
|
|
185
185
|
children: D.slice(0, 3).map((e) => {
|
|
186
|
-
let t =
|
|
186
|
+
let t = a[e.recommendation];
|
|
187
187
|
return /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
|
|
188
188
|
type: "button",
|
|
189
189
|
className: x,
|
|
@@ -227,7 +227,7 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
227
227
|
})]
|
|
228
228
|
}), /* @__PURE__ */ y(d, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */ y(
|
|
230
|
+
/* @__PURE__ */ y(r, {
|
|
231
231
|
title: P("dashboard.quickActions.title", "Quick actions"),
|
|
232
232
|
dataTour: "subscriberbot-home-quick-actions",
|
|
233
233
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -249,7 +249,6 @@ var x = "flex w-full items-center gap-3 rounded-2xl border border-border-subtle
|
|
|
249
249
|
]
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
|
-
//#endregion
|
|
253
252
|
export { C as MobileDashboard };
|
|
254
253
|
|
|
255
254
|
//# sourceMappingURL=MobileDashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileDashboard.js","names":[],"sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile overview\n * @module subscriberbot/components/mobile\n *\n * The phone overview from `sb-24-mobile-app.jpg`: total recurring spend in the\n * hero, then card-first sections for upcoming renewals, what needs action in\n * the Universal Inbox, open AI recommendations, and quick actions. Every\n * number comes from the same real queries the desktop dashboard uses — the\n * page computes once and hands the results down.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n AlertTriangle,\n ArrowRight,\n Bot,\n ChevronRight,\n Inbox,\n Lightbulb,\n PiggyBank,\n Plus,\n ShieldCheck,\n} from 'lucide-react';\nimport { StatusBadge } from '../StatusBadge';\nimport { MobileScreen, MobileSection } from './MobileScreen';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { RECOMMENDATION_LABEL } from '../decisions/decisionModel';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n renewalCountdown,\n type RecurringSpend,\n type UpcomingRenewal,\n} from '../../utils/portfolio';\nimport type { SubDecision, SubInboxMessage } from '../../types';\n\nexport interface MobileDashboardProps {\n greetingName?: string;\n spend: RecurringSpend;\n upcoming: UpcomingRenewal[];\n actionMessages: SubInboxMessage[];\n /** PROPOSED AI decisions, newest first. */\n decisions: SubDecision[];\n relationshipLabel: (relationshipId: string) => string | undefined;\n openInvoiceCount: number;\n openInvoiceTotal: number;\n navigateTo: (relativePath: string) => void;\n}\n\nconst cardCls =\n 'flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken';\n\nconst linkCls = 'inline-flex items-center gap-0.5 text-sm font-medium text-text-link';\n\nexport const MobileDashboard: FC<MobileDashboardProps> = ({\n greetingName,\n spend,\n upcoming,\n actionMessages,\n decisions,\n relationshipLabel,\n openInvoiceCount,\n openInvoiceTotal,\n navigateTo,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n\n const quickActions: Array<{ id: string; label: string; icon: ReactNode; path: string }> = [\n {\n id: 'add',\n label: tr('mobile.dashboard.quick.add', 'Add subscription'),\n icon: <Plus className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n id: 'inbox',\n label: tr('mobile.dashboard.quick.inbox', 'Inbox'),\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n id: 'savings',\n label: tr('mobile.dashboard.quick.savings', 'Savings'),\n icon: <PiggyBank className=\"h-5 w-5\" />,\n path: '/savings',\n },\n {\n id: 'agents',\n label: tr('mobile.dashboard.quick.agents', 'Agents'),\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <MobileScreen\n dataTour=\"subscriberbot-home\"\n testId=\"sb-mobile-dashboard\"\n title={tr('dashboard.title', 'Overview')}\n eyebrow={\n greetingName\n ? tr('mobile.dashboard.greeting', 'Hi, {{name}}', { name: greetingName })\n : undefined\n }\n hero={\n <div data-tour=\"subscriberbot-home-metrics\">\n <p className=\"text-sm\">{tr('mobile.dashboard.totalSpend', 'Total recurring spend')}</p>\n <p className=\"mt-1 font-bold tabular-nums\" data-testid=\"sb-mobile-total-spend\">\n <span className=\"text-4xl\">{formatCurrency(spend.monthly, spend.currency)}</span>\n <span className=\"text-base font-medium\">\n {tr('mobile.dashboard.perMonth', '/month')}\n </span>\n </p>\n <p className=\"mt-1 text-xs\" data-tour=\"subscriberbot-home-portfolio\">\n {tr(\n spend.activeCount === 1\n ? 'mobile.dashboard.activeCountOne'\n : 'mobile.dashboard.activeCount',\n spend.activeCount === 1\n ? '{{count}} active subscription'\n : '{{count}} active subscriptions',\n { count: spend.activeCount }\n )}\n </p>\n </div>\n }\n >\n <MobileSection\n dataTour=\"subscriberbot-home-renewals\"\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n action={\n upcoming.length > 0 ? (\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/relationships')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n ) : undefined\n }\n >\n {upcoming.length === 0 ? (\n <div className={cn(cardCls, 'text-sm text-text-secondary')}>\n {tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n </div>\n ) : (\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-renewals\">\n {upcoming.slice(0, 5).map((u) => {\n const days = daysUntil(u.when);\n const countdown = days == null ? null : renewalCountdown(days);\n return (\n <li key={u.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/relationships/${u.relationshipId}`)}\n >\n <RelationshipGlyph kind={u.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {u.title}\n </span>\n {u.amount != null && (\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(u.amount, u.currency ?? spend.currency)}\n {u.interval ? formatIntervalSuffix(u.interval) : ''}\n </span>\n )}\n {countdown && (\n <span\n className={cn(\n 'block text-sm',\n countdown.tone === 'later'\n ? 'text-text-secondary'\n : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary\" />\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </MobileSection>\n\n <MobileSection\n dataTour=\"subscriberbot-home-needs-attention\"\n title={tr('mobile.dashboard.needsAction', 'Needs action')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/inbox')}>\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}{' '}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n {actionMessages.length === 0 ? (\n <div className={cardCls}>\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </span>\n </span>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {actionMessages.slice(0, 3).map((m) => (\n <li key={m.id}>\n <button type=\"button\" className={cardCls} onClick={() => navigateTo('/inbox')}>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {m.subject || tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </span>\n {m.preview && (\n <span className=\"block truncate text-sm text-text-secondary\">\n {m.preview}\n </span>\n )}\n </span>\n <StatusBadge status={m.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </MobileSection>\n\n {decisions.length > 0 && (\n <MobileSection\n title={tr('mobile.dashboard.recommendations', 'AI recommendations')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/decisions')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-decisions\">\n {decisions.slice(0, 3).map((d) => {\n const rec = RECOMMENDATION_LABEL[d.recommendation];\n return (\n <li key={d.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/decisions/${d.id}`)}\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary\">\n <Lightbulb className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {rec ? tr(rec.key, rec.fallback) : d.recommendation}\n </span>\n <span className=\"block truncate text-sm text-text-secondary\">\n {relationshipLabel(d.relationshipId) ?? d.rationale}\n </span>\n </span>\n {d.estimatedSavings > 0 && (\n <span className=\"shrink-0 text-sm font-semibold tabular-nums text-status-success-text\">\n {tr('mobile.dashboard.savesPerYear', 'Save {{amount}}/yr', {\n amount: formatCurrency(d.estimatedSavings, d.currency, {\n maximumFractionDigits: 0,\n }),\n })}\n </span>\n )}\n </button>\n </li>\n );\n })}\n </ul>\n </MobileSection>\n )}\n\n {openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-2xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: openInvoiceCount,\n amount: formatCurrency(openInvoiceTotal, spend.currency),\n }\n )}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n <MobileSection\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-2 gap-3\">\n {quickActions.map((qa) => (\n <button\n key={qa.id}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"flex min-h-20 flex-col items-start justify-between gap-2 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start active:bg-bg-sunken\"\n >\n <span className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">{qa.label}</span>\n </button>\n ))}\n </div>\n </MobileSection>\n </MobileScreen>\n );\n};\n"],"mappings":";;;;;;;;;;;AAoDA,IAAM,IACJ,uJAEI,IAAU,uEAEH,KAA6C,EACxD,iBACA,UACA,aACA,mBACA,cACA,sBACA,qBACA,qBACA,oBACI;CACJ,IAAM,EAAE,mBAAgB,4BAAyB,EAAc,GAEzD,IAAK,EAAM,GAEX,IAAoF;EACxF;GACE,IAAI;GACJ,OAAO,EAAG,8BAA8B,kBAAkB;GAC1D,MAAM,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA;GACjC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAO,EAAG,gCAAgC,OAAO;GACjD,MAAM,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;GAClC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAO,EAAG,kCAAkC,SAAS;GACrD,MAAM,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA;GACtC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAO,EAAG,iCAAiC,QAAQ;GACnD,MAAM,kBAAC,GAAD,EAAK,WAAU,UAAW,CAAA;GAChC,MAAM;EACR;CACF;CAEA,OACE,kBAAC,GAAD;EACE,UAAS;EACT,QAAO;EACP,OAAO,EAAG,mBAAmB,UAAU;EACvC,SACE,IACI,EAAG,6BAA6B,gBAAgB,EAAE,MAAM,EAAa,CAAC,IACtE,KAAA;EAEN,MACE,kBAAC,OAAD;GAAK,aAAU;aAAf;IACE,kBAAC,KAAD;KAAG,WAAU;eAAW,EAAG,+BAA+B,uBAAuB;IAAK,CAAA;IACtF,kBAAC,KAAD;KAAG,WAAU;KAA8B,eAAY;eAAvD,CACE,kBAAC,QAAD;MAAM,WAAU;gBAAY,EAAe,EAAM,SAAS,EAAM,QAAQ;KAAQ,CAAA,GAChF,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAG,6BAA6B,QAAQ;KACrC,CAAA,CACL;;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,GAAkB,EAAM,QAAQ;MACzD,CACF;KACI,CAAA,CACF;QACN,kBAAC,GAAD,EAAY,WAAU,2DAA4D,CAAA,CAC5E;;GAGV,kBAAC,GAAD;IACE,OAAO,EAAG,gCAAgC,eAAe;IACzD,UAAS;cAET,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAa,KAAK,MACjB,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAG,IAAI;MACjC,WAAU;gBAJZ,CAME,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAG;MACA,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;iBAAyC,EAAG;MAAY,CAAA,CAClE;QATD,EAAG,EASF,CACT;IACE,CAAA;GACQ,CAAA;EACH;;AAElB"}
|
|
1
|
+
{"version":3,"file":"MobileDashboard.js","names":["cardCls","linkCls","MobileDashboard","useFormatters","tr","useTr","quickActions","Plus","Inbox","PiggyBank","Bot","MobileScreen","greetingName","formatCurrency","spend","MobileSection","upcoming","navigateTo","ChevronRight","cn","days","daysUntil","u","countdown","renewalCountdown","RelationshipGlyph","formatIntervalSuffix","actionMessages","ShieldCheck","m","StatusBadge","decisions","rec","RECOMMENDATION_LABEL","d","Lightbulb","relationshipLabel","openInvoiceCount","AlertTriangle","openInvoiceTotal","ArrowRight","qa"],"sources":["../../../../src/subscriberbot/components/mobile/MobileDashboard.tsx"],"sourcesContent":["import { useFormatters } from '../../hooks/useFormatters';\n/**\n * Mobile overview\n * @module subscriberbot/components/mobile\n *\n * The phone overview from `sb-24-mobile-app.jpg`: total recurring spend in the\n * hero, then card-first sections for upcoming renewals, what needs action in\n * the Universal Inbox, open AI recommendations, and quick actions. Every\n * number comes from the same real queries the desktop dashboard uses — the\n * page computes once and hands the results down.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n AlertTriangle,\n ArrowRight,\n Bot,\n ChevronRight,\n Inbox,\n Lightbulb,\n PiggyBank,\n Plus,\n ShieldCheck,\n} from 'lucide-react';\nimport { StatusBadge } from '../StatusBadge';\nimport { MobileScreen, MobileSection } from './MobileScreen';\nimport { RelationshipGlyph } from './RelationshipGlyph';\nimport { RECOMMENDATION_LABEL } from '../decisions/decisionModel';\nimport { useTr } from '../../hooks/useTr';\nimport { cn } from '../../utils/cn';\n\nimport {\n daysUntil,\n renewalCountdown,\n type RecurringSpend,\n type UpcomingRenewal,\n} from '../../utils/portfolio';\nimport type { SubDecision, SubInboxMessage } from '../../types';\n\nexport interface MobileDashboardProps {\n greetingName?: string;\n spend: RecurringSpend;\n upcoming: UpcomingRenewal[];\n actionMessages: SubInboxMessage[];\n /** PROPOSED AI decisions, newest first. */\n decisions: SubDecision[];\n relationshipLabel: (relationshipId: string) => string | undefined;\n openInvoiceCount: number;\n openInvoiceTotal: number;\n navigateTo: (relativePath: string) => void;\n}\n\nconst cardCls =\n 'flex w-full items-center gap-3 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start shadow-sm transition-colors active:bg-bg-sunken';\n\nconst linkCls = 'inline-flex items-center gap-0.5 text-sm font-medium text-text-link';\n\nexport const MobileDashboard: FC<MobileDashboardProps> = ({\n greetingName,\n spend,\n upcoming,\n actionMessages,\n decisions,\n relationshipLabel,\n openInvoiceCount,\n openInvoiceTotal,\n navigateTo,\n}) => {\n const { formatCurrency, formatIntervalSuffix } = useFormatters();\n\n const tr = useTr();\n\n const quickActions: Array<{ id: string; label: string; icon: ReactNode; path: string }> = [\n {\n id: 'add',\n label: tr('mobile.dashboard.quick.add', 'Add subscription'),\n icon: <Plus className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n id: 'inbox',\n label: tr('mobile.dashboard.quick.inbox', 'Inbox'),\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n id: 'savings',\n label: tr('mobile.dashboard.quick.savings', 'Savings'),\n icon: <PiggyBank className=\"h-5 w-5\" />,\n path: '/savings',\n },\n {\n id: 'agents',\n label: tr('mobile.dashboard.quick.agents', 'Agents'),\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <MobileScreen\n dataTour=\"subscriberbot-home\"\n testId=\"sb-mobile-dashboard\"\n title={tr('dashboard.title', 'Overview')}\n eyebrow={\n greetingName\n ? tr('mobile.dashboard.greeting', 'Hi, {{name}}', { name: greetingName })\n : undefined\n }\n hero={\n <div data-tour=\"subscriberbot-home-metrics\">\n <p className=\"text-sm\">{tr('mobile.dashboard.totalSpend', 'Total recurring spend')}</p>\n <p className=\"mt-1 font-bold tabular-nums\" data-testid=\"sb-mobile-total-spend\">\n <span className=\"text-4xl\">{formatCurrency(spend.monthly, spend.currency)}</span>\n <span className=\"text-base font-medium\">\n {tr('mobile.dashboard.perMonth', '/month')}\n </span>\n </p>\n <p className=\"mt-1 text-xs\" data-tour=\"subscriberbot-home-portfolio\">\n {tr(\n spend.activeCount === 1\n ? 'mobile.dashboard.activeCountOne'\n : 'mobile.dashboard.activeCount',\n spend.activeCount === 1\n ? '{{count}} active subscription'\n : '{{count}} active subscriptions',\n { count: spend.activeCount }\n )}\n </p>\n </div>\n }\n >\n <MobileSection\n dataTour=\"subscriberbot-home-renewals\"\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n action={\n upcoming.length > 0 ? (\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/relationships')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n ) : undefined\n }\n >\n {upcoming.length === 0 ? (\n <div className={cn(cardCls, 'text-sm text-text-secondary')}>\n {tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n </div>\n ) : (\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-renewals\">\n {upcoming.slice(0, 5).map((u) => {\n const days = daysUntil(u.when);\n const countdown = days == null ? null : renewalCountdown(days);\n return (\n <li key={u.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/relationships/${u.relationshipId}`)}\n >\n <RelationshipGlyph kind={u.kind} />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {u.title}\n </span>\n {u.amount != null && (\n <span className=\"block text-base tabular-nums text-text-primary\">\n {formatCurrency(u.amount, u.currency ?? spend.currency)}\n {u.interval ? formatIntervalSuffix(u.interval) : ''}\n </span>\n )}\n {countdown && (\n <span\n className={cn(\n 'block text-sm',\n countdown.tone === 'later'\n ? 'text-text-secondary'\n : 'text-status-warning-text'\n )}\n >\n {tr(countdown.key, countdown.fallback, countdown.params)}\n </span>\n )}\n </span>\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary\" />\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </MobileSection>\n\n <MobileSection\n dataTour=\"subscriberbot-home-needs-attention\"\n title={tr('mobile.dashboard.needsAction', 'Needs action')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/inbox')}>\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}{' '}\n <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n {actionMessages.length === 0 ? (\n <div className={cardCls}>\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </span>\n </span>\n </div>\n ) : (\n <ul className=\"space-y-3\">\n {actionMessages.slice(0, 3).map((m) => (\n <li key={m.id}>\n <button type=\"button\" className={cardCls} onClick={() => navigateTo('/inbox')}>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {m.subject || tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </span>\n {m.preview && (\n <span className=\"block truncate text-sm text-text-secondary\">\n {m.preview}\n </span>\n )}\n </span>\n <StatusBadge status={m.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </MobileSection>\n\n {decisions.length > 0 && (\n <MobileSection\n title={tr('mobile.dashboard.recommendations', 'AI recommendations')}\n action={\n <button type=\"button\" className={linkCls} onClick={() => navigateTo('/decisions')}>\n {tr('common.viewAll', 'View all')} <ChevronRight className=\"rtl:rotate-180 h-4 w-4\" />\n </button>\n }\n >\n <ul className=\"space-y-3\" data-testid=\"sb-mobile-decisions\">\n {decisions.slice(0, 3).map((d) => {\n const rec = RECOMMENDATION_LABEL[d.recommendation];\n return (\n <li key={d.id}>\n <button\n type=\"button\"\n className={cardCls}\n onClick={() => navigateTo(`/decisions/${d.id}`)}\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-xl bg-bg-sunken text-text-secondary\">\n <Lightbulb className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-semibold text-text-primary\">\n {rec ? tr(rec.key, rec.fallback) : d.recommendation}\n </span>\n <span className=\"block truncate text-sm text-text-secondary\">\n {relationshipLabel(d.relationshipId) ?? d.rationale}\n </span>\n </span>\n {d.estimatedSavings > 0 && (\n <span className=\"shrink-0 text-sm font-semibold tabular-nums text-status-success-text\">\n {tr('mobile.dashboard.savesPerYear', 'Save {{amount}}/yr', {\n amount: formatCurrency(d.estimatedSavings, d.currency, {\n maximumFractionDigits: 0,\n }),\n })}\n </span>\n )}\n </button>\n </li>\n );\n })}\n </ul>\n </MobileSection>\n )}\n\n {openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-2xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-4 py-3 text-start\"\n >\n <span className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: openInvoiceCount,\n amount: formatCurrency(openInvoiceTotal, spend.currency),\n }\n )}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n <MobileSection\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-2 gap-3\">\n {quickActions.map((qa) => (\n <button\n key={qa.id}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"flex min-h-20 flex-col items-start justify-between gap-2 rounded-2xl border border-border-subtle bg-bg-surface p-4 text-start active:bg-bg-sunken\"\n >\n <span className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">{qa.label}</span>\n </button>\n ))}\n </div>\n </MobileSection>\n </MobileScreen>\n );\n};\n"],"mappings":";;;;;;;;;;;AAoDA,IAAMA,IACJ,uJAEIC,IAAU,uEAEHC,KAA6C,EACxD,iBACA,UACA,aACA,mBACA,cACA,sBACA,qBACA,qBACA,oBACI;CACJ,IAAM,EAAE,mBAAgB,4BAAyBC,EAAc,GAEzDC,IAAKC,EAAM,GAEXC,IAAoF;EACxF;GACE,IAAI;GACJ,OAAOF,EAAG,8BAA8B,kBAAkB;GAC1D,MAAM,kBAACG,GAAD,EAAM,WAAU,UAAW,CAAA;GACjC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAOH,EAAG,gCAAgC,OAAO;GACjD,MAAM,kBAACI,GAAD,EAAO,WAAU,UAAW,CAAA;GAClC,MAAM;EACR;EACA;GACE,IAAI;GACJ,OAAOJ,EAAG,kCAAkC,SAAS;GACrD,MAAM,kBAACK,GAAD,EAAW,WAAU,UAAW,CAAA;GACtC,MAAM;EACR;EACA;GACE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,UAAS;IAET,UAAA,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAE,EAAa,KAAK,MACjB,kBAAC,UAAD;MAEE,MAAK;MACL,eAAeW,EAAWwB,EAAG,IAAI;MACjC,WAAU;MAJZ,UAAA,CAME,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAA,EAAG;MACA,CAAA,GACN,kBAAC,QAAD;OAAM,WAAU;OAAyC,UAAAA,EAAG;MAAY,CAAA,CAClE;KATD,GAAAA,EAAG,EASF,CACT;IACE,CAAA;GACQ,CAAA;EACH;;AAElB"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { SubRelationship } from '../../types';
|
|
3
|
-
|
|
4
3
|
interface MobileRelationshipListProps {
|
|
5
4
|
items: SubRelationship[];
|
|
6
5
|
navigateTo: (relativePath: string) => void;
|
|
7
6
|
}
|
|
8
7
|
export declare const MobileRelationshipList: FC<MobileRelationshipListProps>;
|
|
9
8
|
export {};
|
|
10
|
-
//# sourceMappingURL=MobileRelationshipList.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useFormatters as e } from "../../hooks/useFormatters.js";
|
|
2
|
+
import { StatusBadge as t } from "../StatusBadge.js";
|
|
3
|
+
import { RelationshipGlyph as n } from "./RelationshipGlyph.js";
|
|
4
|
+
import { useCancelRelationship as r, useTransitionRelationship as i } from "../../hooks/useSubscriberBotApi.js";
|
|
5
|
+
import { useTr as a } from "../../hooks/useTr.js";
|
|
6
|
+
import { cn as o } from "../../utils/cn.js";
|
|
7
|
+
import { daysUntil as s, isSwipeTrailingClick as c, quickActionsFor as l, renewalCountdown as u, swipeClickDeadline as d, swipeOffset as f, swipeSettlesOpen as p } from "../../utils/portfolio.js";
|
|
8
8
|
import { useRef as m, useState as h } from "react";
|
|
9
9
|
import { Ban as g, ChevronRight as _, MoreHorizontal as v, Pause as y, Play as b } from "lucide-react";
|
|
10
10
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
11
|
import { AlertDialog as w, AlertDialogAction as T, AlertDialogCancel as E, AlertDialogContent as D, AlertDialogDescription as O, AlertDialogFooter as k, AlertDialogHeader as A, AlertDialogTitle as j, BottomSheet as M, BottomSheetContent as N, BottomSheetDescription as P, BottomSheetHeader as F, BottomSheetTitle as I } from "@burdenoff/fe-libs/ui";
|
|
12
|
-
|
|
12
|
+
// src/subscriberbot/components/mobile/MobileRelationshipList.tsx
|
|
13
13
|
var L = 84, R = 8, z = {
|
|
14
14
|
activate: {
|
|
15
15
|
key: "relationships.detail.actions.activate",
|
|
@@ -35,13 +35,9 @@ var L = 84, R = 8, z = {
|
|
|
35
35
|
icon: g,
|
|
36
36
|
tone: "bg-status-error-bg-subtle text-status-error-text"
|
|
37
37
|
}
|
|
38
|
-
}, B = ({ items:
|
|
39
|
-
let { formatCurrency: s, formatIntervalSuffix:
|
|
40
|
-
|
|
41
|
-
b(e);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
d.mutate({
|
|
38
|
+
}, B = ({ items: t, navigateTo: n }) => {
|
|
39
|
+
let { formatCurrency: s, formatIntervalSuffix: c } = e(), u = a(), d = i(), f = r(), [p, m] = h(null), [g, v] = h(null), [y, b] = h(null), [L, R] = h(null), B = d.isPending || f.isPending, H = (e) => R(e instanceof Error ? e.message : u("mobile.relationships.actionFailed", "That action could not be completed.")), U = (e, t) => {
|
|
40
|
+
m(null), v(null), R(null), t.destructive ? b(e) : d.mutate({
|
|
45
41
|
id: e.id,
|
|
46
42
|
status: t.target
|
|
47
43
|
}, { onError: H });
|
|
@@ -55,12 +51,12 @@ var L = 84, R = 8, z = {
|
|
|
55
51
|
/* @__PURE__ */ S("ul", {
|
|
56
52
|
className: "mt-4 space-y-3",
|
|
57
53
|
"data-testid": "sb-mobile-relationship-list",
|
|
58
|
-
children:
|
|
54
|
+
children: t.map((e) => /* @__PURE__ */ S(V, {
|
|
59
55
|
relationship: e,
|
|
60
56
|
open: p === e.id,
|
|
61
57
|
busy: B,
|
|
62
58
|
onOpenChange: (t) => m(t ? e.id : null),
|
|
63
|
-
onSelect: () =>
|
|
59
|
+
onSelect: () => n(`/relationships/${e.id}`),
|
|
64
60
|
onMore: () => {
|
|
65
61
|
m(null), v(e);
|
|
66
62
|
},
|
|
@@ -72,25 +68,25 @@ var L = 84, R = 8, z = {
|
|
|
72
68
|
onOpenChange: (e) => !e && v(null),
|
|
73
69
|
children: /* @__PURE__ */ S(N, {
|
|
74
70
|
"data-testid": "sb-mobile-relationship-actions",
|
|
75
|
-
children: g && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(F, { children: [/* @__PURE__ */ S(I, { children: g.label }), /* @__PURE__ */ C(P, { children: [s(g.amount, g.currency),
|
|
71
|
+
children: g && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(F, { children: [/* @__PURE__ */ S(I, { children: g.label }), /* @__PURE__ */ C(P, { children: [s(g.amount, g.currency), c(g.interval)] })] }), /* @__PURE__ */ C("div", {
|
|
76
72
|
className: "flex flex-col gap-2 py-2",
|
|
77
73
|
children: [/* @__PURE__ */ C("button", {
|
|
78
74
|
type: "button",
|
|
79
75
|
className: "flex min-h-12 items-center justify-between rounded-xl bg-bg-surface px-4 text-start text-sm font-medium text-text-primary active:bg-bg-sunken",
|
|
80
76
|
onClick: () => {
|
|
81
77
|
let e = g.id;
|
|
82
|
-
v(null),
|
|
78
|
+
v(null), n(`/relationships/${e}`);
|
|
83
79
|
},
|
|
84
80
|
children: [u("mobile.relationships.viewDetails", "View details"), /* @__PURE__ */ S(_, { className: "rtl:rotate-180 h-4 w-4 text-text-secondary" })]
|
|
85
|
-
}),
|
|
86
|
-
let t = z[e.id],
|
|
81
|
+
}), l(g.status).map((e) => {
|
|
82
|
+
let t = z[e.id], n = t.icon;
|
|
87
83
|
return /* @__PURE__ */ C("button", {
|
|
88
84
|
type: "button",
|
|
89
85
|
disabled: B,
|
|
90
|
-
className:
|
|
86
|
+
className: o("flex min-h-12 items-center gap-3 rounded-xl px-4 text-start text-sm font-medium disabled:opacity-50", t.tone),
|
|
91
87
|
onClick: () => U(g, e),
|
|
92
88
|
children: [
|
|
93
|
-
/* @__PURE__ */ S(
|
|
89
|
+
/* @__PURE__ */ S(n, { className: "h-4 w-4" }),
|
|
94
90
|
" ",
|
|
95
91
|
u(t.key, t.fallback)
|
|
96
92
|
]
|
|
@@ -112,9 +108,9 @@ var L = 84, R = 8, z = {
|
|
|
112
108
|
})] })] })
|
|
113
109
|
})
|
|
114
110
|
] });
|
|
115
|
-
}, V = ({ relationship:
|
|
116
|
-
let { formatCurrency: w, formatIntervalSuffix: T } =
|
|
117
|
-
O
|
|
111
|
+
}, V = ({ relationship: r, open: i, busy: g, onOpenChange: _, onSelect: y, onMore: b, onAction: x }) => {
|
|
112
|
+
let { formatCurrency: w, formatIntervalSuffix: T } = e(), E = a(), D = l(r.status), O = D.length * L, [k, A] = h(null), j = m(null), M = m(0), N = k ?? (i ? -O : 0), P = s(r.renewsAt), F = P != null && (r.status === "ACTIVE" || r.status === "TRIAL") ? u(P) : null, I = (e) => {
|
|
113
|
+
O !== 0 && e.pointerType !== "mouse" && (j.current = {
|
|
118
114
|
x: e.clientX,
|
|
119
115
|
y: e.clientY,
|
|
120
116
|
swiping: !1,
|
|
@@ -132,69 +128,65 @@ var L = 84, R = 8, z = {
|
|
|
132
128
|
if (Math.abs(n) < R) return;
|
|
133
129
|
t.swiping = !0, e.currentTarget.setPointerCapture(e.pointerId);
|
|
134
130
|
}
|
|
135
|
-
t.moved = !0, A(
|
|
131
|
+
t.moved = !0, A(f(n, i, O));
|
|
136
132
|
}, V = () => {
|
|
137
133
|
let e = j.current;
|
|
138
|
-
j.current = null, e?.swiping && k != null && _(
|
|
134
|
+
j.current = null, e?.swiping && k != null && _(p(k, O)), A(null), e?.moved && (M.current = d(Date.now()));
|
|
139
135
|
};
|
|
140
136
|
return /* @__PURE__ */ C("li", {
|
|
141
137
|
className: "relative overflow-hidden rounded-2xl border border-border-subtle bg-bg-sunken",
|
|
142
138
|
"data-testid": "sb-mobile-relationship-row",
|
|
143
|
-
"data-relationship-id":
|
|
139
|
+
"data-relationship-id": r.id,
|
|
144
140
|
children: [D.length > 0 && /* @__PURE__ */ S("div", {
|
|
145
141
|
className: "absolute inset-y-0 right-0 flex",
|
|
146
142
|
style: { width: O },
|
|
147
|
-
"aria-hidden": !
|
|
143
|
+
"aria-hidden": !i,
|
|
148
144
|
children: D.map((e) => {
|
|
149
|
-
let t = z[e.id],
|
|
145
|
+
let t = z[e.id], n = t.icon;
|
|
150
146
|
return /* @__PURE__ */ C("button", {
|
|
151
147
|
type: "button",
|
|
152
|
-
tabIndex:
|
|
148
|
+
tabIndex: i ? 0 : -1,
|
|
153
149
|
disabled: g,
|
|
154
150
|
onClick: () => x(e),
|
|
155
|
-
className:
|
|
151
|
+
className: o("flex h-full flex-col items-center justify-center gap-1 text-xs font-medium disabled:opacity-50", t.tone),
|
|
156
152
|
style: { width: L },
|
|
157
|
-
children: [/* @__PURE__ */ S(
|
|
153
|
+
children: [/* @__PURE__ */ S(n, { className: "h-5 w-5" }), E(t.key, t.fallback)]
|
|
158
154
|
}, e.id);
|
|
159
155
|
})
|
|
160
156
|
}), /* @__PURE__ */ C("div", {
|
|
161
|
-
className:
|
|
157
|
+
className: o("relative flex touch-pan-y items-center gap-3 bg-bg-surface p-4", k == null && "transition-transform duration-200 ease-out"),
|
|
162
158
|
style: { transform: `translateX(${N}px)` },
|
|
163
159
|
onPointerDown: I,
|
|
164
160
|
onPointerMove: B,
|
|
165
161
|
onPointerUp: V,
|
|
166
162
|
onPointerCancel: V,
|
|
167
163
|
onClickCapture: (e) => {
|
|
168
|
-
|
|
164
|
+
c(Date.now(), M.current) && (M.current = 0, e.preventDefault(), e.stopPropagation());
|
|
169
165
|
},
|
|
170
166
|
children: [/* @__PURE__ */ C("button", {
|
|
171
167
|
type: "button",
|
|
172
168
|
onClick: () => {
|
|
173
|
-
|
|
174
|
-
_(!1);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
y();
|
|
169
|
+
i ? _(!1) : y();
|
|
178
170
|
},
|
|
179
171
|
className: "flex min-w-0 flex-1 items-center gap-3 text-start",
|
|
180
|
-
children: [/* @__PURE__ */ S(
|
|
172
|
+
children: [/* @__PURE__ */ S(n, { kind: r.kind }), /* @__PURE__ */ C("span", {
|
|
181
173
|
className: "min-w-0 flex-1",
|
|
182
174
|
children: [
|
|
183
175
|
/* @__PURE__ */ S("span", {
|
|
184
176
|
className: "block truncate font-semibold text-text-primary",
|
|
185
|
-
children:
|
|
177
|
+
children: r.label
|
|
186
178
|
}),
|
|
187
179
|
/* @__PURE__ */ C("span", {
|
|
188
180
|
className: "block text-base tabular-nums text-text-primary",
|
|
189
|
-
children: [w(
|
|
181
|
+
children: [w(r.amount, r.currency), /* @__PURE__ */ S("span", {
|
|
190
182
|
className: "text-sm text-text-secondary",
|
|
191
|
-
children: T(
|
|
183
|
+
children: T(r.interval)
|
|
192
184
|
})]
|
|
193
185
|
}),
|
|
194
186
|
/* @__PURE__ */ C("span", {
|
|
195
187
|
className: "mt-0.5 flex items-center gap-2",
|
|
196
|
-
children: [/* @__PURE__ */ S(
|
|
197
|
-
className:
|
|
188
|
+
children: [/* @__PURE__ */ S(t, { status: r.status }), F && /* @__PURE__ */ S("span", {
|
|
189
|
+
className: o("truncate text-xs", F.tone === "later" ? "text-text-secondary" : "text-status-warning-text"),
|
|
198
190
|
children: E(F.key, F.fallback, F.params)
|
|
199
191
|
})]
|
|
200
192
|
})
|
|
@@ -203,7 +195,7 @@ var L = 84, R = 8, z = {
|
|
|
203
195
|
}), /* @__PURE__ */ S("button", {
|
|
204
196
|
type: "button",
|
|
205
197
|
onClick: b,
|
|
206
|
-
"aria-label": E("mobile.relationships.moreActions", "More actions for {{label}}", { label:
|
|
198
|
+
"aria-label": E("mobile.relationships.moreActions", "More actions for {{label}}", { label: r.label }),
|
|
207
199
|
className: "flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary active:bg-bg-sunken",
|
|
208
200
|
"data-testid": "sb-mobile-relationship-more",
|
|
209
201
|
children: /* @__PURE__ */ S(v, { className: "h-5 w-5" })
|
|
@@ -211,7 +203,6 @@ var L = 84, R = 8, z = {
|
|
|
211
203
|
})]
|
|
212
204
|
});
|
|
213
205
|
};
|
|
214
|
-
//#endregion
|
|
215
206
|
export { B as MobileRelationshipList };
|
|
216
207
|
|
|
217
208
|
//# sourceMappingURL=MobileRelationshipList.js.map
|