@reclack/walletkit 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/element/index.d.ts +2 -1
- package/dist/element/props.d.ts +36 -0
- package/dist/element.js +437 -420
- package/package.json +1 -1
package/dist/element.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { DEFAULT_LOGO_BASE as e, applyTheme as t, createWalletKit as n, networkLabel as r, networkLogo as i, subscribeHandheld as a, subscribeScheme as o, walletDeepLink as s, walletLogo as c, walletPairingLink as l, walletScans as u, walletsFor as d } from "@reclack/walletkit";
|
|
2
2
|
// node_modules/.pnpm/preact@10.29.8/node_modules/preact/dist/preact.module.js
|
|
3
|
-
var f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D = {}, O = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,
|
|
4
|
-
function
|
|
3
|
+
var f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D = {}, O = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, te = Array.isArray;
|
|
4
|
+
function k(e, t) {
|
|
5
5
|
for (var n in t) e[n] = t[n];
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ne(e) {
|
|
9
9
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function A(e, t, n) {
|
|
12
12
|
var r, i, a, o = {};
|
|
13
13
|
for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
|
|
14
14
|
if (arguments.length > 2 && (o.children = arguments.length > 3 ? f.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
|
|
15
|
+
return re(e, o, r, i, null);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function re(e, t, n, r, i) {
|
|
18
18
|
var a = {
|
|
19
19
|
type: e,
|
|
20
20
|
props: t,
|
|
@@ -32,62 +32,62 @@ function ne(e, t, n, r, i) {
|
|
|
32
32
|
};
|
|
33
33
|
return i == null && p.vnode != null && p.vnode(a), a;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function j(e) {
|
|
36
36
|
return e.children;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function M(e, t) {
|
|
39
39
|
this.props = e, this.context = t;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
if (t == null) return e.__ ?
|
|
41
|
+
function N(e, t) {
|
|
42
|
+
if (t == null) return e.__ ? N(e.__, e.__i + 1) : null;
|
|
43
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" ?
|
|
44
|
+
return typeof e.type == "function" ? N(e) : null;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function ie(e) {
|
|
47
47
|
if (e.__P && e.__d) {
|
|
48
|
-
var t = e.__v, n = t.__e, r = [], i = [], a =
|
|
49
|
-
a.__v = t.__v + 1, p.vnode && p.vnode(a),
|
|
48
|
+
var t = e.__v, n = t.__e, r = [], i = [], a = k({}, t);
|
|
49
|
+
a.__v = t.__v + 1, p.vnode && p.vnode(a), pe(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? N(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, he(r, a, i), t.__e = t.__ = null, a.__e != n && ae(a);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function ae(e) {
|
|
53
53
|
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
|
|
54
54
|
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
|
|
55
|
-
}),
|
|
55
|
+
}), ae(e);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
(!e.__d && (e.__d = !0) && h.push(e) && !
|
|
57
|
+
function oe(e) {
|
|
58
|
+
(!e.__d && (e.__d = !0) && h.push(e) && !P.__r++ || g != p.debounceRendering) && ((g = p.debounceRendering) || _)(P);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function P() {
|
|
61
61
|
try {
|
|
62
|
-
for (var e, t = 1; h.length;) h.length > t && h.sort(v), e = h.shift(), t = h.length,
|
|
62
|
+
for (var e, t = 1; h.length;) h.length > t && h.sort(v), e = h.shift(), t = h.length, ie(e);
|
|
63
63
|
} finally {
|
|
64
|
-
h.length =
|
|
64
|
+
h.length = P.__r = 0;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function se(e, t, n, r, i, a, o, s, c, l, u) {
|
|
68
68
|
var d, f, p, m, h, g, _ = r && r.__k || O, v = t.length;
|
|
69
|
-
for (c =
|
|
69
|
+
for (c = ce(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || D, p.__i = d, g = pe(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ve(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = le(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
70
|
return n.__e = h, c;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ce(e, t, n, r, i) {
|
|
73
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] =
|
|
75
|
-
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r =
|
|
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] = re(null, o, null, null, null) : te(o) ? o = e.__k[a] = re(j, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = re(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 = ue(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 = N(s)), ye(s, s));
|
|
76
76
|
return r;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function le(e, t, n) {
|
|
79
79
|
var r, i;
|
|
80
80
|
if (typeof e.type == "function") {
|
|
81
|
-
for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t =
|
|
81
|
+
for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = le(r[i], t, n));
|
|
82
82
|
return t;
|
|
83
83
|
}
|
|
84
|
-
e.__e != t && (t && e.type && !t.parentNode && (t =
|
|
84
|
+
e.__e != t && (t && e.type && !t.parentNode && (t = N(e)), t = n.insertBefore(e.__e, t || null));
|
|
85
85
|
do
|
|
86
86
|
t &&= t.nextSibling;
|
|
87
87
|
while (t != null && t.nodeType == 8);
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function ue(e, t, n, r) {
|
|
91
91
|
var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);
|
|
92
92
|
if (l === null && s == null || u && s == l.key && c == l.type) return n;
|
|
93
93
|
if (r > +!!u) {
|
|
@@ -95,16 +95,16 @@ function le(e, t, n, r) {
|
|
|
95
95
|
}
|
|
96
96
|
return -1;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function de(e, t, n) {
|
|
99
99
|
t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ee.test(t) ? n : n + "px";
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function F(e, t, n, r, i) {
|
|
102
102
|
var a, o;
|
|
103
103
|
n: if (t == "style") {
|
|
104
104
|
if (typeof n == "string") e.style.cssText = n;
|
|
105
105
|
else {
|
|
106
|
-
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n ||
|
|
107
|
-
if (n) for (t in n) r && n[t] == r[t] ||
|
|
106
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || de(e.style, t, "");
|
|
107
|
+
if (n) for (t in n) r && n[t] == r[t] || de(e.style, t, n[t]);
|
|
108
108
|
}
|
|
109
109
|
} else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(S, "$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[x] = r[x] : (n[x] = C, e.addEventListener(t, a ? T : w, a)) : e.removeEventListener(t, a ? T : w, a);
|
|
110
110
|
else {
|
|
@@ -116,7 +116,7 @@ function I(e, t, n, r, i) {
|
|
|
116
116
|
typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function fe(e) {
|
|
120
120
|
return function(t) {
|
|
121
121
|
if (this.l) {
|
|
122
122
|
var n = this.l[t.type + e];
|
|
@@ -126,19 +126,19 @@ function de(e) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function pe(e, t, n, r, i, a, o, s, c, l) {
|
|
130
130
|
var u, d, f, m, h, g, _, v, y, b, x, S, C, w, T, E, D = t.type;
|
|
131
131
|
if (t.constructor !== void 0) return null;
|
|
132
132
|
128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = p.__b) && u(t);
|
|
133
133
|
n: if (typeof D == "function") {
|
|
134
134
|
d = o.length;
|
|
135
135
|
try {
|
|
136
|
-
if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new
|
|
136
|
+
if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new M(y, S), f.constructor = D, f.render = be), x && x.sub(f), f.state || (f.state = {}), f.__n = r, m = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = k({}, f.__s)), k(f.__s, D.getDerivedStateFromProps(y, f.__s))), h = f.props, g = f.state, f.__v = t, m) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);
|
|
137
137
|
else {
|
|
138
138
|
if (b && D.getDerivedStateFromProps == null && y !== h && f.componentWillReceiveProps != null && f.componentWillReceiveProps(y, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(y, f.__s, S)) {
|
|
139
139
|
t.__v != n.__v && (f.props = y, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
|
|
140
140
|
e && (e.__ = t);
|
|
141
|
-
}), O.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s =
|
|
141
|
+
}), O.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = N(n);
|
|
142
142
|
break n;
|
|
143
143
|
}
|
|
144
144
|
f.componentWillUpdate != null && f.componentWillUpdate(y, f.__s, S), b && f.componentDidUpdate != null && f.__h.push(function() {
|
|
@@ -149,24 +149,24 @@ function fe(e, t, n, r, i, a, o, s, c, l) {
|
|
|
149
149
|
else do
|
|
150
150
|
f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
|
|
151
151
|
while (f.__d && ++w < 25);
|
|
152
|
-
f.state = f.__s, f.getChildContext != null && (r =
|
|
152
|
+
f.state = f.__s, f.getChildContext != null && (r = k(k({}, r), f.getChildContext())), b && !m && f.getSnapshotBeforeUpdate != null && (_ = f.getSnapshotBeforeUpdate(h, g)), T = u != null && u.type === j && u.key == null ? ge(u.props.children) : u, s = se(e, te(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), v && (f.__E = f.__ = null);
|
|
153
153
|
} catch (e) {
|
|
154
154
|
if (o.length = d, t.__v = null, c || a != null) {
|
|
155
155
|
if (e.then) {
|
|
156
156
|
for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
|
|
157
157
|
a != null && (a[a.indexOf(s)] = null), t.__e = s;
|
|
158
|
-
} else if (a != null) for (E = a.length; E--;)
|
|
158
|
+
} else if (a != null) for (E = a.length; E--;) ne(a[E]);
|
|
159
159
|
} else t.__e = n.__e;
|
|
160
|
-
t.__k ??= n.__k || [], e.then ||
|
|
160
|
+
t.__k ??= n.__k || [], e.then || me(t), p.__e(e, t, n);
|
|
161
161
|
}
|
|
162
|
-
} else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e =
|
|
162
|
+
} else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = _e(n.__e, t, n, r, i, a, o, c, l);
|
|
163
163
|
return (u = p.diffed) && u(t), 128 & t.__u ? void 0 : s;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(
|
|
165
|
+
function me(e) {
|
|
166
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(me));
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
for (var r = 0; r < n.length; r++)
|
|
168
|
+
function he(e, t, n) {
|
|
169
|
+
for (var r = 0; r < n.length; r++) ve(n[r], n[++r], n[++r]);
|
|
170
170
|
p.__c && p.__c(t, e), e.some(function(t) {
|
|
171
171
|
try {
|
|
172
172
|
e = t.__h, t.__h = [], e.some(function(e) {
|
|
@@ -177,10 +177,10 @@ function me(e, t, n) {
|
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
return typeof e != "object" || !e || e.__b > 0 ? e :
|
|
180
|
+
function ge(e) {
|
|
181
|
+
return typeof e != "object" || !e || e.__b > 0 ? e : te(e) ? e.map(ge) : e.constructor === void 0 ? k({}, e) : null;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function _e(e, t, n, r, i, a, o, s, c) {
|
|
184
184
|
var l, u, d, m, h, g, _, v = n.props || D, y = t.props, b = t.type;
|
|
185
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
186
|
for (l = 0; l < a.length; l++) if ((h = a[l]) && "setAttribute" in h == !!b && (b ? h.localName == b : h.nodeType == 3)) {
|
|
@@ -195,15 +195,15 @@ function ge(e, t, n, r, i, a, o, s, c) {
|
|
|
195
195
|
if (b == null) v === y || s && e.data == y || (e.data = y);
|
|
196
196
|
else {
|
|
197
197
|
if (a = b == "textarea" && y.defaultValue != null ? null : a && f.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" ? d = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y ||
|
|
199
|
-
for (l in y) h = y[l], l == "children" ? m = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h ||
|
|
198
|
+
for (l in v) h = v[l], l == "dangerouslySetInnerHTML" ? d = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || F(e, l, null, h, i);
|
|
199
|
+
for (l in y) h = y[l], l == "children" ? m = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h || F(e, l, h, v[l], i);
|
|
200
200
|
if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
|
|
201
|
-
else if (d && (e.innerHTML = ""),
|
|
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]) &&
|
|
201
|
+
else if (d && (e.innerHTML = ""), se(t.type == "template" ? e.content : e, te(m) ? m : [m], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && N(n, 0), s, c), a != null) for (l = a.length; l--;) ne(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]) && F(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && F(e, l, _, v[l], i));
|
|
203
203
|
}
|
|
204
204
|
return e;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function ve(e, t, n) {
|
|
207
207
|
try {
|
|
208
208
|
if (typeof e == "function") {
|
|
209
209
|
var r = typeof e.__u == "function";
|
|
@@ -213,9 +213,9 @@ function _e(e, t, n) {
|
|
|
213
213
|
p.__e(e, n);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function ye(e, t, n) {
|
|
217
217
|
var r, i;
|
|
218
|
-
if (p.unmount && p.unmount(e), (r = e.ref) && (r.current && r.current != e.__e ||
|
|
218
|
+
if (p.unmount && p.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || ve(r, null, t)), (r = e.__c) != null) {
|
|
219
219
|
if (r.componentWillUnmount) try {
|
|
220
220
|
r.componentWillUnmount();
|
|
221
221
|
} catch (e) {
|
|
@@ -223,17 +223,17 @@ function ve(e, t, n) {
|
|
|
223
223
|
}
|
|
224
224
|
r.base = r.__P = r.__n = null;
|
|
225
225
|
}
|
|
226
|
-
if (r = e.__k) for (i = 0; i < r.length; i++) r[i] &&
|
|
227
|
-
n ||
|
|
226
|
+
if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && ye(r[i], t, n || typeof e.type != "function");
|
|
227
|
+
n || ne(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function be(e, t, n) {
|
|
230
230
|
return this.constructor(e, n);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function I(e, t, n) {
|
|
233
233
|
var r, i, a, o;
|
|
234
|
-
t == document && (t = document.documentElement), p.__ && p.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [],
|
|
234
|
+
t == document && (t = document.documentElement), p.__ && p.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], pe(t, e = (!r && n || t).__k = A(j, null, [e]), i || D, D, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? f.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), he(a, e, o), e.props.children = null;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function xe(e) {
|
|
237
237
|
function t(e) {
|
|
238
238
|
var n, r;
|
|
239
239
|
return this.getChildContext || (n = /* @__PURE__ */ new Set(), (r = {})[t.__c] = this, this.getChildContext = function() {
|
|
@@ -242,7 +242,7 @@ function be(e) {
|
|
|
242
242
|
n = null;
|
|
243
243
|
}, this.shouldComponentUpdate = function(e) {
|
|
244
244
|
this.props.value != e.value && n.forEach(function(e) {
|
|
245
|
-
e.__e = !0,
|
|
245
|
+
e.__e = !0, oe(e);
|
|
246
246
|
});
|
|
247
247
|
}, this.sub = function(e) {
|
|
248
248
|
n.add(e);
|
|
@@ -263,33 +263,33 @@ f = O.slice, p = { __e: function(e, t, n, r) {
|
|
|
263
263
|
e = t;
|
|
264
264
|
}
|
|
265
265
|
throw e;
|
|
266
|
-
} }, m = 0,
|
|
267
|
-
var n = this.__s != null && this.__s != this.state ? this.__s : this.__s =
|
|
268
|
-
typeof e == "function" && (e = e(
|
|
269
|
-
},
|
|
270
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
271
|
-
},
|
|
266
|
+
} }, m = 0, M.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), oe(this));
|
|
269
|
+
}, M.prototype.forceUpdate = function(e) {
|
|
270
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), oe(this));
|
|
271
|
+
}, M.prototype.render = j, h = [], _ = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, v = function(e, t) {
|
|
272
272
|
return e.__v.__b - t.__v.__b;
|
|
273
|
-
},
|
|
273
|
+
}, P.__r = 0, y = Math.random().toString(8), b = "__d" + y, x = "__a" + y, S = /(PointerCapture)$|Capture$/i, C = 0, w = fe(!1), T = fe(!0), E = 0;
|
|
274
274
|
// src/element/styles.css?inline
|
|
275
|
-
var xe = ":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}.network-select{position:relative}.network-trigger{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:.75rem;padding:.625rem .75rem;font-size:.875rem;display:flex}.network-trigger:hover:not(:disabled),.network-trigger[aria-expanded=true]{border-color:var(--rkw-brand)}.network-trigger:disabled{opacity:.6;cursor:not-allowed}.network-trigger-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.network-caret{border-right:1.5px solid var(--rkw-ink-muted);border-bottom:1.5px solid var(--rkw-ink-muted);flex:none;width:.45rem;height:.45rem;transform:translateY(-2px)rotate(45deg)}.network-trigger[aria-expanded=true] .network-caret{transform:translateY(2px)rotate(-135deg)}.network-panel{z-index:20;border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-surface);padding:.5rem;position:absolute;top:calc(100% + .375rem);left:0;right:0;box-shadow:0 12px 28px #1010141f}.network-search{font:inherit;border:1px solid var(--rkw-line);background:var(--rkw-surface);width:100%;color:inherit;appearance:none;border-radius:6px;margin-bottom:.5rem;padding:.5rem .75rem;font-size:.875rem}.network-search:focus,.network-search:focus-visible{border-color:var(--rkw-ink-muted);outline:none}.network-list{max-height:13rem;margin:0;padding:0;list-style:none;overflow-y:auto}.network-item{cursor:pointer;border-radius:7px;justify-content:space-between;align-items:center;gap:.75rem;padding:.5rem .625rem;font-size:.875rem;display:flex}.network-item-active{background:var(--rkw-ground)}.network-item-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.network-item[aria-selected=true] .network-item-name{color:var(--rkw-brand);font-weight:600}.network-mark{background:var(--rkw-ground);border-radius:50%;flex:none;place-items:center;width:1.25rem;height:1.25rem;font-size:.625rem;font-weight:700;display:grid;overflow:hidden}.network-mark img{object-fit:contain;width:100%;height:100%}.network-empty{padding:.5rem .625rem .25rem}.rkw-field{gap:.375rem;display:grid}.rkw-field-label{color:var(--rkw-ink-muted);font-size:.8125rem}", R, z, Se, Ce, B = 0, we = [], V = p, Te = V.__b, Ee = V.__r, De = V.diffed, Oe = V.__c, ke = V.unmount, Ae = V.__;
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
var n =
|
|
275
|
+
var Se = ":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}.network-select{position:relative}.network-trigger{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:.75rem;padding:.625rem .75rem;font-size:.875rem;display:flex}.network-trigger:hover:not(:disabled),.network-trigger[aria-expanded=true]{border-color:var(--rkw-brand)}.network-trigger:disabled{opacity:.6;cursor:not-allowed}.network-trigger-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.network-caret{border-right:1.5px solid var(--rkw-ink-muted);border-bottom:1.5px solid var(--rkw-ink-muted);flex:none;width:.45rem;height:.45rem;transform:translateY(-2px)rotate(45deg)}.network-trigger[aria-expanded=true] .network-caret{transform:translateY(2px)rotate(-135deg)}.network-panel{z-index:20;border:1px solid var(--rkw-line);border-radius:var(--rkw-radius);background:var(--rkw-surface);padding:.5rem;position:absolute;top:calc(100% + .375rem);left:0;right:0;box-shadow:0 12px 28px #1010141f}.network-search{font:inherit;border:1px solid var(--rkw-line);background:var(--rkw-surface);width:100%;color:inherit;appearance:none;border-radius:6px;margin-bottom:.5rem;padding:.5rem .75rem;font-size:.875rem}.network-search:focus,.network-search:focus-visible{border-color:var(--rkw-ink-muted);outline:none}.network-list{max-height:13rem;margin:0;padding:0;list-style:none;overflow-y:auto}.network-item{cursor:pointer;border-radius:7px;justify-content:space-between;align-items:center;gap:.75rem;padding:.5rem .625rem;font-size:.875rem;display:flex}.network-item-active{background:var(--rkw-ground)}.network-item-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.network-item[aria-selected=true] .network-item-name{color:var(--rkw-brand);font-weight:600}.network-mark{background:var(--rkw-ground);border-radius:50%;flex:none;place-items:center;width:1.25rem;height:1.25rem;font-size:.625rem;font-weight:700;display:grid;overflow:hidden}.network-mark img{object-fit:contain;width:100%;height:100%}.network-empty{padding:.5rem .625rem .25rem}.rkw-field{gap:.375rem;display:grid}.rkw-field-label{color:var(--rkw-ink-muted);font-size:.8125rem}", L, R, Ce, we, z = 0, Te = [], B = p, Ee = B.__b, De = B.__r, Oe = B.diffed, ke = B.__c, Ae = B.unmount, je = 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
279
|
__: [],
|
|
280
280
|
__h: []
|
|
281
281
|
});
|
|
282
282
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function H(e) {
|
|
285
|
+
return z = 1, Me(Ve, e);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
var r =
|
|
289
|
-
if (r.t = e, !r.__c && (r.__ = [n ? n(t) :
|
|
287
|
+
function Me(e, t, n) {
|
|
288
|
+
var r = V(L++, 2);
|
|
289
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ve(void 0, t), function(e) {
|
|
290
290
|
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
291
291
|
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
292
|
-
}], r.__c =
|
|
292
|
+
}], r.__c = R, !R.__f)) {
|
|
293
293
|
var i = function(e, t, n) {
|
|
294
294
|
if (!r.__c.__H) return !0;
|
|
295
295
|
var i = !1, o = r.__c.props !== e;
|
|
@@ -305,125 +305,125 @@ function je(e, t, n) {
|
|
|
305
305
|
}
|
|
306
306
|
return !i || o;
|
|
307
307
|
};
|
|
308
|
-
|
|
309
|
-
var a =
|
|
310
|
-
|
|
308
|
+
R.__f = !0;
|
|
309
|
+
var a = R.shouldComponentUpdate, o = R.componentWillUpdate;
|
|
310
|
+
R.componentWillUpdate = function(e, t, n) {
|
|
311
311
|
if (this.__e) {
|
|
312
312
|
var r = a;
|
|
313
313
|
a = void 0, i(e, t, n), a = r;
|
|
314
314
|
}
|
|
315
315
|
o && o.call(this, e, t, n);
|
|
316
|
-
},
|
|
316
|
+
}, R.shouldComponentUpdate = i;
|
|
317
317
|
}
|
|
318
318
|
return r.__N || r.__;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
var n =
|
|
322
|
-
!
|
|
320
|
+
function U(e, t) {
|
|
321
|
+
var n = V(L++, 3);
|
|
322
|
+
!B.__s && Be(n.__H, t) && (n.__ = e, n.u = t, R.__H.__h.push(n));
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
return
|
|
324
|
+
function W(e) {
|
|
325
|
+
return z = 5, G(function() {
|
|
326
326
|
return { current: e };
|
|
327
327
|
}, []);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
var n =
|
|
331
|
-
return
|
|
329
|
+
function G(e, t) {
|
|
330
|
+
var n = V(L++, 7);
|
|
331
|
+
return Be(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
return
|
|
333
|
+
function Ne(e, t) {
|
|
334
|
+
return z = 8, G(function() {
|
|
335
335
|
return e;
|
|
336
336
|
}, t);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
var t =
|
|
340
|
-
return n.c = e, t ? (n.__ ?? (n.__ = !0, t.sub(
|
|
338
|
+
function Pe(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
341
|
}
|
|
342
|
-
function
|
|
343
|
-
var e =
|
|
342
|
+
function Fe() {
|
|
343
|
+
var e = V(L++, 11);
|
|
344
344
|
if (!e.__) {
|
|
345
|
-
for (var t =
|
|
345
|
+
for (var t = R.__v; t !== null && !t.__m && t.__ !== null;) t = t.__;
|
|
346
346
|
var n = t.__m || (t.__m = [0, 0]);
|
|
347
347
|
e.__ = "P" + n[0] + "-" + n[1]++;
|
|
348
348
|
}
|
|
349
349
|
return e.__;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
for (var e; e =
|
|
351
|
+
function Ie() {
|
|
352
|
+
for (var e; e = Te.shift();) {
|
|
353
353
|
var t = e.__H;
|
|
354
354
|
if (e.__P && t) try {
|
|
355
|
-
t.__h.some(
|
|
355
|
+
t.__h.some(K), t.__h.some(ze), t.__h = [];
|
|
356
356
|
} catch (n) {
|
|
357
|
-
t.__h = [],
|
|
357
|
+
t.__h = [], B.__e(n, e.__v);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
var t = (
|
|
368
|
-
t && (
|
|
361
|
+
B.__b = function(e) {
|
|
362
|
+
R = null, Ee && Ee(e);
|
|
363
|
+
}, B.__ = function(e, t) {
|
|
364
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), je && je(e, t);
|
|
365
|
+
}, B.__r = function(e) {
|
|
366
|
+
De && De(e), L = 0;
|
|
367
|
+
var t = (R = e.__c).__H;
|
|
368
|
+
t && (Ce === R ? (t.__h = [], R.__h = [], t.__.some(function(e) {
|
|
369
369
|
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
370
|
-
})) : (t.__h.some(
|
|
371
|
-
},
|
|
372
|
-
|
|
370
|
+
})) : (t.__h.some(K), t.__h.some(ze), t.__h = [], L = 0)), Ce = R;
|
|
371
|
+
}, B.diffed = function(e) {
|
|
372
|
+
Oe && Oe(e);
|
|
373
373
|
var t = e.__c;
|
|
374
|
-
t && t.__H && (t.__H.__h.length && (
|
|
374
|
+
t && t.__H && (t.__H.__h.length && (Te.push(t) !== 1 && we === B.requestAnimationFrame || ((we = B.requestAnimationFrame) || Re)(Ie)), t.__H.__.some(function(e) {
|
|
375
375
|
e.u &&= (e.__H = e.u, void 0);
|
|
376
|
-
})),
|
|
377
|
-
},
|
|
376
|
+
})), Ce = R = null;
|
|
377
|
+
}, B.__c = function(e, t) {
|
|
378
378
|
t.some(function(e) {
|
|
379
379
|
try {
|
|
380
|
-
e.__h.some(
|
|
381
|
-
return !e.__ ||
|
|
380
|
+
e.__h.some(K), e.__h = e.__h.filter(function(e) {
|
|
381
|
+
return !e.__ || ze(e);
|
|
382
382
|
});
|
|
383
383
|
} catch (n) {
|
|
384
384
|
t.some(function(e) {
|
|
385
385
|
e.__h &&= [];
|
|
386
|
-
}), t = [],
|
|
386
|
+
}), t = [], B.__e(n, e.__v);
|
|
387
387
|
}
|
|
388
|
-
}),
|
|
389
|
-
},
|
|
390
|
-
|
|
388
|
+
}), ke && ke(e, t);
|
|
389
|
+
}, B.unmount = function(e) {
|
|
390
|
+
Ae && Ae(e);
|
|
391
391
|
var t, n = e.__c;
|
|
392
392
|
n && n.__H && (n.__H.__.some(function(e) {
|
|
393
393
|
try {
|
|
394
|
-
|
|
394
|
+
K(e);
|
|
395
395
|
} catch (e) {
|
|
396
396
|
t = e;
|
|
397
397
|
}
|
|
398
|
-
}), n.__H = void 0, t &&
|
|
398
|
+
}), n.__H = void 0, t && B.__e(t, n.__v));
|
|
399
399
|
};
|
|
400
|
-
var
|
|
401
|
-
function
|
|
400
|
+
var Le = typeof requestAnimationFrame == "function";
|
|
401
|
+
function Re(e) {
|
|
402
402
|
var t, n = function() {
|
|
403
|
-
clearTimeout(r),
|
|
403
|
+
clearTimeout(r), Le && cancelAnimationFrame(t), setTimeout(e);
|
|
404
404
|
}, r = setTimeout(n, 35);
|
|
405
|
-
|
|
405
|
+
Le && (t = requestAnimationFrame(n));
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
var t =
|
|
409
|
-
typeof n == "function" && (e.__c = void 0, n()),
|
|
407
|
+
function K(e) {
|
|
408
|
+
var t = R, n = e.__c;
|
|
409
|
+
typeof n == "function" && (e.__c = void 0, n()), R = t;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
var t =
|
|
413
|
-
e.__c = e.__(),
|
|
411
|
+
function ze(e) {
|
|
412
|
+
var t = R;
|
|
413
|
+
e.__c = e.__(), R = t;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Be(e, t) {
|
|
416
416
|
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
417
417
|
return t !== e[n];
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ve(e, t) {
|
|
421
421
|
return typeof t == "function" ? t(e) : t;
|
|
422
422
|
}
|
|
423
423
|
// node_modules/.pnpm/preact@10.29.8/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
424
|
-
var
|
|
424
|
+
var He = 0;
|
|
425
425
|
Array.isArray;
|
|
426
|
-
function
|
|
426
|
+
function q(e, t, n, r, i, a) {
|
|
427
427
|
t ||= {};
|
|
428
428
|
var o, s, c = t;
|
|
429
429
|
if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
|
|
@@ -438,7 +438,7 @@ function J(e, t, n, r, i, a) {
|
|
|
438
438
|
__e: null,
|
|
439
439
|
__c: null,
|
|
440
440
|
constructor: void 0,
|
|
441
|
-
__v: --
|
|
441
|
+
__v: --He,
|
|
442
442
|
__i: -1,
|
|
443
443
|
__u: 0,
|
|
444
444
|
__source: i,
|
|
@@ -448,32 +448,32 @@ function J(e, t, n, r, i, a) {
|
|
|
448
448
|
return p.vnode && p.vnode(l), l;
|
|
449
449
|
}
|
|
450
450
|
// src/element/ui/assets.tsx
|
|
451
|
-
var
|
|
452
|
-
function
|
|
453
|
-
return /* @__PURE__ */
|
|
451
|
+
var Ue = xe(e);
|
|
452
|
+
function We({ base: e, children: t }) {
|
|
453
|
+
return /* @__PURE__ */ q(Ue.Provider, {
|
|
454
454
|
value: e,
|
|
455
455
|
children: t
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
function We() {
|
|
459
|
-
return Ne(He);
|
|
460
|
-
}
|
|
461
458
|
function Ge() {
|
|
462
|
-
|
|
463
|
-
return K(() => (t) => c(t, e), [e]);
|
|
459
|
+
return Pe(Ue);
|
|
464
460
|
}
|
|
465
|
-
// src/element/ui/use-handheld.ts
|
|
466
461
|
function Ke() {
|
|
467
|
-
let
|
|
468
|
-
return
|
|
462
|
+
let e = Pe(Ue);
|
|
463
|
+
return G(() => (t) => c(t, e), [e]);
|
|
464
|
+
}
|
|
465
|
+
// src/element/ui/use-handheld.ts
|
|
466
|
+
function qe() {
|
|
467
|
+
let [e, t] = H(!1);
|
|
468
|
+
return U(() => a(t), []), e;
|
|
469
469
|
}
|
|
470
470
|
// src/element/ui/wallet-mark.tsx
|
|
471
|
-
function
|
|
472
|
-
let i =
|
|
473
|
-
return /* @__PURE__ */
|
|
471
|
+
function J({ id: e, name: t, icon: n, size: r = "sm" }) {
|
|
472
|
+
let i = Ke(), a = n ?? i(e), o = r === "lg" ? 32 : 20;
|
|
473
|
+
return /* @__PURE__ */ q("span", {
|
|
474
474
|
class: r === "lg" ? "wallet-mark wallet-mark-lg" : "wallet-mark",
|
|
475
475
|
"aria-hidden": "true",
|
|
476
|
-
children: a ? /* @__PURE__ */
|
|
476
|
+
children: a ? /* @__PURE__ */ q("img", {
|
|
477
477
|
src: a,
|
|
478
478
|
alt: "",
|
|
479
479
|
width: o,
|
|
@@ -484,12 +484,12 @@ function Y({ id: e, name: t, icon: n, size: r = "sm" }) {
|
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
// node_modules/.pnpm/uqr@0.1.3/node_modules/uqr/dist/index.mjs
|
|
487
|
-
var
|
|
488
|
-
L:
|
|
489
|
-
M:
|
|
490
|
-
Q:
|
|
491
|
-
H:
|
|
492
|
-
},
|
|
487
|
+
var Y = /* @__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))(Y || {}), Je = [0, 1], Ye = [1, 0], Xe = [2, 3], Ze = [3, 2], Qe = {
|
|
488
|
+
L: Je,
|
|
489
|
+
M: Ye,
|
|
490
|
+
Q: Xe,
|
|
491
|
+
H: Ze
|
|
492
|
+
}, $e = /^\d*$/, et = /^[A-Z0-9 $%*+./:-]*$/, tt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", nt = 1, rt = 40, it = 3, at = 3, X = 40, ot = 10, st = [
|
|
493
493
|
[
|
|
494
494
|
-1,
|
|
495
495
|
7,
|
|
@@ -662,7 +662,7 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
662
662
|
30,
|
|
663
663
|
30
|
|
664
664
|
]
|
|
665
|
-
],
|
|
665
|
+
], ct = [
|
|
666
666
|
[
|
|
667
667
|
-1,
|
|
668
668
|
1,
|
|
@@ -835,9 +835,9 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
835
835
|
77,
|
|
836
836
|
81
|
|
837
837
|
]
|
|
838
|
-
],
|
|
838
|
+
], lt = class {
|
|
839
839
|
constructor(e, t, n, r) {
|
|
840
|
-
if (this.version = e, this.ecc = t, e <
|
|
840
|
+
if (this.version = e, this.ecc = t, e < nt || e > rt) throw RangeError("Version value out of range");
|
|
841
841
|
if (r < -1 || r > 7) throw RangeError("Mask value out of range");
|
|
842
842
|
this.size = e * 4 + 17;
|
|
843
843
|
let i = Array.from({ length: this.size }).fill(!1);
|
|
@@ -862,7 +862,7 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
862
862
|
return e >= 0 && e < this.size && t >= 0 && t < this.size && this.modules[t][e];
|
|
863
863
|
}
|
|
864
864
|
drawFunctionPatterns() {
|
|
865
|
-
for (let e = 0; e < this.size; e++) this.setFunctionModule(6, e, e % 2 == 0,
|
|
865
|
+
for (let e = 0; e < this.size; e++) this.setFunctionModule(6, e, e % 2 == 0, Y.Timing), this.setFunctionModule(e, 6, e % 2 == 0, Y.Timing);
|
|
866
866
|
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
867
867
|
let e = this.getAlignmentPatternPositions(), t = e.length;
|
|
868
868
|
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]);
|
|
@@ -872,11 +872,11 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
872
872
|
let t = this.ecc[1] << 3 | e, n = t;
|
|
873
873
|
for (let e = 0; e < 10; e++) n = n << 1 ^ (n >>> 9) * 1335;
|
|
874
874
|
let r = (t << 10 | n) ^ 21522;
|
|
875
|
-
for (let e = 0; e <= 5; e++) this.setFunctionModule(8, e,
|
|
876
|
-
this.setFunctionModule(8, 7,
|
|
877
|
-
for (let e = 9; e < 15; e++) this.setFunctionModule(14 - e, 8,
|
|
878
|
-
for (let e = 0; e < 8; e++) this.setFunctionModule(this.size - 1 - e, 8,
|
|
879
|
-
for (let e = 8; e < 15; e++) this.setFunctionModule(8, this.size - 15 + e,
|
|
875
|
+
for (let e = 0; e <= 5; e++) this.setFunctionModule(8, e, Q(r, e));
|
|
876
|
+
this.setFunctionModule(8, 7, Q(r, 6)), this.setFunctionModule(8, 8, Q(r, 7)), this.setFunctionModule(7, 8, Q(r, 8));
|
|
877
|
+
for (let e = 9; e < 15; e++) this.setFunctionModule(14 - e, 8, Q(r, e));
|
|
878
|
+
for (let e = 0; e < 8; e++) this.setFunctionModule(this.size - 1 - e, 8, Q(r, e));
|
|
879
|
+
for (let e = 8; e < 15; e++) this.setFunctionModule(8, this.size - 15 + e, Q(r, e));
|
|
880
880
|
this.setFunctionModule(8, this.size - 8, !0);
|
|
881
881
|
}
|
|
882
882
|
drawVersion() {
|
|
@@ -885,30 +885,30 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
885
885
|
for (let t = 0; t < 12; t++) e = e << 1 ^ (e >>> 11) * 7973;
|
|
886
886
|
let t = this.version << 12 | e;
|
|
887
887
|
for (let e = 0; e < 18; e++) {
|
|
888
|
-
let n =
|
|
888
|
+
let n = Q(t, e), r = this.size - 11 + e % 3, i = Math.floor(e / 3);
|
|
889
889
|
this.setFunctionModule(r, i, n), this.setFunctionModule(i, r, n);
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
892
|
drawFinderPattern(e, t) {
|
|
893
893
|
for (let n = -4; n <= 4; n++) for (let r = -4; r <= 4; r++) {
|
|
894
894
|
let i = Math.max(Math.abs(r), Math.abs(n)), a = e + r, o = t + n;
|
|
895
|
-
a >= 0 && a < this.size && o >= 0 && o < this.size && this.setFunctionModule(a, o, i !== 2 && i !== 4,
|
|
895
|
+
a >= 0 && a < this.size && o >= 0 && o < this.size && this.setFunctionModule(a, o, i !== 2 && i !== 4, Y.Position);
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
drawAlignmentPattern(e, t) {
|
|
899
|
-
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,
|
|
899
|
+
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, Y.Alignment);
|
|
900
900
|
}
|
|
901
|
-
setFunctionModule(e, t, n, r =
|
|
901
|
+
setFunctionModule(e, t, n, r = Y.Function) {
|
|
902
902
|
this.modules[t][e] = n, this.types[t][e] = r;
|
|
903
903
|
}
|
|
904
904
|
addEccAndInterleave(e) {
|
|
905
905
|
let t = this.version, n = this.ecc;
|
|
906
|
-
if (e.length !==
|
|
907
|
-
let r =
|
|
906
|
+
if (e.length !== wt(t, n)) throw RangeError("Invalid argument");
|
|
907
|
+
let r = ct[n[0]][t], i = st[n[0]][t], a = Math.floor(Ct(t) / 8), o = r - a % r, s = Math.floor(a / r), c = [], l = Tt(i);
|
|
908
908
|
for (let t = 0, n = 0; t < r; t++) {
|
|
909
909
|
let r = e.slice(n, n + s - i + (t < o ? 0 : 1));
|
|
910
910
|
n += r.length;
|
|
911
|
-
let a =
|
|
911
|
+
let a = Et(r, l);
|
|
912
912
|
t < o && r.push(0), c.push(r.concat(a));
|
|
913
913
|
}
|
|
914
914
|
let u = [];
|
|
@@ -918,13 +918,13 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
918
918
|
return u;
|
|
919
919
|
}
|
|
920
920
|
drawCodewords(e) {
|
|
921
|
-
if (e.length !== Math.floor(
|
|
921
|
+
if (e.length !== Math.floor(Ct(this.version) / 8)) throw RangeError("Invalid argument");
|
|
922
922
|
let t = 0;
|
|
923
923
|
for (let n = this.size - 1; n >= 1; n -= 2) {
|
|
924
924
|
n === 6 && (n = 5);
|
|
925
925
|
for (let r = 0; r < this.size; r++) for (let i = 0; i < 2; i++) {
|
|
926
926
|
let a = n - i, o = n + 1 & 2 ? r : this.size - 1 - r;
|
|
927
|
-
!this.types[o][a] && t < e.length * 8 && (this.modules[o][a] =
|
|
927
|
+
!this.types[o][a] && t < e.length * 8 && (this.modules[o][a] = Q(e[t >>> 3], 7 - (t & 7)), t++);
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
}
|
|
@@ -974,8 +974,8 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
974
974
|
0,
|
|
975
975
|
0
|
|
976
976
|
];
|
|
977
|
-
for (let a = 0; a < this.size; a++) this.modules[t][a] === n ? (r++, r === 5 ? e +=
|
|
978
|
-
e += this.finderPenaltyTerminateAndCount(n, r, i) *
|
|
977
|
+
for (let a = 0; a < this.size; a++) this.modules[t][a] === n ? (r++, r === 5 ? e += it : r > 5 && e++) : (this.finderPenaltyAddHistory(r, i), n || (e += this.finderPenaltyCountPatterns(i) * X), n = this.modules[t][a], r = 1);
|
|
978
|
+
e += this.finderPenaltyTerminateAndCount(n, r, i) * X;
|
|
979
979
|
}
|
|
980
980
|
for (let t = 0; t < this.size; t++) {
|
|
981
981
|
let n = !1, r = 0, i = [
|
|
@@ -987,17 +987,17 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
987
987
|
0,
|
|
988
988
|
0
|
|
989
989
|
];
|
|
990
|
-
for (let a = 0; a < this.size; a++) this.modules[a][t] === n ? (r++, r === 5 ? e +=
|
|
991
|
-
e += this.finderPenaltyTerminateAndCount(n, r, i) *
|
|
990
|
+
for (let a = 0; a < this.size; a++) this.modules[a][t] === n ? (r++, r === 5 ? e += it : r > 5 && e++) : (this.finderPenaltyAddHistory(r, i), n || (e += this.finderPenaltyCountPatterns(i) * X), n = this.modules[a][t], r = 1);
|
|
991
|
+
e += this.finderPenaltyTerminateAndCount(n, r, i) * X;
|
|
992
992
|
}
|
|
993
993
|
for (let t = 0; t < this.size - 1; t++) for (let n = 0; n < this.size - 1; n++) {
|
|
994
994
|
let r = this.modules[t][n];
|
|
995
|
-
r === this.modules[t][n + 1] && r === this.modules[t + 1][n] && r === this.modules[t + 1][n + 1] && (e +=
|
|
995
|
+
r === this.modules[t][n + 1] && r === this.modules[t + 1][n] && r === this.modules[t + 1][n + 1] && (e += at);
|
|
996
996
|
}
|
|
997
997
|
let t = 0;
|
|
998
998
|
for (let e of this.modules) t = e.reduce((e, t) => e + +!!t, t);
|
|
999
999
|
let n = this.size * this.size, r = Math.ceil(Math.abs(t * 20 - n * 10) / n) - 1;
|
|
1000
|
-
return e += r *
|
|
1000
|
+
return e += r * ot, e;
|
|
1001
1001
|
}
|
|
1002
1002
|
getAlignmentPatternPositions() {
|
|
1003
1003
|
if (this.version === 1) return [];
|
|
@@ -1018,14 +1018,14 @@ var X = /* @__PURE__ */ ((e) => (e[e.Border = -1] = "Border", e[e.Data = 0] = "D
|
|
|
1018
1018
|
t[0] === 0 && (e += this.size), t.pop(), t.unshift(e);
|
|
1019
1019
|
}
|
|
1020
1020
|
};
|
|
1021
|
-
function
|
|
1021
|
+
function Z(e, t, n) {
|
|
1022
1022
|
if (t < 0 || t > 31 || e >>> t) throw RangeError("Value out of range");
|
|
1023
1023
|
for (let r = t - 1; r >= 0; r--) n.push(e >>> r & 1);
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function Q(e, t) {
|
|
1026
1026
|
return !!(e >>> t & 1);
|
|
1027
1027
|
}
|
|
1028
|
-
var
|
|
1028
|
+
var ut = class {
|
|
1029
1029
|
constructor(e, t, n) {
|
|
1030
1030
|
if (this.mode = e, this.numChars = t, this.bitData = n, t < 0) throw RangeError("Invalid argument");
|
|
1031
1031
|
this.bitData = n.slice();
|
|
@@ -1033,74 +1033,74 @@ var lt = class {
|
|
|
1033
1033
|
getData() {
|
|
1034
1034
|
return this.bitData.slice();
|
|
1035
1035
|
}
|
|
1036
|
-
},
|
|
1036
|
+
}, dt = [
|
|
1037
1037
|
1,
|
|
1038
1038
|
10,
|
|
1039
1039
|
12,
|
|
1040
1040
|
14
|
|
1041
|
-
],
|
|
1041
|
+
], ft = [
|
|
1042
1042
|
2,
|
|
1043
1043
|
9,
|
|
1044
1044
|
11,
|
|
1045
1045
|
13
|
|
1046
|
-
],
|
|
1046
|
+
], pt = [
|
|
1047
1047
|
4,
|
|
1048
1048
|
8,
|
|
1049
1049
|
16,
|
|
1050
1050
|
16
|
|
1051
1051
|
];
|
|
1052
|
-
function
|
|
1052
|
+
function mt(e, t) {
|
|
1053
1053
|
return e[Math.floor((t + 7) / 17) + 1];
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function ht(e) {
|
|
1056
1056
|
let t = [];
|
|
1057
|
-
for (let n of e)
|
|
1058
|
-
return new
|
|
1057
|
+
for (let n of e) Z(n, 8, t);
|
|
1058
|
+
return new ut(pt, e.length, t);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
if (!
|
|
1060
|
+
function gt(e) {
|
|
1061
|
+
if (!yt(e)) throw RangeError("String contains non-numeric characters");
|
|
1062
1062
|
let t = [];
|
|
1063
1063
|
for (let n = 0; n < e.length;) {
|
|
1064
1064
|
let r = Math.min(e.length - n, 3);
|
|
1065
|
-
|
|
1065
|
+
Z(Number.parseInt(e.substring(n, n + r), 10), r * 3 + 1, t), n += r;
|
|
1066
1066
|
}
|
|
1067
|
-
return new
|
|
1067
|
+
return new ut(dt, e.length, t);
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1070
|
-
if (!
|
|
1069
|
+
function _t(e) {
|
|
1070
|
+
if (!bt(e)) throw RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1071
1071
|
let t = [], n = 0;
|
|
1072
1072
|
for (; n + 2 <= e.length; n += 2) {
|
|
1073
|
-
let r =
|
|
1074
|
-
r +=
|
|
1073
|
+
let r = tt.indexOf(e.charAt(n)) * 45;
|
|
1074
|
+
r += tt.indexOf(e.charAt(n + 1)), Z(r, 11, t);
|
|
1075
1075
|
}
|
|
1076
|
-
return n < e.length &&
|
|
1077
|
-
}
|
|
1078
|
-
function _t(e) {
|
|
1079
|
-
return e === "" ? [] : vt(e) ? [ht(e)] : yt(e) ? [gt(e)] : [mt(xt(e))];
|
|
1076
|
+
return n < e.length && Z(tt.indexOf(e.charAt(n)), 6, t), new ut(ft, e.length, t);
|
|
1080
1077
|
}
|
|
1081
1078
|
function vt(e) {
|
|
1082
|
-
return
|
|
1079
|
+
return e === "" ? [] : yt(e) ? [gt(e)] : bt(e) ? [_t(e)] : [ht(St(e))];
|
|
1083
1080
|
}
|
|
1084
1081
|
function yt(e) {
|
|
1085
1082
|
return $e.test(e);
|
|
1086
1083
|
}
|
|
1087
|
-
function bt(e
|
|
1084
|
+
function bt(e) {
|
|
1085
|
+
return et.test(e);
|
|
1086
|
+
}
|
|
1087
|
+
function xt(e, t) {
|
|
1088
1088
|
let n = 0;
|
|
1089
1089
|
for (let r of e) {
|
|
1090
|
-
let e =
|
|
1090
|
+
let e = mt(r.mode, t);
|
|
1091
1091
|
if (r.numChars >= 1 << e) return Infinity;
|
|
1092
1092
|
n += 4 + e + r.bitData.length;
|
|
1093
1093
|
}
|
|
1094
1094
|
return n;
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function St(e) {
|
|
1097
1097
|
e = encodeURI(e);
|
|
1098
1098
|
let t = [];
|
|
1099
1099
|
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));
|
|
1100
1100
|
return t;
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1103
|
-
if (e <
|
|
1102
|
+
function Ct(e) {
|
|
1103
|
+
if (e < nt || e > rt) throw RangeError("Version number out of range");
|
|
1104
1104
|
let t = (16 * e + 128) * e + 64;
|
|
1105
1105
|
if (e >= 2) {
|
|
1106
1106
|
let n = Math.floor(e / 7) + 2;
|
|
@@ -1108,40 +1108,40 @@ function St(e) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
return t;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return Math.floor(
|
|
1111
|
+
function wt(e, t) {
|
|
1112
|
+
return Math.floor(Ct(e) / 8) - st[t[0]][e] * ct[t[0]][e];
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function Tt(e) {
|
|
1115
1115
|
if (e < 1 || e > 255) throw RangeError("Degree out of range");
|
|
1116
1116
|
let t = [];
|
|
1117
1117
|
for (let n = 0; n < e - 1; n++) t.push(0);
|
|
1118
1118
|
t.push(1);
|
|
1119
1119
|
let n = 1;
|
|
1120
1120
|
for (let r = 0; r < e; r++) {
|
|
1121
|
-
for (let e = 0; e < t.length; e++) t[e] =
|
|
1122
|
-
n =
|
|
1121
|
+
for (let e = 0; e < t.length; e++) t[e] = Dt(t[e], n), e + 1 < t.length && (t[e] ^= t[e + 1]);
|
|
1122
|
+
n = Dt(n, 2);
|
|
1123
1123
|
}
|
|
1124
1124
|
return t;
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Et(e, t) {
|
|
1127
1127
|
let n = t.map((e) => 0);
|
|
1128
1128
|
for (let r of e) {
|
|
1129
1129
|
let e = r ^ n.shift();
|
|
1130
|
-
n.push(0), t.forEach((t, r) => n[r] ^=
|
|
1130
|
+
n.push(0), t.forEach((t, r) => n[r] ^= Dt(t, e));
|
|
1131
1131
|
}
|
|
1132
1132
|
return n;
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1134
|
+
function Dt(e, t) {
|
|
1135
1135
|
if (e >>> 8 || t >>> 8) throw RangeError("Byte out of range");
|
|
1136
1136
|
let n = 0;
|
|
1137
1137
|
for (let r = 7; r >= 0; r--) n = n << 1 ^ (n >>> 7) * 285, n ^= (t >>> r & 1) * e;
|
|
1138
1138
|
return n;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
if (!(
|
|
1140
|
+
function Ot(e, t, n = 1, r = 40, i = -1, a = !0) {
|
|
1141
|
+
if (!(nt <= n && n <= r && r <= rt) || i < -1 || i > 7) throw RangeError("Invalid value");
|
|
1142
1142
|
let o, s;
|
|
1143
1143
|
for (o = n;; o++) {
|
|
1144
|
-
let n =
|
|
1144
|
+
let n = wt(o, t) * 8, i = xt(e, o);
|
|
1145
1145
|
if (i <= n) {
|
|
1146
1146
|
s = i;
|
|
1147
1147
|
break;
|
|
@@ -1149,25 +1149,25 @@ function Dt(e, t, n = 1, r = 40, i = -1, a = !0) {
|
|
|
1149
1149
|
if (o >= r) throw RangeError("Data too long");
|
|
1150
1150
|
}
|
|
1151
1151
|
for (let e of [
|
|
1152
|
-
Je,
|
|
1153
1152
|
Ye,
|
|
1154
|
-
Xe
|
|
1155
|
-
|
|
1153
|
+
Xe,
|
|
1154
|
+
Ze
|
|
1155
|
+
]) a && s <= wt(o, e) * 8 && (t = e);
|
|
1156
1156
|
let c = [];
|
|
1157
1157
|
for (let t of e) {
|
|
1158
|
-
|
|
1158
|
+
Z(t.mode[0], 4, c), Z(t.numChars, mt(t.mode, o), c);
|
|
1159
1159
|
for (let e of t.getData()) c.push(e);
|
|
1160
1160
|
}
|
|
1161
|
-
let l =
|
|
1162
|
-
|
|
1163
|
-
for (let e = 236; c.length < l; e ^= 253)
|
|
1161
|
+
let l = wt(o, t) * 8;
|
|
1162
|
+
Z(0, Math.min(4, l - c.length), c), Z(0, (8 - c.length % 8) % 8, c);
|
|
1163
|
+
for (let e = 236; c.length < l; e ^= 253) Z(e, 8, c);
|
|
1164
1164
|
let u = Array.from({ length: Math.ceil(c.length / 8) }, () => 0);
|
|
1165
|
-
return c.forEach((e, t) => u[t >>> 3] |= e << 7 - (t & 7)), new
|
|
1165
|
+
return c.forEach((e, t) => u[t >>> 3] |= e << 7 - (t & 7)), new lt(o, t, u, i);
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1168
|
-
let { ecc: n = "L", boostEcc: r = !1, minVersion: i = 1, maxVersion: a = 40, maskPattern: o = -1, border: s = 1 } = t || {}, c = typeof e == "string" ?
|
|
1167
|
+
function kt(e, t) {
|
|
1168
|
+
let { ecc: n = "L", boostEcc: r = !1, minVersion: i = 1, maxVersion: a = 40, maskPattern: o = -1, border: s = 1 } = t || {}, c = typeof e == "string" ? vt(e) : Array.isArray(e) ? [ht(e)] : void 0;
|
|
1169
1169
|
if (!c) throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);
|
|
1170
|
-
let l =
|
|
1170
|
+
let l = Ot(c, Qe[n], i, a, o, r), u = At({
|
|
1171
1171
|
version: l.version,
|
|
1172
1172
|
maskPattern: l.mask,
|
|
1173
1173
|
size: l.size,
|
|
@@ -1176,35 +1176,35 @@ function Ot(e, t) {
|
|
|
1176
1176
|
}, s);
|
|
1177
1177
|
return t?.invert && (u.data = u.data.map((e) => e.map((e) => !e))), t?.onEncoded?.(u), u;
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function At(e, t = 1) {
|
|
1180
1180
|
if (!t) return e;
|
|
1181
1181
|
let { size: n } = e, r = n + t * 2;
|
|
1182
1182
|
e.size = r, e.data.forEach((e) => {
|
|
1183
1183
|
for (let n = 0; n < t; n++) e.unshift(!1), e.push(!1);
|
|
1184
1184
|
});
|
|
1185
1185
|
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));
|
|
1186
|
-
let i =
|
|
1186
|
+
let i = Y.Border;
|
|
1187
1187
|
e.types.forEach((e) => {
|
|
1188
1188
|
for (let n = 0; n < t; n++) e.unshift(i), e.push(i);
|
|
1189
1189
|
});
|
|
1190
1190
|
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));
|
|
1191
1191
|
return e;
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function jt(e) {
|
|
1194
1194
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1197
|
-
let n =
|
|
1196
|
+
function Mt(e, t = {}) {
|
|
1197
|
+
let n = kt(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 = [];
|
|
1198
1198
|
for (let e = 0; e < n.size; e++) for (let t = 0; t < n.size; t++) {
|
|
1199
1199
|
let i = t * r, a = e * r;
|
|
1200
1200
|
n.data[e][t] && l.push(`M${i},${a}h${r}v${r}h-${r}z`);
|
|
1201
1201
|
}
|
|
1202
|
-
return c += `<rect fill="${
|
|
1202
|
+
return c += `<rect fill="${jt(i)}" width="${s}" height="${o}"/>`, c += `<path fill="${jt(a)}" d="${l.join("")}"/>`, c += "</svg>", c;
|
|
1203
1203
|
}
|
|
1204
1204
|
// src/element/ui/qr.ts
|
|
1205
|
-
function
|
|
1205
|
+
function Nt(e) {
|
|
1206
1206
|
if (e) try {
|
|
1207
|
-
return
|
|
1207
|
+
return Mt(e, {
|
|
1208
1208
|
border: 2,
|
|
1209
1209
|
ecc: "H"
|
|
1210
1210
|
});
|
|
@@ -1213,9 +1213,9 @@ function Mt(e) {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
// src/element/ui/wallet-connect-panel.tsx
|
|
1216
|
-
function
|
|
1217
|
-
let [d, f] =
|
|
1218
|
-
|
|
1216
|
+
function Pt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a, error: o, onRemote: c, onConnect: u }) {
|
|
1217
|
+
let [d, f] = H(!1), p = qe(), [m, h] = H(""), [g, _] = H(0);
|
|
1218
|
+
U(() => {
|
|
1219
1219
|
if (!c) return;
|
|
1220
1220
|
let e = !0;
|
|
1221
1221
|
return h(""), c((t) => {
|
|
@@ -1224,7 +1224,7 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1224
1224
|
e = !1;
|
|
1225
1225
|
};
|
|
1226
1226
|
}, [e, g]);
|
|
1227
|
-
let v = window.location.href, y = s(e, v), [b, x] =
|
|
1227
|
+
let v = window.location.href, y = s(e, v), [b, x] = H(y || c ? "wallet" : "camera"), S = p ? "" : Nt(b === "wallet" && y ? y : v), C = p || !m ? "" : Nt(m), w = m ? l(e, m) : void 0;
|
|
1228
1228
|
async function T() {
|
|
1229
1229
|
try {
|
|
1230
1230
|
await navigator.clipboard.writeText(m), f(!0), window.setTimeout(() => f(!1), 1600);
|
|
@@ -1239,21 +1239,21 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1239
1239
|
window.prompt("Copy this payment link", v);
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
|
-
return r ? /* @__PURE__ */
|
|
1242
|
+
return r ? /* @__PURE__ */ q("div", {
|
|
1243
1243
|
class: "connect-panel connect-status",
|
|
1244
1244
|
children: [
|
|
1245
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ q("span", {
|
|
1246
1246
|
class: "connect-status-mark",
|
|
1247
|
-
children: [/* @__PURE__ */ J
|
|
1247
|
+
children: [/* @__PURE__ */ q(J, {
|
|
1248
1248
|
id: e,
|
|
1249
1249
|
name: t,
|
|
1250
1250
|
icon: n,
|
|
1251
1251
|
size: "lg"
|
|
1252
|
-
}), a ? /* @__PURE__ */
|
|
1252
|
+
}), a ? /* @__PURE__ */ q("svg", {
|
|
1253
1253
|
class: "connect-spinner",
|
|
1254
1254
|
viewBox: "0 0 100 100",
|
|
1255
1255
|
"aria-hidden": "true",
|
|
1256
|
-
children: /* @__PURE__ */
|
|
1256
|
+
children: /* @__PURE__ */ q("circle", {
|
|
1257
1257
|
cx: "50",
|
|
1258
1258
|
cy: "50",
|
|
1259
1259
|
r: "46",
|
|
@@ -1265,19 +1265,19 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1265
1265
|
})
|
|
1266
1266
|
}) : null]
|
|
1267
1267
|
}),
|
|
1268
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ q("p", {
|
|
1269
1269
|
class: `connect-status-title${o ? " is-error" : ""}`,
|
|
1270
1270
|
children: o ? "Connection declined" : `Continue in ${t}`
|
|
1271
1271
|
}),
|
|
1272
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ q("p", {
|
|
1273
1273
|
class: "connect-status-note",
|
|
1274
1274
|
children: o || `Accept the connection request in ${t}.`
|
|
1275
1275
|
}),
|
|
1276
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ q("button", {
|
|
1277
1277
|
type: "button",
|
|
1278
1278
|
class: "secondary connect-retry",
|
|
1279
1279
|
onClick: () => u(r),
|
|
1280
|
-
children: [/* @__PURE__ */
|
|
1280
|
+
children: [/* @__PURE__ */ q("svg", {
|
|
1281
1281
|
class: "connect-retry-icon",
|
|
1282
1282
|
viewBox: "0 0 24 24",
|
|
1283
1283
|
fill: "none",
|
|
@@ -1286,41 +1286,41 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1286
1286
|
"stroke-linecap": "round",
|
|
1287
1287
|
"stroke-linejoin": "round",
|
|
1288
1288
|
"aria-hidden": "true",
|
|
1289
|
-
children: [/* @__PURE__ */
|
|
1289
|
+
children: [/* @__PURE__ */ q("path", { d: "M21 12a9 9 0 1 1-2.64-6.36" }), /* @__PURE__ */ q("path", { d: "M21 3v6h-6" })]
|
|
1290
1290
|
}), "Try again"]
|
|
1291
1291
|
})
|
|
1292
1292
|
]
|
|
1293
|
-
}) : c ? /* @__PURE__ */
|
|
1293
|
+
}) : c ? /* @__PURE__ */ q("div", {
|
|
1294
1294
|
class: `connect-panel${p ? " connect-handoff" : ""}`,
|
|
1295
|
-
children: [p ? /* @__PURE__ */
|
|
1295
|
+
children: [p ? /* @__PURE__ */ q(j, { children: [o ? /* @__PURE__ */ q("button", {
|
|
1296
1296
|
type: "button",
|
|
1297
1297
|
class: "secondary connect-retry",
|
|
1298
1298
|
onClick: () => _((e) => e + 1),
|
|
1299
1299
|
children: "Try again"
|
|
1300
|
-
}) : w ? /* @__PURE__ */
|
|
1300
|
+
}) : w ? /* @__PURE__ */ q("a", {
|
|
1301
1301
|
class: "primary connect-open",
|
|
1302
1302
|
href: w,
|
|
1303
1303
|
children: ["Open in ", t]
|
|
1304
|
-
}) : m ? /* @__PURE__ */
|
|
1304
|
+
}) : m ? /* @__PURE__ */ q("button", {
|
|
1305
1305
|
type: "button",
|
|
1306
1306
|
class: "secondary connect-copy",
|
|
1307
1307
|
onClick: T,
|
|
1308
1308
|
children: d ? "Copied" : "Copy connection code"
|
|
1309
|
-
}) : null, /* @__PURE__ */
|
|
1309
|
+
}) : null, /* @__PURE__ */ q("p", {
|
|
1310
1310
|
class: "qr-caption",
|
|
1311
1311
|
children: o || (m ? w ? `Approve the connection in ${t}, then come back here.` : `Copy this code and paste it into ${t} to connect.` : "Preparing a connection…")
|
|
1312
|
-
})] }) : /* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */
|
|
1312
|
+
})] }) : /* @__PURE__ */ q(j, { children: [
|
|
1313
|
+
/* @__PURE__ */ q("div", {
|
|
1314
1314
|
class: "portal-tabs qr-tabs",
|
|
1315
1315
|
role: "tablist",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1316
|
+
children: [/* @__PURE__ */ q("button", {
|
|
1317
1317
|
type: "button",
|
|
1318
1318
|
role: "tab",
|
|
1319
1319
|
"aria-selected": b === "wallet",
|
|
1320
1320
|
class: `portal-tab${b === "wallet" ? " is-active" : ""}`,
|
|
1321
1321
|
onClick: () => x("wallet"),
|
|
1322
1322
|
children: "Wallet app"
|
|
1323
|
-
}), /* @__PURE__ */
|
|
1323
|
+
}), /* @__PURE__ */ q("button", {
|
|
1324
1324
|
type: "button",
|
|
1325
1325
|
role: "tab",
|
|
1326
1326
|
"aria-selected": b === "camera",
|
|
@@ -1329,27 +1329,27 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1329
1329
|
children: "Phone camera"
|
|
1330
1330
|
})]
|
|
1331
1331
|
}),
|
|
1332
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ q("div", {
|
|
1333
1333
|
class: "qr-frame",
|
|
1334
|
-
children: [b === "camera" ? S ? /* @__PURE__ */
|
|
1334
|
+
children: [b === "camera" ? S ? /* @__PURE__ */ q("div", {
|
|
1335
1335
|
class: "qr",
|
|
1336
1336
|
dangerouslySetInnerHTML: { __html: S }
|
|
1337
|
-
}) : /* @__PURE__ */
|
|
1337
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1338
1338
|
class: "qr qr-fallback",
|
|
1339
|
-
children: /* @__PURE__ */
|
|
1340
|
-
}) : C ? /* @__PURE__ */
|
|
1339
|
+
children: /* @__PURE__ */ q("code", { children: v })
|
|
1340
|
+
}) : C ? /* @__PURE__ */ q("div", {
|
|
1341
1341
|
class: "qr",
|
|
1342
1342
|
dangerouslySetInnerHTML: { __html: C }
|
|
1343
|
-
}) : o ? /* @__PURE__ */
|
|
1343
|
+
}) : o ? /* @__PURE__ */ q("div", {
|
|
1344
1344
|
class: "qr qr-fallback",
|
|
1345
|
-
children: /* @__PURE__ */
|
|
1346
|
-
}) : /* @__PURE__ */
|
|
1345
|
+
children: /* @__PURE__ */ q("code", { children: "Connection failed" })
|
|
1346
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1347
1347
|
class: "qr",
|
|
1348
|
-
children: /* @__PURE__ */
|
|
1348
|
+
children: /* @__PURE__ */ q("svg", {
|
|
1349
1349
|
class: "qr-spinner",
|
|
1350
1350
|
viewBox: "0 0 100 100",
|
|
1351
1351
|
"aria-hidden": "true",
|
|
1352
|
-
children: /* @__PURE__ */
|
|
1352
|
+
children: /* @__PURE__ */ q("circle", {
|
|
1353
1353
|
cx: "50",
|
|
1354
1354
|
cy: "50",
|
|
1355
1355
|
r: "46",
|
|
@@ -1360,9 +1360,9 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1360
1360
|
"stroke-dasharray": "72 217"
|
|
1361
1361
|
})
|
|
1362
1362
|
})
|
|
1363
|
-
}), b === "wallet" && (C || o) ? /* @__PURE__ */
|
|
1363
|
+
}), b === "wallet" && (C || o) ? /* @__PURE__ */ q("span", {
|
|
1364
1364
|
class: "qr-badge",
|
|
1365
|
-
children: /* @__PURE__ */ J
|
|
1365
|
+
children: /* @__PURE__ */ q(J, {
|
|
1366
1366
|
id: e,
|
|
1367
1367
|
name: t,
|
|
1368
1368
|
icon: n,
|
|
@@ -1370,33 +1370,33 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1370
1370
|
})
|
|
1371
1371
|
}) : null]
|
|
1372
1372
|
}),
|
|
1373
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ q("p", {
|
|
1374
1374
|
class: "qr-caption",
|
|
1375
1375
|
children: b === "camera" ? "Scan with your phone’s camera to open this checkout on your phone" : o || (m ? `Scan this from inside ${t} to connect` : "Preparing a connection…")
|
|
1376
1376
|
}),
|
|
1377
|
-
b === "camera" ? /* @__PURE__ */
|
|
1377
|
+
b === "camera" ? /* @__PURE__ */ q("button", {
|
|
1378
1378
|
type: "button",
|
|
1379
1379
|
class: "link-button qr-copy",
|
|
1380
1380
|
onClick: E,
|
|
1381
1381
|
children: d ? "Copied" : "Copy link"
|
|
1382
|
-
}) : o ? /* @__PURE__ */
|
|
1382
|
+
}) : o ? /* @__PURE__ */ q("button", {
|
|
1383
1383
|
type: "button",
|
|
1384
1384
|
class: "link-button qr-copy",
|
|
1385
1385
|
onClick: () => _((e) => e + 1),
|
|
1386
1386
|
children: "Try again"
|
|
1387
|
-
}) : m ? /* @__PURE__ */
|
|
1387
|
+
}) : m ? /* @__PURE__ */ q("button", {
|
|
1388
1388
|
type: "button",
|
|
1389
1389
|
class: "link-button qr-copy",
|
|
1390
1390
|
onClick: T,
|
|
1391
1391
|
children: d ? "Copied" : "Copy to clipboard"
|
|
1392
1392
|
}) : null
|
|
1393
|
-
] }), /* @__PURE__ */
|
|
1393
|
+
] }), /* @__PURE__ */ q("div", {
|
|
1394
1394
|
class: "install-row",
|
|
1395
|
-
children: [/* @__PURE__ */
|
|
1395
|
+
children: [/* @__PURE__ */ q("span", { children: [
|
|
1396
1396
|
"Don’t have ",
|
|
1397
1397
|
t,
|
|
1398
1398
|
"?"
|
|
1399
|
-
] }), i ? /* @__PURE__ */
|
|
1399
|
+
] }), i ? /* @__PURE__ */ q("a", {
|
|
1400
1400
|
class: "secondary",
|
|
1401
1401
|
href: i,
|
|
1402
1402
|
target: "_blank",
|
|
@@ -1404,27 +1404,27 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1404
1404
|
children: "Get"
|
|
1405
1405
|
}) : null]
|
|
1406
1406
|
})]
|
|
1407
|
-
}) : /* @__PURE__ */
|
|
1407
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1408
1408
|
class: `connect-panel${p ? " connect-handoff" : ""}`,
|
|
1409
|
-
children: [p ? /* @__PURE__ */
|
|
1409
|
+
children: [p ? /* @__PURE__ */ q(j, { children: [y ? /* @__PURE__ */ q("a", {
|
|
1410
1410
|
class: "primary connect-open",
|
|
1411
1411
|
href: y,
|
|
1412
1412
|
children: ["Open in ", t]
|
|
1413
|
-
}) : null, /* @__PURE__ */
|
|
1413
|
+
}) : null, /* @__PURE__ */ q("p", {
|
|
1414
1414
|
class: "qr-caption",
|
|
1415
1415
|
children: y ? `${t} opens with this checkout loaded.` : `Open ${t} and browse to this page to pay.`
|
|
1416
|
-
})] }) : /* @__PURE__ */
|
|
1417
|
-
y ? /* @__PURE__ */
|
|
1416
|
+
})] }) : /* @__PURE__ */ q(j, { children: [
|
|
1417
|
+
y ? /* @__PURE__ */ q("div", {
|
|
1418
1418
|
class: "portal-tabs qr-tabs",
|
|
1419
1419
|
role: "tablist",
|
|
1420
|
-
children: [/* @__PURE__ */
|
|
1420
|
+
children: [/* @__PURE__ */ q("button", {
|
|
1421
1421
|
type: "button",
|
|
1422
1422
|
role: "tab",
|
|
1423
1423
|
"aria-selected": b === "wallet",
|
|
1424
1424
|
class: `portal-tab${b === "wallet" ? " is-active" : ""}`,
|
|
1425
1425
|
onClick: () => x("wallet"),
|
|
1426
1426
|
children: "Wallet app"
|
|
1427
|
-
}), /* @__PURE__ */
|
|
1427
|
+
}), /* @__PURE__ */ q("button", {
|
|
1428
1428
|
type: "button",
|
|
1429
1429
|
role: "tab",
|
|
1430
1430
|
"aria-selected": b === "camera",
|
|
@@ -1433,17 +1433,17 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1433
1433
|
children: "Phone camera"
|
|
1434
1434
|
})]
|
|
1435
1435
|
}) : null,
|
|
1436
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ q("div", {
|
|
1437
1437
|
class: "qr-frame",
|
|
1438
|
-
children: [S ? /* @__PURE__ */
|
|
1438
|
+
children: [S ? /* @__PURE__ */ q("div", {
|
|
1439
1439
|
class: "qr",
|
|
1440
1440
|
dangerouslySetInnerHTML: { __html: S }
|
|
1441
|
-
}) : /* @__PURE__ */
|
|
1441
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1442
1442
|
class: "qr qr-fallback",
|
|
1443
|
-
children: /* @__PURE__ */
|
|
1444
|
-
}), b === "wallet" && y ? /* @__PURE__ */
|
|
1443
|
+
children: /* @__PURE__ */ q("code", { children: v })
|
|
1444
|
+
}), b === "wallet" && y ? /* @__PURE__ */ q("span", {
|
|
1445
1445
|
class: "qr-badge",
|
|
1446
|
-
children: /* @__PURE__ */ J
|
|
1446
|
+
children: /* @__PURE__ */ q(J, {
|
|
1447
1447
|
id: e,
|
|
1448
1448
|
name: t,
|
|
1449
1449
|
icon: n,
|
|
@@ -1451,23 +1451,23 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1451
1451
|
})
|
|
1452
1452
|
}) : null]
|
|
1453
1453
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ q("p", {
|
|
1455
1455
|
class: "qr-caption",
|
|
1456
1456
|
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"
|
|
1457
1457
|
}),
|
|
1458
|
-
b === "camera" ? /* @__PURE__ */
|
|
1458
|
+
b === "camera" ? /* @__PURE__ */ q("button", {
|
|
1459
1459
|
type: "button",
|
|
1460
1460
|
class: "link-button qr-copy",
|
|
1461
1461
|
onClick: E,
|
|
1462
1462
|
children: d ? "Copied" : "Copy link"
|
|
1463
1463
|
}) : null
|
|
1464
|
-
] }), /* @__PURE__ */
|
|
1464
|
+
] }), /* @__PURE__ */ q("div", {
|
|
1465
1465
|
class: "install-row",
|
|
1466
|
-
children: [/* @__PURE__ */
|
|
1466
|
+
children: [/* @__PURE__ */ q("span", { children: [
|
|
1467
1467
|
"Don’t have ",
|
|
1468
1468
|
t,
|
|
1469
1469
|
"?"
|
|
1470
|
-
] }), i ? /* @__PURE__ */
|
|
1470
|
+
] }), i ? /* @__PURE__ */ q("a", {
|
|
1471
1471
|
class: "secondary",
|
|
1472
1472
|
href: i,
|
|
1473
1473
|
target: "_blank",
|
|
@@ -1478,13 +1478,13 @@ function Nt({ id: e, name: t, icon: n, detected: r, installUrl: i, connecting: a
|
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
1480
1480
|
// src/element/ui/wallet-dialog.tsx
|
|
1481
|
-
var
|
|
1482
|
-
function
|
|
1483
|
-
let u =
|
|
1484
|
-
|
|
1481
|
+
var Ft = 5;
|
|
1482
|
+
function It({ open: e, wallets: t, registry: n = [], connecting: r, connected: i, error: a, initialWalletId: o, remotePairing: s, onSelect: c, onClose: l }) {
|
|
1483
|
+
let u = W(null), [d, f] = H(""), [p, m] = H(), [h, g] = H(!1);
|
|
1484
|
+
U(() => {
|
|
1485
1485
|
let t = u.current;
|
|
1486
1486
|
t && (e && !t.open ? (t.showModal(), f(""), m(o ? _.find((e) => e.id === o) : void 0), g(!1)) : !e && t.open && t.close());
|
|
1487
|
-
}, [e, o]),
|
|
1487
|
+
}, [e, o]), U(() => {
|
|
1488
1488
|
if (!e) return;
|
|
1489
1489
|
let t = document.documentElement, n = {
|
|
1490
1490
|
overflow: t.style.overflow,
|
|
@@ -1493,13 +1493,13 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1493
1493
|
return t.style.overflow = "hidden", r > 0 && (t.style.paddingRight = `${r}px`), () => {
|
|
1494
1494
|
t.style.overflow = n.overflow, t.style.paddingRight = n.padding;
|
|
1495
1495
|
};
|
|
1496
|
-
}, [e]),
|
|
1496
|
+
}, [e]), U(() => {
|
|
1497
1497
|
let e = u.current;
|
|
1498
1498
|
if (!e) return;
|
|
1499
1499
|
let t = () => l();
|
|
1500
1500
|
return e.addEventListener("close", t), () => e.removeEventListener("close", t);
|
|
1501
1501
|
}, [l]);
|
|
1502
|
-
let _ =
|
|
1502
|
+
let _ = G(() => {
|
|
1503
1503
|
let e = new Map(t.map((e) => [e.id, e])), r = n.map((t) => {
|
|
1504
1504
|
let n = e.get(t.id);
|
|
1505
1505
|
return {
|
|
@@ -1517,31 +1517,31 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1517
1517
|
detected: e
|
|
1518
1518
|
});
|
|
1519
1519
|
return r.sort((e, t) => Number(!!t.detected) - Number(!!e.detected));
|
|
1520
|
-
}, [t, n]), v =
|
|
1521
|
-
|
|
1520
|
+
}, [t, n]), v = qe();
|
|
1521
|
+
U(() => {
|
|
1522
1522
|
i && l();
|
|
1523
1523
|
}, [i, l]);
|
|
1524
|
-
let y =
|
|
1524
|
+
let y = G(() => {
|
|
1525
1525
|
let e = d.trim().toLowerCase();
|
|
1526
1526
|
return e ? _.filter((t) => t.name.toLowerCase().includes(e)) : _;
|
|
1527
|
-
}, [_, d]), b =
|
|
1527
|
+
}, [_, d]), b = G(() => h ? y : _.slice(0, Ft), [
|
|
1528
1528
|
h,
|
|
1529
1529
|
y,
|
|
1530
1530
|
_
|
|
1531
1531
|
]);
|
|
1532
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ q("dialog", {
|
|
1533
1533
|
ref: u,
|
|
1534
1534
|
class: "wallet-dialog",
|
|
1535
1535
|
"aria-label": "All wallets",
|
|
1536
1536
|
onClick: (e) => {
|
|
1537
1537
|
e.target === u.current && l();
|
|
1538
1538
|
},
|
|
1539
|
-
children: /* @__PURE__ */
|
|
1539
|
+
children: /* @__PURE__ */ q("div", {
|
|
1540
1540
|
class: "wallet-dialog-body",
|
|
1541
|
-
children: [/* @__PURE__ */
|
|
1541
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1542
1542
|
class: "wallet-dialog-head",
|
|
1543
1543
|
children: [
|
|
1544
|
-
p || h ? /* @__PURE__ */
|
|
1544
|
+
p || h ? /* @__PURE__ */ q("button", {
|
|
1545
1545
|
type: "button",
|
|
1546
1546
|
class: "icon-button",
|
|
1547
1547
|
"aria-label": "Back",
|
|
@@ -1549,9 +1549,9 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1549
1549
|
p ? m(void 0) : (g(!1), f(""));
|
|
1550
1550
|
},
|
|
1551
1551
|
children: "‹"
|
|
1552
|
-
}) : /* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1552
|
+
}) : /* @__PURE__ */ q("span", { class: "icon-button-spacer" }),
|
|
1553
|
+
/* @__PURE__ */ q("h2", { children: p ? p.name : h ? "All wallets" : "Connect wallet" }),
|
|
1554
|
+
/* @__PURE__ */ q("button", {
|
|
1555
1555
|
type: "button",
|
|
1556
1556
|
class: "icon-button",
|
|
1557
1557
|
"aria-label": "Close",
|
|
@@ -1559,7 +1559,7 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1559
1559
|
children: "×"
|
|
1560
1560
|
})
|
|
1561
1561
|
]
|
|
1562
|
-
}), p ? /* @__PURE__ */
|
|
1562
|
+
}), p ? /* @__PURE__ */ q(Pt, {
|
|
1563
1563
|
id: p.id,
|
|
1564
1564
|
name: p.name,
|
|
1565
1565
|
icon: p.icon,
|
|
@@ -1569,8 +1569,8 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1569
1569
|
error: a,
|
|
1570
1570
|
onRemote: p.detected ? void 0 : s?.(p.id),
|
|
1571
1571
|
onConnect: c
|
|
1572
|
-
}) : /* @__PURE__ */
|
|
1573
|
-
h ? /* @__PURE__ */
|
|
1572
|
+
}) : /* @__PURE__ */ q(j, { children: [
|
|
1573
|
+
h ? /* @__PURE__ */ q("input", {
|
|
1574
1574
|
type: "search",
|
|
1575
1575
|
class: "wallet-search",
|
|
1576
1576
|
placeholder: "Search wallet",
|
|
@@ -1578,9 +1578,9 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1578
1578
|
value: d,
|
|
1579
1579
|
onInput: (e) => f(e.target.value)
|
|
1580
1580
|
}) : null,
|
|
1581
|
-
h ? /* @__PURE__ */
|
|
1581
|
+
h ? /* @__PURE__ */ q("div", {
|
|
1582
1582
|
class: "wallet-grid",
|
|
1583
|
-
children: b.map((e) => /* @__PURE__ */
|
|
1583
|
+
children: b.map((e) => /* @__PURE__ */ q("button", {
|
|
1584
1584
|
type: "button",
|
|
1585
1585
|
class: "wallet-tile",
|
|
1586
1586
|
"aria-label": e.detected ? `${e.name}, installed` : e.name,
|
|
@@ -1588,58 +1588,58 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1588
1588
|
m(e), e.detected && c(e.detected);
|
|
1589
1589
|
},
|
|
1590
1590
|
children: [
|
|
1591
|
-
/* @__PURE__ */ J
|
|
1591
|
+
/* @__PURE__ */ q(J, {
|
|
1592
1592
|
id: e.id,
|
|
1593
1593
|
name: e.name,
|
|
1594
1594
|
icon: e.icon,
|
|
1595
1595
|
size: "lg"
|
|
1596
1596
|
}),
|
|
1597
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ q("span", {
|
|
1598
1598
|
class: "wallet-tile-name",
|
|
1599
1599
|
children: e.name
|
|
1600
1600
|
}),
|
|
1601
|
-
e.detected ? /* @__PURE__ */
|
|
1601
|
+
e.detected ? /* @__PURE__ */ q("span", {
|
|
1602
1602
|
class: "wallet-tile-badge",
|
|
1603
1603
|
"aria-hidden": "true",
|
|
1604
|
-
children: /* @__PURE__ */
|
|
1604
|
+
children: /* @__PURE__ */ q("svg", {
|
|
1605
1605
|
viewBox: "0 0 24 24",
|
|
1606
1606
|
fill: "none",
|
|
1607
1607
|
stroke: "currentColor",
|
|
1608
1608
|
"stroke-width": "3",
|
|
1609
1609
|
"stroke-linecap": "round",
|
|
1610
1610
|
"stroke-linejoin": "round",
|
|
1611
|
-
children: /* @__PURE__ */
|
|
1611
|
+
children: /* @__PURE__ */ q("path", { d: "m5 13 4 4L19 7" })
|
|
1612
1612
|
})
|
|
1613
1613
|
}) : null
|
|
1614
1614
|
]
|
|
1615
1615
|
}, e.id))
|
|
1616
|
-
}) : /* @__PURE__ */
|
|
1616
|
+
}) : /* @__PURE__ */ q("div", {
|
|
1617
1617
|
class: "wallet-list",
|
|
1618
|
-
children: b.map((e) => /* @__PURE__ */
|
|
1618
|
+
children: b.map((e) => /* @__PURE__ */ q("button", {
|
|
1619
1619
|
type: "button",
|
|
1620
1620
|
class: "wallet-row",
|
|
1621
1621
|
onClick: () => {
|
|
1622
1622
|
m(e), e.detected && c(e.detected);
|
|
1623
1623
|
},
|
|
1624
1624
|
children: [
|
|
1625
|
-
/* @__PURE__ */ J
|
|
1625
|
+
/* @__PURE__ */ q(J, {
|
|
1626
1626
|
id: e.id,
|
|
1627
1627
|
name: e.name,
|
|
1628
1628
|
icon: e.icon,
|
|
1629
1629
|
size: "lg"
|
|
1630
1630
|
}),
|
|
1631
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ q("span", {
|
|
1632
1632
|
class: "wallet-row-name",
|
|
1633
1633
|
children: e.name
|
|
1634
1634
|
}),
|
|
1635
|
-
e.detected ? /* @__PURE__ */
|
|
1635
|
+
e.detected ? /* @__PURE__ */ q("span", {
|
|
1636
1636
|
class: "wallet-row-tag is-installed",
|
|
1637
1637
|
children: "Installed"
|
|
1638
|
-
}) : v ? /* @__PURE__ */
|
|
1638
|
+
}) : v ? /* @__PURE__ */ q("span", {
|
|
1639
1639
|
class: "wallet-row-tag is-muted",
|
|
1640
1640
|
children: "Get"
|
|
1641
1641
|
}) : null,
|
|
1642
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ q("span", {
|
|
1643
1643
|
class: "wallet-row-chevron",
|
|
1644
1644
|
"aria-hidden": "true",
|
|
1645
1645
|
children: "›"
|
|
@@ -1647,43 +1647,43 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1647
1647
|
]
|
|
1648
1648
|
}, e.id))
|
|
1649
1649
|
}),
|
|
1650
|
-
!h && _.length >
|
|
1650
|
+
!h && _.length > Ft ? /* @__PURE__ */ q("button", {
|
|
1651
1651
|
type: "button",
|
|
1652
1652
|
class: "wallet-row wallet-search-row",
|
|
1653
1653
|
onClick: () => g(!0),
|
|
1654
1654
|
children: [
|
|
1655
|
-
/* @__PURE__ */
|
|
1655
|
+
/* @__PURE__ */ q("span", {
|
|
1656
1656
|
class: "wallet-search-icon",
|
|
1657
1657
|
"aria-hidden": "true",
|
|
1658
|
-
children: /* @__PURE__ */
|
|
1658
|
+
children: /* @__PURE__ */ q("svg", {
|
|
1659
1659
|
viewBox: "0 0 24 24",
|
|
1660
1660
|
fill: "none",
|
|
1661
1661
|
stroke: "currentColor",
|
|
1662
1662
|
"stroke-width": "2",
|
|
1663
1663
|
"stroke-linecap": "round",
|
|
1664
|
-
children: [/* @__PURE__ */
|
|
1664
|
+
children: [/* @__PURE__ */ q("circle", {
|
|
1665
1665
|
cx: "11",
|
|
1666
1666
|
cy: "11",
|
|
1667
1667
|
r: "7"
|
|
1668
|
-
}), /* @__PURE__ */
|
|
1668
|
+
}), /* @__PURE__ */ q("path", { d: "m20 20-3.5-3.5" })]
|
|
1669
1669
|
})
|
|
1670
1670
|
}),
|
|
1671
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ q("span", {
|
|
1672
1672
|
class: "wallet-row-name",
|
|
1673
1673
|
children: "Search wallet"
|
|
1674
1674
|
}),
|
|
1675
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ q("span", {
|
|
1676
1676
|
class: "wallet-row-count",
|
|
1677
1677
|
children: _.length
|
|
1678
1678
|
}),
|
|
1679
|
-
/* @__PURE__ */
|
|
1679
|
+
/* @__PURE__ */ q("span", {
|
|
1680
1680
|
class: "wallet-row-chevron",
|
|
1681
1681
|
"aria-hidden": "true",
|
|
1682
1682
|
children: "›"
|
|
1683
1683
|
})
|
|
1684
1684
|
]
|
|
1685
1685
|
}) : null,
|
|
1686
|
-
h && b.length === 0 ? /* @__PURE__ */
|
|
1686
|
+
h && b.length === 0 ? /* @__PURE__ */ q("p", {
|
|
1687
1687
|
class: "muted wallet-empty",
|
|
1688
1688
|
children: [
|
|
1689
1689
|
"No wallet matches “",
|
|
@@ -1696,63 +1696,63 @@ function Ft({ open: e, wallets: t, registry: n = [], connecting: r, connected: i
|
|
|
1696
1696
|
});
|
|
1697
1697
|
}
|
|
1698
1698
|
// src/element/ui/wallet-list.tsx
|
|
1699
|
-
var
|
|
1700
|
-
function
|
|
1701
|
-
let s =
|
|
1699
|
+
var Lt = 3, Rt = ["metamask", "coinbase"], zt = 2;
|
|
1700
|
+
function Bt({ wallets: e, registry: t = [], connecting: n, connected: r, error: i, remotePairing: a, onSelect: o }) {
|
|
1701
|
+
let s = Ke(), [c, l] = H(!1), [u, d] = H(), f = e.slice(0, Lt), p = e.length > f.length || t.length > f.length, m = e.length === 0 ? [...Rt.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, zt) : [], h = new Set(f.map((e) => e.id)), g = t.filter((e) => !h.has(e.id)).map((e) => ({
|
|
1702
1702
|
id: e.id,
|
|
1703
1703
|
src: s(e.id)
|
|
1704
1704
|
})).filter((e) => e.src).slice(0, 3);
|
|
1705
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ q("div", {
|
|
1706
1706
|
class: "wallets",
|
|
1707
1707
|
children: [
|
|
1708
|
-
f.map((e) => /* @__PURE__ */
|
|
1708
|
+
f.map((e) => /* @__PURE__ */ q("button", {
|
|
1709
1709
|
type: "button",
|
|
1710
1710
|
class: "wallet",
|
|
1711
1711
|
onClick: () => o(e),
|
|
1712
1712
|
children: [
|
|
1713
|
-
/* @__PURE__ */ J
|
|
1713
|
+
/* @__PURE__ */ q(J, {
|
|
1714
1714
|
id: e.id,
|
|
1715
1715
|
name: e.name,
|
|
1716
1716
|
icon: e.icon
|
|
1717
1717
|
}),
|
|
1718
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ q("span", {
|
|
1719
1719
|
class: "wallet-name",
|
|
1720
1720
|
children: e.name
|
|
1721
1721
|
}),
|
|
1722
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ q("span", {
|
|
1723
1723
|
class: "wallet-tag",
|
|
1724
1724
|
children: "Detected"
|
|
1725
1725
|
})
|
|
1726
1726
|
]
|
|
1727
1727
|
}, e.id)),
|
|
1728
|
-
m.map((e) => /* @__PURE__ */
|
|
1728
|
+
m.map((e) => /* @__PURE__ */ q("button", {
|
|
1729
1729
|
type: "button",
|
|
1730
1730
|
class: "wallet",
|
|
1731
1731
|
onClick: () => {
|
|
1732
1732
|
d(e.id), l(!0);
|
|
1733
1733
|
},
|
|
1734
|
-
children: [/* @__PURE__ */ J
|
|
1734
|
+
children: [/* @__PURE__ */ q(J, {
|
|
1735
1735
|
id: e.id,
|
|
1736
1736
|
name: e.name
|
|
1737
|
-
}), /* @__PURE__ */
|
|
1737
|
+
}), /* @__PURE__ */ q("span", {
|
|
1738
1738
|
class: "wallet-name",
|
|
1739
1739
|
children: e.name
|
|
1740
1740
|
})]
|
|
1741
1741
|
}, e.id)),
|
|
1742
|
-
f.length === 0 && m.length === 0 && !p ? /* @__PURE__ */
|
|
1742
|
+
f.length === 0 && m.length === 0 && !p ? /* @__PURE__ */ q("p", {
|
|
1743
1743
|
class: "muted",
|
|
1744
1744
|
children: "Loading wallets…"
|
|
1745
1745
|
}) : null,
|
|
1746
|
-
p ? /* @__PURE__ */
|
|
1746
|
+
p ? /* @__PURE__ */ q("button", {
|
|
1747
1747
|
type: "button",
|
|
1748
1748
|
class: "wallet wallet-more-button",
|
|
1749
1749
|
onClick: () => {
|
|
1750
1750
|
d(void 0), l(!0);
|
|
1751
1751
|
},
|
|
1752
|
-
children: [g.length > 0 ? /* @__PURE__ */
|
|
1752
|
+
children: [g.length > 0 ? /* @__PURE__ */ q("span", {
|
|
1753
1753
|
class: "wallet-stack",
|
|
1754
1754
|
"aria-hidden": "true",
|
|
1755
|
-
children: g.map((e) => /* @__PURE__ */
|
|
1755
|
+
children: g.map((e) => /* @__PURE__ */ q("img", {
|
|
1756
1756
|
src: e.src,
|
|
1757
1757
|
alt: "",
|
|
1758
1758
|
width: 16,
|
|
@@ -1760,16 +1760,16 @@ function zt({ wallets: e, registry: t = [], connecting: n, connected: r, error:
|
|
|
1760
1760
|
loading: "lazy",
|
|
1761
1761
|
decoding: "async"
|
|
1762
1762
|
}, e.id))
|
|
1763
|
-
}) : /* @__PURE__ */
|
|
1763
|
+
}) : /* @__PURE__ */ q("span", {
|
|
1764
1764
|
class: "wallet-mark",
|
|
1765
1765
|
"aria-hidden": "true",
|
|
1766
1766
|
children: "···"
|
|
1767
|
-
}), /* @__PURE__ */
|
|
1767
|
+
}), /* @__PURE__ */ q("span", {
|
|
1768
1768
|
class: "wallet-name",
|
|
1769
1769
|
children: "Other wallets"
|
|
1770
1770
|
})]
|
|
1771
1771
|
}) : null,
|
|
1772
|
-
/* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ q(It, {
|
|
1773
1773
|
open: c,
|
|
1774
1774
|
wallets: e,
|
|
1775
1775
|
registry: t,
|
|
@@ -1785,13 +1785,13 @@ function zt({ wallets: e, registry: t = [], connecting: n, connected: r, error:
|
|
|
1785
1785
|
});
|
|
1786
1786
|
}
|
|
1787
1787
|
// src/element/ui/app.tsx
|
|
1788
|
-
var
|
|
1789
|
-
function
|
|
1790
|
-
let [t, n] =
|
|
1791
|
-
return
|
|
1788
|
+
var Vt = 1;
|
|
1789
|
+
function Ht(e) {
|
|
1790
|
+
let [t, n] = H(e.getState);
|
|
1791
|
+
return U(() => (n(e.getState()), e.subscribe(() => n(e.getState()))), [e]), t;
|
|
1792
1792
|
}
|
|
1793
|
-
function
|
|
1794
|
-
let o =
|
|
1793
|
+
function Ut({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose: a }) {
|
|
1794
|
+
let o = Ht(e), c = qe(), l = W(!1), [f, p] = H(), m = t.family ? [t.family] : ["evm", "svm"], h = G(() => {
|
|
1795
1795
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
1796
1796
|
let r = n.name.trim().toLowerCase();
|
|
1797
1797
|
t.has(n.id) || t.has(r) || (t.add(n.id), t.add(r), e.push(n));
|
|
@@ -1811,7 +1811,7 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1811
1811
|
o.evm.available,
|
|
1812
1812
|
o.svm.available,
|
|
1813
1813
|
t.family
|
|
1814
|
-
]), g =
|
|
1814
|
+
]), g = G(() => {
|
|
1815
1815
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
1816
1816
|
for (let n of m) for (let r of d(o.catalog, n)) e.has(r.id) || (e.add(r.id), t.push(r));
|
|
1817
1817
|
let n = new Set(h.map((e) => e.id)), r = new Set(h.map((e) => e.name.trim().toLowerCase()));
|
|
@@ -1820,13 +1820,13 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1820
1820
|
o.catalog,
|
|
1821
1821
|
t.family,
|
|
1822
1822
|
h
|
|
1823
|
-
]), _ = o.evm.connecting || o.svm.connecting, v = f === "svm" ? o.svm.error : o.evm.error, y =
|
|
1823
|
+
]), _ = o.evm.connecting || o.svm.connecting, v = f === "svm" ? o.svm.error : o.evm.error, y = Ne((t) => {
|
|
1824
1824
|
p(t.family), t.evm ? e.connectEvm(t.evm) : t.svm && e.connectSvm(t.svm);
|
|
1825
|
-
}, [e]), b =
|
|
1825
|
+
}, [e]), b = Ne((n) => {
|
|
1826
1826
|
if (!e.canPairRemotely() || m.length === 1 && m[0] === "svm") return;
|
|
1827
1827
|
let r = g.find((e) => e.id === n);
|
|
1828
1828
|
if (r && !s(r.id, window.location.href) && (c || u(r.id))) return (n) => {
|
|
1829
|
-
p("evm"), e.connectRemote(r, t.chainId ??
|
|
1829
|
+
p("evm"), e.connectRemote(r, t.chainId ?? Vt, n);
|
|
1830
1830
|
};
|
|
1831
1831
|
}, [
|
|
1832
1832
|
e,
|
|
@@ -1835,7 +1835,7 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1835
1835
|
t.chainId,
|
|
1836
1836
|
t.family
|
|
1837
1837
|
]), x = f === "svm" ? o.svm.connected : o.evm.connected;
|
|
1838
|
-
return f && x && (l.current = !0),
|
|
1838
|
+
return f && x && (l.current = !0), U(() => {
|
|
1839
1839
|
if (!f || !x) return;
|
|
1840
1840
|
let n = !0;
|
|
1841
1841
|
return (async () => {
|
|
@@ -1857,9 +1857,9 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1857
1857
|
f,
|
|
1858
1858
|
x?.address,
|
|
1859
1859
|
x?.walletId
|
|
1860
|
-
]), n === "modal" ? /* @__PURE__ */
|
|
1860
|
+
]), n === "modal" ? /* @__PURE__ */ q(We, {
|
|
1861
1861
|
base: o.assetBase,
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1862
|
+
children: /* @__PURE__ */ q(It, {
|
|
1863
1863
|
open: !0,
|
|
1864
1864
|
wallets: h,
|
|
1865
1865
|
registry: g,
|
|
@@ -1872,9 +1872,9 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1872
1872
|
l.current || a();
|
|
1873
1873
|
}
|
|
1874
1874
|
})
|
|
1875
|
-
}) : /* @__PURE__ */
|
|
1875
|
+
}) : /* @__PURE__ */ q(We, {
|
|
1876
1876
|
base: o.assetBase,
|
|
1877
|
-
children: /* @__PURE__ */
|
|
1877
|
+
children: /* @__PURE__ */ q(Bt, {
|
|
1878
1878
|
wallets: h,
|
|
1879
1879
|
registry: g,
|
|
1880
1880
|
connecting: _,
|
|
@@ -1886,7 +1886,7 @@ function Ht({ kit: e, request: t, variant: n, onResult: r, onError: i, onClose:
|
|
|
1886
1886
|
});
|
|
1887
1887
|
}
|
|
1888
1888
|
// src/element/element.ts
|
|
1889
|
-
var
|
|
1889
|
+
var $ = class extends HTMLElement {
|
|
1890
1890
|
static tagName = "reclack-connect";
|
|
1891
1891
|
static get observedAttributes() {
|
|
1892
1892
|
return [
|
|
@@ -1949,7 +1949,7 @@ var Ut = class extends HTMLElement {
|
|
|
1949
1949
|
this.#o = this.kit.subscribe(() => this.#f()), this.#p(), this.#_();
|
|
1950
1950
|
}
|
|
1951
1951
|
disconnectedCallback() {
|
|
1952
|
-
this.#a = !1, this.#o?.(), this.#o = void 0, this.#c?.(), this.#c = void 0,
|
|
1952
|
+
this.#a = !1, this.#o?.(), this.#o = void 0, this.#c?.(), this.#c = void 0, I(null, this.#i), this.#t && !this.#h().keepAlive && this.kit.destroy();
|
|
1953
1953
|
}
|
|
1954
1954
|
attributeChangedCallback() {
|
|
1955
1955
|
this.#a && (this.#p(), this.#_());
|
|
@@ -1999,7 +1999,7 @@ var Ut = class extends HTMLElement {
|
|
|
1999
1999
|
}));
|
|
2000
2000
|
}
|
|
2001
2001
|
#v() {
|
|
2002
|
-
|
|
2002
|
+
I(A(Ut, {
|
|
2003
2003
|
kit: this.kit,
|
|
2004
2004
|
request: this.#h(),
|
|
2005
2005
|
variant: this.#g(),
|
|
@@ -2018,20 +2018,20 @@ var Ut = class extends HTMLElement {
|
|
|
2018
2018
|
}, Wt;
|
|
2019
2019
|
function Gt(e) {
|
|
2020
2020
|
if (typeof CSSStyleSheet < "u" && "adoptedStyleSheets" in e) {
|
|
2021
|
-
Wt || (Wt = new CSSStyleSheet(), Wt.replaceSync(
|
|
2021
|
+
Wt || (Wt = new CSSStyleSheet(), Wt.replaceSync(Se)), e.adoptedStyleSheets = [Wt];
|
|
2022
2022
|
return;
|
|
2023
2023
|
}
|
|
2024
2024
|
let t = document.createElement("style");
|
|
2025
|
-
t.textContent =
|
|
2025
|
+
t.textContent = Se, e.append(t);
|
|
2026
2026
|
}
|
|
2027
|
-
function Kt(e =
|
|
2028
|
-
typeof customElements > "u" || customElements.get(e) || customElements.define(e,
|
|
2027
|
+
function Kt(e = $.tagName) {
|
|
2028
|
+
typeof customElements > "u" || customElements.get(e) || customElements.define(e, $);
|
|
2029
2029
|
}
|
|
2030
2030
|
function qt(e = { intent: ["address"] }) {
|
|
2031
2031
|
Kt();
|
|
2032
2032
|
let { kit: t, kitOptions: r, theme: i, container: a, ...o } = e;
|
|
2033
2033
|
if (o.keepAlive && !t && !r) throw Error("connectWallet with keepAlive needs a kit of your own to keep the connection on.");
|
|
2034
|
-
let s = document.createElement(
|
|
2034
|
+
let s = document.createElement($.tagName);
|
|
2035
2035
|
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) => {
|
|
2036
2036
|
let n = (e) => {
|
|
2037
2037
|
s.remove(), e();
|
|
@@ -2085,25 +2085,42 @@ var Qt = {
|
|
|
2085
2085
|
connect: "onConnect",
|
|
2086
2086
|
cancel: "onCancel",
|
|
2087
2087
|
"connect-error": "onError"
|
|
2088
|
+
}, $t = {
|
|
2089
|
+
value: "value",
|
|
2090
|
+
label: "label",
|
|
2091
|
+
themeMode: "theme-mode",
|
|
2092
|
+
brand: "brand",
|
|
2093
|
+
radius: "radius",
|
|
2094
|
+
fontFamily: "font",
|
|
2095
|
+
assetBase: "asset-base"
|
|
2088
2096
|
};
|
|
2097
|
+
function en(e) {
|
|
2098
|
+
let t = {};
|
|
2099
|
+
for (let [n, r] of Object.entries($t)) {
|
|
2100
|
+
let i = e[n];
|
|
2101
|
+
i !== void 0 && (t[r] = String(i));
|
|
2102
|
+
}
|
|
2103
|
+
return e.networks !== void 0 && (t.networks = Array.isArray(e.networks) ? e.networks.join(",") : e.networks), e.disabled && (t.disabled = ""), t;
|
|
2104
|
+
}
|
|
2105
|
+
var tn = { change: "onChange" };
|
|
2089
2106
|
// src/element/ui/network-select.tsx
|
|
2090
|
-
function
|
|
2091
|
-
let [o, s] =
|
|
2107
|
+
function nn({ networks: e, value: t, disabled: n, label: i, onChange: a }) {
|
|
2108
|
+
let [o, s] = H(!1), [c, l] = H(""), [u, d] = H(0), f = W(null), p = W(null), m = W(null), h = Fe(), g = e.includes(t) ? t : e[0] ?? "", _ = G(() => {
|
|
2092
2109
|
let t = c.trim().toLowerCase();
|
|
2093
2110
|
return t ? e.filter((e) => r(e).toLowerCase().includes(t) || e.toLowerCase().includes(t)) : e;
|
|
2094
2111
|
}, [e, c]);
|
|
2095
|
-
|
|
2112
|
+
U(() => {
|
|
2096
2113
|
if (!o) return;
|
|
2097
2114
|
let e = (e) => {
|
|
2098
2115
|
let t = f.current;
|
|
2099
2116
|
t && !e.composedPath().includes(t) && s(!1);
|
|
2100
2117
|
};
|
|
2101
2118
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2102
|
-
}, [o]),
|
|
2119
|
+
}, [o]), U(() => {
|
|
2103
2120
|
o && m.current?.focus();
|
|
2104
|
-
}, [o]),
|
|
2121
|
+
}, [o]), U(() => {
|
|
2105
2122
|
n && s(!1);
|
|
2106
|
-
}, [n]),
|
|
2123
|
+
}, [n]), U(() => {
|
|
2107
2124
|
o && f.current?.querySelector(`#${CSS.escape(`${h}-${u}`)}`)?.scrollIntoView({ block: "nearest" });
|
|
2108
2125
|
}, [
|
|
2109
2126
|
o,
|
|
@@ -2146,17 +2163,17 @@ function $t({ networks: e, value: t, disabled: n, label: i, onChange: a }) {
|
|
|
2146
2163
|
case "Tab": s(!1);
|
|
2147
2164
|
}
|
|
2148
2165
|
}
|
|
2149
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ q("div", {
|
|
2150
2167
|
class: "rkw-field",
|
|
2151
|
-
children: [i === "" ? null : /* @__PURE__ */
|
|
2168
|
+
children: [i === "" ? null : /* @__PURE__ */ q("span", {
|
|
2152
2169
|
class: "rkw-field-label",
|
|
2153
2170
|
id: `${h}-label`,
|
|
2154
2171
|
children: i ?? "Network"
|
|
2155
|
-
}), /* @__PURE__ */
|
|
2172
|
+
}), /* @__PURE__ */ q("div", {
|
|
2156
2173
|
class: "network-select",
|
|
2157
2174
|
ref: f,
|
|
2158
2175
|
onKeyDown: x,
|
|
2159
|
-
children: [/* @__PURE__ */
|
|
2176
|
+
children: [/* @__PURE__ */ q("button", {
|
|
2160
2177
|
ref: p,
|
|
2161
2178
|
type: "button",
|
|
2162
2179
|
class: "network-trigger",
|
|
@@ -2166,20 +2183,20 @@ function $t({ networks: e, value: t, disabled: n, label: i, onChange: a }) {
|
|
|
2166
2183
|
disabled: n,
|
|
2167
2184
|
onClick: () => o ? s(!1) : v(),
|
|
2168
2185
|
children: [
|
|
2169
|
-
/* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ q(rn, { network: g }),
|
|
2187
|
+
/* @__PURE__ */ q("span", {
|
|
2171
2188
|
class: "network-trigger-name",
|
|
2172
2189
|
children: r(g)
|
|
2173
2190
|
}),
|
|
2174
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ q("span", {
|
|
2175
2192
|
class: "network-caret",
|
|
2176
2193
|
"aria-hidden": "true"
|
|
2177
2194
|
})
|
|
2178
2195
|
]
|
|
2179
|
-
}), o ? /* @__PURE__ */
|
|
2196
|
+
}), o ? /* @__PURE__ */ q("div", {
|
|
2180
2197
|
class: "network-panel",
|
|
2181
2198
|
children: [
|
|
2182
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ q("input", {
|
|
2183
2200
|
ref: m,
|
|
2184
2201
|
type: "search",
|
|
2185
2202
|
class: "network-search",
|
|
@@ -2195,25 +2212,25 @@ function $t({ networks: e, value: t, disabled: n, label: i, onChange: a }) {
|
|
|
2195
2212
|
l(e.target.value), d(0);
|
|
2196
2213
|
}
|
|
2197
2214
|
}),
|
|
2198
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ q("ul", {
|
|
2199
2216
|
class: "network-list",
|
|
2200
2217
|
id: h,
|
|
2201
2218
|
role: "listbox",
|
|
2202
2219
|
"aria-labelledby": `${h}-label`,
|
|
2203
|
-
children: _.map((e, t) => /* @__PURE__ */
|
|
2220
|
+
children: _.map((e, t) => /* @__PURE__ */ q("li", {
|
|
2204
2221
|
id: `${h}-${t}`,
|
|
2205
2222
|
role: "option",
|
|
2206
2223
|
"aria-selected": e === g,
|
|
2207
2224
|
class: t === u ? "network-item network-item-active" : "network-item",
|
|
2208
2225
|
onClick: () => b(e),
|
|
2209
2226
|
onMouseMove: () => d(t),
|
|
2210
|
-
children: [/* @__PURE__ */
|
|
2227
|
+
children: [/* @__PURE__ */ q(rn, { network: e }), /* @__PURE__ */ q("span", {
|
|
2211
2228
|
class: "network-item-name",
|
|
2212
2229
|
children: r(e)
|
|
2213
2230
|
})]
|
|
2214
2231
|
}, e))
|
|
2215
2232
|
}),
|
|
2216
|
-
_.length === 0 ? /* @__PURE__ */
|
|
2233
|
+
_.length === 0 ? /* @__PURE__ */ q("p", {
|
|
2217
2234
|
class: "network-empty",
|
|
2218
2235
|
children: [
|
|
2219
2236
|
"No network matches “",
|
|
@@ -2226,12 +2243,12 @@ function $t({ networks: e, value: t, disabled: n, label: i, onChange: a }) {
|
|
|
2226
2243
|
})]
|
|
2227
2244
|
});
|
|
2228
2245
|
}
|
|
2229
|
-
function
|
|
2230
|
-
let t =
|
|
2231
|
-
return /* @__PURE__ */
|
|
2246
|
+
function rn({ network: e }) {
|
|
2247
|
+
let t = Ge(), n = i(e, t);
|
|
2248
|
+
return /* @__PURE__ */ q("span", {
|
|
2232
2249
|
class: "network-mark",
|
|
2233
2250
|
"aria-hidden": "true",
|
|
2234
|
-
children: n ? /* @__PURE__ */
|
|
2251
|
+
children: n ? /* @__PURE__ */ q("img", {
|
|
2235
2252
|
src: n,
|
|
2236
2253
|
alt: "",
|
|
2237
2254
|
width: 20,
|
|
@@ -2242,7 +2259,7 @@ function en({ network: e }) {
|
|
|
2242
2259
|
});
|
|
2243
2260
|
}
|
|
2244
2261
|
// src/element/network-element.ts
|
|
2245
|
-
var
|
|
2262
|
+
var an = class extends HTMLElement {
|
|
2246
2263
|
static tagName = "reclack-network";
|
|
2247
2264
|
static get observedAttributes() {
|
|
2248
2265
|
return [
|
|
@@ -2277,7 +2294,7 @@ var tn = class extends HTMLElement {
|
|
|
2277
2294
|
this.#t = !0, this.#o(), this.#s();
|
|
2278
2295
|
}
|
|
2279
2296
|
disconnectedCallback() {
|
|
2280
|
-
this.#t = !1, this.#r?.(), this.#r = void 0,
|
|
2297
|
+
this.#t = !1, this.#r?.(), this.#r = void 0, I(null, this.#e);
|
|
2281
2298
|
}
|
|
2282
2299
|
attributeChangedCallback() {
|
|
2283
2300
|
this.#t && (this.#o(), this.#s());
|
|
@@ -2304,9 +2321,9 @@ var tn = class extends HTMLElement {
|
|
|
2304
2321
|
}
|
|
2305
2322
|
#s() {
|
|
2306
2323
|
let t = this.#i();
|
|
2307
|
-
|
|
2324
|
+
I(A(We, {
|
|
2308
2325
|
base: this.getAttribute("asset-base") ?? e,
|
|
2309
|
-
children:
|
|
2326
|
+
children: A(nn, {
|
|
2310
2327
|
networks: t,
|
|
2311
2328
|
value: this.value,
|
|
2312
2329
|
disabled: this.hasAttribute("disabled"),
|
|
@@ -2322,8 +2339,8 @@ var tn = class extends HTMLElement {
|
|
|
2322
2339
|
}), this.#e);
|
|
2323
2340
|
}
|
|
2324
2341
|
};
|
|
2325
|
-
function
|
|
2326
|
-
typeof customElements > "u" || customElements.get(e) || customElements.define(e,
|
|
2342
|
+
function on(e = an.tagName) {
|
|
2343
|
+
typeof customElements > "u" || customElements.get(e) || customElements.define(e, an);
|
|
2327
2344
|
}
|
|
2328
|
-
Kt(),
|
|
2329
|
-
export { Xt as ATTRIBUTES, Qt as EVENTS,
|
|
2345
|
+
Kt(), on();
|
|
2346
|
+
export { Xt as ATTRIBUTES, Qt as EVENTS, $t as NETWORK_ATTRIBUTES, tn as NETWORK_EVENTS, $ as ReclackConnectElement, an as ReclackNetworkElement, Zt as attributesOf, qt as connectWallet, on as defineNetworkElement, Kt as defineWalletElement, en as networkAttributesOf };
|