@cedros/pay-react 0.1.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 (190) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1731 -0
  3. package/dist/CedrosContext-B3iCqN6e.js +11 -0
  4. package/dist/CedrosContext-vX9uqZKp.mjs +1796 -0
  5. package/dist/ar-LVoQZTFI.js +1 -0
  6. package/dist/ar-w27mU-4x.mjs +19 -0
  7. package/dist/bn-BR5Cv1T4.js +1 -0
  8. package/dist/bn-Ba_k3Kex.mjs +19 -0
  9. package/dist/components/CedrosPay.d.ts +54 -0
  10. package/dist/components/CedrosPay.d.ts.map +1 -0
  11. package/dist/components/CryptoButton.d.ts +26 -0
  12. package/dist/components/CryptoButton.d.ts.map +1 -0
  13. package/dist/components/PaymentModal.d.ts +28 -0
  14. package/dist/components/PaymentModal.d.ts.map +1 -0
  15. package/dist/components/ProductPrice.d.ts +56 -0
  16. package/dist/components/ProductPrice.d.ts.map +1 -0
  17. package/dist/components/PurchaseButton.d.ts +52 -0
  18. package/dist/components/PurchaseButton.d.ts.map +1 -0
  19. package/dist/components/StripeButton.d.ts +27 -0
  20. package/dist/components/StripeButton.d.ts.map +1 -0
  21. package/dist/context/CedrosContext.d.ts +46 -0
  22. package/dist/context/CedrosContext.d.ts.map +1 -0
  23. package/dist/context/ThemeContext.d.ts +30 -0
  24. package/dist/context/ThemeContext.d.ts.map +1 -0
  25. package/dist/context/index.d.ts +3 -0
  26. package/dist/context/index.d.ts.map +1 -0
  27. package/dist/crypto-only.d.ts +33 -0
  28. package/dist/crypto-only.d.ts.map +1 -0
  29. package/dist/crypto-only.js +1 -0
  30. package/dist/crypto-only.mjs +35 -0
  31. package/dist/de-CoZiPFN7.mjs +19 -0
  32. package/dist/de-pQxy-oD1.js +1 -0
  33. package/dist/en-CSsJl3nf.mjs +19 -0
  34. package/dist/en-D-uY3ltT.js +1 -0
  35. package/dist/es-BWGIBp2f.mjs +19 -0
  36. package/dist/es-D24cg8dD.js +1 -0
  37. package/dist/fil-BOBft9G-.js +1 -0
  38. package/dist/fil-Czo27xmj.mjs +19 -0
  39. package/dist/fr-Ct9ub8Fa.js +1 -0
  40. package/dist/fr-DQ-2ThBv.mjs +19 -0
  41. package/dist/he-DpV1WnBQ.mjs +19 -0
  42. package/dist/he-DtQqRKRq.js +1 -0
  43. package/dist/hooks/usePaymentMode.d.ts +39 -0
  44. package/dist/hooks/usePaymentMode.d.ts.map +1 -0
  45. package/dist/hooks/useRefundVerification.d.ts +30 -0
  46. package/dist/hooks/useRefundVerification.d.ts.map +1 -0
  47. package/dist/hooks/useStripeCheckout.d.ts +20 -0
  48. package/dist/hooks/useStripeCheckout.d.ts.map +1 -0
  49. package/dist/hooks/useX402Payment.d.ts +24 -0
  50. package/dist/hooks/useX402Payment.d.ts.map +1 -0
  51. package/dist/i18n/index.d.ts +107 -0
  52. package/dist/i18n/index.d.ts.map +1 -0
  53. package/dist/i18n/useTranslation.d.ts +55 -0
  54. package/dist/i18n/useTranslation.d.ts.map +1 -0
  55. package/dist/id-BJMqsu19.mjs +19 -0
  56. package/dist/id-CiM2mL7C.js +1 -0
  57. package/dist/in-BxgxKLQH.mjs +19 -0
  58. package/dist/in-Bzcjmxcc.js +1 -0
  59. package/dist/index.d.ts +33 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/index.mjs +626 -0
  63. package/dist/it-Blb_pIJl.js +1 -0
  64. package/dist/it-DZFFPALf.mjs +19 -0
  65. package/dist/jp-9NHyIuwY.js +1 -0
  66. package/dist/jp-ZExTrlHK.mjs +19 -0
  67. package/dist/kr-DHX3i4Ht.mjs +19 -0
  68. package/dist/kr-DvzJ-0yX.js +1 -0
  69. package/dist/managers/ManagerCache.d.ts +49 -0
  70. package/dist/managers/ManagerCache.d.ts.map +1 -0
  71. package/dist/managers/RouteDiscoveryManager.d.ts +72 -0
  72. package/dist/managers/RouteDiscoveryManager.d.ts.map +1 -0
  73. package/dist/managers/StripeManager.d.ts +110 -0
  74. package/dist/managers/StripeManager.d.ts.map +1 -0
  75. package/dist/managers/WalletManager.d.ts +150 -0
  76. package/dist/managers/WalletManager.d.ts.map +1 -0
  77. package/dist/managers/X402Manager.d.ts +176 -0
  78. package/dist/managers/X402Manager.d.ts.map +1 -0
  79. package/dist/ms-BOAu5pUB.js +1 -0
  80. package/dist/ms-Cv1fdIi2.mjs +19 -0
  81. package/dist/nl-BmGonsKb.mjs +19 -0
  82. package/dist/nl-WHh_DfO8.js +1 -0
  83. package/dist/pa-B7kIhZCF.js +1 -0
  84. package/dist/pa-BfwcJIar.mjs +19 -0
  85. package/dist/pay-react.css +1 -0
  86. package/dist/pl-DE5IB9xv.mjs +19 -0
  87. package/dist/pl-H0hBKdvF.js +1 -0
  88. package/dist/pt-CLzkqDzf.mjs +19 -0
  89. package/dist/pt-DwGrViQ3.js +1 -0
  90. package/dist/ru-CB2m0UDT.js +1 -0
  91. package/dist/ru-DM6-oUR0.mjs +19 -0
  92. package/dist/stripe-only.d.ts +31 -0
  93. package/dist/stripe-only.d.ts.map +1 -0
  94. package/dist/stripe-only.js +1 -0
  95. package/dist/stripe-only.mjs +33 -0
  96. package/dist/styles-D3XGpsqb.js +1 -0
  97. package/dist/styles-zgmHs6Hs.mjs +1601 -0
  98. package/dist/ta-A5HnrGb5.mjs +19 -0
  99. package/dist/ta-CAS197uN.js +1 -0
  100. package/dist/telemetry.d.ts +27 -0
  101. package/dist/telemetry.d.ts.map +1 -0
  102. package/dist/telemetry.js +1 -0
  103. package/dist/telemetry.mjs +127 -0
  104. package/dist/testing/__tests__/providers.test.d.ts +10 -0
  105. package/dist/testing/__tests__/providers.test.d.ts.map +1 -0
  106. package/dist/testing/helpers.d.ts +242 -0
  107. package/dist/testing/helpers.d.ts.map +1 -0
  108. package/dist/testing/index.d.ts +12 -0
  109. package/dist/testing/index.d.ts.map +1 -0
  110. package/dist/testing/index.js +1 -0
  111. package/dist/testing/index.mjs +374 -0
  112. package/dist/testing/mocks.d.ts +225 -0
  113. package/dist/testing/mocks.d.ts.map +1 -0
  114. package/dist/testing/providers.d.ts +89 -0
  115. package/dist/testing/providers.d.ts.map +1 -0
  116. package/dist/th-3fbB3Ytp.mjs +19 -0
  117. package/dist/th-Cpz2cFcg.js +1 -0
  118. package/dist/tr-BrgfFFdq.mjs +19 -0
  119. package/dist/tr-hQrEFk86.js +1 -0
  120. package/dist/types/componentOptions.d.ts +138 -0
  121. package/dist/types/componentOptions.d.ts.map +1 -0
  122. package/dist/types/errors.d.ts +213 -0
  123. package/dist/types/errors.d.ts.map +1 -0
  124. package/dist/types/index.d.ts +248 -0
  125. package/dist/types/index.d.ts.map +1 -0
  126. package/dist/uk-0hFun_g_.mjs +19 -0
  127. package/dist/uk-DrK2Sv8C.js +1 -0
  128. package/dist/ur-CaOjJXai.mjs +19 -0
  129. package/dist/ur-D5-7mN9a.js +1 -0
  130. package/dist/utils/__tests__/cspHelper.test.d.ts +9 -0
  131. package/dist/utils/__tests__/cspHelper.test.d.ts.map +1 -0
  132. package/dist/utils/__tests__/fetchWithTimeout.test.d.ts +11 -0
  133. package/dist/utils/__tests__/fetchWithTimeout.test.d.ts.map +1 -0
  134. package/dist/utils/cartHelpers.d.ts +105 -0
  135. package/dist/utils/cartHelpers.d.ts.map +1 -0
  136. package/dist/utils/circuitBreaker.d.ts +112 -0
  137. package/dist/utils/circuitBreaker.d.ts.map +1 -0
  138. package/dist/utils/couponHelpers.d.ts +50 -0
  139. package/dist/utils/couponHelpers.d.ts.map +1 -0
  140. package/dist/utils/cspHelper.d.ts +162 -0
  141. package/dist/utils/cspHelper.d.ts.map +1 -0
  142. package/dist/utils/deprecation.d.ts +128 -0
  143. package/dist/utils/deprecation.d.ts.map +1 -0
  144. package/dist/utils/errorHandling.d.ts +30 -0
  145. package/dist/utils/errorHandling.d.ts.map +1 -0
  146. package/dist/utils/errorMessages.d.ts +47 -0
  147. package/dist/utils/errorMessages.d.ts.map +1 -0
  148. package/dist/utils/errorParser.d.ts +37 -0
  149. package/dist/utils/errorParser.d.ts.map +1 -0
  150. package/dist/utils/eventEmitter.d.ts +119 -0
  151. package/dist/utils/eventEmitter.d.ts.map +1 -0
  152. package/dist/utils/exponentialBackoff.d.ts +104 -0
  153. package/dist/utils/exponentialBackoff.d.ts.map +1 -0
  154. package/dist/utils/fetchWithTimeout.d.ts +13 -0
  155. package/dist/utils/fetchWithTimeout.d.ts.map +1 -0
  156. package/dist/utils/index.d.ts +15 -0
  157. package/dist/utils/index.d.ts.map +1 -0
  158. package/dist/utils/logger.d.ts +76 -0
  159. package/dist/utils/logger.d.ts.map +1 -0
  160. package/dist/utils/modalStyles.d.ts +13 -0
  161. package/dist/utils/modalStyles.d.ts.map +1 -0
  162. package/dist/utils/rateLimiter.d.ts +88 -0
  163. package/dist/utils/rateLimiter.d.ts.map +1 -0
  164. package/dist/utils/requestDeduplication.d.ts +124 -0
  165. package/dist/utils/requestDeduplication.d.ts.map +1 -0
  166. package/dist/utils/securityValidation.d.ts +75 -0
  167. package/dist/utils/securityValidation.d.ts.map +1 -0
  168. package/dist/utils/solanaCheck.d.ts +10 -0
  169. package/dist/utils/solanaCheck.d.ts.map +1 -0
  170. package/dist/utils/telemetry.d.ts +277 -0
  171. package/dist/utils/telemetry.d.ts.map +1 -0
  172. package/dist/utils/tokenMintValidator.d.ts +77 -0
  173. package/dist/utils/tokenMintValidator.d.ts.map +1 -0
  174. package/dist/utils/uuid.d.ts +13 -0
  175. package/dist/utils/uuid.d.ts.map +1 -0
  176. package/dist/utils/validateConfig.d.ts +13 -0
  177. package/dist/utils/validateConfig.d.ts.map +1 -0
  178. package/dist/utils/walletDetection.d.ts +6 -0
  179. package/dist/utils/walletDetection.d.ts.map +1 -0
  180. package/dist/utils/walletPool.d.ts +57 -0
  181. package/dist/utils/walletPool.d.ts.map +1 -0
  182. package/dist/uuid-C0iMjdcc.js +1 -0
  183. package/dist/uuid-UlzrVY8Y.mjs +17 -0
  184. package/dist/vn-0nlIZFLP.mjs +19 -0
  185. package/dist/vn-B_iut9YL.js +1 -0
  186. package/dist/walletDetection-JZR3UCOa.mjs +27 -0
  187. package/dist/walletDetection-bNmV5ItZ.js +1 -0
  188. package/dist/zh-B4Endr1F.mjs +19 -0
  189. package/dist/zh-PR82dCHr.js +1 -0
  190. package/package.json +139 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,626 @@
1
+ import { jsxs as q, jsx as E, Fragment as te } from "react/jsx-runtime";
2
+ import M, { useState as O, useCallback as N, useMemo as G } from "react";
3
+ import { ConnectionProvider as se, WalletProvider as re, useWallet as oe } from "@solana/wallet-adapter-react";
4
+ import { u as ne, c as V, o as ae, q as Y, e as ce, g as ie, h as le, i as ue, r as de, P as pe, S as me, m as fe } from "./styles-zgmHs6Hs.mjs";
5
+ import { C as Be, E as Ke, b as Ge, a as Ve, d as Ye, z as ze, w as Qe, s as Fe, t as Xe, v as Je, f as Ze, y as et, A as tt, l as st, k as rt, x as ot, p as nt, j as at, B as ct, n as it } from "./styles-zgmHs6Hs.mjs";
6
+ import { a as z, u as Q, g as he, f as j } from "./CedrosContext-vX9uqZKp.mjs";
7
+ import { k as ut, C as dt, j as pt, i as mt, L as ft, b as ht, R as yt, l as St, W as gt, h as Ct, d as Pt, c as vt, m as Et, r as wt, v as Tt } from "./CedrosContext-vX9uqZKp.mjs";
8
+ import { clusterApiUrl as ye } from "@solana/web3.js";
9
+ function Se(t) {
10
+ switch (t) {
11
+ case "mainnet-beta":
12
+ return "https://api.mainnet-beta.solana.com";
13
+ case "devnet":
14
+ return "https://api.devnet.solana.com";
15
+ case "testnet":
16
+ return "https://api.testnet.solana.com";
17
+ default:
18
+ return "https://api.mainnet-beta.solana.com";
19
+ }
20
+ }
21
+ function ge(t) {
22
+ try {
23
+ const s = new URL(t);
24
+ return `${s.protocol}//${s.host}`;
25
+ } catch {
26
+ return t;
27
+ }
28
+ }
29
+ function Ce(t = {}) {
30
+ const {
31
+ solanaCluster: s = "mainnet-beta",
32
+ solanaEndpoint: r,
33
+ customRpcProviders: o = [],
34
+ allowUnsafeScripts: n = !1,
35
+ additionalScriptSrc: e = [],
36
+ additionalConnectSrc: h = [],
37
+ additionalFrameSrc: m = [],
38
+ includeStripe: y = !0
39
+ } = t, l = ["'self'"];
40
+ n && l.push("'unsafe-inline'", "'unsafe-eval'"), y && l.push("https://js.stripe.com"), l.push(...e);
41
+ const i = ["'self'"];
42
+ y && i.push("https://api.stripe.com", "https://*.stripe.com");
43
+ const b = Se(s);
44
+ if (i.push(b), i.push("https://*.solana.com"), r) {
45
+ const P = ge(r);
46
+ i.includes(P) || i.push(P);
47
+ }
48
+ o.forEach((P) => {
49
+ i.includes(P) || i.push(P);
50
+ }), i.push(...h);
51
+ const g = ["'self'"];
52
+ return y && g.push("https://js.stripe.com", "https://checkout.stripe.com"), g.push(...m), {
53
+ scriptSrc: l,
54
+ connectSrc: i,
55
+ frameSrc: g
56
+ };
57
+ }
58
+ function Pe(t, s = "header") {
59
+ const { scriptSrc: r, connectSrc: o, frameSrc: n } = t;
60
+ switch (s) {
61
+ case "header":
62
+ case "meta":
63
+ case "nextjs":
64
+ case "nginx": {
65
+ const e = [];
66
+ return r.length > 0 && e.push(`script-src ${r.join(" ")}`), o.length > 0 && e.push(`connect-src ${o.join(" ")}`), n.length > 0 && e.push(`frame-src ${n.join(" ")}`), e.join("; ");
67
+ }
68
+ case "helmet": {
69
+ const e = {};
70
+ return r.length > 0 && (e.scriptSrc = r), o.length > 0 && (e.connectSrc = o), n.length > 0 && (e.frameSrc = n), e;
71
+ }
72
+ case "directives":
73
+ return { scriptSrc: r, connectSrc: o, frameSrc: n };
74
+ default:
75
+ throw new Error(`Unknown CSP format: ${s}`);
76
+ }
77
+ }
78
+ function xe(t = {}, s = "header") {
79
+ const r = Ce(t);
80
+ return Pe(r, s);
81
+ }
82
+ const Ue = {
83
+ HELIUS: "https://*.helius-rpc.com",
84
+ QUICKNODE: "https://*.quicknode.pro",
85
+ ALCHEMY: "https://*.alchemy.com",
86
+ ANKR: "https://rpc.ankr.com",
87
+ TRITON: "https://*.rpcpool.com"
88
+ }, qe = {
89
+ /**
90
+ * Mainnet production with custom RPC (recommended)
91
+ */
92
+ MAINNET_CUSTOM_RPC: (t) => ({
93
+ solanaCluster: "mainnet-beta",
94
+ solanaEndpoint: t,
95
+ allowUnsafeScripts: !1
96
+ }),
97
+ /**
98
+ * Mainnet with Next.js (requires unsafe-inline/eval)
99
+ */
100
+ MAINNET_NEXTJS: (t) => ({
101
+ solanaCluster: "mainnet-beta",
102
+ solanaEndpoint: t,
103
+ allowUnsafeScripts: !0
104
+ }),
105
+ /**
106
+ * Devnet for testing
107
+ */
108
+ DEVNET: () => ({
109
+ solanaCluster: "devnet",
110
+ allowUnsafeScripts: !0
111
+ }),
112
+ /**
113
+ * Crypto-only payments (no Stripe)
114
+ */
115
+ CRYPTO_ONLY: (t) => ({
116
+ solanaCluster: "mainnet-beta",
117
+ solanaEndpoint: t,
118
+ includeStripe: !1
119
+ }),
120
+ /**
121
+ * Stripe-only payments (no Solana)
122
+ */
123
+ STRIPE_ONLY: () => ({
124
+ solanaCluster: "mainnet-beta",
125
+ includeStripe: !0,
126
+ // Don't include Solana RPC endpoints
127
+ customRpcProviders: []
128
+ })
129
+ }, ve = ({
130
+ resource: t,
131
+ items: s,
132
+ label: r,
133
+ cardLabel: o,
134
+ cryptoLabel: n,
135
+ showCard: e = !0,
136
+ showCrypto: h = !0,
137
+ onPaymentAttempt: m,
138
+ onPaymentSuccess: y,
139
+ onPaymentError: l,
140
+ onStripeSuccess: i,
141
+ onCryptoSuccess: b,
142
+ onStripeError: g,
143
+ onCryptoError: P,
144
+ customerEmail: u,
145
+ successUrl: c,
146
+ cancelUrl: a,
147
+ metadata: S,
148
+ couponCode: v,
149
+ autoDetectWallets: C = !0,
150
+ testPageUrl: w,
151
+ hideMessages: A = !1,
152
+ renderModal: k
153
+ }) => {
154
+ const T = z(), [D, d] = O(!1), { status: F, processPayment: H, processCartCheckout: W } = ne(), { isCartMode: R, effectiveResource: I } = V(t, s), { t: L } = ae(), X = r || L("ui.purchase"), J = o || L("ui.card"), Z = n || L("ui.usdc_solana"), $ = N(async () => {
155
+ if (C && e) {
156
+ const { detectSolanaWallets: p } = await import("./walletDetection-JZR3UCOa.mjs");
157
+ if (!p()) {
158
+ const x = R ? void 0 : I, U = R && s ? Y(s) : void 0;
159
+ ce("stripe", x, U), m && m("stripe"), ie("stripe", x, U);
160
+ let f;
161
+ R && s ? f = await W(
162
+ s,
163
+ c,
164
+ a,
165
+ S,
166
+ u,
167
+ v
168
+ ) : I && (f = await H(
169
+ I,
170
+ c,
171
+ a,
172
+ S,
173
+ u,
174
+ v
175
+ )), f && f.success && f.transactionId ? (le("stripe", f.transactionId, x, U), i ? i(f.transactionId) : y && y(f.transactionId)) : f && !f.success && f.error && (ue("stripe", f.error, x, U), g ? g(f.error) : l && l(f.error));
176
+ return;
177
+ }
178
+ }
179
+ d(!0);
180
+ }, [C, e, R, s, I, W, H, c, a, S, u, v, y, l, i, g, m]), B = G(() => R && s ? `purchase-cart-${s.map((p) => p.resource).join("-")}` : `purchase-${I || "unknown"}`, [R, s, I]), ee = G(
181
+ () => de(B, $),
182
+ [B, $]
183
+ ), _ = F === "loading", K = {
184
+ isOpen: D,
185
+ onClose: () => d(!1),
186
+ resource: R ? void 0 : I,
187
+ items: R ? s : void 0,
188
+ cardLabel: J,
189
+ cryptoLabel: Z,
190
+ showCard: e,
191
+ showCrypto: h,
192
+ onPaymentAttempt: m,
193
+ onPaymentSuccess: (p) => {
194
+ d(!1), y?.(p);
195
+ },
196
+ onPaymentError: (p) => {
197
+ d(!1), l?.(p);
198
+ },
199
+ onStripeSuccess: (p) => {
200
+ d(!1), i?.(p);
201
+ },
202
+ onCryptoSuccess: (p) => {
203
+ d(!1), b?.(p);
204
+ },
205
+ onStripeError: (p) => {
206
+ d(!1), g?.(p);
207
+ },
208
+ onCryptoError: (p) => {
209
+ d(!1), P?.(p);
210
+ },
211
+ customerEmail: u,
212
+ successUrl: c,
213
+ cancelUrl: a,
214
+ metadata: S,
215
+ couponCode: v,
216
+ testPageUrl: w,
217
+ hideMessages: A
218
+ };
219
+ return /* @__PURE__ */ q("div", { className: T.unstyled ? "" : T.className, style: T.unstyled ? {} : T.style, children: [
220
+ /* @__PURE__ */ E(
221
+ "button",
222
+ {
223
+ onClick: ee,
224
+ disabled: _,
225
+ className: T.unstyled ? "" : "cedros-theme__button cedros-theme__stripe",
226
+ style: {
227
+ width: "100%",
228
+ cursor: _ ? "not-allowed" : "pointer",
229
+ opacity: _ ? 0.6 : 1
230
+ },
231
+ type: "button",
232
+ children: _ ? L("ui.processing") : X
233
+ }
234
+ ),
235
+ k ? k(K) : /* @__PURE__ */ E(pe, { ...K })
236
+ ] });
237
+ };
238
+ function Oe(t) {
239
+ const { resource: s, items: r, checkout: o = {}, display: n = {}, callbacks: e = {}, advanced: h = {} } = t, { config: m, walletPool: y } = Q(), l = z(), { isCartMode: i } = V(s, r), b = M.useMemo(() => ({
240
+ marginTop: "0.5rem",
241
+ fontSize: "0.875rem",
242
+ color: l.tokens.surfaceText,
243
+ opacity: 0.7,
244
+ textAlign: "center"
245
+ }), [l.tokens.surfaceText]), g = M.useMemo(
246
+ () => h.wallets && h.wallets.length > 0 ? h.wallets : y.getAdapters(),
247
+ [h.wallets, y]
248
+ ), P = M.useMemo(
249
+ () => r ? Y(r) : 0,
250
+ [r]
251
+ ), u = M.useMemo(
252
+ () => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "stripe" }) : void 0,
253
+ [e.onPaymentSuccess]
254
+ ), c = M.useMemo(
255
+ () => e.onPaymentSuccess ? (d) => e.onPaymentSuccess({ transactionId: d, method: "crypto" }) : void 0,
256
+ [e.onPaymentSuccess]
257
+ ), a = M.useMemo(
258
+ () => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "stripe" }) : void 0,
259
+ [e.onPaymentError]
260
+ ), S = M.useMemo(
261
+ () => e.onPaymentError ? (d) => e.onPaymentError({ message: d, method: "crypto" }) : void 0,
262
+ [e.onPaymentError]
263
+ ), v = m.solanaEndpoint ?? ye(m.solanaCluster);
264
+ if (!s && (!r || r.length === 0))
265
+ return he().error('CedrosPay: Must provide either "resource" or "items" prop'), /* @__PURE__ */ E("div", { className: n.className, style: { color: l.tokens.errorText }, children: "Configuration error: No resource or items provided" });
266
+ const C = n.showCard ?? !0, w = n.showCrypto ?? !0, A = n.showPurchaseButton ?? !1, k = n.layout ?? "vertical", T = n.hideMessages ?? !1, D = h.autoDetectWallets ?? !0;
267
+ return /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : l.className, style: l.unstyled ? {} : l.style, children: /* @__PURE__ */ E(se, { endpoint: v, children: /* @__PURE__ */ E(re, { wallets: g, autoConnect: !1, children: /* @__PURE__ */ E("div", { className: l.unstyled ? n.className : `cedros-theme__pay ${n.className || ""}`, children: /* @__PURE__ */ q("div", { className: l.unstyled ? "" : `cedros-theme__pay-content cedros-theme__pay-content--${k}`, children: [
268
+ A ? /* @__PURE__ */ E(
269
+ ve,
270
+ {
271
+ resource: i ? void 0 : s || r?.[0]?.resource,
272
+ items: i ? r : void 0,
273
+ label: n.purchaseLabel,
274
+ cardLabel: n.cardLabel,
275
+ cryptoLabel: n.cryptoLabel,
276
+ showCard: C,
277
+ showCrypto: w,
278
+ onPaymentAttempt: e.onPaymentAttempt,
279
+ onPaymentSuccess: u,
280
+ onPaymentError: a,
281
+ onStripeSuccess: u,
282
+ onCryptoSuccess: c,
283
+ onStripeError: a,
284
+ onCryptoError: S,
285
+ customerEmail: o.customerEmail,
286
+ successUrl: o.successUrl,
287
+ cancelUrl: o.cancelUrl,
288
+ metadata: o.metadata,
289
+ couponCode: o.couponCode,
290
+ autoDetectWallets: D,
291
+ testPageUrl: h.testPageUrl,
292
+ hideMessages: T,
293
+ renderModal: n.renderModal
294
+ }
295
+ ) : /* @__PURE__ */ q(te, { children: [
296
+ C && /* @__PURE__ */ E(
297
+ me,
298
+ {
299
+ resource: i ? void 0 : s || r?.[0]?.resource,
300
+ items: i ? r : void 0,
301
+ customerEmail: o.customerEmail,
302
+ successUrl: o.successUrl,
303
+ cancelUrl: o.cancelUrl,
304
+ metadata: o.metadata,
305
+ couponCode: o.couponCode,
306
+ label: n.cardLabel,
307
+ onAttempt: e.onPaymentAttempt,
308
+ onSuccess: u,
309
+ onError: a
310
+ }
311
+ ),
312
+ w && /* @__PURE__ */ E(
313
+ fe,
314
+ {
315
+ resource: i ? void 0 : s || r?.[0]?.resource,
316
+ items: i ? r : void 0,
317
+ metadata: o.metadata,
318
+ couponCode: o.couponCode,
319
+ label: n.cryptoLabel,
320
+ onAttempt: e.onPaymentAttempt,
321
+ onSuccess: c,
322
+ onError: S,
323
+ testPageUrl: h.testPageUrl,
324
+ hideMessages: T
325
+ }
326
+ )
327
+ ] }),
328
+ i && r && r.length > 1 && !T && /* @__PURE__ */ q("div", { style: b, children: [
329
+ "Checking out ",
330
+ P,
331
+ " items"
332
+ ] })
333
+ ] }) }) }) }) });
334
+ }
335
+ function Ae() {
336
+ const { x402Manager: t, walletManager: s } = Q(), { publicKey: r, signTransaction: o } = oe(), [n, e] = O({
337
+ status: "idle",
338
+ error: null,
339
+ transactionId: null
340
+ }), [h, m] = O(null), [y, l] = O(null), i = N(
341
+ async (u) => {
342
+ try {
343
+ e((a) => ({ ...a, status: "loading" }));
344
+ const c = await t.requestQuote({ resource: u });
345
+ if (!t.validateRequirement(c))
346
+ throw new Error("Invalid refund requirement received from server");
347
+ return m(c), e((a) => ({ ...a, status: "idle" })), c;
348
+ } catch (c) {
349
+ const a = j(c, "Failed to fetch refund requirement");
350
+ throw e({
351
+ status: "error",
352
+ error: a,
353
+ transactionId: null
354
+ }), c;
355
+ }
356
+ },
357
+ [t]
358
+ ), b = N(
359
+ async (u, c) => {
360
+ if (!r || !o)
361
+ throw new Error("Wallet not connected");
362
+ try {
363
+ e({
364
+ status: "loading",
365
+ error: null,
366
+ transactionId: null
367
+ });
368
+ const a = await t.requestQuote({ resource: u, couponCode: c });
369
+ if (!t.validateRequirement(a))
370
+ throw new Error("Invalid refund requirement received");
371
+ m(a);
372
+ const S = await s.buildTransaction({
373
+ requirement: a,
374
+ payerPublicKey: r
375
+ }), v = await s.signTransaction({
376
+ transaction: S,
377
+ signTransaction: o
378
+ }), C = s.buildPaymentPayload({
379
+ requirement: a,
380
+ signedTx: v,
381
+ payerPublicKey: r
382
+ }), w = await t.submitPayment({
383
+ resource: u,
384
+ payload: C,
385
+ couponCode: c,
386
+ metadata: void 0,
387
+ // no metadata for refunds
388
+ resourceType: "refund"
389
+ });
390
+ return w.settlement && l(w.settlement), e({
391
+ status: "success",
392
+ error: null,
393
+ transactionId: w.transactionId || v.signature
394
+ }), w;
395
+ } catch (a) {
396
+ const S = j(a, "Refund payment failed");
397
+ throw e({
398
+ status: "error",
399
+ error: S,
400
+ transactionId: null
401
+ }), a;
402
+ }
403
+ },
404
+ [r, o, t, s]
405
+ ), g = N(
406
+ async (u) => {
407
+ if (!r || !o)
408
+ throw new Error("Wallet not connected");
409
+ try {
410
+ e({
411
+ status: "loading",
412
+ error: null,
413
+ transactionId: null
414
+ });
415
+ const c = await t.requestQuote({ resource: u });
416
+ if (!t.validateRequirement(c))
417
+ throw new Error("Invalid refund requirement received");
418
+ m(c);
419
+ const { transaction: a } = await t.buildGaslessTransaction({
420
+ resourceId: u,
421
+ userWallet: r.toString(),
422
+ feePayer: c.extra.feePayer
423
+ }), S = s.deserializeTransaction(a), v = await s.partiallySignTransaction({
424
+ transaction: S,
425
+ signTransaction: o
426
+ }), C = await t.submitGaslessTransaction({
427
+ resource: u,
428
+ partialTx: v,
429
+ couponCode: void 0,
430
+ // no couponCode
431
+ metadata: void 0,
432
+ // no metadata
433
+ resourceType: "refund",
434
+ requirement: c
435
+ });
436
+ return C.settlement && l(C.settlement), e({
437
+ status: "success",
438
+ error: null,
439
+ transactionId: C.transactionId || "gasless-refund-tx"
440
+ }), C;
441
+ } catch (c) {
442
+ const a = j(c, "Gasless refund payment failed");
443
+ throw e({
444
+ status: "error",
445
+ error: a,
446
+ transactionId: null
447
+ }), c;
448
+ }
449
+ },
450
+ [r, o, t, s]
451
+ ), P = N(() => {
452
+ e({
453
+ status: "idle",
454
+ error: null,
455
+ transactionId: null
456
+ }), m(null), l(null);
457
+ }, []);
458
+ return {
459
+ state: n,
460
+ requirement: h,
461
+ settlement: y,
462
+ fetchRefundQuote: i,
463
+ processRefund: b,
464
+ processGaslessRefund: g,
465
+ reset: P
466
+ };
467
+ }
468
+ function Ee() {
469
+ if (typeof window > "u")
470
+ return {
471
+ passed: !0,
472
+ severity: "info",
473
+ message: "HTTPS check skipped (SSR environment)"
474
+ };
475
+ const t = window.location.protocol === "https:", s = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
476
+ return t || s ? {
477
+ passed: !0,
478
+ severity: "info",
479
+ message: "HTTPS enforced"
480
+ } : {
481
+ passed: !1,
482
+ severity: "error",
483
+ message: "Page not served over HTTPS",
484
+ recommendation: "Enable HTTPS for all payment pages. Stripe.js requires HTTPS in production."
485
+ };
486
+ }
487
+ function we() {
488
+ return typeof document > "u" ? {
489
+ passed: !0,
490
+ severity: "info",
491
+ message: "CSP check skipped (SSR environment)"
492
+ } : document.querySelector('meta[http-equiv="Content-Security-Policy"]') ? {
493
+ passed: !0,
494
+ severity: "info",
495
+ message: "Content Security Policy detected"
496
+ } : {
497
+ passed: !1,
498
+ severity: "warning",
499
+ message: "No Content Security Policy detected",
500
+ recommendation: "Configure CSP headers to protect against XSS and CDN compromise. Use generateCSP() helper from @cedros/pay-react."
501
+ };
502
+ }
503
+ function Te() {
504
+ return process.env.NODE_ENV === "development" || typeof window < "u" && window.location.hostname === "localhost" ? {
505
+ passed: !0,
506
+ severity: "info",
507
+ message: "Running in development mode (some security checks relaxed)"
508
+ } : {
509
+ passed: !0,
510
+ severity: "info",
511
+ message: "Running in production mode"
512
+ };
513
+ }
514
+ function Re() {
515
+ return {
516
+ passed: !0,
517
+ severity: "info",
518
+ message: "Stripe.js loaded via @stripe/stripe-js package (CSP recommended, not SRI)",
519
+ recommendation: "Ensure CSP script-src includes https://js.stripe.com"
520
+ };
521
+ }
522
+ function be() {
523
+ return typeof window > "u" ? {
524
+ passed: !0,
525
+ severity: "info",
526
+ message: "Mixed content check skipped (SSR environment)"
527
+ } : window.location.protocol === "https:" ? {
528
+ passed: !0,
529
+ severity: "info",
530
+ message: "Mixed content protection active (HTTPS page)"
531
+ } : {
532
+ passed: !0,
533
+ severity: "info",
534
+ message: "Mixed content check skipped (HTTP page)"
535
+ };
536
+ }
537
+ function De() {
538
+ const t = [
539
+ Ee(),
540
+ we(),
541
+ Te(),
542
+ Re(),
543
+ be()
544
+ ], s = t.some((e) => e.severity === "error" && !e.passed), r = t.some((e) => e.severity === "warning" && !e.passed);
545
+ let o, n;
546
+ return s ? (o = "vulnerable", n = "Security issues detected. Review errors and apply recommendations.") : r ? (o = "warnings", n = "Minor security warnings detected. Consider applying recommendations.") : (o = "secure", n = "All security checks passed."), {
547
+ checks: t,
548
+ overallStatus: o,
549
+ summary: n
550
+ };
551
+ }
552
+ function je(t) {
553
+ process.env.NODE_ENV !== "production" && (console.group("🔒 Cedros Pay Security Report"), console.log(`Status: ${t.overallStatus.toUpperCase()}`), console.log(`Summary: ${t.summary}`), console.log(""), t.checks.forEach((s) => {
554
+ const r = s.passed ? "✅" : s.severity === "error" ? "❌" : "⚠️";
555
+ console.log(`${r} ${s.message}`), s.recommendation && console.log(` → ${s.recommendation}`);
556
+ }), console.groupEnd());
557
+ }
558
+ const He = {
559
+ CSP: "Use generateCSP() from @cedros/pay-react to generate Content Security Policy headers",
560
+ HTTPS: "Always serve payment pages over HTTPS in production",
561
+ PACKAGE_UPDATES: "Keep @stripe/stripe-js and @cedros/pay-react updated for security patches",
562
+ AUDIT: "Run npm audit regularly to check for known vulnerabilities",
563
+ MONITORING: "Monitor Stripe security advisories and apply updates promptly",
564
+ NO_SRI: "Do NOT use SRI hashes for Stripe.js - use CSP instead"
565
+ };
566
+ export {
567
+ Be as CEDROS_EVENTS,
568
+ ut as CIRCUIT_BREAKER_PRESETS,
569
+ qe as CSP_PRESETS,
570
+ Oe as CedrosPay,
571
+ dt as CedrosProvider,
572
+ pt as CircuitBreakerOpenError,
573
+ mt as CircuitState,
574
+ fe as CryptoButton,
575
+ Ke as ERROR_CATEGORIES,
576
+ ft as LogLevel,
577
+ ht as Logger,
578
+ Ge as PaymentMethodBadge,
579
+ pe as PaymentModal,
580
+ Ve as ProductPrice,
581
+ ve as PurchaseButton,
582
+ yt as RATE_LIMITER_PRESETS,
583
+ St as RETRY_PRESETS,
584
+ Ue as RPC_PROVIDERS,
585
+ He as SECURITY_RECOMMENDATIONS,
586
+ me as StripeButton,
587
+ gt as WalletPool,
588
+ Ye as calculateDiscountPercentage,
589
+ Ct as createCircuitBreaker,
590
+ Pt as createLogger,
591
+ vt as createRateLimiter,
592
+ ze as createTranslator,
593
+ Et as createWalletPool,
594
+ Qe as detectLocale,
595
+ ue as emitPaymentError,
596
+ ie as emitPaymentProcessing,
597
+ ce as emitPaymentStart,
598
+ le as emitPaymentSuccess,
599
+ Fe as emitWalletConnect,
600
+ Xe as emitWalletConnected,
601
+ Je as emitWalletError,
602
+ Pe as formatCSP,
603
+ Ze as formatCouponCodes,
604
+ xe as generateCSP,
605
+ Ce as generateCSPDirectives,
606
+ et as getAvailableLocales,
607
+ tt as getLocalizedError,
608
+ he as getLogger,
609
+ st as getUserErrorMessage,
610
+ rt as isRetryableError,
611
+ ot as loadLocale,
612
+ je as logSecurityReport,
613
+ nt as parseCouponCodes,
614
+ at as parseStructuredErrorResponse,
615
+ wt as retryWithBackoff,
616
+ Q as useCedrosContext,
617
+ z as useCedrosTheme,
618
+ ct as useLocalizedError,
619
+ V as usePaymentMode,
620
+ Ae as useRefundVerification,
621
+ ne as useStripeCheckout,
622
+ ae as useTranslation,
623
+ it as useX402Payment,
624
+ Tt as validateConfig,
625
+ De as validateSecurity
626
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o="CEDROS PAY - File di traduzione (Italiano)",a="1.0.0",e="it",i={pay_with_card:"Paga con carta",pay_with_crypto:"Paga con USDC",pay_with_usdc:"Paga con USDC",purchase:"Acquista",card:"Carta",usdc_solana:"USDC (Solana)",crypto:"Criptovaluta",connect_wallet:"Connetti il wallet",connecting:"Connessione in corso...",processing:"Elaborazione in corso...",loading:"Caricamento in corso...",close:"Chiudi",cancel:"Annulla",confirm:"Conferma",retry:"Riprova",go_back:"Indietro",contact_support:"Contatta l'assistenza"},n={invalid_payment_proof:{message:"Verifica del pagamento non riuscita",action:"Riprova a effettuare il pagamento. Se il problema persiste, contatta l'assistenza."},invalid_signature:{message:"Firma della transazione non valida",action:"Approva la transazione nel tuo wallet e riprova."},invalid_transaction:{message:"Formato della transazione non valido",action:"Riprova a effettuare il pagamento. Se continua, prova ad aggiornare l'app del wallet."},transaction_not_found:{message:"Transazione non trovata sulla blockchain",action:"La tua transazione potrebbe essere ancora in elaborazione. Attendi un momento e controlla il wallet, oppure riprova."},transaction_not_confirmed:{message:"Transazione ancora in elaborazione",action:"Attendi che la blockchain confermi la transazione, quindi riprova."},transaction_failed:{message:"Transazione non riuscita sulla blockchain",action:"Controlla il tuo wallet per i dettagli. Potresti dover modificare le impostazioni della transazione o aggiungere più SOL per le commissioni."},transaction_expired:{message:"La transazione ha impiegato troppo tempo per essere elaborata",action:"Riprova a effettuare il pagamento. Valuta di aumentare la priorità della transazione se il tuo wallet lo consente."},invalid_recipient:{message:"Il pagamento è stato inviato all'indirizzo sbagliato",action:"Riprova assicurandoti di approvare la transazione corretta nel wallet."},invalid_sender:{message:"Il wallet mittente del pagamento non è valido",action:"Ricollega il tuo wallet e riprova."},unauthorized_refund_issuer:{message:"Non sei autorizzato a emettere rimborsi",action:"Solo gli account autorizzati possono elaborare rimborsi. Contatta l'assistenza se ritieni si tratti di un errore."},amount_below_minimum:{message:"L'importo del pagamento è troppo basso",action:"Controlla l'importo richiesto e riprova."},amount_mismatch:{message:"L'importo del pagamento non corrisponde al preventivo",action:"Il prezzo potrebbe essere cambiato. Aggiorna e riprova a pagare."},insufficient_funds_sol:{message:"SOL insufficienti per le commissioni di transazione",action:"Aggiungi almeno 0.001 SOL al tuo wallet per coprire le commissioni di rete, quindi riprova."},insufficient_funds_token:{message:"Saldo insufficiente nel tuo wallet",action:"Aggiungi fondi al tuo wallet e riprova."},invalid_token_mint:{message:"Token di pagamento errato",action:"Paga con il token corretto come indicato nei dettagli del pagamento."},not_spl_transfer:{message:"La transazione non è un trasferimento di token valido",action:"Assicurati di inviare dal tuo wallet il tipo di token corretto."},missing_token_account:{message:"Account token non trovato",action:"Il tuo wallet potrebbe dover creare prima un account token. Riprova o usa un wallet diverso."},invalid_token_program:{message:"Programma token non valido",action:"Riprova a effettuare il pagamento. Se continua, prova con un wallet diverso."},missing_memo:{message:"Memo del pagamento richiesto ma non incluso",action:"Riprova a effettuare il pagamento assicurandoti di approvare i dettagli della transazione nel wallet."},invalid_memo:{message:"Formato del memo del pagamento non valido",action:"Riprova a effettuare il pagamento."},payment_already_used:{message:"Questo pagamento è già stato elaborato",action:"Controlla la cronologia delle transazioni. Se devi effettuare un altro pagamento, avvia una nuova transazione."},signature_reused:{message:"La firma della transazione è già stata utilizzata",action:"Crea una nuova transazione di pagamento."},quote_expired:{message:"Il preventivo di pagamento è scaduto",action:"I prezzi vengono aggiornati frequentemente. Aggiorna e riprova a pagare."},missing_field:{message:"Informazioni obbligatorie mancanti",action:"Controlla tutti i campi obbligatori e riprova."},invalid_field:{message:"Alcune informazioni non sono valide",action:"Controlla i dati inseriti e riprova."},invalid_amount:{message:"Importo del pagamento non valido",action:"Controlla l'importo e riprova."},invalid_wallet:{message:"Indirizzo del wallet non valido",action:"Ricollega il tuo wallet e riprova."},invalid_resource:{message:"Selezione dell'articolo non valida",action:"Aggiorna la pagina e riprova."},invalid_coupon:{message:"Codice coupon non valido",action:"Controlla il codice coupon e riprova."},invalid_cart_item:{message:"Uno o più articoli nel carrello non sono validi",action:"Rivedi il carrello e riprova."},empty_cart:{message:"Il tuo carrello è vuoto",action:"Aggiungi articoli al carrello prima di procedere al checkout."},resource_not_found:{message:"Articolo non trovato",action:"Questo articolo potrebbe non essere più disponibile. Aggiorna e riprova."},cart_not_found:{message:"Carrello non trovato",action:"Il tuo carrello potrebbe essere scaduto. Avvia un nuovo ordine."},refund_not_found:{message:"Rimborso non trovato",action:"Controlla il numero di riferimento del rimborso o contatta l'assistenza."},product_not_found:{message:"Prodotto non disponibile",action:"Questo prodotto potrebbe non essere più disponibile. Consulta la selezione attuale."},coupon_not_found:{message:"Codice coupon non trovato",action:"Controlla il codice coupon o rimuovilo per continuare."},session_not_found:{message:"Sessione di pagamento scaduta",action:"Avvia un nuovo pagamento."},cart_already_paid:{message:"Questo ordine è già stato pagato",action:"Controlla la cronologia degli ordini. Se devi effettuare un altro acquisto, avvia un nuovo ordine."},refund_already_processed:{message:"Questo rimborso è già stato elaborato",action:"Controlla la cronologia delle transazioni o contatta l'assistenza per i dettagli."},coupon_expired:{message:"Il coupon è scaduto",action:"Rimuovi il codice coupon o usane un altro."},coupon_usage_limit_reached:{message:"Limite di utilizzo del coupon raggiunto",action:"Questo coupon è stato completamente riscattato. Prova con un altro codice."},coupon_not_applicable:{message:"Il coupon non può essere applicato a questo acquisto",action:"Verifica i termini del coupon o rimuovilo per continuare."},coupon_wrong_payment_method:{message:"Coupon non valido per questo metodo di pagamento",action:"Prova un metodo di pagamento diverso o rimuovi il codice coupon."},stripe_error:{message:"Servizio di pagamento con carta temporaneamente non disponibile",action:"Riprova tra poco, oppure utilizza il pagamento in criptovaluta."},rpc_error:{message:"Rete blockchain temporaneamente non disponibile",action:"Riprova tra poco, oppure usa il pagamento con carta."},network_error:{message:"Problemi di connessione di rete",action:"Controlla la connessione a Internet e riprova."},internal_error:{message:"Si è verificato un errore sul nostro server",action:"Riprova. Se il problema persiste, contatta l'assistenza."},database_error:{message:"Servizio temporaneamente non disponibile",action:"Riprova tra poco."},config_error:{message:"Errore di configurazione del servizio",action:"Contatta l'assistenza per ricevere aiuto."},unknown_error:{message:"Si è verificato un errore imprevisto",action:"Riprova o contatta l'assistenza se il problema persiste."}},t={unknown_token_mint:"Avviso: indirizzo di mint del token non riconosciuto. Controlla che questo sia il token corretto per evitare la perdita di fondi.",token_typo_warning:"L'indirizzo del token non corrisponde alle stablecoin note (USDC, USDT, PYUSD, CASH). Verifica attentamente per evitare perdite permanenti di fondi."},r={no_wallet_detected:"Nessun wallet Solana rilevato",install_wallet:"Installa un wallet Solana come Phantom, Solflare o Backpack.",wallet_not_connected:"Wallet non connesso",connect_your_wallet:"Connetti il tuo wallet per continuare.",wallet_connection_failed:"Connessione al wallet non riuscita",try_again:"Riprova a connetterti.",transaction_rejected:"Transazione rifiutata",approve_in_wallet:"Approva la transazione nel tuo wallet per continuare."},l={comment:o,version:a,locale:e,ui:i,errors:n,validation:t,wallet:r};exports.comment=o;exports.default=l;exports.errors=n;exports.locale=e;exports.ui=i;exports.validation=t;exports.version=a;exports.wallet=r;
@@ -0,0 +1,19 @@
1
+ const o = "CEDROS PAY - File di traduzione (Italiano)", a = "1.0.0", r = "it", e = { pay_with_card: "Paga con carta", pay_with_crypto: "Paga con USDC", pay_with_usdc: "Paga con USDC", purchase: "Acquista", card: "Carta", usdc_solana: "USDC (Solana)", crypto: "Criptovaluta", connect_wallet: "Connetti il wallet", connecting: "Connessione in corso...", processing: "Elaborazione in corso...", loading: "Caricamento in corso...", close: "Chiudi", cancel: "Annulla", confirm: "Conferma", retry: "Riprova", go_back: "Indietro", contact_support: "Contatta l'assistenza" }, i = { invalid_payment_proof: { message: "Verifica del pagamento non riuscita", action: "Riprova a effettuare il pagamento. Se il problema persiste, contatta l'assistenza." }, invalid_signature: { message: "Firma della transazione non valida", action: "Approva la transazione nel tuo wallet e riprova." }, invalid_transaction: { message: "Formato della transazione non valido", action: "Riprova a effettuare il pagamento. Se continua, prova ad aggiornare l'app del wallet." }, transaction_not_found: { message: "Transazione non trovata sulla blockchain", action: "La tua transazione potrebbe essere ancora in elaborazione. Attendi un momento e controlla il wallet, oppure riprova." }, transaction_not_confirmed: { message: "Transazione ancora in elaborazione", action: "Attendi che la blockchain confermi la transazione, quindi riprova." }, transaction_failed: { message: "Transazione non riuscita sulla blockchain", action: "Controlla il tuo wallet per i dettagli. Potresti dover modificare le impostazioni della transazione o aggiungere più SOL per le commissioni." }, transaction_expired: { message: "La transazione ha impiegato troppo tempo per essere elaborata", action: "Riprova a effettuare il pagamento. Valuta di aumentare la priorità della transazione se il tuo wallet lo consente." }, invalid_recipient: { message: "Il pagamento è stato inviato all'indirizzo sbagliato", action: "Riprova assicurandoti di approvare la transazione corretta nel wallet." }, invalid_sender: { message: "Il wallet mittente del pagamento non è valido", action: "Ricollega il tuo wallet e riprova." }, unauthorized_refund_issuer: { message: "Non sei autorizzato a emettere rimborsi", action: "Solo gli account autorizzati possono elaborare rimborsi. Contatta l'assistenza se ritieni si tratti di un errore." }, amount_below_minimum: { message: "L'importo del pagamento è troppo basso", action: "Controlla l'importo richiesto e riprova." }, amount_mismatch: { message: "L'importo del pagamento non corrisponde al preventivo", action: "Il prezzo potrebbe essere cambiato. Aggiorna e riprova a pagare." }, insufficient_funds_sol: { message: "SOL insufficienti per le commissioni di transazione", action: "Aggiungi almeno 0.001 SOL al tuo wallet per coprire le commissioni di rete, quindi riprova." }, insufficient_funds_token: { message: "Saldo insufficiente nel tuo wallet", action: "Aggiungi fondi al tuo wallet e riprova." }, invalid_token_mint: { message: "Token di pagamento errato", action: "Paga con il token corretto come indicato nei dettagli del pagamento." }, not_spl_transfer: { message: "La transazione non è un trasferimento di token valido", action: "Assicurati di inviare dal tuo wallet il tipo di token corretto." }, missing_token_account: { message: "Account token non trovato", action: "Il tuo wallet potrebbe dover creare prima un account token. Riprova o usa un wallet diverso." }, invalid_token_program: { message: "Programma token non valido", action: "Riprova a effettuare il pagamento. Se continua, prova con un wallet diverso." }, missing_memo: { message: "Memo del pagamento richiesto ma non incluso", action: "Riprova a effettuare il pagamento assicurandoti di approvare i dettagli della transazione nel wallet." }, invalid_memo: { message: "Formato del memo del pagamento non valido", action: "Riprova a effettuare il pagamento." }, payment_already_used: { message: "Questo pagamento è già stato elaborato", action: "Controlla la cronologia delle transazioni. Se devi effettuare un altro pagamento, avvia una nuova transazione." }, signature_reused: { message: "La firma della transazione è già stata utilizzata", action: "Crea una nuova transazione di pagamento." }, quote_expired: { message: "Il preventivo di pagamento è scaduto", action: "I prezzi vengono aggiornati frequentemente. Aggiorna e riprova a pagare." }, missing_field: { message: "Informazioni obbligatorie mancanti", action: "Controlla tutti i campi obbligatori e riprova." }, invalid_field: { message: "Alcune informazioni non sono valide", action: "Controlla i dati inseriti e riprova." }, invalid_amount: { message: "Importo del pagamento non valido", action: "Controlla l'importo e riprova." }, invalid_wallet: { message: "Indirizzo del wallet non valido", action: "Ricollega il tuo wallet e riprova." }, invalid_resource: { message: "Selezione dell'articolo non valida", action: "Aggiorna la pagina e riprova." }, invalid_coupon: { message: "Codice coupon non valido", action: "Controlla il codice coupon e riprova." }, invalid_cart_item: { message: "Uno o più articoli nel carrello non sono validi", action: "Rivedi il carrello e riprova." }, empty_cart: { message: "Il tuo carrello è vuoto", action: "Aggiungi articoli al carrello prima di procedere al checkout." }, resource_not_found: { message: "Articolo non trovato", action: "Questo articolo potrebbe non essere più disponibile. Aggiorna e riprova." }, cart_not_found: { message: "Carrello non trovato", action: "Il tuo carrello potrebbe essere scaduto. Avvia un nuovo ordine." }, refund_not_found: { message: "Rimborso non trovato", action: "Controlla il numero di riferimento del rimborso o contatta l'assistenza." }, product_not_found: { message: "Prodotto non disponibile", action: "Questo prodotto potrebbe non essere più disponibile. Consulta la selezione attuale." }, coupon_not_found: { message: "Codice coupon non trovato", action: "Controlla il codice coupon o rimuovilo per continuare." }, session_not_found: { message: "Sessione di pagamento scaduta", action: "Avvia un nuovo pagamento." }, cart_already_paid: { message: "Questo ordine è già stato pagato", action: "Controlla la cronologia degli ordini. Se devi effettuare un altro acquisto, avvia un nuovo ordine." }, refund_already_processed: { message: "Questo rimborso è già stato elaborato", action: "Controlla la cronologia delle transazioni o contatta l'assistenza per i dettagli." }, coupon_expired: { message: "Il coupon è scaduto", action: "Rimuovi il codice coupon o usane un altro." }, coupon_usage_limit_reached: { message: "Limite di utilizzo del coupon raggiunto", action: "Questo coupon è stato completamente riscattato. Prova con un altro codice." }, coupon_not_applicable: { message: "Il coupon non può essere applicato a questo acquisto", action: "Verifica i termini del coupon o rimuovilo per continuare." }, coupon_wrong_payment_method: { message: "Coupon non valido per questo metodo di pagamento", action: "Prova un metodo di pagamento diverso o rimuovi il codice coupon." }, stripe_error: { message: "Servizio di pagamento con carta temporaneamente non disponibile", action: "Riprova tra poco, oppure utilizza il pagamento in criptovaluta." }, rpc_error: { message: "Rete blockchain temporaneamente non disponibile", action: "Riprova tra poco, oppure usa il pagamento con carta." }, network_error: { message: "Problemi di connessione di rete", action: "Controlla la connessione a Internet e riprova." }, internal_error: { message: "Si è verificato un errore sul nostro server", action: "Riprova. Se il problema persiste, contatta l'assistenza." }, database_error: { message: "Servizio temporaneamente non disponibile", action: "Riprova tra poco." }, config_error: { message: "Errore di configurazione del servizio", action: "Contatta l'assistenza per ricevere aiuto." }, unknown_error: { message: "Si è verificato un errore imprevisto", action: "Riprova o contatta l'assistenza se il problema persiste." } }, n = { unknown_token_mint: "Avviso: indirizzo di mint del token non riconosciuto. Controlla che questo sia il token corretto per evitare la perdita di fondi.", token_typo_warning: "L'indirizzo del token non corrisponde alle stablecoin note (USDC, USDT, PYUSD, CASH). Verifica attentamente per evitare perdite permanenti di fondi." }, t = { no_wallet_detected: "Nessun wallet Solana rilevato", install_wallet: "Installa un wallet Solana come Phantom, Solflare o Backpack.", wallet_not_connected: "Wallet non connesso", connect_your_wallet: "Connetti il tuo wallet per continuare.", wallet_connection_failed: "Connessione al wallet non riuscita", try_again: "Riprova a connetterti.", transaction_rejected: "Transazione rifiutata", approve_in_wallet: "Approva la transazione nel tuo wallet per continuare." }, l = {
2
+ comment: o,
3
+ version: a,
4
+ locale: "it",
5
+ ui: e,
6
+ errors: i,
7
+ validation: n,
8
+ wallet: t
9
+ };
10
+ export {
11
+ o as comment,
12
+ l as default,
13
+ i as errors,
14
+ r as locale,
15
+ e as ui,
16
+ n as validation,
17
+ a as version,
18
+ t as wallet
19
+ };