@cedros/pay-react 1.1.30 → 1.1.32

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 (136) hide show
  1. package/README.md +53 -30
  2. package/dist/{AISettingsSection-BMh3hAb5.mjs → AISettingsSection-ChBtZVz7.mjs} +4 -4
  3. package/dist/{AISettingsSection-C0zqPbd6.js → AISettingsSection-DSROL7Lg.js} +2 -2
  4. package/dist/{AutosaveIndicator-3ctAnz8Y.mjs → AutosaveIndicator-BTa2YPNH.mjs} +1 -1
  5. package/dist/AutosaveIndicator-BgDnlrCW.js +1 -0
  6. package/dist/CedrosContext-3Dz7_9Ct.js +3 -0
  7. package/dist/{CedrosContext-5Gjveoba.mjs → CedrosContext-DQc_k5PG.mjs} +430 -314
  8. package/dist/ChatLogsSection-B5AdoZls.js +1 -0
  9. package/dist/{ChatLogsSection-BtJixYAp.mjs → ChatLogsSection-D8FX7Dmn.mjs} +2 -2
  10. package/dist/{ComplianceSection-BMnb1p4w.mjs → ComplianceSection-A1hgI_X2.mjs} +3 -3
  11. package/dist/ComplianceSection-UWfkNrmW.js +1 -0
  12. package/dist/CryptoButton-BQceZhbn.js +1 -0
  13. package/dist/{CryptoButton-Cl2kZbOP.mjs → CryptoButton-BuO_RZLj.mjs} +4 -5
  14. package/dist/{CustomersSection-dmwoBhcf.mjs → CustomersSection-BuSVgS16.mjs} +2 -2
  15. package/dist/CustomersSection-Rh552kcC.js +1 -0
  16. package/dist/DisputesSection-BtMdxOuD.js +1 -0
  17. package/dist/{DisputesSection-CHyLne76.mjs → DisputesSection-DqWrBCyC.mjs} +2 -2
  18. package/dist/Dropdown-CWYy2Rtt.js +1 -0
  19. package/dist/{Dropdown-BRSZlhik.mjs → Dropdown-DHCHYuTB.mjs} +1 -1
  20. package/dist/{ErrorBanner-lZJhCmDX.mjs → ErrorBanner-7naZtdtD.mjs} +1 -1
  21. package/dist/ErrorBanner-BOS1XAPu.js +1 -0
  22. package/dist/FAQSection-DczKj0C3.js +1 -0
  23. package/dist/{FAQSection-Di2xE9Sm.mjs → FAQSection-x0ya8PvI.mjs} +3 -3
  24. package/dist/{ImagesSection-D63PEjR6.mjs → ImagesSection-CMvHgbtL.mjs} +2 -2
  25. package/dist/ImagesSection-tRpBN-ls.js +1 -0
  26. package/dist/{InventorySection-Dp5Yu4TA.mjs → InventorySection-5PEOXciZ.mjs} +2 -2
  27. package/dist/InventorySection-clEVFr_r.js +1 -0
  28. package/dist/MessagingSection-BpwTsNW1.js +1 -0
  29. package/dist/{MessagingSection-BLCnCpEv.mjs → MessagingSection-Bt84iW-5.mjs} +3 -3
  30. package/dist/OrdersSection-Bsou3cwl.js +1 -0
  31. package/dist/{OrdersSection-Bd56F3cj.mjs → OrdersSection-kJzPO6CP.mjs} +2 -2
  32. package/dist/{PaymentSettingsSection-B5J56VAk.js → PaymentSettingsSection-CUgUJ7tm.js} +1 -1
  33. package/dist/{PaymentSettingsSection-52iw47Su.mjs → PaymentSettingsSection-s_XMFPik.mjs} +3 -3
  34. package/dist/{ReturnsSection-DUVeKrCd.mjs → ReturnsSection-BcwsQbrU.mjs} +2 -2
  35. package/dist/ReturnsSection-BwHv1HkV.js +1 -0
  36. package/dist/{SettingsSection-DKkHykaC.js → SettingsSection-B_feZEzU.js} +1 -1
  37. package/dist/{SettingsSection-vK9WIwXE.mjs → SettingsSection-OI1G3b40.mjs} +1 -1
  38. package/dist/{ShippingSection-CZRrXrlh.mjs → ShippingSection-B2GtSEvn.mjs} +2 -2
  39. package/dist/ShippingSection-DyTGH_Fh.js +1 -0
  40. package/dist/{SingleCategorySettings-C8xJ47_T.mjs → SingleCategorySettings-Cd76sY00.mjs} +4 -4
  41. package/dist/SingleCategorySettings-Ci6hJ0Xu.js +3 -0
  42. package/dist/{StatsBar-D4cOKG2e.mjs → StatsBar-B_lf0ph0.mjs} +1 -1
  43. package/dist/StatsBar-CVqsD8j2.js +1 -0
  44. package/dist/StorefrontSection-BxaWrsPc.js +1 -0
  45. package/dist/{StorefrontSection-uXSVbEAa.mjs → StorefrontSection-DW0q9GsC.mjs} +4 -4
  46. package/dist/{SubscriptionsSection-Ci_AZrWA.mjs → SubscriptionsSection-CNHPCync.mjs} +3 -3
  47. package/dist/SubscriptionsSection-QMoSKKot.js +1 -0
  48. package/dist/TaxSection-BKhh7kOv.js +1 -0
  49. package/dist/{TaxSection-BTukS_cU.mjs → TaxSection-BwLpiery.mjs} +2 -2
  50. package/dist/Token22Section-B_URxab9.js +1 -0
  51. package/dist/{Token22Section-DRsPJuTq.mjs → Token22Section-DyNDKGdU.mjs} +227 -212
  52. package/dist/{WalletManager-D-eoqUDy.mjs → WalletManager-CGR69MiR.mjs} +1 -1
  53. package/dist/{WalletManager-DXChB9LA.js → WalletManager-ZJbGQHrn.js} +1 -1
  54. package/dist/WebhooksSection-BIs2Qh-o.js +1 -0
  55. package/dist/{WebhooksSection-A8Y4ZGcj.mjs → WebhooksSection-bDVQE9Qp.mjs} +2 -2
  56. package/dist/admin.js +1 -1
  57. package/dist/admin.mjs +1 -1
  58. package/dist/crypto-only.js +1 -1
  59. package/dist/crypto-only.mjs +102 -105
  60. package/dist/{index-9QF_UfSN.mjs → index-CU6M10Rs.mjs} +13 -14
  61. package/dist/{index-Cq9ya93W.js → index-DVxx_62C.js} +10 -10
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +31 -34
  64. package/dist/pay-react.css +1 -1
  65. package/dist/plugin-CuoGEYWr.mjs +339 -0
  66. package/dist/plugin-DNhaPAbC.js +1 -0
  67. package/dist/sections-BYdyCKFF.js +1 -0
  68. package/dist/{sections-more-Ixw6mM6R.mjs → sections-vLd_ind5.mjs} +263 -270
  69. package/dist/src/admin/plugin.d.ts.map +1 -1
  70. package/dist/src/admin/sectionIds.d.ts.map +1 -1
  71. package/dist/src/admin.d.ts +0 -7
  72. package/dist/src/admin.d.ts.map +1 -1
  73. package/dist/src/components/admin/LiquidityPoolTab.d.ts.map +1 -1
  74. package/dist/src/components/admin/PoolManagementView.d.ts.map +1 -1
  75. package/dist/src/components/admin/index.d.ts +0 -1
  76. package/dist/src/components/admin/index.d.ts.map +1 -1
  77. package/dist/src/index.d.ts +0 -1
  78. package/dist/src/index.d.ts.map +1 -1
  79. package/dist/src/managers/MeteoraPoolManager.d.ts.map +1 -1
  80. package/dist/src/utils/optionalPeerImport.d.ts +6 -0
  81. package/dist/src/utils/optionalPeerImport.d.ts.map +1 -0
  82. package/dist/stripe-only.js +1 -1
  83. package/dist/stripe-only.mjs +18 -19
  84. package/dist/styles-BwaDljnz.js +1 -0
  85. package/dist/{styles-DGagylUj.mjs → styles-fihm6qVA.mjs} +51 -52
  86. package/dist/testing/index.js +1 -1
  87. package/dist/testing/index.mjs +1 -1
  88. package/package.json +6 -8
  89. package/dist/AutosaveIndicator-DXRPr4P7.js +0 -1
  90. package/dist/CedrosContext-CCakH2SZ.js +0 -3
  91. package/dist/CedrosPayAdminDashboard-DaJ9JoGn.mjs +0 -250
  92. package/dist/CedrosPayAdminDashboard-Uvyh9p7A.js +0 -1
  93. package/dist/ChatLogsSection-FC3O536G.js +0 -1
  94. package/dist/ComplianceSection-BioTKm7k.js +0 -1
  95. package/dist/CryptoButton-DxFCYDlJ.js +0 -1
  96. package/dist/CustomersSection-z6ARxuex.js +0 -1
  97. package/dist/DisputesSection-BjHHQAi7.js +0 -1
  98. package/dist/Dropdown-j8o0OO5L.js +0 -1
  99. package/dist/ErrorBanner-CAgPnj62.js +0 -1
  100. package/dist/FAQSection-b34DMzgV.js +0 -1
  101. package/dist/ImagesSection-DGBA7iKY.js +0 -1
  102. package/dist/InventorySection-bVCECzX5.js +0 -1
  103. package/dist/LazyCedrosPayAdminDashboard-BqJDNrDI.mjs +0 -9
  104. package/dist/LazyCedrosPayAdminDashboard-CpfTtOBc.js +0 -1
  105. package/dist/MessagingSection-DU0dYNMy.js +0 -1
  106. package/dist/OrdersSection-FOFEAgs1.js +0 -1
  107. package/dist/ReturnsSection-BjpIVFfN.js +0 -1
  108. package/dist/ShippingSection-B5lk7zpS.js +0 -1
  109. package/dist/SingleCategorySettings-g7D-9lG1.js +0 -3
  110. package/dist/StatsBar-CWXw2ZT3.js +0 -1
  111. package/dist/StorefrontSection-BWnMB9k-.js +0 -1
  112. package/dist/SubscriptionsSection-DQfXkuDv.js +0 -1
  113. package/dist/TaxSection-cuPQISxZ.js +0 -1
  114. package/dist/ThemeContext-CFXyYx7A.js +0 -1
  115. package/dist/ThemeContext-l0bqcOGW.mjs +0 -126
  116. package/dist/Token22Section-CCfkDm8W.js +0 -1
  117. package/dist/WebhooksSection-CnEmaGH1.js +0 -1
  118. package/dist/icons-C3yDMnKE.mjs +0 -235
  119. package/dist/icons-Cjgd9YVo.js +0 -1
  120. package/dist/pay-react_false-CPX8Vyp9.mjs +0 -5
  121. package/dist/pay-react_false-DaeIe3_l.js +0 -1
  122. package/dist/sectionIds-D46-_-h-.js +0 -1
  123. package/dist/sectionIds-YktNxmRt.mjs +0 -124
  124. package/dist/sections-511_XBh4.js +0 -1
  125. package/dist/sections-CRaMa8ZB.mjs +0 -9
  126. package/dist/sections-more-Cgw2qJlA.js +0 -1
  127. package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts +0 -40
  128. package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +0 -1
  129. package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts +0 -4
  130. package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts.map +0 -1
  131. package/dist/src/standalone-admin.d.ts +0 -8
  132. package/dist/src/standalone-admin.d.ts.map +0 -1
  133. package/dist/standalone-admin.d.ts +0 -2
  134. package/dist/standalone-admin.js +0 -1
  135. package/dist/standalone-admin.mjs +0 -4
  136. package/dist/styles--fxb3lCl.js +0 -1
@@ -1,18 +1,18 @@
1
1
  import { jsxs as t, jsx as e, Fragment as me } from "react/jsx-runtime";
2
- import { useState as S, useCallback as B, useMemo as H, useEffect as Y, Suspense as ke, lazy as Se } from "react";
3
- import { I as L } from "./icons-C3yDMnKE.mjs";
4
- import { E as re } from "./ErrorBanner-lZJhCmDX.mjs";
5
- import { S as pe } from "./StatsBar-D4cOKG2e.mjs";
6
- import { a as Ne, F as Q } from "./Dropdown-BRSZlhik.mjs";
2
+ import { useState as S, useCallback as B, useMemo as H, useEffect as Y } from "react";
3
+ import { I as L } from "./plugin-CuoGEYWr.mjs";
4
+ import { E as re } from "./ErrorBanner-7naZtdtD.mjs";
5
+ import { S as pe } from "./StatsBar-B_lf0ph0.mjs";
6
+ import { a as Ne, F as Q } from "./Dropdown-DHCHYuTB.mjs";
7
7
  import { f as he } from "./dateHelpers-yvPkofYQ.mjs";
8
8
  import { g as se } from "./fetchWithTimeout-DmMOwL0Q.mjs";
9
- function Ae({
10
- serverUrl: p,
9
+ function ke({
10
+ serverUrl: y,
11
11
  productId: r,
12
12
  apiKey: v,
13
13
  authManager: u
14
14
  }) {
15
- const [g, T] = S(null), [A, $] = S(!1), [_, U] = S(!1), [w, C] = S(null), I = B(async () => {
15
+ const [p, T] = S(null), [A, $] = S(!1), [g, U] = S(!1), [w, C] = S(null), I = B(async () => {
16
16
  if (r) {
17
17
  $(!0), C(null);
18
18
  try {
@@ -24,7 +24,7 @@ function Ae({
24
24
  else {
25
25
  const s = { "Content-Type": "application/json" };
26
26
  v && (s["X-API-Key"] = v);
27
- const l = await fetch(`${p}/admin/products/${r}/variations`, {
27
+ const l = await fetch(`${y}/admin/products/${r}/variations`, {
28
28
  headers: s
29
29
  });
30
30
  if (!l.ok)
@@ -43,7 +43,7 @@ function Ae({
43
43
  $(!1);
44
44
  }
45
45
  }
46
- }, [p, r, v, u]), F = B(
46
+ }, [y, r, v, u]), F = B(
47
47
  async (c) => {
48
48
  if (!r) return null;
49
49
  U(!0), C(null);
@@ -60,7 +60,7 @@ function Ae({
60
60
  else {
61
61
  const l = { "Content-Type": "application/json" };
62
62
  v && (l["X-API-Key"] = v);
63
- const k = await fetch(`${p}/admin/products/${r}/variations`, {
63
+ const k = await fetch(`${y}/admin/products/${r}/variations`, {
64
64
  method: "PUT",
65
65
  headers: l,
66
66
  body: JSON.stringify(c)
@@ -81,8 +81,8 @@ function Ae({
81
81
  U(!1);
82
82
  }
83
83
  },
84
- [p, r, v, u]
85
- ), f = B(
84
+ [y, r, v, u]
85
+ ), _ = B(
86
86
  async (c) => {
87
87
  if (!r || c.length === 0) return !1;
88
88
  U(!0), C(null);
@@ -98,7 +98,7 @@ function Ae({
98
98
  else {
99
99
  const s = { "Content-Type": "application/json" };
100
100
  v && (s["X-API-Key"] = v);
101
- const l = await fetch(`${p}/admin/products/${r}/variants/inventory`, {
101
+ const l = await fetch(`${y}/admin/products/${r}/variants/inventory`, {
102
102
  method: "PUT",
103
103
  headers: s,
104
104
  body: JSON.stringify({ updates: c })
@@ -106,11 +106,11 @@ function Ae({
106
106
  if (!l.ok)
107
107
  throw new Error(`Failed to update inventory: ${l.status}`);
108
108
  }
109
- if (g) {
109
+ if (p) {
110
110
  const s = new Map(c.map((l) => [l.variantId, l]));
111
111
  T({
112
- ...g,
113
- variants: g.variants.map((l) => {
112
+ ...p,
113
+ variants: p.variants.map((l) => {
114
114
  const k = s.get(l.id);
115
115
  return k ? {
116
116
  ...l,
@@ -128,58 +128,58 @@ function Ae({
128
128
  U(!1);
129
129
  }
130
130
  },
131
- [p, r, v, u, g]
131
+ [y, r, v, u, p]
132
132
  );
133
133
  return {
134
- data: g,
134
+ data: p,
135
135
  isLoading: A,
136
136
  error: w,
137
137
  fetch: I,
138
138
  save: F,
139
- bulkUpdateInventory: f,
140
- isSaving: _
139
+ bulkUpdateInventory: _,
140
+ isSaving: g
141
141
  };
142
142
  }
143
143
  function be() {
144
144
  return `var_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
145
145
  }
146
- function we({
147
- value: p,
146
+ function Se({
147
+ value: y,
148
148
  onChange: r,
149
149
  maxTypes: v = 5,
150
150
  maxValuesPerType: u = 20,
151
- disabled: g = !1
151
+ disabled: p = !1
152
152
  }) {
153
- const [T, A] = S(null), [$, _] = S(""), [U, w] = S({}), C = p.variationTypes, I = B(() => {
153
+ const [T, A] = S(null), [$, g] = S(""), [U, w] = S({}), C = y.variationTypes, I = B(() => {
154
154
  if (!$.trim() || C.length >= v) return;
155
- const y = {
155
+ const f = {
156
156
  id: be(),
157
157
  name: $.trim(),
158
158
  displayOrder: C.length,
159
159
  values: []
160
160
  };
161
161
  r({
162
- variationTypes: [...C, y]
163
- }), _(""), A(y.id);
162
+ variationTypes: [...C, f]
163
+ }), g(""), A(f.id);
164
164
  }, [$, C, v, r]), F = B(
165
- (y) => {
165
+ (f) => {
166
166
  r({
167
- variationTypes: C.filter((D) => D.id !== y).map((D, N) => ({ ...D, displayOrder: N }))
168
- }), T === y && A(null);
167
+ variationTypes: C.filter((D) => D.id !== f).map((D, N) => ({ ...D, displayOrder: N }))
168
+ }), T === f && A(null);
169
169
  },
170
170
  [C, r, T]
171
- ), f = B(
172
- (y, D) => {
171
+ ), _ = B(
172
+ (f, D) => {
173
173
  r({
174
174
  variationTypes: C.map(
175
- (N) => N.id === y ? { ...N, name: D } : N
175
+ (N) => N.id === f ? { ...N, name: D } : N
176
176
  )
177
177
  });
178
178
  },
179
179
  [C, r]
180
180
  ), c = B(
181
- (y, D) => {
182
- const N = C.findIndex((x) => x.id === y);
181
+ (f, D) => {
182
+ const N = C.findIndex((x) => x.id === f);
183
183
  if (N === -1 || D === "up" && N === 0 || D === "down" && N === C.length - 1) return;
184
184
  const i = [...C], h = D === "up" ? N - 1 : N + 1;
185
185
  [i[N], i[h]] = [i[h], i[N]], r({
@@ -188,10 +188,10 @@ function we({
188
188
  },
189
189
  [C, r]
190
190
  ), s = B(
191
- (y) => {
192
- const D = (U[y] || "").trim();
191
+ (f) => {
192
+ const D = (U[f] || "").trim();
193
193
  if (!D) return;
194
- const N = C.find((h) => h.id === y);
194
+ const N = C.find((h) => h.id === f);
195
195
  if (!N || N.values.length >= u) return;
196
196
  const i = {
197
197
  id: be(),
@@ -199,25 +199,25 @@ function we({
199
199
  };
200
200
  r({
201
201
  variationTypes: C.map(
202
- (h) => h.id === y ? { ...h, values: [...h.values, i] } : h
202
+ (h) => h.id === f ? { ...h, values: [...h.values, i] } : h
203
203
  )
204
- }), w((h) => ({ ...h, [y]: "" }));
204
+ }), w((h) => ({ ...h, [f]: "" }));
205
205
  },
206
206
  [C, U, u, r]
207
207
  ), l = B(
208
- (y, D) => {
208
+ (f, D) => {
209
209
  r({
210
210
  variationTypes: C.map(
211
- (N) => N.id === y ? { ...N, values: N.values.filter((i) => i.id !== D) } : N
211
+ (N) => N.id === f ? { ...N, values: N.values.filter((i) => i.id !== D) } : N
212
212
  )
213
213
  });
214
214
  },
215
215
  [C, r]
216
216
  ), k = B(
217
- (y, D, N) => {
217
+ (f, D, N) => {
218
218
  r({
219
219
  variationTypes: C.map(
220
- (i) => i.id === y ? {
220
+ (i) => i.id === f ? {
221
221
  ...i,
222
222
  values: i.values.map(
223
223
  (h) => h.id === D ? { ...h, label: N } : h
@@ -238,7 +238,7 @@ function we({
238
238
  " types"
239
239
  ] })
240
240
  ] }),
241
- C.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variation-empty", children: 'No variation types defined. Add types like "Size" or "Color" to create product variants.' }) : /* @__PURE__ */ e("div", { className: "cedros-admin__variation-type-list", children: C.map((y, D) => /* @__PURE__ */ t("div", { className: "cedros-admin__variation-type-item", children: [
241
+ C.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variation-empty", children: 'No variation types defined. Add types like "Size" or "Color" to create product variants.' }) : /* @__PURE__ */ e("div", { className: "cedros-admin__variation-type-list", children: C.map((f, D) => /* @__PURE__ */ t("div", { className: "cedros-admin__variation-type-item", children: [
242
242
  /* @__PURE__ */ t("div", { className: "cedros-admin__variation-type-header", children: [
243
243
  /* @__PURE__ */ t("div", { className: "cedros-admin__variation-type-controls", children: [
244
244
  /* @__PURE__ */ e(
@@ -246,8 +246,8 @@ function we({
246
246
  {
247
247
  type: "button",
248
248
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--icon",
249
- onClick: () => c(y.id, "up"),
250
- disabled: g || D === 0,
249
+ onClick: () => c(f.id, "up"),
250
+ disabled: p || D === 0,
251
251
  title: "Move up",
252
252
  children: L.arrowUp
253
253
  }
@@ -257,8 +257,8 @@ function we({
257
257
  {
258
258
  type: "button",
259
259
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--icon",
260
- onClick: () => c(y.id, "down"),
261
- disabled: g || D === C.length - 1,
260
+ onClick: () => c(f.id, "down"),
261
+ disabled: p || D === C.length - 1,
262
262
  title: "Move down",
263
263
  children: L.arrowDown
264
264
  }
@@ -269,14 +269,14 @@ function we({
269
269
  {
270
270
  type: "text",
271
271
  className: "cedros-admin__input cedros-admin__variation-type-name",
272
- value: y.name,
273
- onChange: (N) => f(y.id, N.target.value),
274
- disabled: g,
272
+ value: f.name,
273
+ onChange: (N) => _(f.id, N.target.value),
274
+ disabled: p,
275
275
  placeholder: "Type name"
276
276
  }
277
277
  ),
278
278
  /* @__PURE__ */ t("span", { className: "cedros-admin__variation-value-count", children: [
279
- y.values.length,
279
+ f.values.length,
280
280
  " values"
281
281
  ] }),
282
282
  /* @__PURE__ */ e(
@@ -285,9 +285,9 @@ function we({
285
285
  type: "button",
286
286
  className: "cedros-admin__button cedros-admin__button--ghost",
287
287
  onClick: () => A(
288
- T === y.id ? null : y.id
288
+ T === f.id ? null : f.id
289
289
  ),
290
- children: T === y.id ? "Collapse" : "Edit values"
290
+ children: T === f.id ? "Collapse" : "Edit values"
291
291
  }
292
292
  ),
293
293
  /* @__PURE__ */ e(
@@ -295,35 +295,35 @@ function we({
295
295
  {
296
296
  type: "button",
297
297
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--danger",
298
- onClick: () => F(y.id),
299
- disabled: g,
298
+ onClick: () => F(f.id),
299
+ disabled: p,
300
300
  title: "Remove type",
301
301
  children: L.delete
302
302
  }
303
303
  )
304
304
  ] }),
305
- T === y.id && /* @__PURE__ */ t("div", { className: "cedros-admin__variation-values", children: [
305
+ T === f.id && /* @__PURE__ */ t("div", { className: "cedros-admin__variation-values", children: [
306
306
  /* @__PURE__ */ t("div", { className: "cedros-admin__variation-values-header", children: [
307
307
  /* @__PURE__ */ t("span", { style: { fontSize: 12, fontWeight: 600 }, children: [
308
308
  'Values for "',
309
- y.name,
309
+ f.name,
310
310
  '"'
311
311
  ] }),
312
312
  /* @__PURE__ */ t("span", { style: { fontSize: 11, opacity: 0.7 }, children: [
313
- y.values.length,
313
+ f.values.length,
314
314
  "/",
315
315
  u
316
316
  ] })
317
317
  ] }),
318
- y.values.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variation-empty", style: { padding: "8px 0" }, children: 'No values yet. Add values like "Small", "Medium", "Large".' }) : /* @__PURE__ */ e("div", { className: "cedros-admin__variation-value-list", children: y.values.map((N) => /* @__PURE__ */ t("div", { className: "cedros-admin__variation-value-item", children: [
318
+ f.values.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variation-empty", style: { padding: "8px 0" }, children: 'No values yet. Add values like "Small", "Medium", "Large".' }) : /* @__PURE__ */ e("div", { className: "cedros-admin__variation-value-list", children: f.values.map((N) => /* @__PURE__ */ t("div", { className: "cedros-admin__variation-value-item", children: [
319
319
  /* @__PURE__ */ e(
320
320
  "input",
321
321
  {
322
322
  type: "text",
323
323
  className: "cedros-admin__input cedros-admin__input--sm",
324
324
  value: N.label,
325
- onChange: (i) => k(y.id, N.id, i.target.value),
326
- disabled: g
325
+ onChange: (i) => k(f.id, N.id, i.target.value),
326
+ disabled: p
327
327
  }
328
328
  ),
329
329
  /* @__PURE__ */ e(
@@ -331,28 +331,28 @@ function we({
331
331
  {
332
332
  type: "button",
333
333
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--icon cedros-admin__button--danger",
334
- onClick: () => l(y.id, N.id),
335
- disabled: g,
334
+ onClick: () => l(f.id, N.id),
335
+ disabled: p,
336
336
  title: "Remove value",
337
337
  children: L.close
338
338
  }
339
339
  )
340
340
  ] }, N.id)) }),
341
- y.values.length < u && /* @__PURE__ */ t("div", { className: "cedros-admin__variation-add-value", children: [
341
+ f.values.length < u && /* @__PURE__ */ t("div", { className: "cedros-admin__variation-add-value", children: [
342
342
  /* @__PURE__ */ e(
343
343
  "input",
344
344
  {
345
345
  type: "text",
346
346
  className: "cedros-admin__input cedros-admin__input--sm",
347
- value: U[y.id] || "",
347
+ value: U[f.id] || "",
348
348
  onChange: (N) => w((i) => ({
349
349
  ...i,
350
- [y.id]: N.target.value
350
+ [f.id]: N.target.value
351
351
  })),
352
352
  placeholder: "Add value...",
353
- disabled: g,
353
+ disabled: p,
354
354
  onKeyDown: (N) => {
355
- N.key === "Enter" && (N.preventDefault(), s(y.id));
355
+ N.key === "Enter" && (N.preventDefault(), s(f.id));
356
356
  }
357
357
  }
358
358
  ),
@@ -361,14 +361,14 @@ function we({
361
361
  {
362
362
  type: "button",
363
363
  className: "cedros-admin__button cedros-admin__button--secondary cedros-admin__button--sm",
364
- onClick: () => s(y.id),
365
- disabled: g || !U[y.id]?.trim(),
364
+ onClick: () => s(f.id),
365
+ disabled: p || !U[f.id]?.trim(),
366
366
  children: "Add"
367
367
  }
368
368
  )
369
369
  ] })
370
370
  ] })
371
- ] }, y.id)) }),
371
+ ] }, f.id)) }),
372
372
  C.length < v && /* @__PURE__ */ t("div", { className: "cedros-admin__variation-add-type", children: [
373
373
  /* @__PURE__ */ e(
374
374
  "input",
@@ -376,11 +376,11 @@ function we({
376
376
  type: "text",
377
377
  className: "cedros-admin__input",
378
378
  value: $,
379
- onChange: (y) => _(y.target.value),
379
+ onChange: (f) => g(f.target.value),
380
380
  placeholder: "New variation type (e.g., Size, Color)",
381
- disabled: g,
382
- onKeyDown: (y) => {
383
- y.key === "Enter" && (y.preventDefault(), I());
381
+ disabled: p,
382
+ onKeyDown: (f) => {
383
+ f.key === "Enter" && (f.preventDefault(), I());
384
384
  }
385
385
  }
386
386
  ),
@@ -390,7 +390,7 @@ function we({
390
390
  type: "button",
391
391
  className: "cedros-admin__button cedros-admin__button--secondary",
392
392
  onClick: I,
393
- disabled: g || !$.trim(),
393
+ disabled: p || !$.trim(),
394
394
  children: "Add Type"
395
395
  }
396
396
  )
@@ -400,17 +400,17 @@ function we({
400
400
  function ve() {
401
401
  return `variant_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
402
402
  }
403
- function Ie(p) {
404
- if (p.length === 0) return [];
405
- const r = [...p].sort((u, g) => u.displayOrder - g.displayOrder), v = (u, g) => {
403
+ function Ae(y) {
404
+ if (y.length === 0) return [];
405
+ const r = [...y].sort((u, p) => u.displayOrder - p.displayOrder), v = (u, p) => {
406
406
  if (u >= r.length) {
407
- const $ = g.valueIds.sort().join("|"), _ = Object.values(g.options).join(" / ");
407
+ const $ = p.valueIds.sort().join("|"), g = Object.values(p.options).join(" / ");
408
408
  return [
409
409
  {
410
410
  key: $,
411
- title: _,
412
- optionValueIds: [...g.valueIds],
413
- options: { ...g.options }
411
+ title: g,
412
+ optionValueIds: [...p.valueIds],
413
+ options: { ...p.options }
414
414
  }
415
415
  ];
416
416
  }
@@ -418,42 +418,42 @@ function Ie(p) {
418
418
  for (const $ of T.values)
419
419
  A.push(
420
420
  ...v(u + 1, {
421
- valueIds: [...g.valueIds, $.id],
422
- options: { ...g.options, [T.name]: $.label }
421
+ valueIds: [...p.valueIds, $.id],
422
+ options: { ...p.options, [T.name]: $.label }
423
423
  })
424
424
  );
425
425
  return A;
426
426
  };
427
427
  return v(0, { valueIds: [], options: {} });
428
428
  }
429
- function Pe(p) {
430
- return p.optionValueIds?.length ? [...p.optionValueIds].sort().join("|") : Object.entries(p.options).sort(([r], [v]) => r.localeCompare(v)).map(([r, v]) => `${r}:${v}`).join("|");
429
+ function we(y) {
430
+ return y.optionValueIds?.length ? [...y.optionValueIds].sort().join("|") : Object.entries(y.options).sort(([r], [v]) => r.localeCompare(v)).map(([r, v]) => `${r}:${v}`).join("|");
431
431
  }
432
- function Te({
433
- variationConfig: p,
432
+ function Ie({
433
+ variationConfig: y,
434
434
  variants: r,
435
435
  onChange: v,
436
436
  defaultPrice: u = 0,
437
- currencySymbol: g = "$",
437
+ currencySymbol: p = "$",
438
438
  maxVariants: T = 100,
439
439
  disabled: A = !1
440
440
  }) {
441
441
  const $ = H(
442
- () => Ie(p.variationTypes),
443
- [p.variationTypes]
444
- ), _ = H(() => {
442
+ () => Ae(y.variationTypes),
443
+ [y.variationTypes]
444
+ ), g = H(() => {
445
445
  const c = /* @__PURE__ */ new Map();
446
446
  for (const s of r)
447
- c.set(Pe(s), s);
447
+ c.set(we(s), s);
448
448
  return c;
449
449
  }, [r]), { existingRows: U, possibleRows: w } = H(() => {
450
450
  const c = [], s = [];
451
451
  for (const l of $) {
452
- const k = _.get(l.key);
452
+ const k = g.get(l.key);
453
453
  k ? c.push({ combo: l, variant: k }) : s.push(l);
454
454
  }
455
455
  return { existingRows: c, possibleRows: s };
456
- }, [$, _]), C = B(
456
+ }, [$, g]), C = B(
457
457
  (c, s) => {
458
458
  v(
459
459
  r.map((l) => l.id === c ? { ...l, ...s } : l)
@@ -481,7 +481,7 @@ function Te({
481
481
  v([...r, s]);
482
482
  },
483
483
  [r, v, T, u]
484
- ), f = B(() => {
484
+ ), _ = B(() => {
485
485
  const c = T - r.length, l = w.slice(0, c).map((k) => ({
486
486
  id: ve(),
487
487
  title: k.title,
@@ -494,7 +494,7 @@ function Te({
494
494
  }));
495
495
  v([...r, ...l]);
496
496
  }, [r, v, w, T, u]);
497
- return p.variationTypes.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variant-grid-empty", children: "Add variation types above to create product variants." }) : $.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variant-grid-empty", children: "Add values to your variation types to create product variants." }) : /* @__PURE__ */ t("div", { className: "cedros-admin__variant-grid", children: [
497
+ return y.variationTypes.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variant-grid-empty", children: "Add variation types above to create product variants." }) : $.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__variant-grid-empty", children: "Add values to your variation types to create product variants." }) : /* @__PURE__ */ t("div", { className: "cedros-admin__variant-grid", children: [
498
498
  /* @__PURE__ */ t("div", { className: "cedros-admin__variant-grid-header", children: [
499
499
  /* @__PURE__ */ e("h4", { className: "cedros-admin__field-label", style: { marginBottom: 0 }, children: "Variants" }),
500
500
  /* @__PURE__ */ t("span", { style: { fontSize: 12, opacity: 0.7 }, children: [
@@ -513,7 +513,7 @@ function Te({
513
513
  {
514
514
  type: "button",
515
515
  className: "cedros-admin__button cedros-admin__button--secondary",
516
- onClick: f,
516
+ onClick: _,
517
517
  disabled: A,
518
518
  children: [
519
519
  "Generate All (",
@@ -540,7 +540,7 @@ function Te({
540
540
  /* @__PURE__ */ e("span", { style: { fontSize: 11, opacity: 0.6 }, children: Object.entries(c.options).map(([l, k]) => `${l}: ${k}`).join(", ") })
541
541
  ] }) }),
542
542
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
543
- /* @__PURE__ */ e("span", { children: g }),
543
+ /* @__PURE__ */ e("span", { children: p }),
544
544
  /* @__PURE__ */ e(
545
545
  "input",
546
546
  {
@@ -644,37 +644,37 @@ function Te({
644
644
  ] }) })
645
645
  ] });
646
646
  }
647
- function xe({
648
- serverUrl: p,
647
+ function Pe({
648
+ serverUrl: y,
649
649
  productId: r,
650
650
  productTitle: v,
651
651
  defaultPrice: u = 0,
652
- currencySymbol: g = "$",
652
+ currencySymbol: p = "$",
653
653
  apiKey: T,
654
654
  authManager: A,
655
655
  onClose: $
656
656
  }) {
657
657
  const {
658
- data: _,
658
+ data: g,
659
659
  isLoading: U,
660
660
  error: w,
661
661
  fetch: C,
662
662
  save: I,
663
663
  isSaving: F
664
- } = Ae({ serverUrl: p, productId: r, apiKey: T, authManager: A }), [f, c] = S({ variationTypes: [] }), [s, l] = S([]), [k, y] = S(!1), [D, N] = S(!1);
664
+ } = ke({ serverUrl: y, productId: r, apiKey: T, authManager: A }), [_, c] = S({ variationTypes: [] }), [s, l] = S([]), [k, f] = S(!1), [D, N] = S(!1);
665
665
  Y(() => {
666
666
  C();
667
667
  }, [C]), Y(() => {
668
- _ && (c(_.variationConfig), l(_.variants), y(!1));
669
- }, [_]);
668
+ g && (c(g.variationConfig), l(g.variants), f(!1));
669
+ }, [g]);
670
670
  const i = B((d) => {
671
- c(d), y(!0), N(!1);
671
+ c(d), f(!0), N(!1);
672
672
  }, []), h = B((d) => {
673
- l(d), y(!0), N(!1);
673
+ l(d), f(!0), N(!1);
674
674
  }, []), x = B(async () => {
675
- const d = new Set((_?.variants ?? []).map((V) => V.id)), m = s.filter((V) => !d.has(V.id)), z = s.filter((V) => d.has(V.id)), E = (_?.variants ?? []).filter((V) => !s.some((ee) => ee.id === V.id)).map((V) => V.id);
675
+ const d = new Set((g?.variants ?? []).map((V) => V.id)), m = s.filter((V) => !d.has(V.id)), z = s.filter((V) => d.has(V.id)), E = (g?.variants ?? []).filter((V) => !s.some((ee) => ee.id === V.id)).map((V) => V.id);
676
676
  await I({
677
- variationConfig: f,
677
+ variationConfig: _,
678
678
  createVariants: m.map((V) => ({
679
679
  optionValueIds: V.optionValueIds ?? [],
680
680
  inventoryQuantity: V.inventoryQuantity,
@@ -689,8 +689,8 @@ function xe({
689
689
  inventoryStatus: V.inventoryStatus
690
690
  })),
691
691
  deleteVariantIds: E.length > 0 ? E : void 0
692
- }) && (y(!1), N(!0), setTimeout(() => N(!1), 3e3));
693
- }, [f, s, _?.variants, I]);
692
+ }) && (f(!1), N(!0), setTimeout(() => N(!1), 3e3));
693
+ }, [_, s, g?.variants, I]);
694
694
  return U ? /* @__PURE__ */ t("div", { className: "cedros-admin__variations-editor", children: [
695
695
  /* @__PURE__ */ t("div", { className: "cedros-admin__variations-editor-header", children: [
696
696
  /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: v ? `Variations: ${v}` : "Product Variations" }),
@@ -741,21 +741,21 @@ function xe({
741
741
  w && /* @__PURE__ */ e("div", { className: "cedros-admin__error-banner", children: w }),
742
742
  /* @__PURE__ */ t("div", { className: "cedros-admin__variations-editor-content", children: [
743
743
  /* @__PURE__ */ e("div", { className: "cedros-admin__variations-editor-section", children: /* @__PURE__ */ e(
744
- we,
744
+ Se,
745
745
  {
746
- value: f,
746
+ value: _,
747
747
  onChange: i,
748
748
  disabled: F
749
749
  }
750
750
  ) }),
751
- f.variationTypes.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-admin__variations-editor-section", children: /* @__PURE__ */ e(
752
- Te,
751
+ _.variationTypes.length > 0 && /* @__PURE__ */ e("div", { className: "cedros-admin__variations-editor-section", children: /* @__PURE__ */ e(
752
+ Ie,
753
753
  {
754
- variationConfig: f,
754
+ variationConfig: _,
755
755
  variants: s,
756
756
  onChange: h,
757
757
  defaultPrice: u,
758
- currencySymbol: g,
758
+ currencySymbol: p,
759
759
  disabled: F
760
760
  }
761
761
  ) })
@@ -768,29 +768,29 @@ const Ce = {
768
768
  requireAccreditedInvestor: !1,
769
769
  tokenGates: []
770
770
  };
771
- function Re({ value: p, onChange: r }) {
772
- const [v, u] = S(p !== null), [g, T] = S(""), [A, $] = S("fungible_token"), [_, U] = S(1), w = p ?? Ce, C = () => {
773
- p ? (r(null), u(!1)) : (r({ ...Ce }), u(!0));
771
+ function Te({ value: y, onChange: r }) {
772
+ const [v, u] = S(y !== null), [p, T] = S(""), [A, $] = S("fungible_token"), [g, U] = S(1), w = y ?? Ce, C = () => {
773
+ y ? (r(null), u(!1)) : (r({ ...Ce }), u(!0));
774
774
  }, I = (c) => {
775
775
  r({ ...w, ...c });
776
776
  }, F = () => {
777
- if (!g.trim()) return;
777
+ if (!p.trim()) return;
778
778
  const c = {
779
- address: g.trim(),
779
+ address: p.trim(),
780
780
  gateType: A,
781
- minAmount: _
781
+ minAmount: g
782
782
  }, s = [...w.tokenGates ?? [], c];
783
783
  I({ tokenGates: s }), T(""), U(1);
784
- }, f = (c) => {
784
+ }, _ = (c) => {
785
785
  const s = (w.tokenGates ?? []).filter((l, k) => k !== c);
786
786
  I({ tokenGates: s.length > 0 ? s : [] });
787
787
  };
788
788
  return /* @__PURE__ */ t("div", { style: { border: "1px solid var(--cedros-admin-border, #e0e0e0)", borderRadius: "4px", padding: "0.75rem", marginTop: "0.5rem" }, children: [
789
789
  /* @__PURE__ */ t("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", fontSize: "0.9rem", fontWeight: 600, cursor: "pointer" }, children: [
790
- /* @__PURE__ */ e("input", { type: "checkbox", checked: p !== null, onChange: C }),
790
+ /* @__PURE__ */ e("input", { type: "checkbox", checked: y !== null, onChange: C }),
791
791
  "Enable compliance gates"
792
792
  ] }),
793
- p !== null && v && /* @__PURE__ */ t("div", { style: { marginTop: "0.75rem", display: "flex", flexDirection: "column", gap: "0.5rem" }, children: [
793
+ y !== null && v && /* @__PURE__ */ t("div", { style: { marginTop: "0.75rem", display: "flex", flexDirection: "column", gap: "0.5rem" }, children: [
794
794
  /* @__PURE__ */ t("label", { style: { display: "flex", alignItems: "center", gap: "0.5rem", fontSize: "0.85rem" }, children: [
795
795
  /* @__PURE__ */ e(
796
796
  "input",
@@ -841,7 +841,7 @@ function Re({ value: p, onChange: r }) {
841
841
  {
842
842
  type: "button",
843
843
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
844
- onClick: () => f(s),
844
+ onClick: () => _(s),
845
845
  style: { padding: "0 0.25rem" },
846
846
  children: "×"
847
847
  }
@@ -854,7 +854,7 @@ function Re({ value: p, onChange: r }) {
854
854
  type: "text",
855
855
  className: "cedros-admin__input",
856
856
  placeholder: "Mint or collection address",
857
- value: g,
857
+ value: p,
858
858
  onChange: (c) => T(c.target.value),
859
859
  style: { flex: 1, minWidth: "200px", fontSize: "0.8rem" }
860
860
  }
@@ -878,7 +878,7 @@ function Re({ value: p, onChange: r }) {
878
878
  type: "number",
879
879
  className: "cedros-admin__input",
880
880
  min: 1,
881
- value: _,
881
+ value: g,
882
882
  onChange: (c) => U(Number(c.target.value)),
883
883
  style: { width: "80px", fontSize: "0.8rem" }
884
884
  }
@@ -889,7 +889,7 @@ function Re({ value: p, onChange: r }) {
889
889
  type: "button",
890
890
  className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
891
891
  onClick: F,
892
- disabled: !g.trim(),
892
+ disabled: !p.trim(),
893
893
  children: "Add Gate"
894
894
  }
895
895
  )
@@ -898,35 +898,35 @@ function Re({ value: p, onChange: r }) {
898
898
  ] })
899
899
  ] });
900
900
  }
901
- function $e({
902
- serverUrl: p,
901
+ function xe({
902
+ serverUrl: y,
903
903
  productId: r,
904
904
  productTitle: v,
905
905
  apiKey: u,
906
- authManager: g,
906
+ authManager: p,
907
907
  onClose: T
908
908
  }) {
909
- const [A, $] = S(null), [_, U] = S(!0), [w, C] = S(null), I = B(async () => {
909
+ const [A, $] = S(null), [g, U] = S(!0), [w, C] = S(null), I = B(async () => {
910
910
  U(!0), C(null);
911
911
  try {
912
912
  const F = `/paywall/v1/products/${encodeURIComponent(r)}/nft-metadata`;
913
- let f;
914
- if (g?.isAuthenticated())
915
- f = await g.fetchWithAuth(F);
913
+ let _;
914
+ if (p?.isAuthenticated())
915
+ _ = await p.fetchWithAuth(F);
916
916
  else {
917
917
  const c = { "Content-Type": "application/json" };
918
918
  u && (c["X-API-Key"] = u);
919
- const s = await fetch(`${p}${F}`, { headers: c });
919
+ const s = await fetch(`${y}${F}`, { headers: c });
920
920
  if (!s.ok) throw new Error(`Request failed: ${s.status}`);
921
- f = await s.json();
921
+ _ = await s.json();
922
922
  }
923
- $(f);
923
+ $(_);
924
924
  } catch {
925
925
  C("Failed to load NFT metadata. Ensure this product exists and the server is running.");
926
926
  } finally {
927
927
  U(!1);
928
928
  }
929
- }, [p, r, u, g]);
929
+ }, [y, r, u, p]);
930
930
  return Y(() => {
931
931
  I();
932
932
  }, [I]), /* @__PURE__ */ t("div", { children: [
@@ -949,7 +949,7 @@ function $e({
949
949
  )
950
950
  ] }),
951
951
  /* @__PURE__ */ e(re, { message: w, onRetry: I }),
952
- _ ? /* @__PURE__ */ t("div", { className: "cedros-admin__loading", children: [
952
+ g ? /* @__PURE__ */ t("div", { className: "cedros-admin__loading", children: [
953
953
  L.loading,
954
954
  " Loading metadata..."
955
955
  ] }) : A ? /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: [
@@ -1013,8 +1013,8 @@ function $e({
1013
1013
  ] }) : null
1014
1014
  ] });
1015
1015
  }
1016
- function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1017
- const [g, T] = S([]), [A, $] = S(!0), [_, U] = S(!1), [w, C] = S(!1), [I, F] = S(null), [f, c] = S(null), [s, l] = S(null), [k, y] = S(null), [D, N] = S(null), [i, h] = S({
1016
+ function Ee({ serverUrl: y, apiKey: r, pageSize: v = 20, authManager: u }) {
1017
+ const [p, T] = S([]), [A, $] = S(!0), [g, U] = S(!1), [w, C] = S(!1), [I, F] = S(null), [_, c] = S(null), [s, l] = S(null), [k, f] = S(null), [D, N] = S(null), [i, h] = S({
1018
1018
  id: "",
1019
1019
  title: "",
1020
1020
  slug: "",
@@ -1137,7 +1137,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1137
1137
  else {
1138
1138
  const a = { "Content-Type": "application/json" };
1139
1139
  r && (a["X-API-Key"] = r);
1140
- const R = await fetch(`${p}/admin/products?limit=${v}`, { headers: a });
1140
+ const R = await fetch(`${y}/admin/products?limit=${v}`, { headers: a });
1141
1141
  if (!R.ok) throw new Error(`Failed to fetch products: ${R.status}`);
1142
1142
  n = await R.json();
1143
1143
  }
@@ -1147,7 +1147,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1147
1147
  } finally {
1148
1148
  $(!1);
1149
1149
  }
1150
- }, [p, r, v, u]);
1150
+ }, [y, r, v, u]);
1151
1151
  Y(() => {
1152
1152
  ie(), (async () => {
1153
1153
  try {
@@ -1157,7 +1157,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1157
1157
  else {
1158
1158
  const a = { "Content-Type": "application/json" };
1159
1159
  r && (a["X-API-Key"] = r);
1160
- const R = await fetch(`${p}/admin/collections`, { headers: a });
1160
+ const R = await fetch(`${y}/admin/collections`, { headers: a });
1161
1161
  if (!R.ok) return;
1162
1162
  n = await R.json();
1163
1163
  }
@@ -1165,7 +1165,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1165
1165
  } catch {
1166
1166
  }
1167
1167
  })();
1168
- }, [ie, p, r, u]);
1168
+ }, [ie, y, r, u]);
1169
1169
  const _e = async (n) => {
1170
1170
  if (n.preventDefault(), !(!i.id || !i.description)) {
1171
1171
  if (F(null), i.fulfillmentType === "shipping" && i.checkoutShippingAddress && !i.shippingCountriesCsv.split(",").map((R) => R.trim()).filter(Boolean).length) {
@@ -1228,7 +1228,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1228
1228
  else {
1229
1229
  const b = { "Content-Type": "application/json" };
1230
1230
  r && (b["X-API-Key"] = r);
1231
- const P = await fetch(`${p}/admin/products`, {
1231
+ const P = await fetch(`${y}/admin/products`, {
1232
1232
  method: "POST",
1233
1233
  headers: b,
1234
1234
  body: JSON.stringify(o)
@@ -1289,15 +1289,15 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1289
1289
  return "One-time purchase";
1290
1290
  }
1291
1291
  }, ce = i.storePolicyFulfillment === "digital_in_app" || i.storePolicyFulfillment === "reader_content" || i.storePolicyFulfillment === "other" || i.productType === "subscription" || i.storeManagedKind !== "none", ae = H(() => {
1292
- const n = g.filter((R) => R.active).length, a = g.reduce((R, X) => {
1292
+ const n = p.filter((R) => R.active).length, a = p.reduce((R, X) => {
1293
1293
  const j = X.variations?.length ?? 0;
1294
1294
  return R + (j > 0 ? j : 1);
1295
1295
  }, 0);
1296
1296
  return { activeCount: n, totalSkus: a };
1297
- }, [g]), te = (n) => {
1298
- y((a) => !a || a.key !== n ? { key: n, direction: "asc" } : { key: n, direction: a.direction === "asc" ? "desc" : "asc" });
1297
+ }, [p]), te = (n) => {
1298
+ f((a) => !a || a.key !== n ? { key: n, direction: "asc" } : { key: n, direction: a.direction === "asc" ? "desc" : "asc" });
1299
1299
  }, ne = (n) => !k || k.key !== n ? /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon cedros-admin__sort-icon--idle", children: L.chevronUp }) : /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon", children: k.direction === "asc" ? L.chevronUp : L.chevronDown }), ye = H(() => {
1300
- if (!k) return g;
1300
+ if (!k) return p;
1301
1301
  const n = k.direction === "asc" ? 1 : -1, a = (R) => {
1302
1302
  switch (k.key) {
1303
1303
  case "product":
@@ -1313,18 +1313,18 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1313
1313
  return R.id;
1314
1314
  }
1315
1315
  };
1316
- return [...g].sort((R, X) => {
1316
+ return [...p].sort((R, X) => {
1317
1317
  const j = a(R), q = a(X);
1318
1318
  return typeof j == "number" && typeof q == "number" ? (j - q) * n : String(j).localeCompare(String(q), void 0, { sensitivity: "base" }) * n;
1319
1319
  });
1320
- }, [g, k]);
1320
+ }, [p, k]);
1321
1321
  return /* @__PURE__ */ t("div", { className: "cedros-admin__page", children: [
1322
1322
  /* @__PURE__ */ e(re, { message: D, onRetry: ie }),
1323
1323
  /* @__PURE__ */ e(
1324
1324
  pe,
1325
1325
  {
1326
1326
  stats: [
1327
- { label: "Total Products", value: g.length },
1327
+ { label: "Total Products", value: p.length },
1328
1328
  { label: "Active", value: ae.activeCount, variant: ae.activeCount > 0 ? "success" : "muted" },
1329
1329
  { label: "Total SKUs", value: ae.totalSkus }
1330
1330
  ],
@@ -1338,16 +1338,16 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
1338
1338
  {
1339
1339
  className: "cedros-admin__button cedros-admin__button--primary cedros-admin__button--action",
1340
1340
  onClick: () => {
1341
- F(null), U(!_);
1341
+ F(null), U(!g);
1342
1342
  },
1343
1343
  children: [
1344
- _ ? L.close : L.plus,
1345
- _ ? "Cancel" : "Add Product"
1344
+ g ? L.close : L.plus,
1345
+ g ? "Cancel" : "Add Product"
1346
1346
  ]
1347
1347
  }
1348
1348
  )
1349
1349
  ] }),
1350
- _ && /* @__PURE__ */ t("form", { onSubmit: _e, className: "cedros-admin__add-form", children: [
1350
+ g && /* @__PURE__ */ t("form", { onSubmit: _e, className: "cedros-admin__add-form", children: [
1351
1351
  I && /* @__PURE__ */ e("div", { style: { marginBottom: "0.75rem", color: "#B42318", fontWeight: 600 }, children: I }),
1352
1352
  /* @__PURE__ */ t("div", { className: "cedros-admin__form-row", children: [
1353
1353
  /* @__PURE__ */ t("div", { className: "cedros-admin__field", children: [
@@ -2007,7 +2007,7 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2007
2007
  /* @__PURE__ */ e("div", { style: { marginTop: 4, fontSize: 12, opacity: 0.75 }, children: "ISO 2-letter country codes, comma-separated. Required for shipping address collection." })
2008
2008
  ] }) }),
2009
2009
  /* @__PURE__ */ e(
2010
- Re,
2010
+ Te,
2011
2011
  {
2012
2012
  value: i.complianceRequirements,
2013
2013
  onChange: (n) => h((a) => ({ ...a, complianceRequirements: n }))
@@ -2082,18 +2082,18 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2082
2082
  ] }) })
2083
2083
  ] }, n.id)) })
2084
2084
  ] }) }),
2085
- f && /* @__PURE__ */ e("div", { className: "cedros-admin__modal-overlay", onClick: () => c(null), children: /* @__PURE__ */ e(
2085
+ _ && /* @__PURE__ */ e("div", { className: "cedros-admin__modal-overlay", onClick: () => c(null), children: /* @__PURE__ */ e(
2086
2086
  "div",
2087
2087
  {
2088
2088
  className: "cedros-admin__modal cedros-admin__modal--lg",
2089
2089
  onClick: (n) => n.stopPropagation(),
2090
2090
  children: /* @__PURE__ */ e(
2091
- xe,
2091
+ Pe,
2092
2092
  {
2093
- serverUrl: p,
2094
- productId: f.id,
2095
- productTitle: z(f),
2096
- defaultPrice: f.fiatAmountCents / 100,
2093
+ serverUrl: y,
2094
+ productId: _.id,
2095
+ productTitle: z(_),
2096
+ defaultPrice: _.fiatAmountCents / 100,
2097
2097
  apiKey: r,
2098
2098
  authManager: u,
2099
2099
  onClose: () => c(null)
@@ -2107,9 +2107,9 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2107
2107
  className: "cedros-admin__modal cedros-admin__modal--lg",
2108
2108
  onClick: (n) => n.stopPropagation(),
2109
2109
  children: /* @__PURE__ */ e(
2110
- $e,
2110
+ xe,
2111
2111
  {
2112
- serverUrl: p,
2112
+ serverUrl: y,
2113
2113
  productId: s.id,
2114
2114
  productTitle: z(s),
2115
2115
  apiKey: r,
@@ -2121,8 +2121,8 @@ function qe({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2121
2121
  ) })
2122
2122
  ] });
2123
2123
  }
2124
- function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2125
- const [g, T] = S([]), [A, $] = S(null), [_, U] = S(!0), [w, C] = S(!0), [I, F] = S(null), [f, c] = S(""), [s, l] = S(null), k = B(async () => {
2124
+ function Oe({ serverUrl: y, apiKey: r, pageSize: v = 20, authManager: u }) {
2125
+ const [p, T] = S([]), [A, $] = S(null), [g, U] = S(!0), [w, C] = S(!0), [I, F] = S(null), [_, c] = S(""), [s, l] = S(null), k = B(async () => {
2126
2126
  C(!0);
2127
2127
  try {
2128
2128
  F(null);
@@ -2132,7 +2132,7 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2132
2132
  else {
2133
2133
  const d = { "Content-Type": "application/json" };
2134
2134
  r && (d["X-API-Key"] = r);
2135
- const m = await fetch(`${p}/admin/stats`, { headers: d });
2135
+ const m = await fetch(`${y}/admin/stats`, { headers: d });
2136
2136
  if (!m.ok) throw new Error(`Failed to fetch stats: ${m.status}`);
2137
2137
  x = await m.json();
2138
2138
  }
@@ -2142,23 +2142,23 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2142
2142
  } finally {
2143
2143
  C(!1);
2144
2144
  }
2145
- }, [p, r, u]);
2145
+ }, [y, r, u]);
2146
2146
  Y(() => {
2147
2147
  k();
2148
2148
  }, [k]);
2149
- const y = B(async () => {
2149
+ const f = B(async () => {
2150
2150
  try {
2151
2151
  F(null);
2152
2152
  let x;
2153
2153
  const d = new URLSearchParams({ limit: v.toString() });
2154
- f && d.set("method", f);
2154
+ _ && d.set("method", _);
2155
2155
  const m = `/admin/transactions?${d}`;
2156
2156
  if (u?.isAuthenticated())
2157
2157
  x = await u.fetchWithAuth(m);
2158
2158
  else {
2159
2159
  const z = { "Content-Type": "application/json" };
2160
2160
  r && (z["X-API-Key"] = r);
2161
- const E = await fetch(`${p}${m}`, { headers: z });
2161
+ const E = await fetch(`${y}${m}`, { headers: z });
2162
2162
  if (!E.ok) throw new Error(`Failed to fetch transactions: ${E.status}`);
2163
2163
  x = await E.json();
2164
2164
  }
@@ -2168,14 +2168,14 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2168
2168
  } finally {
2169
2169
  U(!1);
2170
2170
  }
2171
- }, [p, r, v, f, u]);
2171
+ }, [y, r, v, _, u]);
2172
2172
  Y(() => {
2173
- y();
2174
- }, [y]);
2173
+ f();
2174
+ }, [f]);
2175
2175
  const D = (x, d = "USD") => new Intl.NumberFormat("en-US", { style: "currency", currency: d }).format(x), N = (x) => {
2176
2176
  l((d) => !d || d.key !== x ? { key: x, direction: "asc" } : { key: x, direction: d.direction === "asc" ? "desc" : "asc" });
2177
2177
  }, i = (x) => !s || s.key !== x ? /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon cedros-admin__sort-icon--idle", children: L.chevronUp }) : /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon", children: s.direction === "asc" ? L.chevronUp : L.chevronDown }), h = H(() => {
2178
- if (!s) return g;
2178
+ if (!s) return p;
2179
2179
  const x = s.direction === "asc" ? 1 : -1, d = (m) => {
2180
2180
  switch (s.key) {
2181
2181
  case "resource":
@@ -2193,14 +2193,14 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2193
2193
  return m.id;
2194
2194
  }
2195
2195
  };
2196
- return [...g].sort((m, z) => {
2196
+ return [...p].sort((m, z) => {
2197
2197
  const E = d(m), M = d(z);
2198
2198
  return typeof E == "number" && typeof M == "number" ? (E - M) * x : String(E).localeCompare(String(M), void 0, { sensitivity: "base" }) * x;
2199
2199
  });
2200
- }, [g, s]);
2200
+ }, [p, s]);
2201
2201
  return /* @__PURE__ */ t("div", { className: "cedros-admin__page", children: [
2202
2202
  /* @__PURE__ */ e(re, { message: I, onRetry: () => {
2203
- k(), y();
2203
+ k(), f();
2204
2204
  } }),
2205
2205
  /* @__PURE__ */ e(
2206
2206
  pe,
@@ -2221,7 +2221,7 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2221
2221
  /* @__PURE__ */ e(
2222
2222
  Ne,
2223
2223
  {
2224
- value: f,
2224
+ value: _,
2225
2225
  onChange: c,
2226
2226
  options: [
2227
2227
  { value: "", label: "All" },
@@ -2232,7 +2232,7 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2232
2232
  }
2233
2233
  )
2234
2234
  ] }),
2235
- _ ? /* @__PURE__ */ t("div", { className: "cedros-admin__loading", children: [
2235
+ g ? /* @__PURE__ */ t("div", { className: "cedros-admin__loading", children: [
2236
2236
  L.loading,
2237
2237
  " Loading transactions..."
2238
2238
  ] }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ t("table", { className: "cedros-admin__table", children: [
@@ -2278,8 +2278,8 @@ function je({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2278
2278
  ] }) })
2279
2279
  ] });
2280
2280
  }
2281
- function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2282
- const [g, T] = S([]), [A, $] = S(!0), [_, U] = S(!1), [w, C] = S(!1), [I, F] = S(null), [f, c] = S(null), [s, l] = S({
2281
+ function Be({ serverUrl: y, apiKey: r, pageSize: v = 20, authManager: u }) {
2282
+ const [p, T] = S([]), [A, $] = S(!0), [g, U] = S(!1), [w, C] = S(!1), [I, F] = S(null), [_, c] = S(null), [s, l] = S({
2283
2283
  code: "",
2284
2284
  discountType: "percentage",
2285
2285
  discountValue: 0,
@@ -2308,24 +2308,24 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2308
2308
  else {
2309
2309
  const z = { "Content-Type": "application/json" };
2310
2310
  r && (z["X-API-Key"] = r);
2311
- const E = await fetch(`${p}${m}`, { headers: z });
2311
+ const E = await fetch(`${y}${m}`, { headers: z });
2312
2312
  if (!E.ok) throw new Error(`Failed to fetch coupons: ${E.status}`);
2313
2313
  d = await E.json();
2314
2314
  }
2315
2315
  T(d.coupons || []);
2316
2316
  } catch (d) {
2317
2317
  se().error("[CouponsSection] Failed to fetch coupons:", d, {
2318
- serverUrl: p.slice(0, 20) + "...",
2318
+ serverUrl: y.slice(0, 20) + "...",
2319
2319
  hasApiKey: !!r
2320
2320
  }), T([]), c("Failed to load coupons");
2321
2321
  } finally {
2322
2322
  $(!1);
2323
2323
  }
2324
- }, [p, r, v, u]);
2324
+ }, [y, r, v, u]);
2325
2325
  Y(() => {
2326
2326
  k();
2327
2327
  }, [k]);
2328
- const y = async (d) => {
2328
+ const f = async (d) => {
2329
2329
  if (d.preventDefault(), !(!s.code || s.discountValue <= 0)) {
2330
2330
  C(!0);
2331
2331
  try {
@@ -2359,7 +2359,7 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2359
2359
  else {
2360
2360
  const V = { "Content-Type": "application/json" };
2361
2361
  r && (V["X-API-Key"] = r);
2362
- const ee = await fetch(`${p}/admin/coupons`, {
2362
+ const ee = await fetch(`${y}/admin/coupons`, {
2363
2363
  method: "POST",
2364
2364
  headers: V,
2365
2365
  body: JSON.stringify(M)
@@ -2385,17 +2385,17 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2385
2385
  }), U(!1), k();
2386
2386
  } catch (m) {
2387
2387
  se().error("[CouponsSection] Failed to add coupon:", m, {
2388
- serverUrl: p.slice(0, 20) + "...",
2388
+ serverUrl: y.slice(0, 20) + "...",
2389
2389
  hasApiKey: !!r
2390
2390
  }), c("Failed to create coupon");
2391
2391
  } finally {
2392
2392
  C(!1);
2393
2393
  }
2394
2394
  }
2395
- }, D = g.filter((d) => d.active).length, N = g.reduce((d, m) => d + (m.usageCount ?? 0), 0), i = (d) => {
2395
+ }, D = p.filter((d) => d.active).length, N = p.reduce((d, m) => d + (m.usageCount ?? 0), 0), i = (d) => {
2396
2396
  F((m) => !m || m.key !== d ? { key: d, direction: "asc" } : { key: d, direction: m.direction === "asc" ? "desc" : "asc" });
2397
2397
  }, h = (d) => !I || I.key !== d ? /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon cedros-admin__sort-icon--idle", children: L.chevronUp }) : /* @__PURE__ */ e("span", { className: "cedros-admin__sort-icon", children: I.direction === "asc" ? L.chevronUp : L.chevronDown }), x = H(() => {
2398
- if (!I) return g;
2398
+ if (!I) return p;
2399
2399
  const d = I.direction === "asc" ? 1 : -1, m = (z) => {
2400
2400
  switch (I.key) {
2401
2401
  case "discount":
@@ -2409,18 +2409,18 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2409
2409
  return z.code;
2410
2410
  }
2411
2411
  };
2412
- return [...g].sort((z, E) => {
2412
+ return [...p].sort((z, E) => {
2413
2413
  const M = m(z), V = m(E);
2414
2414
  return typeof M == "number" && typeof V == "number" ? (M - V) * d : String(M).localeCompare(String(V), void 0, { sensitivity: "base" }) * d;
2415
2415
  });
2416
- }, [g, I]);
2416
+ }, [p, I]);
2417
2417
  return /* @__PURE__ */ t("div", { className: "cedros-admin__page", children: [
2418
- /* @__PURE__ */ e(re, { message: f, onRetry: k }),
2418
+ /* @__PURE__ */ e(re, { message: _, onRetry: k }),
2419
2419
  /* @__PURE__ */ e(
2420
2420
  pe,
2421
2421
  {
2422
2422
  stats: [
2423
- { label: "Total Coupons", value: g.length },
2423
+ { label: "Total Coupons", value: p.length },
2424
2424
  { label: "Active", value: D, variant: D > 0 ? "success" : "muted" },
2425
2425
  { label: "Redemptions", value: N }
2426
2426
  ],
@@ -2433,15 +2433,15 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2433
2433
  "button",
2434
2434
  {
2435
2435
  className: "cedros-admin__button cedros-admin__button--primary cedros-admin__button--action",
2436
- onClick: () => U(!_),
2436
+ onClick: () => U(!g),
2437
2437
  children: [
2438
- _ ? L.close : L.plus,
2439
- _ ? "Cancel" : "Add Coupon"
2438
+ g ? L.close : L.plus,
2439
+ g ? "Cancel" : "Add Coupon"
2440
2440
  ]
2441
2441
  }
2442
2442
  )
2443
2443
  ] }),
2444
- _ && /* @__PURE__ */ t("form", { onSubmit: y, className: "cedros-admin__add-form", children: [
2444
+ g && /* @__PURE__ */ t("form", { onSubmit: f, className: "cedros-admin__add-form", children: [
2445
2445
  /* @__PURE__ */ t("div", { className: "cedros-admin__form-row", children: [
2446
2446
  /* @__PURE__ */ t("div", { className: "cedros-admin__field", children: [
2447
2447
  /* @__PURE__ */ e("label", { className: "cedros-admin__field-label", children: "Coupon Code" }),
@@ -2698,8 +2698,8 @@ function Ge({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2698
2698
  ] }) })
2699
2699
  ] });
2700
2700
  }
2701
- function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2702
- const [g, T] = S([]), [A, $] = S(!0), [_, U] = S(null), [w, C] = S([]), [I, F] = S(!0), [f, c] = S(null), [s, l] = S([]), [k, y] = S(!0), [D, N] = S(null), [i, h] = S(null), [x, d] = S(null), m = B(async () => {
2701
+ function qe({ serverUrl: y, apiKey: r, pageSize: v = 20, authManager: u }) {
2702
+ const [p, T] = S([]), [A, $] = S(!0), [g, U] = S(null), [w, C] = S([]), [I, F] = S(!0), [_, c] = S(null), [s, l] = S([]), [k, f] = S(!0), [D, N] = S(null), [i, h] = S(null), [x, d] = S(null), m = B(async () => {
2703
2703
  try {
2704
2704
  let o;
2705
2705
  const b = `/admin/refunds?limit=${v}`;
@@ -2708,20 +2708,20 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2708
2708
  else {
2709
2709
  const P = { "Content-Type": "application/json" };
2710
2710
  r && (P["X-API-Key"] = r);
2711
- const G = await fetch(`${p}${b}`, { headers: P });
2711
+ const G = await fetch(`${y}${b}`, { headers: P });
2712
2712
  if (!G.ok) throw new Error(`Failed to fetch x402 refunds: ${G.status}`);
2713
2713
  o = await G.json();
2714
2714
  }
2715
2715
  T(o.refunds || []);
2716
2716
  } catch (o) {
2717
2717
  se().error("[RefundsSection] Failed to fetch x402 refunds:", o, {
2718
- serverUrl: p.slice(0, 20) + "...",
2718
+ serverUrl: y.slice(0, 20) + "...",
2719
2719
  hasApiKey: !!r
2720
2720
  }), T([]), d("Failed to load x402 refunds");
2721
2721
  } finally {
2722
2722
  $(!1);
2723
2723
  }
2724
- }, [p, r, v, u]);
2724
+ }, [y, r, v, u]);
2725
2725
  Y(() => {
2726
2726
  m();
2727
2727
  }, [m]);
@@ -2734,7 +2734,7 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2734
2734
  else {
2735
2735
  const G = { "Content-Type": "application/json" };
2736
2736
  r && (G["X-API-Key"] = r);
2737
- const W = await fetch(`${p}${b}`, { headers: G });
2737
+ const W = await fetch(`${y}${b}`, { headers: G });
2738
2738
  if (!W.ok) throw new Error(`Failed to fetch credits refund requests: ${W.status}`);
2739
2739
  o = await W.json();
2740
2740
  }
@@ -2742,13 +2742,13 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2742
2742
  C(P);
2743
2743
  } catch (o) {
2744
2744
  se().error("[RefundsSection] Failed to fetch credits refunds:", o, {
2745
- serverUrl: p.slice(0, 20) + "...",
2745
+ serverUrl: y.slice(0, 20) + "...",
2746
2746
  hasApiKey: !!r
2747
2747
  }), C([]), d("Failed to load credits refunds");
2748
2748
  } finally {
2749
2749
  F(!1);
2750
2750
  }
2751
- }, [p, r, v, u]);
2751
+ }, [y, r, v, u]);
2752
2752
  Y(() => {
2753
2753
  z();
2754
2754
  }, [z]);
@@ -2761,20 +2761,20 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2761
2761
  else {
2762
2762
  const P = { "Content-Type": "application/json" };
2763
2763
  r && (P["X-API-Key"] = r);
2764
- const G = await fetch(`${p}${b}`, { headers: P });
2764
+ const G = await fetch(`${y}${b}`, { headers: P });
2765
2765
  if (!G.ok) throw new Error(`Failed to fetch Stripe refunds: ${G.status}`);
2766
2766
  o = await G.json();
2767
2767
  }
2768
2768
  l(o.refunds || []);
2769
2769
  } catch (o) {
2770
2770
  se().error("[RefundsSection] Failed to fetch Stripe refunds:", o, {
2771
- serverUrl: p.slice(0, 20) + "...",
2771
+ serverUrl: y.slice(0, 20) + "...",
2772
2772
  hasApiKey: !!r
2773
2773
  }), l([]), d("Failed to load Stripe refunds");
2774
2774
  } finally {
2775
- y(!1);
2775
+ f(!1);
2776
2776
  }
2777
- }, [p, r, v, u]);
2777
+ }, [y, r, v, u]);
2778
2778
  Y(() => {
2779
2779
  E();
2780
2780
  }, [E]);
@@ -2787,13 +2787,13 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2787
2787
  else {
2788
2788
  const P = { "Content-Type": "application/json" };
2789
2789
  r && (P["X-API-Key"] = r);
2790
- const G = await fetch(`${p}${b}`, { method: "POST", headers: P });
2790
+ const G = await fetch(`${y}${b}`, { method: "POST", headers: P });
2791
2791
  if (!G.ok) throw new Error(`Failed to process refund: ${G.status}`);
2792
2792
  }
2793
2793
  await E();
2794
2794
  } catch (b) {
2795
2795
  se().error("[RefundsSection] Failed to process Stripe refund:", b, {
2796
- serverUrl: p.slice(0, 20) + "...",
2796
+ serverUrl: y.slice(0, 20) + "...",
2797
2797
  hasApiKey: !!r,
2798
2798
  refundId: o
2799
2799
  }), d("Failed to process Stripe refund");
@@ -2823,7 +2823,7 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2823
2823
  default:
2824
2824
  return "muted";
2825
2825
  }
2826
- }, _e = (o) => o.stripeRefundId ?? "—", fe = (o) => o.chargeId ?? "—", oe = s.filter((o) => o.status === "pending" || o.status === "requires_action").length, ce = w.filter((o) => o.status === "pending").length, ae = g.filter((o) => o.status === "pending").length, te = oe + ce + ae, ne = s.filter((o) => o.status === "succeeded").reduce((o, b) => o + b.amount, 0), ye = w.filter((o) => o.status === "processed").reduce((o, b) => o + b.amountLamports, 0), n = g.filter((o) => o.status === "completed").reduce((o, b) => o + b.amount, 0), a = ne / 100 + ye / 1e6 + n, R = (o) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(o), X = k || I || A, j = (o) => {
2826
+ }, _e = (o) => o.stripeRefundId ?? "—", fe = (o) => o.chargeId ?? "—", oe = s.filter((o) => o.status === "pending" || o.status === "requires_action").length, ce = w.filter((o) => o.status === "pending").length, ae = p.filter((o) => o.status === "pending").length, te = oe + ce + ae, ne = s.filter((o) => o.status === "succeeded").reduce((o, b) => o + b.amount, 0), ye = w.filter((o) => o.status === "processed").reduce((o, b) => o + b.amountLamports, 0), n = p.filter((o) => o.status === "completed").reduce((o, b) => o + b.amount, 0), a = ne / 100 + ye / 1e6 + n, R = (o) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(o), X = k || I || A, j = (o) => {
2827
2827
  h((b) => !b || b.key !== o ? { key: o, direction: "asc" } : { key: o, direction: b.direction === "asc" ? "desc" : "asc" });
2828
2828
  }, q = (o) => {
2829
2829
  c((b) => !b || b.key !== o ? { key: o, direction: "asc" } : { key: o, direction: b.direction === "asc" ? "desc" : "asc" });
@@ -2855,9 +2855,9 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2855
2855
  return typeof W == "number" && typeof K == "number" ? (W - K) * o : String(W).localeCompare(String(K), void 0, { sensitivity: "base" }) * o;
2856
2856
  });
2857
2857
  }, [s, i]), le = H(() => {
2858
- if (!f) return w;
2859
- const o = f.direction === "asc" ? 1 : -1, b = (P) => {
2860
- switch (f.key) {
2858
+ if (!_) return w;
2859
+ const o = _.direction === "asc" ? 1 : -1, b = (P) => {
2860
+ switch (_.key) {
2861
2861
  case "original":
2862
2862
  return P.originalTransactionId ?? "";
2863
2863
  case "user":
@@ -2879,10 +2879,10 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2879
2879
  const W = b(P), K = b(G);
2880
2880
  return typeof W == "number" && typeof K == "number" ? (W - K) * o : String(W).localeCompare(String(K), void 0, { sensitivity: "base" }) * o;
2881
2881
  });
2882
- }, [w, f]), ue = H(() => {
2883
- if (!_) return g;
2884
- const o = _.direction === "asc" ? 1 : -1, b = (P) => {
2885
- switch (_.key) {
2882
+ }, [w, _]), ue = H(() => {
2883
+ if (!g) return p;
2884
+ const o = g.direction === "asc" ? 1 : -1, b = (P) => {
2885
+ switch (g.key) {
2886
2886
  case "transaction":
2887
2887
  return P.transactionId ?? "";
2888
2888
  case "amount":
@@ -2898,11 +2898,11 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2898
2898
  return P.id;
2899
2899
  }
2900
2900
  };
2901
- return [...g].sort((P, G) => {
2901
+ return [...p].sort((P, G) => {
2902
2902
  const W = b(P), K = b(G);
2903
2903
  return typeof W == "number" && typeof K == "number" ? (W - K) * o : String(W).localeCompare(String(K), void 0, { sensitivity: "base" }) * o;
2904
2904
  });
2905
- }, [g, _]);
2905
+ }, [p, g]);
2906
2906
  return /* @__PURE__ */ t("div", { className: "cedros-admin__page", children: [
2907
2907
  /* @__PURE__ */ e(re, { message: x, onRetry: () => {
2908
2908
  m(), z(), E();
@@ -2982,33 +2982,33 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
2982
2982
  " Loading credits refunds..."
2983
2983
  ] }) : w.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No credits refund requests found." }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ t("table", { className: "cedros-admin__table", children: [
2984
2984
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
2985
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "id" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("id"), children: [
2985
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "id" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("id"), children: [
2986
2986
  "Request ID",
2987
- O(f?.key === "id", f?.direction)
2987
+ O(_?.key === "id", _?.direction)
2988
2988
  ] }) }),
2989
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "original" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("original"), children: [
2989
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "original" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("original"), children: [
2990
2990
  "Original Tx",
2991
- O(f?.key === "original", f?.direction)
2991
+ O(_?.key === "original", _?.direction)
2992
2992
  ] }) }),
2993
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "user" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("user"), children: [
2993
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "user" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("user"), children: [
2994
2994
  "User",
2995
- O(f?.key === "user", f?.direction)
2995
+ O(_?.key === "user", _?.direction)
2996
2996
  ] }) }),
2997
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "amount" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("amount"), children: [
2997
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "amount" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("amount"), children: [
2998
2998
  "Amount",
2999
- O(f?.key === "amount", f?.direction)
2999
+ O(_?.key === "amount", _?.direction)
3000
3000
  ] }) }),
3001
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "reason" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("reason"), children: [
3001
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "reason" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("reason"), children: [
3002
3002
  "Reason",
3003
- O(f?.key === "reason", f?.direction)
3003
+ O(_?.key === "reason", _?.direction)
3004
3004
  ] }) }),
3005
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "status" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("status"), children: [
3005
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "status" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("status"), children: [
3006
3006
  "Status",
3007
- O(f?.key === "status", f?.direction)
3007
+ O(_?.key === "status", _?.direction)
3008
3008
  ] }) }),
3009
- /* @__PURE__ */ e("th", { "aria-sort": f?.key === "date" ? f?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("date"), children: [
3009
+ /* @__PURE__ */ e("th", { "aria-sort": _?.key === "date" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => q("date"), children: [
3010
3010
  "Date",
3011
- O(f?.key === "date", f?.direction)
3011
+ O(_?.key === "date", _?.direction)
3012
3012
  ] }) })
3013
3013
  ] }) }),
3014
3014
  /* @__PURE__ */ e("tbody", { children: le.map((o) => /* @__PURE__ */ t("tr", { children: [
@@ -3026,31 +3026,31 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
3026
3026
  A ? /* @__PURE__ */ t("div", { className: "cedros-admin__loading", children: [
3027
3027
  L.loading,
3028
3028
  " Loading x402 refunds..."
3029
- ] }) : g.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No x402 refund requests found." }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ t("table", { className: "cedros-admin__table", children: [
3029
+ ] }) : p.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No x402 refund requests found." }) : /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ t("table", { className: "cedros-admin__table", children: [
3030
3030
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
3031
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "id" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("id"), children: [
3031
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "id" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("id"), children: [
3032
3032
  "ID",
3033
- O(_?.key === "id", _?.direction)
3033
+ O(g?.key === "id", g?.direction)
3034
3034
  ] }) }),
3035
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "transaction" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("transaction"), children: [
3035
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "transaction" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("transaction"), children: [
3036
3036
  "Transaction",
3037
- O(_?.key === "transaction", _?.direction)
3037
+ O(g?.key === "transaction", g?.direction)
3038
3038
  ] }) }),
3039
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "amount" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("amount"), children: [
3039
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "amount" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("amount"), children: [
3040
3040
  "Amount",
3041
- O(_?.key === "amount", _?.direction)
3041
+ O(g?.key === "amount", g?.direction)
3042
3042
  ] }) }),
3043
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "reason" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("reason"), children: [
3043
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "reason" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("reason"), children: [
3044
3044
  "Reason",
3045
- O(_?.key === "reason", _?.direction)
3045
+ O(g?.key === "reason", g?.direction)
3046
3046
  ] }) }),
3047
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "status" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("status"), children: [
3047
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "status" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("status"), children: [
3048
3048
  "Status",
3049
- O(_?.key === "status", _?.direction)
3049
+ O(g?.key === "status", g?.direction)
3050
3050
  ] }) }),
3051
- /* @__PURE__ */ e("th", { "aria-sort": _?.key === "date" ? _?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("date"), children: [
3051
+ /* @__PURE__ */ e("th", { "aria-sort": g?.key === "date" ? g?.direction === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ t("button", { type: "button", className: "cedros-admin__table-sort", onClick: () => J("date"), children: [
3052
3052
  "Date",
3053
- O(_?.key === "date", _?.direction)
3053
+ O(g?.key === "date", g?.direction)
3054
3054
  ] }) })
3055
3055
  ] }) }),
3056
3056
  /* @__PURE__ */ e("tbody", { children: ue.map((o) => /* @__PURE__ */ t("tr", { children: [
@@ -3067,16 +3067,9 @@ function Me({ serverUrl: p, apiKey: r, pageSize: v = 20, authManager: u }) {
3067
3067
  ] }) })
3068
3068
  ] });
3069
3069
  }
3070
- const Fe = Se(
3071
- () => import("./SettingsSection-vK9WIwXE.mjs").then((p) => ({ default: p.SettingsSection }))
3072
- );
3073
- function We(p) {
3074
- return /* @__PURE__ */ e(ke, { fallback: null, children: /* @__PURE__ */ e(Fe, { ...p }) });
3075
- }
3076
3070
  export {
3077
- Ge as C,
3078
- qe as P,
3079
- Me as R,
3080
- We as S,
3081
- je as T
3071
+ Be as CouponsSection,
3072
+ Ee as ProductsSection,
3073
+ qe as RefundsSection,
3074
+ Oe as TransactionsSection
3082
3075
  };