@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/stories/Accessibility.stories.d.ts +13 -0
  3. package/dist/stories/Accessibility.stories.d.ts.map +1 -0
  4. package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
  6. package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
  7. package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
  8. package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
  9. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  10. package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
  11. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  12. package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
  13. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  15. package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
  16. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
  17. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  18. package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
  19. package/dist/subscriberbot/components/Modal.js +43 -33
  20. package/dist/subscriberbot/components/Modal.js.map +1 -1
  21. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
  22. package/dist/subscriberbot/components/PostureOptions.js +10 -10
  23. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  24. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
  25. package/dist/subscriberbot/components/StateViews.js +45 -37
  26. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  27. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
  28. package/dist/subscriberbot/components/StatusBadge.js +6 -6
  29. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  30. package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
  31. package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
  32. package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
  33. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  34. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
  35. package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
  36. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  37. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
  38. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
  39. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  40. package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
  41. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  42. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
  43. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
  44. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
  45. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  46. package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
  47. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
  48. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  49. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
  50. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
  51. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  52. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
  53. package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
  54. package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
  55. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  56. package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
  57. package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
  58. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  59. package/dist/subscriberbot/components/viz.d.ts +1 -0
  60. package/dist/subscriberbot/components/viz.d.ts.map +1 -1
  61. package/dist/subscriberbot/components/viz.js +100 -101
  62. package/dist/subscriberbot/components/viz.js.map +1 -1
  63. package/dist/subscriberbot/hooks/index.js +1 -1
  64. package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
  65. package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
  66. package/dist/subscriberbot/hooks/useFormError.js +28 -0
  67. package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
  68. package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
  69. package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
  70. package/dist/subscriberbot/hooks/useFormatters.js +13 -0
  71. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
  72. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  73. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
  74. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  75. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
  76. package/dist/subscriberbot/hooks/useTr.js +1 -1
  77. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  78. package/dist/subscriberbot/index.js +1 -1
  79. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  80. package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
  81. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  82. package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
  83. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  84. package/dist/subscriberbot/pages/DashboardPage.js +107 -98
  85. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  86. package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
  87. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  88. package/dist/subscriberbot/pages/InboxPage.js +421 -402
  89. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  90. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  91. package/dist/subscriberbot/pages/InsightsPage.js +130 -121
  92. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  93. package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
  94. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  95. package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
  96. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  97. package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
  98. package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
  99. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  100. package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
  101. package/dist/subscriberbot/pages/SavingsPage.js +57 -57
  102. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  103. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
  104. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  105. package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
  106. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  107. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
  108. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  109. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
  110. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  111. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
  112. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  113. package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
  114. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
  116. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
  118. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  119. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
  120. package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
  121. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
  122. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  123. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
  124. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
  125. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
  126. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  127. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
  128. package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
  129. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
  130. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  131. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
  132. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
  133. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
  134. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  135. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
  136. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
  137. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
  138. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  139. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
  140. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
  141. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
  142. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  143. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
  144. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
  145. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
  146. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  147. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
  148. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
  149. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
  150. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  151. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
  152. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
  153. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
  154. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  155. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
  156. package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
  157. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
  158. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  159. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
  160. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  161. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
  162. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  163. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
  164. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  165. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
  166. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  167. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
  168. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  169. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
  170. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  171. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
  172. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  173. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
  174. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  175. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
  176. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  177. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
  178. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  179. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
  180. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  181. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
  182. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  183. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
  184. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
  185. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  186. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
  187. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
  188. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
  189. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  190. package/dist/subscriberbot/utils/formatters.d.ts +16 -5
  191. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
  192. package/dist/subscriberbot/utils/formatters.js +57 -25
  193. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  194. package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
  195. package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
  196. package/dist/subscriberbot/utils/plaidLink.js +21 -21
  197. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  198. package/package.json +1 -1
@@ -1,355 +1,371 @@
1
1
  import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { useTr as n } from "../../hooks/useTr.js";
2
+ import { useTr as t } from "../../hooks/useTr.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { useRelationship as r, useRelationships as i } from "../../hooks/useSubscriberBotApi.js";
5
5
  import { REQUEST_TYPES as a, REQUEST_TYPE_LABEL as o } from "../../components/procurement/labels.js";
6
6
  import "../../components/procurement/index.js";
7
- import { useCreateProcurementRequest as ee, useProcurementTerms as te } from "../../hooks/useProcurementApi.js";
8
- import { useEffect as s, useMemo as c, useRef as ne, useState as l } from "react";
9
- import { ArrowLeft as u, CalendarClock as re, FileText as d, Target as f } from "lucide-react";
10
- import { useSearchParams as p } from "react-router";
11
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
- import { GlassCard as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
7
+ import { useCreateProcurementRequest as s, useProcurementTerms as c } from "../../hooks/useProcurementApi.js";
8
+ import { useFormError as ee } from "../../hooks/useFormError.js";
9
+ import { useEffect as l, useMemo as u, useRef as te, useState as d } from "react";
10
+ import { ArrowLeft as ne, CalendarClock as re, FileText as ie, Target as ae } from "lucide-react";
11
+ import { useSearchParams as f } from "react-router";
12
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
13
+ import { GlassCard as h, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
13
14
  //#region src/subscriberbot/pages/procurement/ProcurementNewPage.tsx
14
- var ie = {
15
+ var se = {
15
16
  DAILY: 365,
16
17
  WEEKLY: 52,
17
18
  MONTHLY: 12,
18
19
  QUARTERLY: 4,
19
20
  YEARLY: 1
20
- }, v = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", y = "mb-1.5 block text-xs font-medium text-text-secondary";
21
- function b({ icon: e, title: t, description: n, children: r }) {
22
- return /* @__PURE__ */ h(g, {
21
+ }, g = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", _ = "mb-1.5 block text-xs font-medium text-text-secondary";
22
+ function v({ icon: e, title: t, description: n, children: r }) {
23
+ return /* @__PURE__ */ m(h, {
23
24
  treatment: "metric",
24
25
  className: "p-5 sm:p-6",
25
- children: [/* @__PURE__ */ h("div", {
26
+ children: [/* @__PURE__ */ m("div", {
26
27
  className: "flex items-start gap-3",
27
- children: [/* @__PURE__ */ m("span", {
28
+ children: [/* @__PURE__ */ p("span", {
28
29
  className: "mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
29
30
  children: e
30
- }), /* @__PURE__ */ h("div", {
31
+ }), /* @__PURE__ */ m("div", {
31
32
  className: "min-w-0",
32
- children: [/* @__PURE__ */ m("h2", {
33
+ children: [/* @__PURE__ */ p("h2", {
33
34
  className: "text-sm font-semibold text-text-primary",
34
35
  children: t
35
- }), /* @__PURE__ */ m("p", {
36
+ }), /* @__PURE__ */ p("p", {
36
37
  className: "mt-0.5 text-xs text-text-secondary",
37
38
  children: n
38
39
  })]
39
40
  })]
40
- }), /* @__PURE__ */ m("div", {
41
+ }), /* @__PURE__ */ p("div", {
41
42
  className: "mt-4",
42
43
  children: r
43
44
  })]
44
45
  });
45
46
  }
46
- function x(e) {
47
+ function y(e) {
47
48
  if (!e) return "";
48
49
  let t = e instanceof Date ? e : new Date(e);
49
50
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
50
51
  }
51
- var S = (e) => {
52
+ var b = (e) => {
52
53
  if (!e.trim()) return null;
53
54
  let t = Number(e);
54
55
  return Number.isFinite(t) && t > 0 ? t : null;
55
56
  };
56
- function C() {
57
- let g = n(), { navigateTo: C } = e(), [ae] = p(), w = ee(), T = te(), E = i({ pagination: {
57
+ function x() {
58
+ let h = t(), { navigateTo: x } = e(), [ce] = f(), S = s(), C = c(), w = i({ pagination: {
58
59
  limit: 100,
59
60
  offset: 0
60
- } }), [D, O] = l(ae.get("relationshipId") ?? ""), k = r(D || void 0), A = c(() => {
61
- let e = E.data?.items ?? [], t = k.data;
61
+ } }), [T, E] = d(ce.get("relationshipId") ?? ""), D = r(T || void 0), O = u(() => {
62
+ let e = w.data?.items ?? [], t = D.data;
62
63
  return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
63
- }, [E.data, k.data]), [j, M] = l(""), [N, oe] = l(""), [P, se] = l(""), [F, ce] = l("RENEWAL"), [I, L] = l("USD"), [R, z] = l(""), [B, V] = l(""), [H, U] = l(""), [W, le] = l("12"), [G, ue] = l(""), [K, q] = l(""), [J, de] = l(""), [Y, X] = l(null), Z = D ? A.find((e) => e.id === D) : void 0, Q = ne(null);
64
- s(() => {
64
+ }, [w.data, D.data]), [k, A] = d(""), [j, M] = d(""), [N, le] = d(""), [P, ue] = d("RENEWAL"), [F, I] = d("USD"), [L, R] = d(""), [z, B] = d(""), [V, H] = d(""), [U, de] = d("12"), [W, fe] = d(""), [G, K] = d(""), [q, pe] = d(""), [J, Y, X, me] = ee(), Z = T ? O.find((e) => e.id === T) : void 0, Q = te(null);
65
+ l(() => {
65
66
  if (!Z || Q.current === Z.id) return;
66
- Q.current = Z.id, M(Z.label), L(Z.currency);
67
- let e = ie[Z.interval] ?? 0;
68
- z(Z.amount > 0 && e > 0 ? String(Math.round(Z.amount * e * 100) / 100) : ""), q(Z.renewsAt ? x(Z.renewsAt) : "");
67
+ Q.current = Z.id, A(Z.label), I(Z.currency);
68
+ let e = se[Z.interval] ?? 0;
69
+ R(Z.amount > 0 && e > 0 ? String(Math.round(Z.amount * e * 100) / 100) : ""), K(Z.renewsAt ? y(Z.renewsAt) : "");
69
70
  }, [Z]);
70
- let $ = T.data ? Math.round(T.data.feeRate * 100) : null, fe = x(/* @__PURE__ */ new Date());
71
- return /* @__PURE__ */ h(t, {
72
- title: g("procurement.new.title", "Request an expert negotiation"),
73
- description: g("procurement.new.description", "Tell the procurement desk about the contract and what matters to you."),
74
- actions: /* @__PURE__ */ h("button", {
71
+ let $ = C.data ? Math.round(C.data.feeRate * 100) : null, he = y(/* @__PURE__ */ new Date());
72
+ return /* @__PURE__ */ m(n, {
73
+ title: h("procurement.new.title", "Request an expert negotiation"),
74
+ description: h("procurement.new.description", "Tell the procurement desk about the contract and what matters to you."),
75
+ actions: /* @__PURE__ */ m("button", {
75
76
  type: "button",
76
- onClick: () => C("/procurement"),
77
+ onClick: () => x("/procurement"),
77
78
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
78
79
  children: [
79
- /* @__PURE__ */ m(u, { className: "h-4 w-4" }),
80
+ /* @__PURE__ */ p(ne, { className: "rtl:rotate-180 h-4 w-4" }),
80
81
  " ",
81
- g("procurement.back", "Back")
82
+ h("procurement.back", "Back")
82
83
  ]
83
84
  }),
84
- children: [/* @__PURE__ */ m(_, {
85
+ children: [/* @__PURE__ */ p(oe, {
85
86
  className: "mb-6",
86
- children: $ == null ? g("procurement.new.purpose", "Nothing reaches the vendor until you submit the request. You only pay a share of the savings the expert secures.") : g("procurement.new.purposeFee", "Nothing reaches the vendor until you submit the request. The fee is {{pct}}% of the first-year savings against the vendor quote (or your current price), and only when the expert gets the price down.", { pct: $ })
87
- }), /* @__PURE__ */ h("form", {
87
+ children: $ == null ? h("procurement.new.purpose", "Nothing reaches the vendor until you submit the request. You only pay a share of the savings the expert secures.") : h("procurement.new.purposeFee", "Nothing reaches the vendor until you submit the request. The fee is {{pct}}% of the first-year savings against the vendor quote (or your current price), and only when the expert gets the price down.", { pct: $ })
88
+ }), /* @__PURE__ */ m("form", {
88
89
  onSubmit: (e) => {
89
- e.preventDefault(), X(null);
90
- let t = S(R), n = S(B), r = Number(W);
91
- if (!j.trim()) {
92
- X(g("procurement.form.vendorRequired", "Which vendor is the contract with?"));
90
+ e.preventDefault(), Y(null);
91
+ let t = b(L), n = b(z), r = Number(U);
92
+ if (!k.trim()) {
93
+ Y(h("procurement.form.vendorRequired", "Which vendor is the contract with?"), "proc-vendor");
93
94
  return;
94
95
  }
95
96
  if (t == null && n == null) {
96
- X(g("procurement.form.baselineRequired", "Enter what you pay per year today or the annual value of the vendor quote."));
97
+ Y(h("procurement.form.baselineRequired", "Enter what you pay per year today or the annual value of the vendor quote."), ["proc-current", "proc-quoted"]);
97
98
  return;
98
99
  }
99
- if (!K) {
100
- X(g("procurement.form.deadlineRequired", "When must the decision be made?"));
100
+ if (!G) {
101
+ Y(h("procurement.form.deadlineRequired", "When must the decision be made?"), "proc-deadline");
101
102
  return;
102
103
  }
103
- if (!Number.isInteger(r) || r < 1 || r > (T.data?.maxTermMonths ?? 60)) {
104
- X(g("procurement.form.termInvalid", "The term must be between 1 and {{max}} months.", { max: T.data?.maxTermMonths ?? 60 }));
104
+ if (!Number.isInteger(r) || r < 1 || r > (C.data?.maxTermMonths ?? 60)) {
105
+ Y(h("procurement.form.termInvalid", "The term must be between 1 and {{max}} months.", { max: C.data?.maxTermMonths ?? 60 }), "proc-term");
105
106
  return;
106
107
  }
107
- let i = S(H), a = S(G), o = {
108
- vendorName: j.trim(),
109
- requestType: F,
110
- currency: I.trim().toUpperCase() || "USD",
108
+ let i = b(V), a = b(W), o = {
109
+ vendorName: k.trim(),
110
+ requestType: P,
111
+ currency: F.trim().toUpperCase() || "USD",
111
112
  termMonths: r,
112
- deadline: (/* @__PURE__ */ new Date(`${K}T23:59:59`)).toISOString(),
113
- ...D ? { relationshipId: D } : {},
114
- ...N.trim() ? { productName: N.trim() } : {},
115
- ...P.trim() ? { category: P.trim() } : {},
113
+ deadline: (/* @__PURE__ */ new Date(`${G}T23:59:59`)).toISOString(),
114
+ ...T ? { relationshipId: T } : {},
115
+ ...j.trim() ? { productName: j.trim() } : {},
116
+ ...N.trim() ? { category: N.trim() } : {},
116
117
  ...t == null ? {} : { currentAnnualValue: t },
117
118
  ...n == null ? {} : { quotedAnnualValue: n },
118
119
  ...i == null ? {} : { targetAnnualValue: i },
119
120
  ...a == null ? {} : { seats: Math.round(a) },
120
- ...J.trim() ? { notes: J.trim() } : {}
121
+ ...q.trim() ? { notes: q.trim() } : {}
121
122
  };
122
- w.mutate({ input: o }, {
123
- onSuccess: (e) => C(`/procurement/${e.id}`),
124
- onError: (e) => X(e instanceof Error ? e.message : g("procurement.form.error", "Could not create the request."))
123
+ S.mutate({ input: o }, {
124
+ onSuccess: (e) => x(`/procurement/${e.id}`),
125
+ onError: (e) => Y(e instanceof Error ? e.message : h("procurement.form.error", "Could not create the request."))
125
126
  });
126
127
  },
127
128
  className: "max-w-3xl space-y-5",
128
129
  "data-testid": "procurement-form",
129
130
  children: [
130
- Y && /* @__PURE__ */ m("div", {
131
+ J && /* @__PURE__ */ p("div", {
132
+ id: me,
133
+ tabIndex: -1,
131
134
  role: "alert",
132
135
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
133
- children: Y
136
+ children: J
134
137
  }),
135
- /* @__PURE__ */ m(b, {
136
- icon: /* @__PURE__ */ m(d, { className: "h-4 w-4" }),
137
- title: g("procurement.form.contract.title", "The contract"),
138
- description: g("procurement.form.contract.description", "Link a tracked subscription to prefill it, or describe the contract."),
139
- children: /* @__PURE__ */ h("div", {
138
+ /* @__PURE__ */ p(v, {
139
+ icon: /* @__PURE__ */ p(ie, { className: "h-4 w-4" }),
140
+ title: h("procurement.form.contract.title", "The contract"),
141
+ description: h("procurement.form.contract.description", "Link a tracked subscription to prefill it, or describe the contract."),
142
+ children: /* @__PURE__ */ m("div", {
140
143
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
141
144
  children: [
142
- /* @__PURE__ */ h("div", {
145
+ /* @__PURE__ */ m("div", {
143
146
  className: "sm:col-span-2",
144
- children: [/* @__PURE__ */ m("label", {
147
+ children: [/* @__PURE__ */ p("label", {
145
148
  htmlFor: "proc-relationship",
146
- className: y,
147
- children: g("procurement.form.relationship", "Tracked subscription (optional)")
148
- }), /* @__PURE__ */ h("select", {
149
+ className: _,
150
+ children: h("procurement.form.relationship", "Tracked subscription (optional)")
151
+ }), /* @__PURE__ */ m("select", {
152
+ ...X("proc-relationship"),
149
153
  id: "proc-relationship",
150
- value: D,
151
- onChange: (e) => O(e.target.value),
152
- className: v,
153
- children: [/* @__PURE__ */ m("option", {
154
+ value: T,
155
+ onChange: (e) => E(e.target.value),
156
+ className: g,
157
+ children: [/* @__PURE__ */ p("option", {
154
158
  value: "",
155
- children: g("procurement.form.noRelationship", "Not linked")
156
- }), A.map((e) => /* @__PURE__ */ m("option", {
159
+ children: h("procurement.form.noRelationship", "Not linked")
160
+ }), O.map((e) => /* @__PURE__ */ p("option", {
157
161
  value: e.id,
158
162
  children: e.label
159
163
  }, e.id))]
160
164
  })]
161
165
  }),
162
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
166
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
163
167
  htmlFor: "proc-vendor",
164
- className: y,
168
+ className: _,
165
169
  children: [
166
- g("procurement.form.vendor", "Vendor"),
170
+ h("procurement.form.vendor", "Vendor"),
167
171
  " ",
168
- /* @__PURE__ */ m("span", {
172
+ /* @__PURE__ */ p("span", {
169
173
  className: "text-status-error-text",
170
174
  children: "*"
171
175
  })
172
176
  ]
173
- }), /* @__PURE__ */ m("input", {
177
+ }), /* @__PURE__ */ p("input", {
178
+ ...X("proc-vendor"),
174
179
  id: "proc-vendor",
175
- value: j,
176
- onChange: (e) => M(e.target.value),
177
- placeholder: g("procurement.form.vendorPlaceholder", "e.g. Salesforce"),
178
- className: v
180
+ value: k,
181
+ onChange: (e) => A(e.target.value),
182
+ placeholder: h("procurement.form.vendorPlaceholder", "e.g. Salesforce"),
183
+ className: g
179
184
  })] }),
180
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
185
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
181
186
  htmlFor: "proc-product",
182
- className: y,
183
- children: g("procurement.form.product", "Product or plan")
184
- }), /* @__PURE__ */ m("input", {
187
+ className: _,
188
+ children: h("procurement.form.product", "Product or plan")
189
+ }), /* @__PURE__ */ p("input", {
190
+ ...X("proc-product"),
185
191
  id: "proc-product",
186
- value: N,
187
- onChange: (e) => oe(e.target.value),
188
- placeholder: g("procurement.form.productPlaceholder", "e.g. Sales Cloud Enterprise"),
189
- className: v
192
+ value: j,
193
+ onChange: (e) => M(e.target.value),
194
+ placeholder: h("procurement.form.productPlaceholder", "e.g. Sales Cloud Enterprise"),
195
+ className: g
190
196
  })] }),
191
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
197
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
192
198
  htmlFor: "proc-type",
193
- className: y,
194
- children: g("procurement.form.type", "Type of request")
195
- }), /* @__PURE__ */ m("select", {
199
+ className: _,
200
+ children: h("procurement.form.type", "Type of request")
201
+ }), /* @__PURE__ */ p("select", {
202
+ ...X("proc-type"),
196
203
  id: "proc-type",
197
- value: F,
198
- onChange: (e) => ce(e.target.value),
199
- className: v,
200
- children: a.map((e) => /* @__PURE__ */ m("option", {
204
+ value: P,
205
+ onChange: (e) => ue(e.target.value),
206
+ className: g,
207
+ children: a.map((e) => /* @__PURE__ */ p("option", {
201
208
  value: e,
202
- children: g(o[e].key, o[e].fallback)
209
+ children: h(o[e].key, o[e].fallback)
203
210
  }, e))
204
211
  })] }),
205
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
212
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
206
213
  htmlFor: "proc-category",
207
- className: y,
208
- children: g("procurement.form.category", "Software category")
209
- }), /* @__PURE__ */ m("input", {
214
+ className: _,
215
+ children: h("procurement.form.category", "Software category")
216
+ }), /* @__PURE__ */ p("input", {
217
+ ...X("proc-category"),
210
218
  id: "proc-category",
211
- value: P,
212
- onChange: (e) => se(e.target.value),
213
- placeholder: g("procurement.form.categoryPlaceholder", "e.g. CRM, Security, HR"),
214
- className: v
219
+ value: N,
220
+ onChange: (e) => le(e.target.value),
221
+ placeholder: h("procurement.form.categoryPlaceholder", "e.g. CRM, Security, HR"),
222
+ className: g
215
223
  })] })
216
224
  ]
217
225
  })
218
226
  }),
219
- /* @__PURE__ */ m(b, {
220
- icon: /* @__PURE__ */ m(f, { className: "h-4 w-4" }),
221
- title: g("procurement.form.value.title", "Price and terms"),
222
- description: g("procurement.form.value.description", "Annual values. Savings are measured against the quote, or the current price when there is no quote."),
223
- children: /* @__PURE__ */ h("div", {
227
+ /* @__PURE__ */ p(v, {
228
+ icon: /* @__PURE__ */ p(ae, { className: "h-4 w-4" }),
229
+ title: h("procurement.form.value.title", "Price and terms"),
230
+ description: h("procurement.form.value.description", "Annual values. Savings are measured against the quote, or the current price when there is no quote."),
231
+ children: /* @__PURE__ */ m("div", {
224
232
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
225
233
  children: [
226
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
234
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
227
235
  htmlFor: "proc-current",
228
- className: y,
229
- children: g("procurement.form.current", "What you pay per year today")
230
- }), /* @__PURE__ */ m("input", {
236
+ className: _,
237
+ children: h("procurement.form.current", "What you pay per year today")
238
+ }), /* @__PURE__ */ p("input", {
239
+ ...X("proc-current"),
231
240
  id: "proc-current",
232
241
  type: "number",
233
242
  min: "0",
234
243
  step: "0.01",
235
- value: R,
236
- onChange: (e) => z(e.target.value),
237
- className: v
244
+ value: L,
245
+ onChange: (e) => R(e.target.value),
246
+ className: g
238
247
  })] }),
239
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
248
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
240
249
  htmlFor: "proc-quoted",
241
- className: y,
242
- children: g("procurement.form.quoted", "Vendor quote per year")
243
- }), /* @__PURE__ */ m("input", {
250
+ className: _,
251
+ children: h("procurement.form.quoted", "Vendor quote per year")
252
+ }), /* @__PURE__ */ p("input", {
253
+ ...X("proc-quoted"),
244
254
  id: "proc-quoted",
245
255
  type: "number",
246
256
  min: "0",
247
257
  step: "0.01",
248
- value: B,
249
- onChange: (e) => V(e.target.value),
250
- className: v
258
+ value: z,
259
+ onChange: (e) => B(e.target.value),
260
+ className: g
251
261
  })] }),
252
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
262
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
253
263
  htmlFor: "proc-target",
254
- className: y,
255
- children: g("procurement.form.target", "Annual price you would be happy with")
256
- }), /* @__PURE__ */ m("input", {
264
+ className: _,
265
+ children: h("procurement.form.target", "Annual price you would be happy with")
266
+ }), /* @__PURE__ */ p("input", {
267
+ ...X("proc-target"),
257
268
  id: "proc-target",
258
269
  type: "number",
259
270
  min: "0",
260
271
  step: "0.01",
261
- value: H,
262
- onChange: (e) => U(e.target.value),
263
- className: v
272
+ value: V,
273
+ onChange: (e) => H(e.target.value),
274
+ className: g
264
275
  })] }),
265
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
276
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
266
277
  htmlFor: "proc-currency",
267
- className: y,
268
- children: g("procurement.form.currency", "Currency")
269
- }), /* @__PURE__ */ m("input", {
278
+ className: _,
279
+ children: h("procurement.form.currency", "Currency")
280
+ }), /* @__PURE__ */ p("input", {
281
+ ...X("proc-currency"),
270
282
  id: "proc-currency",
271
- value: I,
283
+ value: F,
272
284
  maxLength: 3,
273
- onChange: (e) => L(e.target.value),
274
- className: v
285
+ onChange: (e) => I(e.target.value),
286
+ className: g
275
287
  })] }),
276
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
288
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
277
289
  htmlFor: "proc-term",
278
- className: y,
279
- children: g("procurement.form.term", "Contract term (months)")
280
- }), /* @__PURE__ */ m("input", {
290
+ className: _,
291
+ children: h("procurement.form.term", "Contract term (months)")
292
+ }), /* @__PURE__ */ p("input", {
293
+ ...X("proc-term"),
281
294
  id: "proc-term",
282
295
  type: "number",
283
296
  min: "1",
284
- max: T.data?.maxTermMonths ?? 60,
297
+ max: C.data?.maxTermMonths ?? 60,
285
298
  step: "1",
286
- value: W,
287
- onChange: (e) => le(e.target.value),
288
- className: v
299
+ value: U,
300
+ onChange: (e) => de(e.target.value),
301
+ className: g
289
302
  })] }),
290
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
303
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
291
304
  htmlFor: "proc-seats",
292
- className: y,
293
- children: g("procurement.form.seats", "Seats or licences")
294
- }), /* @__PURE__ */ m("input", {
305
+ className: _,
306
+ children: h("procurement.form.seats", "Seats or licences")
307
+ }), /* @__PURE__ */ p("input", {
308
+ ...X("proc-seats"),
295
309
  id: "proc-seats",
296
310
  type: "number",
297
311
  min: "1",
298
312
  step: "1",
299
- value: G,
300
- onChange: (e) => ue(e.target.value),
301
- className: v
313
+ value: W,
314
+ onChange: (e) => fe(e.target.value),
315
+ className: g
302
316
  })] })
303
317
  ]
304
318
  })
305
319
  }),
306
- /* @__PURE__ */ m(b, {
307
- icon: /* @__PURE__ */ m(re, { className: "h-4 w-4" }),
308
- title: g("procurement.form.deadline.title", "Deadline and priorities"),
309
- description: g("procurement.form.deadline.description", "The earlier the expert starts, the more leverage there is. Requests are worked in deadline order."),
310
- children: /* @__PURE__ */ h("div", {
320
+ /* @__PURE__ */ p(v, {
321
+ icon: /* @__PURE__ */ p(re, { className: "h-4 w-4" }),
322
+ title: h("procurement.form.deadline.title", "Deadline and priorities"),
323
+ description: h("procurement.form.deadline.description", "The earlier the expert starts, the more leverage there is. Requests are worked in deadline order."),
324
+ children: /* @__PURE__ */ m("div", {
311
325
  className: "grid grid-cols-1 gap-4",
312
- children: [/* @__PURE__ */ h("div", {
326
+ children: [/* @__PURE__ */ m("div", {
313
327
  className: "sm:max-w-xs",
314
- children: [/* @__PURE__ */ h("label", {
328
+ children: [/* @__PURE__ */ m("label", {
315
329
  htmlFor: "proc-deadline",
316
- className: y,
330
+ className: _,
317
331
  children: [
318
- g("procurement.form.deadline", "Decision deadline (renewal or signature date)"),
332
+ h("procurement.form.deadline", "Decision deadline (renewal or signature date)"),
319
333
  " ",
320
- /* @__PURE__ */ m("span", {
334
+ /* @__PURE__ */ p("span", {
321
335
  className: "text-status-error-text",
322
336
  children: "*"
323
337
  })
324
338
  ]
325
- }), /* @__PURE__ */ m("input", {
339
+ }), /* @__PURE__ */ p("input", {
340
+ ...X("proc-deadline"),
326
341
  id: "proc-deadline",
327
342
  type: "date",
328
- min: fe,
329
- value: K,
330
- onChange: (e) => q(e.target.value),
331
- className: v
343
+ min: he,
344
+ value: G,
345
+ onChange: (e) => K(e.target.value),
346
+ className: g
332
347
  })]
333
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
348
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
334
349
  htmlFor: "proc-notes",
335
- className: y,
336
- children: g("procurement.form.notes", "Priorities and constraints (must-have features, budget, flexibility on term or seats)")
337
- }), /* @__PURE__ */ m("textarea", {
350
+ className: _,
351
+ children: h("procurement.form.notes", "Priorities and constraints (must-have features, budget, flexibility on term or seats)")
352
+ }), /* @__PURE__ */ p("textarea", {
353
+ ...X("proc-notes"),
338
354
  id: "proc-notes",
339
355
  rows: 4,
340
- value: J,
341
- onChange: (e) => de(e.target.value),
342
- className: v
356
+ value: q,
357
+ onChange: (e) => pe(e.target.value),
358
+ className: g
343
359
  })] })]
344
360
  })
345
361
  }),
346
- /* @__PURE__ */ m("div", {
362
+ /* @__PURE__ */ p("div", {
347
363
  className: "flex justify-end",
348
- children: /* @__PURE__ */ m("button", {
364
+ children: /* @__PURE__ */ p("button", {
349
365
  type: "submit",
350
- disabled: w.isPending,
366
+ disabled: S.isPending,
351
367
  className: "rounded-lg bg-action-primary-bg px-5 py-2.5 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
352
- children: w.isPending ? g("procurement.form.creating", "Creating…") : g("procurement.form.create", "Create request")
368
+ children: S.isPending ? h("procurement.form.creating", "Creating…") : h("procurement.form.create", "Create request")
353
369
  })
354
370
  })
355
371
  ]
@@ -357,6 +373,6 @@ function C() {
357
373
  });
358
374
  }
359
375
  //#endregion
360
- export { C as ProcurementNewPage };
376
+ export { x as ProcurementNewPage };
361
377
 
362
378
  //# sourceMappingURL=ProcurementNewPage.js.map