@openrails/billing-ui 0.268.3 → 0.269.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 (142) hide show
  1. package/dist/admin/context.d.ts +164 -62
  2. package/dist/admin/lib/api/endpoints.d.ts +3 -7
  3. package/dist/admin/lib/api/import-endpoints.d.ts +44 -0
  4. package/dist/admin/lib/api/index.d.ts +17 -7
  5. package/dist/admin/lib/api/types.d.ts +0 -29
  6. package/dist/admin/lib/import-queries.d.ts +66 -0
  7. package/dist/admin/lib/mutations.d.ts +1 -5
  8. package/dist/admin/lib/queries.d.ts +6 -20
  9. package/dist/admin/messages.d.ts +176 -6
  10. package/dist/admin/pages/catalog/index.d.ts +0 -1
  11. package/dist/admin/pages/imports/detail.d.ts +2 -0
  12. package/dist/admin/pages/imports/index.d.ts +2 -0
  13. package/dist/admin/pages/imports/mapping-csv.d.ts +10 -0
  14. package/dist/admin/pages/imports/progress.d.ts +21 -0
  15. package/dist/admin/pages/imports/records.d.ts +2 -0
  16. package/dist/admin/pages/imports/shared.d.ts +22 -0
  17. package/dist/admin/pages/parked/index.d.ts +2 -0
  18. package/dist/admin/pages/proposals/grouping.d.ts +13 -0
  19. package/dist/admin/pages/proposals/index.d.ts +2 -0
  20. package/dist/admin/pages/provider-prices/index.d.ts +2 -0
  21. package/dist/admin/pages/provider-prices/map-dialog.d.ts +11 -0
  22. package/dist/admin/routes.d.ts +1 -1
  23. package/dist/{admin-attempts-BLeeKABa.js → admin-attempts-DQTg0UzZ.js} +82 -82
  24. package/dist/{admin-attempts-BLeeKABa.js.map → admin-attempts-DQTg0UzZ.js.map} +1 -1
  25. package/dist/{admin-auth-DWVWxDup.js → admin-auth-1aZIgXiS.js} +2 -2
  26. package/dist/{admin-auth-DWVWxDup.js.map → admin-auth-1aZIgXiS.js.map} +1 -1
  27. package/dist/{admin-badge-CrEqD9Ew.js → admin-badge-pgG6D9-a.js} +2 -2
  28. package/dist/{admin-badge-CrEqD9Ew.js.map → admin-badge-pgG6D9-a.js.map} +1 -1
  29. package/dist/{admin-button-a7bDFgp0.js → admin-button-CrcYk5r0.js} +2 -2
  30. package/dist/{admin-button-a7bDFgp0.js.map → admin-button-CrcYk5r0.js.map} +1 -1
  31. package/dist/{admin-capabilities-QYUuJXvG.js → admin-capabilities-BDcZeHL_.js} +2 -2
  32. package/dist/{admin-capabilities-QYUuJXvG.js.map → admin-capabilities-BDcZeHL_.js.map} +1 -1
  33. package/dist/{admin-card-D1tz8Lbh.js → admin-card-DvTMc5Se.js} +2 -2
  34. package/dist/{admin-card-D1tz8Lbh.js.map → admin-card-DvTMc5Se.js.map} +1 -1
  35. package/dist/{admin-catalog-ggiDgWsR.js → admin-catalog-BlF5mnu4.js} +285 -382
  36. package/dist/admin-catalog-BlF5mnu4.js.map +1 -0
  37. package/dist/{admin-dom-VkcwevWr.js → admin-cursor-pager-CIb3Jw2F.js} +20 -25
  38. package/dist/admin-cursor-pager-CIb3Jw2F.js.map +1 -0
  39. package/dist/{admin-customers-BVMg-gUv.js → admin-customers-EpfoWDh-.js} +13 -13
  40. package/dist/{admin-customers-BVMg-gUv.js.map → admin-customers-EpfoWDh-.js.map} +1 -1
  41. package/dist/{admin-dashboard-Cc13i8i9.js → admin-dashboard-CJE63yz4.js} +46 -46
  42. package/dist/{admin-dashboard-Cc13i8i9.js.map → admin-dashboard-CJE63yz4.js.map} +1 -1
  43. package/dist/{admin-data-table-BL84xKKF.js → admin-data-table-hvFcJepL.js} +16 -16
  44. package/dist/{admin-data-table-BL84xKKF.js.map → admin-data-table-hvFcJepL.js.map} +1 -1
  45. package/dist/{admin-detail-CaEwBdX9.js → admin-detail-BRP6pL7t.js} +51 -51
  46. package/dist/{admin-detail-CaEwBdX9.js.map → admin-detail-BRP6pL7t.js.map} +1 -1
  47. package/dist/{admin-detail-9YAep3ts.js → admin-detail-CRzFb_pa.js} +232 -232
  48. package/dist/{admin-detail-9YAep3ts.js.map → admin-detail-CRzFb_pa.js.map} +1 -1
  49. package/dist/admin-detail-Ceod8AXy.js +299 -0
  50. package/dist/admin-detail-Ceod8AXy.js.map +1 -0
  51. package/dist/{admin-detail-C8t5jBps.js → admin-detail-QLxU8r-5.js} +62 -62
  52. package/dist/{admin-detail-C8t5jBps.js.map → admin-detail-QLxU8r-5.js.map} +1 -1
  53. package/dist/admin-detail-pPC8Q9l-.js +710 -0
  54. package/dist/{admin-detail-D2zcz_Xm.js.map → admin-detail-pPC8Q9l-.js.map} +1 -1
  55. package/dist/{admin-dialog-CiAw5vx-.js → admin-dialog-BSRf9Zre.js} +24 -24
  56. package/dist/{admin-dialog-CiAw5vx-.js.map → admin-dialog-BSRf9Zre.js.map} +1 -1
  57. package/dist/admin-dom-C7Y7A6Wa.js +8 -0
  58. package/dist/admin-dom-C7Y7A6Wa.js.map +1 -0
  59. package/dist/{admin-dropdown-menu-CYJbmqK2.js → admin-dropdown-menu-D0E5rwmn.js} +2 -2
  60. package/dist/{admin-dropdown-menu-CYJbmqK2.js.map → admin-dropdown-menu-D0E5rwmn.js.map} +1 -1
  61. package/dist/{admin-fact-card-BHTpDlaX.js → admin-fact-card-BPSVhS15.js} +2 -2
  62. package/dist/{admin-fact-card-BHTpDlaX.js.map → admin-fact-card-BPSVhS15.js.map} +1 -1
  63. package/dist/{admin-health-BUnjbvYR.js → admin-health-D0L5Kig7.js} +84 -84
  64. package/dist/{admin-health-BUnjbvYR.js.map → admin-health-D0L5Kig7.js.map} +1 -1
  65. package/dist/admin-imports-TCOljTgw.js +269 -0
  66. package/dist/admin-imports-TCOljTgw.js.map +1 -0
  67. package/dist/{admin-input-C-S_RGGo.js → admin-input-DJAK9nmk.js} +2 -2
  68. package/dist/{admin-input-C-S_RGGo.js.map → admin-input-DJAK9nmk.js.map} +1 -1
  69. package/dist/{admin-label-DPVYDdSO.js → admin-label-aviN9Gng.js} +2 -2
  70. package/dist/{admin-label-DPVYDdSO.js.map → admin-label-aviN9Gng.js.map} +1 -1
  71. package/dist/{admin-linked-table-row-D-gbTT7a.js → admin-linked-table-row-BGr7JXeM.js} +6 -6
  72. package/dist/{admin-linked-table-row-D-gbTT7a.js.map → admin-linked-table-row-BGr7JXeM.js.map} +1 -1
  73. package/dist/admin-map-dialog-DpGaIq52.js +135 -0
  74. package/dist/admin-map-dialog-DpGaIq52.js.map +1 -0
  75. package/dist/admin-mapping-csv-FtkyTBmk.js +56 -0
  76. package/dist/admin-mapping-csv-FtkyTBmk.js.map +1 -0
  77. package/dist/{admin-metering-BjbL0jjT.js → admin-metering-D-e-37Jn.js} +285 -285
  78. package/dist/{admin-metering-BjbL0jjT.js.map → admin-metering-D-e-37Jn.js.map} +1 -1
  79. package/dist/admin-ops-CQP4TzWM.js +235 -0
  80. package/dist/admin-ops-CQP4TzWM.js.map +1 -0
  81. package/dist/{admin-orders-BVW9-Fs9.js → admin-orders-BJ7W5S8P.js} +32 -32
  82. package/dist/{admin-orders-BVW9-Fs9.js.map → admin-orders-BJ7W5S8P.js.map} +1 -1
  83. package/dist/admin-parked-7HL8mOjw.js +193 -0
  84. package/dist/admin-parked-7HL8mOjw.js.map +1 -0
  85. package/dist/{admin-payments-C5MsFFmm.js → admin-payments-CzkzqYA1.js} +17 -17
  86. package/dist/{admin-payments-C5MsFFmm.js.map → admin-payments-CzkzqYA1.js.map} +1 -1
  87. package/dist/{admin-price-detail-D517JYHB.js → admin-price-detail-CSI5oKdb.js} +74 -74
  88. package/dist/{admin-price-detail-D517JYHB.js.map → admin-price-detail-CSI5oKdb.js.map} +1 -1
  89. package/dist/{admin-price-wizard-bj36o3ux.js → admin-price-wizard-CBEcNGvP.js} +38 -38
  90. package/dist/{admin-price-wizard-bj36o3ux.js.map → admin-price-wizard-CBEcNGvP.js.map} +1 -1
  91. package/dist/admin-proposals-dtgijWKz.js +375 -0
  92. package/dist/admin-proposals-dtgijWKz.js.map +1 -0
  93. package/dist/admin-provider-prices-ChuponcZ.js +246 -0
  94. package/dist/admin-provider-prices-ChuponcZ.js.map +1 -0
  95. package/dist/{admin-range-picker-D2aFF8IV.js → admin-range-picker-De36L-AP.js} +12 -12
  96. package/dist/{admin-range-picker-D2aFF8IV.js.map → admin-range-picker-De36L-AP.js.map} +1 -1
  97. package/dist/admin-records-CUHUOXAU.js +391 -0
  98. package/dist/admin-records-CUHUOXAU.js.map +1 -0
  99. package/dist/{admin-reports-D-ob04d4.js → admin-reports-BFGS_PWf.js} +45 -45
  100. package/dist/{admin-reports-D-ob04d4.js.map → admin-reports-BFGS_PWf.js.map} +1 -1
  101. package/dist/{admin-select-C8O7nx72.js → admin-select-BUcEU5Rg.js} +2 -2
  102. package/dist/{admin-select-C8O7nx72.js.map → admin-select-BUcEU5Rg.js.map} +1 -1
  103. package/dist/{admin-settings-Bs6cLcqi.js → admin-settings-DYC-c7mJ.js} +296 -296
  104. package/dist/{admin-settings-Bs6cLcqi.js.map → admin-settings-DYC-c7mJ.js.map} +1 -1
  105. package/dist/admin-shared-CzG8Pan3.js +222 -0
  106. package/dist/admin-shared-CzG8Pan3.js.map +1 -0
  107. package/dist/{admin-skeleton-wfocg2PJ.js → admin-skeleton-B0yzYY_X.js} +2 -2
  108. package/dist/{admin-skeleton-wfocg2PJ.js.map → admin-skeleton-B0yzYY_X.js.map} +1 -1
  109. package/dist/{admin-status-badge-D_gDMrht.js → admin-status-badge-0-K37EfN.js} +7 -2
  110. package/dist/admin-status-badge-0-K37EfN.js.map +1 -0
  111. package/dist/{admin-subscriptions-DYR1RGMO.js → admin-subscriptions-CvW-YFs0.js} +74 -74
  112. package/dist/{admin-subscriptions-DYR1RGMO.js.map → admin-subscriptions-CvW-YFs0.js.map} +1 -1
  113. package/dist/{admin-switch-F5D0AYjT.js → admin-switch-DDorugaw.js} +2 -2
  114. package/dist/{admin-switch-F5D0AYjT.js.map → admin-switch-DDorugaw.js.map} +1 -1
  115. package/dist/{admin-table-nUij5fLc.js → admin-table-BU6Tie69.js} +2 -2
  116. package/dist/{admin-table-nUij5fLc.js.map → admin-table-BU6Tie69.js.map} +1 -1
  117. package/dist/{admin-tabs-C3myjKdr.js → admin-tabs-D5lqdVcC.js} +2 -2
  118. package/dist/{admin-tabs-C3myjKdr.js.map → admin-tabs-D5lqdVcC.js.map} +1 -1
  119. package/dist/{admin-textarea-v-L-PXIc.js → admin-textarea-Dc6lnEub.js} +2 -2
  120. package/dist/{admin-textarea-v-L-PXIc.js.map → admin-textarea-Dc6lnEub.js.map} +1 -1
  121. package/dist/{admin-typed-confirm-dialog-BLgpuikW.js → admin-typed-confirm-dialog-Bk6XxmPb.js} +6 -6
  122. package/dist/{admin-typed-confirm-dialog-BLgpuikW.js.map → admin-typed-confirm-dialog-Bk6XxmPb.js.map} +1 -1
  123. package/dist/{admin-utils-6yE4YIVI.js → admin-utils-B9eEBNsR.js} +398 -146
  124. package/dist/admin-utils-B9eEBNsR.js.map +1 -0
  125. package/dist/{admin-widget-viz-BiEfckd4.js → admin-widget-viz-8aukE3v_.js} +34 -34
  126. package/dist/{admin-widget-viz-BiEfckd4.js.map → admin-widget-viz-8aukE3v_.js.map} +1 -1
  127. package/dist/admin.css +1 -1
  128. package/dist/admin.js +489 -264
  129. package/dist/admin.js.map +1 -1
  130. package/dist/client/generated/error-codes.d.ts +1 -1
  131. package/dist/client/generated/routes.d.ts +94 -22
  132. package/dist/client/generated/wire.d.ts +89 -14
  133. package/dist/index.js +1 -1
  134. package/dist/styles.css +1 -1
  135. package/package.json +2 -2
  136. package/dist/admin-catalog-ggiDgWsR.js.map +0 -1
  137. package/dist/admin-detail-D2zcz_Xm.js +0 -710
  138. package/dist/admin-dom-VkcwevWr.js.map +0 -1
  139. package/dist/admin-ops-DT8epiXg.js +0 -217
  140. package/dist/admin-ops-DT8epiXg.js.map +0 -1
  141. package/dist/admin-status-badge-D_gDMrht.js.map +0 -1
  142. package/dist/admin-utils-6yE4YIVI.js.map +0 -1
@@ -643,31 +643,31 @@ function j(e) {
643
643
  rawBody: e,
644
644
  headers: { "Content-Type": "application/yaml" },
645
645
  ...n ? { query: { force: "true" } } : {}
646
- }), H = () => t("/merchant/psps/refresh", { method: "POST" }), U = (e, n, r) => t("/merchant/findings", {
646
+ }), H = (e, n, r) => t("/merchant/findings", {
647
647
  query: {
648
648
  ...e,
649
649
  limit: n
650
650
  },
651
651
  signal: r
652
- }), W = (e) => t(`/merchant/findings/${e}`), G = (e, n, r) => t(`/merchant/findings/${e}/resolve`, {
652
+ }), U = (e) => t(`/merchant/findings/${e}`), W = (e, n, r) => t(`/merchant/findings/${e}/resolve`, {
653
653
  method: "POST",
654
654
  body: {
655
655
  outcome: n,
656
656
  notes: r
657
657
  }
658
- }), ee = (e) => t("/merchant/configuration", { signal: e }), te = (e) => t("/merchant/configuration", {
658
+ }), ee = (e) => t("/merchant/configuration", { signal: e }), G = (e) => t("/merchant/configuration", {
659
659
  method: "PATCH",
660
660
  body: e
661
- }), K = (e) => t("/merchant/psps?limit=500", { signal: e }), q = (e) => t("/merchant/custodians", { signal: e }), J = (e, n) => t(`/admin/customers/${encodeURIComponent(e)}/payment-methods/${encodeURIComponent(n)}`, { method: "DELETE" }), Y = (e, n) => t(`/merchant/custodians/${encodeURIComponent(e)}`, {
661
+ }), te = (e) => t("/merchant/psps?limit=500", { signal: e }), K = (e) => t("/merchant/custodians", { signal: e }), ne = (e, n) => t(`/admin/customers/${encodeURIComponent(e)}/payment-methods/${encodeURIComponent(n)}`, { method: "DELETE" }), q = (e, n) => t(`/merchant/custodians/${encodeURIComponent(e)}`, {
662
662
  method: "PUT",
663
663
  body: n
664
- }), X = async (e) => (await Z(e)).rails, ne = (e) => t("/merchant/psps", {
664
+ }), J = async (e) => (await Z(e)).rails, Y = (e) => t("/merchant/psps", {
665
665
  method: "POST",
666
666
  body: e
667
- }), re = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
667
+ }), X = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
668
668
  method: "PATCH",
669
669
  body: n
670
- }), ie = (e, n) => t("/merchant/psps/routing-preview", {
670
+ }), re = (e, n) => t("/merchant/psps/routing-preview", {
671
671
  method: "POST",
672
672
  body: e,
673
673
  signal: n
@@ -713,20 +713,19 @@ function j(e) {
713
713
  listPriceMigrations: z,
714
714
  cancelPriceMigration: B,
715
715
  applyCatalog: V,
716
- refreshPSPs: H,
717
- listFindings: U,
718
- getFinding: W,
719
- resolveFinding: G,
716
+ listFindings: H,
717
+ getFinding: U,
718
+ resolveFinding: W,
720
719
  getMerchantConfiguration: ee,
721
- updateMerchantConfiguration: te,
722
- listPSPs: K,
723
- listRails: X,
724
- createPSP: ne,
725
- listCustodians: q,
726
- putCustodian: Y,
727
- deleteCustomerPaymentMethod: J,
728
- updatePSP: re,
729
- previewPSPRouting: ie,
720
+ updateMerchantConfiguration: G,
721
+ listPSPs: te,
722
+ listRails: J,
723
+ createPSP: Y,
724
+ listCustodians: K,
725
+ putCustodian: q,
726
+ deleteCustomerPaymentMethod: ne,
727
+ updatePSP: X,
728
+ previewPSPRouting: re,
730
729
  getConfig: Z,
731
730
  getAdminAccess: (e) => t("/admin/access", { signal: e }),
732
731
  updateCustomer: (e, n) => t(`/admin/customers/${e}`, {
@@ -869,8 +868,87 @@ function R(e) {
869
868
  };
870
869
  }
871
870
  //#endregion
872
- //#region src/admin/lib/api/index.ts
871
+ //#region src/admin/lib/api/import-endpoints.ts
873
872
  function z(e) {
873
+ let { api: t } = e;
874
+ return {
875
+ listPSPImports: (e, n, r) => t("/merchant/psp-imports", {
876
+ query: {
877
+ ...e,
878
+ ...n
879
+ },
880
+ signal: r
881
+ }),
882
+ getPSPImport: (e, n) => t(`/merchant/psp-imports/${encodeURIComponent(e)}`, { signal: n }),
883
+ createPSPImport: (e) => t("/merchant/psp-imports", {
884
+ method: "POST",
885
+ body: e
886
+ }),
887
+ listPSPImportRecords: (e, n, r, i) => t(`/merchant/psp-imports/${encodeURIComponent(e)}/records`, {
888
+ query: {
889
+ ...n,
890
+ ...r
891
+ },
892
+ signal: i
893
+ }),
894
+ linkPSPImport: (e, n) => t(`/merchant/psp-imports/${encodeURIComponent(e)}/link`, {
895
+ method: "POST",
896
+ body: n
897
+ }),
898
+ applyPSPImport: (e) => t(`/merchant/psp-imports/${encodeURIComponent(e)}/apply`, { method: "POST" }),
899
+ setPSPImportMappings: (e) => t("/merchant/psp-import-mappings", {
900
+ method: "POST",
901
+ body: { mappings: e }
902
+ }),
903
+ listProviderCatalog: (e, n, r) => t("/merchant/provider-catalog", {
904
+ query: {
905
+ ...e,
906
+ ...n
907
+ },
908
+ signal: r
909
+ }),
910
+ createProviderPrice: (e) => t("/catalog/provider-prices", {
911
+ method: "POST",
912
+ body: e
913
+ }),
914
+ listParkedSubscriptions: (e, n, r) => t("/merchant/parked-subscriptions", {
915
+ query: {
916
+ ...e,
917
+ ...n
918
+ },
919
+ signal: r
920
+ }),
921
+ customersByIds: (e, n) => t("/admin/customers", {
922
+ query: { ids: e.join(",") },
923
+ signal: n
924
+ }),
925
+ listProposals: (e, n, r) => t("/merchant/proposals", {
926
+ query: {
927
+ ...e,
928
+ ...n
929
+ },
930
+ signal: r
931
+ }),
932
+ approveProposals: (e, n, r) => t("/merchant/proposals/approve", {
933
+ method: "POST",
934
+ headers: { "Idempotency-Key": r },
935
+ body: {
936
+ ids: e,
937
+ notes: n
938
+ }
939
+ }),
940
+ dismissProposals: (e, n) => t("/merchant/proposals/dismiss", {
941
+ method: "POST",
942
+ body: {
943
+ ids: e,
944
+ notes: n
945
+ }
946
+ })
947
+ };
948
+ }
949
+ //#endregion
950
+ //#region src/admin/lib/api/index.ts
951
+ function B(e) {
874
952
  let t = j(e);
875
953
  return {
876
954
  ...t,
@@ -878,12 +956,13 @@ function z(e) {
878
956
  ...P(e),
879
957
  ...I(e),
880
958
  ...L(e),
881
- ...R(t)
959
+ ...R(t),
960
+ ...z(e)
882
961
  };
883
962
  }
884
963
  //#endregion
885
964
  //#region src/admin/lib/toast.ts
886
- function B(e) {
965
+ function V(e) {
887
966
  let t = (t) => (n, r) => t(n, {
888
967
  ...r,
889
968
  toasterId: e
@@ -895,13 +974,17 @@ function B(e) {
895
974
  warning: t(u.warning)
896
975
  });
897
976
  }
898
- function V(e) {
977
+ function H(e) {
899
978
  function t(t, n) {
900
979
  if (t instanceof x) {
901
980
  if (t.code === "revision_mismatch") {
902
981
  e.error(`${n}: changed since you opened it`, { description: "The latest version is loaded; review it and try again." });
903
982
  return;
904
983
  }
984
+ if (t.code === "person_required") {
985
+ e.error(`${n}: only a signed-in person can do this`, { description: t.message });
986
+ return;
987
+ }
905
988
  if (t.isPermissionDenied) {
906
989
  e.error(`${n}: your role lacks permission`, { description: t.message });
907
990
  return;
@@ -922,17 +1005,17 @@ function V(e) {
922
1005
  }
923
1006
  //#endregion
924
1007
  //#region src/admin/lib/queries.ts
925
- function H(e) {
1008
+ function U(e) {
926
1009
  let t = e.rows[0] ?? [];
927
1010
  return Object.fromEntries(e.columns.map((e, n) => [e.name, t[n] ?? null]));
928
1011
  }
929
- async function U(e, t) {
1012
+ async function W(e, t) {
930
1013
  return {
931
1014
  data: await T((n) => e(n, t), t),
932
1015
  next_cursor: null
933
1016
  };
934
1017
  }
935
- var W = (e) => ({
1018
+ var ee = (e) => ({
936
1019
  merchant: () => e(),
937
1020
  customers: () => [...e(), "customers"],
938
1021
  customer: (t) => [
@@ -955,11 +1038,6 @@ var W = (e) => ({
955
1038
  attempts: () => [...e(), "payment-attempts"],
956
1039
  cycles: () => [...e(), "renewals"],
957
1040
  catalog: () => [...e(), "catalog"],
958
- catalogDrift: () => [
959
- ...e(),
960
- "catalog",
961
- "drift"
962
- ],
963
1041
  usageMeters: () => [
964
1042
  ...e(),
965
1043
  "catalog",
@@ -977,13 +1055,13 @@ var W = (e) => ({
977
1055
  dashboard: () => [...e(), "dashboard"],
978
1056
  notifications: () => [...e(), "notifications"]
979
1057
  }), G = (e) => e ? { errorAction: e } : void 0;
980
- function ee(e, t) {
981
- 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, listPaymentAttempts: b, listPSPs: x, listRails: S, previewPSPRouting: C, listPayments: w, listPrices: E, listProducts: D, listRenewals: O, listPriceMigrations: k, listSubscriptions: A, listUsageMeters: j, getAdminAccess: M, getConfig: N, listWebhooks: P, getDashboard: F, metricsQuery: I } = t, L = n, R = W(L);
1058
+ function te(e, t) {
1059
+ 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, listPaymentAttempts: b, listPSPs: x, listRails: S, previewPSPRouting: C, listPayments: w, listPrices: E, listProducts: D, listRenewals: O, listPriceMigrations: k, listSubscriptions: A, listUsageMeters: j, getAdminAccess: M, getConfig: N, listWebhooks: P, getDashboard: F, metricsQuery: I } = t, L = n, R = ee(L);
982
1060
  return {
983
1061
  queryKeys: R,
984
1062
  merchantQueryKeys: () => {
985
1063
  let e = L();
986
- return W(() => e);
1064
+ return ee(() => e);
987
1065
  },
988
1066
  adminQueries: {
989
1067
  customers: (e, t, n) => l({
@@ -1187,7 +1265,7 @@ function ee(e, t) {
1187
1265
  "products",
1188
1266
  "all"
1189
1267
  ],
1190
- queryFn: ({ signal: e }) => U((e, t) => D(500, e, void 0, t), e),
1268
+ queryFn: ({ signal: e }) => W((e, t) => D(500, e, void 0, t), e),
1191
1269
  meta: G(e.errorAction)
1192
1270
  }),
1193
1271
  prices: (e = {}) => {
@@ -1214,7 +1292,7 @@ function ee(e, t) {
1214
1292
  "all",
1215
1293
  { productId: e.productId }
1216
1294
  ],
1217
- queryFn: ({ signal: t }) => U((t, n) => E(500, t, e.productId, n), t),
1295
+ queryFn: ({ signal: t }) => W((t, n) => E(500, t, e.productId, n), t),
1218
1296
  meta: G(e.errorAction)
1219
1297
  }),
1220
1298
  price: (e, t = {}) => {
@@ -1264,15 +1342,6 @@ function ee(e, t) {
1264
1342
  queryFn: ({ signal: r }) => k(e, t, n, r),
1265
1343
  enabled: !!(e && t)
1266
1344
  }),
1267
- catalogDrift: (e = !0, t = 200, n) => l({
1268
- queryKey: [...R.catalogDrift(), {
1269
- limit: t,
1270
- cursor: n
1271
- }],
1272
- queryFn: ({ signal: e }) => y({ type: "catalog.*" }, t, e),
1273
- enabled: e,
1274
- meta: { errorAction: "Load drift" }
1275
- }),
1276
1345
  pspRouting: (e) => l({
1277
1346
  queryKey: [
1278
1347
  ...R.catalog(),
@@ -1295,7 +1364,7 @@ function ee(e, t) {
1295
1364
  }),
1296
1365
  allUsageMeters: () => l({
1297
1366
  queryKey: [...R.usageMeters(), "all"],
1298
- queryFn: ({ signal: e }) => U((e, t) => j(500, e, t), e),
1367
+ queryFn: ({ signal: e }) => W((e, t) => j(500, e, t), e),
1299
1368
  meta: { errorAction: "Load usage meters" }
1300
1369
  }),
1301
1370
  usageMeter: (e) => l({
@@ -1321,7 +1390,7 @@ function ee(e, t) {
1321
1390
  "summary"
1322
1391
  ],
1323
1392
  queryFn: async ({ signal: e }) => {
1324
- let t = H(await I({
1393
+ let t = U(await I({
1325
1394
  measures: [
1326
1395
  "open_findings",
1327
1396
  "orphaned_members",
@@ -1393,7 +1462,7 @@ function ee(e, t) {
1393
1462
  }),
1394
1463
  unreadNotifications: () => l({
1395
1464
  queryKey: [...R.notifications(), "count"],
1396
- queryFn: async ({ signal: e }) => Number(H(await I({
1465
+ queryFn: async ({ signal: e }) => Number(U(await I({
1397
1466
  measures: ["open_findings"],
1398
1467
  range: { last: "1d" },
1399
1468
  filters: { finding_status: ["requires_review"] }
@@ -1406,10 +1475,10 @@ function ee(e, t) {
1406
1475
  }
1407
1476
  //#endregion
1408
1477
  //#region src/admin/lib/mutations.ts
1409
- var te = 200, K = async (e) => {
1478
+ var K = 200, ne = async (e) => {
1410
1479
  let t = [], n;
1411
1480
  for (;;) {
1412
- let r = await e(te, n);
1481
+ let r = await e(K, n);
1413
1482
  if (t.push(...r.data), !r.next_cursor || r.data.length === 0) return t;
1414
1483
  n = r.next_cursor;
1415
1484
  }
@@ -1419,71 +1488,71 @@ var te = 200, K = async (e) => {
1419
1488
  }), J = (e, t) => () => q(e, t), Y = (e, t) => () => e.invalidateQueries({ queryKey: t }), X = (e, ...t) => (n) => {
1420
1489
  n instanceof x && n.code === "revision_mismatch" && Promise.all(t.map((t) => e.invalidateQueries({ queryKey: t })));
1421
1490
  };
1422
- function ne(e, t, n) {
1423
- 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, refreshPSPs: k, refundPayment: A, createPriceMigration: j, resolveFinding: 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) => {
1424
- t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: V.config().queryKey });
1425
- }, W = (e, t) => () => Promise.all([q(e, [...t.alerts(), "webhooks"]), q(e, t.settings())]);
1491
+ function re(e, t, n) {
1492
+ 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, resumeSubscription: M, revokeProductAccess: N, updateCustomer: P, updateMerchantConfiguration: F, updatePrice: I, updateProduct: L, updateWebhook: R, putDashboard: z } = t, { adminQueries: B, merchantQueryKeys: V } = n, H = (e) => (t) => {
1493
+ t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: B.config().queryKey });
1494
+ }, U = (e, t) => () => Promise.all([q(e, [...t.alerts(), "webhooks"]), q(e, t.settings())]);
1426
1495
  return { adminMutations: {
1427
1496
  saveDashboard: (e) => {
1428
- let t = H().dashboard();
1497
+ let t = V().dashboard();
1429
1498
  return c({
1430
1499
  mutationKey: [...t, "save"],
1431
- mutationFn: (e) => B(e),
1500
+ mutationFn: (e) => z(e),
1432
1501
  onSuccess: (n) => e.setQueryData(t, n)
1433
1502
  });
1434
1503
  },
1435
1504
  findCustomer: () => {
1436
- let e = H().customers();
1505
+ let e = V().customers();
1437
1506
  return c({
1438
1507
  mutationKey: [...e, "find"],
1439
1508
  mutationFn: async (e) => (await v(e, 1, "")).data[0]
1440
1509
  });
1441
1510
  },
1442
1511
  exportCustomers: () => {
1443
- let e = H().customers();
1512
+ let e = V().customers();
1444
1513
  return c({
1445
1514
  mutationKey: [...e, "export"],
1446
- mutationFn: (e) => K((t, n) => v(e, t, n ?? ""))
1515
+ mutationFn: (e) => ne((t, n) => v(e, t, n ?? ""))
1447
1516
  });
1448
1517
  },
1449
1518
  exportSubscriptions: () => {
1450
- let e = H().subscriptions();
1519
+ let e = V().subscriptions();
1451
1520
  return c({
1452
1521
  mutationKey: [...e, "export"],
1453
- mutationFn: (e) => K((t, n) => b(e, t, n))
1522
+ mutationFn: (e) => ne((t, n) => b(e, t, n))
1454
1523
  });
1455
1524
  },
1456
1525
  exportPayments: () => {
1457
- let e = H().payments();
1526
+ let e = V().payments();
1458
1527
  return c({
1459
1528
  mutationKey: [...e, "export"],
1460
1529
  mutationFn: (e) => T((t) => y(e, {
1461
- limit: te,
1530
+ limit: K,
1462
1531
  cursor: t
1463
1532
  }))
1464
1533
  });
1465
1534
  },
1466
1535
  resolveFinding: (e) => {
1467
- let t = H().ops();
1536
+ let t = V().ops();
1468
1537
  return c({
1469
1538
  mutationKey: [
1470
1539
  ...t,
1471
1540
  "findings",
1472
1541
  "resolve"
1473
1542
  ],
1474
- mutationFn: ({ id: e, outcome: t, notes: n }) => M(e, t, n),
1543
+ mutationFn: ({ id: e, outcome: t, notes: n }) => j(e, t, n),
1475
1544
  onSuccess: Y(e, t)
1476
1545
  });
1477
1546
  },
1478
1547
  refundPayment: (e, t, n, r) => {
1479
- let i = H(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
1548
+ let i = V(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
1480
1549
  return c({
1481
1550
  mutationKey: [
1482
1551
  ...a,
1483
1552
  t,
1484
1553
  "refund"
1485
1554
  ],
1486
- mutationFn: ({ amount: e, reason: n, revokeAccess: r }) => A(t, e, n, r),
1555
+ mutationFn: ({ amount: e, reason: n, revokeAccess: r }) => k(t, e, n, r),
1487
1556
  onSuccess: () => Promise.all([
1488
1557
  e.invalidateQueries({ queryKey: a }),
1489
1558
  ...o ? [e.invalidateQueries({ queryKey: o })] : [],
@@ -1492,7 +1561,7 @@ function ne(e, t, n) {
1492
1561
  });
1493
1562
  },
1494
1563
  cancelSubscription: (e, t, n) => {
1495
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1564
+ let r = V(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1496
1565
  return c({
1497
1566
  mutationKey: [
1498
1567
  ...i,
@@ -1504,19 +1573,19 @@ function ne(e, t, n) {
1504
1573
  });
1505
1574
  },
1506
1575
  resumeSubscription: (e, t, n) => {
1507
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1576
+ let r = V(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1508
1577
  return c({
1509
1578
  mutationKey: [
1510
1579
  ...i,
1511
1580
  t,
1512
1581
  "resume"
1513
1582
  ],
1514
- mutationFn: () => N(t),
1583
+ mutationFn: () => M(t),
1515
1584
  onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...a ? [e.invalidateQueries({ queryKey: a })] : []])
1516
1585
  });
1517
1586
  },
1518
1587
  changeSubscriptionPaymentMethod: (e, t, n) => {
1519
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1588
+ let r = V(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
1520
1589
  return c({
1521
1590
  mutationKey: [
1522
1591
  ...i,
@@ -1528,7 +1597,7 @@ function ne(e, t, n) {
1528
1597
  });
1529
1598
  },
1530
1599
  previewSubscriptionChange: (e) => {
1531
- let t = H().subscriptions();
1600
+ let t = V().subscriptions();
1532
1601
  return c({
1533
1602
  mutationKey: [
1534
1603
  ...t,
@@ -1540,7 +1609,7 @@ function ne(e, t, n) {
1540
1609
  });
1541
1610
  },
1542
1611
  changeSubscription: (e, t, n) => {
1543
- let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
1612
+ let r = V(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
1544
1613
  return c({
1545
1614
  mutationKey: [
1546
1615
  ...i,
@@ -1556,7 +1625,7 @@ function ne(e, t, n) {
1556
1625
  });
1557
1626
  },
1558
1627
  grantCustomerProductAccess: (e, t) => {
1559
- let n = H().customer(t);
1628
+ let n = V().customer(t);
1560
1629
  return c({
1561
1630
  mutationKey: [
1562
1631
  ...n,
@@ -1568,19 +1637,19 @@ function ne(e, t, n) {
1568
1637
  });
1569
1638
  },
1570
1639
  revokeCustomerProductAccess: (e, t) => {
1571
- let n = H().customer(t);
1640
+ let n = V().customer(t);
1572
1641
  return c({
1573
1642
  mutationKey: [
1574
1643
  ...n,
1575
1644
  "product-access",
1576
1645
  "revoke"
1577
1646
  ],
1578
- mutationFn: ({ grantId: e, reason: t }) => P(e, t),
1647
+ mutationFn: ({ grantId: e, reason: t }) => N(e, t),
1579
1648
  onSuccess: Y(e, n)
1580
1649
  });
1581
1650
  },
1582
1651
  askCatalogCopilot: () => {
1583
- let e = H();
1652
+ let e = V();
1584
1653
  return c({
1585
1654
  mutationKey: [
1586
1655
  ...e.catalog(),
@@ -1591,7 +1660,7 @@ function ne(e, t, n) {
1591
1660
  });
1592
1661
  },
1593
1662
  loadCatalogPriceDraft: () => {
1594
- let e = H();
1663
+ let e = V();
1595
1664
  return c({
1596
1665
  mutationKey: [
1597
1666
  ...e.catalog(),
@@ -1610,7 +1679,7 @@ function ne(e, t, n) {
1610
1679
  });
1611
1680
  },
1612
1681
  createCatalogDraftPrice: (e) => {
1613
- let t = H();
1682
+ let t = V();
1614
1683
  return c({
1615
1684
  mutationKey: [
1616
1685
  ...t.catalog(),
@@ -1622,23 +1691,15 @@ function ne(e, t, n) {
1622
1691
  });
1623
1692
  },
1624
1693
  applyCatalog: (e) => {
1625
- let t = H();
1694
+ let t = V();
1626
1695
  return c({
1627
1696
  mutationKey: [...t.catalog(), "apply"],
1628
1697
  mutationFn: ({ document: e, force: t }) => O(e, t),
1629
1698
  onSuccess: Y(e, t.catalog())
1630
1699
  });
1631
1700
  },
1632
- refreshPSPs: (e) => {
1633
- let t = H();
1634
- return c({
1635
- mutationKey: [...t.catalogDrift(), "refresh"],
1636
- mutationFn: () => k(),
1637
- onSuccess: Y(e, t.catalogDrift())
1638
- });
1639
- },
1640
1701
  createProduct: (e) => {
1641
- let t = H();
1702
+ let t = V();
1642
1703
  return c({
1643
1704
  mutationKey: [
1644
1705
  ...t.catalog(),
@@ -1650,27 +1711,27 @@ function ne(e, t, n) {
1650
1711
  });
1651
1712
  },
1652
1713
  updateProduct: (e) => {
1653
- let t = H();
1714
+ let t = V();
1654
1715
  return c({
1655
1716
  mutationKey: [
1656
1717
  ...t.catalog(),
1657
1718
  "products",
1658
1719
  "update"
1659
1720
  ],
1660
- mutationFn: ({ id: e, product: t }) => R(e, t),
1721
+ mutationFn: ({ id: e, product: t }) => L(e, t),
1661
1722
  onSuccess: Y(e, t.catalog()),
1662
1723
  onError: X(e, t.catalog())
1663
1724
  });
1664
1725
  },
1665
1726
  setProductActive: (e) => {
1666
- let t = H();
1727
+ let t = V();
1667
1728
  return c({
1668
1729
  mutationKey: [
1669
1730
  ...t.catalog(),
1670
1731
  "products",
1671
1732
  "set-active"
1672
1733
  ],
1673
- mutationFn: ({ id: e, active: t, revision: n }) => R(e, {
1734
+ mutationFn: ({ id: e, active: t, revision: n }) => L(e, {
1674
1735
  archived: !t,
1675
1736
  expected_revision: n
1676
1737
  }),
@@ -1679,7 +1740,7 @@ function ne(e, t, n) {
1679
1740
  });
1680
1741
  },
1681
1742
  createPrice: (e) => {
1682
- let t = H();
1743
+ let t = V();
1683
1744
  return c({
1684
1745
  mutationKey: [
1685
1746
  ...t.catalog(),
@@ -1691,14 +1752,14 @@ function ne(e, t, n) {
1691
1752
  });
1692
1753
  },
1693
1754
  setPriceActive: (e) => {
1694
- let t = H();
1755
+ let t = V();
1695
1756
  return c({
1696
1757
  mutationKey: [
1697
1758
  ...t.catalog(),
1698
1759
  "prices",
1699
1760
  "set-active"
1700
1761
  ],
1701
- mutationFn: ({ id: e, active: t, revision: n }) => L(e, {
1762
+ mutationFn: ({ id: e, active: t, revision: n }) => I(e, {
1702
1763
  archived: !t,
1703
1764
  expected_revision: n
1704
1765
  }),
@@ -1707,7 +1768,7 @@ function ne(e, t, n) {
1707
1768
  });
1708
1769
  },
1709
1770
  putUsageMeter: (e) => {
1710
- let t = H(), n = t.usageMeters();
1771
+ let t = V(), n = t.usageMeters();
1711
1772
  return c({
1712
1773
  mutationKey: [...n, "put"],
1713
1774
  mutationFn: ({ key: e, meter: t }) => w(e, t),
@@ -1716,7 +1777,7 @@ function ne(e, t, n) {
1716
1777
  });
1717
1778
  },
1718
1779
  putDefaultUsageRateCard: (e) => {
1719
- let t = H(), n = t.usageMeters();
1780
+ let t = V(), n = t.usageMeters();
1720
1781
  return c({
1721
1782
  mutationKey: [
1722
1783
  ...n,
@@ -1729,7 +1790,7 @@ function ne(e, t, n) {
1729
1790
  });
1730
1791
  },
1731
1792
  deleteDefaultUsageRateCard: (e) => {
1732
- let t = H(), n = t.usageMeters();
1793
+ let t = V(), n = t.usageMeters();
1733
1794
  return c({
1734
1795
  mutationKey: [
1735
1796
  ...n,
@@ -1741,7 +1802,7 @@ function ne(e, t, n) {
1741
1802
  });
1742
1803
  },
1743
1804
  previewPriceChange: () => {
1744
- let e = H();
1805
+ let e = V();
1745
1806
  return c({
1746
1807
  mutationKey: [
1747
1808
  ...e.catalog(),
@@ -1752,7 +1813,7 @@ function ne(e, t, n) {
1752
1813
  });
1753
1814
  },
1754
1815
  changePrice: (e) => {
1755
- let t = H();
1816
+ let t = V();
1756
1817
  return c({
1757
1818
  mutationKey: [
1758
1819
  ...t.catalog(),
@@ -1761,13 +1822,13 @@ function ne(e, t, n) {
1761
1822
  ],
1762
1823
  mutationFn: async ({ price: e, migration: t }) => {
1763
1824
  let n = await u(e);
1764
- return t && await j(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
1825
+ return t && await A(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
1765
1826
  },
1766
1827
  onSettled: Y(e, t.catalog())
1767
1828
  });
1768
1829
  },
1769
1830
  cancelPriceMigration: (e) => {
1770
- let t = H();
1831
+ let t = V();
1771
1832
  return c({
1772
1833
  mutationKey: [
1773
1834
  ...t.catalog(),
@@ -1779,16 +1840,16 @@ function ne(e, t, n) {
1779
1840
  });
1780
1841
  },
1781
1842
  updateMerchantConfiguration: (e) => {
1782
- let t = H();
1843
+ let t = V();
1783
1844
  return c({
1784
1845
  mutationKey: [...t.settings(), "update"],
1785
- mutationFn: (e) => I(e),
1846
+ mutationFn: (e) => F(e),
1786
1847
  onSettled: J(e, t.settings()),
1787
- onError: U(e)
1848
+ onError: H(e)
1788
1849
  });
1789
1850
  },
1790
1851
  createPSP: (e) => {
1791
- let t = r(), n = H();
1852
+ let t = r(), n = V();
1792
1853
  return c({
1793
1854
  mutationKey: [
1794
1855
  ...n.settings(),
@@ -1802,11 +1863,11 @@ function ne(e, t, n) {
1802
1863
  return p(e);
1803
1864
  },
1804
1865
  onSettled: J(e, [...n.settings(), "psps"]),
1805
- onError: U(e)
1866
+ onError: H(e)
1806
1867
  });
1807
1868
  },
1808
1869
  updatePSP: (e) => {
1809
- let t = r(), n = H();
1870
+ let t = r(), n = V();
1810
1871
  return c({
1811
1872
  mutationKey: [
1812
1873
  ...n.settings(),
@@ -1820,25 +1881,25 @@ function ne(e, t, n) {
1820
1881
  return C(e, n);
1821
1882
  },
1822
1883
  onSettled: J(e, [...n.settings(), "psps"]),
1823
- onError: U(e)
1884
+ onError: H(e)
1824
1885
  });
1825
1886
  },
1826
1887
  setCreditLimit: () => {
1827
- let e = H();
1888
+ let e = V();
1828
1889
  return c({
1829
1890
  mutationKey: [
1830
1891
  ...e.settings(),
1831
1892
  "customer-controls",
1832
1893
  "credit-limit"
1833
1894
  ],
1834
- mutationFn: ({ customerId: e, currency: t, amount: n }) => F(e, { credit_limits: [{
1895
+ mutationFn: ({ customerId: e, currency: t, amount: n }) => P(e, { credit_limits: [{
1835
1896
  currency: t,
1836
1897
  amount: n
1837
1898
  }] })
1838
1899
  });
1839
1900
  },
1840
1901
  lookupCustomerControls: () => {
1841
- let e = H();
1902
+ let e = V();
1842
1903
  return c({
1843
1904
  mutationKey: [
1844
1905
  ...e.settings(),
@@ -1858,7 +1919,7 @@ function ne(e, t, n) {
1858
1919
  });
1859
1920
  },
1860
1921
  createWebhook: (e) => {
1861
- let t = H();
1922
+ let t = V();
1862
1923
  return c({
1863
1924
  mutationKey: [
1864
1925
  ...t.alerts(),
@@ -1866,25 +1927,25 @@ function ne(e, t, n) {
1866
1927
  "create"
1867
1928
  ],
1868
1929
  mutationFn: (e) => f(e),
1869
- onSuccess: W(e, t),
1870
- onError: U(e)
1930
+ onSuccess: U(e, t),
1931
+ onError: H(e)
1871
1932
  });
1872
1933
  },
1873
1934
  updateWebhook: (e) => {
1874
- let t = H();
1935
+ let t = V();
1875
1936
  return c({
1876
1937
  mutationKey: [
1877
1938
  ...t.alerts(),
1878
1939
  "webhooks",
1879
1940
  "update"
1880
1941
  ],
1881
- mutationFn: ({ id: e, webhook: t }) => z(e, t),
1882
- onSuccess: W(e, t),
1883
- onError: U(e)
1942
+ mutationFn: ({ id: e, webhook: t }) => R(e, t),
1943
+ onSuccess: U(e, t),
1944
+ onError: H(e)
1884
1945
  });
1885
1946
  },
1886
1947
  deleteWebhook: (e) => {
1887
- let t = H();
1948
+ let t = V();
1888
1949
  return c({
1889
1950
  mutationKey: [
1890
1951
  ...t.alerts(),
@@ -1892,15 +1953,15 @@ function ne(e, t, n) {
1892
1953
  "delete"
1893
1954
  ],
1894
1955
  mutationFn: (e) => m(e),
1895
- onSuccess: W(e, t),
1896
- onError: U(e)
1956
+ onSuccess: U(e, t),
1957
+ onError: H(e)
1897
1958
  });
1898
1959
  }
1899
1960
  } };
1900
1961
  }
1901
1962
  //#endregion
1902
1963
  //#region src/admin/lib/credit-queries.ts
1903
- function re(e, t) {
1964
+ function Z(e, t) {
1904
1965
  let { selectedMerchant: n } = e, r = (t, n) => [
1905
1966
  ...e.queryRoot(t),
1906
1967
  "customers",
@@ -2018,29 +2079,220 @@ function ie(e, t, n) {
2018
2079
  };
2019
2080
  }
2020
2081
  //#endregion
2082
+ //#region src/admin/lib/import-queries.ts
2083
+ var ae = (e) => e === "pulling" || e === "applying", oe = 2e3, se = (e) => ({
2084
+ imports: () => [...e(), "psp-imports"],
2085
+ import: (t) => [
2086
+ ...e(),
2087
+ "psp-imports",
2088
+ t
2089
+ ],
2090
+ providerCatalog: () => [...e(), "provider-catalog"],
2091
+ parked: () => [...e(), "parked"],
2092
+ proposals: () => [...e(), "proposals"],
2093
+ catalog: () => [...e(), "catalog"],
2094
+ ops: () => [...e(), "ops"]
2095
+ });
2096
+ function ce(e, t) {
2097
+ let { queryRoot: n } = e, r = se(n), i = () => {
2098
+ let e = n();
2099
+ return se(() => e);
2100
+ };
2101
+ return {
2102
+ importKeys: r,
2103
+ importQueries: {
2104
+ list: (e, n, i) => l({
2105
+ queryKey: [
2106
+ ...r.imports(),
2107
+ "list",
2108
+ e,
2109
+ n,
2110
+ i
2111
+ ],
2112
+ queryFn: ({ signal: r }) => t.listPSPImports(e, {
2113
+ limit: n,
2114
+ cursor: i
2115
+ }, r),
2116
+ placeholderData: s,
2117
+ refetchInterval: (e) => e.state.data?.data.some((e) => ae(e.status)) ? oe : !1,
2118
+ meta: { errorAction: "Load PSP imports" }
2119
+ }),
2120
+ latest: (e) => l({
2121
+ queryKey: [
2122
+ ...r.imports(),
2123
+ "latest",
2124
+ e
2125
+ ],
2126
+ queryFn: async ({ signal: n }) => (await t.listPSPImports({ psp: e }, { limit: 1 }, n)).data[0] ?? null,
2127
+ enabled: !!e
2128
+ }),
2129
+ detail: (e) => l({
2130
+ queryKey: r.import(e),
2131
+ queryFn: ({ signal: n }) => t.getPSPImport(e, n),
2132
+ enabled: !!e,
2133
+ refetchInterval: (e) => ae(e.state.data?.status) ? oe : !1,
2134
+ meta: { errorAction: "Load PSP import" }
2135
+ }),
2136
+ records: (e, n, i, a, o) => l({
2137
+ queryKey: [
2138
+ ...r.import(e),
2139
+ "records",
2140
+ n,
2141
+ i,
2142
+ a,
2143
+ o
2144
+ ],
2145
+ queryFn: ({ signal: r }) => t.listPSPImportRecords(e, n, {
2146
+ limit: i,
2147
+ cursor: a
2148
+ }, r),
2149
+ enabled: !!(e && o),
2150
+ placeholderData: s,
2151
+ meta: { errorAction: "Load import records" }
2152
+ }),
2153
+ providerCatalog: (e, n, i) => l({
2154
+ queryKey: [
2155
+ ...r.providerCatalog(),
2156
+ e,
2157
+ n,
2158
+ i
2159
+ ],
2160
+ queryFn: ({ signal: r }) => t.listProviderCatalog(e, {
2161
+ limit: n,
2162
+ cursor: i
2163
+ }, r),
2164
+ enabled: !!e.psp,
2165
+ placeholderData: s,
2166
+ meta: { errorAction: "Load provider prices" }
2167
+ }),
2168
+ providerPrice: (e, n) => l({
2169
+ queryKey: [
2170
+ ...r.providerCatalog(),
2171
+ "price",
2172
+ e,
2173
+ n
2174
+ ],
2175
+ queryFn: async ({ signal: r }) => (await T((n) => t.listProviderCatalog({
2176
+ psp: e,
2177
+ kind: "price"
2178
+ }, {
2179
+ limit: 500,
2180
+ cursor: n
2181
+ }, r), r)).find((e) => e.ref === n) ?? null,
2182
+ enabled: !!(e && n),
2183
+ meta: { errorAction: "Load provider price" }
2184
+ }),
2185
+ parked: (e, n, i) => l({
2186
+ queryKey: [
2187
+ ...r.parked(),
2188
+ e,
2189
+ n,
2190
+ i
2191
+ ],
2192
+ queryFn: ({ signal: r }) => t.listParkedSubscriptions(e, {
2193
+ limit: n,
2194
+ cursor: i
2195
+ }, r),
2196
+ placeholderData: s,
2197
+ meta: { errorAction: "Load parked subscriptions" }
2198
+ }),
2199
+ proposals: (e) => l({
2200
+ queryKey: [...r.proposals(), e],
2201
+ queryFn: ({ signal: n }) => T((r) => t.listProposals(e, e.ids ? {} : {
2202
+ limit: 500,
2203
+ cursor: r
2204
+ }, n), n),
2205
+ meta: { errorAction: "Load proposals" }
2206
+ }),
2207
+ customers: (e) => l({
2208
+ queryKey: [
2209
+ ...n(),
2210
+ "customers",
2211
+ "ids",
2212
+ e
2213
+ ],
2214
+ queryFn: ({ signal: n }) => t.customersByIds(e, n),
2215
+ enabled: e.length > 0
2216
+ })
2217
+ },
2218
+ importMutations: {
2219
+ create: (e) => {
2220
+ let n = i();
2221
+ return c({
2222
+ mutationFn: (e) => t.createPSPImport(e),
2223
+ onSuccess: () => e.invalidateQueries({ queryKey: n.imports() })
2224
+ });
2225
+ },
2226
+ link: (e) => {
2227
+ let n = i();
2228
+ return c({
2229
+ mutationFn: ({ id: e, params: n }) => t.linkPSPImport(e, n),
2230
+ onSuccess: (t, { id: r }) => e.invalidateQueries({ queryKey: n.import(r) })
2231
+ });
2232
+ },
2233
+ apply: (e) => {
2234
+ let n = i();
2235
+ return c({
2236
+ mutationFn: (e) => t.applyPSPImport(e),
2237
+ onSuccess: () => e.invalidateQueries({ queryKey: n.imports() })
2238
+ });
2239
+ },
2240
+ setMappings: () => c({ mutationFn: (e) => t.setPSPImportMappings(e) }),
2241
+ mapPrice: (e) => {
2242
+ let n = i();
2243
+ return c({
2244
+ mutationFn: (e) => t.createProviderPrice(e),
2245
+ onSuccess: () => Promise.all([
2246
+ n.providerCatalog(),
2247
+ n.parked(),
2248
+ n.imports(),
2249
+ n.catalog(),
2250
+ n.ops()
2251
+ ].map((t) => e.invalidateQueries({ queryKey: t })))
2252
+ });
2253
+ },
2254
+ decide: (e) => {
2255
+ let n = i();
2256
+ return c({
2257
+ mutationFn: ({ action: e, ids: n, notes: r, key: i }) => e === "approve" ? t.approveProposals(n, r, i) : t.dismissProposals(n, r),
2258
+ onSettled: () => Promise.all([n.imports(), n.ops()].map((t) => e.invalidateQueries({ queryKey: t })))
2259
+ });
2260
+ },
2261
+ dismissPrice: (e) => {
2262
+ let n = i();
2263
+ return c({
2264
+ mutationFn: ({ finding: e, notes: n }) => t.resolveFinding(e, "ignore", n),
2265
+ onSuccess: () => Promise.all([n.providerCatalog(), n.ops()].map((t) => e.invalidateQueries({ queryKey: t })))
2266
+ });
2267
+ }
2268
+ }
2269
+ };
2270
+ }
2271
+ //#endregion
2021
2272
  //#region src/admin/context.tsx
2022
- function Z(e) {
2023
- let t = E(e), n = z(t), r = ee(t, n), i = B(e.namespace);
2273
+ function le(e) {
2274
+ let t = E(e), n = B(t), r = te(t, n), i = V(e.namespace);
2024
2275
  return {
2025
2276
  toast: i,
2026
- ...V(i),
2277
+ ...H(i),
2027
2278
  ...t,
2028
2279
  ...n,
2029
2280
  ...r,
2030
- ...ne(t, n, r),
2031
- ...re(t, n),
2032
- ...ie(t, n, r)
2281
+ ...re(t, n, r),
2282
+ ...Z(t, n),
2283
+ ...ie(t, n, r),
2284
+ ...ce(t, n)
2033
2285
  };
2034
2286
  }
2035
- var ae = e(null);
2036
- function oe() {
2037
- let e = n(ae);
2287
+ var ue = e(null);
2288
+ function de() {
2289
+ let e = n(ue);
2038
2290
  if (!e) throw Error("BillingAdmin context is missing");
2039
2291
  return e;
2040
2292
  }
2041
- var se = () => oe().services, Q = e(null), ce = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), le = () => window.location.pathname + window.location.search;
2042
- function ue({ basePath: e = "/", navigation: n, children: r }) {
2043
- let s = o(ce, le, () => 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) => {
2293
+ var fe = () => de().services, Q = e(null), pe = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), me = () => window.location.pathname + window.location.search;
2294
+ function he({ basePath: e = "/", navigation: n, children: r }) {
2295
+ let s = o(pe, me, () => 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) => {
2044
2296
  if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(e)) return e;
2045
2297
  let t = new URL(e, "http://billing.local" + p + f);
2046
2298
  return c + t.pathname + t.search + t.hash;
@@ -2087,15 +2339,15 @@ function $() {
2087
2339
  if (!e) throw Error("BillingAdmin router is missing");
2088
2340
  return e;
2089
2341
  }
2090
- var de = () => $().location, fe = () => $().navigate, pe = () => $().params;
2091
- function me() {
2342
+ var ge = () => $().location, _e = () => $().navigate, ve = () => $().params;
2343
+ function ye() {
2092
2344
  let { location: e, navigate: t } = $();
2093
2345
  return [i(() => new URLSearchParams(e.search), [e.search]), (n, r) => {
2094
2346
  let i = new URLSearchParams(n).toString();
2095
2347
  t(e.pathname + (i ? "?" + i : ""), r);
2096
2348
  }];
2097
2349
  }
2098
- function he({ to: e, onClick: t, ...n }) {
2350
+ function be({ to: e, onClick: t, ...n }) {
2099
2351
  let { href: r, navigate: i } = $();
2100
2352
  return /* @__PURE__ */ d("a", {
2101
2353
  ...n,
@@ -2105,15 +2357,15 @@ function he({ to: e, onClick: t, ...n }) {
2105
2357
  }
2106
2358
  });
2107
2359
  }
2108
- function ge({ to: e, replace: t }) {
2109
- let n = fe();
2360
+ function xe({ to: e, replace: t }) {
2361
+ let n = _e();
2110
2362
  return r(() => n(e, { replace: t }), [
2111
2363
  n,
2112
2364
  e,
2113
2365
  t
2114
2366
  ]), null;
2115
2367
  }
2116
- function _e({ params: e, children: t }) {
2368
+ function Se({ params: e, children: t }) {
2117
2369
  let n = $();
2118
2370
  return /* @__PURE__ */ d(Q.Provider, {
2119
2371
  value: {
@@ -2125,10 +2377,10 @@ function _e({ params: e, children: t }) {
2125
2377
  }
2126
2378
  //#endregion
2127
2379
  //#region src/admin/lib/utils.ts
2128
- function ve(...e) {
2380
+ function Ce(...e) {
2129
2381
  return p(f(e));
2130
2382
  }
2131
2383
  //#endregion
2132
- export { E as C, h as E, x as S, m as T, M as _, _e as a, A as b, pe as c, Z as d, oe as f, z as g, V as h, ge as i, me as l, B as m, ue as n, de as o, se as p, he as r, fe as s, ve as t, ae as u, D as v, g as w, k as x, O as y };
2384
+ export { x as C, h as D, m as E, k as S, g as T, B as _, Se as a, O as b, ve as c, le as d, de as f, H as g, V as h, xe as i, ye as l, ae as m, he as n, ge as o, fe as p, be as r, _e as s, Ce as t, ue as u, M as v, E as w, A as x, D as y };
2133
2385
 
2134
- //# sourceMappingURL=admin-utils-6yE4YIVI.js.map
2386
+ //# sourceMappingURL=admin-utils-B9eEBNsR.js.map