@paywithglide/glide-react 0.0.47 → 0.0.49

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.
package/dist/core.js CHANGED
@@ -1,33 +1,33 @@
1
- var ee = Object.defineProperty;
2
- var te = (s, e, t) => e in s ? ee(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var w = (s, e, t) => te(s, typeof e != "symbol" ? e + "" : e, t);
4
- function se(s, { strict: e = !0 } = {}) {
5
- return !s || typeof s != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
1
+ var ce = Object.defineProperty;
2
+ var le = (s, t, e) => t in s ? ce(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var I = (s, t, e) => le(s, typeof t != "symbol" ? t + "" : t, e);
4
+ function pe(s, { strict: t = !0 } = {}) {
5
+ return !s || typeof s != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
6
6
  }
7
- function _(s) {
8
- return se(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
7
+ function Z(s) {
8
+ return pe(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
9
9
  }
10
- const q = "2.21.51";
11
- let b = {
12
- getDocsUrl: ({ docsBaseUrl: s, docsPath: e = "", docsSlug: t }) => e ? `${s ?? "https://viem.sh"}${e}${t ? `#${t}` : ""}` : void 0,
13
- version: `viem@${q}`
10
+ const ee = "2.21.51";
11
+ let w = {
12
+ getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
13
+ version: `viem@${ee}`
14
14
  };
15
15
  class v extends Error {
16
- constructor(e, t = {}) {
17
- var d;
16
+ constructor(t, e = {}) {
17
+ var l;
18
18
  const i = (() => {
19
- var a;
20
- return t.cause instanceof v ? t.cause.details : (a = t.cause) != null && a.message ? t.cause.message : t.details;
21
- })(), o = t.cause instanceof v && t.cause.docsPath || t.docsPath, n = (d = b.getDocsUrl) == null ? void 0 : d.call(b, { ...t, docsPath: o }), c = [
22
- e || "An error occurred.",
19
+ var d;
20
+ return e.cause instanceof v ? e.cause.details : (d = e.cause) != null && d.message ? e.cause.message : e.details;
21
+ })(), o = e.cause instanceof v && e.cause.docsPath || e.docsPath, n = (l = w.getDocsUrl) == null ? void 0 : l.call(w, { ...e, docsPath: o }), p = [
22
+ t || "An error occurred.",
23
23
  "",
24
- ...t.metaMessages ? [...t.metaMessages, ""] : [],
24
+ ...e.metaMessages ? [...e.metaMessages, ""] : [],
25
25
  ...n ? [`Docs: ${n}`] : [],
26
26
  ...i ? [`Details: ${i}`] : [],
27
- ...b.version ? [`Version: ${b.version}`] : []
27
+ ...w.version ? [`Version: ${w.version}`] : []
28
28
  ].join(`
29
29
  `);
30
- super(c, t.cause ? { cause: t.cause } : void 0), Object.defineProperty(this, "details", {
30
+ super(p, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
31
31
  enumerable: !0,
32
32
  configurable: !0,
33
33
  writable: !0,
@@ -57,130 +57,130 @@ class v extends Error {
57
57
  configurable: !0,
58
58
  writable: !0,
59
59
  value: "BaseError"
60
- }), this.details = i, this.docsPath = o, this.metaMessages = t.metaMessages, this.name = t.name ?? this.name, this.shortMessage = e, this.version = q;
60
+ }), this.details = i, this.docsPath = o, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = ee;
61
61
  }
62
- walk(e) {
63
- return K(this, e);
62
+ walk(t) {
63
+ return te(this, t);
64
64
  }
65
65
  }
66
- function K(s, e) {
67
- return e != null && e(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? K(s.cause, e) : e ? null : s;
66
+ function te(s, t) {
67
+ return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? te(s.cause, t) : t ? null : s;
68
68
  }
69
- class N extends v {
70
- constructor({ size: e, targetSize: t, type: i }) {
71
- super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`, { name: "SizeExceedsPaddingSizeError" });
69
+ class se extends v {
70
+ constructor({ size: t, targetSize: e, type: i }) {
71
+ super(`${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`, { name: "SizeExceedsPaddingSizeError" });
72
72
  }
73
73
  }
74
- function I(s, { dir: e, size: t = 32 } = {}) {
75
- return typeof s == "string" ? ie(s, { dir: e, size: t }) : oe(s, { dir: e, size: t });
74
+ function P(s, { dir: t, size: e = 32 } = {}) {
75
+ return typeof s == "string" ? he(s, { dir: t, size: e }) : ue(s, { dir: t, size: e });
76
76
  }
77
- function ie(s, { dir: e, size: t = 32 } = {}) {
78
- if (t === null)
77
+ function he(s, { dir: t, size: e = 32 } = {}) {
78
+ if (e === null)
79
79
  return s;
80
80
  const i = s.replace("0x", "");
81
- if (i.length > t * 2)
82
- throw new N({
81
+ if (i.length > e * 2)
82
+ throw new se({
83
83
  size: Math.ceil(i.length / 2),
84
- targetSize: t,
84
+ targetSize: e,
85
85
  type: "hex"
86
86
  });
87
- return `0x${i[e === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
87
+ return `0x${i[t === "right" ? "padEnd" : "padStart"](e * 2, "0")}`;
88
88
  }
89
- function oe(s, { dir: e, size: t = 32 } = {}) {
90
- if (t === null)
89
+ function ue(s, { dir: t, size: e = 32 } = {}) {
90
+ if (e === null)
91
91
  return s;
92
- if (s.length > t)
93
- throw new N({
92
+ if (s.length > e)
93
+ throw new se({
94
94
  size: s.length,
95
- targetSize: t,
95
+ targetSize: e,
96
96
  type: "bytes"
97
97
  });
98
- const i = new Uint8Array(t);
99
- for (let o = 0; o < t; o++) {
100
- const n = e === "right";
101
- i[n ? o : t - o - 1] = s[n ? o : s.length - o - 1];
98
+ const i = new Uint8Array(e);
99
+ for (let o = 0; o < e; o++) {
100
+ const n = t === "right";
101
+ i[n ? o : e - o - 1] = s[n ? o : s.length - o - 1];
102
102
  }
103
103
  return i;
104
104
  }
105
- class ne extends v {
106
- constructor({ max: e, min: t, signed: i, size: o, value: n }) {
107
- super(`Number "${n}" is not in safe ${o ? `${o * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${t} to ${e})` : `(above ${t})`}`, { name: "IntegerOutOfRangeError" });
105
+ class me extends v {
106
+ constructor({ max: t, min: e, signed: i, size: o, value: n }) {
107
+ super(`Number "${n}" is not in safe ${o ? `${o * 8}-bit ${i ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${e} to ${t})` : `(above ${e})`}`, { name: "IntegerOutOfRangeError" });
108
108
  }
109
109
  }
110
- class re extends v {
111
- constructor({ givenSize: e, maxSize: t }) {
112
- super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
110
+ class ge extends v {
111
+ constructor({ givenSize: t, maxSize: e }) {
112
+ super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
113
113
  }
114
114
  }
115
- function V(s, { size: e }) {
116
- if (_(s) > e)
117
- throw new re({
118
- givenSize: _(s),
119
- maxSize: e
115
+ function ie(s, { size: t }) {
116
+ if (Z(s) > t)
117
+ throw new ge({
118
+ givenSize: Z(s),
119
+ maxSize: t
120
120
  });
121
121
  }
122
- const ae = /* @__PURE__ */ Array.from({ length: 256 }, (s, e) => e.toString(16).padStart(2, "0"));
123
- function de(s, e = {}) {
124
- return typeof s == "number" || typeof s == "bigint" ? pe(s, e) : typeof s == "string" ? ue(s, e) : typeof s == "boolean" ? ce(s, e) : J(s, e);
122
+ const fe = /* @__PURE__ */ Array.from({ length: 256 }, (s, t) => t.toString(16).padStart(2, "0"));
123
+ function ye(s, t = {}) {
124
+ return typeof s == "number" || typeof s == "bigint" ? we(s, t) : typeof s == "string" ? $e(s, t) : typeof s == "boolean" ? ve(s, t) : oe(s, t);
125
125
  }
126
- function ce(s, e = {}) {
127
- const t = `0x${Number(s)}`;
128
- return typeof e.size == "number" ? (V(t, { size: e.size }), I(t, { size: e.size })) : t;
126
+ function ve(s, t = {}) {
127
+ const e = `0x${Number(s)}`;
128
+ return typeof t.size == "number" ? (ie(e, { size: t.size }), P(e, { size: t.size })) : e;
129
129
  }
130
- function J(s, e = {}) {
131
- let t = "";
130
+ function oe(s, t = {}) {
131
+ let e = "";
132
132
  for (let o = 0; o < s.length; o++)
133
- t += ae[s[o]];
134
- const i = `0x${t}`;
135
- return typeof e.size == "number" ? (V(i, { size: e.size }), I(i, { dir: "right", size: e.size })) : i;
133
+ e += fe[s[o]];
134
+ const i = `0x${e}`;
135
+ return typeof t.size == "number" ? (ie(i, { size: t.size }), P(i, { dir: "right", size: t.size })) : i;
136
136
  }
137
- function pe(s, e = {}) {
138
- const { signed: t, size: i } = e, o = BigInt(s);
137
+ function we(s, t = {}) {
138
+ const { signed: e, size: i } = t, o = BigInt(s);
139
139
  let n;
140
- i ? t ? n = (1n << BigInt(i) * 8n - 1n) - 1n : n = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
141
- const c = typeof n == "bigint" && t ? -n - 1n : 0;
142
- if (n && o > n || o < c) {
143
- const a = typeof s == "bigint" ? "n" : "";
144
- throw new ne({
145
- max: n ? `${n}${a}` : void 0,
146
- min: `${c}${a}`,
147
- signed: t,
140
+ i ? e ? n = (1n << BigInt(i) * 8n - 1n) - 1n : n = 2n ** (BigInt(i) * 8n) - 1n : typeof s == "number" && (n = BigInt(Number.MAX_SAFE_INTEGER));
141
+ const p = typeof n == "bigint" && e ? -n - 1n : 0;
142
+ if (n && o > n || o < p) {
143
+ const d = typeof s == "bigint" ? "n" : "";
144
+ throw new me({
145
+ max: n ? `${n}${d}` : void 0,
146
+ min: `${p}${d}`,
147
+ signed: e,
148
148
  size: i,
149
- value: `${s}${a}`
149
+ value: `${s}${d}`
150
150
  });
151
151
  }
152
- const d = `0x${(t && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
153
- return i ? I(d, { size: i }) : d;
152
+ const l = `0x${(e && o < 0 ? (1n << BigInt(i * 8)) + BigInt(o) : o).toString(16)}`;
153
+ return i ? P(l, { size: i }) : l;
154
154
  }
155
- const le = /* @__PURE__ */ new TextEncoder();
156
- function ue(s, e = {}) {
157
- const t = le.encode(s);
158
- return J(t, e);
155
+ const be = /* @__PURE__ */ new TextEncoder();
156
+ function $e(s, t = {}) {
157
+ const e = be.encode(s);
158
+ return oe(e, t);
159
159
  }
160
- function he(s) {
160
+ function Se(s) {
161
161
  return s instanceof Error;
162
162
  }
163
- let F = !1;
164
- function me(s) {
165
- if (F)
163
+ let Q = !1;
164
+ function Ie(s) {
165
+ if (Q)
166
166
  return;
167
- F = !0;
168
- const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = (c) => {
169
- const d = c.detail;
170
- e.has(d.info.uuid) || e.set(d.info.uuid, d);
167
+ Q = !0;
168
+ const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = (p) => {
169
+ const l = p.detail;
170
+ t.has(l.info.uuid) || t.set(l.info.uuid, l);
171
171
  };
172
- window.addEventListener("eip6963:announceProvider", o), window.dispatchEvent(new Event("eip6963:requestProvider")), window.addEventListener("message", async (c) => {
173
- var y;
174
- if (c.origin !== s) return;
175
- const { type: d, data: a } = c.data;
176
- switch (d) {
172
+ window.addEventListener("eip6963:announceProvider", o), window.dispatchEvent(new Event("eip6963:requestProvider")), window.addEventListener("message", async (p) => {
173
+ var f;
174
+ if (p.origin !== s) return;
175
+ const { type: l, data: d } = p.data;
176
+ switch (l) {
177
177
  case "glide:getProviders": {
178
- const p = Array.from(e.values()).map(
179
- ({ info: u, provider: l }) => ({
178
+ const c = Array.from(t.values()).map(
179
+ ({ info: u, provider: h }) => ({
180
180
  info: u,
181
- isConnected: typeof l.isConnected == "boolean" ? l.isConnected : void 0,
182
- chainId: l.chainId,
183
- selectedAddress: l.selectedAddress
181
+ isConnected: typeof h.isConnected == "boolean" ? h.isConnected : void 0,
182
+ chainId: h.chainId,
183
+ selectedAddress: h.selectedAddress
184
184
  })
185
185
  ), r = document.getElementById(
186
186
  "glide-deposit-iframe"
@@ -188,126 +188,107 @@ function me(s) {
188
188
  r != null && r.contentWindow && r.contentWindow.postMessage(
189
189
  {
190
190
  type: "glide:providers",
191
- providers: p
191
+ providers: c
192
192
  },
193
193
  s
194
194
  );
195
195
  break;
196
196
  }
197
197
  case "glide:providerRequest": {
198
- const { uuid: p, requestId: r, method: u, params: l } = a;
198
+ const { uuid: c, requestId: r, method: u, params: h } = d;
199
199
  if (i.has(r))
200
200
  return;
201
201
  i.set(r, !0);
202
- const g = e.get(p);
202
+ const g = t.get(c);
203
203
  if (!g) {
204
204
  i.delete(r), n(r, { error: "Provider not found" });
205
205
  return;
206
206
  }
207
207
  try {
208
- const h = await g.provider.request({
208
+ const m = await g.provider.request({
209
209
  method: u,
210
- params: l
210
+ params: h
211
211
  });
212
- i.delete(r), n(r, { result: h });
213
- } catch (h) {
214
- i.delete(r), he(h) ? n(r, {
215
- error: h.message || String(h),
216
- code: h.code,
217
- data: h.data
212
+ i.delete(r), n(r, { result: m });
213
+ } catch (m) {
214
+ i.delete(r), Se(m) ? n(r, {
215
+ error: m.message || String(m),
216
+ code: m.code,
217
+ data: m.data
218
218
  }) : n(r, {
219
- error: String(h)
219
+ error: String(m)
220
220
  });
221
221
  }
222
222
  break;
223
223
  }
224
224
  case "glide:addEventListener": {
225
- const { uuid: p, requestId: r, eventName: u } = a, l = e.get(p);
226
- if (!l || !l.provider.on) {
225
+ const { uuid: c, requestId: r, eventName: u } = d, h = t.get(c);
226
+ if (!h || !h.provider.on) {
227
227
  n(r, { error: "Provider or method not found" });
228
228
  return;
229
229
  }
230
- const g = (...h) => {
231
- const f = document.getElementById(
230
+ const g = (...m) => {
231
+ const y = document.getElementById(
232
232
  "glide-deposit-iframe"
233
233
  );
234
- f != null && f.contentWindow && f.contentWindow.postMessage(
234
+ y != null && y.contentWindow && y.contentWindow.postMessage(
235
235
  {
236
236
  type: "glide:providerEvent",
237
- uuid: p,
237
+ uuid: c,
238
238
  eventName: u,
239
- args: h
239
+ args: m
240
240
  },
241
241
  s
242
242
  );
243
243
  };
244
- t.has(p) || t.set(p, /* @__PURE__ */ new Map()), t.get(p).has(u) || t.get(p).set(u, /* @__PURE__ */ new Set()), t.get(p).get(u).add(g), l.provider.on(u, g), n(r, { result: !0 });
244
+ e.has(c) || e.set(c, /* @__PURE__ */ new Map()), e.get(c).has(u) || e.get(c).set(u, /* @__PURE__ */ new Set()), e.get(c).get(u).add(g), h.provider.on(u, g), n(r, { result: !0 });
245
245
  break;
246
246
  }
247
247
  case "glide:removeEventListener": {
248
- const { uuid: p, requestId: r, eventName: u } = a, l = e.get(p);
249
- if (!l || !l.provider.removeListener) {
248
+ const { uuid: c, requestId: r, eventName: u } = d, h = t.get(c);
249
+ if (!h || !h.provider.removeListener) {
250
250
  n(r, { error: "Provider or method not found" });
251
251
  return;
252
252
  }
253
- const g = (y = t.get(p)) == null ? void 0 : y.get(u);
254
- g && (g.forEach((h) => {
255
- l.provider.removeListener(u, h);
253
+ const g = (f = e.get(c)) == null ? void 0 : f.get(u);
254
+ g && (g.forEach((m) => {
255
+ h.provider.removeListener(u, m);
256
256
  }), g.clear()), n(r, { result: !0 });
257
257
  break;
258
258
  }
259
259
  }
260
260
  });
261
- function n(c, d) {
262
- const a = document.getElementById(
261
+ function n(p, l) {
262
+ const d = document.getElementById(
263
263
  "glide-deposit-iframe"
264
264
  );
265
- a != null && a.contentWindow && a.contentWindow.postMessage(
265
+ d != null && d.contentWindow && d.contentWindow.postMessage(
266
266
  {
267
267
  type: "glide:providerResponse",
268
- requestId: c,
269
- ...d
268
+ requestId: p,
269
+ ...l
270
270
  },
271
271
  s
272
272
  );
273
273
  }
274
274
  }
275
- const ge = "@paywithglide/glide-react", fe = "0.0.47", ye = "module", we = ["dist"], ve = "dist/glide.js", be = "dist/index.d.ts", $e = { ".": { types: "./dist/index.d.ts", default: "./dist/glide.js" }, "./core": { types: "./dist/core.d.ts", default: "./dist/core.js" }, "./package.json": "./package.json" }, Se = !1, Ie = { dev: "vite", build: "bun run lint && vite build", "build-web": "tsc --p ./tsconfig.build.json && vite build --mode web", "build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background", lint: "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json", preview: "vite preview", prepublishOnly: "bun run build" }, xe = { "@paywithglide/glide-js": "0.13.32" }, Pe = { "@antiwork/shortest": "^0.2.1", "@eslint/js": "^9.15.0", "@tanstack/react-query": "^5.61.5", "@types/chrome": "^0.0.299", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", eslint: "^9.15.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.14", globals: "^15.12.0", prettier: "^3.6.2", react: "^18.3.1", "react-dom": "^18.3.1", typescript: "~5.6.2", "typescript-eslint": "^8.15.0", viem: "^2.21.51", vite: "^6.0.1", "vite-plugin-dts": "^4.3.0", "vite-plugin-static-copy": "^2.2.0", wagmi: "^2.13.0" }, ke = {
276
- name: ge,
277
- version: fe,
278
- type: ye,
279
- files: we,
280
- module: ve,
281
- types: be,
282
- exports: $e,
283
- sideEffects: Se,
284
- scripts: Ie,
285
- dependencies: xe,
286
- devDependencies: Pe
287
- }, G = ke.version;
288
- function Ee() {
289
- var t;
290
- if (typeof navigator > "u") return "unknown";
291
- const s = navigator.userAgent.toLowerCase(), e = ((t = navigator.platform) == null ? void 0 : t.toLowerCase()) || "";
292
- return /iphone|ipad|ipod/.test(s) || e === "macintel" && navigator.maxTouchPoints > 1 ? "ios" : /android/.test(s) ? "android" : /win/.test(e) || /windows/.test(s) ? "windows" : /mac/.test(e) && !/iphone|ipad|ipod/.test(s) ? "macos" : /linux/.test(e) || /linux/.test(s) ? "linux" : "unknown";
293
- }
294
- function Ce() {
295
- if (typeof navigator > "u") return "unknown";
296
- const s = navigator.userAgent;
297
- return s.includes("Firefox") ? "firefox" : s.includes("Edg") ? "edge" : s.includes("Chrome") ? "chrome" : s.includes("Safari") ? "safari" : s.includes("Opera") || s.includes("OPR") ? "opera" : "unknown";
298
- }
299
- function Ae() {
300
- if (typeof navigator > "u") return !1;
301
- const s = navigator.userAgent.toLowerCase();
302
- return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/.test(
303
- s
304
- );
305
- }
306
- const H = 999999;
307
- class Te {
308
- constructor(e) {
309
- w(this, "opts");
310
- w(this, "open", () => {
275
+ const Pe = "@paywithglide/glide-react", xe = "0.0.49", Ee = "module", Ce = ["dist"], ke = "dist/glide.js", Me = "dist/index.d.ts", Ae = { ".": { types: "./dist/index.d.ts", default: "./dist/glide.js" }, "./core": { types: "./dist/core.d.ts", default: "./dist/core.js" }, "./package.json": "./package.json" }, Ue = !1, Te = { dev: "vite", build: "bun run lint && vite build", "build-web": "tsc --p ./tsconfig.build.json && vite build --mode web", "build-chromeext": "tsc --p ./tsconfig.build.json && vite build --mode chromeext:popup && vite build --mode chromeext:content && vite build --mode chromeext:background", lint: "prettier --check . && eslint . --max-warnings 0 && tsc --p ./tsconfig.build.json", preview: "vite preview", prepublishOnly: "bun run build" }, We = { "@paywithglide/glide-js": "0.13.32" }, je = { "@antiwork/shortest": "^0.2.1", "@eslint/js": "^9.15.0", "@privy-io/react-auth": "^3.10.1", "@solana-program/memo": "^0.10.0", "@solana-program/system": "^0.10.0", "@solana-program/token": "^0.9.0", "@solana/kit": "^5.1.0", "@tanstack/react-query": "^5.61.5", "@types/chrome": "^0.0.299", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.4", eslint: "^9.15.0", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.14", globals: "^15.12.0", prettier: "^3.6.2", react: "^18.3.1", "react-dom": "^18.3.1", typescript: "~5.6.2", "typescript-eslint": "^8.15.0", viem: "^2.21.51", vite: "^6.0.1", "vite-plugin-dts": "^4.3.0", "vite-plugin-static-copy": "^2.2.0", wagmi: "^2.13.0" }, ze = {
276
+ name: Pe,
277
+ version: xe,
278
+ type: Ee,
279
+ files: Ce,
280
+ module: ke,
281
+ types: Me,
282
+ exports: Ae,
283
+ sideEffects: Ue,
284
+ scripts: Te,
285
+ dependencies: We,
286
+ devDependencies: je
287
+ }, De = ze.version, Y = 999999;
288
+ class Re {
289
+ constructor(t) {
290
+ I(this, "opts");
291
+ I(this, "open", () => {
311
292
  if (!(!this.opts.container && document.body.classList.contains("glide-deposit-open"))) {
312
293
  if (this.opts.container || document.body.classList.add("glide-deposit-open"), (this.opts.mode === "deposit" || this.opts.mode === "buy") && !this.opts.recipient)
313
294
  throw new Error("recipient is required for deposit/buy mode");
@@ -318,30 +299,31 @@ class Te {
318
299
  this.openUrl(`${this.baseUrl}${this.opts.app}?init=true&embed=true`), this.initialize();
319
300
  }
320
301
  });
321
- w(this, "iframeEventHandler", async (e) => {
322
- var i, o, n, c, d, a, y, p, r, u, l, g, h, f, x, $, P, S, k, E, C, A, M, D, T, U, O, j, z, R, L, B, W;
323
- const t = e.data;
324
- switch (t.type) {
302
+ I(this, "iframeEventHandler", async (t) => {
303
+ var i, o, n, p, l, d, f, c, r, u, h, g, m, y, x, b, E, $, C, S, k, M, A, U, T, W, j, z, D, O, R, L, B, F, G, H, q, K, N, _, V, J, X;
304
+ const e = t.data;
305
+ switch (e.type) {
325
306
  case "sendInit": {
326
- const m = this.opts.recipient, X = (i = this.opts.walletProvider) == null ? void 0 : i.address, Z = (o = this.opts.walletProvider) == null ? void 0 : o.availableChainIds, Q = (n = this.opts.walletProvider) == null ? void 0 : n.currentChainId, Y = this.opts.preferGaslessPayment || !!((c = this.opts.walletProvider) != null && c.signTypedDataAsync);
327
- (y = (d = this.iframe) == null ? void 0 : d.contentWindow) == null || y.postMessage(
307
+ const a = this.opts.recipient, ne = ((i = this.opts.walletProvider) == null ? void 0 : i.address) || ((o = this.opts.solanaWalletProvider) == null ? void 0 : o.address), re = (n = this.opts.walletProvider) == null ? void 0 : n.availableChainIds, ae = ((p = this.opts.walletProvider) == null ? void 0 : p.currentChainId) || ((l = this.opts.solanaWalletProvider) == null ? void 0 : l.currentChainId), de = this.opts.preferGaslessPayment || !!((d = this.opts.walletProvider) != null && d.signTypedDataAsync);
308
+ (r = (f = this.iframe) == null ? void 0 : f.contentWindow) == null || r.postMessage(
328
309
  {
329
310
  type: "initialize",
330
311
  // Analytics context - project identification
331
312
  projectId: this.opts.projectId,
332
313
  appSlug: this.opts.app,
333
314
  sessionId: this.opts.sessionId,
334
- recipient: m,
335
- connectedWalletAddress: X,
336
- availableChainIds: Z,
337
- currentChainId: Q,
338
- preferGaslessPayment: Y,
315
+ recipient: a,
316
+ connectedWalletAddress: ne,
317
+ availableChainIds: re,
318
+ currentChainId: ae,
319
+ preferGaslessPayment: de,
339
320
  chainIds: this.opts.chainIds,
340
321
  excludeChainIds: this.opts.excludeChainIds,
341
322
  excludeCurrencyTiers: this.opts.excludeCurrencyTiers,
342
323
  excludeFundingSources: this.opts.excludeFundingSources,
343
324
  fundingSources: this.opts.fundingSources,
344
325
  allowedPaymentCurrencies: this.opts.allowedPaymentCurrencies,
326
+ excludePaymentCurrencies: this.opts.excludePaymentCurrencies,
345
327
  appMetadata: this.opts.appMetadata,
346
328
  enableRefundEmails: this.opts.enableRefundEmails,
347
329
  payerEmail: this.opts.payerEmail,
@@ -362,14 +344,14 @@ class Te {
362
344
  stableDepositAddressKey: this.opts.stableDepositAddressKey,
363
345
  theme: {
364
346
  ...this.opts.theme || {},
365
- colorScheme: ((a = this.opts.theme) == null ? void 0 : a.colorScheme) || getComputedStyle(document.documentElement).colorScheme || "",
347
+ colorScheme: ((c = this.opts.theme) == null ? void 0 : c.colorScheme) || getComputedStyle(document.documentElement).colorScheme || "",
366
348
  safeInsetBottom: this.getSafeInsetBottom()
367
349
  },
368
350
  didProvideLocalStorage: !!this.opts.localStorageProvider,
369
351
  debug: this.opts.debug,
370
352
  popupsBlocked: this.opts.popupsBlocked,
371
353
  gasRefuelAmountPerChain: this.opts.gasRefuelAmountPerChain,
372
- sdkVersion: G,
354
+ sdkVersion: De,
373
355
  referrerDomain: typeof window < "u" ? window.location.origin : void 0,
374
356
  hasAnalyticsCallback: !!this.opts.onAnalyticsEvent
375
357
  },
@@ -378,23 +360,20 @@ class Te {
378
360
  break;
379
361
  }
380
362
  case "didOpen": {
381
- this.iframe.style.opacity = "1", (r = (p = this.opts).onOpen) == null || r.call(p), this.trackEvent({
382
- type: "modal_opened",
383
- timestamp: Date.now()
384
- });
363
+ this.iframe.style.opacity = "1", (h = (u = this.opts).onOpen) == null || h.call(u);
385
364
  break;
386
365
  }
387
366
  case "analyticsEvent":
388
- this.opts.onAnalyticsEvent && t.event && this.opts.onAnalyticsEvent(t.event);
367
+ this.opts.onAnalyticsEvent && e.event && this.opts.onAnalyticsEvent(e.event);
389
368
  break;
390
369
  case "localStorage.getKeys": {
391
370
  if (!this.opts.localStorageProvider)
392
371
  throw new Error("localStorageProvider is not set");
393
- const m = await this.opts.localStorageProvider.getKeys();
394
- (l = (u = this.iframe) == null ? void 0 : u.contentWindow) == null || l.postMessage(
372
+ const a = await this.opts.localStorageProvider.getKeys();
373
+ (m = (g = this.iframe) == null ? void 0 : g.contentWindow) == null || m.postMessage(
395
374
  {
396
375
  type: "localStorage.didGetKeys",
397
- keys: m
376
+ keys: a
398
377
  },
399
378
  this.baseUrl
400
379
  );
@@ -404,66 +383,58 @@ class Te {
404
383
  if (!this.opts.localStorageProvider)
405
384
  throw new Error("localStorageProvider is not set");
406
385
  await this.opts.localStorageProvider.setItem(
407
- t.key,
408
- t.value
386
+ e.key,
387
+ e.value
409
388
  );
410
389
  break;
411
390
  case "localStorage.removeItem":
412
391
  if (!this.opts.localStorageProvider)
413
392
  throw new Error("localStorageProvider is not set");
414
- await this.opts.localStorageProvider.removeItem(t.key);
393
+ await this.opts.localStorageProvider.removeItem(e.key);
415
394
  break;
416
395
  case "localStorage.getItem": {
417
396
  if (!this.opts.localStorageProvider)
418
397
  throw new Error("localStorageProvider is not set");
419
- const m = await this.opts.localStorageProvider.getItem(t.key);
420
- (h = (g = this.iframe) == null ? void 0 : g.contentWindow) == null || h.postMessage(
398
+ const a = await this.opts.localStorageProvider.getItem(e.key);
399
+ (x = (y = this.iframe) == null ? void 0 : y.contentWindow) == null || x.postMessage(
421
400
  {
422
401
  type: "localStorage.didGetItem",
423
- key: t.key,
424
- value: m
402
+ key: e.key,
403
+ value: a
425
404
  },
426
405
  this.baseUrl
427
406
  );
428
407
  break;
429
408
  }
430
409
  case "success":
431
- (x = (f = this.opts) == null ? void 0 : f.onSuccess) == null || x.call(f, t.hash, t.session), this.trackEvent({
432
- type: "modal_closed",
433
- timestamp: Date.now(),
434
- completedTransaction: !0
435
- });
410
+ (E = (b = this.opts) == null ? void 0 : b.onSuccess) == null || E.call(b, e.hash, e.session);
436
411
  break;
437
412
  case "close":
438
- this.removeIframe(), this.destroy(), this.trackEvent({
439
- type: "modal_closed",
440
- timestamp: Date.now(),
441
- completedTransaction: !1
442
- }), (P = ($ = this.opts) == null ? void 0 : $.onClose) == null || P.call($);
413
+ this.removeIframe(), this.destroy(), (C = ($ = this.opts) == null ? void 0 : $.onClose) == null || C.call($);
443
414
  break;
444
415
  case "setMode":
445
- (k = (S = this.opts) == null ? void 0 : S.onSetMode) == null || k.call(S, t.mode);
416
+ (k = (S = this.opts) == null ? void 0 : S.onSetMode) == null || k.call(S, e.mode);
446
417
  break;
447
418
  case "switchChain":
448
419
  if (!this.opts.walletProvider)
449
420
  throw new Error("walletProvider is not set");
450
421
  try {
451
422
  await this.opts.walletProvider.switchChainAsync({
452
- chainId: t.chainId
453
- }), (C = (E = this.iframe) == null ? void 0 : E.contentWindow) == null || C.postMessage(
423
+ chainId: e.chainId
424
+ }), (A = (M = this.iframe) == null ? void 0 : M.contentWindow) == null || A.postMessage(
454
425
  {
455
426
  type: "didSwitchChain",
456
427
  success: !0,
457
- chainId: t.chainId
428
+ chainId: e.chainId
458
429
  },
459
430
  this.baseUrl
460
431
  );
461
- } catch (m) {
462
- (M = (A = this.iframe) == null ? void 0 : A.contentWindow) == null || M.postMessage(
432
+ } catch (a) {
433
+ (T = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || T.postMessage(
463
434
  {
464
435
  type: "didSwitchChain",
465
436
  success: !1,
466
- error: m
437
+ error: a
467
438
  },
468
439
  this.baseUrl
469
440
  );
@@ -474,23 +445,23 @@ class Te {
474
445
  if (!this.opts.walletProvider)
475
446
  throw new Error("walletProvider is not set");
476
447
  try {
477
- const m = await this.opts.walletProvider.sendTransactionAsync(
478
- t.tx
448
+ const a = await this.opts.walletProvider.sendTransactionAsync(
449
+ e.tx
479
450
  );
480
- (T = (D = this.iframe) == null ? void 0 : D.contentWindow) == null || T.postMessage(
451
+ (j = (W = this.iframe) == null ? void 0 : W.contentWindow) == null || j.postMessage(
481
452
  {
482
453
  type: "didSendTransaction",
483
454
  success: !0,
484
- txHash: m
455
+ txHash: a
485
456
  },
486
457
  this.baseUrl
487
458
  );
488
- } catch (m) {
489
- (O = (U = this.iframe) == null ? void 0 : U.contentWindow) == null || O.postMessage(
459
+ } catch (a) {
460
+ (D = (z = this.iframe) == null ? void 0 : z.contentWindow) == null || D.postMessage(
490
461
  {
491
462
  type: "didSendTransaction",
492
463
  success: !1,
493
- error: m
464
+ error: a
494
465
  },
495
466
  this.baseUrl
496
467
  );
@@ -502,7 +473,7 @@ class Te {
502
473
  if (!this.opts.walletProvider)
503
474
  throw new Error("walletProvider is not set");
504
475
  if (!this.opts.walletProvider.signTypedDataAsync) {
505
- (z = (j = this.iframe) == null ? void 0 : j.contentWindow) == null || z.postMessage(
476
+ (R = (O = this.iframe) == null ? void 0 : O.contentWindow) == null || R.postMessage(
506
477
  {
507
478
  type: "didSignTypedData",
508
479
  success: !1,
@@ -513,23 +484,79 @@ class Te {
513
484
  return;
514
485
  }
515
486
  try {
516
- const m = await this.opts.walletProvider.signTypedDataAsync(
517
- t.data
487
+ const a = await this.opts.walletProvider.signTypedDataAsync(
488
+ e.data
518
489
  );
519
- (L = (R = this.iframe) == null ? void 0 : R.contentWindow) == null || L.postMessage(
490
+ (B = (L = this.iframe) == null ? void 0 : L.contentWindow) == null || B.postMessage(
520
491
  {
521
492
  type: "didSignTypedData",
522
493
  success: !0,
523
- signature: m
494
+ signature: a
524
495
  },
525
496
  this.baseUrl
526
497
  );
527
- } catch (m) {
528
- (W = (B = this.iframe) == null ? void 0 : B.contentWindow) == null || W.postMessage(
498
+ } catch (a) {
499
+ (G = (F = this.iframe) == null ? void 0 : F.contentWindow) == null || G.postMessage(
529
500
  {
530
501
  type: "didSignTypedData",
531
502
  success: !1,
532
- error: m
503
+ error: a
504
+ },
505
+ this.baseUrl
506
+ );
507
+ }
508
+ }
509
+ break;
510
+ case "solana_signMessage":
511
+ {
512
+ if (!this.opts.solanaWalletProvider)
513
+ throw new Error("solanaWalletProvider is not set");
514
+ try {
515
+ const a = await this.opts.solanaWalletProvider.signMessageAsync(
516
+ e.message
517
+ );
518
+ (q = (H = this.iframe) == null ? void 0 : H.contentWindow) == null || q.postMessage(
519
+ {
520
+ type: "solana_didSignMessage",
521
+ success: !0,
522
+ signature: a
523
+ },
524
+ this.baseUrl
525
+ );
526
+ } catch (a) {
527
+ (N = (K = this.iframe) == null ? void 0 : K.contentWindow) == null || N.postMessage(
528
+ {
529
+ type: "solana_didSignMessage",
530
+ success: !1,
531
+ error: a
532
+ },
533
+ this.baseUrl
534
+ );
535
+ }
536
+ }
537
+ break;
538
+ case "solana_sendTransaction":
539
+ {
540
+ if (!this.opts.solanaWalletProvider)
541
+ throw new Error("solanaWalletProvider is not set");
542
+ try {
543
+ const a = await this.opts.solanaWalletProvider.sendTransactionAsync(
544
+ e.transaction
545
+ );
546
+ (V = (_ = this.iframe) == null ? void 0 : _.contentWindow) == null || V.postMessage(
547
+ {
548
+ type: "solana_didSendTransaction",
549
+ success: !0,
550
+ signature: a
551
+ },
552
+ this.baseUrl
553
+ );
554
+ } catch (a) {
555
+ (X = (J = this.iframe) == null ? void 0 : J.contentWindow) == null || X.postMessage(
556
+ {
557
+ type: "solana_didSendTransaction",
558
+ success: !1,
559
+ error: a
533
560
  },
534
561
  this.baseUrl
535
562
  );
@@ -538,47 +565,18 @@ class Te {
538
565
  break;
539
566
  }
540
567
  });
541
- this.opts = e;
542
- }
543
- /**
544
- * Get analytics context for events tracked directly in SDK
545
- */
546
- getAnalyticsContext() {
547
- var e;
548
- return {
549
- projectId: this.opts.projectId,
550
- appSlug: this.opts.app,
551
- sdkVersion: G,
552
- referrerDomain: typeof window < "u" ? window.location.origin : void 0,
553
- walletAddress: (e = this.opts.walletProvider) == null ? void 0 : e.address,
554
- device: {
555
- isMobile: Ae(),
556
- platform: Ee(),
557
- browser: Ce()
558
- }
559
- };
560
- }
561
- /**
562
- * Track an analytics event with context
563
- */
564
- trackEvent(e) {
565
- if (!this.opts.onAnalyticsEvent) return;
566
- const t = {
567
- ...e,
568
- ...this.getAnalyticsContext()
569
- };
570
- this.opts.onAnalyticsEvent(t);
568
+ this.opts = t;
571
569
  }
572
570
  get externalUrl() {
573
- var e, t, i, o, n, c, d, a, y;
574
- return `${this.baseUrl}${this.opts.app}?${this.opts.recipient ? `&recipient=${this.opts.recipient}` : ""}${this.opts.preferGaslessPayment ? "&preferGaslessPayment=true" : ""}${this.opts.mode ? `&mode=${this.opts.mode}` : ""}${this.opts.amount ? `&amount=${this.opts.amount}` : ""}${this.opts.chainId ? `&chainId=${this.opts.chainId}` : ""}${this.opts.currencyId ? `&currencyId=${this.opts.currencyId}` : ""}${this.opts.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${de(
571
+ var t, e, i, o, n, p, l, d, f, c;
572
+ return `${this.baseUrl}${this.opts.app}?${this.opts.recipient ? `&recipient=${this.opts.recipient}` : ""}${this.opts.preferGaslessPayment ? "&preferGaslessPayment=true" : ""}${this.opts.mode ? `&mode=${this.opts.mode}` : ""}${this.opts.amount ? `&amount=${this.opts.amount}` : ""}${this.opts.chainId ? `&chainId=${this.opts.chainId}` : ""}${this.opts.currencyId ? `&currencyId=${this.opts.currencyId}` : ""}${this.opts.evm ? `&evm.chainId=${this.opts.evm.chainId}&evm.to=${this.opts.evm.to}&evm.data=${this.opts.evm.data || "0x0"}&evm.value=${ye(
575
573
  this.opts.evm.value || 0n
576
- )}` : ""}${this.opts.approval ? `&approval.token=${this.opts.approval.token}&approval.amount=${this.opts.approval.amount}` : ""}${this.opts.sessionMetadata ? `&metadata=${this.opts.sessionMetadata}` : ""}${this.opts.autoCloseOnSuccess ? "&autoCloseOnSuccess=true" : ""}${this.opts.sessionId ? `&sessionId=${this.opts.sessionId}` : ""}${(e = this.opts.chainIds) != null && e.length ? `&chainIds=${this.opts.chainIds.join(",")}` : ""}${(t = this.opts.excludeChainIds) != null && t.length ? `&excludeChainIds=${this.opts.excludeChainIds.join(",")}` : ""}${(i = this.opts.excludeCurrencyTiers) != null && i.length ? `&excludeCurrencyTiers=${this.opts.excludeCurrencyTiers.join(",")}` : ""}${(o = this.opts.excludeFundingSources) != null && o.length ? `&excludeFundingSources=${this.opts.excludeFundingSources.join(",")}` : ""}${(n = this.opts.fundingSources) != null && n.length ? `&fundingSources=${this.opts.fundingSources.join(",")}` : ""}${(c = this.opts.allowedPaymentCurrencies) != null && c.length ? `&allowedPaymentCurrencies=${this.opts.allowedPaymentCurrencies.join(",")}` : ""}${(d = this.opts.appMetadata) != null && d.name ? `&appMetadata.name=${encodeURIComponent(this.opts.appMetadata.name)}` : ""}${(a = this.opts.appMetadata) != null && a.logoUrl ? `&appMetadata.logoUrl=${encodeURIComponent(this.opts.appMetadata.logoUrl)}` : ""}${(y = this.opts.appMetadata) != null && y.faviconUrl ? `&appMetadata.faviconUrl=${encodeURIComponent(this.opts.appMetadata.faviconUrl)}` : ""}${this.opts.enableRefundEmails ? "&enableRefundEmails=true" : ""}${this.opts.payerEmail ? `&payerEmail=${encodeURIComponent(this.opts.payerEmail)}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.hideSettlementCopy ? "&hideSettlementCopy=true" : ""}${this.opts.showAppLogo ? `&showAppLogo=${this.opts.showAppLogo}` : ""}${this.opts.showOnrampFirst ? "&showOnrampFirst=true" : ""}${this.opts.debitCardAlias ? `&debitCardAlias=${this.opts.debitCardAlias}` : ""}${this.opts.copyOverrides ? `&copyOverrides=${encodeURIComponent(JSON.stringify(this.opts.copyOverrides))}` : ""}${this.opts.stableDepositAddressKey ? `&stableDepositAddressKey=${encodeURIComponent(this.opts.stableDepositAddressKey)}` : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
574
+ )}` : ""}${this.opts.approval ? `&approval.token=${this.opts.approval.token}&approval.amount=${this.opts.approval.amount}` : ""}${this.opts.sessionMetadata ? `&metadata=${this.opts.sessionMetadata}` : ""}${this.opts.autoCloseOnSuccess ? "&autoCloseOnSuccess=true" : ""}${this.opts.sessionId ? `&sessionId=${this.opts.sessionId}` : ""}${(t = this.opts.chainIds) != null && t.length ? `&chainIds=${this.opts.chainIds.join(",")}` : ""}${(e = this.opts.excludeChainIds) != null && e.length ? `&excludeChainIds=${this.opts.excludeChainIds.join(",")}` : ""}${(i = this.opts.excludeCurrencyTiers) != null && i.length ? `&excludeCurrencyTiers=${this.opts.excludeCurrencyTiers.join(",")}` : ""}${(o = this.opts.excludeFundingSources) != null && o.length ? `&excludeFundingSources=${this.opts.excludeFundingSources.join(",")}` : ""}${(n = this.opts.fundingSources) != null && n.length ? `&fundingSources=${this.opts.fundingSources.join(",")}` : ""}${(p = this.opts.allowedPaymentCurrencies) != null && p.length ? `&allowedPaymentCurrencies=${this.opts.allowedPaymentCurrencies.join(",")}` : ""}${(l = this.opts.excludePaymentCurrencies) != null && l.length ? `&excludePaymentCurrencies=${this.opts.excludePaymentCurrencies.join(",")}` : ""}${(d = this.opts.appMetadata) != null && d.name ? `&appMetadata.name=${encodeURIComponent(this.opts.appMetadata.name)}` : ""}${(f = this.opts.appMetadata) != null && f.logoUrl ? `&appMetadata.logoUrl=${encodeURIComponent(this.opts.appMetadata.logoUrl)}` : ""}${(c = this.opts.appMetadata) != null && c.faviconUrl ? `&appMetadata.faviconUrl=${encodeURIComponent(this.opts.appMetadata.faviconUrl)}` : ""}${this.opts.enableRefundEmails ? "&enableRefundEmails=true" : ""}${this.opts.payerEmail ? `&payerEmail=${encodeURIComponent(this.opts.payerEmail)}` : ""}${this.opts.debug ? "&debug=true" : ""}${this.opts.popupsBlocked ? "&popupsBlocked=true" : ""}${this.opts.disableWithdrawToSelfSuggestion ? "&disableWithdrawToSelfSuggestion=true" : ""}${this.opts.hideSettlementCopy ? "&hideSettlementCopy=true" : ""}${this.opts.showAppLogo ? `&showAppLogo=${this.opts.showAppLogo}` : ""}${this.opts.showOnrampFirst ? "&showOnrampFirst=true" : ""}${this.opts.debitCardAlias ? `&debitCardAlias=${this.opts.debitCardAlias}` : ""}${this.opts.copyOverrides ? `&copyOverrides=${encodeURIComponent(JSON.stringify(this.opts.copyOverrides))}` : ""}${this.opts.stableDepositAddressKey ? `&stableDepositAddressKey=${encodeURIComponent(this.opts.stableDepositAddressKey)}` : ""}${this.opts.gasRefuelAmountPerChain ? `&gasRefuelAmountPerChain=${encodeURIComponent(JSON.stringify(this.opts.gasRefuelAmountPerChain))}` : ""}`;
577
575
  }
578
576
  initialize() {
579
577
  window.addEventListener("message", this.iframeEventHandler);
580
- const e = new URL(this.baseUrl).origin;
581
- me(e);
578
+ const t = new URL(this.baseUrl).origin;
579
+ Ie(t);
582
580
  }
583
581
  destroy() {
584
582
  window.removeEventListener("message", this.iframeEventHandler);
@@ -593,149 +591,63 @@ class Te {
593
591
  if (typeof window > "u" || typeof document > "u")
594
592
  return 0;
595
593
  try {
596
- const e = document.createElement("div");
597
- e.style.cssText = "position: fixed; bottom: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; z-index: -1;", document.body.appendChild(e);
598
- const t = window.getComputedStyle(e).paddingBottom;
599
- return document.body.removeChild(e), parseFloat(t) || 0;
594
+ const t = document.createElement("div");
595
+ t.style.cssText = "position: fixed; bottom: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; z-index: -1;", document.body.appendChild(t);
596
+ const e = window.getComputedStyle(t).paddingBottom;
597
+ return document.body.removeChild(t), parseFloat(e) || 0;
600
598
  } catch {
601
599
  return 0;
602
600
  }
603
601
  }
604
- openUrl(e) {
605
- this.createIframe(e);
602
+ openUrl(t) {
603
+ this.createIframe(t);
606
604
  }
607
- createIframe(e) {
605
+ createIframe(t) {
608
606
  this.removeIframe();
609
- const t = document.createElement("iframe");
610
- t.id = "glide-deposit-iframe";
611
- const i = this.opts.container, o = i ? `z-index: ${H}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: relative; width: 100%; height: 100%; opacity: 0;` : `z-index: ${H}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;`;
612
- t.setAttribute("style", o), t.src = e, t.allow = "payment *; clipboard-write *", i ? i.appendChild(t) : document.body.appendChild(t);
607
+ const e = document.createElement("iframe");
608
+ e.id = "glide-deposit-iframe";
609
+ const i = this.opts.container, o = i ? `z-index: ${Y}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: relative; width: 100%; height: 100%; opacity: 0;` : `z-index: ${Y}; display: block; background-color: transparent; border: 0px none transparent; overflow-x: hidden; overflow-y: auto; visibility: visible; margin: 0px; padding: 0px; -webkit-tap-highlight-color: transparent; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; opacity: 0;`;
610
+ e.setAttribute("style", o), e.src = t, e.allow = "payment *; clipboard-write *", i ? i.appendChild(e) : document.body.appendChild(e);
613
611
  }
614
612
  removeIframe() {
615
- const e = document.getElementById("glide-deposit-iframe");
616
- e && (e.remove(), document.body.classList.remove("glide-deposit-open"));
613
+ const t = document.getElementById("glide-deposit-iframe");
614
+ t && (t.remove(), document.body.classList.remove("glide-deposit-open"));
617
615
  }
618
616
  }
619
- const Ue = Object.freeze({
620
- getItem: (s) => new Promise((e, t) => {
617
+ const Le = Object.freeze({
618
+ getItem: (s) => new Promise((t, e) => {
621
619
  try {
622
620
  const i = localStorage.getItem(s);
623
- e(i);
624
- } catch (i) {
625
621
  t(i);
622
+ } catch (i) {
623
+ e(i);
626
624
  }
627
625
  }),
628
- setItem: (s, e) => new Promise((t, i) => {
626
+ setItem: (s, t) => new Promise((e, i) => {
629
627
  try {
630
- localStorage.setItem(s, e), t();
628
+ localStorage.setItem(s, t), e();
631
629
  } catch (o) {
632
630
  i(o);
633
631
  }
634
632
  }),
635
- removeItem: (s) => new Promise((e, t) => {
633
+ removeItem: (s) => new Promise((t, e) => {
636
634
  try {
637
- localStorage.removeItem(s), e();
635
+ localStorage.removeItem(s), t();
638
636
  } catch (i) {
639
- t(i);
637
+ e(i);
640
638
  }
641
639
  }),
642
- getKeys: () => new Promise((s, e) => {
640
+ getKeys: () => new Promise((s, t) => {
643
641
  try {
644
- const t = Object.keys(localStorage);
645
- s(t);
646
- } catch (t) {
647
- e(t);
642
+ const e = Object.keys(localStorage);
643
+ s(e);
644
+ } catch (e) {
645
+ t(e);
648
646
  }
649
647
  })
650
648
  });
651
- class Me {
652
- constructor(e) {
653
- w(this, "callback");
654
- w(this, "startTime");
655
- w(this, "currentStep");
656
- this.callback = e;
657
- }
658
- setCallback(e) {
659
- this.callback = e;
660
- }
661
- track(e) {
662
- if (this.callback)
663
- try {
664
- this.callback(e);
665
- } catch (t) {
666
- console.error("Error in analytics callback:", t);
667
- }
668
- }
669
- // Convenience methods for common events
670
- modalOpened() {
671
- this.startTime = Date.now(), this.track({
672
- type: "modal_opened",
673
- timestamp: Date.now()
674
- });
675
- }
676
- modalClosed(e) {
677
- this.track({
678
- type: "modal_closed",
679
- timestamp: Date.now(),
680
- completedTransaction: e
681
- }), this.startTime = void 0, this.currentStep = void 0;
682
- }
683
- stepViewed(e) {
684
- this.currentStep = e, this.track({
685
- type: "step_viewed",
686
- step: e,
687
- timestamp: Date.now()
688
- });
689
- }
690
- stepExited(e, t) {
691
- this.track({
692
- type: "step_exited",
693
- step: e,
694
- timestamp: Date.now(),
695
- direction: t
696
- });
697
- }
698
- paymentMethodSelected(e) {
699
- this.track({
700
- type: "payment_method_selected",
701
- paymentMethod: e,
702
- timestamp: Date.now()
703
- });
704
- }
705
- transactionCompleted(e, t, i, o) {
706
- const n = this.startTime ? Date.now() - this.startTime : 0;
707
- this.track({
708
- type: "transaction_completed",
709
- sessionId: e,
710
- txHash: t,
711
- paymentMethod: i,
712
- success: !0,
713
- amountUSD: o,
714
- timestamp: Date.now()
715
- }), this.track({
716
- type: "conversion_completed",
717
- sessionId: e,
718
- paymentMethod: i,
719
- amountUSD: o,
720
- duration: n,
721
- timestamp: Date.now()
722
- });
723
- }
724
- errorOccurred(e, t, i) {
725
- this.track({
726
- type: "error_occurred",
727
- errorType: e,
728
- errorMessage: t,
729
- step: i || this.currentStep,
730
- timestamp: Date.now()
731
- });
732
- }
733
- }
734
- const Oe = new Me();
735
649
  export {
736
- Me as GlideAnalytics,
737
- Te as GlideDeposit,
738
- Ue as browserLocalStorageProvider,
739
- Oe as glideAnalytics,
740
- me as initializeParentBridge
650
+ Re as GlideDeposit,
651
+ Le as browserLocalStorageProvider,
652
+ Ie as initializeParentBridge
741
653
  };