@openrails/billing-ui 0.274.0 → 0.276.0

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 (179) hide show
  1. package/README.md +10 -1
  2. package/dist/admin/console.d.ts +33 -0
  3. package/dist/admin/context.d.ts +14 -0
  4. package/dist/admin/index.d.ts +1 -0
  5. package/dist/admin/lib/api/endpoints.d.ts +2 -1
  6. package/dist/admin/lib/api/index.d.ts +1 -0
  7. package/dist/admin/lib/api/order-endpoints.d.ts +1 -0
  8. package/dist/admin/lib/api/types.d.ts +2 -12
  9. package/dist/admin/lib/format.d.ts +5 -1
  10. package/dist/admin/lib/order-queries.d.ts +3 -0
  11. package/dist/admin/lib/queries.d.ts +3 -0
  12. package/dist/admin/messages.d.ts +13 -8
  13. package/dist/admin/pages/dashboard/lib.d.ts +1 -0
  14. package/dist/admin/pages/imports/shared.d.ts +1 -0
  15. package/dist/admin/pages/subscriptions/change-subscription-dialog.d.ts +4 -7
  16. package/dist/admin/pages/subscriptions/subscription-change-options.d.ts +6 -15
  17. package/dist/{admin-attempts-Dzipkstg.js → admin-attempts-CP5CWyNR.js} +28 -28
  18. package/dist/{admin-attempts-Dzipkstg.js.map → admin-attempts-CP5CWyNR.js.map} +1 -1
  19. package/dist/{admin-auth-BCl_Tv3t.js → admin-auth-DlIOmwPo.js} +2 -2
  20. package/dist/{admin-auth-BCl_Tv3t.js.map → admin-auth-DlIOmwPo.js.map} +1 -1
  21. package/dist/{admin-badge-kmYQM9Ge.js → admin-badge-DR_8AhdC.js} +2 -2
  22. package/dist/{admin-badge-kmYQM9Ge.js.map → admin-badge-DR_8AhdC.js.map} +1 -1
  23. package/dist/{admin-button-Cq9ZfX4R.js → admin-button-DBzTD6By.js} +2 -2
  24. package/dist/{admin-button-Cq9ZfX4R.js.map → admin-button-DBzTD6By.js.map} +1 -1
  25. package/dist/{admin-capabilities-k5fQZhN9.js → admin-capabilities-CZdT1Pxe.js} +2 -2
  26. package/dist/{admin-capabilities-k5fQZhN9.js.map → admin-capabilities-CZdT1Pxe.js.map} +1 -1
  27. package/dist/{admin-card-C8k67jJv.js → admin-card-mZl4-s5d.js} +2 -2
  28. package/dist/{admin-card-C8k67jJv.js.map → admin-card-mZl4-s5d.js.map} +1 -1
  29. package/dist/{admin-catalog-CON-GwKL.js → admin-catalog-DpTjS0Yo.js} +38 -38
  30. package/dist/{admin-catalog-CON-GwKL.js.map → admin-catalog-DpTjS0Yo.js.map} +1 -1
  31. package/dist/{admin-cursor-pager-DqFruoNu.js → admin-cursor-pager-C-KjCIy9.js} +4 -4
  32. package/dist/{admin-cursor-pager-DqFruoNu.js.map → admin-cursor-pager-C-KjCIy9.js.map} +1 -1
  33. package/dist/{admin-customers-CWWOrcVR.js → admin-customers-BE3N839X.js} +12 -12
  34. package/dist/{admin-customers-CWWOrcVR.js.map → admin-customers-BE3N839X.js.map} +1 -1
  35. package/dist/{admin-dashboard-BiShWFk2.js → admin-dashboard-BxjkV15J.js} +25 -17
  36. package/dist/admin-dashboard-BxjkV15J.js.map +1 -0
  37. package/dist/{admin-data-table-CdsjYJh5.js → admin-data-table-D89AwWz_.js} +5 -5
  38. package/dist/{admin-data-table-CdsjYJh5.js.map → admin-data-table-D89AwWz_.js.map} +1 -1
  39. package/dist/{admin-detail-BWSC1aCH.js → admin-detail-BKe9xqPd.js} +41 -41
  40. package/dist/{admin-detail-BWSC1aCH.js.map → admin-detail-BKe9xqPd.js.map} +1 -1
  41. package/dist/admin-detail-C8lD7U2t.js +699 -0
  42. package/dist/admin-detail-C8lD7U2t.js.map +1 -0
  43. package/dist/{admin-detail-CMmhZQ2A.js → admin-detail-D6zD085K.js} +45 -37
  44. package/dist/admin-detail-D6zD085K.js.map +1 -0
  45. package/dist/{admin-detail-Cyuf_i9U.js → admin-detail-Ln56otK0.js} +40 -40
  46. package/dist/{admin-detail-Cyuf_i9U.js.map → admin-detail-Ln56otK0.js.map} +1 -1
  47. package/dist/{admin-detail-CiONe1Pt.js → admin-detail-P-UnNvXJ.js} +171 -171
  48. package/dist/admin-detail-P-UnNvXJ.js.map +1 -0
  49. package/dist/{admin-dialog-Ch7rTOCr.js → admin-dialog-Dn2FRJu4.js} +3 -3
  50. package/dist/{admin-dialog-Ch7rTOCr.js.map → admin-dialog-Dn2FRJu4.js.map} +1 -1
  51. package/dist/{admin-dropdown-menu-Bah3f8AZ.js → admin-dropdown-menu-DLUn6Uj3.js} +2 -2
  52. package/dist/{admin-dropdown-menu-Bah3f8AZ.js.map → admin-dropdown-menu-DLUn6Uj3.js.map} +1 -1
  53. package/dist/{admin-dunning-B2zgtrOo.js → admin-dunning-COaHzrmN.js} +2 -2
  54. package/dist/{admin-dunning-B2zgtrOo.js.map → admin-dunning-COaHzrmN.js.map} +1 -1
  55. package/dist/{admin-fact-card-Bt__Cd_U.js → admin-fact-card-DKvBnUXB.js} +2 -2
  56. package/dist/{admin-fact-card-Bt__Cd_U.js.map → admin-fact-card-DKvBnUXB.js.map} +1 -1
  57. package/dist/admin-format-BbiTCqUG.js +171 -0
  58. package/dist/admin-format-BbiTCqUG.js.map +1 -0
  59. package/dist/{admin-health-pzTO6_0v.js → admin-health-DmnI4e8K.js} +10 -10
  60. package/dist/{admin-health-pzTO6_0v.js.map → admin-health-DmnI4e8K.js.map} +1 -1
  61. package/dist/{admin-imports-tT5et8-V.js → admin-imports-C0aMP6sj.js} +18 -18
  62. package/dist/{admin-imports-tT5et8-V.js.map → admin-imports-C0aMP6sj.js.map} +1 -1
  63. package/dist/{admin-input-DvRZy_2a.js → admin-input-JKrQIGfD.js} +2 -2
  64. package/dist/{admin-input-DvRZy_2a.js.map → admin-input-JKrQIGfD.js.map} +1 -1
  65. package/dist/{admin-label-QZtWJGH-.js → admin-label-CHWsVIZC.js} +2 -2
  66. package/dist/{admin-label-QZtWJGH-.js.map → admin-label-CHWsVIZC.js.map} +1 -1
  67. package/dist/{admin-linked-table-row-6jkCKwMn.js → admin-linked-table-row-BMZYYsuk.js} +3 -3
  68. package/dist/{admin-linked-table-row-6jkCKwMn.js.map → admin-linked-table-row-BMZYYsuk.js.map} +1 -1
  69. package/dist/{admin-map-dialog-BV54mvMQ.js → admin-map-dialog-BHUGdCcv.js} +10 -10
  70. package/dist/{admin-map-dialog-BV54mvMQ.js.map → admin-map-dialog-BHUGdCcv.js.map} +1 -1
  71. package/dist/{admin-metering-Bv5EcX6M.js → admin-metering-CDqueHUh.js} +15 -15
  72. package/dist/{admin-metering-Bv5EcX6M.js.map → admin-metering-CDqueHUh.js.map} +1 -1
  73. package/dist/{admin-missing-record-BXqGFDt3.js → admin-missing-record-BPFs3MmO.js} +2 -2
  74. package/dist/{admin-missing-record-BXqGFDt3.js.map → admin-missing-record-BPFs3MmO.js.map} +1 -1
  75. package/dist/{admin-ops-h3RjpcNu.js → admin-ops-CL2kjDwi.js} +18 -15
  76. package/dist/admin-ops-CL2kjDwi.js.map +1 -0
  77. package/dist/admin-orders-C1Sf2qhc.js +192 -0
  78. package/dist/admin-orders-C1Sf2qhc.js.map +1 -0
  79. package/dist/admin-parked-a0tB5bhG.js +193 -0
  80. package/dist/admin-parked-a0tB5bhG.js.map +1 -0
  81. package/dist/admin-payments-DJcjwRA4.js +221 -0
  82. package/dist/admin-payments-DJcjwRA4.js.map +1 -0
  83. package/dist/{admin-price-detail-BjWYU5A-.js → admin-price-detail-BOmeWw15.js} +15 -15
  84. package/dist/{admin-price-detail-BjWYU5A-.js.map → admin-price-detail-BOmeWw15.js.map} +1 -1
  85. package/dist/{admin-price-format-BVUpDoSC.js → admin-price-format-CqOmHrIn.js} +2 -2
  86. package/dist/{admin-price-format-BVUpDoSC.js.map → admin-price-format-CqOmHrIn.js.map} +1 -1
  87. package/dist/{admin-price-wizard-CTbkbmYc.js → admin-price-wizard-B6s5OJeO.js} +9 -9
  88. package/dist/{admin-price-wizard-CTbkbmYc.js.map → admin-price-wizard-B6s5OJeO.js.map} +1 -1
  89. package/dist/{admin-proposals-Ci9Q8j7Y.js → admin-proposals-DVrl-ym4.js} +20 -20
  90. package/dist/{admin-proposals-Ci9Q8j7Y.js.map → admin-proposals-DVrl-ym4.js.map} +1 -1
  91. package/dist/admin-provider-prices-BVVogH7Q.js +241 -0
  92. package/dist/admin-provider-prices-BVVogH7Q.js.map +1 -0
  93. package/dist/{admin-range-picker-nfflPp21.js → admin-range-picker-C6BtSm2B.js} +5 -5
  94. package/dist/{admin-range-picker-nfflPp21.js.map → admin-range-picker-C6BtSm2B.js.map} +1 -1
  95. package/dist/{admin-records-CrTCorWH.js → admin-records-DKtcgN11.js} +19 -19
  96. package/dist/{admin-records-CrTCorWH.js.map → admin-records-DKtcgN11.js.map} +1 -1
  97. package/dist/{admin-reports-BO6wrvtw.js → admin-reports-CtPoiceH.js} +8 -8
  98. package/dist/{admin-reports-BO6wrvtw.js.map → admin-reports-CtPoiceH.js.map} +1 -1
  99. package/dist/{admin-select-DvfJ80Rg.js → admin-select-6Yuh5M1Q.js} +2 -2
  100. package/dist/{admin-select-DvfJ80Rg.js.map → admin-select-6Yuh5M1Q.js.map} +1 -1
  101. package/dist/{admin-settings-BOoTzhyf.js → admin-settings-DscHu4ww.js} +560 -550
  102. package/dist/admin-settings-DscHu4ww.js.map +1 -0
  103. package/dist/{admin-shared-BbGT_qTo.js → admin-shared-BywM-MMp.js} +13 -9
  104. package/dist/{admin-shared-BbGT_qTo.js.map → admin-shared-BywM-MMp.js.map} +1 -1
  105. package/dist/{admin-skeleton-B2a4ScVE.js → admin-skeleton-lndmw89u.js} +2 -2
  106. package/dist/{admin-skeleton-B2a4ScVE.js.map → admin-skeleton-lndmw89u.js.map} +1 -1
  107. package/dist/{admin-status-badge-Bp6cssXY.js → admin-status-badge-IL8ofZ_6.js} +3 -3
  108. package/dist/{admin-status-badge-Bp6cssXY.js.map → admin-status-badge-IL8ofZ_6.js.map} +1 -1
  109. package/dist/{admin-subscriptions-D9JmoicC.js → admin-subscriptions-Cd5CGrue.js} +83 -87
  110. package/dist/admin-subscriptions-Cd5CGrue.js.map +1 -0
  111. package/dist/{admin-switch-DBBxJRZP.js → admin-switch-DpwQSzEm.js} +2 -2
  112. package/dist/{admin-switch-DBBxJRZP.js.map → admin-switch-DpwQSzEm.js.map} +1 -1
  113. package/dist/{admin-table-CPDoVfK4.js → admin-table-D-GdGM1m.js} +2 -2
  114. package/dist/{admin-table-CPDoVfK4.js.map → admin-table-D-GdGM1m.js.map} +1 -1
  115. package/dist/admin-tabs-B--1flzO.js +158 -0
  116. package/dist/admin-tabs-B--1flzO.js.map +1 -0
  117. package/dist/{admin-textarea-d3fu_waS.js → admin-textarea-xsp5V9xM.js} +2 -2
  118. package/dist/{admin-textarea-d3fu_waS.js.map → admin-textarea-xsp5V9xM.js.map} +1 -1
  119. package/dist/{admin-typed-confirm-dialog-BVklYjFo.js → admin-typed-confirm-dialog-NiEDwX_0.js} +6 -6
  120. package/dist/{admin-typed-confirm-dialog-BVklYjFo.js.map → admin-typed-confirm-dialog-NiEDwX_0.js.map} +1 -1
  121. package/dist/{admin-utils-DTT53IpS.js → admin-utils-wuPUD0uh.js} +152 -137
  122. package/dist/admin-utils-wuPUD0uh.js.map +1 -0
  123. package/dist/{admin-widget-viz-Exsqz3Dw.js → admin-widget-viz-kHHVmDEx.js} +215 -187
  124. package/dist/admin-widget-viz-kHHVmDEx.js.map +1 -0
  125. package/dist/admin.css +1 -1
  126. package/dist/admin.js +581 -434
  127. package/dist/admin.js.map +1 -1
  128. package/dist/client/generated/routes.d.ts +17 -0
  129. package/dist/client/generated/wire.d.ts +4 -0
  130. package/dist/client/types.d.ts +6 -0
  131. package/dist/{client-BYgnI6_h.js → client-ctrbivyN.js} +3 -2
  132. package/dist/client-ctrbivyN.js.map +1 -0
  133. package/dist/client.js +1 -1
  134. package/dist/{hooks-t2tSrCpa.js → hooks-KpTetx6F.js} +2 -2
  135. package/dist/{hooks-t2tSrCpa.js.map → hooks-KpTetx6F.js.map} +1 -1
  136. package/dist/index.js +750 -711
  137. package/dist/index.js.map +1 -1
  138. package/dist/lib/card-brands.d.ts +1 -0
  139. package/dist/locales/de.js +3 -0
  140. package/dist/locales/de.js.map +1 -1
  141. package/dist/locales/en.d.ts +3 -0
  142. package/dist/locales/en.js +3 -0
  143. package/dist/locales/en.js.map +1 -1
  144. package/dist/locales/es.js +3 -0
  145. package/dist/locales/es.js.map +1 -1
  146. package/dist/locales/ja.js +3 -0
  147. package/dist/locales/ja.js.map +1 -1
  148. package/dist/locales/ko.js +3 -0
  149. package/dist/locales/ko.js.map +1 -1
  150. package/dist/locales/zh.js +3 -0
  151. package/dist/locales/zh.js.map +1 -1
  152. package/dist/react.js +1 -1
  153. package/dist/styles.css +1 -1
  154. package/package.json +6 -2
  155. package/dist/admin-customer-search-CJHB80rg.js +0 -117
  156. package/dist/admin-customer-search-CJHB80rg.js.map +0 -1
  157. package/dist/admin-dashboard-BiShWFk2.js.map +0 -1
  158. package/dist/admin-detail-CKRtK43V.js +0 -728
  159. package/dist/admin-detail-CKRtK43V.js.map +0 -1
  160. package/dist/admin-detail-CMmhZQ2A.js.map +0 -1
  161. package/dist/admin-detail-CiONe1Pt.js.map +0 -1
  162. package/dist/admin-format-DoohJ7Fg.js +0 -136
  163. package/dist/admin-format-DoohJ7Fg.js.map +0 -1
  164. package/dist/admin-ops-h3RjpcNu.js.map +0 -1
  165. package/dist/admin-orders-DYxPiuTl.js +0 -192
  166. package/dist/admin-orders-DYxPiuTl.js.map +0 -1
  167. package/dist/admin-parked-ClKA60d5.js +0 -193
  168. package/dist/admin-parked-ClKA60d5.js.map +0 -1
  169. package/dist/admin-payments-BlIuy3wL.js +0 -220
  170. package/dist/admin-payments-BlIuy3wL.js.map +0 -1
  171. package/dist/admin-provider-prices-B6Ayq-eN.js +0 -246
  172. package/dist/admin-provider-prices-B6Ayq-eN.js.map +0 -1
  173. package/dist/admin-settings-BOoTzhyf.js.map +0 -1
  174. package/dist/admin-subscriptions-D9JmoicC.js.map +0 -1
  175. package/dist/admin-tabs-DDUv3kiu.js +0 -46
  176. package/dist/admin-tabs-DDUv3kiu.js.map +0 -1
  177. package/dist/admin-utils-DTT53IpS.js.map +0 -1
  178. package/dist/admin-widget-viz-Exsqz3Dw.js.map +0 -1
  179. package/dist/client-BYgnI6_h.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { E as e, O as t, f as n, l as r, p as i, w as a } from "./admin-utils-DTT53IpS.js";
2
- import { t as o } from "./admin-button-Cq9ZfX4R.js";
3
- import { t as s } from "./admin-input-DvRZy_2a.js";
4
- import { a as c, d as l, i as u, n as d, u as f } from "./admin-capabilities-k5fQZhN9.js";
5
- import { n as p, o as m, s as h, t as g } from "./admin-format-DoohJ7Fg.js";
6
- import { n as _ } from "./admin-confirm-katGq0Qo.js";
7
- import { t as v } from "./admin-badge-kmYQM9Ge.js";
8
- import { t as y } from "./admin-form-field-errors-hbUMIriS.js";
9
- import { a as b, i as x, n as S, r as C, t as w } from "./admin-select-DvfJ80Rg.js";
10
- import { a as T, n as ee, o as te, r as E, s as D, t as ne } from "./admin-table-CPDoVfK4.js";
11
- import { a as O, i as k, n as A, o as j, r as M, s as N, t as P } from "./admin-dialog-Ch7rTOCr.js";
12
- import { t as F } from "./admin-label-QZtWJGH-.js";
13
- import { t as re } from "./admin-switch-DBBxJRZP.js";
14
- import { r as I } from "./admin-dialog-width-CC7QHT1p.js";
15
- import { t as ie } from "./admin-typed-confirm-dialog-BVklYjFo.js";
16
- import { i as L, n as R, r as ae, t as oe } from "./admin-tabs-DDUv3kiu.js";
17
- import * as z from "react";
18
- import { useMutation as B, useQuery as V, useQueryClient as H } from "@tanstack/react-query";
19
- import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
20
- import { HugeiconsIcon as se } from "@hugeicons/react";
21
- import { Add01Icon as ce, Delete02Icon as le } from "@hugeicons/core-free-icons";
22
- import { useForm as K } from "@tanstack/react-form";
1
+ import { E as e, O as t, f as n, l as r, p as i, w as a } from "./admin-utils-wuPUD0uh.js";
2
+ import { t as o } from "./admin-button-DBzTD6By.js";
3
+ import { t as s } from "./admin-input-JKrQIGfD.js";
4
+ import { a as c, d as l, i as u, n as d, u as f } from "./admin-capabilities-CZdT1Pxe.js";
5
+ import { h as p, n as m, o as h, r as g, s as _, t as v } from "./admin-format-BbiTCqUG.js";
6
+ import { n as ee } from "./admin-confirm-katGq0Qo.js";
7
+ import { t as y } from "./admin-badge-DR_8AhdC.js";
8
+ import { t as b } from "./admin-form-field-errors-hbUMIriS.js";
9
+ import { a as x, i as S, n as C, r as w, t as T } from "./admin-select-6Yuh5M1Q.js";
10
+ import { a as E, n as D, o as O, r as k, s as A, t as j } from "./admin-table-D-GdGM1m.js";
11
+ import { a as M, i as N, n as P, o as F, r as te, s as ne, t as re } from "./admin-dialog-Dn2FRJu4.js";
12
+ import { t as I } from "./admin-label-CHWsVIZC.js";
13
+ import { t as ie } from "./admin-switch-DpwQSzEm.js";
14
+ import { r as L } from "./admin-dialog-width-CC7QHT1p.js";
15
+ import { t as ae } from "./admin-typed-confirm-dialog-NiEDwX_0.js";
16
+ import { a as oe, i as R, n as z, r as se, t as ce } from "./admin-tabs-B--1flzO.js";
17
+ import * as B from "react";
18
+ import { useMutation as V, useQuery as H, useQueryClient as U } from "@tanstack/react-query";
19
+ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
20
+ import { HugeiconsIcon as q } from "@hugeicons/react";
21
+ import { Add01Icon as le, Cancel01Icon as ue, Delete02Icon as de } from "@hugeicons/core-free-icons";
22
+ import { useForm as J } from "@tanstack/react-form";
23
23
  //#region src/admin/pages/settings/configuration-edit.ts
24
- function q(e) {
25
- let { toast: t, toastApiError: n, toastStaleEdit: r, adminMutations: o } = i(), [s, c] = z.useState(null), l = H(), u = B(o.updateMerchantConfiguration(l));
24
+ function Y(e) {
25
+ let { toast: t, toastApiError: n, toastStaleEdit: r, adminMutations: o } = i(), [s, c] = B.useState(null), l = U(), u = V(o.updateMerchantConfiguration(l));
26
26
  return {
27
27
  editing: s !== null,
28
28
  open: () => {
@@ -47,45 +47,45 @@ function q(e) {
47
47
  }
48
48
  //#endregion
49
49
  //#region src/admin/pages/settings/setting-fields.tsx
50
- function J() {
51
- let { adminQueries: t } = i(), { data: n } = V(t.config());
52
- return !n || n.capabilities.features?.merchant_config_edits ? null : /* @__PURE__ */ W("p", {
50
+ function fe() {
51
+ let { adminQueries: t } = i(), { data: n } = H(t.config());
52
+ return !n || n.capabilities.features?.merchant_config_edits ? null : /* @__PURE__ */ G("p", {
53
53
  className: "rounded-md border px-3 py-2 text-sm text-muted-foreground",
54
- children: /* @__PURE__ */ W(e, { id: "Read-only: this merchant's configuration comes from a file. Change it there." })
54
+ children: /* @__PURE__ */ G(e, { id: "Read-only: this merchant's configuration comes from a file. Change it there." })
55
55
  });
56
56
  }
57
- function Y({ edits: t, editing: n, form: r, saving: i, canSave: a = !0, onEdit: s, onCancel: c }) {
58
- return t ? n ? /* @__PURE__ */ G("div", {
57
+ function pe({ edits: t, editing: n, form: r, saving: i, canSave: a = !0, onEdit: s, onCancel: c }) {
58
+ return t ? n ? /* @__PURE__ */ K("div", {
59
59
  className: "flex items-center gap-2",
60
- children: [/* @__PURE__ */ W(o, {
60
+ children: [/* @__PURE__ */ G(o, {
61
61
  type: "button",
62
62
  variant: "outline",
63
63
  size: "sm",
64
64
  disabled: i,
65
65
  onClick: c,
66
- children: /* @__PURE__ */ W(e, { id: "Cancel" })
67
- }), /* @__PURE__ */ W(o, {
66
+ children: /* @__PURE__ */ G(e, { id: "Cancel" })
67
+ }), /* @__PURE__ */ G(o, {
68
68
  type: "submit",
69
69
  size: "sm",
70
70
  form: r,
71
71
  disabled: !a || i,
72
72
  children: i ? "Saving…" : "Save"
73
73
  })]
74
- }) : /* @__PURE__ */ W(o, {
74
+ }) : /* @__PURE__ */ G(o, {
75
75
  type: "button",
76
76
  variant: "outline",
77
77
  size: "sm",
78
78
  onClick: s,
79
- children: /* @__PURE__ */ W(e, { id: "Edit" })
79
+ children: /* @__PURE__ */ G(e, { id: "Edit" })
80
80
  }) : null;
81
81
  }
82
82
  function X({ label: e, value: t }) {
83
- return /* @__PURE__ */ G("div", {
83
+ return /* @__PURE__ */ K("div", {
84
84
  className: "grid gap-1.5 md:grid-cols-[11rem_minmax(0,1fr)] md:gap-6",
85
- children: [/* @__PURE__ */ W("dt", {
85
+ children: [/* @__PURE__ */ G("dt", {
86
86
  className: "text-sm text-muted-foreground",
87
87
  children: e
88
- }), /* @__PURE__ */ W("dd", {
88
+ }), /* @__PURE__ */ G("dd", {
89
89
  className: t ? "min-w-0 text-sm break-words" : "text-sm text-muted-foreground",
90
90
  children: t || "Not set"
91
91
  })]
@@ -93,12 +93,12 @@ function X({ label: e, value: t }) {
93
93
  }
94
94
  function Z({ label: e, id: n, children: r }) {
95
95
  let { id: i } = t();
96
- return /* @__PURE__ */ G("div", {
96
+ return /* @__PURE__ */ K("div", {
97
97
  className: "grid gap-2 md:grid-cols-[11rem_minmax(0,1fr)] md:items-center md:gap-6",
98
- children: [/* @__PURE__ */ W(F, {
98
+ children: [/* @__PURE__ */ G(I, {
99
99
  htmlFor: i(n),
100
100
  children: e
101
- }), /* @__PURE__ */ W("div", {
101
+ }), /* @__PURE__ */ G("div", {
102
102
  className: "min-w-0",
103
103
  children: r
104
104
  })]
@@ -106,20 +106,20 @@ function Z({ label: e, id: n, children: r }) {
106
106
  }
107
107
  //#endregion
108
108
  //#region src/admin/pages/settings/notifications.tsx
109
- function ue() {
110
- let { adminQueries: t } = i(), n = V(t.merchantConfiguration("Load settings")), r = V(t.webhooks()), a = l(), o = r.data?.data ?? [];
111
- return /* @__PURE__ */ G("div", {
109
+ function me() {
110
+ let { adminQueries: t } = i(), n = H(t.merchantConfiguration("Load settings")), r = H(t.webhooks()), a = l(), o = r.data?.data ?? [];
111
+ return /* @__PURE__ */ K("div", {
112
112
  className: "flex flex-col gap-10",
113
113
  children: [
114
- /* @__PURE__ */ W(J, {}),
115
- n.data ? /* @__PURE__ */ W(de, {
114
+ /* @__PURE__ */ G(fe, {}),
115
+ n.data ? /* @__PURE__ */ G(he, {
116
116
  configuration: n.data,
117
117
  edits: a
118
- }) : /* @__PURE__ */ W("p", {
118
+ }) : /* @__PURE__ */ G("p", {
119
119
  className: "text-sm text-muted-foreground",
120
- children: /* @__PURE__ */ W(e, { id: "Loading…" })
120
+ children: /* @__PURE__ */ G(e, { id: "Loading…" })
121
121
  }),
122
- /* @__PURE__ */ W(pe, {
122
+ /* @__PURE__ */ G(_e, {
123
123
  webhooks: o,
124
124
  loading: r.isPending,
125
125
  edits: a
@@ -127,27 +127,27 @@ function ue() {
127
127
  ]
128
128
  });
129
129
  }
130
- function de({ configuration: n, edits: r }) {
131
- let { id: i, text: a } = t(), o = n.alert_email ?? "", c = q(n), l = K({
130
+ function he({ configuration: n, edits: r }) {
131
+ let { id: i, text: a } = t(), o = n.alert_email ?? "", c = Y(n), l = J({
132
132
  defaultValues: { email: o },
133
133
  onSubmit: ({ value: e }) => c.save({ alert_email: e.email.trim() }, e.email.trim() ? "Alert email saved" : "Alert email cleared", "Save alert email")
134
134
  });
135
- return /* @__PURE__ */ G("section", {
135
+ return /* @__PURE__ */ K("section", {
136
136
  className: "grid gap-5",
137
- children: [/* @__PURE__ */ G("div", {
137
+ children: [/* @__PURE__ */ K("div", {
138
138
  className: "flex flex-wrap items-start justify-between gap-4",
139
- children: [/* @__PURE__ */ G("div", {
139
+ children: [/* @__PURE__ */ K("div", {
140
140
  className: "grid gap-1",
141
- children: [/* @__PURE__ */ W("h2", {
141
+ children: [/* @__PURE__ */ G("h2", {
142
142
  className: "text-base font-semibold",
143
- children: /* @__PURE__ */ W(e, { id: "Email delivery" })
144
- }), /* @__PURE__ */ W("p", {
143
+ children: /* @__PURE__ */ G(e, { id: "Email delivery" })
144
+ }), /* @__PURE__ */ G("p", {
145
145
  className: "text-sm text-muted-foreground",
146
- children: /* @__PURE__ */ W(e, { id: "Send email alerts to this address." })
146
+ children: /* @__PURE__ */ G(e, { id: "Send email alerts to this address." })
147
147
  })]
148
- }), /* @__PURE__ */ W(l.Subscribe, {
148
+ }), /* @__PURE__ */ G(l.Subscribe, {
149
149
  selector: (e) => e.isSubmitting,
150
- children: (e) => /* @__PURE__ */ W(Y, {
150
+ children: (e) => /* @__PURE__ */ G(pe, {
151
151
  edits: r,
152
152
  editing: c.editing,
153
153
  form: "alert-email-form",
@@ -158,17 +158,17 @@ function de({ configuration: n, edits: r }) {
158
158
  onCancel: c.close
159
159
  })
160
160
  })]
161
- }), c.editing ? /* @__PURE__ */ W("form", {
161
+ }), c.editing ? /* @__PURE__ */ G("form", {
162
162
  id: i("alert-email-form"),
163
163
  onSubmit: (e) => {
164
164
  e.preventDefault(), e.stopPropagation(), l.handleSubmit();
165
165
  },
166
- children: /* @__PURE__ */ W(l.Field, {
166
+ children: /* @__PURE__ */ G(l.Field, {
167
167
  name: "email",
168
- children: (e) => /* @__PURE__ */ W(Z, {
168
+ children: (e) => /* @__PURE__ */ G(Z, {
169
169
  label: a("Alert email"),
170
170
  id: "alert-email",
171
- children: /* @__PURE__ */ W(s, {
171
+ children: /* @__PURE__ */ G(s, {
172
172
  id: i("alert-email"),
173
173
  type: "email",
174
174
  placeholder: a("alerts@example.com"),
@@ -178,13 +178,13 @@ function de({ configuration: n, edits: r }) {
178
178
  })
179
179
  })
180
180
  })
181
- }) : /* @__PURE__ */ W("dl", { children: /* @__PURE__ */ W(X, {
181
+ }) : /* @__PURE__ */ G("dl", { children: /* @__PURE__ */ G(X, {
182
182
  label: a("Alert email"),
183
183
  value: o
184
184
  }) })]
185
185
  });
186
186
  }
187
- var fe = [
187
+ var ge = [
188
188
  {
189
189
  value: "generic",
190
190
  label: "Generic (your own receiver)"
@@ -198,100 +198,100 @@ var fe = [
198
198
  label: "Slack"
199
199
  }
200
200
  ];
201
- function pe({ webhooks: t, loading: n, edits: r }) {
202
- return /* @__PURE__ */ G("section", {
201
+ function _e({ webhooks: t, loading: n, edits: r }) {
202
+ return /* @__PURE__ */ K("section", {
203
203
  className: "grid gap-5",
204
- children: [/* @__PURE__ */ G("div", {
204
+ children: [/* @__PURE__ */ K("div", {
205
205
  className: "flex flex-wrap items-start justify-between gap-4",
206
- children: [/* @__PURE__ */ G("div", {
206
+ children: [/* @__PURE__ */ K("div", {
207
207
  className: "grid max-w-2xl gap-1",
208
- children: [/* @__PURE__ */ W("h2", {
208
+ children: [/* @__PURE__ */ G("h2", {
209
209
  className: "text-base font-semibold",
210
- children: /* @__PURE__ */ W(e, { id: "Webhooks" })
211
- }), /* @__PURE__ */ W("p", {
210
+ children: /* @__PURE__ */ G(e, { id: "Webhooks" })
211
+ }), /* @__PURE__ */ G("p", {
212
212
  className: "text-sm text-pretty text-muted-foreground",
213
- children: /* @__PURE__ */ W(e, { id: "Send alerts to Discord, Slack, or your own endpoint." })
213
+ children: /* @__PURE__ */ G(e, { id: "Send alerts to Discord, Slack, or your own endpoint." })
214
214
  })]
215
- }), r && /* @__PURE__ */ W(he, {})]
216
- }), n ? /* @__PURE__ */ W("p", {
215
+ }), r && /* @__PURE__ */ G(ye, {})]
216
+ }), n ? /* @__PURE__ */ G("p", {
217
217
  className: "text-sm text-muted-foreground",
218
- children: /* @__PURE__ */ W(e, { id: "Loading…" })
219
- }) : t.length === 0 ? /* @__PURE__ */ W("p", {
218
+ children: /* @__PURE__ */ G(e, { id: "Loading…" })
219
+ }) : t.length === 0 ? /* @__PURE__ */ G("p", {
220
220
  className: "py-2 text-sm text-muted-foreground",
221
- children: /* @__PURE__ */ W(e, { id: "No webhooks configured." })
222
- }) : /* @__PURE__ */ G(ne, {
221
+ children: /* @__PURE__ */ G(e, { id: "No webhooks configured." })
222
+ }) : /* @__PURE__ */ K(j, {
223
223
  className: "min-w-[36rem]",
224
- children: [/* @__PURE__ */ W(te, { children: /* @__PURE__ */ G(D, {
224
+ children: [/* @__PURE__ */ G(O, { children: /* @__PURE__ */ K(A, {
225
225
  className: "hover:bg-transparent",
226
226
  children: [
227
- /* @__PURE__ */ W(T, {
227
+ /* @__PURE__ */ G(E, {
228
228
  className: "text-muted-foreground",
229
- children: /* @__PURE__ */ W(e, { id: "Name" })
229
+ children: /* @__PURE__ */ G(e, { id: "Name" })
230
230
  }),
231
- /* @__PURE__ */ W(T, {
231
+ /* @__PURE__ */ G(E, {
232
232
  className: "text-muted-foreground",
233
- children: /* @__PURE__ */ W(e, { id: "Format" })
233
+ children: /* @__PURE__ */ G(e, { id: "Format" })
234
234
  }),
235
- /* @__PURE__ */ W(T, {
235
+ /* @__PURE__ */ G(E, {
236
236
  className: "text-muted-foreground",
237
237
  children: "URL"
238
238
  }),
239
- r && /* @__PURE__ */ W(T, {
239
+ r && /* @__PURE__ */ G(E, {
240
240
  className: "text-right text-muted-foreground",
241
- children: /* @__PURE__ */ W(e, { id: "Action" })
241
+ children: /* @__PURE__ */ G(e, { id: "Action" })
242
242
  })
243
243
  ]
244
- }) }), /* @__PURE__ */ W(ee, { children: t.map((e) => /* @__PURE__ */ W(me, {
244
+ }) }), /* @__PURE__ */ G(D, { children: t.map((e) => /* @__PURE__ */ G(ve, {
245
245
  webhook: e,
246
246
  edits: r
247
247
  }, e.id)) })]
248
248
  })]
249
249
  });
250
250
  }
251
- function me({ webhook: n, edits: r }) {
252
- let { toast: a, toastApiError: s, adminMutations: c } = i(), { text: l } = t(), [u, d] = z.useState(!1), f = H(), p = B(c.deleteWebhook(f)), m = n.name ?? n.destination_host;
253
- return /* @__PURE__ */ G(D, {
251
+ function ve({ webhook: n, edits: r }) {
252
+ let { toast: a, toastApiError: s, adminMutations: c } = i(), { text: l } = t(), [u, d] = B.useState(!1), f = U(), p = V(c.deleteWebhook(f)), m = n.name ?? n.destination_host;
253
+ return /* @__PURE__ */ K(A, {
254
254
  className: n.enabled ? void 0 : "opacity-60",
255
255
  children: [
256
- /* @__PURE__ */ W(E, {
256
+ /* @__PURE__ */ G(k, {
257
257
  className: "py-3 font-medium",
258
258
  children: m
259
259
  }),
260
- /* @__PURE__ */ W(E, {
260
+ /* @__PURE__ */ G(k, {
261
261
  className: "py-3",
262
- children: /* @__PURE__ */ G("span", {
262
+ children: /* @__PURE__ */ K("span", {
263
263
  className: "flex flex-wrap gap-1",
264
- children: [/* @__PURE__ */ W(v, {
264
+ children: [/* @__PURE__ */ G(y, {
265
265
  variant: "secondary",
266
266
  children: n.format
267
- }), !n.enabled && /* @__PURE__ */ W(v, {
267
+ }), !n.enabled && /* @__PURE__ */ G(y, {
268
268
  variant: "outline",
269
- children: /* @__PURE__ */ W(e, { id: "disabled" })
269
+ children: /* @__PURE__ */ G(e, { id: "disabled" })
270
270
  })]
271
271
  })
272
272
  }),
273
- /* @__PURE__ */ W(E, {
273
+ /* @__PURE__ */ G(k, {
274
274
  className: "max-w-[22rem] truncate py-3 text-xs text-muted-foreground",
275
275
  title: n.destination_host,
276
276
  children: n.destination_host
277
277
  }),
278
- r && /* @__PURE__ */ W(E, {
278
+ r && /* @__PURE__ */ G(k, {
279
279
  className: "py-3 text-right",
280
- children: /* @__PURE__ */ G("div", {
280
+ children: /* @__PURE__ */ K("div", {
281
281
  className: "flex justify-end gap-1",
282
282
  children: [
283
- /* @__PURE__ */ W(he, { webhook: n }),
284
- /* @__PURE__ */ W(o, {
283
+ /* @__PURE__ */ G(ye, { webhook: n }),
284
+ /* @__PURE__ */ G(o, {
285
285
  variant: "ghost",
286
286
  size: "icon",
287
287
  "aria-label": l("Delete webhook"),
288
288
  onClick: () => d(!0),
289
- children: /* @__PURE__ */ W(se, {
290
- icon: le,
289
+ children: /* @__PURE__ */ G(q, {
290
+ icon: de,
291
291
  className: "size-4 text-muted-foreground"
292
292
  })
293
293
  }),
294
- /* @__PURE__ */ W(ie, {
294
+ /* @__PURE__ */ G(ae, {
295
295
  open: u,
296
296
  onOpenChange: d,
297
297
  title: `Delete "${m}"?`,
@@ -312,13 +312,13 @@ function me({ webhook: n, edits: r }) {
312
312
  ]
313
313
  });
314
314
  }
315
- function he({ webhook: n }) {
316
- let { toast: r, toastApiError: a, adminMutations: c } = i(), { id: l, text: u } = t(), [d, f] = z.useState(!1), p = H(), m = B(c.createWebhook(p)), h = B(c.updateWebhook(p)), g = () => ({
315
+ function ye({ webhook: n }) {
316
+ let { toast: r, toastApiError: a, adminMutations: c } = i(), { id: l, text: u } = t(), [d, f] = B.useState(!1), p = U(), m = V(c.createWebhook(p)), h = V(c.updateWebhook(p)), g = () => ({
317
317
  name: n?.name ?? "",
318
318
  url: "",
319
319
  format: n?.format ?? "generic",
320
320
  enabled: n?.enabled ?? !0
321
- }), _ = K({
321
+ }), _ = J({
322
322
  defaultValues: g(),
323
323
  onSubmit: async ({ value: e }) => {
324
324
  let t = e.url.trim();
@@ -343,41 +343,41 @@ function he({ webhook: n }) {
343
343
  }), v = (e) => {
344
344
  e ? _.reset(g()) : _.reset(), f(e);
345
345
  };
346
- return /* @__PURE__ */ G(P, {
346
+ return /* @__PURE__ */ K(re, {
347
347
  open: d,
348
348
  onOpenChange: v,
349
- children: [/* @__PURE__ */ W(N, { render: /* @__PURE__ */ G(o, {
349
+ children: [/* @__PURE__ */ G(ne, { render: /* @__PURE__ */ K(o, {
350
350
  size: "sm",
351
351
  variant: "outline",
352
352
  children: [
353
- !n && /* @__PURE__ */ W(se, {
354
- icon: ce,
353
+ !n && /* @__PURE__ */ G(q, {
354
+ icon: le,
355
355
  className: "size-4"
356
356
  }),
357
357
  " ",
358
358
  n ? "Edit" : "Add webhook"
359
359
  ]
360
- }) }), /* @__PURE__ */ G(A, {
361
- className: I,
362
- children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: n ? `Edit ${n.name ?? n.destination_host}` : "Add webhook" }), /* @__PURE__ */ W(M, { children: n ? "The current URL is never shown. Paste a new one to replace it, or leave it blank to keep it." : "Paste a webhook address from Discord, Slack, or your own alert receiver." })] }), /* @__PURE__ */ G("form", {
360
+ }) }), /* @__PURE__ */ K(P, {
361
+ className: L,
362
+ children: [/* @__PURE__ */ K(M, { children: [/* @__PURE__ */ G(F, { children: n ? `Edit ${n.name ?? n.destination_host}` : "Add webhook" }), /* @__PURE__ */ G(te, { children: n ? "The current URL is never shown. Paste a new one to replace it, or leave it blank to keep it." : "Paste a webhook address from Discord, Slack, or your own alert receiver." })] }), /* @__PURE__ */ K("form", {
363
363
  onSubmit: (e) => {
364
364
  e.preventDefault(), e.stopPropagation(), _.handleSubmit();
365
365
  },
366
366
  className: "grid gap-4",
367
- children: [/* @__PURE__ */ G("div", {
367
+ children: [/* @__PURE__ */ K("div", {
368
368
  className: "grid gap-3",
369
369
  children: [
370
- /* @__PURE__ */ W(_.Field, {
370
+ /* @__PURE__ */ G(_.Field, {
371
371
  name: "name",
372
372
  validators: { onChange: ({ value: e }) => n || e.trim() ? void 0 : "Enter a webhook name" },
373
- children: (t) => /* @__PURE__ */ G("div", {
373
+ children: (t) => /* @__PURE__ */ K("div", {
374
374
  className: "grid gap-1.5",
375
375
  children: [
376
- /* @__PURE__ */ W(F, {
376
+ /* @__PURE__ */ G(I, {
377
377
  htmlFor: l("wh-name"),
378
- children: /* @__PURE__ */ W(e, { id: "Name" })
378
+ children: /* @__PURE__ */ G(e, { id: "Name" })
379
379
  }),
380
- /* @__PURE__ */ W(s, {
380
+ /* @__PURE__ */ G(s, {
381
381
  id: l("wh-name"),
382
382
  placeholder: u("e.g. #billing-alerts"),
383
383
  value: t.state.value,
@@ -385,32 +385,32 @@ function he({ webhook: n }) {
385
385
  onChange: (e) => t.handleChange(e.target.value),
386
386
  "aria-invalid": t.state.meta.errors.length > 0
387
387
  }),
388
- /* @__PURE__ */ W(y, { errors: t.state.meta.errors })
388
+ /* @__PURE__ */ G(b, { errors: t.state.meta.errors })
389
389
  ]
390
390
  })
391
391
  }),
392
- /* @__PURE__ */ W(_.Field, {
392
+ /* @__PURE__ */ G(_.Field, {
393
393
  name: "format",
394
- children: (t) => /* @__PURE__ */ G("div", {
394
+ children: (t) => /* @__PURE__ */ K("div", {
395
395
  className: "grid gap-1.5",
396
- children: [/* @__PURE__ */ W(F, {
396
+ children: [/* @__PURE__ */ G(I, {
397
397
  htmlFor: l("wh-format"),
398
- children: /* @__PURE__ */ W(e, { id: "Format" })
399
- }), /* @__PURE__ */ G(w, {
398
+ children: /* @__PURE__ */ G(e, { id: "Format" })
399
+ }), /* @__PURE__ */ K(T, {
400
400
  value: t.state.value,
401
401
  onValueChange: (e) => t.handleChange(e),
402
- children: [/* @__PURE__ */ W(x, {
402
+ children: [/* @__PURE__ */ G(S, {
403
403
  id: l("wh-format"),
404
404
  className: "w-full",
405
- children: /* @__PURE__ */ W(b, {})
406
- }), /* @__PURE__ */ W(S, { children: fe.map((e) => /* @__PURE__ */ W(C, {
405
+ children: /* @__PURE__ */ G(x, {})
406
+ }), /* @__PURE__ */ G(C, { children: ge.map((e) => /* @__PURE__ */ G(w, {
407
407
  value: e.value,
408
408
  children: e.label
409
409
  }, e.value)) })]
410
410
  })]
411
411
  })
412
412
  }),
413
- /* @__PURE__ */ W(_.Field, {
413
+ /* @__PURE__ */ G(_.Field, {
414
414
  name: "url",
415
415
  validators: { onChange: ({ value: e }) => {
416
416
  if (!e.trim()) return n ? void 0 : "Enter a webhook URL";
@@ -421,14 +421,14 @@ function he({ webhook: n }) {
421
421
  return "Enter a valid webhook URL";
422
422
  }
423
423
  } },
424
- children: (t) => /* @__PURE__ */ G("div", {
424
+ children: (t) => /* @__PURE__ */ K("div", {
425
425
  className: "grid gap-1.5",
426
426
  children: [
427
- /* @__PURE__ */ W(F, {
427
+ /* @__PURE__ */ G(I, {
428
428
  htmlFor: l("wh-url"),
429
- children: /* @__PURE__ */ W(e, { id: "Webhook URL" })
429
+ children: /* @__PURE__ */ G(e, { id: "Webhook URL" })
430
430
  }),
431
- /* @__PURE__ */ W(s, {
431
+ /* @__PURE__ */ G(s, {
432
432
  id: l("wh-url"),
433
433
  type: "url",
434
434
  autoComplete: "off",
@@ -439,26 +439,26 @@ function he({ webhook: n }) {
439
439
  onChange: (e) => t.handleChange(e.target.value),
440
440
  "aria-invalid": t.state.meta.errors.length > 0
441
441
  }),
442
- /* @__PURE__ */ W(y, { errors: t.state.meta.errors })
442
+ /* @__PURE__ */ G(b, { errors: t.state.meta.errors })
443
443
  ]
444
444
  })
445
445
  }),
446
- n && /* @__PURE__ */ W(_.Field, {
446
+ n && /* @__PURE__ */ G(_.Field, {
447
447
  name: "enabled",
448
- children: (t) => /* @__PURE__ */ G("div", {
448
+ children: (t) => /* @__PURE__ */ K("div", {
449
449
  className: "flex items-center gap-2",
450
- children: [/* @__PURE__ */ W(re, {
450
+ children: [/* @__PURE__ */ G(ie, {
451
451
  id: l("wh-enabled"),
452
452
  checked: t.state.value,
453
453
  onCheckedChange: t.handleChange
454
- }), /* @__PURE__ */ W(F, {
454
+ }), /* @__PURE__ */ G(I, {
455
455
  htmlFor: l("wh-enabled"),
456
- children: /* @__PURE__ */ W(e, { id: "Enabled" })
456
+ children: /* @__PURE__ */ G(e, { id: "Enabled" })
457
457
  })]
458
458
  })
459
459
  })
460
460
  ]
461
- }), /* @__PURE__ */ W(k, { children: /* @__PURE__ */ W(_.Subscribe, {
461
+ }), /* @__PURE__ */ G(N, { children: /* @__PURE__ */ G(_.Subscribe, {
462
462
  selector: (e) => [
463
463
  e.values.name,
464
464
  e.values.url,
@@ -466,7 +466,7 @@ function he({ webhook: n }) {
466
466
  e.canSubmit,
467
467
  e.isSubmitting
468
468
  ],
469
- children: ([e, t, r, i, a]) => /* @__PURE__ */ W(o, {
469
+ children: ([e, t, r, i, a]) => /* @__PURE__ */ G(o, {
470
470
  type: "submit",
471
471
  disabled: (n ? !r : !e.trim() || !t.trim()) || !i || a,
472
472
  children: a ? "Saving…" : n ? "Save" : "Add webhook"
@@ -478,11 +478,11 @@ function he({ webhook: n }) {
478
478
  }
479
479
  //#endregion
480
480
  //#region src/admin/pages/settings/custody.tsx
481
- function ge() {
482
- let e = i(), t = H(), n = l(), r = V(e.adminQueries.merchantConfiguration()), a = V(e.adminQueries.psps()), s = [...e.queryKeys.settings(), "custodians"], c = V({
481
+ function be() {
482
+ let e = i(), t = U(), n = l(), r = H(e.adminQueries.merchantConfiguration()), a = H(e.adminQueries.psps()), s = [...e.queryKeys.settings(), "custodians"], c = H({
483
483
  queryKey: s,
484
484
  queryFn: ({ signal: t }) => e.listCustodians(t)
485
- }), [u, d] = z.useState(null), [f] = z.useState(() => e.selectedMerchant()), p = () => t.invalidateQueries({ queryKey: e.queryKeys.settings() }), m = B({
485
+ }), [u, d] = B.useState(null), [f] = B.useState(() => e.selectedMerchant()), p = () => t.invalidateQueries({ queryKey: e.queryKeys.settings() }), m = V({
486
486
  mutationFn: async ({ psp: t, custody: n }) => {
487
487
  if (f !== e.selectedMerchant()) throw Error("Merchant changed; reopen settings");
488
488
  let r = a.data?.data.find((e) => e.id === t);
@@ -494,7 +494,7 @@ function ge() {
494
494
  },
495
495
  onSuccess: p,
496
496
  onError: (t) => e.toastApiError(t, "Change card custody")
497
- }), h = B({
497
+ }), h = V({
498
498
  mutationFn: async (t) => {
499
499
  if (!r.data || f !== e.selectedMerchant()) throw Error("Merchant changed; reopen settings");
500
500
  return e.updateMerchantConfiguration({
@@ -508,27 +508,27 @@ function ge() {
508
508
  });
509
509
  if (!r.data || !a.data || !c.data) return null;
510
510
  let g = a.data.data.filter((e) => !e.archived && (e.rail === "nmi" || e.rail === "stripe"));
511
- return /* @__PURE__ */ G("section", {
511
+ return /* @__PURE__ */ K("section", {
512
512
  className: "grid gap-5",
513
513
  "aria-label": "Card vaults",
514
514
  children: [
515
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h2", {
515
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("h2", {
516
516
  className: "text-base font-semibold",
517
517
  children: "Card vaults"
518
- }), /* @__PURE__ */ W("p", {
518
+ }), /* @__PURE__ */ G("p", {
519
519
  className: "text-sm text-muted-foreground",
520
520
  children: "Choose where new cards are stored and which accounts charge them. Existing cards and subscriptions keep their accepted custody."
521
521
  })] }),
522
- /* @__PURE__ */ W("ul", {
522
+ /* @__PURE__ */ G("ul", {
523
523
  className: "grid gap-2",
524
- children: c.data.data.map((e) => /* @__PURE__ */ G("li", {
524
+ children: c.data.data.map((e) => /* @__PURE__ */ K("li", {
525
525
  className: "flex flex-wrap items-center justify-between gap-3 rounded border p-3",
526
- children: [/* @__PURE__ */ G("div", { children: [
527
- /* @__PURE__ */ W("strong", { children: e.key }),
526
+ children: [/* @__PURE__ */ K("div", { children: [
527
+ /* @__PURE__ */ G("strong", { children: e.key }),
528
528
  " · Basis Theory · ",
529
529
  e.environment,
530
- /* @__PURE__ */ W("br", {}),
531
- /* @__PURE__ */ G("span", {
530
+ /* @__PURE__ */ G("br", {}),
531
+ /* @__PURE__ */ K("span", {
532
532
  className: "text-sm text-muted-foreground",
533
533
  children: [
534
534
  e.account_id,
@@ -537,7 +537,7 @@ function ge() {
537
537
  e.credentials?.api_key?.configured ? "Credential configured" : "Credential missing"
538
538
  ]
539
539
  })
540
- ] }), n && !e.archived && /* @__PURE__ */ W(o, {
540
+ ] }), n && !e.archived && /* @__PURE__ */ G(o, {
541
541
  size: "sm",
542
542
  variant: "outline",
543
543
  onClick: () => d(e),
@@ -545,23 +545,23 @@ function ge() {
545
545
  })]
546
546
  }, e.key))
547
547
  }),
548
- n && /* @__PURE__ */ W(o, {
548
+ n && /* @__PURE__ */ G(o, {
549
549
  className: "justify-self-start",
550
550
  variant: "outline",
551
551
  onClick: () => d("new"),
552
552
  children: "Add Basis Theory vault"
553
553
  }),
554
- u && /* @__PURE__ */ W(_e, {
554
+ u && /* @__PURE__ */ G(xe, {
555
555
  current: u === "new" ? void 0 : u,
556
556
  close: () => d(null),
557
557
  saved: p
558
558
  }, u === "new" ? "new" : `${u.key}:${u.revision}`),
559
- g.filter((e) => e.rail === "nmi").map((e) => /* @__PURE__ */ G(F, {
559
+ g.filter((e) => e.rail === "nmi").map((e) => /* @__PURE__ */ K(I, {
560
560
  className: "grid gap-2",
561
561
  children: [
562
562
  e.key,
563
563
  ": card storage",
564
- /* @__PURE__ */ G("select", {
564
+ /* @__PURE__ */ K("select", {
565
565
  className: "rounded border bg-background p-2",
566
566
  "aria-label": `${e.key} card storage`,
567
567
  disabled: !n || m.isPending,
@@ -570,39 +570,39 @@ function ge() {
570
570
  psp: e.id,
571
571
  custody: t.target.value
572
572
  }),
573
- children: [/* @__PURE__ */ W("option", {
573
+ children: [/* @__PURE__ */ G("option", {
574
574
  value: "",
575
575
  children: "NMI customer vault"
576
- }), c.data.data.filter((t) => !t.archived && t.environment === e.environment).map((e) => /* @__PURE__ */ G("option", {
576
+ }), c.data.data.filter((t) => !t.archived && t.environment === e.environment).map((e) => /* @__PURE__ */ K("option", {
577
577
  value: e.key,
578
578
  children: [e.key, " · Basis Theory"]
579
579
  }, e.key))]
580
580
  })
581
581
  ]
582
582
  }, e.id)),
583
- /* @__PURE__ */ G("form", {
583
+ /* @__PURE__ */ K("form", {
584
584
  className: "grid gap-3",
585
585
  onSubmit: (e) => {
586
586
  e.preventDefault(), h.mutate(new FormData(e.currentTarget));
587
587
  },
588
588
  children: [
589
- /* @__PURE__ */ G(F, {
589
+ /* @__PURE__ */ K(I, {
590
590
  className: "grid gap-2",
591
- children: ["Vault for new cards", /* @__PURE__ */ G("select", {
591
+ children: ["Vault for new cards", /* @__PURE__ */ K("select", {
592
592
  name: "card_vault",
593
593
  className: "rounded border bg-background p-2",
594
594
  defaultValue: r.data.card_vault ?? "",
595
595
  disabled: !n,
596
596
  children: [
597
- /* @__PURE__ */ W("option", {
597
+ /* @__PURE__ */ G("option", {
598
598
  value: "",
599
599
  children: "No card vault selected"
600
600
  }),
601
- r.data.platform_vault.available && /* @__PURE__ */ W("option", {
601
+ r.data.platform_vault.available && /* @__PURE__ */ G("option", {
602
602
  value: "platform",
603
603
  children: "Hosted vault · isolated to this merchant"
604
604
  }),
605
- g.map((e) => /* @__PURE__ */ G("option", {
605
+ g.map((e) => /* @__PURE__ */ K("option", {
606
606
  value: e.key,
607
607
  children: [
608
608
  e.key,
@@ -614,21 +614,21 @@ function ge() {
614
614
  ]
615
615
  })]
616
616
  }),
617
- /* @__PURE__ */ G("fieldset", {
617
+ /* @__PURE__ */ K("fieldset", {
618
618
  className: "grid gap-2",
619
619
  disabled: !n,
620
620
  children: [
621
- /* @__PURE__ */ W("legend", {
621
+ /* @__PURE__ */ G("legend", {
622
622
  className: "mb-2 font-medium",
623
623
  children: "Charge PSPs"
624
624
  }),
625
- /* @__PURE__ */ W("p", {
625
+ /* @__PURE__ */ G("p", {
626
626
  className: "text-sm text-muted-foreground",
627
627
  children: "Select the accounts allowed for new charges. With none selected, routing considers all eligible accounts."
628
628
  }),
629
- g.map((e) => /* @__PURE__ */ G(F, {
629
+ g.map((e) => /* @__PURE__ */ K(I, {
630
630
  className: "flex gap-2",
631
- children: [/* @__PURE__ */ W("input", {
631
+ children: [/* @__PURE__ */ G("input", {
632
632
  type: "checkbox",
633
633
  name: "charge_psps",
634
634
  value: e.key,
@@ -637,7 +637,7 @@ function ge() {
637
637
  }, e.id))
638
638
  ]
639
639
  }),
640
- n && /* @__PURE__ */ W(o, {
640
+ n && /* @__PURE__ */ G(o, {
641
641
  className: "justify-self-start",
642
642
  disabled: h.isPending,
643
643
  type: "submit",
@@ -648,8 +648,8 @@ function ge() {
648
648
  ]
649
649
  });
650
650
  }
651
- function _e({ current: e, close: t, saved: n }) {
652
- let r = i(), [a] = z.useState(() => r.selectedMerchant()), c = B({
651
+ function xe({ current: e, close: t, saved: n }) {
652
+ let r = i(), [a] = B.useState(() => r.selectedMerchant()), c = V({
653
653
  mutationFn: async (t) => {
654
654
  if (a !== r.selectedMerchant()) throw Error("Merchant changed; reopen this form");
655
655
  let n = String(t.get("private_key") ?? "").trim();
@@ -670,75 +670,75 @@ function _e({ current: e, close: t, saved: n }) {
670
670
  },
671
671
  onError: (e) => r.toastApiError(e, "Configure vault")
672
672
  });
673
- return /* @__PURE__ */ G("form", {
673
+ return /* @__PURE__ */ K("form", {
674
674
  className: "grid gap-3 rounded border p-4",
675
675
  onSubmit: (e) => {
676
676
  e.preventDefault(), c.mutate(new FormData(e.currentTarget));
677
677
  },
678
678
  children: [
679
- /* @__PURE__ */ W("h3", {
679
+ /* @__PURE__ */ G("h3", {
680
680
  className: "font-medium",
681
681
  children: e ? `Edit ${e.key}` : "Add Basis Theory vault"
682
682
  }),
683
- !e && /* @__PURE__ */ G(U, { children: [
684
- /* @__PURE__ */ G(F, {
683
+ !e && /* @__PURE__ */ K(W, { children: [
684
+ /* @__PURE__ */ K(I, {
685
685
  className: "grid gap-1",
686
- children: ["Vault key", /* @__PURE__ */ W(s, {
686
+ children: ["Vault key", /* @__PURE__ */ G(s, {
687
687
  name: "key",
688
688
  required: !0,
689
689
  pattern: "[a-z0-9_-]{1,63}"
690
690
  })]
691
691
  }),
692
- /* @__PURE__ */ G(F, {
692
+ /* @__PURE__ */ K(I, {
693
693
  className: "grid gap-1",
694
- children: ["Environment", /* @__PURE__ */ G("select", {
694
+ children: ["Environment", /* @__PURE__ */ K("select", {
695
695
  name: "environment",
696
696
  className: "rounded border bg-background p-2",
697
- children: [/* @__PURE__ */ W("option", {
697
+ children: [/* @__PURE__ */ G("option", {
698
698
  value: "test",
699
699
  children: "Test"
700
- }), /* @__PURE__ */ W("option", {
700
+ }), /* @__PURE__ */ G("option", {
701
701
  value: "live",
702
702
  children: "Live"
703
703
  })]
704
704
  })]
705
705
  }),
706
- /* @__PURE__ */ G(F, {
706
+ /* @__PURE__ */ K(I, {
707
707
  className: "grid gap-1",
708
- children: ["Basis Theory tenant ID", /* @__PURE__ */ W(s, {
708
+ children: ["Basis Theory tenant ID", /* @__PURE__ */ G(s, {
709
709
  name: "account_id",
710
710
  required: !0
711
711
  })]
712
712
  })
713
713
  ] }),
714
- /* @__PURE__ */ G(F, {
714
+ /* @__PURE__ */ K(I, {
715
715
  className: "grid gap-1",
716
- children: ["Public collection key", /* @__PURE__ */ W(s, {
716
+ children: ["Public collection key", /* @__PURE__ */ G(s, {
717
717
  name: "public_key",
718
718
  required: !0,
719
719
  defaultValue: String(e?.settings?.public_api_key ?? "")
720
720
  })]
721
721
  }),
722
- /* @__PURE__ */ G(F, {
722
+ /* @__PURE__ */ K(I, {
723
723
  className: "grid gap-1",
724
- children: ["Private API key", /* @__PURE__ */ W(s, {
724
+ children: ["Private API key", /* @__PURE__ */ G(s, {
725
725
  type: "password",
726
726
  name: "private_key",
727
727
  autoComplete: "new-password",
728
728
  required: !e
729
729
  })]
730
730
  }),
731
- /* @__PURE__ */ W("p", {
731
+ /* @__PURE__ */ G("p", {
732
732
  className: "text-sm text-muted-foreground",
733
733
  children: "Use a key that can read its application, manage the merchant’s card tokens and invoke the proxy. Existing credentials stay unchanged when left blank."
734
734
  }),
735
- /* @__PURE__ */ G("div", {
735
+ /* @__PURE__ */ K("div", {
736
736
  className: "flex gap-2",
737
- children: [/* @__PURE__ */ W(o, {
737
+ children: [/* @__PURE__ */ G(o, {
738
738
  type: "submit",
739
739
  disabled: c.isPending,
740
740
  children: "Validate and save vault"
741
- }), /* @__PURE__ */ W(o, {
741
+ }), /* @__PURE__ */ G(o, {
742
742
  type: "button",
743
743
  variant: "outline",
744
744
  onClick: t,
@@ -751,9 +751,9 @@ function _e({ current: e, close: t, saved: n }) {
751
751
  //#endregion
752
752
  //#region src/admin/pages/settings/index.tsx
753
753
  var Q = "h-8 flex-none px-0 after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary pointer-coarse:h-10";
754
- function ve() {
754
+ function Se() {
755
755
  let [t, i] = r(), a = f(), o = u(), s = n().props.settingsTabs ?? [], c = s.map((e) => e.value), l = d(null, a, o, c), p = d(t.get("tab"), a, o, c);
756
- return /* @__PURE__ */ G(oe, {
756
+ return /* @__PURE__ */ K(ce, {
757
757
  value: p,
758
758
  onValueChange: (e) => {
759
759
  let n = new URLSearchParams(t);
@@ -761,33 +761,33 @@ function ve() {
761
761
  },
762
762
  className: "flex flex-col gap-4",
763
763
  children: [
764
- /* @__PURE__ */ W("div", {
764
+ /* @__PURE__ */ G("div", {
765
765
  className: "overflow-x-auto",
766
- children: /* @__PURE__ */ G(ae, {
766
+ children: /* @__PURE__ */ K(se, {
767
767
  variant: "line",
768
768
  className: "w-max min-w-full justify-start gap-6 rounded-none p-0",
769
769
  children: [
770
- a && /* @__PURE__ */ W(L, {
770
+ a && /* @__PURE__ */ G(R, {
771
771
  value: "merchant",
772
772
  className: Q,
773
- children: /* @__PURE__ */ W(e, { id: "Merchant" })
773
+ children: /* @__PURE__ */ G(e, { id: "Merchant" })
774
774
  }),
775
- a && /* @__PURE__ */ W(L, {
775
+ a && /* @__PURE__ */ G(R, {
776
776
  value: "notifications",
777
777
  className: Q,
778
- children: /* @__PURE__ */ W(e, { id: "Notifications" })
778
+ children: /* @__PURE__ */ G(e, { id: "Notifications" })
779
779
  }),
780
- a && /* @__PURE__ */ W(L, {
780
+ a && /* @__PURE__ */ G(R, {
781
781
  value: "psps",
782
782
  className: Q,
783
- children: /* @__PURE__ */ W(e, { id: "PSPs" })
783
+ children: /* @__PURE__ */ G(e, { id: "PSPs" })
784
784
  }),
785
- o && /* @__PURE__ */ W(L, {
785
+ o && /* @__PURE__ */ G(R, {
786
786
  value: "customer-controls",
787
787
  className: Q,
788
- children: /* @__PURE__ */ W(e, { id: "Customer controls" })
788
+ children: /* @__PURE__ */ G(e, { id: "Customer controls" })
789
789
  }),
790
- s.map((e) => /* @__PURE__ */ W(L, {
790
+ s.map((e) => /* @__PURE__ */ G(R, {
791
791
  value: e.value,
792
792
  className: Q,
793
793
  children: e.title
@@ -795,50 +795,50 @@ function ve() {
795
795
  ]
796
796
  })
797
797
  }),
798
- a && /* @__PURE__ */ W(R, {
798
+ a && /* @__PURE__ */ G(z, {
799
799
  value: "merchant",
800
- children: /* @__PURE__ */ W(ye, {})
800
+ children: /* @__PURE__ */ G(Ce, {})
801
801
  }),
802
- a && /* @__PURE__ */ W(R, {
802
+ a && /* @__PURE__ */ G(z, {
803
803
  value: "notifications",
804
- children: /* @__PURE__ */ W(ue, {})
804
+ children: /* @__PURE__ */ G(me, {})
805
805
  }),
806
- a && /* @__PURE__ */ W(R, {
806
+ a && /* @__PURE__ */ G(z, {
807
807
  value: "psps",
808
- children: /* @__PURE__ */ W(Se, {})
808
+ children: /* @__PURE__ */ G(Ee, {})
809
809
  }),
810
- o && /* @__PURE__ */ W(R, {
810
+ o && /* @__PURE__ */ G(z, {
811
811
  value: "customer-controls",
812
- children: /* @__PURE__ */ W(Pe, {})
812
+ children: /* @__PURE__ */ G(Re, {})
813
813
  }),
814
- s.map((e) => /* @__PURE__ */ W(R, {
814
+ s.map((e) => /* @__PURE__ */ G(z, {
815
815
  value: e.value,
816
816
  children: e.element
817
817
  }, e.value))
818
818
  ]
819
819
  });
820
820
  }
821
- function ye() {
822
- let { adminQueries: t } = i(), { data: n } = V(t.merchantConfiguration("Load settings")), r = l();
823
- return n ? /* @__PURE__ */ G("div", {
821
+ function Ce() {
822
+ let { adminQueries: t } = i(), { data: n } = H(t.merchantConfiguration("Load settings")), r = l();
823
+ return n ? /* @__PURE__ */ K("div", {
824
824
  className: "grid gap-10",
825
825
  children: [
826
- /* @__PURE__ */ W(J, {}),
827
- /* @__PURE__ */ W(be, {
826
+ /* @__PURE__ */ G(fe, {}),
827
+ /* @__PURE__ */ G(we, {
828
828
  configuration: n,
829
829
  edits: r
830
830
  }),
831
- /* @__PURE__ */ W(xe, {
831
+ /* @__PURE__ */ G(Te, {
832
832
  configuration: n,
833
833
  edits: r
834
834
  })
835
835
  ]
836
- }) : /* @__PURE__ */ W("p", {
836
+ }) : /* @__PURE__ */ G("p", {
837
837
  className: "text-sm text-muted-foreground",
838
- children: /* @__PURE__ */ W(e, { id: "Loading…" })
838
+ children: /* @__PURE__ */ G(e, { id: "Loading…" })
839
839
  });
840
840
  }
841
- function be({ configuration: n, edits: r }) {
841
+ function we({ configuration: n, edits: r }) {
842
842
  let { id: i, text: a } = t(), o = n.profile, c = () => ({
843
843
  displayName: n.display_name,
844
844
  fromEmail: o?.from_email ?? "",
@@ -846,7 +846,7 @@ function be({ configuration: n, edits: r }) {
846
846
  subscribeURL: o?.subscribe_url ?? "",
847
847
  billingURL: o?.billing_url ?? "",
848
848
  logoURL: o?.logo_url ?? ""
849
- }), l = q(n), u = K({
849
+ }), l = Y(n), u = J({
850
850
  defaultValues: c(),
851
851
  onSubmit: ({ value: e }) => l.save({
852
852
  display_name: e.displayName.trim(),
@@ -859,22 +859,22 @@ function be({ configuration: n, edits: r }) {
859
859
  }
860
860
  }, "Profile saved", "Save profile")
861
861
  });
862
- return /* @__PURE__ */ G("section", {
862
+ return /* @__PURE__ */ K("section", {
863
863
  className: "grid gap-5",
864
- children: [/* @__PURE__ */ G("div", {
864
+ children: [/* @__PURE__ */ K("div", {
865
865
  className: "flex flex-wrap items-start justify-between gap-4",
866
- children: [/* @__PURE__ */ G("div", {
866
+ children: [/* @__PURE__ */ K("div", {
867
867
  className: "grid gap-1",
868
- children: [/* @__PURE__ */ W("h2", {
868
+ children: [/* @__PURE__ */ G("h2", {
869
869
  className: "text-base font-semibold",
870
- children: /* @__PURE__ */ W(e, { id: "Merchant profile" })
871
- }), /* @__PURE__ */ W("p", {
870
+ children: /* @__PURE__ */ G(e, { id: "Merchant profile" })
871
+ }), /* @__PURE__ */ G("p", {
872
872
  className: "text-sm text-pretty text-muted-foreground",
873
- children: /* @__PURE__ */ W(e, { id: "Customer-facing merchant details used on invoices and emails." })
873
+ children: /* @__PURE__ */ G(e, { id: "Customer-facing merchant details used on invoices and emails." })
874
874
  })]
875
- }), /* @__PURE__ */ W(u.Subscribe, {
875
+ }), /* @__PURE__ */ G(u.Subscribe, {
876
876
  selector: (e) => [e.canSubmit, e.isSubmitting],
877
- children: ([e, t]) => /* @__PURE__ */ W(Y, {
877
+ children: ([e, t]) => /* @__PURE__ */ G(pe, {
878
878
  edits: r,
879
879
  editing: l.editing,
880
880
  form: "merchant-profile-form",
@@ -886,38 +886,38 @@ function be({ configuration: n, edits: r }) {
886
886
  onCancel: l.close
887
887
  })
888
888
  })]
889
- }), l.editing ? /* @__PURE__ */ G("form", {
889
+ }), l.editing ? /* @__PURE__ */ K("form", {
890
890
  id: i("merchant-profile-form"),
891
891
  onSubmit: (e) => {
892
892
  e.preventDefault(), e.stopPropagation(), u.handleSubmit();
893
893
  },
894
894
  className: "grid gap-4",
895
895
  children: [
896
- /* @__PURE__ */ W(u.Field, {
896
+ /* @__PURE__ */ G(u.Field, {
897
897
  name: "displayName",
898
898
  validators: { onChange: ({ value: e }) => e.trim() ? void 0 : "Enter the merchant's name" },
899
- children: (e) => /* @__PURE__ */ W(Z, {
899
+ children: (e) => /* @__PURE__ */ G(Z, {
900
900
  label: a("Display name"),
901
901
  id: "s-name",
902
- children: /* @__PURE__ */ G("div", {
902
+ children: /* @__PURE__ */ K("div", {
903
903
  className: "grid gap-1.5",
904
- children: [/* @__PURE__ */ W(s, {
904
+ children: [/* @__PURE__ */ G(s, {
905
905
  id: i("s-name"),
906
906
  value: e.state.value,
907
907
  onBlur: e.handleBlur,
908
908
  onChange: (t) => e.handleChange(t.target.value),
909
909
  autoComplete: "organization",
910
910
  "aria-invalid": e.state.meta.errors.length > 0
911
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
911
+ }), /* @__PURE__ */ G(b, { errors: e.state.meta.errors })]
912
912
  })
913
913
  })
914
914
  }),
915
- /* @__PURE__ */ W(u.Field, {
915
+ /* @__PURE__ */ G(u.Field, {
916
916
  name: "fromEmail",
917
- children: (e) => /* @__PURE__ */ W(Z, {
917
+ children: (e) => /* @__PURE__ */ G(Z, {
918
918
  label: a("From email"),
919
919
  id: "s-email",
920
- children: /* @__PURE__ */ W(s, {
920
+ children: /* @__PURE__ */ G(s, {
921
921
  id: i("s-email"),
922
922
  type: "email",
923
923
  value: e.state.value,
@@ -927,12 +927,12 @@ function be({ configuration: n, edits: r }) {
927
927
  })
928
928
  })
929
929
  }),
930
- /* @__PURE__ */ W(u.Field, {
930
+ /* @__PURE__ */ G(u.Field, {
931
931
  name: "supportURL",
932
- children: (e) => /* @__PURE__ */ W(Z, {
932
+ children: (e) => /* @__PURE__ */ G(Z, {
933
933
  label: a("Support URL"),
934
934
  id: "s-support",
935
- children: /* @__PURE__ */ W(s, {
935
+ children: /* @__PURE__ */ G(s, {
936
936
  id: i("s-support"),
937
937
  type: "url",
938
938
  value: e.state.value,
@@ -942,12 +942,12 @@ function be({ configuration: n, edits: r }) {
942
942
  })
943
943
  })
944
944
  }),
945
- /* @__PURE__ */ W(u.Field, {
945
+ /* @__PURE__ */ G(u.Field, {
946
946
  name: "subscribeURL",
947
- children: (e) => /* @__PURE__ */ W(Z, {
947
+ children: (e) => /* @__PURE__ */ G(Z, {
948
948
  label: a("Subscribe URL"),
949
949
  id: "s-subscribe",
950
- children: /* @__PURE__ */ W(s, {
950
+ children: /* @__PURE__ */ G(s, {
951
951
  id: i("s-subscribe"),
952
952
  type: "url",
953
953
  value: e.state.value,
@@ -957,12 +957,12 @@ function be({ configuration: n, edits: r }) {
957
957
  })
958
958
  })
959
959
  }),
960
- /* @__PURE__ */ W(u.Field, {
960
+ /* @__PURE__ */ G(u.Field, {
961
961
  name: "billingURL",
962
- children: (e) => /* @__PURE__ */ W(Z, {
962
+ children: (e) => /* @__PURE__ */ G(Z, {
963
963
  label: a("Billing URL"),
964
964
  id: "s-billing",
965
- children: /* @__PURE__ */ W(s, {
965
+ children: /* @__PURE__ */ G(s, {
966
966
  id: i("s-billing"),
967
967
  type: "url",
968
968
  value: e.state.value,
@@ -972,12 +972,12 @@ function be({ configuration: n, edits: r }) {
972
972
  })
973
973
  })
974
974
  }),
975
- /* @__PURE__ */ W(u.Field, {
975
+ /* @__PURE__ */ G(u.Field, {
976
976
  name: "logoURL",
977
- children: (e) => /* @__PURE__ */ W(Z, {
977
+ children: (e) => /* @__PURE__ */ G(Z, {
978
978
  label: a("Logo URL"),
979
979
  id: "s-logo",
980
- children: /* @__PURE__ */ W(s, {
980
+ children: /* @__PURE__ */ G(s, {
981
981
  id: i("s-logo"),
982
982
  type: "url",
983
983
  value: e.state.value,
@@ -988,30 +988,30 @@ function be({ configuration: n, edits: r }) {
988
988
  })
989
989
  })
990
990
  ]
991
- }) : /* @__PURE__ */ G("dl", {
991
+ }) : /* @__PURE__ */ K("dl", {
992
992
  className: "grid gap-4",
993
993
  children: [
994
- /* @__PURE__ */ W(X, {
994
+ /* @__PURE__ */ G(X, {
995
995
  label: a("Display name"),
996
996
  value: n.display_name
997
997
  }),
998
- /* @__PURE__ */ W(X, {
998
+ /* @__PURE__ */ G(X, {
999
999
  label: a("From email"),
1000
1000
  value: o?.from_email
1001
1001
  }),
1002
- /* @__PURE__ */ W(X, {
1002
+ /* @__PURE__ */ G(X, {
1003
1003
  label: a("Support URL"),
1004
1004
  value: o?.support_url
1005
1005
  }),
1006
- /* @__PURE__ */ W(X, {
1006
+ /* @__PURE__ */ G(X, {
1007
1007
  label: a("Subscribe URL"),
1008
1008
  value: o?.subscribe_url
1009
1009
  }),
1010
- /* @__PURE__ */ W(X, {
1010
+ /* @__PURE__ */ G(X, {
1011
1011
  label: a("Billing URL"),
1012
1012
  value: o?.billing_url
1013
1013
  }),
1014
- /* @__PURE__ */ W(X, {
1014
+ /* @__PURE__ */ G(X, {
1015
1015
  label: a("Logo URL"),
1016
1016
  value: o?.logo_url
1017
1017
  })
@@ -1019,27 +1019,27 @@ function be({ configuration: n, edits: r }) {
1019
1019
  })]
1020
1020
  });
1021
1021
  }
1022
- function xe({ configuration: n, edits: r }) {
1023
- let { id: i, text: a } = t(), o = n.reprice_notice_window_days ?? 30, c = q(n), l = K({
1022
+ function Te({ configuration: n, edits: r }) {
1023
+ let { id: i, text: a } = t(), o = n.reprice_notice_window_days ?? 30, c = Y(n), l = J({
1024
1024
  defaultValues: { days: String(o) },
1025
1025
  onSubmit: ({ value: e }) => c.save({ reprice_notice_window_days: Number(e.days) }, "Notice window saved", "Save notice window")
1026
1026
  });
1027
- return /* @__PURE__ */ G("section", {
1027
+ return /* @__PURE__ */ K("section", {
1028
1028
  className: "grid gap-5",
1029
- children: [/* @__PURE__ */ G("div", {
1029
+ children: [/* @__PURE__ */ K("div", {
1030
1030
  className: "flex flex-wrap items-start justify-between gap-4",
1031
- children: [/* @__PURE__ */ G("div", {
1031
+ children: [/* @__PURE__ */ K("div", {
1032
1032
  className: "grid max-w-2xl gap-1",
1033
- children: [/* @__PURE__ */ W("h2", {
1033
+ children: [/* @__PURE__ */ G("h2", {
1034
1034
  className: "text-base font-semibold",
1035
- children: /* @__PURE__ */ W(e, { id: "Pricing policies" })
1036
- }), /* @__PURE__ */ W("p", {
1035
+ children: /* @__PURE__ */ G(e, { id: "Pricing policies" })
1036
+ }), /* @__PURE__ */ G("p", {
1037
1037
  className: "text-sm text-pretty text-muted-foreground",
1038
- children: /* @__PURE__ */ W(e, { id: "Set how much notice customers receive before a price increase." })
1038
+ children: /* @__PURE__ */ G(e, { id: "Set how much notice customers receive before a price increase." })
1039
1039
  })]
1040
- }), /* @__PURE__ */ W(l.Subscribe, {
1040
+ }), /* @__PURE__ */ G(l.Subscribe, {
1041
1041
  selector: (e) => [e.canSubmit, e.isSubmitting],
1042
- children: ([e, t]) => /* @__PURE__ */ W(Y, {
1042
+ children: ([e, t]) => /* @__PURE__ */ G(pe, {
1043
1043
  edits: r,
1044
1044
  editing: c.editing,
1045
1045
  form: "notice-window-form",
@@ -1051,23 +1051,23 @@ function xe({ configuration: n, edits: r }) {
1051
1051
  onCancel: c.close
1052
1052
  })
1053
1053
  })]
1054
- }), c.editing ? /* @__PURE__ */ W("form", {
1054
+ }), c.editing ? /* @__PURE__ */ G("form", {
1055
1055
  id: i("notice-window-form"),
1056
1056
  onSubmit: (e) => {
1057
1057
  e.preventDefault(), e.stopPropagation(), l.handleSubmit();
1058
1058
  },
1059
- children: /* @__PURE__ */ W(l.Field, {
1059
+ children: /* @__PURE__ */ G(l.Field, {
1060
1060
  name: "days",
1061
1061
  validators: { onChange: ({ value: e }) => {
1062
1062
  let t = Number(e);
1063
1063
  return e.trim() && Number.isInteger(t) && t >= 0 ? void 0 : "Enter a whole number of days";
1064
1064
  } },
1065
- children: (e) => /* @__PURE__ */ W(Z, {
1065
+ children: (e) => /* @__PURE__ */ G(Z, {
1066
1066
  label: a("Notice period (days)"),
1067
1067
  id: "s-notice-window",
1068
- children: /* @__PURE__ */ G("div", {
1068
+ children: /* @__PURE__ */ K("div", {
1069
1069
  className: "grid gap-1.5",
1070
- children: [/* @__PURE__ */ W(s, {
1070
+ children: [/* @__PURE__ */ G(s, {
1071
1071
  id: i("s-notice-window"),
1072
1072
  type: "number",
1073
1073
  step: "1",
@@ -1076,87 +1076,87 @@ function xe({ configuration: n, edits: r }) {
1076
1076
  onBlur: e.handleBlur,
1077
1077
  onChange: (t) => e.handleChange(t.target.value),
1078
1078
  "aria-invalid": e.state.meta.errors.length > 0
1079
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
1079
+ }), /* @__PURE__ */ G(b, { errors: e.state.meta.errors })]
1080
1080
  })
1081
1081
  })
1082
1082
  })
1083
- }) : /* @__PURE__ */ W("dl", { children: /* @__PURE__ */ W(X, {
1083
+ }) : /* @__PURE__ */ G("dl", { children: /* @__PURE__ */ G(X, {
1084
1084
  label: a("Notice period"),
1085
1085
  value: `${o} ${o === 1 ? "day" : "days"}`
1086
1086
  }) })]
1087
1087
  });
1088
1088
  }
1089
- function Se() {
1090
- let { selectedMerchant: t, adminQueries: n } = i(), r = V(n.psps()), a = V(n.rails()), o = l();
1091
- if (r.isPending || a.isPending) return /* @__PURE__ */ W("p", {
1089
+ function Ee() {
1090
+ let { selectedMerchant: t, adminQueries: n } = i(), r = H(n.psps()), a = H(n.rails()), o = l();
1091
+ if (r.isPending || a.isPending) return /* @__PURE__ */ G("p", {
1092
1092
  className: "text-sm text-muted-foreground",
1093
- children: /* @__PURE__ */ W(e, { id: "Loading…" })
1093
+ children: /* @__PURE__ */ G(e, { id: "Loading…" })
1094
1094
  });
1095
1095
  let s = a.data ?? [];
1096
- return /* @__PURE__ */ G("div", {
1096
+ return /* @__PURE__ */ K("div", {
1097
1097
  className: "grid gap-6",
1098
1098
  children: [
1099
- /* @__PURE__ */ W(J, {}),
1100
- /* @__PURE__ */ G("section", {
1099
+ /* @__PURE__ */ G(fe, {}),
1100
+ /* @__PURE__ */ K("section", {
1101
1101
  className: "grid gap-5",
1102
- children: [/* @__PURE__ */ G("div", {
1102
+ children: [/* @__PURE__ */ K("div", {
1103
1103
  className: "flex flex-wrap items-start justify-between gap-4",
1104
- children: [/* @__PURE__ */ G("div", {
1104
+ children: [/* @__PURE__ */ K("div", {
1105
1105
  className: "grid gap-1",
1106
- children: [/* @__PURE__ */ W("h2", {
1106
+ children: [/* @__PURE__ */ G("h2", {
1107
1107
  className: "text-base font-semibold",
1108
- children: /* @__PURE__ */ W(e, { id: "PSPs" })
1109
- }), /* @__PURE__ */ W("p", {
1108
+ children: /* @__PURE__ */ G(e, { id: "PSPs" })
1109
+ }), /* @__PURE__ */ G("p", {
1110
1110
  className: "text-sm text-muted-foreground",
1111
- children: /* @__PURE__ */ W(e, { id: "The accounts this merchant takes payments through, one or more per rail." })
1111
+ children: /* @__PURE__ */ G(e, { id: "The accounts this merchant takes payments through, one or more per rail." })
1112
1112
  })]
1113
- }), o && /* @__PURE__ */ W(Ne, { railDefinitions: s }, t() ?? "")]
1114
- }), r.data?.data?.length ? /* @__PURE__ */ G(ne, {
1113
+ }), o && /* @__PURE__ */ G(Le, { railDefinitions: s }, t() ?? "")]
1114
+ }), r.data?.data?.length ? /* @__PURE__ */ K(j, {
1115
1115
  className: "min-w-[44rem]",
1116
- children: [/* @__PURE__ */ W(te, { children: /* @__PURE__ */ G(D, {
1116
+ children: [/* @__PURE__ */ G(O, { children: /* @__PURE__ */ K(A, {
1117
1117
  className: "hover:bg-transparent",
1118
1118
  children: [
1119
- /* @__PURE__ */ W(T, {
1119
+ /* @__PURE__ */ G(E, {
1120
1120
  className: "text-muted-foreground",
1121
1121
  children: "PSP"
1122
1122
  }),
1123
- /* @__PURE__ */ W(T, {
1123
+ /* @__PURE__ */ G(E, {
1124
1124
  className: "text-muted-foreground",
1125
- children: /* @__PURE__ */ W(e, { id: "Environment" })
1125
+ children: /* @__PURE__ */ G(e, { id: "Environment" })
1126
1126
  }),
1127
- /* @__PURE__ */ W(T, {
1127
+ /* @__PURE__ */ G(E, {
1128
1128
  className: "text-muted-foreground",
1129
- children: /* @__PURE__ */ W(e, { id: "Credentials" })
1129
+ children: /* @__PURE__ */ G(e, { id: "Credentials" })
1130
1130
  }),
1131
- /* @__PURE__ */ W(T, {
1131
+ /* @__PURE__ */ G(E, {
1132
1132
  className: "text-muted-foreground",
1133
- children: /* @__PURE__ */ W(e, { id: "State" })
1133
+ children: /* @__PURE__ */ G(e, { id: "State" })
1134
1134
  }),
1135
- o && /* @__PURE__ */ W(T, {
1135
+ o && /* @__PURE__ */ G(E, {
1136
1136
  className: "text-right text-muted-foreground",
1137
- children: /* @__PURE__ */ W(e, { id: "Action" })
1137
+ children: /* @__PURE__ */ G(e, { id: "Action" })
1138
1138
  })
1139
1139
  ]
1140
- }) }), /* @__PURE__ */ W(ee, { children: r.data.data.map((e) => /* @__PURE__ */ W(we, {
1140
+ }) }), /* @__PURE__ */ G(D, { children: r.data.data.map((e) => /* @__PURE__ */ G(Oe, {
1141
1141
  psp: e,
1142
1142
  railDefinitions: s,
1143
1143
  edits: o
1144
1144
  }, e.id)) })]
1145
- }) : /* @__PURE__ */ W("p", {
1145
+ }) : /* @__PURE__ */ G("p", {
1146
1146
  className: "py-2 text-sm text-muted-foreground",
1147
- children: /* @__PURE__ */ W(e, { id: "No PSPs configured." })
1147
+ children: /* @__PURE__ */ G(e, { id: "No PSPs configured." })
1148
1148
  })]
1149
1149
  }),
1150
- /* @__PURE__ */ W(ge, {})
1150
+ /* @__PURE__ */ G(be, {})
1151
1151
  ]
1152
1152
  });
1153
1153
  }
1154
- function Ce(e) {
1155
- return e.validated_at ? `Validated ${m(e.validated_at)}` : e.configured ? "Configured" : "Not configured";
1154
+ function De(e) {
1155
+ return e.validated_at ? `Validated ${h(e.validated_at)}` : e.configured ? "Configured" : "Not configured";
1156
1156
  }
1157
- function we({ psp: n, railDefinitions: r, edits: s }) {
1158
- let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { text: p } = t(), m = H(), h = B(d.updatePSP(m)), [g, y] = z.useState(!1), b = _(), x = r.find((e) => e.rail === n.rail), S = x?.display_name ?? n.rail, C = n.credentials ?? {}, w = async (e) => {
1159
- if (!(!e && !await b({
1157
+ function Oe({ psp: n, railDefinitions: r, edits: s }) {
1158
+ let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { text: p } = t(), m = U(), h = V(d.updatePSP(m)), [g, _] = B.useState(!1), v = ee(), b = r.find((e) => e.rail === n.rail), x = b?.display_name ?? n.rail, S = n.credentials ?? {}, C = async (e) => {
1159
+ if (!(!e && !await v({
1160
1160
  title: `Archive ${n.key}?`,
1161
1161
  description: "New purchase stops routing to it. Existing subscriptions, refunds and webhooks keep using it.",
1162
1162
  confirmLabel: "Archive PSP"
@@ -1171,7 +1171,7 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1171
1171
  }), c.success("PSP archived");
1172
1172
  } catch (t) {
1173
1173
  if (t instanceof a && t.code === "psp_last_active") {
1174
- e ? l(t, "Archive PSP") : y(!0);
1174
+ e ? l(t, "Archive PSP") : _(!0);
1175
1175
  return;
1176
1176
  }
1177
1177
  if (t instanceof a && t.revisionMismatch) {
@@ -1181,88 +1181,88 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1181
1181
  l(t, "Archive PSP");
1182
1182
  }
1183
1183
  };
1184
- return /* @__PURE__ */ G(D, {
1184
+ return /* @__PURE__ */ K(A, {
1185
1185
  className: n.archived ? "opacity-60" : void 0,
1186
1186
  children: [
1187
- /* @__PURE__ */ W(E, {
1187
+ /* @__PURE__ */ G(k, {
1188
1188
  className: "py-3",
1189
- children: /* @__PURE__ */ G("div", {
1189
+ children: /* @__PURE__ */ K("div", {
1190
1190
  className: "grid min-w-0 leading-tight",
1191
- children: [/* @__PURE__ */ W("span", {
1191
+ children: [/* @__PURE__ */ G("span", {
1192
1192
  className: "font-medium",
1193
1193
  children: n.key
1194
- }), /* @__PURE__ */ G("span", {
1194
+ }), /* @__PURE__ */ K("span", {
1195
1195
  className: "truncate text-xs text-muted-foreground",
1196
1196
  children: [
1197
- S,
1197
+ x,
1198
1198
  " · ",
1199
- De(n)
1199
+ je(n)
1200
1200
  ]
1201
1201
  })]
1202
1202
  })
1203
1203
  }),
1204
- /* @__PURE__ */ W(E, {
1204
+ /* @__PURE__ */ G(k, {
1205
1205
  className: "py-3 capitalize",
1206
1206
  children: n.environment
1207
1207
  }),
1208
- /* @__PURE__ */ W(E, {
1208
+ /* @__PURE__ */ G(k, {
1209
1209
  className: "py-3",
1210
- children: Object.keys(C).length > 0 ? /* @__PURE__ */ W("span", {
1210
+ children: Object.keys(S).length > 0 ? /* @__PURE__ */ G("span", {
1211
1211
  className: "flex flex-wrap gap-1",
1212
- children: Object.entries(C).map(([e, t]) => /* @__PURE__ */ W(v, {
1212
+ children: Object.entries(S).map(([e, t]) => /* @__PURE__ */ G(y, {
1213
1213
  variant: "secondary",
1214
1214
  className: t.configured ? "" : "bg-held-surface text-held",
1215
- title: Ce(t),
1215
+ title: De(t),
1216
1216
  children: e
1217
1217
  }, e))
1218
- }) : /* @__PURE__ */ W("span", {
1218
+ }) : /* @__PURE__ */ G("span", {
1219
1219
  className: "text-sm text-muted-foreground",
1220
- children: /* @__PURE__ */ W(e, { id: "None required" })
1220
+ children: /* @__PURE__ */ G(e, { id: "None required" })
1221
1221
  })
1222
1222
  }),
1223
- /* @__PURE__ */ W(E, {
1223
+ /* @__PURE__ */ G(k, {
1224
1224
  className: "py-3",
1225
- children: n.archived && n.open_obligations === 0 ? /* @__PURE__ */ W(v, {
1225
+ children: n.archived && n.open_obligations === 0 ? /* @__PURE__ */ G(y, {
1226
1226
  variant: "secondary",
1227
- children: /* @__PURE__ */ W(e, { id: "archived" })
1228
- }) : n.archived ? /* @__PURE__ */ G(v, {
1227
+ children: /* @__PURE__ */ G(e, { id: "archived" })
1228
+ }) : n.archived ? /* @__PURE__ */ K(y, {
1229
1229
  variant: "secondary",
1230
1230
  className: "bg-held-surface text-held",
1231
1231
  children: [
1232
- /* @__PURE__ */ W(e, { id: "draining (" }),
1232
+ /* @__PURE__ */ G(e, { id: "draining (" }),
1233
1233
  n.open_obligations,
1234
1234
  ")"
1235
1235
  ]
1236
- }) : /* @__PURE__ */ W(v, {
1236
+ }) : /* @__PURE__ */ G(y, {
1237
1237
  variant: "secondary",
1238
1238
  className: "bg-settled-surface text-settled",
1239
- children: /* @__PURE__ */ W(e, { id: "active" })
1239
+ children: /* @__PURE__ */ G(e, { id: "active" })
1240
1240
  })
1241
1241
  }),
1242
- s && /* @__PURE__ */ W(E, {
1242
+ s && /* @__PURE__ */ G(k, {
1243
1243
  className: "py-3 text-right",
1244
- children: !n.archived && /* @__PURE__ */ G("div", {
1244
+ children: !n.archived && /* @__PURE__ */ K("div", {
1245
1245
  className: "flex justify-end gap-2",
1246
1246
  children: [
1247
- /* @__PURE__ */ W(Te, {
1247
+ /* @__PURE__ */ G(ke, {
1248
1248
  psp: n,
1249
- credentialKeys: x?.credential_keys ?? Object.keys(C)
1249
+ credentialKeys: b?.credential_keys ?? Object.keys(S)
1250
1250
  }, `${f() ?? ""}:${n.id}`),
1251
- /* @__PURE__ */ W(o, {
1251
+ /* @__PURE__ */ G(o, {
1252
1252
  variant: "outline",
1253
1253
  size: "sm",
1254
1254
  disabled: h.isPending,
1255
- onClick: () => w(!1),
1256
- children: /* @__PURE__ */ W(e, { id: "Archive" })
1255
+ onClick: () => C(!1),
1256
+ children: /* @__PURE__ */ G(e, { id: "Archive" })
1257
1257
  }),
1258
- /* @__PURE__ */ W(ie, {
1258
+ /* @__PURE__ */ G(ae, {
1259
1259
  open: g,
1260
- onOpenChange: y,
1261
- title: `Archive the last active ${S} PSP?`,
1260
+ onOpenChange: _,
1261
+ title: `Archive the last active ${x} PSP?`,
1262
1262
  description: p("New purchase on this rail is refused until another PSP is armed. Existing subscriptions, refunds and webhooks keep using this one."),
1263
1263
  confirmationWord: "ARCHIVE",
1264
1264
  actionLabel: "Archive PSP",
1265
- onConfirm: () => w(!0)
1265
+ onConfirm: () => C(!0)
1266
1266
  })
1267
1267
  ]
1268
1268
  })
@@ -1270,62 +1270,62 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1270
1270
  ]
1271
1271
  });
1272
1272
  }
1273
- function Te({ psp: n, credentialKeys: r }) {
1274
- let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { id: p } = t(), [h, g] = z.useState(!1), [_] = z.useState(() => f() ?? ""), v = z.useRef(n.revision), y = H(), b = B(d.updatePSP(y)), x = n.credentials ?? {}, S = K({
1273
+ function ke({ psp: n, credentialKeys: r }) {
1274
+ let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { id: p } = t(), [m, g] = B.useState(!1), [_] = B.useState(() => f() ?? ""), v = B.useRef(n.revision), ee = U(), y = V(d.updatePSP(ee)), b = n.credentials ?? {}, x = J({
1275
1275
  defaultValues: { credentials: {} },
1276
1276
  onSubmit: async ({ value: e }) => {
1277
1277
  let t = Object.fromEntries(Object.entries(e.credentials).filter(([, e]) => e.trim()));
1278
1278
  try {
1279
1279
  if ((f() ?? "") !== _) throw Error("Merchant changed; reopen this form");
1280
- await b.mutateAsync({
1280
+ await y.mutateAsync({
1281
1281
  id: n.id,
1282
1282
  psp: {
1283
1283
  expected_revision: v.current,
1284
1284
  credentials: t
1285
1285
  }
1286
- }), c.success(`${n.key} credentials validated and rotated`), C(!1);
1286
+ }), c.success(`${n.key} credentials validated and rotated`), S(!1);
1287
1287
  } catch (e) {
1288
1288
  if (e instanceof a && e.revisionMismatch) {
1289
- u(`PSP ${n.key}`), C(!1);
1289
+ u(`PSP ${n.key}`), S(!1);
1290
1290
  return;
1291
1291
  }
1292
1292
  l(e, "Rotate credentials");
1293
1293
  } finally {
1294
- b.reset();
1294
+ y.reset();
1295
1295
  }
1296
1296
  }
1297
- }), C = (e) => {
1298
- e || S.reset(), e && (v.current = n.revision), g(e);
1297
+ }), S = (e) => {
1298
+ e || x.reset(), e && (v.current = n.revision), g(e);
1299
1299
  };
1300
- return /* @__PURE__ */ G(P, {
1301
- open: h,
1302
- onOpenChange: C,
1303
- children: [/* @__PURE__ */ W(N, { render: /* @__PURE__ */ W(o, {
1300
+ return /* @__PURE__ */ K(re, {
1301
+ open: m,
1302
+ onOpenChange: S,
1303
+ children: [/* @__PURE__ */ G(ne, { render: /* @__PURE__ */ G(o, {
1304
1304
  variant: "outline",
1305
1305
  size: "sm",
1306
- children: /* @__PURE__ */ W(e, { id: "Rotate" })
1307
- }) }), /* @__PURE__ */ G(A, {
1308
- className: I,
1309
- children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ G(j, { children: [
1310
- /* @__PURE__ */ W(e, { id: "Rotate " }),
1306
+ children: /* @__PURE__ */ G(e, { id: "Rotate" })
1307
+ }) }), /* @__PURE__ */ K(P, {
1308
+ className: L,
1309
+ children: [/* @__PURE__ */ K(M, { children: [/* @__PURE__ */ K(F, { children: [
1310
+ /* @__PURE__ */ G(e, { id: "Rotate " }),
1311
1311
  n.key,
1312
- /* @__PURE__ */ W(e, { id: " credentials · " }),
1313
- De(n)
1314
- ] }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(e, { id: "Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now." }) })] }), /* @__PURE__ */ G("form", {
1312
+ /* @__PURE__ */ G(e, { id: " credentials · " }),
1313
+ je(n)
1314
+ ] }), /* @__PURE__ */ G(te, { children: /* @__PURE__ */ G(e, { id: "Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now." }) })] }), /* @__PURE__ */ K("form", {
1315
1315
  onSubmit: (e) => {
1316
- e.preventDefault(), e.stopPropagation(), S.handleSubmit();
1316
+ e.preventDefault(), e.stopPropagation(), x.handleSubmit();
1317
1317
  },
1318
1318
  className: "grid gap-4",
1319
- children: [/* @__PURE__ */ W(S.Field, {
1319
+ children: [/* @__PURE__ */ G(x.Field, {
1320
1320
  name: "credentials",
1321
- children: (t) => /* @__PURE__ */ G("div", {
1321
+ children: (t) => /* @__PURE__ */ K("div", {
1322
1322
  className: "grid gap-3",
1323
1323
  children: [r.map((r) => {
1324
- let i = x[r];
1325
- return /* @__PURE__ */ G($, {
1324
+ let i = b[r];
1325
+ return /* @__PURE__ */ K($, {
1326
1326
  label: r,
1327
1327
  id: `rot-${n.id}-${r}`,
1328
- children: [/* @__PURE__ */ W(s, {
1328
+ children: [/* @__PURE__ */ G(s, {
1329
1329
  id: p(`rot-${n.id}-${r}`),
1330
1330
  type: "password",
1331
1331
  autoComplete: "new-password",
@@ -1335,19 +1335,19 @@ function Te({ psp: n, credentialKeys: r }) {
1335
1335
  ...t.state.value,
1336
1336
  [r]: e.target.value
1337
1337
  })
1338
- }), i?.validated_at && /* @__PURE__ */ G("p", {
1338
+ }), i?.validated_at && /* @__PURE__ */ K("p", {
1339
1339
  className: "text-xs text-muted-foreground",
1340
- children: [/* @__PURE__ */ W(e, { id: "Last validated " }), m(i.validated_at)]
1340
+ children: [/* @__PURE__ */ G(e, { id: "Last validated " }), h(i.validated_at)]
1341
1341
  })]
1342
1342
  }, r);
1343
- }), /* @__PURE__ */ W("p", {
1343
+ }), /* @__PURE__ */ G("p", {
1344
1344
  className: "text-xs text-muted-foreground",
1345
- children: /* @__PURE__ */ W(e, { id: "Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active." })
1345
+ children: /* @__PURE__ */ G(e, { id: "Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active." })
1346
1346
  })]
1347
1347
  })
1348
- }), /* @__PURE__ */ W(k, { children: /* @__PURE__ */ W(S.Subscribe, {
1348
+ }), /* @__PURE__ */ G(N, { children: /* @__PURE__ */ G(x.Subscribe, {
1349
1349
  selector: (e) => [e.values.credentials, e.isSubmitting],
1350
- children: ([e, t]) => /* @__PURE__ */ W(o, {
1350
+ children: ([e, t]) => /* @__PURE__ */ G(o, {
1351
1351
  type: "submit",
1352
1352
  disabled: t || !Object.values(e).some((e) => e.trim()),
1353
1353
  children: t ? "Validating…" : "Validate & rotate"
@@ -1357,7 +1357,7 @@ function Te({ psp: n, credentialKeys: r }) {
1357
1357
  })]
1358
1358
  });
1359
1359
  }
1360
- var Ee = {
1360
+ var Ae = {
1361
1361
  gateway_id: {
1362
1362
  label: "Gateway ID",
1363
1363
  hint: "The Gateway ID shown in your NMI dashboard."
@@ -1379,36 +1379,36 @@ var Ee = {
1379
1379
  hint: "The Solana address your payments land in."
1380
1380
  }
1381
1381
  };
1382
- function De(e) {
1382
+ function je(e) {
1383
1383
  return e.client_accnum ? `${e.client_accnum}-${e.client_subacc ?? ""}` : e.gateway_id ?? e.account_id ?? e.treasury ?? "";
1384
1384
  }
1385
- var Oe = {
1385
+ var Me = {
1386
1386
  live: "Live: real money",
1387
1387
  test: "Test: the provider's own system, no money moves",
1388
1388
  sandbox: "Sandbox: the provider's separate sandbox",
1389
1389
  mainnet: "Mainnet: real money",
1390
1390
  devnet: "Devnet: Solana's development network",
1391
1391
  testnet: "Testnet: Solana's test network"
1392
- }, ke = {
1392
+ }, Ne = {
1393
1393
  nmi: "NMI",
1394
1394
  ccbill: "CCBill",
1395
1395
  stripe: "Stripe",
1396
1396
  solana: "Solana"
1397
1397
  };
1398
- function Ae(e, t) {
1399
- let n = ke[e] ?? e;
1398
+ function Pe(e, t) {
1399
+ let n = Ne[e] ?? e;
1400
1400
  return !t || t.toLowerCase() === n.toLowerCase() ? n : `${t} (${n})`;
1401
1401
  }
1402
- var je = {
1402
+ var Fe = {
1403
1403
  api: "API",
1404
1404
  id: "ID",
1405
1405
  url: "URL"
1406
1406
  };
1407
- function Me(e) {
1408
- return e.split(/[_-]+/).filter(Boolean).map((e, t) => je[e.toLowerCase()] || (t > 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase())).join(" ");
1407
+ function Ie(e) {
1408
+ return e.split(/[_-]+/).filter(Boolean).map((e, t) => Fe[e.toLowerCase()] || (t > 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase())).join(" ");
1409
1409
  }
1410
- function Ne({ railDefinitions: n }) {
1411
- let { toast: r, toastApiError: a, adminMutations: c, selectedMerchant: l } = i(), { text: u, id: d } = t(), [f, p] = z.useState(!1), [m] = z.useState(() => l() ?? ""), h = H(), g = B(c.createPSP(h)), _ = K({
1410
+ function Le({ railDefinitions: n }) {
1411
+ let { toast: r, toastApiError: a, adminMutations: c, selectedMerchant: l } = i(), { text: u, id: d } = t(), [f, p] = B.useState(!1), [m] = B.useState(() => l() ?? ""), h = U(), g = V(c.createPSP(h)), _ = J({
1412
1412
  defaultValues: {
1413
1413
  rail: "",
1414
1414
  environment: "",
@@ -1437,107 +1437,107 @@ function Ne({ railDefinitions: n }) {
1437
1437
  }), v = (e) => {
1438
1438
  e || _.reset(), p(e);
1439
1439
  };
1440
- return /* @__PURE__ */ G(P, {
1440
+ return /* @__PURE__ */ K(re, {
1441
1441
  open: f,
1442
1442
  onOpenChange: v,
1443
- children: [/* @__PURE__ */ W(N, { render: /* @__PURE__ */ W(o, {
1443
+ children: [/* @__PURE__ */ G(ne, { render: /* @__PURE__ */ G(o, {
1444
1444
  size: "sm",
1445
- children: /* @__PURE__ */ W(e, { id: "Add PSP" })
1446
- }) }), /* @__PURE__ */ G(A, {
1447
- className: I,
1448
- children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(e, { id: "Add a PSP" }) }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(e, { id: "Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again." }) })] }), /* @__PURE__ */ G("form", {
1445
+ children: /* @__PURE__ */ G(e, { id: "Add PSP" })
1446
+ }) }), /* @__PURE__ */ K(P, {
1447
+ className: L,
1448
+ children: [/* @__PURE__ */ K(M, { children: [/* @__PURE__ */ G(F, { children: /* @__PURE__ */ G(e, { id: "Add a PSP" }) }), /* @__PURE__ */ G(te, { children: /* @__PURE__ */ G(e, { id: "Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again." }) })] }), /* @__PURE__ */ K("form", {
1449
1449
  onSubmit: (e) => {
1450
1450
  e.preventDefault(), e.stopPropagation(), _.handleSubmit();
1451
1451
  },
1452
1452
  className: "grid gap-4",
1453
- children: [/* @__PURE__ */ G("div", {
1453
+ children: [/* @__PURE__ */ K("div", {
1454
1454
  className: "grid gap-3",
1455
1455
  children: [
1456
- /* @__PURE__ */ W(_.Field, {
1456
+ /* @__PURE__ */ G(_.Field, {
1457
1457
  name: "rail",
1458
1458
  validators: { onChange: ({ value: e }) => e ? void 0 : "Choose a payment rail" },
1459
- children: (e) => /* @__PURE__ */ G($, {
1459
+ children: (e) => /* @__PURE__ */ K($, {
1460
1460
  label: u("Payment rail"),
1461
1461
  id: "pv-rail",
1462
- children: [/* @__PURE__ */ G(w, {
1462
+ children: [/* @__PURE__ */ K(T, {
1463
1463
  items: n.map((e) => ({
1464
1464
  value: e.rail,
1465
- label: Ae(e.rail, e.display_name)
1465
+ label: Pe(e.rail, e.display_name)
1466
1466
  })),
1467
1467
  value: e.state.value || null,
1468
1468
  onValueChange: (t) => {
1469
1469
  e.handleChange(t ?? ""), _.setFieldValue("account", {}), _.setFieldValue("credentials", {}), _.setFieldValue("environment", n.find((e) => e.rail === t)?.environments[0] ?? "");
1470
1470
  },
1471
- children: [/* @__PURE__ */ W(x, {
1471
+ children: [/* @__PURE__ */ G(S, {
1472
1472
  id: d("pv-rail"),
1473
1473
  className: "w-full",
1474
1474
  "aria-invalid": e.state.meta.errors.length > 0,
1475
- children: /* @__PURE__ */ W(b, { placeholder: u("Pick a rail…") })
1476
- }), /* @__PURE__ */ W(S, { children: n.map((e) => /* @__PURE__ */ W(C, {
1475
+ children: /* @__PURE__ */ G(x, { placeholder: u("Pick a rail…") })
1476
+ }), /* @__PURE__ */ G(C, { children: n.map((e) => /* @__PURE__ */ G(w, {
1477
1477
  value: e.rail,
1478
- children: Ae(e.rail, e.display_name)
1478
+ children: Pe(e.rail, e.display_name)
1479
1479
  }, e.rail)) })]
1480
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
1480
+ }), /* @__PURE__ */ G(b, { errors: e.state.meta.errors })]
1481
1481
  })
1482
1482
  }),
1483
- /* @__PURE__ */ W(_.Subscribe, {
1483
+ /* @__PURE__ */ G(_.Subscribe, {
1484
1484
  selector: (e) => e.values.rail,
1485
1485
  children: (e) => {
1486
1486
  let t = n.find((t) => t.rail === e)?.environments ?? [];
1487
- return /* @__PURE__ */ W(_.Field, {
1487
+ return /* @__PURE__ */ G(_.Field, {
1488
1488
  name: "environment",
1489
1489
  validators: { onChange: ({ value: e }) => e ? void 0 : "Choose whether it moves real money" },
1490
- children: (n) => /* @__PURE__ */ G($, {
1490
+ children: (n) => /* @__PURE__ */ K($, {
1491
1491
  label: u("Environment"),
1492
1492
  id: "pv-environment",
1493
1493
  hint: "Whether this PSP moves real money. It is checked with the provider before the PSP is used.",
1494
- children: [/* @__PURE__ */ G(w, {
1494
+ children: [/* @__PURE__ */ K(T, {
1495
1495
  items: t.map((e) => ({
1496
1496
  value: e,
1497
- label: u(Oe[e] ?? e)
1497
+ label: u(Me[e] ?? e)
1498
1498
  })),
1499
1499
  value: n.state.value || null,
1500
1500
  onValueChange: (e) => n.handleChange(e ?? ""),
1501
- children: [/* @__PURE__ */ W(x, {
1501
+ children: [/* @__PURE__ */ G(S, {
1502
1502
  id: d("pv-environment"),
1503
1503
  className: "w-full",
1504
1504
  disabled: !e,
1505
1505
  "aria-invalid": n.state.meta.errors.length > 0,
1506
- children: /* @__PURE__ */ W(b, { placeholder: u("Pick an environment…") })
1507
- }), /* @__PURE__ */ W(S, { children: t.map((e) => /* @__PURE__ */ W(C, {
1506
+ children: /* @__PURE__ */ G(x, { placeholder: u("Pick an environment…") })
1507
+ }), /* @__PURE__ */ G(C, { children: t.map((e) => /* @__PURE__ */ G(w, {
1508
1508
  value: e,
1509
- children: u(Oe[e] ?? e)
1509
+ children: u(Me[e] ?? e)
1510
1510
  }, e)) })]
1511
- }), /* @__PURE__ */ W(y, { errors: n.state.meta.errors })]
1511
+ }), /* @__PURE__ */ G(b, { errors: n.state.meta.errors })]
1512
1512
  })
1513
1513
  });
1514
1514
  }
1515
1515
  }),
1516
- /* @__PURE__ */ W(_.Field, {
1516
+ /* @__PURE__ */ G(_.Field, {
1517
1517
  name: "key",
1518
1518
  validators: { onChange: ({ value: e }) => /^[a-z0-9][a-z0-9_-]{0,62}$/.test(e.trim().toLowerCase()) ? void 0 : "Lowercase letters, digits, - or _" },
1519
- children: (e) => /* @__PURE__ */ G($, {
1519
+ children: (e) => /* @__PURE__ */ K($, {
1520
1520
  label: u("Key"),
1521
1521
  id: "pv-key",
1522
1522
  hint: "Your name for this PSP, such as mobius. Prices and purchase name it by this key.",
1523
- children: [/* @__PURE__ */ W(s, {
1523
+ children: [/* @__PURE__ */ G(s, {
1524
1524
  id: d("pv-key"),
1525
1525
  value: e.state.value,
1526
1526
  onBlur: e.handleBlur,
1527
1527
  onChange: (t) => e.handleChange(t.target.value),
1528
1528
  "aria-invalid": e.state.meta.errors.length > 0
1529
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
1529
+ }), /* @__PURE__ */ G(b, { errors: e.state.meta.errors })]
1530
1530
  })
1531
1531
  }),
1532
- /* @__PURE__ */ W(_.Subscribe, {
1532
+ /* @__PURE__ */ G(_.Subscribe, {
1533
1533
  selector: (e) => e.values.rail,
1534
- children: (e) => /* @__PURE__ */ W(_.Field, {
1534
+ children: (e) => /* @__PURE__ */ G(_.Field, {
1535
1535
  name: "account",
1536
- children: (t) => /* @__PURE__ */ W(U, { children: n.find((t) => t.rail === e)?.account_fields.map((e) => /* @__PURE__ */ W($, {
1537
- label: u(Ee[e]?.label ?? Me(e)),
1536
+ children: (t) => /* @__PURE__ */ G(W, { children: n.find((t) => t.rail === e)?.account_fields.map((e) => /* @__PURE__ */ G($, {
1537
+ label: u(Ae[e]?.label ?? Ie(e)),
1538
1538
  id: `pv-account-${e}`,
1539
- hint: Ee[e]?.hint,
1540
- children: /* @__PURE__ */ W(s, {
1539
+ hint: Ae[e]?.hint,
1540
+ children: /* @__PURE__ */ G(s, {
1541
1541
  id: d(`pv-account-${e}`),
1542
1542
  value: t.state.value[e] ?? "",
1543
1543
  onBlur: t.handleBlur,
@@ -1549,16 +1549,16 @@ function Ne({ railDefinitions: n }) {
1549
1549
  }, e)) })
1550
1550
  })
1551
1551
  }),
1552
- /* @__PURE__ */ W(_.Subscribe, {
1552
+ /* @__PURE__ */ G(_.Subscribe, {
1553
1553
  selector: (e) => e.values.rail,
1554
1554
  children: (e) => {
1555
1555
  let t = n.find((t) => t.rail === e);
1556
- return /* @__PURE__ */ W(_.Field, {
1556
+ return /* @__PURE__ */ G(_.Field, {
1557
1557
  name: "credentials",
1558
- children: (e) => /* @__PURE__ */ W(U, { children: t?.credential_keys.map((t) => /* @__PURE__ */ W($, {
1559
- label: Me(t),
1558
+ children: (e) => /* @__PURE__ */ G(W, { children: t?.credential_keys.map((t) => /* @__PURE__ */ G($, {
1559
+ label: Ie(t),
1560
1560
  id: `pv-credential-${t}`,
1561
- children: /* @__PURE__ */ W(s, {
1561
+ children: /* @__PURE__ */ G(s, {
1562
1562
  id: d(`pv-credential-${t}`),
1563
1563
  type: "password",
1564
1564
  autoComplete: "new-password",
@@ -1573,7 +1573,7 @@ function Ne({ railDefinitions: n }) {
1573
1573
  }
1574
1574
  })
1575
1575
  ]
1576
- }), /* @__PURE__ */ W(k, { children: /* @__PURE__ */ W(_.Subscribe, {
1576
+ }), /* @__PURE__ */ G(N, { children: /* @__PURE__ */ G(_.Subscribe, {
1577
1577
  selector: (e) => [
1578
1578
  e.values.rail,
1579
1579
  e.values.environment,
@@ -1582,12 +1582,12 @@ function Ne({ railDefinitions: n }) {
1582
1582
  e.canSubmit,
1583
1583
  e.isSubmitting
1584
1584
  ],
1585
- children: ([t, r, i, a, s, c]) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(o, {
1585
+ children: ([t, r, i, a, s, c]) => /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(o, {
1586
1586
  type: "button",
1587
1587
  variant: "outline",
1588
1588
  onClick: () => v(!1),
1589
- children: /* @__PURE__ */ W(e, { id: "Cancel" })
1590
- }), /* @__PURE__ */ W(o, {
1589
+ children: /* @__PURE__ */ G(e, { id: "Cancel" })
1590
+ }), /* @__PURE__ */ G(o, {
1591
1591
  type: "submit",
1592
1592
  disabled: !t || !r || !i.trim() || !n.find((e) => e.rail === t)?.account_fields.every((e) => (a[e] ?? "").trim()) || !s || c,
1593
1593
  children: c ? "Saving…" : "Add PSP"
@@ -1597,164 +1597,174 @@ function Ne({ railDefinitions: n }) {
1597
1597
  })]
1598
1598
  });
1599
1599
  }
1600
- function Pe() {
1601
- let { toast: n, toastApiError: r, adminMutations: a } = i(), { text: l, id: u } = t(), [d, f] = z.useState(), m = B(a.lookupCustomerControls()), _ = B(a.setCreditLimit()), v = c(), b = K({
1600
+ function Re() {
1601
+ let { toast: n, toastApiError: r, adminMutations: a, adminQueries: l } = i(), { text: u, id: d } = t(), [f, h] = B.useState(), ee = V(a.lookupCustomerControls()), y = V(a.setCreditLimit()), E = c(), D = J({
1602
1602
  defaultValues: { newLimit: "" },
1603
1603
  onSubmit: async ({ value: e }) => {
1604
- if (!d) return;
1605
- let t = p(d.currency), i = t === void 0 ? null : g(e.newLimit, t);
1604
+ if (!f) return;
1605
+ let t = m(f.currency), i = t === void 0 ? null : v(e.newLimit, t);
1606
1606
  if (!(i === null || i.startsWith("-"))) try {
1607
- await _.mutateAsync({
1608
- customerId: d.customerID,
1609
- currency: d.currency,
1607
+ await y.mutateAsync({
1608
+ customerId: f.customerID,
1609
+ currency: f.currency,
1610
1610
  amount: i
1611
- }), f((e) => e && {
1611
+ }), h((e) => e && {
1612
1612
  ...e,
1613
1613
  creditLimit: i
1614
- }), b.reset(), n.success("Credit limit updated");
1614
+ }), D.reset(), n.success("Credit limit updated");
1615
1615
  } catch (e) {
1616
1616
  r(e, "Set credit limit");
1617
1617
  }
1618
1618
  }
1619
- }), x = K({
1620
- defaultValues: {
1621
- customerID: "",
1622
- currency: "usd"
1623
- },
1619
+ }), [O, k] = B.useState(), { data: A } = H(l.merchantConfiguration()), j = [...new Set([
1620
+ ...A?.usage_billing?.currencies ?? [],
1621
+ ...O?.balances ?? [],
1622
+ ...O?.settings.credit_limits ?? [],
1623
+ ...O?.settings.trust_levels ?? []
1624
+ ].map((e) => e.currency.toUpperCase()))].sort(), M = j.length ? j : Object.keys(p).sort(), N = J({
1625
+ defaultValues: { currency: "" },
1624
1626
  onSubmit: async ({ value: e }) => {
1625
- let t = e.customerID.trim(), n = e.currency.trim().toLowerCase();
1626
- try {
1627
- let e = await m.mutateAsync({
1628
- customerId: t,
1629
- currency: n
1627
+ let t = e.currency || M[0];
1628
+ if (!(!O || !t)) try {
1629
+ let e = await ee.mutateAsync({
1630
+ customerId: O.id,
1631
+ currency: t
1630
1632
  });
1631
- f({
1632
- customerID: t,
1633
+ h({
1634
+ customerID: O.id,
1633
1635
  ...e
1634
- }), b.reset();
1636
+ }), D.reset();
1635
1637
  } catch (e) {
1636
- r(e, "Lookup customer controls"), f(void 0);
1638
+ r(e, "Lookup customer controls"), h(void 0);
1637
1639
  }
1638
1640
  }
1639
- });
1640
- return /* @__PURE__ */ G("div", {
1641
+ }), P = (e) => {
1642
+ k(e), h(void 0), N.reset();
1643
+ };
1644
+ return /* @__PURE__ */ K("div", {
1641
1645
  className: "grid gap-10",
1642
- children: [/* @__PURE__ */ G("section", {
1646
+ children: [/* @__PURE__ */ K("section", {
1643
1647
  className: "grid gap-5",
1644
- children: [/* @__PURE__ */ G("div", {
1648
+ children: [/* @__PURE__ */ K("div", {
1645
1649
  className: "grid gap-1",
1646
- children: [/* @__PURE__ */ W("h2", {
1650
+ children: [/* @__PURE__ */ G("h2", {
1647
1651
  className: "text-base font-semibold",
1648
- children: /* @__PURE__ */ W(e, { id: "Customer lookup" })
1649
- }), /* @__PURE__ */ W("p", {
1652
+ children: /* @__PURE__ */ G(e, { id: "Customer lookup" })
1653
+ }), /* @__PURE__ */ G("p", {
1650
1654
  className: "text-sm text-muted-foreground",
1651
- children: /* @__PURE__ */ W(e, { id: "Find a customer by ID and currency." })
1655
+ children: /* @__PURE__ */ G(e, { id: "Find a customer by name or email, then pick a currency." })
1652
1656
  })]
1653
- }), /* @__PURE__ */ G("form", {
1654
- onSubmit: (e) => {
1655
- e.preventDefault(), e.stopPropagation(), x.handleSubmit();
1656
- },
1657
+ }), /* @__PURE__ */ K("div", {
1657
1658
  className: "grid gap-4 md:grid-cols-[minmax(0,1fr)_10rem_auto] md:items-end",
1658
- children: [
1659
- /* @__PURE__ */ W(x.Field, {
1660
- name: "customerID",
1661
- validators: { onChange: ({ value: e }) => e.trim() ? void 0 : "Enter a customer ID" },
1662
- children: (e) => /* @__PURE__ */ G($, {
1663
- label: l("Customer ID"),
1664
- id: "customer-controls-id",
1665
- children: [/* @__PURE__ */ W(s, {
1666
- id: u("customer-controls-id"),
1667
- placeholder: l("Customer UUID"),
1668
- value: e.state.value,
1669
- onBlur: e.handleBlur,
1670
- onChange: (t) => e.handleChange(t.target.value),
1671
- "aria-invalid": e.state.meta.errors.length > 0
1672
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
1673
- })
1674
- }),
1675
- /* @__PURE__ */ W(x.Field, {
1659
+ children: [/* @__PURE__ */ K("div", {
1660
+ className: "grid gap-1.5",
1661
+ children: [/* @__PURE__ */ G(I, { children: /* @__PURE__ */ G(e, { id: "Customer" }) }), O ? /* @__PURE__ */ K("span", {
1662
+ className: "inline-flex h-8 w-fit max-w-full items-center gap-1 rounded-md bg-muted pr-1 pl-2 text-sm font-medium",
1663
+ children: [/* @__PURE__ */ G("span", {
1664
+ className: "truncate",
1665
+ children: g(O)
1666
+ }), /* @__PURE__ */ G(o, {
1667
+ variant: "ghost",
1668
+ size: "icon",
1669
+ className: "size-5",
1670
+ "aria-label": u("Clear customer"),
1671
+ onClick: () => P(void 0),
1672
+ children: /* @__PURE__ */ G(q, {
1673
+ icon: ue,
1674
+ className: "size-3"
1675
+ })
1676
+ })]
1677
+ }) : /* @__PURE__ */ G(oe, { onPick: P })]
1678
+ }), /* @__PURE__ */ K("form", {
1679
+ onSubmit: (e) => {
1680
+ e.preventDefault(), e.stopPropagation(), N.handleSubmit();
1681
+ },
1682
+ className: "contents",
1683
+ children: [/* @__PURE__ */ G(N.Field, {
1676
1684
  name: "currency",
1677
- validators: { onChange: ({ value: e }) => e.trim() ? void 0 : "Enter a currency" },
1678
1685
  children: (e) => /* @__PURE__ */ G($, {
1679
- label: l("Currency"),
1686
+ label: u("Currency"),
1680
1687
  id: "customer-controls-currency",
1681
- children: [/* @__PURE__ */ W(s, {
1682
- id: u("customer-controls-currency"),
1683
- placeholder: l("USD"),
1684
- value: e.state.value,
1685
- onBlur: e.handleBlur,
1686
- onChange: (t) => e.handleChange(t.target.value),
1687
- "aria-invalid": e.state.meta.errors.length > 0
1688
- }), /* @__PURE__ */ W(y, { errors: e.state.meta.errors })]
1688
+ children: /* @__PURE__ */ K(T, {
1689
+ items: M.map((e) => ({
1690
+ value: e,
1691
+ label: e
1692
+ })),
1693
+ value: e.state.value || M[0] || null,
1694
+ onValueChange: (t) => e.handleChange(t ?? ""),
1695
+ children: [/* @__PURE__ */ G(S, {
1696
+ id: d("customer-controls-currency"),
1697
+ className: "w-full",
1698
+ disabled: M.length === 0,
1699
+ children: /* @__PURE__ */ G(x, { placeholder: u(O ? "No currency yet" : "Pick a customer first") })
1700
+ }), /* @__PURE__ */ G(C, { children: M.map((e) => /* @__PURE__ */ G(w, {
1701
+ value: e,
1702
+ children: e
1703
+ }, e)) })]
1704
+ })
1689
1705
  })
1690
- }),
1691
- /* @__PURE__ */ W(x.Subscribe, {
1692
- selector: (e) => [
1693
- e.values.customerID,
1694
- e.values.currency,
1695
- e.canSubmit,
1696
- e.isSubmitting
1697
- ],
1698
- children: ([e, t, n, r]) => /* @__PURE__ */ W(o, {
1706
+ }), /* @__PURE__ */ G(N.Subscribe, {
1707
+ selector: (e) => e.isSubmitting,
1708
+ children: (e) => /* @__PURE__ */ G(o, {
1699
1709
  type: "submit",
1700
1710
  variant: "outline",
1701
- disabled: !e.trim() || !t.trim() || !n || r,
1702
- children: r ? "Looking up…" : "Look up"
1711
+ disabled: !O || !M.length || e,
1712
+ children: e ? "Looking up…" : "Look up"
1703
1713
  })
1704
- })
1705
- ]
1714
+ })]
1715
+ })]
1706
1716
  })]
1707
- }), d && /* @__PURE__ */ G("section", {
1717
+ }), f && /* @__PURE__ */ K("section", {
1708
1718
  className: "grid gap-5",
1709
1719
  children: [
1710
- /* @__PURE__ */ G("div", {
1720
+ /* @__PURE__ */ K("div", {
1711
1721
  className: "grid gap-1",
1712
- children: [/* @__PURE__ */ W("h2", {
1722
+ children: [/* @__PURE__ */ G("h2", {
1713
1723
  className: "text-base font-semibold",
1714
- children: /* @__PURE__ */ W(e, { id: "Credit and trust" })
1715
- }), /* @__PURE__ */ G("p", {
1724
+ children: /* @__PURE__ */ G(e, { id: "Credit and trust" })
1725
+ }), /* @__PURE__ */ K("p", {
1716
1726
  className: "text-sm text-muted-foreground",
1717
1727
  children: [
1718
- /* @__PURE__ */ W("span", {
1728
+ /* @__PURE__ */ G("span", {
1719
1729
  className: "font-mono text-xs break-all text-foreground",
1720
- children: d.customerID
1730
+ children: f.customerID
1721
1731
  }),
1722
1732
  " ",
1723
1733
  "· ",
1724
- d.currency.toUpperCase()
1734
+ f.currency.toUpperCase()
1725
1735
  ]
1726
1736
  })]
1727
1737
  }),
1728
- /* @__PURE__ */ G("dl", {
1738
+ /* @__PURE__ */ K("dl", {
1729
1739
  className: "grid gap-4",
1730
- children: [/* @__PURE__ */ W(X, {
1731
- label: l("Trust level"),
1732
- value: d.trustLevel || "Default"
1733
- }), /* @__PURE__ */ W(X, {
1734
- label: l("Credit limit"),
1735
- value: d.creditLimit === "0" ? "Off" : h(d.creditLimit, d.currency)
1740
+ children: [/* @__PURE__ */ G(X, {
1741
+ label: u("Trust level"),
1742
+ value: f.trustLevel || "Default"
1743
+ }), /* @__PURE__ */ G(X, {
1744
+ label: u("Credit limit"),
1745
+ value: f.creditLimit === "0" ? "Off" : _(f.creditLimit, f.currency)
1736
1746
  })]
1737
1747
  }),
1738
- v && /* @__PURE__ */ W("form", {
1748
+ E && /* @__PURE__ */ G("form", {
1739
1749
  onSubmit: (e) => {
1740
- e.preventDefault(), e.stopPropagation(), b.handleSubmit();
1750
+ e.preventDefault(), e.stopPropagation(), D.handleSubmit();
1741
1751
  },
1742
- children: /* @__PURE__ */ W(Z, {
1743
- label: `New limit (${d.currency.toUpperCase()})`,
1752
+ children: /* @__PURE__ */ G(Z, {
1753
+ label: `New limit (${f.currency.toUpperCase()})`,
1744
1754
  id: "customer-controls-limit",
1745
- children: /* @__PURE__ */ W(b.Field, {
1755
+ children: /* @__PURE__ */ G(D.Field, {
1746
1756
  name: "newLimit",
1747
1757
  validators: { onChange: ({ value: e }) => {
1748
- let t = p(d.currency), n = t === void 0 ? null : g(e, t);
1758
+ let t = m(f.currency), n = t === void 0 ? null : v(e, t);
1749
1759
  return e !== "" && n !== null && !n.startsWith("-") ? void 0 : "Enter a valid amount";
1750
1760
  } },
1751
- children: (t) => /* @__PURE__ */ G("div", {
1761
+ children: (t) => /* @__PURE__ */ K("div", {
1752
1762
  className: "grid gap-1.5",
1753
1763
  children: [
1754
- /* @__PURE__ */ G("div", {
1764
+ /* @__PURE__ */ K("div", {
1755
1765
  className: "flex gap-2",
1756
- children: [/* @__PURE__ */ W(s, {
1757
- id: u("customer-controls-limit"),
1766
+ children: [/* @__PURE__ */ G(s, {
1767
+ id: d("customer-controls-limit"),
1758
1768
  placeholder: "0.00",
1759
1769
  type: "number",
1760
1770
  step: "any",
@@ -1763,23 +1773,23 @@ function Pe() {
1763
1773
  onBlur: t.handleBlur,
1764
1774
  onChange: (e) => t.handleChange(e.target.value),
1765
1775
  "aria-invalid": t.state.meta.errors.length > 0
1766
- }), /* @__PURE__ */ W(b.Subscribe, {
1776
+ }), /* @__PURE__ */ G(D.Subscribe, {
1767
1777
  selector: (e) => [
1768
1778
  e.values.newLimit,
1769
1779
  e.canSubmit,
1770
1780
  e.isSubmitting
1771
1781
  ],
1772
- children: ([e, t, n]) => /* @__PURE__ */ W(o, {
1782
+ children: ([e, t, n]) => /* @__PURE__ */ G(o, {
1773
1783
  type: "submit",
1774
1784
  disabled: !e || !t || n,
1775
1785
  children: n ? "Updating…" : "Update"
1776
1786
  })
1777
1787
  })]
1778
1788
  }),
1779
- /* @__PURE__ */ W(y, { errors: t.state.meta.errors }),
1780
- /* @__PURE__ */ W("p", {
1789
+ /* @__PURE__ */ G(b, { errors: t.state.meta.errors }),
1790
+ /* @__PURE__ */ G("p", {
1781
1791
  className: "text-xs text-muted-foreground",
1782
- children: /* @__PURE__ */ W(e, { id: "Enter 0 to turn credit off." })
1792
+ children: /* @__PURE__ */ G(e, { id: "Enter 0 to turn credit off." })
1783
1793
  })
1784
1794
  ]
1785
1795
  })
@@ -1792,14 +1802,14 @@ function Pe() {
1792
1802
  }
1793
1803
  function $({ label: e, id: n, hint: r, children: i }) {
1794
1804
  let { id: a } = t();
1795
- return /* @__PURE__ */ G("div", {
1805
+ return /* @__PURE__ */ K("div", {
1796
1806
  className: "grid gap-1.5",
1797
1807
  children: [
1798
- /* @__PURE__ */ W(F, {
1808
+ /* @__PURE__ */ G(I, {
1799
1809
  htmlFor: a(n),
1800
1810
  children: e
1801
1811
  }),
1802
- r ? /* @__PURE__ */ W("p", {
1812
+ r ? /* @__PURE__ */ G("p", {
1803
1813
  className: "text-[13px] text-muted-foreground",
1804
1814
  children: r
1805
1815
  }) : null,
@@ -1808,6 +1818,6 @@ function $({ label: e, id: n, hint: r, children: i }) {
1808
1818
  });
1809
1819
  }
1810
1820
  //#endregion
1811
- export { ve as SettingsPage };
1821
+ export { Se as SettingsPage };
1812
1822
 
1813
- //# sourceMappingURL=admin-settings-BOoTzhyf.js.map
1823
+ //# sourceMappingURL=admin-settings-DscHu4ww.js.map