@reclack/walletkit 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +341 -2
- package/assets/backpack.webp +0 -0
- package/assets/berasig.webp +0 -0
- package/assets/bestwallet.webp +0 -0
- package/assets/bifrostwallet.webp +0 -0
- package/assets/binance.webp +0 -0
- package/assets/bitcoincom.webp +0 -0
- package/assets/bitget.webp +0 -0
- package/assets/bitpay.webp +0 -0
- package/assets/bitski.webp +0 -0
- package/assets/bitverse.webp +0 -0
- package/assets/blockchaincom.webp +0 -0
- package/assets/brave.webp +0 -0
- package/assets/bybit.webp +0 -0
- package/assets/clv.webp +0 -0
- package/assets/coin98.webp +0 -0
- package/assets/coinbase.webp +0 -0
- package/assets/compass.webp +0 -0
- package/assets/core.webp +0 -0
- package/assets/crypto_com.webp +0 -0
- package/assets/ctrl.webp +0 -0
- package/assets/dawn.webp +0 -0
- package/assets/desig.webp +0 -0
- package/assets/enkrypt.webp +0 -0
- package/assets/exodus.webp +0 -0
- package/assets/foxwallet.webp +0 -0
- package/assets/frame.webp +0 -0
- package/assets/frontier.webp +0 -0
- package/assets/gate.webp +0 -0
- package/assets/gemini.webp +0 -0
- package/assets/imtoken.webp +0 -0
- package/assets/iopay.webp +0 -0
- package/assets/kaia.webp +0 -0
- package/assets/kaikas.webp +0 -0
- package/assets/kraken.webp +0 -0
- package/assets/kresuswallet.webp +0 -0
- package/assets/ledger.webp +0 -0
- package/assets/magiceden.webp +0 -0
- package/assets/meco.webp +0 -0
- package/assets/metamask.webp +0 -0
- package/assets/mew.webp +0 -0
- package/assets/nest.webp +0 -0
- package/assets/nova.webp +0 -0
- package/assets/okto.webp +0 -0
- package/assets/okx.webp +0 -0
- package/assets/oneinch.webp +0 -0
- package/assets/onekey.webp +0 -0
- package/assets/phantom.webp +0 -0
- package/assets/rabby.webp +0 -0
- package/assets/rainbow.webp +0 -0
- package/assets/ramper.webp +0 -0
- package/assets/ready.webp +0 -0
- package/assets/ronin.webp +0 -0
- package/assets/safe.webp +0 -0
- package/assets/safepal.webp +0 -0
- package/assets/solflare.webp +0 -0
- package/assets/subwallet.webp +0 -0
- package/assets/taho.webp +0 -0
- package/assets/talisman.webp +0 -0
- package/assets/tokenary.webp +0 -0
- package/assets/tokenpocket.webp +0 -0
- package/assets/trust-wallet.webp +0 -0
- package/assets/uniswap.webp +0 -0
- package/assets/universalprofiles.webp +0 -0
- package/assets/valora.webp +0 -0
- package/assets/wigwam.webp +0 -0
- package/assets/xportal.webp +0 -0
- package/assets/zeal.webp +0 -0
- package/assets/zerion.webp +0 -0
- package/custom-elements.json +207 -0
- package/dist/abi.d.ts +21 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +50 -0
- package/dist/abi.js.map +1 -0
- package/dist/address.d.ts +15 -0
- package/dist/address.d.ts.map +1 -0
- package/dist/address.js +25 -0
- package/dist/address.js.map +1 -0
- package/dist/balance.d.ts +78 -0
- package/dist/balance.d.ts.map +1 -0
- package/dist/balance.js +146 -0
- package/dist/balance.js.map +1 -0
- package/dist/base58.d.ts +15 -0
- package/dist/base58.d.ts.map +1 -0
- package/dist/base58.js +52 -0
- package/dist/base58.js.map +1 -0
- package/dist/catalog-fetch.d.ts +18 -0
- package/dist/catalog-fetch.d.ts.map +1 -0
- package/dist/catalog-fetch.js +85 -0
- package/dist/catalog-fetch.js.map +1 -0
- package/dist/catalog.d.ts +57 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +80 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chains.d.ts +32 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/chains.js +103 -0
- package/dist/chains.js.map +1 -0
- package/dist/config.d.ts +40 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -0
- package/dist/deep-links.d.ts +22 -0
- package/dist/deep-links.d.ts.map +1 -0
- package/dist/deep-links.js +201 -0
- package/dist/deep-links.js.map +1 -0
- package/dist/device.d.ts +23 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/device.js +59 -0
- package/dist/device.js.map +1 -0
- package/dist/element/attributes.d.ts +48 -0
- package/dist/element/element.d.ts +92 -0
- package/dist/element/index.d.ts +4 -0
- package/dist/element/props.d.ts +67 -0
- package/dist/element/ui/app.d.ts +22 -0
- package/dist/element/ui/assets.d.ts +7 -0
- package/dist/element/ui/qr.d.ts +16 -0
- package/dist/element/ui/use-handheld.d.ts +8 -0
- package/dist/element/ui/wallet-connect-panel.d.ts +26 -0
- package/dist/element/ui/wallet-dialog.d.ts +37 -0
- package/dist/element/ui/wallet-list.d.ts +26 -0
- package/dist/element/ui/wallet-mark.d.ts +15 -0
- package/dist/element.js +2079 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +64 -0
- package/dist/errors.js.map +1 -0
- package/dist/evm.d.ts +49 -0
- package/dist/evm.d.ts.map +1 -0
- package/dist/evm.js +217 -0
- package/dist/evm.js.map +1 -0
- package/dist/icons.d.ts +22 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +98 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/intent.d.ts +60 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +2 -0
- package/dist/intent.js.map +1 -0
- package/dist/kit.d.ts +124 -0
- package/dist/kit.d.ts.map +1 -0
- package/dist/kit.js +362 -0
- package/dist/kit.js.map +1 -0
- package/dist/svm.d.ts +45 -0
- package/dist/svm.d.ts.map +1 -0
- package/dist/svm.js +201 -0
- package/dist/svm.js.map +1 -0
- package/dist/theme.d.ts +101 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +217 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +144 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/wallet-standard.d.ts +77 -0
- package/dist/wallet-standard.d.ts.map +1 -0
- package/dist/wallet-standard.js +89 -0
- package/dist/wallet-standard.js.map +1 -0
- package/dist/walletconnect.d.ts +74 -0
- package/dist/walletconnect.d.ts.map +1 -0
- package/dist/walletconnect.js +133 -0
- package/dist/walletconnect.js.map +1 -0
- package/package.json +71 -3
- package/vscode.html-custom-data.json +55 -0
package/dist/element.js
ADDED
|
@@ -0,0 +1,2079 @@
|
|
|
1
|
+
import { DEFAULT_LOGO_BASE as e, applyTheme as t, createWalletKit as n, subscribeHandheld as r, subscribeScheme as i, walletDeepLink as a, walletLogo as o, walletPairingLink as s, walletScans as c, walletsFor as l } from "@reclack/walletkit";
|
|
2
|
+
// node_modules/.pnpm/preact@10.29.8/node_modules/preact/dist/preact.module.js
|
|
3
|
+
var u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T = {}, E = [], D = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, O = Array.isArray;
|
|
4
|
+
function k(e, t) {
|
|
5
|
+
for (var n in t) e[n] = t[n];
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
function ee(e) {
|
|
9
|
+
e && e.parentNode && e.parentNode.removeChild(e);
|
|
10
|
+
}
|
|
11
|
+
function A(e, t, n) {
|
|
12
|
+
var r, i, a, o = {};
|
|
13
|
+
for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
|
|
14
|
+
if (arguments.length > 2 && (o.children = arguments.length > 3 ? u.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
|
|
15
|
+
return j(e, o, r, i, null);
|
|
16
|
+
}
|
|
17
|
+
function j(e, t, n, r, i) {
|
|
18
|
+
var a = {
|
|
19
|
+
type: e,
|
|
20
|
+
props: t,
|
|
21
|
+
key: n,
|
|
22
|
+
ref: r,
|
|
23
|
+
__k: null,
|
|
24
|
+
__: null,
|
|
25
|
+
__b: 0,
|
|
26
|
+
__e: null,
|
|
27
|
+
__c: null,
|
|
28
|
+
constructor: void 0,
|
|
29
|
+
__v: i ?? ++f,
|
|
30
|
+
__i: -1,
|
|
31
|
+
__u: 0
|
|
32
|
+
};
|
|
33
|
+
return i == null && d.vnode != null && d.vnode(a), a;
|
|
34
|
+
}
|
|
35
|
+
function M(e) {
|
|
36
|
+
return e.children;
|
|
37
|
+
}
|
|
38
|
+
function N(e, t) {
|
|
39
|
+
this.props = e, this.context = t;
|
|
40
|
+
}
|
|
41
|
+
function P(e, t) {
|
|
42
|
+
if (t == null) return e.__ ? P(e.__, e.__i + 1) : null;
|
|
43
|
+
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
|
|
44
|
+
return typeof e.type == "function" ? P(e) : null;
|
|
45
|
+
}
|
|
46
|
+
function te(e) {
|
|
47
|
+
if (e.__P && e.__d) {
|
|
48
|
+
var t = e.__v, n = t.__e, r = [], i = [], a = k({}, t);
|
|
49
|
+
a.__v = t.__v + 1, d.vnode && d.vnode(a), ue(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? P(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, fe(r, a, i), t.__e = t.__ = null, a.__e != n && ne(a);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function ne(e) {
|
|
53
|
+
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
|
|
54
|
+
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
|
|
55
|
+
}), ne(e);
|
|
56
|
+
}
|
|
57
|
+
function re(e) {
|
|
58
|
+
(!e.__d && (e.__d = !0) && p.push(e) && !F.__r++ || m != d.debounceRendering) && ((m = d.debounceRendering) || h)(F);
|
|
59
|
+
}
|
|
60
|
+
function F() {
|
|
61
|
+
try {
|
|
62
|
+
for (var e, t = 1; p.length;) p.length > t && p.sort(g), e = p.shift(), t = p.length, te(e);
|
|
63
|
+
} finally {
|
|
64
|
+
p.length = F.__r = 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function ie(e, t, n, r, i, a, o, s, c, l, u) {
|
|
68
|
+
var d, f, p, m, h, g, _ = r && r.__k || E, v = t.length;
|
|
69
|
+
for (c = ae(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || T, p.__i = d, g = ue(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && he(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = oe(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
|
|
70
|
+
return n.__e = h, c;
|
|
71
|
+
}
|
|
72
|
+
function ae(e, t, n, r, i) {
|
|
73
|
+
var a, o, s, c, l, u = n.length, d = u, f = 0;
|
|
74
|
+
for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = j(null, o, null, null, null) : O(o) ? o = e.__k[a] = j(M, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = j(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = se(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
|
|
75
|
+
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = P(s)), ge(s, s));
|
|
76
|
+
return r;
|
|
77
|
+
}
|
|
78
|
+
function oe(e, t, n) {
|
|
79
|
+
var r, i;
|
|
80
|
+
if (typeof e.type == "function") {
|
|
81
|
+
for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = oe(r[i], t, n));
|
|
82
|
+
return t;
|
|
83
|
+
}
|
|
84
|
+
e.__e != t && (t && e.type && !t.parentNode && (t = P(e)), t = n.insertBefore(e.__e, t || null));
|
|
85
|
+
do
|
|
86
|
+
t &&= t.nextSibling;
|
|
87
|
+
while (t != null && t.nodeType == 8);
|
|
88
|
+
return t;
|
|
89
|
+
}
|
|
90
|
+
function se(e, t, n, r) {
|
|
91
|
+
var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);
|
|
92
|
+
if (l === null && s == null || u && s == l.key && c == l.type) return n;
|
|
93
|
+
if (r > +!!u) {
|
|
94
|
+
for (i = n - 1, a = n + 1; i >= 0 || a < t.length;) if ((l = t[o = i >= 0 ? i-- : a++]) != null && !(2 & l.__u) && s == l.key && c == l.type) return o;
|
|
95
|
+
}
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
98
|
+
function ce(e, t, n) {
|
|
99
|
+
t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || D.test(t) ? n : n + "px";
|
|
100
|
+
}
|
|
101
|
+
function I(e, t, n, r, i) {
|
|
102
|
+
var a, o;
|
|
103
|
+
n: if (t == "style") {
|
|
104
|
+
if (typeof n == "string") e.style.cssText = n;
|
|
105
|
+
else {
|
|
106
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ce(e.style, t, "");
|
|
107
|
+
if (n) for (t in n) r && n[t] == r[t] || ce(e.style, t, n[t]);
|
|
108
|
+
}
|
|
109
|
+
} else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(b, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[y] = r[y] : (n[y] = x, e.addEventListener(t, a ? C : S, a)) : e.removeEventListener(t, a ? C : S, a);
|
|
110
|
+
else {
|
|
111
|
+
if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
112
|
+
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
113
|
+
e[t] = n ?? "";
|
|
114
|
+
break n;
|
|
115
|
+
} catch {}
|
|
116
|
+
typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function le(e) {
|
|
120
|
+
return function(t) {
|
|
121
|
+
if (this.l) {
|
|
122
|
+
var n = this.l[t.type + e];
|
|
123
|
+
if (t[v] == null) t[v] = x++;
|
|
124
|
+
else if (t[v] < n[y]) return;
|
|
125
|
+
return n(d.event ? d.event(t) : t);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function ue(e, t, n, r, i, a, o, s, c, l) {
|
|
130
|
+
var u, f, p, m, h, g, _, v, y, b, x, S, C, w, T, D, A = t.type;
|
|
131
|
+
if (t.constructor !== void 0) return null;
|
|
132
|
+
128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = d.__b) && u(t);
|
|
133
|
+
n: if (typeof A == "function") {
|
|
134
|
+
f = o.length;
|
|
135
|
+
try {
|
|
136
|
+
if (y = t.props, b = A.prototype && A.prototype.render, x = (u = A.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (p = t.__c = n.__c).__ = p.__E : (b ? t.__c = p = new A(y, S) : (t.__c = p = new N(y, S), p.constructor = A, p.render = _e), x && x.sub(p), p.state || (p.state = {}), p.__n = r, m = p.__d = !0, p.__h = [], p._sb = []), b && p.__s == null && (p.__s = p.state), b && A.getDerivedStateFromProps != null && (p.__s == p.state && (p.__s = k({}, p.__s)), k(p.__s, A.getDerivedStateFromProps(y, p.__s))), h = p.props, g = p.state, p.__v = t, m) b && A.getDerivedStateFromProps == null && p.componentWillMount != null && p.componentWillMount(), b && p.componentDidMount != null && p.__h.push(p.componentDidMount);
|
|
137
|
+
else {
|
|
138
|
+
if (b && A.getDerivedStateFromProps == null && y !== h && p.componentWillReceiveProps != null && p.componentWillReceiveProps(y, S), t.__v == n.__v || !p.__e && p.shouldComponentUpdate != null && !1 === p.shouldComponentUpdate(y, p.__s, S)) {
|
|
139
|
+
t.__v != n.__v && (p.props = y, p.state = p.__s, p.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
|
|
140
|
+
e && (e.__ = t);
|
|
141
|
+
}), E.push.apply(p.__h, p._sb), p._sb = [], p.__h.length && o.push(p), s = P(n);
|
|
142
|
+
break n;
|
|
143
|
+
}
|
|
144
|
+
p.componentWillUpdate != null && p.componentWillUpdate(y, p.__s, S), b && p.componentDidUpdate != null && p.__h.push(function() {
|
|
145
|
+
p.componentDidUpdate(h, g, _);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (p.context = S, p.props = y, p.__P = e, p.__e = !1, C = d.__r, w = 0, b) p.state = p.__s, p.__d = !1, C && C(t), u = p.render(p.props, p.state, p.context), E.push.apply(p.__h, p._sb), p._sb = [];
|
|
149
|
+
else do
|
|
150
|
+
p.__d = !1, C && C(t), u = p.render(p.props, p.state, p.context), p.state = p.__s;
|
|
151
|
+
while (p.__d && ++w < 25);
|
|
152
|
+
p.state = p.__s, p.getChildContext != null && (r = k(k({}, r), p.getChildContext())), b && !m && p.getSnapshotBeforeUpdate != null && (_ = p.getSnapshotBeforeUpdate(h, g)), T = u != null && u.type === M && u.key == null ? pe(u.props.children) : u, s = ie(e, O(T) ? T : [T], t, n, r, i, a, o, s, c, l), p.base = t.__e, t.__u &= -161, p.__h.length && o.push(p), v && (p.__E = p.__ = null);
|
|
153
|
+
} catch (e) {
|
|
154
|
+
if (o.length = f, t.__v = null, c || a != null) {
|
|
155
|
+
if (e.then) {
|
|
156
|
+
for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
|
|
157
|
+
a != null && (a[a.indexOf(s)] = null), t.__e = s;
|
|
158
|
+
} else if (a != null) for (D = a.length; D--;) ee(a[D]);
|
|
159
|
+
} else t.__e = n.__e;
|
|
160
|
+
t.__k ??= n.__k || [], e.then || de(t), d.__e(e, t, n);
|
|
161
|
+
}
|
|
162
|
+
} else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = me(n.__e, t, n, r, i, a, o, c, l);
|
|
163
|
+
return (u = d.diffed) && u(t), 128 & t.__u ? void 0 : s;
|
|
164
|
+
}
|
|
165
|
+
function de(e) {
|
|
166
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(de));
|
|
167
|
+
}
|
|
168
|
+
function fe(e, t, n) {
|
|
169
|
+
for (var r = 0; r < n.length; r++) he(n[r], n[++r], n[++r]);
|
|
170
|
+
d.__c && d.__c(t, e), e.some(function(t) {
|
|
171
|
+
try {
|
|
172
|
+
e = t.__h, t.__h = [], e.some(function(e) {
|
|
173
|
+
e.call(t);
|
|
174
|
+
});
|
|
175
|
+
} catch (e) {
|
|
176
|
+
d.__e(e, t.__v);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function pe(e) {
|
|
181
|
+
return typeof e != "object" || !e || e.__b > 0 ? e : O(e) ? e.map(pe) : e.constructor === void 0 ? k({}, e) : null;
|
|
182
|
+
}
|
|
183
|
+
function me(e, t, n, r, i, a, o, s, c) {
|
|
184
|
+
var l, f, p, m, h, g, _, v = n.props || T, y = t.props, b = t.type;
|
|
185
|
+
if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {
|
|
186
|
+
for (l = 0; l < a.length; l++) if ((h = a[l]) && "setAttribute" in h == !!b && (b ? h.localName == b : h.nodeType == 3)) {
|
|
187
|
+
e = h, a[l] = null;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (e == null) {
|
|
192
|
+
if (b == null) return document.createTextNode(y);
|
|
193
|
+
e = document.createElementNS(i, b, y.is && y), s &&= (d.__m && d.__m(t, a), !1), a = null;
|
|
194
|
+
}
|
|
195
|
+
if (b == null) v === y || s && e.data == y || (e.data = y);
|
|
196
|
+
else {
|
|
197
|
+
if (a = b == "textarea" && y.defaultValue != null ? null : a && u.call(e.childNodes), !s && a != null) for (v = {}, l = 0; l < e.attributes.length; l++) v[(h = e.attributes[l]).name] = h.value;
|
|
198
|
+
for (l in v) h = v[l], l == "dangerouslySetInnerHTML" ? p = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || I(e, l, null, h, i);
|
|
199
|
+
for (l in y) h = y[l], l == "children" ? m = h : l == "dangerouslySetInnerHTML" ? f = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h || I(e, l, h, v[l], i);
|
|
200
|
+
if (f) s || p && (f.__html == p.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
201
|
+
else if (p && (e.innerHTML = ""), ie(t.type == "template" ? e.content : e, O(m) ? m : [m], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && P(n, 0), s, c), a != null) for (l = a.length; l--;) ee(a[l]);
|
|
202
|
+
s && b != "textarea" || (l = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[l] || b == "progress" && !g || b == "option" && g != v[l]) && I(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && I(e, l, _, v[l], i));
|
|
203
|
+
}
|
|
204
|
+
return e;
|
|
205
|
+
}
|
|
206
|
+
function he(e, t, n) {
|
|
207
|
+
try {
|
|
208
|
+
if (typeof e == "function") {
|
|
209
|
+
var r = typeof e.__u == "function";
|
|
210
|
+
r && e.__u(), r && t == null || (e.__u = e(t));
|
|
211
|
+
} else e.current = t;
|
|
212
|
+
} catch (e) {
|
|
213
|
+
d.__e(e, n);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function ge(e, t, n) {
|
|
217
|
+
var r, i;
|
|
218
|
+
if (d.unmount && d.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || he(r, null, t)), (r = e.__c) != null) {
|
|
219
|
+
if (r.componentWillUnmount) try {
|
|
220
|
+
r.componentWillUnmount();
|
|
221
|
+
} catch (e) {
|
|
222
|
+
d.__e(e, t);
|
|
223
|
+
}
|
|
224
|
+
r.base = r.__P = r.__n = null;
|
|
225
|
+
}
|
|
226
|
+
if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && ge(r[i], t, n || typeof e.type != "function");
|
|
227
|
+
n || ee(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
228
|
+
}
|
|
229
|
+
function _e(e, t, n) {
|
|
230
|
+
return this.constructor(e, n);
|
|
231
|
+
}
|
|
232
|
+
function ve(e, t, n) {
|
|
233
|
+
var r, i, a, o;
|
|
234
|
+
t == document && (t = document.documentElement), d.__ && d.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ue(t, e = (!r && n || t).__k = A(M, null, [e]), i || T, T, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? u.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), fe(a, e, o), e.props.children = null;
|
|
235
|
+
}
|
|
236
|
+
function ye(e) {
|
|
237
|
+
function t(e) {
|
|
238
|
+
var n, r;
|
|
239
|
+
return this.getChildContext || (n = /* @__PURE__ */ new Set(), (r = {})[t.__c] = this, this.getChildContext = function() {
|
|
240
|
+
return r;
|
|
241
|
+
}, this.componentWillUnmount = function() {
|
|
242
|
+
n = null;
|
|
243
|
+
}, this.shouldComponentUpdate = function(e) {
|
|
244
|
+
this.props.value != e.value && n.forEach(function(e) {
|
|
245
|
+
e.__e = !0, re(e);
|
|
246
|
+
});
|
|
247
|
+
}, this.sub = function(e) {
|
|
248
|
+
n.add(e);
|
|
249
|
+
var t = e.componentWillUnmount;
|
|
250
|
+
e.componentWillUnmount = function() {
|
|
251
|
+
n && n.delete(e), t && t.call(e);
|
|
252
|
+
};
|
|
253
|
+
}), e.children;
|
|
254
|
+
}
|
|
255
|
+
return t.__c = "__cC" + w++, t.__ = e, t.Provider = t.__l = (t.Consumer = function(e, t) {
|
|
256
|
+
return e.children(t);
|
|
257
|
+
}).contextType = t, t;
|
|
258
|
+
}
|
|
259
|
+
u = E.slice, d = { __e: function(e, t, n, r) {
|
|
260
|
+
for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
|
|
261
|
+
if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;
|
|
262
|
+
} catch (t) {
|
|
263
|
+
e = t;
|
|
264
|
+
}
|
|
265
|
+
throw e;
|
|
266
|
+
} }, f = 0, N.prototype.setState = function(e, t) {
|
|
267
|
+
var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state);
|
|
268
|
+
typeof e == "function" && (e = e(k({}, n), this.props)), e && k(n, e), e != null && this.__v && (t && this._sb.push(t), re(this));
|
|
269
|
+
}, N.prototype.forceUpdate = function(e) {
|
|
270
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), re(this));
|
|
271
|
+
}, N.prototype.render = M, p = [], h = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, g = function(e, t) {
|
|
272
|
+
return e.__v.__b - t.__v.__b;
|
|
273
|
+
}, F.__r = 0, _ = Math.random().toString(8), v = "__d" + _, y = "__a" + _, b = /(PointerCapture)$|Capture$/i, x = 0, S = le(!1), C = le(!0), w = 0;
|
|
274
|
+
// src/element/styles.css?inline
|
|
275
|
+
var be = ":host{--rkw-surface:#fff;--rkw-ground:#f6f7f9;--rkw-plate:#f6f7f9;--rkw-ink:#101014;--rkw-ink-muted:#6b6b76;--rkw-line:#e5e5ea;--rkw-brand:#533afd;--rkw-brand-ink:#fff;--rkw-danger:#b42318;--rkw-ok:#12a150;--rkw-installed:#16a34a;--rkw-installed-ink:#15803d;--rkw-radius:10px;--rkw-hover:color-mix(in srgb, var(--rkw-ink-muted) 12%, transparent);--rkw-cross:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M6 6 18 18M18 6 6 18'/%3E%3C/svg%3E\");color-scheme:var(--rkw-color-scheme,light);scrollbar-width:thin;color:var(--rkw-ink);font-family:var(--rkw-font,inherit);-webkit-font-smoothing:antialiased;font-size:16px;line-height:1.5;display:block}:host([hidden]){display:none}*,:before,:after{box-sizing:border-box}button{font:inherit;color:inherit}.wallets{gap:.5rem;display:grid}.wallet{border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-surface);width:100%;font:inherit;color:inherit;cursor:pointer;text-align:left;align-items:center;gap:.625rem;padding:.625rem .75rem;font-size:.875rem;display:flex}.wallet:hover:not(:disabled){border-color:var(--rkw-brand)}.wallet:disabled{opacity:.6;cursor:progress}.wallet-mark{background:var(--rkw-plate);border-radius:7px;flex:none;place-items:center;width:1.75rem;height:1.75rem;font-size:.75rem;font-weight:700;display:grid;overflow:hidden}.wallet-mark img{object-fit:contain;width:100%;height:100%}.wallet-name{flex:1;font-weight:500}.wallet-tag{color:var(--rkw-ink-muted);font-size:.6875rem}.connected{border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);align-items:center;gap:.625rem;padding:.625rem .75rem;display:flex}.connected-meta{flex:1;min-width:0;display:grid}.connected-meta strong{font-size:.875rem}.connected-meta code{color:var(--rkw-ink-muted);font-size:.75rem}.primary,.secondary{font:inherit;border-radius:var(--rkw-radius);cursor:pointer;border:1px solid #0000;width:100%;padding:.75rem 1rem;font-size:.9375rem;font-weight:600}.primary{background:var(--rkw-brand);color:var(--rkw-brand-ink)}.primary:disabled{opacity:.45;cursor:not-allowed}.secondary{background:var(--rkw-surface);border-color:var(--rkw-line);color:inherit;justify-self:start;width:auto;padding:.5rem .75rem;font-size:.8125rem}.link-button{font:inherit;color:var(--rkw-brand);cursor:pointer;background:0 0;border:0;padding:0;font-size:.8125rem}.plan-terms{color:var(--rkw-ink);margin:.625rem 0 0;font-size:.8125rem;line-height:1.5}.pending{color:var(--rkw-ink-muted);margin:0;font-size:.75rem}.error{color:var(--rkw-danger);margin:0;font-size:.8125rem}.muted{color:var(--rkw-ink-muted);margin:0;font-size:.875rem}.wallet-dialog{border:1px solid var(--rkw-line);background:var(--rkw-surface);width:min(22.5rem,100vw - 2rem);max-height:min(40rem,100dvh - 4rem);color:inherit;border-radius:24px;margin:auto;padding:0;transition:height .3s cubic-bezier(.22,1,.36,1),width .3s cubic-bezier(.22,1,.36,1);overflow:hidden;box-shadow:0 24px 60px -20px #10101447,0 2px 6px #1010140d}.wallet-dialog[open]{display:flex}.wallet-dialog::backdrop{background:color-mix(in srgb, var(--rkw-ground) 55%, transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.wallet-list{gap:.25rem;display:grid}.wallet-row{width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:.75rem;padding:.75rem .5rem;transition:background .15s;display:flex}.wallet-row:hover:not(:disabled),.wallet-row:focus-visible{background:var(--rkw-hover)}.wallet-row .wallet-mark-lg{border-radius:12px;width:2.5rem;height:2.5rem}.wallet-row-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.9375rem;font-weight:500;overflow:hidden}.wallet-row-tag{background:color-mix(in srgb, var(--rkw-brand) 9%, transparent);color:var(--rkw-brand);letter-spacing:.02em;text-transform:uppercase;border-radius:6px;flex:none;padding:.125rem .4375rem;font-size:.625rem;font-weight:700;line-height:1}.wallet-row-tag.is-installed{background:color-mix(in srgb, var(--rkw-installed) 12%, transparent);color:var(--rkw-installed-ink)}.wallet-row-tag.is-muted{background:color-mix(in srgb, var(--rkw-ink-muted) 10%, transparent);color:var(--rkw-ink-muted)}.wallet-search-row{background:var(--rkw-plate);flex:none;margin-top:.375rem;padding-top:.5rem;padding-bottom:.5rem}.wallet-search-row .wallet-search-icon{height:1.5rem}.wallet-search-row:hover:not(:disabled),.wallet-search-row:focus-visible{background:var(--rkw-hover)}.wallet-search-icon{width:2.5rem;height:2.5rem;color:var(--rkw-ink-muted);flex:none;place-items:center;display:grid}.wallet-search-icon svg{width:1.25rem;height:1.25rem}.wallet-row-count{color:var(--rkw-ink-muted);font-variant-numeric:tabular-nums;flex:none;font-size:.8125rem}.wallet-row-chevron{color:var(--rkw-ink-muted);flex:none;font-size:1rem;line-height:1}.wallet-dialog-body{flex-direction:column;width:100%;min-height:0;padding:1rem 1rem .875rem;display:flex}.wallet-dialog-head{flex:none;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:1.125rem;display:flex}.wallet-dialog-head h2{margin:0;font-size:.9375rem;font-weight:600}.icon-button{font:inherit;width:1.75rem;height:1.75rem;color:var(--rkw-ink-muted);cursor:pointer;background:0 0;border:0;border-radius:7px;place-items:center;font-size:1.25rem;line-height:1;display:grid}.icon-button:hover{background:var(--rkw-hover);color:var(--rkw-ink)}.wallet-search{font:inherit;border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-surface);width:100%;color:inherit;flex:none;margin-bottom:.875rem;padding:.5rem .75rem;font-size:.875rem}.wallet-search::-webkit-search-cancel-button{appearance:none;cursor:pointer;background-color:var(--rkw-ink-muted);width:1.125rem;height:1.125rem;-webkit-mask:var(--rkw-cross) center / contain no-repeat;-webkit-mask:var(--rkw-cross) center / contain no-repeat;mask:var(--rkw-cross) center / contain no-repeat}.wallet-search::-webkit-search-cancel-button:hover{background-color:var(--rkw-ink)}.wallet-grid,.wallet-list{overscroll-behavior:contain;min-height:0;margin-right:-1rem;padding-right:1rem;overflow-y:auto}.wallet-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.625rem;max-height:24rem;margin-bottom:-.625rem;display:grid}.wallet-tile{background:var(--rkw-plate);font:inherit;color:inherit;cursor:pointer;text-align:center;border:0;border-radius:16px;justify-items:center;gap:.5rem;padding:.875rem .5rem;text-decoration:none;transition:background .15s;display:grid;position:relative}.wallet-tile:hover:not(:disabled),.wallet-tile:focus-visible{background:var(--rkw-hover)}.wallet-tile .wallet-mark-lg{background:var(--rkw-surface);border-radius:14px;width:3.25rem;height:3.25rem}.wallet-tile:disabled{opacity:.6;cursor:progress}.wallet-mark-lg{border-radius:12px;width:2.75rem;height:2.75rem;font-size:1rem}.wallet-tile-name{text-overflow:ellipsis;white-space:nowrap;width:100%;max-width:100%;font-size:.75rem;font-weight:500;line-height:1.2;overflow:hidden}.wallet-tile-badge{background:var(--rkw-surface);border:1.5px solid var(--rkw-installed);width:.9375rem;height:.9375rem;color:var(--rkw-installed);box-shadow:0 0 0 2px var(--rkw-plate);border-radius:999px;place-items:center;display:grid;position:absolute;top:.4375rem;right:.4375rem}.wallet-tile-badge svg{stroke-width:4px;width:.5rem;height:.5rem}.wallet-stack{flex:none;justify-content:center;align-items:center;width:1.75rem;height:1.75rem;display:flex}.wallet-stack img{object-fit:cover;width:1rem;height:1rem;box-shadow:0 0 0 2px var(--rkw-surface);border-radius:50%}.wallet-stack img+img{margin-left:-.4375rem}.wallet-more-button .wallet-mark{letter-spacing:.05em;color:var(--rkw-ink-muted)}.wallet-empty{text-align:center;padding:1rem 0 0}.icon-button-spacer{width:1.75rem;height:1.75rem}.connect-status{align-content:center;gap:.625rem;min-height:17rem;padding:1.25rem 0 1.5rem}.connect-status .connect-retry{justify-self:center;margin-top:.5rem}.connect-open{text-align:center;text-decoration:none;display:block}.connect-handoff{align-content:center;gap:1rem;min-height:16rem}.connect-status-mark{place-items:center;width:5.5rem;height:5.5rem;display:grid;position:relative}.connect-status-mark .wallet-mark-lg{background:var(--rkw-surface);border-radius:18px;width:4rem;height:4rem}.connect-spinner{width:100%;height:100%;color:var(--rkw-brand);animation:1.1s linear infinite connect-spin;position:absolute;inset:0}@keyframes connect-spin{to{transform:rotate(360deg)}}.connect-retry,.connect-copy{align-items:center;gap:.375rem;display:inline-flex}.connect-retry-icon{width:.875rem;height:.875rem}@media (prefers-reduced-motion:reduce){.connect-spinner,.qr-spinner,.state-loading-spinner{animation:none}}.connect-status-title{margin:.5rem 0 0;font-size:.9375rem;font-weight:600}.connect-status-title.is-error{color:var(--rkw-danger)}.connect-status-note{max-width:30ch;color:var(--rkw-ink-muted);text-align:center;margin:0;font-size:.8125rem;line-height:1.5}@keyframes wallet-view-in{0%{opacity:0;transform:translateY(6px)scale(.985)}to{opacity:1;transform:none}}.connect-panel,.wallet-list,.wallet-grid{animation:.24s cubic-bezier(.22,1,.36,1) both wallet-view-in}@media (prefers-reduced-motion:reduce){.connect-panel,.wallet-list,.wallet-grid{animation:none}}.connect-panel{justify-items:center;gap:.875rem;min-height:0;padding:.5rem 0 0;display:grid;overflow-y:auto}.portal-tabs{border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-plate);gap:.25rem;padding:.3125rem;display:flex}.portal-tab{color:var(--rkw-ink-muted);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:7px;flex:1;justify-content:center;align-items:center;gap:.375rem;padding:.4375rem .5rem;font-size:.8125rem;font-weight:500;transition:background .15s,color .15s;display:inline-flex}.portal-tab:hover{color:var(--rkw-ink)}.portal-tab.is-active{background:color-mix(in srgb, var(--rkw-brand) 16%, var(--rkw-surface));color:var(--rkw-ink);box-shadow:none}.portal-tabs.qr-tabs{border-radius:9px;gap:0;width:auto;padding:0;overflow:hidden}.qr-tabs .portal-tab{border-radius:0;flex:none;padding:.4375rem .875rem;font-size:.75rem}.qr-tabs .portal-tab.is-active{box-shadow:none}.qr-frame{border:1px solid var(--rkw-line);background:var(--rkw-surface);border-radius:22px;place-items:center;width:100%;padding:0;display:grid;position:relative;overflow:hidden}.qr{aspect-ratio:1;place-items:center;width:100%;max-width:none;display:grid}.qr svg{width:100%;height:100%}.qr-fallback{border:1px dashed var(--rkw-line);background:var(--rkw-ground);border-radius:10px;padding:1rem}.qr-fallback code{word-break:break-all;text-align:center;color:var(--rkw-ink-muted);font-size:.6875rem;line-height:1.5}.qr .qr-spinner{width:2.5rem;height:2.5rem;color:var(--rkw-brand);animation:1.1s linear infinite connect-spin}.qr-badge{background:var(--rkw-surface);border-radius:12px;place-items:center;padding:.25rem;display:grid;position:absolute}.qr-caption{text-align:center;margin:0;font-size:.8125rem}.qr-copy{font-size:.8125rem}.install-row{border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-ground);justify-content:space-between;align-items:center;gap:.75rem;width:100%;padding:.625rem .75rem;font-size:.8125rem;display:flex}.install-row .secondary{text-decoration:none;display:inline-block}", L, R, xe, Se, z = 0, Ce = [], B = d, we = B.__b, Te = B.__r, Ee = B.diffed, De = B.__c, Oe = B.unmount, ke = B.__;
|
|
276
|
+
function V(e, t) {
|
|
277
|
+
B.__h && B.__h(R, e, z || t), z = 0;
|
|
278
|
+
var n = R.__H || (R.__H = {
|
|
279
|
+
__: [],
|
|
280
|
+
__h: []
|
|
281
|
+
});
|
|
282
|
+
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
283
|
+
}
|
|
284
|
+
function H(e) {
|
|
285
|
+
return z = 1, Ae(ze, e);
|
|
286
|
+
}
|
|
287
|
+
function Ae(e, t, n) {
|
|
288
|
+
var r = V(L++, 2);
|
|
289
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : ze(void 0, t), function(e) {
|
|
290
|
+
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
291
|
+
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
292
|
+
}], r.__c = R, !R.__f)) {
|
|
293
|
+
var i = function(e, t, n) {
|
|
294
|
+
if (!r.__c.__H) return !0;
|
|
295
|
+
var i = !1, o = r.__c.props !== e;
|
|
296
|
+
if (r.__c.__H.__.some(function(e) {
|
|
297
|
+
if (e.__N) {
|
|
298
|
+
i = !0;
|
|
299
|
+
var t = e.__[0];
|
|
300
|
+
e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);
|
|
301
|
+
}
|
|
302
|
+
}), a) {
|
|
303
|
+
var s = a.call(this, e, t, n);
|
|
304
|
+
return i ? s || o : s;
|
|
305
|
+
}
|
|
306
|
+
return !i || o;
|
|
307
|
+
};
|
|
308
|
+
R.__f = !0;
|
|
309
|
+
var a = R.shouldComponentUpdate, o = R.componentWillUpdate;
|
|
310
|
+
R.componentWillUpdate = function(e, t, n) {
|
|
311
|
+
if (this.__e) {
|
|
312
|
+
var r = a;
|
|
313
|
+
a = void 0, i(e, t, n), a = r;
|
|
314
|
+
}
|
|
315
|
+
o && o.call(this, e, t, n);
|
|
316
|
+
}, R.shouldComponentUpdate = i;
|
|
317
|
+
}
|
|
318
|
+
return r.__N || r.__;
|
|
319
|
+
}
|
|
320
|
+
function U(e, t) {
|
|
321
|
+
var n = V(L++, 3);
|
|
322
|
+
!B.__s && Re(n.__H, t) && (n.__ = e, n.u = t, R.__H.__h.push(n));
|
|
323
|
+
}
|
|
324
|
+
function je(e) {
|
|
325
|
+
return z = 5, W(function() {
|
|
326
|
+
return { current: e };
|
|
327
|
+
}, []);
|
|
328
|
+
}
|
|
329
|
+
function W(e, t) {
|
|
330
|
+
var n = V(L++, 7);
|
|
331
|
+
return Re(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
332
|
+
}
|
|
333
|
+
function Me(e, t) {
|
|
334
|
+
return z = 8, W(function() {
|
|
335
|
+
return e;
|
|
336
|
+
}, t);
|
|
337
|
+
}
|
|
338
|
+
function Ne(e) {
|
|
339
|
+
var t = R.context[e.__c], n = V(L++, 9);
|
|
340
|
+
return n.c = e, t ? (n.__ ?? (n.__ = !0, t.sub(R)), t.props.value) : e.__;
|
|
341
|
+
}
|
|
342
|
+
function Pe() {
|
|
343
|
+
for (var e; e = Ce.shift();) {
|
|
344
|
+
var t = e.__H;
|
|
345
|
+
if (e.__P && t) try {
|
|
346
|
+
t.__h.some(G), t.__h.some(Le), t.__h = [];
|
|
347
|
+
} catch (n) {
|
|
348
|
+
t.__h = [], B.__e(n, e.__v);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
B.__b = function(e) {
|
|
353
|
+
R = null, we && we(e);
|
|
354
|
+
}, B.__ = function(e, t) {
|
|
355
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ke && ke(e, t);
|
|
356
|
+
}, B.__r = function(e) {
|
|
357
|
+
Te && Te(e), L = 0;
|
|
358
|
+
var t = (R = e.__c).__H;
|
|
359
|
+
t && (xe === R ? (t.__h = [], R.__h = [], t.__.some(function(e) {
|
|
360
|
+
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
361
|
+
})) : (t.__h.some(G), t.__h.some(Le), t.__h = [], L = 0)), xe = R;
|
|
362
|
+
}, B.diffed = function(e) {
|
|
363
|
+
Ee && Ee(e);
|
|
364
|
+
var t = e.__c;
|
|
365
|
+
t && t.__H && (t.__H.__h.length && (Ce.push(t) !== 1 && Se === B.requestAnimationFrame || ((Se = B.requestAnimationFrame) || Ie)(Pe)), t.__H.__.some(function(e) {
|
|
366
|
+
e.u &&= (e.__H = e.u, void 0);
|
|
367
|
+
})), xe = R = null;
|
|
368
|
+
}, B.__c = function(e, t) {
|
|
369
|
+
t.some(function(e) {
|
|
370
|
+
try {
|
|
371
|
+
e.__h.some(G), e.__h = e.__h.filter(function(e) {
|
|
372
|
+
return !e.__ || Le(e);
|
|
373
|
+
});
|
|
374
|
+
} catch (n) {
|
|
375
|
+
t.some(function(e) {
|
|
376
|
+
e.__h &&= [];
|
|
377
|
+
}), t = [], B.__e(n, e.__v);
|
|
378
|
+
}
|
|
379
|
+
}), De && De(e, t);
|
|
380
|
+
}, B.unmount = function(e) {
|
|
381
|
+
Oe && Oe(e);
|
|
382
|
+
var t, n = e.__c;
|
|
383
|
+
n && n.__H && (n.__H.__.some(function(e) {
|
|
384
|
+
try {
|
|
385
|
+
G(e);
|
|
386
|
+
} catch (e) {
|
|
387
|
+
t = e;
|
|
388
|
+
}
|
|
389
|
+
}), n.__H = void 0, t && B.__e(t, n.__v));
|
|
390
|
+
};
|
|
391
|
+
var Fe = typeof requestAnimationFrame == "function";
|
|
392
|
+
function Ie(e) {
|
|
393
|
+
var t, n = function() {
|
|
394
|
+
clearTimeout(r), Fe && cancelAnimationFrame(t), setTimeout(e);
|
|
395
|
+
}, r = setTimeout(n, 35);
|
|
396
|
+
Fe && (t = requestAnimationFrame(n));
|
|
397
|
+
}
|
|
398
|
+
function G(e) {
|
|
399
|
+
var t = R, n = e.__c;
|
|
400
|
+
typeof n == "function" && (e.__c = void 0, n()), R = t;
|
|
401
|
+
}
|
|
402
|
+
function Le(e) {
|
|
403
|
+
var t = R;
|
|
404
|
+
e.__c = e.__(), R = t;
|
|
405
|
+
}
|
|
406
|
+
function Re(e, t) {
|
|
407
|
+
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
408
|
+
return t !== e[n];
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
function ze(e, t) {
|
|
412
|
+
return typeof t == "function" ? t(e) : t;
|
|
413
|
+
}
|
|
414
|
+
// node_modules/.pnpm/preact@10.29.8/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
415
|
+
var Be = 0;
|
|
416
|
+
Array.isArray;
|
|
417
|
+
function K(e, t, n, r, i, a) {
|
|
418
|
+
t ||= {};
|
|
419
|
+
var o, s, c = t;
|
|
420
|
+
if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
|
|
421
|
+
var l = {
|
|
422
|
+
type: e,
|
|
423
|
+
props: c,
|
|
424
|
+
key: n,
|
|
425
|
+
ref: o,
|
|
426
|
+
__k: null,
|
|
427
|
+
__: null,
|
|
428
|
+
__b: 0,
|
|
429
|
+
__e: null,
|
|
430
|
+
__c: null,
|
|
431
|
+
constructor: void 0,
|
|
432
|
+
__v: --Be,
|
|
433
|
+
__i: -1,
|
|
434
|
+
__u: 0,
|
|
435
|
+
__source: i,
|
|
436
|
+
__self: a
|
|
437
|
+
};
|
|
438
|
+
if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
|
|
439
|
+
return d.vnode && d.vnode(l), l;
|
|
440
|
+
}
|
|
441
|
+
// src/element/ui/assets.tsx
|
|
442
|
+
var Ve = ye(e);
|
|
443
|
+
function He({ base: e, children: t }) {
|
|
444
|
+
return /* @__PURE__ */ K(Ve.Provider, {
|
|
445
|
+
value: e,
|
|
446
|
+
children: t
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
function Ue() {
|
|
450
|
+
let e = Ne(Ve);
|
|
451
|
+
return W(() => (t) => o(t, e), [e]);
|
|
452
|
+
}
|
|
453
|
+
// src/element/ui/use-handheld.ts
|
|
454
|
+
function We() {
|
|
455
|
+
let [e, t] = H(!1);
|
|
456
|
+
return U(() => r(t), []), e;
|
|
457
|
+
}
|
|
458
|
+
// src/element/ui/wallet-mark.tsx
|
|
459
|
+
function q({ id: e, name: t, icon: n, size: r = "sm" }) {
|
|
460
|
+
let i = Ue(), a = n ?? i(e), o = r === "lg" ? 32 : 20;
|
|
461
|
+
return /* @__PURE__ */ K("span", {
|
|
462
|
+
class: r === "lg" ? "wallet-mark wallet-mark-lg" : "wallet-mark",
|
|
463
|
+
"aria-hidden": "true",
|
|
464
|
+
children: a ? /* @__PURE__ */ K("img", {
|
|
465
|
+
src: a,
|
|
466
|
+
alt: "",
|
|
467
|
+
width: o,
|
|
468
|
+
height: o,
|
|
469
|
+
loading: "lazy",
|
|
470
|
+
decoding: "async"
|
|
471
|
+
}) : t.charAt(0)
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
// node_modules/.pnpm/uqr@0.1.3/node_modules/uqr/dist/index.mjs
|
|
475
|
+
var J = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "Data", e[e.Function = 1] = "Function", e[e.Position = 2] = "Position", e[e.Timing = 3] = "Timing", e[e.Alignment = 4] = "Alignment", e))(J || {}), Ge = [0, 1], Ke = [1, 0], qe = [2, 3], Je = [3, 2], Ye = {
|
|
476
|
+
L: Ge,
|
|
477
|
+
M: Ke,
|
|
478
|
+
Q: qe,
|
|
479
|
+
H: Je
|
|
480
|
+
}, Xe = /^\d*$/, Ze = /^[A-Z0-9 $%*+./:-]*$/, Qe = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", $e = 1, et = 40, tt = 3, nt = 3, Y = 40, rt = 10, it = [
|
|
481
|
+
[
|
|
482
|
+
-1,
|
|
483
|
+
7,
|
|
484
|
+
10,
|
|
485
|
+
15,
|
|
486
|
+
20,
|
|
487
|
+
26,
|
|
488
|
+
18,
|
|
489
|
+
20,
|
|
490
|
+
24,
|
|
491
|
+
30,
|
|
492
|
+
18,
|
|
493
|
+
20,
|
|
494
|
+
24,
|
|
495
|
+
26,
|
|
496
|
+
30,
|
|
497
|
+
22,
|
|
498
|
+
24,
|
|
499
|
+
28,
|
|
500
|
+
30,
|
|
501
|
+
28,
|
|
502
|
+
28,
|
|
503
|
+
28,
|
|
504
|
+
28,
|
|
505
|
+
30,
|
|
506
|
+
30,
|
|
507
|
+
26,
|
|
508
|
+
28,
|
|
509
|
+
30,
|
|
510
|
+
30,
|
|
511
|
+
30,
|
|
512
|
+
30,
|
|
513
|
+
30,
|
|
514
|
+
30,
|
|
515
|
+
30,
|
|
516
|
+
30,
|
|
517
|
+
30,
|
|
518
|
+
30,
|
|
519
|
+
30,
|
|
520
|
+
30,
|
|
521
|
+
30,
|
|
522
|
+
30
|
|
523
|
+
],
|
|
524
|
+
[
|
|
525
|
+
-1,
|
|
526
|
+
10,
|
|
527
|
+
16,
|
|
528
|
+
26,
|
|
529
|
+
18,
|
|
530
|
+
24,
|
|
531
|
+
16,
|
|
532
|
+
18,
|
|
533
|
+
22,
|
|
534
|
+
22,
|
|
535
|
+
26,
|
|
536
|
+
30,
|
|
537
|
+
22,
|
|
538
|
+
22,
|
|
539
|
+
24,
|
|
540
|
+
24,
|
|
541
|
+
28,
|
|
542
|
+
28,
|
|
543
|
+
26,
|
|
544
|
+
26,
|
|
545
|
+
26,
|
|
546
|
+
26,
|
|
547
|
+
28,
|
|
548
|
+
28,
|
|
549
|
+
28,
|
|
550
|
+
28,
|
|
551
|
+
28,
|
|
552
|
+
28,
|
|
553
|
+
28,
|
|
554
|
+
28,
|
|
555
|
+
28,
|
|
556
|
+
28,
|
|
557
|
+
28,
|
|
558
|
+
28,
|
|
559
|
+
28,
|
|
560
|
+
28,
|
|
561
|
+
28,
|
|
562
|
+
28,
|
|
563
|
+
28,
|
|
564
|
+
28,
|
|
565
|
+
28
|
|
566
|
+
],
|
|
567
|
+
[
|
|
568
|
+
-1,
|
|
569
|
+
13,
|
|
570
|
+
22,
|
|
571
|
+
18,
|
|
572
|
+
26,
|
|
573
|
+
18,
|
|
574
|
+
24,
|
|
575
|
+
18,
|
|
576
|
+
22,
|
|
577
|
+
20,
|
|
578
|
+
24,
|
|
579
|
+
28,
|
|
580
|
+
26,
|
|
581
|
+
24,
|
|
582
|
+
20,
|
|
583
|
+
30,
|
|
584
|
+
24,
|
|
585
|
+
28,
|
|
586
|
+
28,
|
|
587
|
+
26,
|
|
588
|
+
30,
|
|
589
|
+
28,
|
|
590
|
+
30,
|
|
591
|
+
30,
|
|
592
|
+
30,
|
|
593
|
+
30,
|
|
594
|
+
28,
|
|
595
|
+
30,
|
|
596
|
+
30,
|
|
597
|
+
30,
|
|
598
|
+
30,
|
|
599
|
+
30,
|
|
600
|
+
30,
|
|
601
|
+
30,
|
|
602
|
+
30,
|
|
603
|
+
30,
|
|
604
|
+
30,
|
|
605
|
+
30,
|
|
606
|
+
30,
|
|
607
|
+
30,
|
|
608
|
+
30
|
|
609
|
+
],
|
|
610
|
+
[
|
|
611
|
+
-1,
|
|
612
|
+
17,
|
|
613
|
+
28,
|
|
614
|
+
22,
|
|
615
|
+
16,
|
|
616
|
+
22,
|
|
617
|
+
28,
|
|
618
|
+
26,
|
|
619
|
+
26,
|
|
620
|
+
24,
|
|
621
|
+
28,
|
|
622
|
+
24,
|
|
623
|
+
28,
|
|
624
|
+
22,
|
|
625
|
+
24,
|
|
626
|
+
24,
|
|
627
|
+
30,
|
|
628
|
+
28,
|
|
629
|
+
28,
|
|
630
|
+
26,
|
|
631
|
+
28,
|
|
632
|
+
30,
|
|
633
|
+
24,
|
|
634
|
+
30,
|
|
635
|
+
30,
|
|
636
|
+
30,
|
|
637
|
+
30,
|
|
638
|
+
30,
|
|
639
|
+
30,
|
|
640
|
+
30,
|
|
641
|
+
30,
|
|
642
|
+
30,
|
|
643
|
+
30,
|
|
644
|
+
30,
|
|
645
|
+
30,
|
|
646
|
+
30,
|
|
647
|
+
30,
|
|
648
|
+
30,
|
|
649
|
+
30,
|
|
650
|
+
30,
|
|
651
|
+
30
|
|
652
|
+
]
|
|
653
|
+
], at = [
|
|
654
|
+
[
|
|
655
|
+
-1,
|
|
656
|
+
1,
|
|
657
|
+
1,
|
|
658
|
+
1,
|
|
659
|
+
1,
|
|
660
|
+
1,
|
|
661
|
+
2,
|
|
662
|
+
2,
|
|
663
|
+
2,
|
|
664
|
+
2,
|
|
665
|
+
4,
|
|
666
|
+
4,
|
|
667
|
+
4,
|
|
668
|
+
4,
|
|
669
|
+
4,
|
|
670
|
+
6,
|
|
671
|
+
6,
|
|
672
|
+
6,
|
|
673
|
+
6,
|
|
674
|
+
7,
|
|
675
|
+
8,
|
|
676
|
+
8,
|
|
677
|
+
9,
|
|
678
|
+
9,
|
|
679
|
+
10,
|
|
680
|
+
12,
|
|
681
|
+
12,
|
|
682
|
+
12,
|
|
683
|
+
13,
|
|
684
|
+
14,
|
|
685
|
+
15,
|
|
686
|
+
16,
|
|
687
|
+
17,
|
|
688
|
+
18,
|
|
689
|
+
19,
|
|
690
|
+
19,
|
|
691
|
+
20,
|
|
692
|
+
21,
|
|
693
|
+
22,
|
|
694
|
+
24,
|
|
695
|
+
25
|
|
696
|
+
],
|
|
697
|
+
[
|
|
698
|
+
-1,
|
|
699
|
+
1,
|
|
700
|
+
1,
|
|
701
|
+
1,
|
|
702
|
+
2,
|
|
703
|
+
2,
|
|
704
|
+
4,
|
|
705
|
+
4,
|
|
706
|
+
4,
|
|
707
|
+
5,
|
|
708
|
+
5,
|
|
709
|
+
5,
|
|
710
|
+
8,
|
|
711
|
+
9,
|
|
712
|
+
9,
|
|
713
|
+
10,
|
|
714
|
+
10,
|
|
715
|
+
11,
|
|
716
|
+
13,
|
|
717
|
+
14,
|
|
718
|
+
16,
|
|
719
|
+
17,
|
|
720
|
+
17,
|
|
721
|
+
18,
|
|
722
|
+
20,
|
|
723
|
+
21,
|
|
724
|
+
23,
|
|
725
|
+
25,
|
|
726
|
+
26,
|
|
727
|
+
28,
|
|
728
|
+
29,
|
|
729
|
+
31,
|
|
730
|
+
33,
|
|
731
|
+
35,
|
|
732
|
+
37,
|
|
733
|
+
38,
|
|
734
|
+
40,
|
|
735
|
+
43,
|
|
736
|
+
45,
|
|
737
|
+
47,
|
|
738
|
+
49
|
|
739
|
+
],
|
|
740
|
+
[
|
|
741
|
+
-1,
|
|
742
|
+
1,
|
|
743
|
+
1,
|
|
744
|
+
2,
|
|
745
|
+
2,
|
|
746
|
+
4,
|
|
747
|
+
4,
|
|
748
|
+
6,
|
|
749
|
+
6,
|
|
750
|
+
8,
|
|
751
|
+
8,
|
|
752
|
+
8,
|
|
753
|
+
10,
|
|
754
|
+
12,
|
|
755
|
+
16,
|
|
756
|
+
12,
|
|
757
|
+
17,
|
|
758
|
+
16,
|
|
759
|
+
18,
|
|
760
|
+
21,
|
|
761
|
+
20,
|
|
762
|
+
23,
|
|
763
|
+
23,
|
|
764
|
+
25,
|
|
765
|
+
27,
|
|
766
|
+
29,
|
|
767
|
+
34,
|
|
768
|
+
34,
|
|
769
|
+
35,
|
|
770
|
+
38,
|
|
771
|
+
40,
|
|
772
|
+
43,
|
|
773
|
+
45,
|
|
774
|
+
48,
|
|
775
|
+
51,
|
|
776
|
+
53,
|
|
777
|
+
56,
|
|
778
|
+
59,
|
|
779
|
+
62,
|
|
780
|
+
65,
|
|
781
|
+
68
|
|
782
|
+
],
|
|
783
|
+
[
|
|
784
|
+
-1,
|
|
785
|
+
1,
|
|
786
|
+
1,
|
|
787
|
+
2,
|
|
788
|
+
4,
|
|
789
|
+
4,
|
|
790
|
+
4,
|
|
791
|
+
5,
|
|
792
|
+
6,
|
|
793
|
+
8,
|
|
794
|
+
8,
|
|
795
|
+
11,
|
|
796
|
+
11,
|
|
797
|
+
16,
|
|
798
|
+
16,
|
|
799
|
+
18,
|
|
800
|
+
16,
|
|
801
|
+
19,
|
|
802
|
+
21,
|
|
803
|
+
25,
|
|
804
|
+
25,
|
|
805
|
+
25,
|
|
806
|
+
34,
|
|
807
|
+
30,
|
|
808
|
+
32,
|
|
809
|
+
35,
|
|
810
|
+
37,
|
|
811
|
+
40,
|
|
812
|
+
42,
|
|
813
|
+
45,
|
|
814
|
+
48,
|
|
815
|
+
51,
|
|
816
|
+
54,
|
|
817
|
+
57,
|
|
818
|
+
60,
|
|
819
|
+
63,
|
|
820
|
+
66,
|
|
821
|
+
70,
|
|
822
|
+
74,
|
|
823
|
+
77,
|
|
824
|
+
81
|
|
825
|
+
]
|
|
826
|
+
], ot = class {
|
|
827
|
+
constructor(e, t, n, r) {
|
|
828
|
+
if (this.version = e, this.ecc = t, e < $e || e > et) throw RangeError("Version value out of range");
|
|
829
|
+
if (r < -1 || r > 7) throw RangeError("Mask value out of range");
|
|
830
|
+
this.size = e * 4 + 17;
|
|
831
|
+
let i = Array.from({ length: this.size }).fill(!1);
|
|
832
|
+
for (let e = 0; e < this.size; e++) this.modules.push(i.slice()), this.types.push(i.map(() => 0));
|
|
833
|
+
this.drawFunctionPatterns();
|
|
834
|
+
let a = this.addEccAndInterleave(n);
|
|
835
|
+
if (this.drawCodewords(a), r === -1) {
|
|
836
|
+
let e = 1e9;
|
|
837
|
+
for (let t = 0; t < 8; t++) {
|
|
838
|
+
this.applyMask(t), this.drawFormatBits(t);
|
|
839
|
+
let n = this.getPenaltyScore();
|
|
840
|
+
n < e && (r = t, e = n), this.applyMask(t);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
this.mask = r, this.applyMask(r), this.drawFormatBits(r);
|
|
844
|
+
}
|
|
845
|
+
size;
|
|
846
|
+
mask;
|
|
847
|
+
modules = [];
|
|
848
|
+
types = [];
|
|
849
|
+
getModule(e, t) {
|
|
850
|
+
return e >= 0 && e < this.size && t >= 0 && t < this.size && this.modules[t][e];
|
|
851
|
+
}
|
|
852
|
+
drawFunctionPatterns() {
|
|
853
|
+
for (let e = 0; e < this.size; e++) this.setFunctionModule(6, e, e % 2 == 0, J.Timing), this.setFunctionModule(e, 6, e % 2 == 0, J.Timing);
|
|
854
|
+
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
855
|
+
let e = this.getAlignmentPatternPositions(), t = e.length;
|
|
856
|
+
for (let n = 0; n < t; n++) for (let r = 0; r < t; r++) n === 0 && r === 0 || n === 0 && r === t - 1 || n === t - 1 && r === 0 || this.drawAlignmentPattern(e[n], e[r]);
|
|
857
|
+
this.drawFormatBits(0), this.drawVersion();
|
|
858
|
+
}
|
|
859
|
+
drawFormatBits(e) {
|
|
860
|
+
let t = this.ecc[1] << 3 | e, n = t;
|
|
861
|
+
for (let e = 0; e < 10; e++) n = n << 1 ^ (n >>> 9) * 1335;
|
|
862
|
+
let r = (t << 10 | n) ^ 21522;
|
|
863
|
+
for (let e = 0; e <= 5; e++) this.setFunctionModule(8, e, Z(r, e));
|
|
864
|
+
this.setFunctionModule(8, 7, Z(r, 6)), this.setFunctionModule(8, 8, Z(r, 7)), this.setFunctionModule(7, 8, Z(r, 8));
|
|
865
|
+
for (let e = 9; e < 15; e++) this.setFunctionModule(14 - e, 8, Z(r, e));
|
|
866
|
+
for (let e = 0; e < 8; e++) this.setFunctionModule(this.size - 1 - e, 8, Z(r, e));
|
|
867
|
+
for (let e = 8; e < 15; e++) this.setFunctionModule(8, this.size - 15 + e, Z(r, e));
|
|
868
|
+
this.setFunctionModule(8, this.size - 8, !0);
|
|
869
|
+
}
|
|
870
|
+
drawVersion() {
|
|
871
|
+
if (this.version < 7) return;
|
|
872
|
+
let e = this.version;
|
|
873
|
+
for (let t = 0; t < 12; t++) e = e << 1 ^ (e >>> 11) * 7973;
|
|
874
|
+
let t = this.version << 12 | e;
|
|
875
|
+
for (let e = 0; e < 18; e++) {
|
|
876
|
+
let n = Z(t, e), r = this.size - 11 + e % 3, i = Math.floor(e / 3);
|
|
877
|
+
this.setFunctionModule(r, i, n), this.setFunctionModule(i, r, n);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
drawFinderPattern(e, t) {
|
|
881
|
+
for (let n = -4; n <= 4; n++) for (let r = -4; r <= 4; r++) {
|
|
882
|
+
let i = Math.max(Math.abs(r), Math.abs(n)), a = e + r, o = t + n;
|
|
883
|
+
a >= 0 && a < this.size && o >= 0 && o < this.size && this.setFunctionModule(a, o, i !== 2 && i !== 4, J.Position);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
drawAlignmentPattern(e, t) {
|
|
887
|
+
for (let n = -2; n <= 2; n++) for (let r = -2; r <= 2; r++) this.setFunctionModule(e + r, t + n, Math.max(Math.abs(r), Math.abs(n)) !== 1, J.Alignment);
|
|
888
|
+
}
|
|
889
|
+
setFunctionModule(e, t, n, r = J.Function) {
|
|
890
|
+
this.modules[t][e] = n, this.types[t][e] = r;
|
|
891
|
+
}
|
|
892
|
+
addEccAndInterleave(e) {
|
|
893
|
+
let t = this.version, n = this.ecc;
|
|
894
|
+
if (e.length !== Q(t, n)) throw RangeError("Invalid argument");
|
|
895
|
+
let r = at[n[0]][t], i = it[n[0]][t], a = Math.floor(bt(t) / 8), o = r - a % r, s = Math.floor(a / r), c = [], l = xt(i);
|
|
896
|
+
for (let t = 0, n = 0; t < r; t++) {
|
|
897
|
+
let r = e.slice(n, n + s - i + (t < o ? 0 : 1));
|
|
898
|
+
n += r.length;
|
|
899
|
+
let a = St(r, l);
|
|
900
|
+
t < o && r.push(0), c.push(r.concat(a));
|
|
901
|
+
}
|
|
902
|
+
let u = [];
|
|
903
|
+
for (let e = 0; e < c[0].length; e++) c.forEach((t, n) => {
|
|
904
|
+
(e !== s - i || n >= o) && u.push(t[e]);
|
|
905
|
+
});
|
|
906
|
+
return u;
|
|
907
|
+
}
|
|
908
|
+
drawCodewords(e) {
|
|
909
|
+
if (e.length !== Math.floor(bt(this.version) / 8)) throw RangeError("Invalid argument");
|
|
910
|
+
let t = 0;
|
|
911
|
+
for (let n = this.size - 1; n >= 1; n -= 2) {
|
|
912
|
+
n === 6 && (n = 5);
|
|
913
|
+
for (let r = 0; r < this.size; r++) for (let i = 0; i < 2; i++) {
|
|
914
|
+
let a = n - i, o = n + 1 & 2 ? r : this.size - 1 - r;
|
|
915
|
+
!this.types[o][a] && t < e.length * 8 && (this.modules[o][a] = Z(e[t >>> 3], 7 - (t & 7)), t++);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
applyMask(e) {
|
|
920
|
+
if (e < 0 || e > 7) throw RangeError("Mask value out of range");
|
|
921
|
+
for (let t = 0; t < this.size; t++) for (let n = 0; n < this.size; n++) {
|
|
922
|
+
let r;
|
|
923
|
+
switch (e) {
|
|
924
|
+
case 0:
|
|
925
|
+
r = (n + t) % 2 == 0;
|
|
926
|
+
break;
|
|
927
|
+
case 1:
|
|
928
|
+
r = t % 2 == 0;
|
|
929
|
+
break;
|
|
930
|
+
case 2:
|
|
931
|
+
r = n % 3 == 0;
|
|
932
|
+
break;
|
|
933
|
+
case 3:
|
|
934
|
+
r = (n + t) % 3 == 0;
|
|
935
|
+
break;
|
|
936
|
+
case 4:
|
|
937
|
+
r = (Math.floor(n / 3) + Math.floor(t / 2)) % 2 == 0;
|
|
938
|
+
break;
|
|
939
|
+
case 5:
|
|
940
|
+
r = n * t % 2 + n * t % 3 == 0;
|
|
941
|
+
break;
|
|
942
|
+
case 6:
|
|
943
|
+
r = (n * t % 2 + n * t % 3) % 2 == 0;
|
|
944
|
+
break;
|
|
945
|
+
case 7:
|
|
946
|
+
r = ((n + t) % 2 + n * t % 3) % 2 == 0;
|
|
947
|
+
break;
|
|
948
|
+
default: throw Error("Unreachable");
|
|
949
|
+
}
|
|
950
|
+
!this.types[t][n] && r && (this.modules[t][n] = !this.modules[t][n]);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
getPenaltyScore() {
|
|
954
|
+
let e = 0;
|
|
955
|
+
for (let t = 0; t < this.size; t++) {
|
|
956
|
+
let n = !1, r = 0, i = [
|
|
957
|
+
0,
|
|
958
|
+
0,
|
|
959
|
+
0,
|
|
960
|
+
0,
|
|
961
|
+
0,
|
|
962
|
+
0,
|
|
963
|
+
0
|
|
964
|
+
];
|
|
965
|
+
for (let a = 0; a < this.size; a++) this.modules[t][a] === n ? (r++, r === 5 ? e += tt : r > 5 && e++) : (this.finderPenaltyAddHistory(r, i), n || (e += this.finderPenaltyCountPatterns(i) * Y), n = this.modules[t][a], r = 1);
|
|
966
|
+
e += this.finderPenaltyTerminateAndCount(n, r, i) * Y;
|
|
967
|
+
}
|
|
968
|
+
for (let t = 0; t < this.size; t++) {
|
|
969
|
+
let n = !1, r = 0, i = [
|
|
970
|
+
0,
|
|
971
|
+
0,
|
|
972
|
+
0,
|
|
973
|
+
0,
|
|
974
|
+
0,
|
|
975
|
+
0,
|
|
976
|
+
0
|
|
977
|
+
];
|
|
978
|
+
for (let a = 0; a < this.size; a++) this.modules[a][t] === n ? (r++, r === 5 ? e += tt : r > 5 && e++) : (this.finderPenaltyAddHistory(r, i), n || (e += this.finderPenaltyCountPatterns(i) * Y), n = this.modules[a][t], r = 1);
|
|
979
|
+
e += this.finderPenaltyTerminateAndCount(n, r, i) * Y;
|
|
980
|
+
}
|
|
981
|
+
for (let t = 0; t < this.size - 1; t++) for (let n = 0; n < this.size - 1; n++) {
|
|
982
|
+
let r = this.modules[t][n];
|
|
983
|
+
r === this.modules[t][n + 1] && r === this.modules[t + 1][n] && r === this.modules[t + 1][n + 1] && (e += nt);
|
|
984
|
+
}
|
|
985
|
+
let t = 0;
|
|
986
|
+
for (let e of this.modules) t = e.reduce((e, t) => e + +!!t, t);
|
|
987
|
+
let n = this.size * this.size, r = Math.ceil(Math.abs(t * 20 - n * 10) / n) - 1;
|
|
988
|
+
return e += r * rt, e;
|
|
989
|
+
}
|
|
990
|
+
getAlignmentPatternPositions() {
|
|
991
|
+
if (this.version === 1) return [];
|
|
992
|
+
{
|
|
993
|
+
let e = Math.floor(this.version / 7) + 2, t = this.version === 32 ? 26 : Math.ceil((this.version * 4 + 4) / (e * 2 - 2)) * 2, n = [6];
|
|
994
|
+
for (let r = this.size - 7; n.length < e; r -= t) n.splice(1, 0, r);
|
|
995
|
+
return n;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
finderPenaltyCountPatterns(e) {
|
|
999
|
+
let t = e[1], n = t > 0 && e[2] === t && e[3] === t * 3 && e[4] === t && e[5] === t;
|
|
1000
|
+
return (n && e[0] >= t * 4 && e[6] >= t ? 1 : 0) + (n && e[6] >= t * 4 && e[0] >= t ? 1 : 0);
|
|
1001
|
+
}
|
|
1002
|
+
finderPenaltyTerminateAndCount(e, t, n) {
|
|
1003
|
+
return e && (this.finderPenaltyAddHistory(t, n), t = 0), t += this.size, this.finderPenaltyAddHistory(t, n), this.finderPenaltyCountPatterns(n);
|
|
1004
|
+
}
|
|
1005
|
+
finderPenaltyAddHistory(e, t) {
|
|
1006
|
+
t[0] === 0 && (e += this.size), t.pop(), t.unshift(e);
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
function X(e, t, n) {
|
|
1010
|
+
if (t < 0 || t > 31 || e >>> t) throw RangeError("Value out of range");
|
|
1011
|
+
for (let r = t - 1; r >= 0; r--) n.push(e >>> r & 1);
|
|
1012
|
+
}
|
|
1013
|
+
function Z(e, t) {
|
|
1014
|
+
return !!(e >>> t & 1);
|
|
1015
|
+
}
|
|
1016
|
+
var st = class {
|
|
1017
|
+
constructor(e, t, n) {
|
|
1018
|
+
if (this.mode = e, this.numChars = t, this.bitData = n, t < 0) throw RangeError("Invalid argument");
|
|
1019
|
+
this.bitData = n.slice();
|
|
1020
|
+
}
|
|
1021
|
+
getData() {
|
|
1022
|
+
return this.bitData.slice();
|
|
1023
|
+
}
|
|
1024
|
+
}, ct = [
|
|
1025
|
+
1,
|
|
1026
|
+
10,
|
|
1027
|
+
12,
|
|
1028
|
+
14
|
|
1029
|
+
], lt = [
|
|
1030
|
+
2,
|
|
1031
|
+
9,
|
|
1032
|
+
11,
|
|
1033
|
+
13
|
|
1034
|
+
], ut = [
|
|
1035
|
+
4,
|
|
1036
|
+
8,
|
|
1037
|
+
16,
|
|
1038
|
+
16
|
|
1039
|
+
];
|
|
1040
|
+
function dt(e, t) {
|
|
1041
|
+
return e[Math.floor((t + 7) / 17) + 1];
|
|
1042
|
+
}
|
|
1043
|
+
function ft(e) {
|
|
1044
|
+
let t = [];
|
|
1045
|
+
for (let n of e) X(n, 8, t);
|
|
1046
|
+
return new st(ut, e.length, t);
|
|
1047
|
+
}
|
|
1048
|
+
function pt(e) {
|
|
1049
|
+
if (!gt(e)) throw RangeError("String contains non-numeric characters");
|
|
1050
|
+
let t = [];
|
|
1051
|
+
for (let n = 0; n < e.length;) {
|
|
1052
|
+
let r = Math.min(e.length - n, 3);
|
|
1053
|
+
X(Number.parseInt(e.substring(n, n + r), 10), r * 3 + 1, t), n += r;
|
|
1054
|
+
}
|
|
1055
|
+
return new st(ct, e.length, t);
|
|
1056
|
+
}
|
|
1057
|
+
function mt(e) {
|
|
1058
|
+
if (!_t(e)) throw RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1059
|
+
let t = [], n = 0;
|
|
1060
|
+
for (; n + 2 <= e.length; n += 2) {
|
|
1061
|
+
let r = Qe.indexOf(e.charAt(n)) * 45;
|
|
1062
|
+
r += Qe.indexOf(e.charAt(n + 1)), X(r, 11, t);
|
|
1063
|
+
}
|
|
1064
|
+
return n < e.length && X(Qe.indexOf(e.charAt(n)), 6, t), new st(lt, e.length, t);
|
|
1065
|
+
}
|
|
1066
|
+
function ht(e) {
|
|
1067
|
+
return e === "" ? [] : gt(e) ? [pt(e)] : _t(e) ? [mt(e)] : [ft(yt(e))];
|
|
1068
|
+
}
|
|
1069
|
+
function gt(e) {
|
|
1070
|
+
return Xe.test(e);
|
|
1071
|
+
}
|
|
1072
|
+
function _t(e) {
|
|
1073
|
+
return Ze.test(e);
|
|
1074
|
+
}
|
|
1075
|
+
function vt(e, t) {
|
|
1076
|
+
let n = 0;
|
|
1077
|
+
for (let r of e) {
|
|
1078
|
+
let e = dt(r.mode, t);
|
|
1079
|
+
if (r.numChars >= 1 << e) return Infinity;
|
|
1080
|
+
n += 4 + e + r.bitData.length;
|
|
1081
|
+
}
|
|
1082
|
+
return n;
|
|
1083
|
+
}
|
|
1084
|
+
function yt(e) {
|
|
1085
|
+
e = encodeURI(e);
|
|
1086
|
+
let t = [];
|
|
1087
|
+
for (let n = 0; n < e.length; n++) e.charAt(n) === "%" ? (t.push(Number.parseInt(e.substring(n + 1, n + 3), 16)), n += 2) : t.push(e.charCodeAt(n));
|
|
1088
|
+
return t;
|
|
1089
|
+
}
|
|
1090
|
+
function bt(e) {
|
|
1091
|
+
if (e < $e || e > et) throw RangeError("Version number out of range");
|
|
1092
|
+
let t = (16 * e + 128) * e + 64;
|
|
1093
|
+
if (e >= 2) {
|
|
1094
|
+
let n = Math.floor(e / 7) + 2;
|
|
1095
|
+
t -= (25 * n - 10) * n - 55, e >= 7 && (t -= 36);
|
|
1096
|
+
}
|
|
1097
|
+
return t;
|
|
1098
|
+
}
|
|
1099
|
+
function Q(e, t) {
|
|
1100
|
+
return Math.floor(bt(e) / 8) - it[t[0]][e] * at[t[0]][e];
|
|
1101
|
+
}
|
|
1102
|
+
function xt(e) {
|
|
1103
|
+
if (e < 1 || e > 255) throw RangeError("Degree out of range");
|
|
1104
|
+
let t = [];
|
|
1105
|
+
for (let n = 0; n < e - 1; n++) t.push(0);
|
|
1106
|
+
t.push(1);
|
|
1107
|
+
let n = 1;
|
|
1108
|
+
for (let r = 0; r < e; r++) {
|
|
1109
|
+
for (let e = 0; e < t.length; e++) t[e] = Ct(t[e], n), e + 1 < t.length && (t[e] ^= t[e + 1]);
|
|
1110
|
+
n = Ct(n, 2);
|
|
1111
|
+
}
|
|
1112
|
+
return t;
|
|
1113
|
+
}
|
|
1114
|
+
function St(e, t) {
|
|
1115
|
+
let n = t.map((e) => 0);
|
|
1116
|
+
for (let r of e) {
|
|
1117
|
+
let e = r ^ n.shift();
|
|
1118
|
+
n.push(0), t.forEach((t, r) => n[r] ^= Ct(t, e));
|
|
1119
|
+
}
|
|
1120
|
+
return n;
|
|
1121
|
+
}
|
|
1122
|
+
function Ct(e, t) {
|
|
1123
|
+
if (e >>> 8 || t >>> 8) throw RangeError("Byte out of range");
|
|
1124
|
+
let n = 0;
|
|
1125
|
+
for (let r = 7; r >= 0; r--) n = n << 1 ^ (n >>> 7) * 285, n ^= (t >>> r & 1) * e;
|
|
1126
|
+
return n;
|
|
1127
|
+
}
|
|
1128
|
+
function wt(e, t, n = 1, r = 40, i = -1, a = !0) {
|
|
1129
|
+
if (!($e <= n && n <= r && r <= et) || i < -1 || i > 7) throw RangeError("Invalid value");
|
|
1130
|
+
let o, s;
|
|
1131
|
+
for (o = n;; o++) {
|
|
1132
|
+
let n = Q(o, t) * 8, i = vt(e, o);
|
|
1133
|
+
if (i <= n) {
|
|
1134
|
+
s = i;
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
if (o >= r) throw RangeError("Data too long");
|
|
1138
|
+
}
|
|
1139
|
+
for (let e of [
|
|
1140
|
+
Ke,
|
|
1141
|
+
qe,
|
|
1142
|
+
Je
|
|
1143
|
+
]) a && s <= Q(o, e) * 8 && (t = e);
|
|
1144
|
+
let c = [];
|
|
1145
|
+
for (let t of e) {
|
|
1146
|
+
X(t.mode[0], 4, c), X(t.numChars, dt(t.mode, o), c);
|
|
1147
|
+
for (let e of t.getData()) c.push(e);
|
|
1148
|
+
}
|
|
1149
|
+
let l = Q(o, t) * 8;
|
|
1150
|
+
X(0, Math.min(4, l - c.length), c), X(0, (8 - c.length % 8) % 8, c);
|
|
1151
|
+
for (let e = 236; c.length < l; e ^= 253) X(e, 8, c);
|
|
1152
|
+
let u = Array.from({ length: Math.ceil(c.length / 8) }, () => 0);
|
|
1153
|
+
return c.forEach((e, t) => u[t >>> 3] |= e << 7 - (t & 7)), new ot(o, t, u, i);
|
|
1154
|
+
}
|
|
1155
|
+
function Tt(e, t) {
|
|
1156
|
+
let { ecc: n = "L", boostEcc: r = !1, minVersion: i = 1, maxVersion: a = 40, maskPattern: o = -1, border: s = 1 } = t || {}, c = typeof e == "string" ? ht(e) : Array.isArray(e) ? [ft(e)] : void 0;
|
|
1157
|
+
if (!c) throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);
|
|
1158
|
+
let l = wt(c, Ye[n], i, a, o, r), u = Et({
|
|
1159
|
+
version: l.version,
|
|
1160
|
+
maskPattern: l.mask,
|
|
1161
|
+
size: l.size,
|
|
1162
|
+
data: l.modules,
|
|
1163
|
+
types: l.types
|
|
1164
|
+
}, s);
|
|
1165
|
+
return t?.invert && (u.data = u.data.map((e) => e.map((e) => !e))), t?.onEncoded?.(u), u;
|
|
1166
|
+
}
|
|
1167
|
+
function Et(e, t = 1) {
|
|
1168
|
+
if (!t) return e;
|
|
1169
|
+
let { size: n } = e, r = n + t * 2;
|
|
1170
|
+
e.size = r, e.data.forEach((e) => {
|
|
1171
|
+
for (let n = 0; n < t; n++) e.unshift(!1), e.push(!1);
|
|
1172
|
+
});
|
|
1173
|
+
for (let n = 0; n < t; n++) e.data.unshift(Array.from({ length: r }, (e) => !1)), e.data.push(Array.from({ length: r }, (e) => !1));
|
|
1174
|
+
let i = J.Border;
|
|
1175
|
+
e.types.forEach((e) => {
|
|
1176
|
+
for (let n = 0; n < t; n++) e.unshift(i), e.push(i);
|
|
1177
|
+
});
|
|
1178
|
+
for (let n = 0; n < t; n++) e.types.unshift(Array.from({ length: r }, (e) => i)), e.types.push(Array.from({ length: r }, (e) => i));
|
|
1179
|
+
return e;
|
|
1180
|
+
}
|
|
1181
|
+
function Dt(e) {
|
|
1182
|
+
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
1183
|
+
}
|
|
1184
|
+
function Ot(e, t = {}) {
|
|
1185
|
+
let n = Tt(e, t), { pixelSize: r = 10, whiteColor: i = "white", blackColor: a = "black" } = t, o = n.size * r, s = n.size * r, c = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${o}">`, l = [];
|
|
1186
|
+
for (let e = 0; e < n.size; e++) for (let t = 0; t < n.size; t++) {
|
|
1187
|
+
let i = t * r, a = e * r;
|
|
1188
|
+
n.data[e][t] && l.push(`M${i},${a}h${r}v${r}h-${r}z`);
|
|
1189
|
+
}
|
|
1190
|
+
return c += `<rect fill="${Dt(i)}" width="${s}" height="${o}"/>`, c += `<path fill="${Dt(a)}" d="${l.join("")}"/>`, c += "</svg>", c;
|
|
1191
|
+
}
|
|
1192
|
+
// src/element/ui/qr.ts
|
|
1193
|
+
function kt(e) {
|
|
1194
|
+
if (e) try {
|
|
1195
|
+
return Ot(e, {
|
|
1196
|
+
border: 2,
|
|
1197
|
+
ecc: "H"
|
|
1198
|
+
});
|
|
1199
|
+
} catch {
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
// src/element/ui/wallet-connect-panel.tsx
|
|
1204
|
+
function At({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: o, error: c, onRemote: l, onConnect: u }) {
|
|
1205
|
+
let [d, f] = H(!1), p = We(), [m, h] = H(""), [g, _] = H(0);
|
|
1206
|
+
U(() => {
|
|
1207
|
+
if (!l) return;
|
|
1208
|
+
let e = !0;
|
|
1209
|
+
return h(""), l((t) => {
|
|
1210
|
+
e && h(t);
|
|
1211
|
+
}), () => {
|
|
1212
|
+
e = !1;
|
|
1213
|
+
};
|
|
1214
|
+
}, [e, g]);
|
|
1215
|
+
let v = window.location.href, y = a(e, v), [b, x] = H(y || l ? "wallet" : "camera"), S = p ? "" : kt(b === "wallet" && y ? y : v), C = p || !m ? "" : kt(m), w = m ? s(e, m) : void 0;
|
|
1216
|
+
async function T() {
|
|
1217
|
+
try {
|
|
1218
|
+
await navigator.clipboard.writeText(m), f(!0), window.setTimeout(() => f(!1), 1600);
|
|
1219
|
+
} catch {
|
|
1220
|
+
window.prompt("Copy this connection code", m);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
async function E() {
|
|
1224
|
+
try {
|
|
1225
|
+
await navigator.clipboard.writeText(v), f(!0), window.setTimeout(() => f(!1), 1600);
|
|
1226
|
+
} catch {
|
|
1227
|
+
window.prompt("Copy this payment link", v);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return r ? /* @__PURE__ */ K("div", {
|
|
1231
|
+
class: "connect-panel connect-status",
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ K("span", {
|
|
1234
|
+
class: "connect-status-mark",
|
|
1235
|
+
children: [/* @__PURE__ */ K(q, {
|
|
1236
|
+
id: e,
|
|
1237
|
+
name: t,
|
|
1238
|
+
icon: n,
|
|
1239
|
+
size: "lg"
|
|
1240
|
+
}), o ? /* @__PURE__ */ K("svg", {
|
|
1241
|
+
class: "connect-spinner",
|
|
1242
|
+
viewBox: "0 0 100 100",
|
|
1243
|
+
"aria-hidden": "true",
|
|
1244
|
+
children: /* @__PURE__ */ K("circle", {
|
|
1245
|
+
cx: "50",
|
|
1246
|
+
cy: "50",
|
|
1247
|
+
r: "46",
|
|
1248
|
+
fill: "none",
|
|
1249
|
+
stroke: "currentColor",
|
|
1250
|
+
"stroke-width": "4",
|
|
1251
|
+
"stroke-linecap": "round",
|
|
1252
|
+
"stroke-dasharray": "72 217"
|
|
1253
|
+
})
|
|
1254
|
+
}) : null]
|
|
1255
|
+
}),
|
|
1256
|
+
/* @__PURE__ */ K("p", {
|
|
1257
|
+
class: `connect-status-title${c ? " is-error" : ""}`,
|
|
1258
|
+
children: c ? "Connection declined" : `Continue in ${t}`
|
|
1259
|
+
}),
|
|
1260
|
+
/* @__PURE__ */ K("p", {
|
|
1261
|
+
class: "connect-status-note",
|
|
1262
|
+
children: c || `Accept the connection request in ${t}.`
|
|
1263
|
+
}),
|
|
1264
|
+
/* @__PURE__ */ K("button", {
|
|
1265
|
+
type: "button",
|
|
1266
|
+
class: "secondary connect-retry",
|
|
1267
|
+
onClick: () => u(r),
|
|
1268
|
+
children: [/* @__PURE__ */ K("svg", {
|
|
1269
|
+
class: "connect-retry-icon",
|
|
1270
|
+
viewBox: "0 0 24 24",
|
|
1271
|
+
fill: "none",
|
|
1272
|
+
stroke: "currentColor",
|
|
1273
|
+
"stroke-width": "2",
|
|
1274
|
+
"stroke-linecap": "round",
|
|
1275
|
+
"stroke-linejoin": "round",
|
|
1276
|
+
"aria-hidden": "true",
|
|
1277
|
+
children: [/* @__PURE__ */ K("path", { d: "M21 12a9 9 0 1 1-2.64-6.36" }), /* @__PURE__ */ K("path", { d: "M21 3v6h-6" })]
|
|
1278
|
+
}), "Try again"]
|
|
1279
|
+
})
|
|
1280
|
+
]
|
|
1281
|
+
}) : l ? /* @__PURE__ */ K("div", {
|
|
1282
|
+
class: `connect-panel${p ? " connect-handoff" : ""}`,
|
|
1283
|
+
children: [p ? /* @__PURE__ */ K(M, { children: [c ? /* @__PURE__ */ K("button", {
|
|
1284
|
+
type: "button",
|
|
1285
|
+
class: "secondary connect-retry",
|
|
1286
|
+
onClick: () => _((e) => e + 1),
|
|
1287
|
+
children: "Try again"
|
|
1288
|
+
}) : w ? /* @__PURE__ */ K("a", {
|
|
1289
|
+
class: "primary connect-open",
|
|
1290
|
+
href: w,
|
|
1291
|
+
children: ["Open in ", t]
|
|
1292
|
+
}) : m ? /* @__PURE__ */ K("button", {
|
|
1293
|
+
type: "button",
|
|
1294
|
+
class: "secondary connect-copy",
|
|
1295
|
+
onClick: T,
|
|
1296
|
+
children: d ? "Copied" : "Copy connection code"
|
|
1297
|
+
}) : null, /* @__PURE__ */ K("p", {
|
|
1298
|
+
class: "qr-caption",
|
|
1299
|
+
children: c || (m ? w ? `Approve the connection in ${t}, then come back here.` : `Copy this code and paste it into ${t} to connect.` : "Preparing a connection…")
|
|
1300
|
+
})] }) : /* @__PURE__ */ K(M, { children: [
|
|
1301
|
+
/* @__PURE__ */ K("div", {
|
|
1302
|
+
class: "portal-tabs qr-tabs",
|
|
1303
|
+
role: "tablist",
|
|
1304
|
+
children: [/* @__PURE__ */ K("button", {
|
|
1305
|
+
type: "button",
|
|
1306
|
+
role: "tab",
|
|
1307
|
+
"aria-selected": b === "wallet",
|
|
1308
|
+
class: `portal-tab${b === "wallet" ? " is-active" : ""}`,
|
|
1309
|
+
onClick: () => x("wallet"),
|
|
1310
|
+
children: "Wallet app"
|
|
1311
|
+
}), /* @__PURE__ */ K("button", {
|
|
1312
|
+
type: "button",
|
|
1313
|
+
role: "tab",
|
|
1314
|
+
"aria-selected": b === "camera",
|
|
1315
|
+
class: `portal-tab${b === "camera" ? " is-active" : ""}`,
|
|
1316
|
+
onClick: () => x("camera"),
|
|
1317
|
+
children: "Phone camera"
|
|
1318
|
+
})]
|
|
1319
|
+
}),
|
|
1320
|
+
/* @__PURE__ */ K("div", {
|
|
1321
|
+
class: "qr-frame",
|
|
1322
|
+
children: [b === "camera" ? S ? /* @__PURE__ */ K("div", {
|
|
1323
|
+
class: "qr",
|
|
1324
|
+
dangerouslySetInnerHTML: { __html: S }
|
|
1325
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1326
|
+
class: "qr qr-fallback",
|
|
1327
|
+
children: /* @__PURE__ */ K("code", { children: v })
|
|
1328
|
+
}) : C ? /* @__PURE__ */ K("div", {
|
|
1329
|
+
class: "qr",
|
|
1330
|
+
dangerouslySetInnerHTML: { __html: C }
|
|
1331
|
+
}) : c ? /* @__PURE__ */ K("div", {
|
|
1332
|
+
class: "qr qr-fallback",
|
|
1333
|
+
children: /* @__PURE__ */ K("code", { children: "Connection failed" })
|
|
1334
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1335
|
+
class: "qr",
|
|
1336
|
+
children: /* @__PURE__ */ K("svg", {
|
|
1337
|
+
class: "qr-spinner",
|
|
1338
|
+
viewBox: "0 0 100 100",
|
|
1339
|
+
"aria-hidden": "true",
|
|
1340
|
+
children: /* @__PURE__ */ K("circle", {
|
|
1341
|
+
cx: "50",
|
|
1342
|
+
cy: "50",
|
|
1343
|
+
r: "46",
|
|
1344
|
+
fill: "none",
|
|
1345
|
+
stroke: "currentColor",
|
|
1346
|
+
"stroke-width": "4",
|
|
1347
|
+
"stroke-linecap": "round",
|
|
1348
|
+
"stroke-dasharray": "72 217"
|
|
1349
|
+
})
|
|
1350
|
+
})
|
|
1351
|
+
}), b === "wallet" && (C || c) ? /* @__PURE__ */ K("span", {
|
|
1352
|
+
class: "qr-badge",
|
|
1353
|
+
children: /* @__PURE__ */ K(q, {
|
|
1354
|
+
id: e,
|
|
1355
|
+
name: t,
|
|
1356
|
+
icon: n,
|
|
1357
|
+
size: "lg"
|
|
1358
|
+
})
|
|
1359
|
+
}) : null]
|
|
1360
|
+
}),
|
|
1361
|
+
/* @__PURE__ */ K("p", {
|
|
1362
|
+
class: "qr-caption",
|
|
1363
|
+
children: b === "camera" ? "Scan with your phone’s camera to open this checkout on your phone" : c || (m ? `Scan this from inside ${t} to connect` : "Preparing a connection…")
|
|
1364
|
+
}),
|
|
1365
|
+
b === "camera" ? /* @__PURE__ */ K("button", {
|
|
1366
|
+
type: "button",
|
|
1367
|
+
class: "link-button qr-copy",
|
|
1368
|
+
onClick: E,
|
|
1369
|
+
children: d ? "Copied" : "Copy link"
|
|
1370
|
+
}) : c ? /* @__PURE__ */ K("button", {
|
|
1371
|
+
type: "button",
|
|
1372
|
+
class: "link-button qr-copy",
|
|
1373
|
+
onClick: () => _((e) => e + 1),
|
|
1374
|
+
children: "Try again"
|
|
1375
|
+
}) : m ? /* @__PURE__ */ K("button", {
|
|
1376
|
+
type: "button",
|
|
1377
|
+
class: "link-button qr-copy",
|
|
1378
|
+
onClick: T,
|
|
1379
|
+
children: d ? "Copied" : "Copy to clipboard"
|
|
1380
|
+
}) : null
|
|
1381
|
+
] }), /* @__PURE__ */ K("div", {
|
|
1382
|
+
class: "install-row",
|
|
1383
|
+
children: [/* @__PURE__ */ K("span", { children: [
|
|
1384
|
+
"Don’t have ",
|
|
1385
|
+
t,
|
|
1386
|
+
"?"
|
|
1387
|
+
] }), i ? /* @__PURE__ */ K("a", {
|
|
1388
|
+
class: "secondary",
|
|
1389
|
+
href: i,
|
|
1390
|
+
target: "_blank",
|
|
1391
|
+
rel: "noreferrer noopener",
|
|
1392
|
+
children: "Get"
|
|
1393
|
+
}) : null]
|
|
1394
|
+
})]
|
|
1395
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1396
|
+
class: `connect-panel${p ? " connect-handoff" : ""}`,
|
|
1397
|
+
children: [p ? /* @__PURE__ */ K(M, { children: [y ? /* @__PURE__ */ K("a", {
|
|
1398
|
+
class: "primary connect-open",
|
|
1399
|
+
href: y,
|
|
1400
|
+
children: ["Open in ", t]
|
|
1401
|
+
}) : null, /* @__PURE__ */ K("p", {
|
|
1402
|
+
class: "qr-caption",
|
|
1403
|
+
children: y ? `${t} opens with this checkout loaded.` : `Open ${t} and browse to this page to pay.`
|
|
1404
|
+
})] }) : /* @__PURE__ */ K(M, { children: [
|
|
1405
|
+
y ? /* @__PURE__ */ K("div", {
|
|
1406
|
+
class: "portal-tabs qr-tabs",
|
|
1407
|
+
role: "tablist",
|
|
1408
|
+
children: [/* @__PURE__ */ K("button", {
|
|
1409
|
+
type: "button",
|
|
1410
|
+
role: "tab",
|
|
1411
|
+
"aria-selected": b === "wallet",
|
|
1412
|
+
class: `portal-tab${b === "wallet" ? " is-active" : ""}`,
|
|
1413
|
+
onClick: () => x("wallet"),
|
|
1414
|
+
children: "Wallet app"
|
|
1415
|
+
}), /* @__PURE__ */ K("button", {
|
|
1416
|
+
type: "button",
|
|
1417
|
+
role: "tab",
|
|
1418
|
+
"aria-selected": b === "camera",
|
|
1419
|
+
class: `portal-tab${b === "camera" ? " is-active" : ""}`,
|
|
1420
|
+
onClick: () => x("camera"),
|
|
1421
|
+
children: "Phone camera"
|
|
1422
|
+
})]
|
|
1423
|
+
}) : null,
|
|
1424
|
+
/* @__PURE__ */ K("div", {
|
|
1425
|
+
class: "qr-frame",
|
|
1426
|
+
children: [S ? /* @__PURE__ */ K("div", {
|
|
1427
|
+
class: "qr",
|
|
1428
|
+
dangerouslySetInnerHTML: { __html: S }
|
|
1429
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1430
|
+
class: "qr qr-fallback",
|
|
1431
|
+
children: /* @__PURE__ */ K("code", { children: v })
|
|
1432
|
+
}), b === "wallet" && y ? /* @__PURE__ */ K("span", {
|
|
1433
|
+
class: "qr-badge",
|
|
1434
|
+
children: /* @__PURE__ */ K(q, {
|
|
1435
|
+
id: e,
|
|
1436
|
+
name: t,
|
|
1437
|
+
icon: n,
|
|
1438
|
+
size: "lg"
|
|
1439
|
+
})
|
|
1440
|
+
}) : null]
|
|
1441
|
+
}),
|
|
1442
|
+
/* @__PURE__ */ K("p", {
|
|
1443
|
+
class: "qr-caption",
|
|
1444
|
+
children: S ? b === "wallet" ? `Scan from inside the ${t} app to pay there` : "Scan with your phone’s camera to open this checkout on your phone" : "Open this link on your phone to pay from a mobile wallet"
|
|
1445
|
+
}),
|
|
1446
|
+
b === "camera" ? /* @__PURE__ */ K("button", {
|
|
1447
|
+
type: "button",
|
|
1448
|
+
class: "link-button qr-copy",
|
|
1449
|
+
onClick: E,
|
|
1450
|
+
children: d ? "Copied" : "Copy link"
|
|
1451
|
+
}) : null
|
|
1452
|
+
] }), /* @__PURE__ */ K("div", {
|
|
1453
|
+
class: "install-row",
|
|
1454
|
+
children: [/* @__PURE__ */ K("span", { children: [
|
|
1455
|
+
"Don’t have ",
|
|
1456
|
+
t,
|
|
1457
|
+
"?"
|
|
1458
|
+
] }), i ? /* @__PURE__ */ K("a", {
|
|
1459
|
+
class: "secondary",
|
|
1460
|
+
href: i,
|
|
1461
|
+
target: "_blank",
|
|
1462
|
+
rel: "noreferrer noopener",
|
|
1463
|
+
children: "Get"
|
|
1464
|
+
}) : null]
|
|
1465
|
+
})]
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
// src/element/ui/wallet-dialog.tsx
|
|
1469
|
+
var jt = 5;
|
|
1470
|
+
function Mt({ open: e, wallets: t, registry: n = [], connecting: r, connected: i, error: a, initialWalletId: o, remotePairing: s, onSelect: c, onClose: l }) {
|
|
1471
|
+
let u = je(null), [d, f] = H(""), [p, m] = H(), [h, g] = H(!1);
|
|
1472
|
+
U(() => {
|
|
1473
|
+
let t = u.current;
|
|
1474
|
+
t && (e && !t.open ? (t.showModal(), f(""), m(o ? _.find((e) => e.id === o) : void 0), g(!1)) : !e && t.open && t.close());
|
|
1475
|
+
}, [e, o]), U(() => {
|
|
1476
|
+
if (!e) return;
|
|
1477
|
+
let t = document.documentElement, n = {
|
|
1478
|
+
overflow: t.style.overflow,
|
|
1479
|
+
padding: t.style.paddingRight
|
|
1480
|
+
}, r = window.innerWidth - t.clientWidth;
|
|
1481
|
+
return t.style.overflow = "hidden", r > 0 && (t.style.paddingRight = `${r}px`), () => {
|
|
1482
|
+
t.style.overflow = n.overflow, t.style.paddingRight = n.padding;
|
|
1483
|
+
};
|
|
1484
|
+
}, [e]), U(() => {
|
|
1485
|
+
let e = u.current;
|
|
1486
|
+
if (!e) return;
|
|
1487
|
+
let t = () => l();
|
|
1488
|
+
return e.addEventListener("close", t), () => e.removeEventListener("close", t);
|
|
1489
|
+
}, [l]);
|
|
1490
|
+
let _ = W(() => {
|
|
1491
|
+
let e = new Map(t.map((e) => [e.id, e])), r = n.map((t) => {
|
|
1492
|
+
let n = e.get(t.id);
|
|
1493
|
+
return {
|
|
1494
|
+
id: t.id,
|
|
1495
|
+
name: t.name,
|
|
1496
|
+
icon: n?.icon,
|
|
1497
|
+
detected: n,
|
|
1498
|
+
installUrl: t.installUrl
|
|
1499
|
+
};
|
|
1500
|
+
});
|
|
1501
|
+
for (let e of t) r.some((t) => t.id === e.id) || r.push({
|
|
1502
|
+
id: e.id,
|
|
1503
|
+
name: e.name,
|
|
1504
|
+
icon: e.icon,
|
|
1505
|
+
detected: e
|
|
1506
|
+
});
|
|
1507
|
+
return r.sort((e, t) => Number(!!t.detected) - Number(!!e.detected));
|
|
1508
|
+
}, [t, n]), v = We();
|
|
1509
|
+
U(() => {
|
|
1510
|
+
i && l();
|
|
1511
|
+
}, [i, l]);
|
|
1512
|
+
let y = W(() => {
|
|
1513
|
+
let e = d.trim().toLowerCase();
|
|
1514
|
+
return e ? _.filter((t) => t.name.toLowerCase().includes(e)) : _;
|
|
1515
|
+
}, [_, d]), b = W(() => h ? y : _.slice(0, jt), [
|
|
1516
|
+
h,
|
|
1517
|
+
y,
|
|
1518
|
+
_
|
|
1519
|
+
]);
|
|
1520
|
+
return /* @__PURE__ */ K("dialog", {
|
|
1521
|
+
ref: u,
|
|
1522
|
+
class: "wallet-dialog",
|
|
1523
|
+
"aria-label": "All wallets",
|
|
1524
|
+
onClick: (e) => {
|
|
1525
|
+
e.target === u.current && l();
|
|
1526
|
+
},
|
|
1527
|
+
children: /* @__PURE__ */ K("div", {
|
|
1528
|
+
class: "wallet-dialog-body",
|
|
1529
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1530
|
+
class: "wallet-dialog-head",
|
|
1531
|
+
children: [
|
|
1532
|
+
p || h ? /* @__PURE__ */ K("button", {
|
|
1533
|
+
type: "button",
|
|
1534
|
+
class: "icon-button",
|
|
1535
|
+
"aria-label": "Back",
|
|
1536
|
+
onClick: () => {
|
|
1537
|
+
p ? m(void 0) : (g(!1), f(""));
|
|
1538
|
+
},
|
|
1539
|
+
children: "‹"
|
|
1540
|
+
}) : /* @__PURE__ */ K("span", { class: "icon-button-spacer" }),
|
|
1541
|
+
/* @__PURE__ */ K("h2", { children: p ? p.name : h ? "All wallets" : "Connect wallet" }),
|
|
1542
|
+
/* @__PURE__ */ K("button", {
|
|
1543
|
+
type: "button",
|
|
1544
|
+
class: "icon-button",
|
|
1545
|
+
"aria-label": "Close",
|
|
1546
|
+
onClick: l,
|
|
1547
|
+
children: "×"
|
|
1548
|
+
})
|
|
1549
|
+
]
|
|
1550
|
+
}), p ? /* @__PURE__ */ K(At, {
|
|
1551
|
+
id: p.id,
|
|
1552
|
+
name: p.name,
|
|
1553
|
+
icon: p.icon,
|
|
1554
|
+
detected: p.detected,
|
|
1555
|
+
installUrl: p.installUrl,
|
|
1556
|
+
connecting: r,
|
|
1557
|
+
error: a,
|
|
1558
|
+
onRemote: p.detected ? void 0 : s?.(p.id),
|
|
1559
|
+
onConnect: c
|
|
1560
|
+
}) : /* @__PURE__ */ K(M, { children: [
|
|
1561
|
+
h ? /* @__PURE__ */ K("input", {
|
|
1562
|
+
type: "search",
|
|
1563
|
+
class: "wallet-search",
|
|
1564
|
+
placeholder: "Search wallet",
|
|
1565
|
+
"aria-label": "Search wallet",
|
|
1566
|
+
value: d,
|
|
1567
|
+
onInput: (e) => f(e.target.value)
|
|
1568
|
+
}) : null,
|
|
1569
|
+
h ? /* @__PURE__ */ K("div", {
|
|
1570
|
+
class: "wallet-grid",
|
|
1571
|
+
children: b.map((e) => /* @__PURE__ */ K("button", {
|
|
1572
|
+
type: "button",
|
|
1573
|
+
class: "wallet-tile",
|
|
1574
|
+
"aria-label": e.detected ? `${e.name}, installed` : e.name,
|
|
1575
|
+
onClick: () => {
|
|
1576
|
+
m(e), e.detected && c(e.detected);
|
|
1577
|
+
},
|
|
1578
|
+
children: [
|
|
1579
|
+
/* @__PURE__ */ K(q, {
|
|
1580
|
+
id: e.id,
|
|
1581
|
+
name: e.name,
|
|
1582
|
+
icon: e.icon,
|
|
1583
|
+
size: "lg"
|
|
1584
|
+
}),
|
|
1585
|
+
/* @__PURE__ */ K("span", {
|
|
1586
|
+
class: "wallet-tile-name",
|
|
1587
|
+
children: e.name
|
|
1588
|
+
}),
|
|
1589
|
+
e.detected ? /* @__PURE__ */ K("span", {
|
|
1590
|
+
class: "wallet-tile-badge",
|
|
1591
|
+
"aria-hidden": "true",
|
|
1592
|
+
children: /* @__PURE__ */ K("svg", {
|
|
1593
|
+
viewBox: "0 0 24 24",
|
|
1594
|
+
fill: "none",
|
|
1595
|
+
stroke: "currentColor",
|
|
1596
|
+
"stroke-width": "3",
|
|
1597
|
+
"stroke-linecap": "round",
|
|
1598
|
+
"stroke-linejoin": "round",
|
|
1599
|
+
children: /* @__PURE__ */ K("path", { d: "m5 13 4 4L19 7" })
|
|
1600
|
+
})
|
|
1601
|
+
}) : null
|
|
1602
|
+
]
|
|
1603
|
+
}, e.id))
|
|
1604
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1605
|
+
class: "wallet-list",
|
|
1606
|
+
children: b.map((e) => /* @__PURE__ */ K("button", {
|
|
1607
|
+
type: "button",
|
|
1608
|
+
class: "wallet-row",
|
|
1609
|
+
onClick: () => {
|
|
1610
|
+
m(e), e.detected && c(e.detected);
|
|
1611
|
+
},
|
|
1612
|
+
children: [
|
|
1613
|
+
/* @__PURE__ */ K(q, {
|
|
1614
|
+
id: e.id,
|
|
1615
|
+
name: e.name,
|
|
1616
|
+
icon: e.icon,
|
|
1617
|
+
size: "lg"
|
|
1618
|
+
}),
|
|
1619
|
+
/* @__PURE__ */ K("span", {
|
|
1620
|
+
class: "wallet-row-name",
|
|
1621
|
+
children: e.name
|
|
1622
|
+
}),
|
|
1623
|
+
e.detected ? /* @__PURE__ */ K("span", {
|
|
1624
|
+
class: "wallet-row-tag is-installed",
|
|
1625
|
+
children: "Installed"
|
|
1626
|
+
}) : v ? /* @__PURE__ */ K("span", {
|
|
1627
|
+
class: "wallet-row-tag is-muted",
|
|
1628
|
+
children: "Get"
|
|
1629
|
+
}) : null,
|
|
1630
|
+
/* @__PURE__ */ K("span", {
|
|
1631
|
+
class: "wallet-row-chevron",
|
|
1632
|
+
"aria-hidden": "true",
|
|
1633
|
+
children: "›"
|
|
1634
|
+
})
|
|
1635
|
+
]
|
|
1636
|
+
}, e.id))
|
|
1637
|
+
}),
|
|
1638
|
+
!h && _.length > jt ? /* @__PURE__ */ K("button", {
|
|
1639
|
+
type: "button",
|
|
1640
|
+
class: "wallet-row wallet-search-row",
|
|
1641
|
+
onClick: () => g(!0),
|
|
1642
|
+
children: [
|
|
1643
|
+
/* @__PURE__ */ K("span", {
|
|
1644
|
+
class: "wallet-search-icon",
|
|
1645
|
+
"aria-hidden": "true",
|
|
1646
|
+
children: /* @__PURE__ */ K("svg", {
|
|
1647
|
+
viewBox: "0 0 24 24",
|
|
1648
|
+
fill: "none",
|
|
1649
|
+
stroke: "currentColor",
|
|
1650
|
+
"stroke-width": "2",
|
|
1651
|
+
"stroke-linecap": "round",
|
|
1652
|
+
children: [/* @__PURE__ */ K("circle", {
|
|
1653
|
+
cx: "11",
|
|
1654
|
+
cy: "11",
|
|
1655
|
+
r: "7"
|
|
1656
|
+
}), /* @__PURE__ */ K("path", { d: "m20 20-3.5-3.5" })]
|
|
1657
|
+
})
|
|
1658
|
+
}),
|
|
1659
|
+
/* @__PURE__ */ K("span", {
|
|
1660
|
+
class: "wallet-row-name",
|
|
1661
|
+
children: "Search wallet"
|
|
1662
|
+
}),
|
|
1663
|
+
/* @__PURE__ */ K("span", {
|
|
1664
|
+
class: "wallet-row-count",
|
|
1665
|
+
children: _.length
|
|
1666
|
+
}),
|
|
1667
|
+
/* @__PURE__ */ K("span", {
|
|
1668
|
+
class: "wallet-row-chevron",
|
|
1669
|
+
"aria-hidden": "true",
|
|
1670
|
+
children: "›"
|
|
1671
|
+
})
|
|
1672
|
+
]
|
|
1673
|
+
}) : null,
|
|
1674
|
+
h && b.length === 0 ? /* @__PURE__ */ K("p", {
|
|
1675
|
+
class: "muted wallet-empty",
|
|
1676
|
+
children: [
|
|
1677
|
+
"No wallet matches “",
|
|
1678
|
+
d,
|
|
1679
|
+
"”."
|
|
1680
|
+
]
|
|
1681
|
+
}) : null
|
|
1682
|
+
] })]
|
|
1683
|
+
})
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
// src/element/ui/wallet-list.tsx
|
|
1687
|
+
var Nt = 3, Pt = ["metamask", "coinbase"], Ft = 2;
|
|
1688
|
+
function It({ wallets: e, registry: t = [], connecting: n, connected: r, error: i, remotePairing: a, onSelect: o }) {
|
|
1689
|
+
let s = Ue(), [c, l] = H(!1), [u, d] = H(), f = e.slice(0, Nt), p = e.length > f.length || t.length > f.length, m = e.length === 0 ? [...Pt.map((e) => t.find((t) => t.id === e)), ...t].filter((e) => e !== void 0).filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t).slice(0, Ft) : [], h = new Set(f.map((e) => e.id)), g = t.filter((e) => !h.has(e.id)).map((e) => ({
|
|
1690
|
+
id: e.id,
|
|
1691
|
+
src: s(e.id)
|
|
1692
|
+
})).filter((e) => e.src).slice(0, 3);
|
|
1693
|
+
return /* @__PURE__ */ K("div", {
|
|
1694
|
+
class: "wallets",
|
|
1695
|
+
children: [
|
|
1696
|
+
f.map((e) => /* @__PURE__ */ K("button", {
|
|
1697
|
+
type: "button",
|
|
1698
|
+
class: "wallet",
|
|
1699
|
+
onClick: () => o(e),
|
|
1700
|
+
children: [
|
|
1701
|
+
/* @__PURE__ */ K(q, {
|
|
1702
|
+
id: e.id,
|
|
1703
|
+
name: e.name,
|
|
1704
|
+
icon: e.icon
|
|
1705
|
+
}),
|
|
1706
|
+
/* @__PURE__ */ K("span", {
|
|
1707
|
+
class: "wallet-name",
|
|
1708
|
+
children: e.name
|
|
1709
|
+
}),
|
|
1710
|
+
/* @__PURE__ */ K("span", {
|
|
1711
|
+
class: "wallet-tag",
|
|
1712
|
+
children: "Detected"
|
|
1713
|
+
})
|
|
1714
|
+
]
|
|
1715
|
+
}, e.id)),
|
|
1716
|
+
m.map((e) => /* @__PURE__ */ K("button", {
|
|
1717
|
+
type: "button",
|
|
1718
|
+
class: "wallet",
|
|
1719
|
+
onClick: () => {
|
|
1720
|
+
d(e.id), l(!0);
|
|
1721
|
+
},
|
|
1722
|
+
children: [/* @__PURE__ */ K(q, {
|
|
1723
|
+
id: e.id,
|
|
1724
|
+
name: e.name
|
|
1725
|
+
}), /* @__PURE__ */ K("span", {
|
|
1726
|
+
class: "wallet-name",
|
|
1727
|
+
children: e.name
|
|
1728
|
+
})]
|
|
1729
|
+
}, e.id)),
|
|
1730
|
+
f.length === 0 && m.length === 0 && !p ? /* @__PURE__ */ K("p", {
|
|
1731
|
+
class: "muted",
|
|
1732
|
+
children: "Loading wallets…"
|
|
1733
|
+
}) : null,
|
|
1734
|
+
p ? /* @__PURE__ */ K("button", {
|
|
1735
|
+
type: "button",
|
|
1736
|
+
class: "wallet wallet-more-button",
|
|
1737
|
+
onClick: () => {
|
|
1738
|
+
d(void 0), l(!0);
|
|
1739
|
+
},
|
|
1740
|
+
children: [g.length > 0 ? /* @__PURE__ */ K("span", {
|
|
1741
|
+
class: "wallet-stack",
|
|
1742
|
+
"aria-hidden": "true",
|
|
1743
|
+
children: g.map((e) => /* @__PURE__ */ K("img", {
|
|
1744
|
+
src: e.src,
|
|
1745
|
+
alt: "",
|
|
1746
|
+
width: 16,
|
|
1747
|
+
height: 16,
|
|
1748
|
+
loading: "lazy",
|
|
1749
|
+
decoding: "async"
|
|
1750
|
+
}, e.id))
|
|
1751
|
+
}) : /* @__PURE__ */ K("span", {
|
|
1752
|
+
class: "wallet-mark",
|
|
1753
|
+
"aria-hidden": "true",
|
|
1754
|
+
children: "···"
|
|
1755
|
+
}), /* @__PURE__ */ K("span", {
|
|
1756
|
+
class: "wallet-name",
|
|
1757
|
+
children: "Other wallets"
|
|
1758
|
+
})]
|
|
1759
|
+
}) : null,
|
|
1760
|
+
/* @__PURE__ */ K(Mt, {
|
|
1761
|
+
open: c,
|
|
1762
|
+
wallets: e,
|
|
1763
|
+
registry: t,
|
|
1764
|
+
connecting: n,
|
|
1765
|
+
connected: r,
|
|
1766
|
+
error: i,
|
|
1767
|
+
initialWalletId: u,
|
|
1768
|
+
remotePairing: a,
|
|
1769
|
+
onClose: () => l(!1),
|
|
1770
|
+
onSelect: o
|
|
1771
|
+
})
|
|
1772
|
+
]
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
// src/element/ui/app.tsx
|
|
1776
|
+
var Lt = 1;
|
|
1777
|
+
function Rt(e) {
|
|
1778
|
+
let [t, n] = H(e.getState);
|
|
1779
|
+
return U(() => (n(e.getState()), e.subscribe(() => n(e.getState()))), [e]), t;
|
|
1780
|
+
}
|
|
1781
|
+
function zt({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose: o }) {
|
|
1782
|
+
let s = Rt(e), u = We(), d = je(!1), [f, p] = H(), m = t.family ? [t.family] : ["evm", "svm"], h = W(() => {
|
|
1783
|
+
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
1784
|
+
let r = n.name.trim().toLowerCase();
|
|
1785
|
+
t.has(n.id) || t.has(r) || (t.add(n.id), t.add(r), e.push(n));
|
|
1786
|
+
};
|
|
1787
|
+
if (m.includes("evm")) for (let e of s.evm.available) n({
|
|
1788
|
+
...e,
|
|
1789
|
+
family: "evm",
|
|
1790
|
+
evm: e
|
|
1791
|
+
});
|
|
1792
|
+
if (m.includes("svm")) for (let e of s.svm.available) n({
|
|
1793
|
+
...e,
|
|
1794
|
+
family: "svm",
|
|
1795
|
+
svm: e
|
|
1796
|
+
});
|
|
1797
|
+
return e;
|
|
1798
|
+
}, [
|
|
1799
|
+
s.evm.available,
|
|
1800
|
+
s.svm.available,
|
|
1801
|
+
t.family
|
|
1802
|
+
]), g = W(() => {
|
|
1803
|
+
let e = /* @__PURE__ */ new Set(), t = [];
|
|
1804
|
+
for (let n of m) for (let r of l(s.catalog, n)) e.has(r.id) || (e.add(r.id), t.push(r));
|
|
1805
|
+
let n = new Set(h.map((e) => e.id)), r = new Set(h.map((e) => e.name.trim().toLowerCase()));
|
|
1806
|
+
return t.filter((e) => n.has(e.id) || !r.has(e.name.trim().toLowerCase()));
|
|
1807
|
+
}, [
|
|
1808
|
+
s.catalog,
|
|
1809
|
+
t.family,
|
|
1810
|
+
h
|
|
1811
|
+
]), _ = s.evm.connecting || s.svm.connecting, v = f === "svm" ? s.svm.error : s.evm.error, y = Me((t) => {
|
|
1812
|
+
p(t.family), t.evm ? e.connectEvm(t.evm) : t.svm && e.connectSvm(t.svm);
|
|
1813
|
+
}, [e]), b = Me((n) => {
|
|
1814
|
+
if (!e.canPairRemotely() || m.length === 1 && m[0] === "svm") return;
|
|
1815
|
+
let r = g.find((e) => e.id === n);
|
|
1816
|
+
if (r && !a(r.id, window.location.href) && (u || c(r.id))) return (n) => {
|
|
1817
|
+
p("evm"), e.connectRemote(r, t.chainId ?? Lt, n);
|
|
1818
|
+
};
|
|
1819
|
+
}, [
|
|
1820
|
+
e,
|
|
1821
|
+
u,
|
|
1822
|
+
g,
|
|
1823
|
+
t.chainId,
|
|
1824
|
+
t.family
|
|
1825
|
+
]), x = f === "svm" ? s.svm.connected : s.evm.connected;
|
|
1826
|
+
return f && x && (d.current = !0), U(() => {
|
|
1827
|
+
if (!f || !x) return;
|
|
1828
|
+
let n = !0;
|
|
1829
|
+
return (async () => {
|
|
1830
|
+
try {
|
|
1831
|
+
if (f === "evm" && t.chainId !== void 0 && !await e.ensureChain(t.chainId)) {
|
|
1832
|
+
d.current = !1, n && i(e.getState().evm.error || "The wallet stayed on another network.");
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
let a = await e.resolveIntent(f, t);
|
|
1836
|
+
if (!n) return;
|
|
1837
|
+
t.keepAlive || e.disconnect(f), r(a);
|
|
1838
|
+
} catch (e) {
|
|
1839
|
+
n && i(e instanceof Error ? e.message : "Could not read the wallet.");
|
|
1840
|
+
}
|
|
1841
|
+
})(), () => {
|
|
1842
|
+
n = !1;
|
|
1843
|
+
};
|
|
1844
|
+
}, [
|
|
1845
|
+
f,
|
|
1846
|
+
x?.address,
|
|
1847
|
+
x?.walletId
|
|
1848
|
+
]), n === "modal" ? /* @__PURE__ */ K(He, {
|
|
1849
|
+
base: s.assetBase,
|
|
1850
|
+
children: /* @__PURE__ */ K(Mt, {
|
|
1851
|
+
open: !0,
|
|
1852
|
+
wallets: h,
|
|
1853
|
+
registry: g,
|
|
1854
|
+
connecting: _,
|
|
1855
|
+
connected: !!x,
|
|
1856
|
+
error: v,
|
|
1857
|
+
remotePairing: b,
|
|
1858
|
+
onSelect: y,
|
|
1859
|
+
onClose: () => {
|
|
1860
|
+
d.current || o();
|
|
1861
|
+
}
|
|
1862
|
+
})
|
|
1863
|
+
}) : /* @__PURE__ */ K(He, {
|
|
1864
|
+
base: s.assetBase,
|
|
1865
|
+
children: /* @__PURE__ */ K(It, {
|
|
1866
|
+
wallets: h,
|
|
1867
|
+
registry: g,
|
|
1868
|
+
connecting: _,
|
|
1869
|
+
connected: !!x,
|
|
1870
|
+
error: v,
|
|
1871
|
+
remotePairing: b,
|
|
1872
|
+
onSelect: y
|
|
1873
|
+
})
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
// src/element/element.ts
|
|
1877
|
+
var $ = class extends HTMLElement {
|
|
1878
|
+
static tagName = "reclack-connect";
|
|
1879
|
+
static get observedAttributes() {
|
|
1880
|
+
return [
|
|
1881
|
+
"family",
|
|
1882
|
+
"chain-id",
|
|
1883
|
+
"intent",
|
|
1884
|
+
"keep-alive",
|
|
1885
|
+
"variant",
|
|
1886
|
+
"theme-mode",
|
|
1887
|
+
"asset-base",
|
|
1888
|
+
"api-url",
|
|
1889
|
+
"brand",
|
|
1890
|
+
"radius",
|
|
1891
|
+
"font"
|
|
1892
|
+
];
|
|
1893
|
+
}
|
|
1894
|
+
#e;
|
|
1895
|
+
#t = !0;
|
|
1896
|
+
set kit(e) {
|
|
1897
|
+
this.useKit(e);
|
|
1898
|
+
}
|
|
1899
|
+
get kit() {
|
|
1900
|
+
return this.#e ||= n({
|
|
1901
|
+
assetBase: this.getAttribute("asset-base") ?? void 0,
|
|
1902
|
+
apiUrl: this.getAttribute("api-url") ?? void 0
|
|
1903
|
+
}), this.#e;
|
|
1904
|
+
}
|
|
1905
|
+
#n = { intent: ["address"] };
|
|
1906
|
+
#r;
|
|
1907
|
+
set request(e) {
|
|
1908
|
+
this.#n = e, this.#a && this.#_();
|
|
1909
|
+
}
|
|
1910
|
+
get request() {
|
|
1911
|
+
return this.#n;
|
|
1912
|
+
}
|
|
1913
|
+
set theme(e) {
|
|
1914
|
+
this.#r = e, this.#a && (this.#p(), this.#_());
|
|
1915
|
+
}
|
|
1916
|
+
get theme() {
|
|
1917
|
+
return this.#r;
|
|
1918
|
+
}
|
|
1919
|
+
#i;
|
|
1920
|
+
#a = !1;
|
|
1921
|
+
#o;
|
|
1922
|
+
#s = "light";
|
|
1923
|
+
#c;
|
|
1924
|
+
#l = !1;
|
|
1925
|
+
get scheme() {
|
|
1926
|
+
return this.#s;
|
|
1927
|
+
}
|
|
1928
|
+
constructor() {
|
|
1929
|
+
super(), this.#i = this.attachShadow({ mode: "open" }), Vt(this.#i), Wt(this.#i);
|
|
1930
|
+
}
|
|
1931
|
+
connectedCallback() {
|
|
1932
|
+
this.#a = !0, queueMicrotask(() => {
|
|
1933
|
+
!this.#a || this.#o || this.#u();
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
#u() {
|
|
1937
|
+
this.#o = this.kit.subscribe(() => this.#f()), this.#p(), this.#_();
|
|
1938
|
+
}
|
|
1939
|
+
disconnectedCallback() {
|
|
1940
|
+
this.#a = !1, this.#o?.(), this.#o = void 0, this.#c?.(), this.#c = void 0, ve(null, this.#i), this.#t && !this.#h().keepAlive && this.kit.destroy();
|
|
1941
|
+
}
|
|
1942
|
+
attributeChangedCallback() {
|
|
1943
|
+
this.#a && (this.#p(), this.#_());
|
|
1944
|
+
}
|
|
1945
|
+
useKit(e) {
|
|
1946
|
+
this.#t && this.#e?.destroy(), this.#e = e, this.#t = !1, this.#a && (this.#o?.(), this.#o = void 0, this.#u());
|
|
1947
|
+
}
|
|
1948
|
+
#d;
|
|
1949
|
+
#f() {
|
|
1950
|
+
(this.#r ?? this.kit.getState().theme) !== this.#d && this.#p(), this.#_();
|
|
1951
|
+
}
|
|
1952
|
+
#p() {
|
|
1953
|
+
this.#c?.();
|
|
1954
|
+
let e = this.#m();
|
|
1955
|
+
this.#d = this.#r ?? this.#e?.getState().theme, this.#c = i(e?.mode, (n) => {
|
|
1956
|
+
this.#s = n, t(this, e, n);
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
#m() {
|
|
1960
|
+
if (this.#r) return this.#r;
|
|
1961
|
+
let e = this.#e?.getState().theme;
|
|
1962
|
+
if (e) return e;
|
|
1963
|
+
let t = this.getAttribute("theme-mode");
|
|
1964
|
+
return {
|
|
1965
|
+
mode: t === "light" || t === "dark" ? t : "system",
|
|
1966
|
+
brand: this.getAttribute("brand") ?? void 0,
|
|
1967
|
+
radius: this.getAttribute("radius") ?? void 0,
|
|
1968
|
+
fontFamily: this.getAttribute("font") ?? void 0
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
#h() {
|
|
1972
|
+
let e = this.getAttribute("intent"), t = e ? e.split(",").map((e) => e.trim()).filter((e) => e === "address" || e === "balance") : this.#n.intent, n = this.getAttribute("family"), r = this.getAttribute("chain-id");
|
|
1973
|
+
return {
|
|
1974
|
+
...this.#n,
|
|
1975
|
+
intent: t.length > 0 ? t : ["address"],
|
|
1976
|
+
family: n === "evm" || n === "svm" ? n : this.#n.family,
|
|
1977
|
+
chainId: r ? Number(r) : this.#n.chainId,
|
|
1978
|
+
keepAlive: this.hasAttribute("keep-alive") || this.#n.keepAlive
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
#g() {
|
|
1982
|
+
return this.getAttribute("variant") === "modal" ? "modal" : "inline";
|
|
1983
|
+
}
|
|
1984
|
+
#_() {
|
|
1985
|
+
this.#l || (this.#l = !0, queueMicrotask(() => {
|
|
1986
|
+
this.#l = !1, this.#a && this.#v();
|
|
1987
|
+
}));
|
|
1988
|
+
}
|
|
1989
|
+
#v() {
|
|
1990
|
+
ve(A(zt, {
|
|
1991
|
+
kit: this.kit,
|
|
1992
|
+
request: this.#h(),
|
|
1993
|
+
variant: this.#g(),
|
|
1994
|
+
onResult: (e) => this.#y("connect", e),
|
|
1995
|
+
onError: (e) => this.#y("connect-error", { message: e }),
|
|
1996
|
+
onClose: () => this.#y("cancel", void 0)
|
|
1997
|
+
}), this.#i);
|
|
1998
|
+
}
|
|
1999
|
+
#y(e, t) {
|
|
2000
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
2001
|
+
detail: t,
|
|
2002
|
+
bubbles: !0,
|
|
2003
|
+
composed: !0
|
|
2004
|
+
}));
|
|
2005
|
+
}
|
|
2006
|
+
}, Bt;
|
|
2007
|
+
function Vt(e) {
|
|
2008
|
+
if (typeof CSSStyleSheet < "u" && "adoptedStyleSheets" in e) {
|
|
2009
|
+
Bt || (Bt = new CSSStyleSheet(), Bt.replaceSync(be)), e.adoptedStyleSheets = [Bt];
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
let t = document.createElement("style");
|
|
2013
|
+
t.textContent = be, e.append(t);
|
|
2014
|
+
}
|
|
2015
|
+
function Ht(e = $.tagName) {
|
|
2016
|
+
typeof customElements > "u" || customElements.get(e) || customElements.define(e, $);
|
|
2017
|
+
}
|
|
2018
|
+
function Ut(e = { intent: ["address"] }) {
|
|
2019
|
+
Ht();
|
|
2020
|
+
let { kit: t, kitOptions: r, theme: i, container: a, ...o } = e;
|
|
2021
|
+
if (o.keepAlive && !t && !r) throw Error("connectWallet with keepAlive needs a kit of your own to keep the connection on.");
|
|
2022
|
+
let s = document.createElement($.tagName);
|
|
2023
|
+
return t ? s.useKit(t) : r && s.useKit(n(r)), s.request = o, s.theme = i, s.setAttribute("variant", "modal"), (a ?? document.body).append(s), new Promise((e, t) => {
|
|
2024
|
+
let n = (e) => {
|
|
2025
|
+
s.remove(), e();
|
|
2026
|
+
};
|
|
2027
|
+
s.addEventListener("connect", (t) => {
|
|
2028
|
+
n(() => e(t.detail));
|
|
2029
|
+
}), s.addEventListener("cancel", () => {
|
|
2030
|
+
n(() => t(/* @__PURE__ */ Error("The wallet prompt was closed.")));
|
|
2031
|
+
}), s.addEventListener("connect-error", (e) => {
|
|
2032
|
+
let r = e.detail;
|
|
2033
|
+
n(() => t(Error(r?.message ?? "Could not connect.")));
|
|
2034
|
+
});
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
function Wt(e) {
|
|
2038
|
+
let t = (e) => {
|
|
2039
|
+
Gt(e) && e.stopPropagation();
|
|
2040
|
+
};
|
|
2041
|
+
e.addEventListener("wheel", t), e.addEventListener("touchmove", t);
|
|
2042
|
+
}
|
|
2043
|
+
function Gt(e) {
|
|
2044
|
+
for (let t of e.composedPath()) {
|
|
2045
|
+
if (!(t instanceof Element)) return !1;
|
|
2046
|
+
if (t.scrollHeight <= t.clientHeight) continue;
|
|
2047
|
+
let e = getComputedStyle(t).overflowY;
|
|
2048
|
+
if (e === "auto" || e === "scroll") return !0;
|
|
2049
|
+
}
|
|
2050
|
+
return !1;
|
|
2051
|
+
}
|
|
2052
|
+
// src/element/props.ts
|
|
2053
|
+
var Kt = {
|
|
2054
|
+
variant: "variant",
|
|
2055
|
+
family: "family",
|
|
2056
|
+
chainId: "chain-id",
|
|
2057
|
+
themeMode: "theme-mode",
|
|
2058
|
+
brand: "brand",
|
|
2059
|
+
radius: "radius",
|
|
2060
|
+
fontFamily: "font",
|
|
2061
|
+
assetBase: "asset-base",
|
|
2062
|
+
apiUrl: "api-url"
|
|
2063
|
+
};
|
|
2064
|
+
function qt(e) {
|
|
2065
|
+
let t = {};
|
|
2066
|
+
for (let [n, r] of Object.entries(Kt)) {
|
|
2067
|
+
let i = e[n];
|
|
2068
|
+
i !== void 0 && (t[r] = String(i));
|
|
2069
|
+
}
|
|
2070
|
+
return e.intent?.length && (t.intent = e.intent.join(",")), e.keepAlive && (t["keep-alive"] = ""), t;
|
|
2071
|
+
}
|
|
2072
|
+
var Jt = {
|
|
2073
|
+
connect: "onConnect",
|
|
2074
|
+
cancel: "onCancel",
|
|
2075
|
+
"connect-error": "onError"
|
|
2076
|
+
};
|
|
2077
|
+
// src/element/index.ts
|
|
2078
|
+
Ht();
|
|
2079
|
+
export { Kt as ATTRIBUTES, Jt as EVENTS, $ as ReclackConnectElement, qt as attributesOf, Ut as connectWallet, Ht as defineWalletElement };
|