@openrails/billing-ui 0.281.0 → 0.283.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 (221) hide show
  1. package/README.md +108 -364
  2. package/dist/account/format.d.ts +6 -2
  3. package/dist/admin/context.d.ts +38 -46
  4. package/dist/admin/lib/api/endpoints.d.ts +4 -4
  5. package/dist/admin/lib/api/index.d.ts +4 -4
  6. package/dist/admin/lib/api/metrics.d.ts +15 -6
  7. package/dist/admin/lib/capabilities.d.ts +2 -0
  8. package/dist/admin/lib/duration.d.ts +4 -0
  9. package/dist/admin/lib/format.d.ts +29 -1
  10. package/dist/admin/lib/mutations.d.ts +0 -10
  11. package/dist/admin/lib/queries.d.ts +16 -10
  12. package/dist/admin/messages.d.ts +61 -20
  13. package/dist/admin/pages/catalog/price-wizard-logic.d.ts +2 -0
  14. package/dist/admin/pages/catalog/price-wizard.d.ts +1 -3
  15. package/dist/admin/pages/customers/credits.d.ts +4 -1
  16. package/dist/admin/pages/dashboard/levels.d.ts +8 -0
  17. package/dist/admin/pages/dashboard/lib.d.ts +16 -7
  18. package/dist/admin/pages/dashboard/programs.d.ts +3 -0
  19. package/dist/admin/pages/dashboard/query-builder.d.ts +20 -0
  20. package/dist/admin/pages/dashboard/range.d.ts +8 -2
  21. package/dist/admin/pages/dashboard/registry.d.ts +14 -0
  22. package/dist/admin/pages/dashboard/reports-model.d.ts +8 -4
  23. package/dist/admin/pages/dashboard/reports.d.ts +1 -1
  24. package/dist/admin/pages/dashboard/units.d.ts +5 -0
  25. package/dist/admin/pages/dashboard/use-range.d.ts +5 -1
  26. package/dist/admin/pages/dashboard/widget-editor.d.ts +7 -2
  27. package/dist/admin/pages/dashboard/widget-tile.d.ts +10 -4
  28. package/dist/admin/pages/dashboard/widget-viz.d.ts +10 -5
  29. package/dist/admin/pages/ops/signals.d.ts +4 -0
  30. package/dist/admin/pages/payments/attempts.d.ts +2 -2
  31. package/dist/admin/pages/payments/health-model.d.ts +20 -20
  32. package/dist/admin/pages/subscriptions/views.d.ts +4 -0
  33. package/dist/admin-attempts-CRkxeVfQ.js +417 -0
  34. package/dist/admin-attempts-CRkxeVfQ.js.map +1 -0
  35. package/dist/{admin-auth-BUUdvmqC.js → admin-auth-C0pBH3kp.js} +2 -2
  36. package/dist/{admin-auth-BUUdvmqC.js.map → admin-auth-C0pBH3kp.js.map} +1 -1
  37. package/dist/{admin-badge-CAlUmS2s.js → admin-badge-C_-j7ANF.js} +2 -2
  38. package/dist/{admin-badge-CAlUmS2s.js.map → admin-badge-C_-j7ANF.js.map} +1 -1
  39. package/dist/{admin-button-Bn4otsuw.js → admin-button-BV5MAL2H.js} +2 -2
  40. package/dist/{admin-button-Bn4otsuw.js.map → admin-button-BV5MAL2H.js.map} +1 -1
  41. package/dist/{admin-capabilities-DS-X-__V.js → admin-capabilities-B3ZfkA49.js} +21 -13
  42. package/dist/admin-capabilities-B3ZfkA49.js.map +1 -0
  43. package/dist/{admin-card-BHKW1dfB.js → admin-card-DQ61c-kV.js} +2 -2
  44. package/dist/{admin-card-BHKW1dfB.js.map → admin-card-DQ61c-kV.js.map} +1 -1
  45. package/dist/admin-catalog-DAnsClai.js +867 -0
  46. package/dist/admin-catalog-DAnsClai.js.map +1 -0
  47. package/dist/{admin-cursor-pager-Qo9Sq6lN.js → admin-cursor-pager-dkNj-gb6.js} +22 -22
  48. package/dist/{admin-cursor-pager-Qo9Sq6lN.js.map → admin-cursor-pager-dkNj-gb6.js.map} +1 -1
  49. package/dist/admin-customer-search-DDMn_5Us.js +115 -0
  50. package/dist/admin-customer-search-DDMn_5Us.js.map +1 -0
  51. package/dist/{admin-customers-BZP6Jv-i.js → admin-customers-BMaugwpg.js} +24 -25
  52. package/dist/admin-customers-BMaugwpg.js.map +1 -0
  53. package/dist/admin-dashboard-DbbfrIOq.js +510 -0
  54. package/dist/admin-dashboard-DbbfrIOq.js.map +1 -0
  55. package/dist/{admin-data-table-BiFmcf0Z.js → admin-data-table-BjA8cBsr.js} +5 -5
  56. package/dist/{admin-data-table-BiFmcf0Z.js.map → admin-data-table-BjA8cBsr.js.map} +1 -1
  57. package/dist/admin-detail-BVJcnTO-.js +1361 -0
  58. package/dist/admin-detail-BVJcnTO-.js.map +1 -0
  59. package/dist/{admin-detail-cijme9Lc.js → admin-detail-DO9wd12I.js} +130 -107
  60. package/dist/admin-detail-DO9wd12I.js.map +1 -0
  61. package/dist/{admin-detail-CQws8363.js → admin-detail-M7YFYOGN.js} +211 -210
  62. package/dist/{admin-detail-CQws8363.js.map → admin-detail-M7YFYOGN.js.map} +1 -1
  63. package/dist/admin-detail-sOLj-K-Y.js +336 -0
  64. package/dist/{admin-detail-NApy5bio.js.map → admin-detail-sOLj-K-Y.js.map} +1 -1
  65. package/dist/admin-detail-uZ-eR2TT.js +292 -0
  66. package/dist/{admin-detail-C6VH3i2v.js.map → admin-detail-uZ-eR2TT.js.map} +1 -1
  67. package/dist/{admin-dialog-CgYGInHi.js → admin-dialog-BxRcYcQM.js} +3 -3
  68. package/dist/{admin-dialog-CgYGInHi.js.map → admin-dialog-BxRcYcQM.js.map} +1 -1
  69. package/dist/{admin-dropdown-menu-CU9RxoEJ.js → admin-dropdown-menu-DlyaKwyU.js} +2 -2
  70. package/dist/{admin-dropdown-menu-CU9RxoEJ.js.map → admin-dropdown-menu-DlyaKwyU.js.map} +1 -1
  71. package/dist/{admin-dunning-D8lAP7OA.js → admin-dunning-CDy6aMAj.js} +2 -2
  72. package/dist/{admin-dunning-D8lAP7OA.js.map → admin-dunning-CDy6aMAj.js.map} +1 -1
  73. package/dist/{admin-fact-card-lN-MsuSp.js → admin-fact-card-2DujC_r3.js} +2 -2
  74. package/dist/{admin-fact-card-lN-MsuSp.js.map → admin-fact-card-2DujC_r3.js.map} +1 -1
  75. package/dist/{admin-utils-CX097OR7.js → admin-format-Bc4NWK0F.js} +495 -328
  76. package/dist/admin-format-Bc4NWK0F.js.map +1 -0
  77. package/dist/{admin-health-CnagC763.js → admin-health-DePsyIlc.js} +217 -196
  78. package/dist/admin-health-DePsyIlc.js.map +1 -0
  79. package/dist/{admin-imports-SM_fKKgW.js → admin-imports-BrQH3u9M.js} +85 -86
  80. package/dist/{admin-imports-SM_fKKgW.js.map → admin-imports-BrQH3u9M.js.map} +1 -1
  81. package/dist/{admin-input-B_EUzCAE.js → admin-input-BZ2ExV_5.js} +2 -2
  82. package/dist/{admin-input-B_EUzCAE.js.map → admin-input-BZ2ExV_5.js.map} +1 -1
  83. package/dist/{admin-label-DQsOkp1p.js → admin-label-DecDO0oV.js} +2 -2
  84. package/dist/{admin-label-DQsOkp1p.js.map → admin-label-DecDO0oV.js.map} +1 -1
  85. package/dist/{admin-linked-table-row-BFsgc9tz.js → admin-linked-table-row-ChxhVptQ.js} +3 -3
  86. package/dist/{admin-linked-table-row-BFsgc9tz.js.map → admin-linked-table-row-ChxhVptQ.js.map} +1 -1
  87. package/dist/{admin-map-dialog-Dt3gTuTD.js → admin-map-dialog-CQmGOBMw.js} +12 -12
  88. package/dist/{admin-map-dialog-Dt3gTuTD.js.map → admin-map-dialog-CQmGOBMw.js.map} +1 -1
  89. package/dist/admin-metering-OXGOVQ7e.js +1716 -0
  90. package/dist/{admin-metering-DM4KhjOq.js.map → admin-metering-OXGOVQ7e.js.map} +1 -1
  91. package/dist/{admin-missing-record-G2Jz-VUn.js → admin-missing-record-B_9LpSIW.js} +4 -4
  92. package/dist/{admin-missing-record-G2Jz-VUn.js.map → admin-missing-record-B_9LpSIW.js.map} +1 -1
  93. package/dist/admin-ops-BTSunx1i.js +357 -0
  94. package/dist/{admin-ops-mwzj-jpg.js.map → admin-ops-BTSunx1i.js.map} +1 -1
  95. package/dist/{admin-orders-D_aqV66h.js → admin-orders-LqlpQVFo.js} +59 -60
  96. package/dist/{admin-orders-D_aqV66h.js.map → admin-orders-LqlpQVFo.js.map} +1 -1
  97. package/dist/{admin-parked-2FjIfyMg.js → admin-parked-Ch6mlS5f.js} +61 -62
  98. package/dist/{admin-parked-2FjIfyMg.js.map → admin-parked-Ch6mlS5f.js.map} +1 -1
  99. package/dist/{admin-payments-B4hh31PR.js → admin-payments-yNntF4i4.js} +42 -42
  100. package/dist/{admin-payments-B4hh31PR.js.map → admin-payments-yNntF4i4.js.map} +1 -1
  101. package/dist/{admin-price-detail--5Bovz20.js → admin-price-detail-DvmcYr8B.js} +131 -132
  102. package/dist/admin-price-detail-DvmcYr8B.js.map +1 -0
  103. package/dist/{admin-price-format-C-pus9FL.js → admin-price-format-Btdg11-J.js} +14 -5
  104. package/dist/admin-price-format-Btdg11-J.js.map +1 -0
  105. package/dist/admin-price-wizard-EFO3nBV8.js +376 -0
  106. package/dist/admin-price-wizard-EFO3nBV8.js.map +1 -0
  107. package/dist/{admin-proposals-DPRFoWel.js → admin-proposals-CO0LKHM8.js} +119 -120
  108. package/dist/{admin-proposals-DPRFoWel.js.map → admin-proposals-CO0LKHM8.js.map} +1 -1
  109. package/dist/admin-provider-prices-ZjQeEV1n.js +239 -0
  110. package/dist/{admin-provider-prices-B8Oc86dP.js.map → admin-provider-prices-ZjQeEV1n.js.map} +1 -1
  111. package/dist/admin-query-builder-DedekYUU.js +252 -0
  112. package/dist/admin-query-builder-DedekYUU.js.map +1 -0
  113. package/dist/{admin-range-picker-CSWcCYkg.js → admin-range-picker-1WGFlYYw.js} +46 -24
  114. package/dist/admin-range-picker-1WGFlYYw.js.map +1 -0
  115. package/dist/admin-records-A2R52prt.js +389 -0
  116. package/dist/{admin-records-CWbfqyT8.js.map → admin-records-A2R52prt.js.map} +1 -1
  117. package/dist/admin-reports-ySY9v463.js +420 -0
  118. package/dist/admin-reports-ySY9v463.js.map +1 -0
  119. package/dist/{admin-select-DSGCZFiZ.js → admin-select-CgZq2j0G.js} +2 -2
  120. package/dist/{admin-select-DSGCZFiZ.js.map → admin-select-CgZq2j0G.js.map} +1 -1
  121. package/dist/admin-settings-kOW1nPGB.js +1818 -0
  122. package/dist/admin-settings-kOW1nPGB.js.map +1 -0
  123. package/dist/{admin-shared-DdN2hyaR.js → admin-shared-DoBOSwkv.js} +33 -34
  124. package/dist/{admin-shared-DdN2hyaR.js.map → admin-shared-DoBOSwkv.js.map} +1 -1
  125. package/dist/admin-signals-D_iWk2r5.js +124 -0
  126. package/dist/admin-signals-D_iWk2r5.js.map +1 -0
  127. package/dist/{admin-skeleton-DOfsDIu0.js → admin-skeleton-DdqwXcr4.js} +2 -2
  128. package/dist/{admin-skeleton-DOfsDIu0.js.map → admin-skeleton-DdqwXcr4.js.map} +1 -1
  129. package/dist/{admin-status-badge-BLEGt2Fw.js → admin-status-badge-B8rjk6QR.js} +5 -3
  130. package/dist/admin-status-badge-B8rjk6QR.js.map +1 -0
  131. package/dist/{admin-subscriptions-PL5G3f0O.js → admin-subscriptions-CjYPSPs-.js} +43 -38
  132. package/dist/admin-subscriptions-CjYPSPs-.js.map +1 -0
  133. package/dist/{admin-switch-aOiQQzST.js → admin-switch-CyYmt8wi.js} +2 -2
  134. package/dist/{admin-switch-aOiQQzST.js.map → admin-switch-CyYmt8wi.js.map} +1 -1
  135. package/dist/{admin-table-DIKl2rpV.js → admin-table-ByPfWNq8.js} +2 -2
  136. package/dist/{admin-table-DIKl2rpV.js.map → admin-table-ByPfWNq8.js.map} +1 -1
  137. package/dist/admin-tabs-DKa6QljL.js +45 -0
  138. package/dist/admin-tabs-DKa6QljL.js.map +1 -0
  139. package/dist/{admin-textarea-W52-l_0n.js → admin-textarea-CQg__KGc.js} +2 -2
  140. package/dist/{admin-textarea-W52-l_0n.js.map → admin-textarea-CQg__KGc.js.map} +1 -1
  141. package/dist/{admin-typed-confirm-dialog-B_00EHlT.js → admin-typed-confirm-dialog-BvAYEh3H.js} +6 -6
  142. package/dist/{admin-typed-confirm-dialog-B_00EHlT.js.map → admin-typed-confirm-dialog-BvAYEh3H.js.map} +1 -1
  143. package/dist/admin-widget-tile-DDI3eaRy.js +290 -0
  144. package/dist/admin-widget-tile-DDI3eaRy.js.map +1 -0
  145. package/dist/admin-widget-viz-Db9CQ2Sx.js +1084 -0
  146. package/dist/admin-widget-viz-Db9CQ2Sx.js.map +1 -0
  147. package/dist/admin.css +1 -1
  148. package/dist/admin.js +660 -609
  149. package/dist/admin.js.map +1 -1
  150. package/dist/buy-button.d.ts +4 -2
  151. package/dist/cart.d.ts +4 -2
  152. package/dist/client/client.d.ts +16 -3
  153. package/dist/client/generated/error-codes.d.ts +1 -1
  154. package/dist/client/generated/routes.d.ts +296 -181
  155. package/dist/client/generated/wire.d.ts +514 -277
  156. package/dist/client/index.d.ts +1 -1
  157. package/dist/client/types.d.ts +76 -8
  158. package/dist/{client-DwsFGm4M.js → client-D8qT6xjo.js} +86 -44
  159. package/dist/client-D8qT6xjo.js.map +1 -0
  160. package/dist/client.js +1 -1
  161. package/dist/components/billing-fields.d.ts +5 -3
  162. package/dist/components/platform-card-form.d.ts +3 -1
  163. package/dist/{hooks-C-MhXjQh.js → hooks-CX09fAJA.js} +86 -60
  164. package/dist/hooks-CX09fAJA.js.map +1 -0
  165. package/dist/index.d.ts +1 -1
  166. package/dist/index.js +847 -779
  167. package/dist/index.js.map +1 -1
  168. package/dist/lib/billing-fields.d.ts +15 -0
  169. package/dist/lib/billing.d.ts +23 -5
  170. package/dist/lib/price-label.d.ts +1 -1
  171. package/dist/locales/en.d.ts +4 -0
  172. package/dist/locales/en.js +4 -0
  173. package/dist/locales/en.js.map +1 -1
  174. package/dist/product-list.d.ts +4 -2
  175. package/dist/react/config.d.ts +10 -2
  176. package/dist/react/index.d.ts +1 -1
  177. package/dist/react.js +1 -1
  178. package/dist/styles.css +1 -1
  179. package/dist/tokenized-card-form.d.ts +10 -2
  180. package/docs/payment-form-contract.md +6 -15
  181. package/package.json +6 -6
  182. package/dist/admin/lib/api/copilot.d.ts +0 -6
  183. package/dist/admin/pages/catalog/copilot-panel.d.ts +0 -4
  184. package/dist/admin-attempts-DjgBAbx9.js +0 -418
  185. package/dist/admin-attempts-DjgBAbx9.js.map +0 -1
  186. package/dist/admin-capabilities-DS-X-__V.js.map +0 -1
  187. package/dist/admin-catalog-BdLDhr8R.js +0 -1096
  188. package/dist/admin-catalog-BdLDhr8R.js.map +0 -1
  189. package/dist/admin-customers-BZP6Jv-i.js.map +0 -1
  190. package/dist/admin-dashboard-BJSonknv.js +0 -461
  191. package/dist/admin-dashboard-BJSonknv.js.map +0 -1
  192. package/dist/admin-detail-C03O0R6e.js +0 -1351
  193. package/dist/admin-detail-C03O0R6e.js.map +0 -1
  194. package/dist/admin-detail-C6VH3i2v.js +0 -293
  195. package/dist/admin-detail-NApy5bio.js +0 -337
  196. package/dist/admin-detail-cijme9Lc.js.map +0 -1
  197. package/dist/admin-format-D9Ablh0P.js +0 -169
  198. package/dist/admin-format-D9Ablh0P.js.map +0 -1
  199. package/dist/admin-health-CnagC763.js.map +0 -1
  200. package/dist/admin-metering-DM4KhjOq.js +0 -1717
  201. package/dist/admin-ops-mwzj-jpg.js +0 -358
  202. package/dist/admin-price-detail--5Bovz20.js.map +0 -1
  203. package/dist/admin-price-format-C-pus9FL.js.map +0 -1
  204. package/dist/admin-price-wizard-Cj_Bgh-V.js +0 -354
  205. package/dist/admin-price-wizard-Cj_Bgh-V.js.map +0 -1
  206. package/dist/admin-provider-prices-B8Oc86dP.js +0 -240
  207. package/dist/admin-range-picker-CSWcCYkg.js.map +0 -1
  208. package/dist/admin-records-CWbfqyT8.js +0 -390
  209. package/dist/admin-reports-CAHWO_d6.js +0 -319
  210. package/dist/admin-reports-CAHWO_d6.js.map +0 -1
  211. package/dist/admin-settings-BrvNTJlM.js +0 -1818
  212. package/dist/admin-settings-BrvNTJlM.js.map +0 -1
  213. package/dist/admin-status-badge-BLEGt2Fw.js.map +0 -1
  214. package/dist/admin-subscriptions-PL5G3f0O.js.map +0 -1
  215. package/dist/admin-tabs-DR74xX0-.js +0 -156
  216. package/dist/admin-tabs-DR74xX0-.js.map +0 -1
  217. package/dist/admin-utils-CX097OR7.js.map +0 -1
  218. package/dist/admin-widget-viz-DVV9aTQp.js +0 -643
  219. package/dist/admin-widget-viz-DVV9aTQp.js.map +0 -1
  220. package/dist/client-DwsFGm4M.js.map +0 -1
  221. package/dist/hooks-C-MhXjQh.js.map +0 -1
@@ -110,6 +110,10 @@ var b = {
110
110
  week: {
111
111
  one: "every week",
112
112
  other: "every {count} weeks"
113
+ },
114
+ month: {
115
+ one: "monthly",
116
+ other: "every {count} months"
113
117
  }
114
118
  },
115
119
  per: {
@@ -441,7 +445,8 @@ function E(e) {
441
445
  var D = [
442
446
  "kind",
443
447
  "owner",
444
- "category",
448
+ "outcome",
449
+ "decline_cause",
445
450
  "reason",
446
451
  "response_code",
447
452
  "card_entry",
@@ -501,6 +506,7 @@ function j(e) {
501
506
  signal: r
502
507
  }), s = (e, n) => t("/admin/product-access", {
503
508
  method: "POST",
509
+ headers: { "Idempotency-Key": crypto.randomUUID() },
504
510
  body: { items: [{
505
511
  customer_id: e,
506
512
  product_id: n.productId,
@@ -604,26 +610,19 @@ function j(e) {
604
610
  }), N = (e) => t("/catalog/prices", {
605
611
  method: "POST",
606
612
  body: e
607
- }), P = (e, n = !1, r) => t(`/catalog/prices/${encodeURIComponent(e)}`, {
608
- query: n ? { verify: !0 } : void 0,
609
- signal: r
610
- }), F = async (e) => {
611
- let n = (await t("/catalog/products", { query: { keys: e } })).data[0];
612
- if (!n) throw Error(`No product ${e}`);
613
- return n;
614
- }, I = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}`, {
613
+ }), P = (e, n = !1, r) => t(`/catalog/prices/${encodeURIComponent(e)}${n ? "/verification" : ""}`, { signal: r }), F = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}`, {
615
614
  method: "PATCH",
616
615
  body: n
617
- }), L = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}/history`, {
616
+ }), I = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}/history`, {
618
617
  query: { limit: 500 },
619
618
  signal: n
620
- }), R = (e, n) => t("/catalog/price-migrations/preview", {
619
+ }), L = (e, n) => t("/catalog/price-migrations/preview", {
621
620
  method: "POST",
622
621
  body: {
623
622
  product_key: e,
624
623
  price_key: n
625
624
  }
626
- }), z = (e, n, r, i) => t("/catalog/price-migrations", {
625
+ }), R = (e, n, r, i) => t("/catalog/price-migrations", {
627
626
  method: "POST",
628
627
  body: {
629
628
  product_key: e,
@@ -631,56 +630,56 @@ function j(e) {
631
630
  to_price_id: r,
632
631
  effective_at: i
633
632
  }
634
- }), B = (e, n, r = 20, i) => t("/catalog/price-migrations", {
633
+ }), z = (e, n, r = 20, i) => t("/catalog/price-migrations", {
635
634
  query: {
636
635
  product_key: e,
637
636
  price_key: n,
638
637
  limit: r
639
638
  },
640
639
  signal: i
641
- }), V = (e) => t(`/catalog/price-migrations/${e}/cancel`, { method: "POST" }), H = (e, n = !1) => t("/catalog/apply", {
640
+ }), B = (e) => t(`/catalog/price-migrations/${e}/cancel`, { method: "POST" }), V = (e, n = !1) => t("/catalog/apply", {
642
641
  method: "POST",
643
642
  rawBody: e,
644
643
  headers: { "Content-Type": "application/yaml" },
645
644
  ...n ? { query: { force: "true" } } : {}
646
- }), U = (e, n, r) => t("/merchant/findings", {
645
+ }), H = (e, n, r) => t("/merchant/findings", {
647
646
  query: {
648
647
  ...e,
649
648
  limit: n
650
649
  },
651
650
  signal: r
652
- }), W = (e) => t(`/merchant/findings/${e}`), G = (e, n, r) => t(`/merchant/findings/${e}/resolve`, {
651
+ }), ee = (e) => t(`/merchant/findings/${e}`), te = (e, n, r) => t(`/merchant/findings/${e}/resolve`, {
653
652
  method: "POST",
654
653
  body: {
655
654
  outcome: n,
656
655
  notes: r
657
656
  }
658
- }), K = (e, n) => t("/merchant/destructive-holds", {
657
+ }), ne = (e, n) => t("/merchant/destructive-holds", {
659
658
  query: {
660
659
  limit: 100,
661
660
  cursor: e
662
661
  },
663
662
  signal: n
664
- }), q = (e, n) => t(`/merchant/destructive-holds/${encodeURIComponent(e)}/clear`, {
663
+ }), re = (e, n) => t(`/merchant/destructive-holds/${encodeURIComponent(e)}/clear`, {
665
664
  method: "POST",
666
665
  body: { reason: n }
667
- }), ee = (e) => t("/merchant/configuration", { signal: e }), J = (e) => t("/merchant/configuration", {
666
+ }), U = (e) => t("/merchant/configuration", { signal: e }), ie = (e) => t("/merchant/configuration", {
668
667
  method: "PATCH",
669
668
  body: e
670
- }), te = (e) => t("/merchant/psps?limit=500", { signal: e }), ne = (e) => t("/merchant/custodians", { signal: e }), re = (e, n) => t(`/admin/customers/${encodeURIComponent(e)}/payment-methods/${encodeURIComponent(n)}`, { method: "DELETE" }), Y = (e, n) => t(`/merchant/custodians/${encodeURIComponent(e)}`, {
669
+ }), W = (e) => t("/merchant/psps?limit=500", { signal: e }), ae = (e) => t("/merchant/custodians", { signal: e }), oe = (e, n) => t(`/admin/customers/${encodeURIComponent(e)}/payment-methods/${encodeURIComponent(n)}`, { method: "DELETE" }), se = (e, n) => t(`/merchant/custodians/${encodeURIComponent(e)}`, {
671
670
  method: "PUT",
672
671
  body: n
673
- }), X = async (e) => (await ae(e)).rails, Z = (e) => t("/merchant/psps", {
672
+ }), G = async (e) => (await ce(e)).rails, K = (e) => t("/merchant/psps", {
674
673
  method: "POST",
675
674
  body: e
676
- }), Q = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
675
+ }), q = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
677
676
  method: "PATCH",
678
677
  body: n
679
- }), ie = (e, n) => t("/merchant/psps/routing-preview", {
678
+ }), J = (e, n) => t("/merchant/psps/routing-preview", {
680
679
  method: "POST",
681
680
  body: e,
682
681
  signal: n
683
- }), ae = (e) => t("/config", { signal: e });
682
+ }), ce = (e) => t("/config", { signal: e });
684
683
  return {
685
684
  listCustomers: n,
686
685
  getCustomer: r,
@@ -715,30 +714,29 @@ function j(e) {
715
714
  listPrices: M,
716
715
  createPrice: N,
717
716
  getPrice: P,
718
- getProductByKey: F,
719
- updatePrice: I,
720
- getPriceHistory: L,
721
- previewPriceMigration: R,
722
- createPriceMigration: z,
723
- listPriceMigrations: B,
724
- cancelPriceMigration: V,
725
- applyCatalog: H,
726
- listFindings: U,
727
- getFinding: W,
728
- resolveFinding: G,
729
- listDestructiveHolds: K,
730
- clearDestructiveHold: q,
731
- getMerchantConfiguration: ee,
732
- updateMerchantConfiguration: J,
733
- listPSPs: te,
734
- listRails: X,
735
- createPSP: Z,
736
- listCustodians: ne,
737
- putCustodian: Y,
738
- deleteCustomerPaymentMethod: re,
739
- updatePSP: Q,
740
- previewPSPRouting: ie,
741
- getConfig: ae,
717
+ updatePrice: F,
718
+ getPriceHistory: I,
719
+ previewPriceMigration: L,
720
+ createPriceMigration: R,
721
+ listPriceMigrations: z,
722
+ cancelPriceMigration: B,
723
+ applyCatalog: V,
724
+ listFindings: H,
725
+ getFinding: ee,
726
+ resolveFinding: te,
727
+ listDestructiveHolds: ne,
728
+ clearDestructiveHold: re,
729
+ getMerchantConfiguration: U,
730
+ updateMerchantConfiguration: ie,
731
+ listPSPs: W,
732
+ listRails: G,
733
+ createPSP: K,
734
+ listCustodians: ae,
735
+ putCustodian: se,
736
+ deleteCustomerPaymentMethod: oe,
737
+ updatePSP: q,
738
+ previewPSPRouting: J,
739
+ getConfig: ce,
742
740
  getAdminAccess: (e) => t("/admin/access", { signal: e }),
743
741
  updateCustomer: (e, n) => t(`/admin/customers/${e}`, {
744
742
  method: "PATCH",
@@ -757,15 +755,18 @@ function j(e) {
757
755
  };
758
756
  }
759
757
  // src/admin/lib/api/metrics.ts
760
- var M = [
758
+ var M = (e) => e === "heading" || e === "programs", N = [
759
+ "kpi",
761
760
  "stat",
762
761
  "line",
763
762
  "area",
764
763
  "bar",
765
764
  "donut",
766
- "table"
765
+ "table",
766
+ "cohort",
767
+ "funnel"
767
768
  ];
768
- function N(e) {
769
+ function P(e) {
769
770
  let { api: t } = e;
770
771
  return {
771
772
  metricsQuery: (e, n) => t("/metrics/query", {
@@ -774,20 +775,14 @@ function N(e) {
774
775
  signal: n
775
776
  }),
776
777
  getDashboard: (e) => t("/metrics/dashboard", { signal: e }),
778
+ getMetricsSchema: (e) => t("/metrics/schema", { signal: e }),
777
779
  putDashboard: (e) => t("/merchant/dashboard", {
778
780
  method: "PUT",
779
781
  body: { widgets: e }
780
- })
782
+ }),
783
+ listDisputePrograms: (e, n) => t(`/metrics/dispute-programs${e ? `?at=${encodeURIComponent(e)}` : ""}`, { signal: n })
781
784
  };
782
785
  }
783
- // src/admin/lib/api/copilot.ts
784
- function P(e) {
785
- let { api: t } = e;
786
- return { askCatalog: (e) => t("/console/catalog/ask", {
787
- method: "POST",
788
- body: { question: e }
789
- }) };
790
- }
791
786
  // src/admin/lib/api/credit-endpoints.ts
792
787
  var F = (e) => `/admin/customers/${encodeURIComponent(e)}`;
793
788
  function I(e) {
@@ -957,7 +952,6 @@ function B(e) {
957
952
  let t = j(e);
958
953
  return {
959
954
  ...t,
960
- ...N(e),
961
955
  ...P(e),
962
956
  ...I(e),
963
957
  ...L(e),
@@ -976,7 +970,7 @@ var V = {
976
970
  let n = t.charAt(0).toUpperCase() + t.slice(1);
977
971
  return /[.!?]$/.test(n) ? n : `${n}.`;
978
972
  };
979
- function U(e) {
973
+ function ee(e) {
980
974
  if (!(e instanceof x)) return { text: H(e instanceof Error && e.message ? e.message : b.errors.generic) };
981
975
  let t = e.code;
982
976
  return {
@@ -985,7 +979,7 @@ function U(e) {
985
979
  };
986
980
  }
987
981
  // src/admin/lib/toast.ts
988
- function W(e) {
982
+ function te(e) {
989
983
  let t = (t) => (n, r) => t(n, {
990
984
  ...r,
991
985
  toasterId: e
@@ -997,7 +991,7 @@ function W(e) {
997
991
  warning: t(u.warning)
998
992
  });
999
993
  }
1000
- function G(e) {
994
+ function ne(e) {
1001
995
  function t(t, n) {
1002
996
  if (t instanceof x) {
1003
997
  if (t.code === "revision_mismatch") {
@@ -1009,7 +1003,7 @@ function G(e) {
1009
1003
  return;
1010
1004
  }
1011
1005
  }
1012
- let { text: r, code: i } = U(t);
1006
+ let { text: r, code: i } = ee(t);
1013
1007
  e.error(`Couldn't ${n.charAt(0).toLowerCase()}${n.slice(1)}`, { description: i ? `${r} Code: ${i}.` : r });
1014
1008
  }
1015
1009
  function n(t) {
@@ -1021,17 +1015,17 @@ function G(e) {
1021
1015
  };
1022
1016
  }
1023
1017
  // src/admin/lib/queries.ts
1024
- function K(e) {
1018
+ function re(e) {
1025
1019
  let t = e.rows[0] ?? [];
1026
1020
  return Object.fromEntries(e.columns.map((e, n) => [e.name, t[n] ?? null]));
1027
1021
  }
1028
- async function q(e, t) {
1022
+ async function U(e, t) {
1029
1023
  return {
1030
1024
  data: await T((n) => e(n, t), t),
1031
1025
  next_cursor: null
1032
1026
  };
1033
1027
  }
1034
- var ee = (e) => ({
1028
+ var ie = (e) => ({
1035
1029
  merchant: () => e(),
1036
1030
  customers: () => [...e(), "customers"],
1037
1031
  customer: (t) => [
@@ -1070,18 +1064,18 @@ var ee = (e) => ({
1070
1064
  ops: () => [...e(), "ops"],
1071
1065
  dashboard: () => [...e(), "dashboard"],
1072
1066
  notifications: () => [...e(), "notifications"]
1073
- }), J = (e) => e ? { errorAction: e } : void 0;
1074
- function te(e, t) {
1075
- let { queryRoot: n } = e, { getCustomer: r, getMerchantConfiguration: i, getPayment: a, getPaymentAttempt: o, getPrice: c, getPriceHistory: u, getProduct: d, getRenewal: f, getSubscription: p, getUsageMeter: m, listCustomerEntitlements: h, listCustomerPaymentMethods: g, listCustomerProductAccess: _, listCustomers: v, listFindings: y, listDestructiveHolds: b, listPaymentAttempts: x, listPSPs: S, listRails: C, previewPSPRouting: w, listPayments: E, listPrices: D, listProducts: O, listRenewals: k, listPriceMigrations: A, listSubscriptionChangeOptions: j, listSubscriptions: M, listUsageMeters: N, getAdminAccess: P, getConfig: F, listWebhooks: I, getDashboard: L, metricsQuery: R } = t, z = n, B = ee(z);
1067
+ }), W = (e) => e ? { errorAction: e } : void 0;
1068
+ function ae(e, t) {
1069
+ let { queryRoot: n } = e, { getCustomer: r, getMerchantConfiguration: i, getPayment: a, getPaymentAttempt: o, getPrice: c, getPriceHistory: u, getProduct: d, getRenewal: f, getSubscription: p, getUsageMeter: m, listCustomerEntitlements: h, listCustomerPaymentMethods: g, listCustomerProductAccess: _, listCustomers: v, listFindings: y, listDestructiveHolds: b, listPaymentAttempts: x, listPSPs: S, listRails: C, previewPSPRouting: w, listPayments: E, listPrices: D, listProducts: O, listRenewals: k, listPriceMigrations: A, listSubscriptionChangeOptions: j, listSubscriptions: M, listUsageMeters: N, getAdminAccess: P, getConfig: F, listWebhooks: I, getDashboard: L, getMetricsSchema: R, metricsQuery: z, listDisputePrograms: B } = t, V = n, H = ie(V);
1076
1070
  return {
1077
- queryKeys: B,
1071
+ queryKeys: H,
1078
1072
  merchantQueryKeys: () => {
1079
- let e = z();
1080
- return ee(() => e);
1073
+ let e = V();
1074
+ return ie(() => e);
1081
1075
  },
1082
1076
  adminQueries: {
1083
1077
  customers: (e, t, n) => l({
1084
- queryKey: [...B.customers(), {
1078
+ queryKey: [...H.customers(), {
1085
1079
  search: e,
1086
1080
  limit: t,
1087
1081
  cursor: n
@@ -1091,13 +1085,13 @@ function te(e, t) {
1091
1085
  meta: { errorAction: "Load customers" }
1092
1086
  }),
1093
1087
  customer: (e) => l({
1094
- queryKey: B.customer(e),
1088
+ queryKey: H.customer(e),
1095
1089
  queryFn: ({ signal: t }) => r(e, t),
1096
1090
  enabled: !!e
1097
1091
  }),
1098
1092
  customerSubscriptions: (e, t, n) => l({
1099
1093
  queryKey: [
1100
- ...B.customer(e),
1094
+ ...H.customer(e),
1101
1095
  "subscriptions",
1102
1096
  {
1103
1097
  limit: t,
@@ -1111,7 +1105,7 @@ function te(e, t) {
1111
1105
  }),
1112
1106
  customerPayments: (e, t, n) => l({
1113
1107
  queryKey: [
1114
- ...B.customer(e),
1108
+ ...H.customer(e),
1115
1109
  "payments",
1116
1110
  {
1117
1111
  limit: t,
@@ -1128,7 +1122,7 @@ function te(e, t) {
1128
1122
  }),
1129
1123
  customerPaymentMethodsPage: (e, t, n) => l({
1130
1124
  queryKey: [
1131
- ...B.customer(e),
1125
+ ...H.customer(e),
1132
1126
  "payment-methods",
1133
1127
  {
1134
1128
  limit: t,
@@ -1145,7 +1139,7 @@ function te(e, t) {
1145
1139
  }),
1146
1140
  customerEntitlements: (e, t, n) => l({
1147
1141
  queryKey: [
1148
- ...B.customer(e),
1142
+ ...H.customer(e),
1149
1143
  "entitlements",
1150
1144
  {
1151
1145
  limit: t,
@@ -1162,7 +1156,7 @@ function te(e, t) {
1162
1156
  }),
1163
1157
  customerProductAccess: (e, t, n) => l({
1164
1158
  queryKey: [
1165
- ...B.customer(e),
1159
+ ...H.customer(e),
1166
1160
  "product-access",
1167
1161
  {
1168
1162
  limit: t,
@@ -1178,7 +1172,7 @@ function te(e, t) {
1178
1172
  meta: { errorAction: "Load product access" }
1179
1173
  }),
1180
1174
  subscriptions: (e, t, n) => l({
1181
- queryKey: [...B.subscriptions(), {
1175
+ queryKey: [...H.subscriptions(), {
1182
1176
  filters: e,
1183
1177
  limit: t,
1184
1178
  cursor: n
@@ -1188,17 +1182,17 @@ function te(e, t) {
1188
1182
  meta: { errorAction: "Load subscriptions" }
1189
1183
  }),
1190
1184
  subscription: (e) => l({
1191
- queryKey: B.subscription(e),
1185
+ queryKey: H.subscription(e),
1192
1186
  queryFn: ({ signal: t }) => p(e, t),
1193
1187
  enabled: !!e
1194
1188
  }),
1195
1189
  subscriptionChangeOptions: (e) => l({
1196
- queryKey: [...B.subscription(e), "change-options"],
1190
+ queryKey: [...H.subscription(e), "change-options"],
1197
1191
  queryFn: ({ signal: t }) => j(e, t),
1198
1192
  staleTime: 6e4
1199
1193
  }),
1200
1194
  customerPaymentMethods: (e) => l({
1201
- queryKey: [...B.customer(e ?? "unselected"), "payment-methods"],
1195
+ queryKey: [...H.customer(e ?? "unselected"), "payment-methods"],
1202
1196
  queryFn: ({ signal: t }) => T((n) => g(e, {
1203
1197
  limit: 100,
1204
1198
  cursor: n
@@ -1206,7 +1200,7 @@ function te(e, t) {
1206
1200
  enabled: !!e
1207
1201
  }),
1208
1202
  payments: (e, t, n) => l({
1209
- queryKey: [...B.payments(), {
1203
+ queryKey: [...H.payments(), {
1210
1204
  filters: e,
1211
1205
  limit: t,
1212
1206
  cursor: n
@@ -1219,12 +1213,12 @@ function te(e, t) {
1219
1213
  meta: { errorAction: "Load payments" }
1220
1214
  }),
1221
1215
  payment: (e) => l({
1222
- queryKey: B.payment(e),
1216
+ queryKey: H.payment(e),
1223
1217
  queryFn: ({ signal: t }) => a(e, t),
1224
1218
  enabled: !!e
1225
1219
  }),
1226
1220
  attempts: (e, t, n) => l({
1227
- queryKey: [...B.attempts(), {
1221
+ queryKey: [...H.attempts(), {
1228
1222
  filters: e,
1229
1223
  limit: t,
1230
1224
  cursor: n
@@ -1237,13 +1231,13 @@ function te(e, t) {
1237
1231
  meta: { errorAction: "Load payment attempts" }
1238
1232
  }),
1239
1233
  attempt: (e) => l({
1240
- queryKey: [...B.attempts(), e],
1234
+ queryKey: [...H.attempts(), e],
1241
1235
  queryFn: ({ signal: t }) => o(e, t),
1242
1236
  enabled: !!e,
1243
1237
  meta: { errorAction: "Load payment attempt" }
1244
1238
  }),
1245
1239
  cycles: (e, t, n) => l({
1246
- queryKey: [...B.cycles(), {
1240
+ queryKey: [...H.cycles(), {
1247
1241
  filters: e,
1248
1242
  limit: t,
1249
1243
  cursor: n
@@ -1256,7 +1250,7 @@ function te(e, t) {
1256
1250
  meta: { errorAction: "Load renewals" }
1257
1251
  }),
1258
1252
  cycle: (e) => l({
1259
- queryKey: [...B.cycles(), e],
1253
+ queryKey: [...H.cycles(), e],
1260
1254
  queryFn: ({ signal: t }) => f(e, t),
1261
1255
  enabled: !!e,
1262
1256
  meta: { errorAction: "Load renewal" }
@@ -1265,7 +1259,7 @@ function te(e, t) {
1265
1259
  let { limit: t = 100, cursor: n, errorAction: r } = e;
1266
1260
  return l({
1267
1261
  queryKey: [
1268
- ...B.catalog(),
1262
+ ...H.catalog(),
1269
1263
  "products",
1270
1264
  {
1271
1265
  limit: t,
@@ -1274,23 +1268,23 @@ function te(e, t) {
1274
1268
  ],
1275
1269
  queryFn: ({ signal: e }) => O(t, n, void 0, e),
1276
1270
  placeholderData: s,
1277
- meta: J(r)
1271
+ meta: W(r)
1278
1272
  });
1279
1273
  },
1280
1274
  allProducts: (e = {}) => l({
1281
1275
  queryKey: [
1282
- ...B.catalog(),
1276
+ ...H.catalog(),
1283
1277
  "products",
1284
1278
  "all"
1285
1279
  ],
1286
- queryFn: ({ signal: e }) => q((e, t) => O(500, e, void 0, t), e),
1287
- meta: J(e.errorAction)
1280
+ queryFn: ({ signal: e }) => U((e, t) => O(500, e, void 0, t), e),
1281
+ meta: W(e.errorAction)
1288
1282
  }),
1289
1283
  prices: (e = {}) => {
1290
1284
  let { productId: t, limit: n = 100, cursor: r, errorAction: i } = e;
1291
1285
  return l({
1292
1286
  queryKey: [
1293
- ...B.catalog(),
1287
+ ...H.catalog(),
1294
1288
  "prices",
1295
1289
  {
1296
1290
  productId: t,
@@ -1300,24 +1294,24 @@ function te(e, t) {
1300
1294
  ],
1301
1295
  queryFn: ({ signal: e }) => D(n, r, t, e),
1302
1296
  placeholderData: s,
1303
- meta: J(i)
1297
+ meta: W(i)
1304
1298
  });
1305
1299
  },
1306
1300
  allPrices: (e = {}) => l({
1307
1301
  queryKey: [
1308
- ...B.catalog(),
1302
+ ...H.catalog(),
1309
1303
  "prices",
1310
1304
  "all",
1311
1305
  { productId: e.productId }
1312
1306
  ],
1313
- queryFn: ({ signal: t }) => q((t, n) => D(500, t, e.productId, n), t),
1314
- meta: J(e.errorAction)
1307
+ queryFn: ({ signal: t }) => U((t, n) => D(500, t, e.productId, n), t),
1308
+ meta: W(e.errorAction)
1315
1309
  }),
1316
1310
  price: (e, t = {}) => {
1317
1311
  let { verify: n = !1, errorAction: r } = t;
1318
1312
  return l({
1319
1313
  queryKey: [
1320
- ...B.catalog(),
1314
+ ...H.catalog(),
1321
1315
  "prices",
1322
1316
  e,
1323
1317
  { verify: n }
@@ -1325,12 +1319,12 @@ function te(e, t) {
1325
1319
  queryFn: ({ signal: t }) => c(e, n, t),
1326
1320
  enabled: !!e,
1327
1321
  placeholderData: s,
1328
- meta: J(r)
1322
+ meta: W(r)
1329
1323
  });
1330
1324
  },
1331
1325
  product: (e) => l({
1332
1326
  queryKey: [
1333
- ...B.catalog(),
1327
+ ...H.catalog(),
1334
1328
  "products",
1335
1329
  e ?? "unselected"
1336
1330
  ],
@@ -1339,7 +1333,7 @@ function te(e, t) {
1339
1333
  }),
1340
1334
  priceHistory: (e) => l({
1341
1335
  queryKey: [
1342
- ...B.catalog(),
1336
+ ...H.catalog(),
1343
1337
  "prices",
1344
1338
  "history",
1345
1339
  e ?? "unselected"
@@ -1349,7 +1343,7 @@ function te(e, t) {
1349
1343
  }),
1350
1344
  priceMigrations: (e, t, n = 5) => l({
1351
1345
  queryKey: [
1352
- ...B.catalog(),
1346
+ ...H.catalog(),
1353
1347
  "price-migrations",
1354
1348
  {
1355
1349
  productKey: e,
@@ -1362,7 +1356,7 @@ function te(e, t) {
1362
1356
  }),
1363
1357
  pspRouting: (e) => l({
1364
1358
  queryKey: [
1365
- ...B.catalog(),
1359
+ ...H.catalog(),
1366
1360
  "prices",
1367
1361
  e,
1368
1362
  "routing"
@@ -1372,7 +1366,7 @@ function te(e, t) {
1372
1366
  meta: { errorAction: "Check purchase readiness" }
1373
1367
  }),
1374
1368
  usageMeters: (e = 200, t) => l({
1375
- queryKey: [...B.usageMeters(), {
1369
+ queryKey: [...H.usageMeters(), {
1376
1370
  limit: e,
1377
1371
  cursor: t
1378
1372
  }],
@@ -1381,19 +1375,19 @@ function te(e, t) {
1381
1375
  meta: { errorAction: "Load usage meters" }
1382
1376
  }),
1383
1377
  allUsageMeters: () => l({
1384
- queryKey: [...B.usageMeters(), "all"],
1385
- queryFn: ({ signal: e }) => q((e, t) => N(500, e, t), e),
1378
+ queryKey: [...H.usageMeters(), "all"],
1379
+ queryFn: ({ signal: e }) => U((e, t) => N(500, e, t), e),
1386
1380
  meta: { errorAction: "Load usage meters" }
1387
1381
  }),
1388
1382
  usageMeter: (e) => l({
1389
- queryKey: B.usageMeter(e),
1383
+ queryKey: H.usageMeter(e),
1390
1384
  queryFn: ({ signal: t }) => m(e, t),
1391
1385
  enabled: !!e,
1392
1386
  meta: { errorAction: "Load usage meter" }
1393
1387
  }),
1394
1388
  findings: (e = !0) => l({
1395
1389
  queryKey: [
1396
- ...B.ops(),
1390
+ ...H.ops(),
1397
1391
  "findings",
1398
1392
  { limit: 100 }
1399
1393
  ],
@@ -1402,48 +1396,45 @@ function te(e, t) {
1402
1396
  meta: { errorAction: "Load findings" }
1403
1397
  }),
1404
1398
  destructiveHolds: (e = !0) => l({
1405
- queryKey: [...B.ops(), "destructive-holds"],
1406
- queryFn: ({ signal: e }) => q((e, t) => b(e, t), e),
1399
+ queryKey: [...H.ops(), "destructive-holds"],
1400
+ queryFn: ({ signal: e }) => U((e, t) => b(e, t), e),
1407
1401
  enabled: e,
1408
1402
  meta: { errorAction: "Load holds" }
1409
1403
  }),
1410
1404
  findingSummary: () => l({
1411
1405
  queryKey: [
1412
- ...B.ops(),
1406
+ ...H.ops(),
1413
1407
  "findings",
1414
1408
  "summary"
1415
1409
  ],
1416
1410
  queryFn: async ({ signal: e }) => {
1417
- let t = K(await R({
1418
- measures: [
1419
- "open_findings",
1420
- "orphaned_members",
1421
- "freeloaders",
1422
- "duplicate_coverage"
1423
- ],
1411
+ let t = await z({
1412
+ measures: ["open_findings"],
1413
+ by: ["finding_group"],
1424
1414
  range: { last: "1d" }
1425
- }, e));
1415
+ }, e), n = {};
1416
+ for (let e of t.rows) n[String(e[0])] = Number(e[1] ?? 0);
1426
1417
  return {
1427
- total_open: Number(t.open_findings ?? 0),
1428
- orphaned_members: Number(t.orphaned_members ?? 0),
1429
- freeloaders: Number(t.freeloaders ?? 0),
1430
- duplicate_coverage: Number(t.duplicate_coverage ?? 0)
1418
+ total_open: Object.values(n).reduce((e, t) => e + t, 0),
1419
+ orphaned_members: n.orphaned ?? 0,
1420
+ freeloaders: n.freeloader ?? 0,
1421
+ duplicate_coverage: n.duplicate_coverage ?? 0
1431
1422
  };
1432
1423
  },
1433
1424
  meta: { errorAction: "Load the findings summary" }
1434
1425
  }),
1435
1426
  merchantConfiguration: (e) => l({
1436
- queryKey: B.settings(),
1427
+ queryKey: H.settings(),
1437
1428
  queryFn: ({ signal: e }) => i(e),
1438
- meta: J(e)
1429
+ meta: W(e)
1439
1430
  }),
1440
1431
  psps: () => l({
1441
- queryKey: [...B.settings(), "psps"],
1432
+ queryKey: [...H.settings(), "psps"],
1442
1433
  queryFn: ({ signal: e }) => S(e),
1443
1434
  meta: { errorAction: "Load PSPs" }
1444
1435
  }),
1445
1436
  rails: () => l({
1446
- queryKey: [...B.settings(), "rails"],
1437
+ queryKey: [...H.settings(), "rails"],
1447
1438
  queryFn: ({ signal: e }) => C(e),
1448
1439
  staleTime: Infinity,
1449
1440
  meta: { errorAction: "Load rails" }
@@ -1455,38 +1446,54 @@ function te(e, t) {
1455
1446
  meta: { errorAction: "Load configuration" }
1456
1447
  }),
1457
1448
  access: () => l({
1458
- queryKey: [...B.merchant(), "access"],
1449
+ queryKey: [...H.merchant(), "access"],
1459
1450
  queryFn: ({ signal: e }) => P(e),
1460
1451
  staleTime: 3e5,
1461
1452
  meta: { errorAction: "Load your access" }
1462
1453
  }),
1463
1454
  webhooks: () => l({
1464
- queryKey: [...B.alerts(), "webhooks"],
1455
+ queryKey: [...H.alerts(), "webhooks"],
1465
1456
  queryFn: ({ signal: e }) => I(e),
1466
1457
  meta: { errorAction: "Load webhooks" }
1467
1458
  }),
1468
1459
  dashboard: () => l({
1469
- queryKey: B.dashboard(),
1460
+ queryKey: H.dashboard(),
1470
1461
  queryFn: ({ signal: e }) => L(e),
1471
1462
  meta: { errorAction: "Load dashboard" }
1472
1463
  }),
1464
+ metricsSchema: (e = !0) => l({
1465
+ queryKey: [...H.dashboard(), "schema"],
1466
+ queryFn: ({ signal: e }) => R(e),
1467
+ staleTime: Infinity,
1468
+ enabled: e,
1469
+ meta: { errorAction: "Load the metrics schema" }
1470
+ }),
1473
1471
  widgetMetrics: (e) => l({
1474
1472
  queryKey: [
1475
- ...B.dashboard(),
1473
+ ...H.dashboard(),
1476
1474
  "metrics",
1477
1475
  e ?? "unselected"
1478
1476
  ],
1479
- queryFn: ({ signal: t }) => R(e, t),
1477
+ queryFn: ({ signal: t }) => z(e, t),
1480
1478
  enabled: !!e
1481
1479
  }),
1480
+ disputePrograms: (e) => l({
1481
+ queryKey: [
1482
+ ...H.dashboard(),
1483
+ "dispute-programs",
1484
+ e ?? "now"
1485
+ ],
1486
+ queryFn: ({ signal: t }) => B(e, t),
1487
+ meta: { errorAction: "Load dispute programs" }
1488
+ }),
1482
1489
  notifications: (e) => l({
1483
- queryKey: B.notifications(),
1490
+ queryKey: H.notifications(),
1484
1491
  queryFn: ({ signal: e }) => y({ status: "requires_review" }, 10, e),
1485
1492
  enabled: e
1486
1493
  }),
1487
1494
  unreadNotifications: () => l({
1488
- queryKey: [...B.notifications(), "count"],
1489
- queryFn: async ({ signal: e }) => Number(K(await R({
1495
+ queryKey: [...H.notifications(), "count"],
1496
+ queryFn: async ({ signal: e }) => Number(re(await z({
1490
1497
  measures: ["open_findings"],
1491
1498
  range: { last: "1d" },
1492
1499
  filters: { finding_status: ["requires_review"] }
@@ -1498,96 +1505,96 @@ function te(e, t) {
1498
1505
  };
1499
1506
  }
1500
1507
  // src/admin/lib/mutations.ts
1501
- var ne = 200, re = async (e) => {
1508
+ var oe = 200, se = async (e) => {
1502
1509
  let t = [], n;
1503
1510
  for (;;) {
1504
- let r = await e(ne, n);
1511
+ let r = await e(oe, n);
1505
1512
  if (t.push(...r.data), !r.next_cursor || r.data.length === 0) return t;
1506
1513
  n = r.next_cursor;
1507
1514
  }
1508
- }, Y = (e, t) => e.invalidateQueries({
1515
+ }, G = (e, t) => e.invalidateQueries({
1509
1516
  queryKey: t,
1510
1517
  exact: !0
1511
- }), X = (e, t) => () => Y(e, t), Z = (e, t) => () => e.invalidateQueries({ queryKey: t }), Q = (e, ...t) => (n) => {
1518
+ }), K = (e, t) => () => G(e, t), q = (e, t) => () => e.invalidateQueries({ queryKey: t }), J = (e, ...t) => (n) => {
1512
1519
  n instanceof x && n.code === "revision_mismatch" && Promise.all(t.map((t) => e.invalidateQueries({ queryKey: t })));
1513
1520
  };
1514
- function ie(e, t, n) {
1515
- let { selectedMerchant: r } = e, { askCatalog: i, cancelPriceMigration: a, cancelSubscription: o, changeSubscriptionPaymentMethod: s, changeSubscription: l, createPrice: u, createProduct: d, createWebhook: f, createPSP: p, deleteWebhook: m, getCustomer: h, getProductByKey: g, grantProductAccess: _, listCustomers: v, listPayments: y, listSubscriptions: b, putUsageMeterRateCard: S, updatePSP: C, putUsageMeter: w, previewPriceMigration: E, previewSubscriptionChange: D, applyCatalog: O, refundPayment: k, createPriceMigration: A, resolveFinding: j, clearDestructiveHold: M, resumeSubscription: N, revokeProductAccess: P, updateCustomer: F, updateMerchantConfiguration: I, updatePrice: L, updateProduct: R, updateWebhook: z, putDashboard: B } = t, { adminQueries: V, merchantQueryKeys: H } = n, U = (e) => (t) => {
1516
- t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: V.config().queryKey });
1517
- }, W = (e, t) => () => Promise.all([Y(e, [...t.alerts(), "webhooks"]), Y(e, t.settings())]);
1521
+ function ce(e, t, n) {
1522
+ let { selectedMerchant: r } = e, { cancelPriceMigration: i, cancelSubscription: a, changeSubscriptionPaymentMethod: o, changeSubscription: s, createPrice: l, createProduct: u, createWebhook: d, createPSP: f, deleteWebhook: p, getCustomer: m, grantProductAccess: h, listCustomers: g, listPayments: _, listSubscriptions: v, putUsageMeterRateCard: y, updatePSP: b, putUsageMeter: S, previewPriceMigration: C, previewSubscriptionChange: w, applyCatalog: E, refundPayment: D, createPriceMigration: O, resolveFinding: k, clearDestructiveHold: A, resumeSubscription: j, revokeProductAccess: M, updateCustomer: N, updateMerchantConfiguration: P, updatePrice: F, updateProduct: I, updateWebhook: L, putDashboard: R } = t, { adminQueries: z, merchantQueryKeys: B } = n, V = (e) => (t) => {
1523
+ t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: z.config().queryKey });
1524
+ }, H = (e, t) => () => Promise.all([G(e, [...t.alerts(), "webhooks"]), G(e, t.settings())]);
1518
1525
  return { adminMutations: {
1519
1526
  saveDashboard: (e) => {
1520
- let t = H().dashboard();
1527
+ let t = B().dashboard();
1521
1528
  return c({
1522
1529
  mutationKey: [...t, "save"],
1523
- mutationFn: (e) => B(e),
1530
+ mutationFn: (e) => R(e),
1524
1531
  onSuccess: (n) => e.setQueryData(t, n)
1525
1532
  });
1526
1533
  },
1527
1534
  findCustomers: () => {
1528
- let e = H().customers();
1535
+ let e = B().customers();
1529
1536
  return c({
1530
1537
  mutationKey: [...e, "find"],
1531
- mutationFn: async (e) => (await v(e, 9, "")).data
1538
+ mutationFn: async (e) => (await g(e, 9, "")).data
1532
1539
  });
1533
1540
  },
1534
1541
  exportCustomers: () => {
1535
- let e = H().customers();
1542
+ let e = B().customers();
1536
1543
  return c({
1537
1544
  mutationKey: [...e, "export"],
1538
- mutationFn: (e) => re((t, n) => v(e, t, n ?? ""))
1545
+ mutationFn: (e) => se((t, n) => g(e, t, n ?? ""))
1539
1546
  });
1540
1547
  },
1541
1548
  exportSubscriptions: () => {
1542
- let e = H().subscriptions();
1549
+ let e = B().subscriptions();
1543
1550
  return c({
1544
1551
  mutationKey: [...e, "export"],
1545
- mutationFn: (e) => re((t, n) => b(e, t, n))
1552
+ mutationFn: (e) => se((t, n) => v(e, t, n))
1546
1553
  });
1547
1554
  },
1548
1555
  exportPayments: () => {
1549
- let e = H().payments();
1556
+ let e = B().payments();
1550
1557
  return c({
1551
1558
  mutationKey: [...e, "export"],
1552
- mutationFn: (e) => T((t) => y(e, {
1553
- limit: ne,
1559
+ mutationFn: (e) => T((t) => _(e, {
1560
+ limit: oe,
1554
1561
  cursor: t
1555
1562
  }))
1556
1563
  });
1557
1564
  },
1558
1565
  resolveFinding: (e) => {
1559
- let t = H().ops();
1566
+ let t = B().ops();
1560
1567
  return c({
1561
1568
  mutationKey: [
1562
1569
  ...t,
1563
1570
  "findings",
1564
1571
  "resolve"
1565
1572
  ],
1566
- mutationFn: ({ id: e, outcome: t, notes: n }) => j(e, t, n),
1567
- onSuccess: Z(e, t)
1573
+ mutationFn: ({ id: e, outcome: t, notes: n }) => k(e, t, n),
1574
+ onSuccess: q(e, t)
1568
1575
  });
1569
1576
  },
1570
1577
  clearDestructiveHold: (e) => {
1571
- let t = H().ops();
1578
+ let t = B().ops();
1572
1579
  return c({
1573
1580
  mutationKey: [
1574
1581
  ...t,
1575
1582
  "destructive-holds",
1576
1583
  "clear"
1577
1584
  ],
1578
- mutationFn: ({ id: e, reason: t }) => M(e, t),
1579
- onSuccess: Z(e, t)
1585
+ mutationFn: ({ id: e, reason: t }) => A(e, t),
1586
+ onSuccess: q(e, t)
1580
1587
  });
1581
1588
  },
1582
1589
  refundPayment: (e, t, n, r) => {
1583
- let i = H(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
1590
+ let i = B(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
1584
1591
  return c({
1585
1592
  mutationKey: [
1586
1593
  ...a,
1587
1594
  t,
1588
1595
  "refund"
1589
1596
  ],
1590
- mutationFn: ({ amount: e, reason: n, revokeAccess: r }) => k(t, e, n, r),
1597
+ mutationFn: ({ amount: e, reason: n, revokeAccess: r }) => D(t, e, n, r),
1591
1598
  onSuccess: () => Promise.all([
1592
1599
  e.invalidateQueries({ queryKey: a }),
1593
1600
  ...o ? [e.invalidateQueries({ queryKey: o })] : [],
@@ -1596,43 +1603,43 @@ function ie(e, t, n) {
1596
1603
  });
1597
1604
  },
1598
1605
  cancelSubscription: (e, t, n) => {
1599
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1606
+ let r = B(), i = r.subscriptions(), o = n ? r.customer(n) : void 0;
1600
1607
  return c({
1601
1608
  mutationKey: [
1602
1609
  ...i,
1603
1610
  t,
1604
1611
  "cancel"
1605
1612
  ],
1606
- mutationFn: ({ reason: e, revokeAccess: n }) => o(t, e, n),
1607
- onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...a ? [e.invalidateQueries({ queryKey: a })] : []])
1613
+ mutationFn: ({ reason: e, revokeAccess: n }) => a(t, e, n),
1614
+ onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...o ? [e.invalidateQueries({ queryKey: o })] : []])
1608
1615
  });
1609
1616
  },
1610
1617
  resumeSubscription: (e, t, n) => {
1611
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1618
+ let r = B(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1612
1619
  return c({
1613
1620
  mutationKey: [
1614
1621
  ...i,
1615
1622
  t,
1616
1623
  "resume"
1617
1624
  ],
1618
- mutationFn: () => N(t),
1625
+ mutationFn: () => j(t),
1619
1626
  onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...a ? [e.invalidateQueries({ queryKey: a })] : []])
1620
1627
  });
1621
1628
  },
1622
1629
  changeSubscriptionPaymentMethod: (e, t, n) => {
1623
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1630
+ let r = B(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1624
1631
  return c({
1625
1632
  mutationKey: [
1626
1633
  ...i,
1627
1634
  t,
1628
1635
  "payment-method"
1629
1636
  ],
1630
- mutationFn: (e) => s(t, e),
1637
+ mutationFn: (e) => o(t, e),
1631
1638
  onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...a ? [e.invalidateQueries({ queryKey: a })] : []])
1632
1639
  });
1633
1640
  },
1634
1641
  previewSubscriptionChange: (e) => {
1635
- let t = H().subscriptions();
1642
+ let t = B().subscriptions();
1636
1643
  return c({
1637
1644
  mutationKey: [
1638
1645
  ...t,
@@ -1640,18 +1647,18 @@ function ie(e, t, n) {
1640
1647
  "change",
1641
1648
  "preview"
1642
1649
  ],
1643
- mutationFn: (t) => D(e, t)
1650
+ mutationFn: (t) => w(e, t)
1644
1651
  });
1645
1652
  },
1646
1653
  changeSubscription: (e, t, n) => {
1647
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
1654
+ let r = B(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
1648
1655
  return c({
1649
1656
  mutationKey: [
1650
1657
  ...i,
1651
1658
  t,
1652
1659
  "change"
1653
1660
  ],
1654
- mutationFn: (e) => l(t, e.change, e.idempotencyKey),
1661
+ mutationFn: (e) => s(t, e.change, e.idempotencyKey),
1655
1662
  onSuccess: () => Promise.all([
1656
1663
  e.invalidateQueries({ queryKey: i }),
1657
1664
  e.invalidateQueries({ queryKey: o }),
@@ -1660,195 +1667,153 @@ function ie(e, t, n) {
1660
1667
  });
1661
1668
  },
1662
1669
  grantCustomerProductAccess: (e, t) => {
1663
- let n = H().customer(t);
1670
+ let n = B().customer(t);
1664
1671
  return c({
1665
1672
  mutationKey: [
1666
1673
  ...n,
1667
1674
  "product-access",
1668
1675
  "grant"
1669
1676
  ],
1670
- mutationFn: (e) => _(t, e),
1671
- onSuccess: Z(e, n)
1677
+ mutationFn: (e) => h(t, e),
1678
+ onSuccess: q(e, n)
1672
1679
  });
1673
1680
  },
1674
1681
  revokeCustomerProductAccess: (e, t) => {
1675
- let n = H().customer(t);
1682
+ let n = B().customer(t);
1676
1683
  return c({
1677
1684
  mutationKey: [
1678
1685
  ...n,
1679
1686
  "product-access",
1680
1687
  "revoke"
1681
1688
  ],
1682
- mutationFn: ({ grantId: e, reason: t }) => P(e, t),
1683
- onSuccess: Z(e, n)
1684
- });
1685
- },
1686
- askCatalogCopilot: () => {
1687
- let e = H();
1688
- return c({
1689
- mutationKey: [
1690
- ...e.catalog(),
1691
- "copilot",
1692
- "ask"
1693
- ],
1694
- mutationFn: (e) => i(e)
1695
- });
1696
- },
1697
- loadCatalogPriceDraft: () => {
1698
- let e = H();
1699
- return c({
1700
- mutationKey: [
1701
- ...e.catalog(),
1702
- "copilot",
1703
- "load-price-draft"
1704
- ],
1705
- mutationFn: async ({ productKey: e, priceKey: t }) => {
1706
- let n = await g(e), r = n.prices.find((e) => e.key === t);
1707
- if (!r) throw Error(`No live price ${e}/${t}`);
1708
- return {
1709
- price: r,
1710
- productName: n.display_name,
1711
- productKey: n.key
1712
- };
1713
- }
1714
- });
1715
- },
1716
- createCatalogDraftPrice: (e) => {
1717
- let t = H();
1718
- return c({
1719
- mutationKey: [
1720
- ...t.catalog(),
1721
- "copilot",
1722
- "create-price"
1723
- ],
1724
- mutationFn: (e) => u(e),
1725
- onSuccess: Z(e, t.catalog())
1689
+ mutationFn: ({ grantId: e, reason: t }) => M(e, t),
1690
+ onSuccess: q(e, n)
1726
1691
  });
1727
1692
  },
1728
1693
  applyCatalog: (e) => {
1729
- let t = H();
1694
+ let t = B();
1730
1695
  return c({
1731
1696
  mutationKey: [...t.catalog(), "apply"],
1732
- mutationFn: ({ document: e, force: t }) => O(e, t),
1733
- onSuccess: Z(e, t.catalog())
1697
+ mutationFn: ({ document: e, force: t }) => E(e, t),
1698
+ onSuccess: q(e, t.catalog())
1734
1699
  });
1735
1700
  },
1736
1701
  createProduct: (e) => {
1737
- let t = H();
1702
+ let t = B();
1738
1703
  return c({
1739
1704
  mutationKey: [
1740
1705
  ...t.catalog(),
1741
1706
  "products",
1742
1707
  "create"
1743
1708
  ],
1744
- mutationFn: (e) => d(e),
1745
- onSuccess: Z(e, t.catalog())
1709
+ mutationFn: (e) => u(e),
1710
+ onSuccess: q(e, t.catalog())
1746
1711
  });
1747
1712
  },
1748
1713
  updateProduct: (e) => {
1749
- let t = H();
1714
+ let t = B();
1750
1715
  return c({
1751
1716
  mutationKey: [
1752
1717
  ...t.catalog(),
1753
1718
  "products",
1754
1719
  "update"
1755
1720
  ],
1756
- mutationFn: ({ id: e, product: t }) => R(e, t),
1757
- onSuccess: Z(e, t.catalog()),
1758
- onError: Q(e, t.catalog())
1721
+ mutationFn: ({ id: e, product: t }) => I(e, t),
1722
+ onSuccess: q(e, t.catalog()),
1723
+ onError: J(e, t.catalog())
1759
1724
  });
1760
1725
  },
1761
1726
  setProductActive: (e) => {
1762
- let t = H();
1727
+ let t = B();
1763
1728
  return c({
1764
1729
  mutationKey: [
1765
1730
  ...t.catalog(),
1766
1731
  "products",
1767
1732
  "set-active"
1768
1733
  ],
1769
- mutationFn: ({ id: e, active: t, revision: n }) => R(e, {
1734
+ mutationFn: ({ id: e, active: t, revision: n }) => I(e, {
1770
1735
  archived: !t,
1771
1736
  expected_revision: n
1772
1737
  }),
1773
- onSuccess: Z(e, t.catalog()),
1774
- onError: Q(e, t.catalog())
1738
+ onSuccess: q(e, t.catalog()),
1739
+ onError: J(e, t.catalog())
1775
1740
  });
1776
1741
  },
1777
1742
  createPrice: (e) => {
1778
- let t = H();
1743
+ let t = B();
1779
1744
  return c({
1780
1745
  mutationKey: [
1781
1746
  ...t.catalog(),
1782
1747
  "prices",
1783
1748
  "create"
1784
1749
  ],
1785
- mutationFn: (e) => u(e),
1786
- onSuccess: Z(e, t.catalog())
1750
+ mutationFn: (e) => l(e),
1751
+ onSuccess: q(e, t.catalog())
1787
1752
  });
1788
1753
  },
1789
1754
  setPriceActive: (e) => {
1790
- let t = H();
1755
+ let t = B();
1791
1756
  return c({
1792
1757
  mutationKey: [
1793
1758
  ...t.catalog(),
1794
1759
  "prices",
1795
1760
  "set-active"
1796
1761
  ],
1797
- mutationFn: ({ id: e, active: t, revision: n }) => L(e, {
1762
+ mutationFn: ({ id: e, active: t, revision: n }) => F(e, {
1798
1763
  archived: !t,
1799
1764
  expected_revision: n
1800
1765
  }),
1801
- onSuccess: Z(e, t.catalog()),
1802
- onError: Q(e, t.catalog())
1766
+ onSuccess: q(e, t.catalog()),
1767
+ onError: J(e, t.catalog())
1803
1768
  });
1804
1769
  },
1805
1770
  putUsageMeter: (e) => {
1806
- let t = H(), n = t.usageMeters();
1771
+ let t = B(), n = t.usageMeters();
1807
1772
  return c({
1808
1773
  mutationKey: [...n, "put"],
1809
- mutationFn: ({ key: e, meter: t }) => w(e, t),
1774
+ mutationFn: ({ key: e, meter: t }) => S(e, t),
1810
1775
  onSuccess: (r, { key: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i) })]),
1811
- onError: Q(e, n)
1776
+ onError: J(e, n)
1812
1777
  });
1813
1778
  },
1814
1779
  putDefaultUsageRateCard: (e) => {
1815
- let t = H(), n = t.usageMeters();
1780
+ let t = B(), n = t.usageMeters();
1816
1781
  return c({
1817
1782
  mutationKey: [
1818
1783
  ...n,
1819
1784
  "rate-card",
1820
1785
  "put"
1821
1786
  ],
1822
- mutationFn: ({ meter: e, rateCard: t }) => S(e, t),
1787
+ mutationFn: ({ meter: e, rateCard: t }) => y(e, t),
1823
1788
  onSuccess: (r, { meter: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i.key) })]),
1824
- onError: Q(e, n)
1789
+ onError: J(e, n)
1825
1790
  });
1826
1791
  },
1827
1792
  deleteDefaultUsageRateCard: (e) => {
1828
- let t = H(), n = t.usageMeters();
1793
+ let t = B(), n = t.usageMeters();
1829
1794
  return c({
1830
1795
  mutationKey: [
1831
1796
  ...n,
1832
1797
  "rate-card",
1833
1798
  "delete"
1834
1799
  ],
1835
- mutationFn: (e) => S(e, null),
1800
+ mutationFn: (e) => y(e, null),
1836
1801
  onSuccess: (r, i) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i.key) })])
1837
1802
  });
1838
1803
  },
1839
1804
  previewPriceChange: () => {
1840
- let e = H();
1805
+ let e = B();
1841
1806
  return c({
1842
1807
  mutationKey: [
1843
1808
  ...e.catalog(),
1844
1809
  "prices",
1845
1810
  "preview-change"
1846
1811
  ],
1847
- mutationFn: ({ productKey: e, priceKey: t }) => E(e, t)
1812
+ mutationFn: ({ productKey: e, priceKey: t }) => C(e, t)
1848
1813
  });
1849
1814
  },
1850
1815
  changePrice: (e) => {
1851
- let t = H();
1816
+ let t = B();
1852
1817
  return c({
1853
1818
  mutationKey: [
1854
1819
  ...t.catalog(),
@@ -1856,35 +1821,35 @@ function ie(e, t, n) {
1856
1821
  "change"
1857
1822
  ],
1858
1823
  mutationFn: async ({ price: e, migration: t }) => {
1859
- let n = await u(e);
1860
- return t && await A(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
1824
+ let n = await l(e);
1825
+ return t && await O(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
1861
1826
  },
1862
- onSettled: Z(e, t.catalog())
1827
+ onSettled: q(e, t.catalog())
1863
1828
  });
1864
1829
  },
1865
1830
  cancelPriceMigration: (e) => {
1866
- let t = H();
1831
+ let t = B();
1867
1832
  return c({
1868
1833
  mutationKey: [
1869
1834
  ...t.catalog(),
1870
1835
  "price-migrations",
1871
1836
  "cancel"
1872
1837
  ],
1873
- mutationFn: (e) => a(e),
1874
- onSuccess: Z(e, t.catalog())
1838
+ mutationFn: (e) => i(e),
1839
+ onSuccess: q(e, t.catalog())
1875
1840
  });
1876
1841
  },
1877
1842
  updateMerchantConfiguration: (e) => {
1878
- let t = H();
1843
+ let t = B();
1879
1844
  return c({
1880
1845
  mutationKey: [...t.settings(), "update"],
1881
- mutationFn: (e) => I(e),
1882
- onSettled: X(e, t.settings()),
1883
- onError: U(e)
1846
+ mutationFn: (e) => P(e),
1847
+ onSettled: K(e, t.settings()),
1848
+ onError: V(e)
1884
1849
  });
1885
1850
  },
1886
1851
  createPSP: (e) => {
1887
- let t = r(), n = H();
1852
+ let t = r(), n = B();
1888
1853
  return c({
1889
1854
  mutationKey: [
1890
1855
  ...n.settings(),
@@ -1895,14 +1860,14 @@ function ie(e, t, n) {
1895
1860
  gcTime: 0,
1896
1861
  mutationFn: (e) => {
1897
1862
  if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
1898
- return p(e);
1863
+ return f(e);
1899
1864
  },
1900
- onSettled: X(e, [...n.settings(), "psps"]),
1901
- onError: U(e)
1865
+ onSettled: K(e, [...n.settings(), "psps"]),
1866
+ onError: V(e)
1902
1867
  });
1903
1868
  },
1904
1869
  updatePSP: (e) => {
1905
- let t = r(), n = H();
1870
+ let t = r(), n = B();
1906
1871
  return c({
1907
1872
  mutationKey: [
1908
1873
  ...n.settings(),
@@ -1913,28 +1878,28 @@ function ie(e, t, n) {
1913
1878
  gcTime: 0,
1914
1879
  mutationFn: ({ id: e, psp: n }) => {
1915
1880
  if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
1916
- return C(e, n);
1881
+ return b(e, n);
1917
1882
  },
1918
- onSettled: X(e, [...n.settings(), "psps"]),
1919
- onError: U(e)
1883
+ onSettled: K(e, [...n.settings(), "psps"]),
1884
+ onError: V(e)
1920
1885
  });
1921
1886
  },
1922
1887
  setCreditLimit: () => {
1923
- let e = H();
1888
+ let e = B();
1924
1889
  return c({
1925
1890
  mutationKey: [
1926
1891
  ...e.settings(),
1927
1892
  "customer-controls",
1928
1893
  "credit-limit"
1929
1894
  ],
1930
- mutationFn: ({ customerId: e, currency: t, amount: n }) => F(e, { credit_limits: [{
1895
+ mutationFn: ({ customerId: e, currency: t, amount: n }) => N(e, { credit_limits: [{
1931
1896
  currency: t,
1932
1897
  amount: n
1933
1898
  }] })
1934
1899
  });
1935
1900
  },
1936
1901
  lookupCustomerControls: () => {
1937
- let e = H();
1902
+ let e = B();
1938
1903
  return c({
1939
1904
  mutationKey: [
1940
1905
  ...e.settings(),
@@ -1942,7 +1907,7 @@ function ie(e, t, n) {
1942
1907
  "lookup"
1943
1908
  ],
1944
1909
  mutationFn: async ({ customerId: e, currency: t }) => {
1945
- let { settings: n } = await h(e).catch((e) => {
1910
+ let { settings: n } = await m(e).catch((e) => {
1946
1911
  throw e instanceof x && e.status === 404 ? Error("No customer has this ID") : e;
1947
1912
  }), r = t.toUpperCase();
1948
1913
  return {
@@ -1954,48 +1919,48 @@ function ie(e, t, n) {
1954
1919
  });
1955
1920
  },
1956
1921
  createWebhook: (e) => {
1957
- let t = H();
1922
+ let t = B();
1958
1923
  return c({
1959
1924
  mutationKey: [
1960
1925
  ...t.alerts(),
1961
1926
  "webhooks",
1962
1927
  "create"
1963
1928
  ],
1964
- mutationFn: (e) => f(e),
1965
- onSuccess: W(e, t),
1966
- onError: U(e)
1929
+ mutationFn: (e) => d(e),
1930
+ onSuccess: H(e, t),
1931
+ onError: V(e)
1967
1932
  });
1968
1933
  },
1969
1934
  updateWebhook: (e) => {
1970
- let t = H();
1935
+ let t = B();
1971
1936
  return c({
1972
1937
  mutationKey: [
1973
1938
  ...t.alerts(),
1974
1939
  "webhooks",
1975
1940
  "update"
1976
1941
  ],
1977
- mutationFn: ({ id: e, webhook: t }) => z(e, t),
1978
- onSuccess: W(e, t),
1979
- onError: U(e)
1942
+ mutationFn: ({ id: e, webhook: t }) => L(e, t),
1943
+ onSuccess: H(e, t),
1944
+ onError: V(e)
1980
1945
  });
1981
1946
  },
1982
1947
  deleteWebhook: (e) => {
1983
- let t = H();
1948
+ let t = B();
1984
1949
  return c({
1985
1950
  mutationKey: [
1986
1951
  ...t.alerts(),
1987
1952
  "webhooks",
1988
1953
  "delete"
1989
1954
  ],
1990
- mutationFn: (e) => m(e),
1991
- onSuccess: W(e, t),
1992
- onError: U(e)
1955
+ mutationFn: (e) => p(e),
1956
+ onSuccess: H(e, t),
1957
+ onError: V(e)
1993
1958
  });
1994
1959
  }
1995
1960
  } };
1996
1961
  }
1997
1962
  // src/admin/lib/credit-queries.ts
1998
- function ae(e, t) {
1963
+ function le(e, t) {
1999
1964
  let { selectedMerchant: n } = e, r = (t, n) => [
2000
1965
  ...e.queryRoot(t),
2001
1966
  "customers",
@@ -2043,7 +2008,7 @@ function ae(e, t) {
2043
2008
  };
2044
2009
  }
2045
2010
  // src/admin/lib/order-queries.ts
2046
- function oe(e, t, n) {
2011
+ function ue(e, t, n) {
2047
2012
  let { queryRoot: r } = e, { queryKeys: i } = n, a = t, o = t, u = {
2048
2013
  root: () => [...r(), "orders"],
2049
2014
  detail: (e) => [...u.root(), e],
@@ -2121,7 +2086,7 @@ function oe(e, t, n) {
2121
2086
  };
2122
2087
  }
2123
2088
  // src/admin/lib/import-queries.ts
2124
- var se = (e) => e === "pulling" || e === "applying", ce = 2e3, le = (e) => ({
2089
+ var de = (e) => e === "pulling" || e === "applying", fe = 2e3, pe = (e) => ({
2125
2090
  imports: () => [...e(), "psp-imports"],
2126
2091
  import: (t) => [
2127
2092
  ...e(),
@@ -2134,10 +2099,10 @@ var se = (e) => e === "pulling" || e === "applying", ce = 2e3, le = (e) => ({
2134
2099
  catalog: () => [...e(), "catalog"],
2135
2100
  ops: () => [...e(), "ops"]
2136
2101
  });
2137
- function ue(e, t) {
2138
- let { queryRoot: n } = e, r = le(n), i = () => {
2102
+ function me(e, t) {
2103
+ let { queryRoot: n } = e, r = pe(n), i = () => {
2139
2104
  let e = n();
2140
- return le(() => e);
2105
+ return pe(() => e);
2141
2106
  };
2142
2107
  return {
2143
2108
  importKeys: r,
@@ -2155,7 +2120,7 @@ function ue(e, t) {
2155
2120
  cursor: i
2156
2121
  }, r),
2157
2122
  placeholderData: s,
2158
- refetchInterval: (e) => e.state.data?.data.some((e) => se(e.status)) ? ce : !1,
2123
+ refetchInterval: (e) => e.state.data?.data.some((e) => de(e.status)) ? fe : !1,
2159
2124
  meta: { errorAction: "Load PSP imports" }
2160
2125
  }),
2161
2126
  latest: (e) => l({
@@ -2171,7 +2136,7 @@ function ue(e, t) {
2171
2136
  queryKey: r.import(e),
2172
2137
  queryFn: ({ signal: n }) => t.getPSPImport(e, n),
2173
2138
  enabled: !!e,
2174
- refetchInterval: (e) => se(e.state.data?.status) ? ce : !1,
2139
+ refetchInterval: (e) => de(e.state.data?.status) ? fe : !1,
2175
2140
  meta: { errorAction: "Load PSP import" }
2176
2141
  }),
2177
2142
  records: (e, n, i, a, o) => l({
@@ -2310,29 +2275,29 @@ function ue(e, t) {
2310
2275
  };
2311
2276
  }
2312
2277
  // src/admin/context.tsx
2313
- function de(e) {
2314
- let t = E(e), n = B(t), r = te(t, n), i = W(e.namespace);
2278
+ function he(e) {
2279
+ let t = E(e), n = B(t), r = ae(t, n), i = te(e.namespace);
2315
2280
  return {
2316
2281
  toast: i,
2317
- ...G(i),
2282
+ ...ne(i),
2318
2283
  ...t,
2319
2284
  ...n,
2320
2285
  ...r,
2321
- ...ie(t, n, r),
2322
- ...ae(t, n),
2323
- ...oe(t, n, r),
2324
- ...ue(t, n)
2286
+ ...ce(t, n, r),
2287
+ ...le(t, n),
2288
+ ...ue(t, n, r),
2289
+ ...me(t, n)
2325
2290
  };
2326
2291
  }
2327
- var fe = e(null);
2328
- function pe() {
2329
- let e = n(fe);
2292
+ var ge = e(null);
2293
+ function _e() {
2294
+ let e = n(ge);
2330
2295
  if (!e) throw Error("BillingAdmin context is missing");
2331
2296
  return e;
2332
2297
  }
2333
- var me = () => pe().services, he = e(null), ge = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), _e = () => window.location.pathname + window.location.search;
2334
- function ve({ basePath: e = "/", navigation: n, children: r }) {
2335
- let s = o(ge, _e, () => e), c = e.replace(/\/$/, ""), l = new URL(s, "http://billing.local"), u = n?.pathname ?? l.pathname, f = n?.search ?? l.search, p = u === c ? "/" : u.startsWith(c + "/") ? u.slice(c.length) : "/", [m, h] = a(() => /* @__PURE__ */ new Map()), g = t((e) => {
2298
+ var ve = () => _e().services, ye = e(null), be = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), xe = () => window.location.pathname + window.location.search;
2299
+ function Se({ basePath: e = "/", navigation: n, children: r }) {
2300
+ let s = o(be, xe, () => e), c = e.replace(/\/$/, ""), l = new URL(s, "http://billing.local"), u = n?.pathname ?? l.pathname, f = n?.search ?? l.search, p = u === c ? "/" : u.startsWith(c + "/") ? u.slice(c.length) : "/", [m, h] = a(() => /* @__PURE__ */ new Map()), g = t((e) => {
2336
2301
  if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(e)) return e;
2337
2302
  let t = new URL(e, "http://billing.local" + p + f);
2338
2303
  return c + t.pathname + t.search + t.hash;
@@ -2365,26 +2330,26 @@ function ve({ basePath: e = "/", navigation: n, children: r }) {
2365
2330
  n,
2366
2331
  m
2367
2332
  ]);
2368
- return /* @__PURE__ */ d(he.Provider, {
2333
+ return /* @__PURE__ */ d(ye.Provider, {
2369
2334
  value: v,
2370
2335
  children: r
2371
2336
  });
2372
2337
  }
2373
- function $() {
2374
- let e = n(he);
2338
+ function Y() {
2339
+ let e = n(ye);
2375
2340
  if (!e) throw Error("BillingAdmin router is missing");
2376
2341
  return e;
2377
2342
  }
2378
- var ye = () => $().location, be = () => $().navigate, xe = () => $().params;
2379
- function Se() {
2380
- let { location: e, navigate: t } = $();
2343
+ var Ce = () => Y().location, we = () => Y().navigate, Te = () => Y().params;
2344
+ function Ee() {
2345
+ let { location: e, navigate: t } = Y();
2381
2346
  return [i(() => new URLSearchParams(e.search), [e.search]), (n, r) => {
2382
2347
  let i = new URLSearchParams(n).toString();
2383
2348
  t(e.pathname + (i ? "?" + i : ""), r);
2384
2349
  }];
2385
2350
  }
2386
- function Ce({ to: e, onClick: t, ...n }) {
2387
- let { href: r, navigate: i } = $();
2351
+ function De({ to: e, onClick: t, ...n }) {
2352
+ let { href: r, navigate: i } = Y();
2388
2353
  return /* @__PURE__ */ d("a", {
2389
2354
  ...n,
2390
2355
  href: r(e),
@@ -2393,17 +2358,17 @@ function Ce({ to: e, onClick: t, ...n }) {
2393
2358
  }
2394
2359
  });
2395
2360
  }
2396
- function we({ to: e, replace: t }) {
2397
- let n = be();
2361
+ function Oe({ to: e, replace: t }) {
2362
+ let n = we();
2398
2363
  return r(() => n(e, { replace: t }), [
2399
2364
  n,
2400
2365
  e,
2401
2366
  t
2402
2367
  ]), null;
2403
2368
  }
2404
- function Te({ params: e, children: t }) {
2405
- let n = $();
2406
- return /* @__PURE__ */ d(he.Provider, {
2369
+ function ke({ params: e, children: t }) {
2370
+ let n = Y();
2371
+ return /* @__PURE__ */ d(ye.Provider, {
2407
2372
  value: {
2408
2373
  ...n,
2409
2374
  params: e
@@ -2412,9 +2377,211 @@ function Te({ params: e, children: t }) {
2412
2377
  });
2413
2378
  }
2414
2379
  // src/admin/lib/utils.ts
2415
- function Ee(...e) {
2380
+ function Ae(...e) {
2416
2381
  return p(f(e));
2417
2382
  }
2418
- export { k as C, m as D, g as E, h as O, A as S, E as T, U as _, Te as a, D as b, xe as c, de as d, pe as f, G as g, W as h, we as i, Se as l, se as m, ve as n, ye as o, me as p, Ce as r, be as s, Ee as t, fe as u, B as v, x as w, O as x, M as y };
2383
+ // src/lib/card-brands.ts
2384
+ var je = {
2385
+ visa: "visa",
2386
+ mastercard: "mastercard",
2387
+ mc: "mastercard",
2388
+ master: "mastercard",
2389
+ amex: "amex",
2390
+ americanexpress: "amex",
2391
+ "american express": "amex"
2392
+ }, Me = {
2393
+ visa: "Visa",
2394
+ mastercard: "Mastercard",
2395
+ amex: "Amex",
2396
+ discover: "Discover",
2397
+ jcb: "JCB",
2398
+ diners: "Diners Club",
2399
+ unionpay: "UnionPay"
2400
+ };
2401
+ function Ne(e) {
2402
+ let t = e?.trim();
2403
+ if (!t) return;
2404
+ let n = t.toLowerCase().replace(/[^a-z]/g, "");
2405
+ return Me[Pe(t) ?? n] ?? t[0].toUpperCase() + t.slice(1).toLowerCase();
2406
+ }
2407
+ function Pe(e) {
2408
+ let t = e?.trim().toLowerCase().replace(/[^a-z ]/g, "");
2409
+ return t ? je[t] : void 0;
2410
+ }
2411
+ // src/client/generated/currencies.ts
2412
+ var X = {
2413
+ AED: 6,
2414
+ AUD: 6,
2415
+ BRL: 6,
2416
+ CAD: 6,
2417
+ CHF: 6,
2418
+ CNY: 6,
2419
+ CZK: 6,
2420
+ DKK: 6,
2421
+ EUR: 6,
2422
+ GBP: 6,
2423
+ HKD: 6,
2424
+ ILS: 6,
2425
+ INR: 6,
2426
+ JPY: 4,
2427
+ KRW: 4,
2428
+ MXN: 6,
2429
+ MYR: 6,
2430
+ NOK: 6,
2431
+ NZD: 6,
2432
+ PHP: 6,
2433
+ PLN: 6,
2434
+ PYUSD: 6,
2435
+ SAR: 6,
2436
+ SEK: 6,
2437
+ SGD: 6,
2438
+ SOL: 9,
2439
+ THB: 6,
2440
+ TRY: 6,
2441
+ USD: 6,
2442
+ USD1: 6,
2443
+ USDC: 6,
2444
+ USDG: 6,
2445
+ USDT: 6,
2446
+ ZAR: 6
2447
+ }, Fe = -(1n << 63n), Ie = (1n << 63n) - 1n, Le = (() => {
2448
+ try {
2449
+ return new Intl.NumberFormat("en", { useGrouping: !1 }).format("9007199254740993") === "9007199254740993";
2450
+ } catch {
2451
+ return !1;
2452
+ }
2453
+ })(), Re = 10n ** 15n;
2454
+ function Z(e) {
2455
+ let t = e.trim().toUpperCase();
2456
+ return Object.hasOwn(X, t) ? X[t] : void 0;
2457
+ }
2458
+ var ze = Object.keys(X);
2459
+ function Q(e) {
2460
+ return Number.isInteger(e) && e >= 0 && e <= 18;
2461
+ }
2462
+ function Be(e) {
2463
+ if (typeof e == "number") return Number.isSafeInteger(e) ? BigInt(e) : null;
2464
+ if (!/^-?\d{1,19}$/.test(e)) return null;
2465
+ let t = BigInt(e);
2466
+ return t < Fe || t > Ie ? null : t;
2467
+ }
2468
+ function Ve(e, t) {
2469
+ let n = Be(e);
2470
+ return n === null || !Q(t) ? null : He(n, t);
2471
+ }
2472
+ function He(e, t) {
2473
+ let n = e < 0n ? -e : e, r = 10n ** BigInt(t), i = (n % r).toString().padStart(t, "0").replace(/0+$/, "");
2474
+ return `${e < 0n ? "-" : ""}${n / r}${i ? `.${i}` : ""}`;
2475
+ }
2476
+ function $(e, t, n, r = n) {
2477
+ let i = Be(e);
2478
+ if (i === null || !Q(n)) return `${t} amount exceeds the exact display range`;
2479
+ if (!Le && (i >= Re || i <= -Re)) return `${t} amount exceeds this browser's exact display range`;
2480
+ let a = He(i, n), o = t.trim().toUpperCase();
2481
+ return /^[A-Z]{3}$/.test(o) ? new Intl.NumberFormat(void 0, {
2482
+ style: "currency",
2483
+ currency: o,
2484
+ maximumFractionDigits: r
2485
+ }).format(a) : `${new Intl.NumberFormat(void 0, { maximumFractionDigits: r }).format(a)} ${t}`;
2486
+ }
2487
+ function Ue(e) {
2488
+ return Object.fromEntries((e ?? []).map((e) => [e.code.toUpperCase(), {
2489
+ scale: e.scale,
2490
+ name: e.name || e.code
2491
+ }]));
2492
+ }
2493
+ function We(e, t, n = {}) {
2494
+ let r = n[t.trim().toUpperCase()];
2495
+ if (r) {
2496
+ let n = Be(e);
2497
+ return n === null || !Q(r.scale) ? `${t} amount exceeds the exact display range` : `${new Intl.NumberFormat(void 0, {
2498
+ minimumFractionDigits: r.scale,
2499
+ maximumFractionDigits: r.scale
2500
+ }).format(He(n, r.scale))} ${r.name}`;
2501
+ }
2502
+ let i = Z(t);
2503
+ if (i === void 0) return Ge(e, t);
2504
+ let a = t.trim().toUpperCase(), o = Intl.supportedValuesOf("currency").includes(a) ? new Intl.NumberFormat(void 0, {
2505
+ style: "currency",
2506
+ currency: a
2507
+ }).resolvedOptions().maximumFractionDigits : 4;
2508
+ return $(e, t, i, Math.min(o, i));
2509
+ }
2510
+ function Ge(e, t) {
2511
+ let n = Z(t);
2512
+ return n === void 0 ? `Amount in unregistered currency ${t || "(none)"}` : $(e, t, n);
2513
+ }
2514
+ function Ke(e) {
2515
+ return Object.fromEntries(e.flatMap((e) => e.unit ? [[e.currency.toUpperCase(), e.unit.scale]] : []));
2516
+ }
2517
+ function qe(e) {
2518
+ return Object.fromEntries((e ?? []).map((e) => [e.code.toUpperCase(), e.scale]));
2519
+ }
2520
+ function Je(e, t, n) {
2521
+ let r = n[t.trim().toUpperCase()];
2522
+ return r === void 0 ? Ge(e, t) : $(e, t, r);
2523
+ }
2524
+ function Ye(e, t) {
2525
+ return t.unit ? $(e, t.currency, t.unit.scale) : Ge(e, t.currency);
2526
+ }
2527
+ function Xe(e, t) {
2528
+ if (!Q(t)) return null;
2529
+ let n = /^([+-]?)(\d*)(?:\.(\d*))?$/.exec(e.trim());
2530
+ if (!n || !n[2] && !n[3] || (n[3]?.length ?? 0) > t) return null;
2531
+ let r = BigInt(n[2] || "0") * 10n ** BigInt(t) + BigInt((n[3] || "").padEnd(t, "0") || "0"), i = n[1] === "-" ? -r : r;
2532
+ return i < Fe || i > Ie ? null : i.toString();
2533
+ }
2534
+ function Ze(e, t) {
2535
+ let n = Z(t);
2536
+ return n === void 0 ? null : Xe(e, n);
2537
+ }
2538
+ function Qe(e, t) {
2539
+ let n = Z(t);
2540
+ return e === void 0 || n === void 0 || typeof e == "number" && !Number.isSafeInteger(e) ? "" : Ve(e, n) ?? "";
2541
+ }
2542
+ function $e(e) {
2543
+ if (!e) return "—";
2544
+ let t = new Date(e);
2545
+ return Number.isNaN(t.getTime()) ? "—" : t.toLocaleString(void 0, {
2546
+ dateStyle: "medium",
2547
+ timeStyle: "short"
2548
+ });
2549
+ }
2550
+ function et(e) {
2551
+ return e?.last4 ? `${Ne(e.brand) ?? "Card"} ••••${e.last4}` : "—";
2552
+ }
2553
+ function tt(e) {
2554
+ return `${e?.exp_month ?? "??"}/${e?.exp_year ?? "????"}`;
2555
+ }
2556
+ function nt(e, t = 8) {
2557
+ return e.length > t ? `${e.slice(0, t)}…` : e;
2558
+ }
2559
+ function rt(e) {
2560
+ return e.contact?.name || e.contact?.email || nt(e.id, 13);
2561
+ }
2562
+ function it(e) {
2563
+ return rt({
2564
+ id: e.customer_id,
2565
+ contact: e.customer_contact ?? null
2566
+ });
2567
+ }
2568
+ function at(e) {
2569
+ if (!e) return "";
2570
+ let t = new Date(e).getTime();
2571
+ if (Number.isNaN(t)) return "";
2572
+ let n = Math.round((Date.now() - t) / 1e3);
2573
+ if (n < 45) return "just now";
2574
+ if (n < 90) return "1m";
2575
+ let r = Math.round(n / 60);
2576
+ if (r < 60) return `${r}m`;
2577
+ let i = Math.round(r / 60);
2578
+ if (i < 24) return `${i}h`;
2579
+ let a = Math.round(i / 24);
2580
+ return a < 7 ? `${a}d` : new Date(t).toLocaleDateString(void 0, {
2581
+ month: "short",
2582
+ day: "numeric"
2583
+ });
2584
+ }
2585
+ export { Ee as A, N as B, Se as C, Ce as D, ke as E, de as F, k as G, D as H, te as I, g as J, x as K, ne as L, he as M, _e as N, we as O, ve as P, ee as R, Ae as S, Oe as T, O as U, M as V, A as W, h as X, m as Y, ze as _, Ye as a, Ve as b, $e as c, We as d, Ue as f, nt as g, it as h, qe as i, ge as j, Te as k, Ge as l, Qe as m, Z as n, et as o, Ze as p, E as q, rt as r, tt as s, Xe as t, Je as u, at as v, De as w, X as x, Ke as y, B as z };
2419
2586
 
2420
- //# sourceMappingURL=admin-utils-CX097OR7.js.map
2587
+ //# sourceMappingURL=admin-format-Bc4NWK0F.js.map