@deloraprotocol/widget 1.0.12 → 1.0.14
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/README.md +66 -12
- package/dist/PhArrowCircleDown-lsK25DCk.js +74 -0
- package/dist/PhArrowCircleDown-lsK25DCk.js.map +1 -0
- package/dist/PhArrowClockwise-NeKHZ1co.js +74 -0
- package/dist/PhArrowClockwise-NeKHZ1co.js.map +1 -0
- package/dist/PhArrowDown-C9AkNvLs.js +74 -0
- package/dist/PhArrowDown-C9AkNvLs.js.map +1 -0
- package/dist/PhArrowLeft-RNfIQP1X.js +74 -0
- package/dist/PhArrowLeft-RNfIQP1X.js.map +1 -0
- package/dist/PhArrowRight-DM1tna0G.js +74 -0
- package/dist/PhArrowRight-DM1tna0G.js.map +1 -0
- package/dist/PhArrowSquareOut-S5XYbAZj.js +74 -0
- package/dist/PhArrowSquareOut-S5XYbAZj.js.map +1 -0
- package/dist/PhArrowUp-DmktzOWy.js +74 -0
- package/dist/PhArrowUp-DmktzOWy.js.map +1 -0
- package/dist/PhArrowUpRight-BkNeW_5i.js +74 -0
- package/dist/PhArrowUpRight-BkNeW_5i.js.map +1 -0
- package/dist/PhArrowsClockwise-CQ4pG76b.js +74 -0
- package/dist/PhArrowsClockwise-CQ4pG76b.js.map +1 -0
- package/dist/PhArrowsDownUp-H6gxaNM6.js +74 -0
- package/dist/PhArrowsDownUp-H6gxaNM6.js.map +1 -0
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +74 -0
- package/dist/PhArrowsLeftRight-DZSsfMR6.js.map +1 -0
- package/dist/PhBank-4_9QzqIB.js +74 -0
- package/dist/PhBank-4_9QzqIB.js.map +1 -0
- package/dist/PhBrowser-B-JSznId.js +74 -0
- package/dist/PhBrowser-B-JSznId.js.map +1 -0
- package/dist/PhCaretDown-vV5oHMNi.js +74 -0
- package/dist/PhCaretDown-vV5oHMNi.js.map +1 -0
- package/dist/PhCaretLeft-BLo6Y_f4.js +74 -0
- package/dist/PhCaretLeft-BLo6Y_f4.js.map +1 -0
- package/dist/PhCaretRight-CqQN4TT3.js +74 -0
- package/dist/PhCaretRight-CqQN4TT3.js.map +1 -0
- package/dist/PhCaretUp-Df7UCAHy.js +74 -0
- package/dist/PhCaretUp-Df7UCAHy.js.map +1 -0
- package/dist/PhCheck-gtpfK4ed.js +74 -0
- package/dist/PhCheck-gtpfK4ed.js.map +1 -0
- package/dist/PhCircleHalf-Uq7dwDYw.js +74 -0
- package/dist/PhCircleHalf-Uq7dwDYw.js.map +1 -0
- package/dist/PhClock-SDCW-NmF.js +74 -0
- package/dist/PhClock-SDCW-NmF.js.map +1 -0
- package/dist/PhCompass-B7hgtdx-.js +74 -0
- package/dist/PhCompass-B7hgtdx-.js.map +1 -0
- package/dist/PhCopy-BcnhyXCy.js +74 -0
- package/dist/PhCopy-BcnhyXCy.js.map +1 -0
- package/dist/PhCreditCard-BJjByVgu.js +74 -0
- package/dist/PhCreditCard-BJjByVgu.js.map +1 -0
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +74 -0
- package/dist/PhCurrencyDollar-B7ZXqXBy.js.map +1 -0
- package/dist/PhDesktop-B3VKPuJx.js +74 -0
- package/dist/PhDesktop-B3VKPuJx.js.map +1 -0
- package/dist/PhDeviceMobile-Bnd0TYEH.js +74 -0
- package/dist/PhDeviceMobile-Bnd0TYEH.js.map +1 -0
- package/dist/PhDotsThree-yyMWyZ-R.js +74 -0
- package/dist/PhDotsThree-yyMWyZ-R.js.map +1 -0
- package/dist/PhEnvelope-67uzHbI9.js +74 -0
- package/dist/PhEnvelope-67uzHbI9.js.map +1 -0
- package/dist/PhFunnelSimple-B-DCsloI.js +74 -0
- package/dist/PhFunnelSimple-B-DCsloI.js.map +1 -0
- package/dist/PhGlobe-TMm_6qGk.js +74 -0
- package/dist/PhGlobe-TMm_6qGk.js.map +1 -0
- package/dist/PhIdentificationCard-CePPD2xc.js +74 -0
- package/dist/PhIdentificationCard-CePPD2xc.js.map +1 -0
- package/dist/PhImage-gY96WtHR.js +74 -0
- package/dist/PhImage-gY96WtHR.js.map +1 -0
- package/dist/PhInfo-DRQM_ZDP.js +74 -0
- package/dist/PhInfo-DRQM_ZDP.js.map +1 -0
- package/dist/PhLightbulb-B0TxPfZ1.js +74 -0
- package/dist/PhLightbulb-B0TxPfZ1.js.map +1 -0
- package/dist/PhMagnifyingGlass-B8si5_6W.js +74 -0
- package/dist/PhMagnifyingGlass-B8si5_6W.js.map +1 -0
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +74 -0
- package/dist/PhPaperPlaneRight-DVu5PLYd.js.map +1 -0
- package/dist/PhPlus-BfTsQnUz.js +74 -0
- package/dist/PhPlus-BfTsQnUz.js.map +1 -0
- package/dist/PhPower-CxYUGOWn.js +74 -0
- package/dist/PhPower-CxYUGOWn.js.map +1 -0
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +74 -0
- package/dist/PhPuzzlePiece-CQ4wh0gV.js.map +1 -0
- package/dist/PhQrCode-BuJ97NYJ.js +74 -0
- package/dist/PhQrCode-BuJ97NYJ.js.map +1 -0
- package/dist/PhQuestion-kJoP8Mja.js +74 -0
- package/dist/PhQuestion-kJoP8Mja.js.map +1 -0
- package/dist/PhQuestionMark-C46ZkFpu.js +74 -0
- package/dist/PhQuestionMark-C46ZkFpu.js.map +1 -0
- package/dist/PhSealCheck-Eh8jVqSN.js +74 -0
- package/dist/PhSealCheck-Eh8jVqSN.js.map +1 -0
- package/dist/PhSignOut-jk97OSVt.js +74 -0
- package/dist/PhSignOut-jk97OSVt.js.map +1 -0
- package/dist/PhSpinner-CiYOhwMg.js +74 -0
- package/dist/PhSpinner-CiYOhwMg.js.map +1 -0
- package/dist/PhTrash-pxerMqzd.js +74 -0
- package/dist/PhTrash-pxerMqzd.js.map +1 -0
- package/dist/PhUser-BMg0VV4A.js +74 -0
- package/dist/PhUser-BMg0VV4A.js.map +1 -0
- package/dist/PhVault-DYQvx5A-.js +74 -0
- package/dist/PhVault-DYQvx5A-.js.map +1 -0
- package/dist/PhWallet-uTRV6YNK.js +74 -0
- package/dist/PhWallet-uTRV6YNK.js.map +1 -0
- package/dist/PhWarning-NLC5Mj87.js +74 -0
- package/dist/PhWarning-NLC5Mj87.js.map +1 -0
- package/dist/PhWarningCircle-Ch2jU9fA.js +74 -0
- package/dist/PhWarningCircle-Ch2jU9fA.js.map +1 -0
- package/dist/PhX-Bx4wpwm3.js +74 -0
- package/dist/PhX-Bx4wpwm3.js.map +1 -0
- package/dist/basic-zhUNun3W.js +4454 -0
- package/dist/basic-zhUNun3W.js.map +1 -0
- package/dist/core-C44uv2wG.js +23617 -0
- package/dist/core-C44uv2wG.js.map +1 -0
- package/dist/features-Ce9zwIoM.js +275 -0
- package/dist/features-Ce9zwIoM.js.map +1 -0
- package/dist/index-BOFglHij.js +15873 -0
- package/dist/index-BOFglHij.js.map +1 -0
- package/dist/index-DDv68VV1.js +9670 -0
- package/dist/index-DDv68VV1.js.map +1 -0
- package/dist/index-DIwEE7rK.js +32554 -0
- package/dist/index-DIwEE7rK.js.map +1 -0
- package/dist/index-GLlNTp_B.js +2540 -0
- package/dist/index-GLlNTp_B.js.map +1 -0
- package/dist/index.d.ts +167 -9
- package/dist/index.js +5 -98494
- package/dist/index.js.map +1 -1
- package/dist/property-Bd8U3_QP.js +619 -0
- package/dist/property-Bd8U3_QP.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/w3m-modal-DCBge9gk.js +6015 -0
- package/dist/w3m-modal-DCBge9gk.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4454 @@
|
|
|
1
|
+
import { i as I, C as q, A as P, O as N, a as T, b as _, c as ft, d as u, E as D, R as E, e as k, f as At, g as mn, h as re, H as bn, j as ee, r as H, k as ge, T as De, S as Ie, M as Ut, l as zt, m as Ft, n as yn, o as Vt, w as je, p as vn, q as Cn, s as Wt, t as qt, W as pt } from "./core-C44uv2wG.js";
|
|
2
|
+
import { n as f, r as $, c as S, o as W, U as te, i as $n, t as xn, e as En, a as Rn } from "./index-GLlNTp_B.js";
|
|
3
|
+
var xe = function(t, e, n, o) {
|
|
4
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
5
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
6
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
7
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
8
|
+
};
|
|
9
|
+
let ce = class extends I {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = q.state.connectors, this.count = P.state.count, this.filteredCount = P.state.filteredWallets.length, this.isFetchingRecommendedWallets = P.state.isFetchingRecommendedWallets, this.unsubscribe.push(q.subscribeKey("connectors", (e) => this.connectors = e), P.subscribeKey("count", (e) => this.count = e), P.subscribeKey("filteredWallets", (e) => this.filteredCount = e.length), P.subscribeKey("isFetchingRecommendedWallets", (e) => this.isFetchingRecommendedWallets = e));
|
|
12
|
+
}
|
|
13
|
+
disconnectedCallback() {
|
|
14
|
+
this.unsubscribe.forEach((e) => e());
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
const e = this.connectors.find((c) => c.id === "walletConnect"), { allWallets: n } = N.state;
|
|
18
|
+
if (!e || n === "HIDE" || n === "ONLY_MOBILE" && !T.isMobile())
|
|
19
|
+
return null;
|
|
20
|
+
const o = P.state.featured.length, r = this.count + o, i = r < 10 ? r : Math.floor(r / 10) * 10, s = this.filteredCount > 0 ? this.filteredCount : i;
|
|
21
|
+
let a = `${s}`;
|
|
22
|
+
this.filteredCount > 0 ? a = `${this.filteredCount}` : s < r && (a = `${s}+`);
|
|
23
|
+
const l = _.hasAnyConnection(ft.CONNECTOR_ID.WALLET_CONNECT);
|
|
24
|
+
return u`
|
|
25
|
+
<wui-list-wallet
|
|
26
|
+
name="Search Wallet"
|
|
27
|
+
walletIcon="search"
|
|
28
|
+
showAllWallets
|
|
29
|
+
@click=${this.onAllWallets.bind(this)}
|
|
30
|
+
tagLabel=${a}
|
|
31
|
+
tagVariant="info"
|
|
32
|
+
data-testid="all-wallets"
|
|
33
|
+
tabIdx=${W(this.tabIdx)}
|
|
34
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
35
|
+
?disabled=${l}
|
|
36
|
+
size="sm"
|
|
37
|
+
></wui-list-wallet>
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
onAllWallets() {
|
|
41
|
+
var e;
|
|
42
|
+
D.sendEvent({ type: "track", event: "CLICK_ALL_WALLETS" }), E.push("AllWallets", { redirectView: (e = E.state.data) == null ? void 0 : e.redirectView });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
xe([
|
|
46
|
+
f()
|
|
47
|
+
], ce.prototype, "tabIdx", void 0);
|
|
48
|
+
xe([
|
|
49
|
+
$()
|
|
50
|
+
], ce.prototype, "connectors", void 0);
|
|
51
|
+
xe([
|
|
52
|
+
$()
|
|
53
|
+
], ce.prototype, "count", void 0);
|
|
54
|
+
xe([
|
|
55
|
+
$()
|
|
56
|
+
], ce.prototype, "filteredCount", void 0);
|
|
57
|
+
xe([
|
|
58
|
+
$()
|
|
59
|
+
], ce.prototype, "isFetchingRecommendedWallets", void 0);
|
|
60
|
+
ce = xe([
|
|
61
|
+
S("w3m-all-wallets-widget")
|
|
62
|
+
], ce);
|
|
63
|
+
const _n = k`
|
|
64
|
+
:host {
|
|
65
|
+
margin-top: ${({ spacing: t }) => t[1]};
|
|
66
|
+
}
|
|
67
|
+
wui-separator {
|
|
68
|
+
margin: ${({ spacing: t }) => t[3]} calc(${({ spacing: t }) => t[3]} * -1)
|
|
69
|
+
${({ spacing: t }) => t[2]} calc(${({ spacing: t }) => t[3]} * -1);
|
|
70
|
+
width: calc(100% + ${({ spacing: t }) => t[3]} * 2);
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
var Ee = function(t, e, n, o) {
|
|
74
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
75
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
76
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
77
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
78
|
+
};
|
|
79
|
+
let se = class extends I {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(), this.unsubscribe = [], this.explorerWallets = P.state.explorerWallets, this.connections = _.state.connections, this.connectorImages = At.state.connectorImages, this.loadingTelegram = !1, this.unsubscribe.push(_.subscribeKey("connections", (e) => this.connections = e), At.subscribeKey("connectorImages", (e) => this.connectorImages = e), P.subscribeKey("explorerFilteredWallets", (e) => {
|
|
82
|
+
this.explorerWallets = e != null && e.length ? e : P.state.explorerWallets;
|
|
83
|
+
}), P.subscribeKey("explorerWallets", (e) => {
|
|
84
|
+
var n;
|
|
85
|
+
(n = this.explorerWallets) != null && n.length || (this.explorerWallets = e);
|
|
86
|
+
})), T.isTelegram() && T.isIos() && (this.loadingTelegram = !_.state.wcUri, this.unsubscribe.push(_.subscribeKey("wcUri", (e) => this.loadingTelegram = !e)));
|
|
87
|
+
}
|
|
88
|
+
disconnectedCallback() {
|
|
89
|
+
this.unsubscribe.forEach((e) => e());
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return u`
|
|
93
|
+
<wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
connectorListTemplate() {
|
|
97
|
+
return mn.connectorList().map((e, n) => e.kind === "connector" ? this.renderConnector(e, n) : this.renderWallet(e, n));
|
|
98
|
+
}
|
|
99
|
+
getConnectorNamespaces(e) {
|
|
100
|
+
var n;
|
|
101
|
+
return e.subtype === "walletConnect" ? [] : e.subtype === "multiChain" ? ((n = e.connector.connectors) == null ? void 0 : n.map((o) => o.chain)) || [] : [e.connector.chain];
|
|
102
|
+
}
|
|
103
|
+
renderConnector(e, n) {
|
|
104
|
+
var R, y;
|
|
105
|
+
const o = e.connector, r = re.getConnectorImage(o) || this.connectorImages[(o == null ? void 0 : o.imageId) ?? ""], s = (this.connections.get(o.chain) ?? []).some((b) => bn.isLowerCaseMatch(b.connectorId, o.id));
|
|
106
|
+
let a, l;
|
|
107
|
+
e.subtype === "walletConnect" ? (a = "qr code", l = "accent") : e.subtype === "injected" || e.subtype === "announced" ? (a = s ? "connected" : "installed", l = s ? "info" : "success") : (a = void 0, l = void 0);
|
|
108
|
+
const c = _.hasAnyConnection(ft.CONNECTOR_ID.WALLET_CONNECT), d = e.subtype === "walletConnect" || e.subtype === "external" ? c : !1;
|
|
109
|
+
return u`
|
|
110
|
+
<w3m-list-wallet
|
|
111
|
+
displayIndex=${n}
|
|
112
|
+
imageSrc=${W(r)}
|
|
113
|
+
.installed=${!0}
|
|
114
|
+
name=${o.name ?? "Unknown"}
|
|
115
|
+
.tagVariant=${l}
|
|
116
|
+
tagLabel=${W(a)}
|
|
117
|
+
data-testid=${`wallet-selector-${o.id.toLowerCase()}`}
|
|
118
|
+
size="sm"
|
|
119
|
+
@click=${() => this.onClickConnector(e)}
|
|
120
|
+
tabIdx=${W(this.tabIdx)}
|
|
121
|
+
?disabled=${d}
|
|
122
|
+
rdnsId=${W(((R = o.explorerWallet) == null ? void 0 : R.rdns) || void 0)}
|
|
123
|
+
walletRank=${W((y = o.explorerWallet) == null ? void 0 : y.order)}
|
|
124
|
+
.namespaces=${this.getConnectorNamespaces(e)}
|
|
125
|
+
>
|
|
126
|
+
</w3m-list-wallet>
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
onClickConnector(e) {
|
|
130
|
+
var o;
|
|
131
|
+
const n = (o = E.state.data) == null ? void 0 : o.redirectView;
|
|
132
|
+
if (e.subtype === "walletConnect") {
|
|
133
|
+
q.setActiveConnector(e.connector), T.isMobile() ? E.push("AllWallets") : E.push("ConnectingWalletConnect", { redirectView: n });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (e.subtype === "multiChain") {
|
|
137
|
+
q.setActiveConnector(e.connector), E.push("ConnectingMultiChain", { redirectView: n });
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (e.subtype === "injected") {
|
|
141
|
+
q.setActiveConnector(e.connector), E.push("ConnectingExternal", {
|
|
142
|
+
connector: e.connector,
|
|
143
|
+
redirectView: n,
|
|
144
|
+
wallet: e.connector.explorerWallet
|
|
145
|
+
});
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (e.subtype === "announced") {
|
|
149
|
+
if (e.connector.id === "walletConnect") {
|
|
150
|
+
T.isMobile() ? E.push("AllWallets") : E.push("ConnectingWalletConnect", { redirectView: n });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
E.push("ConnectingExternal", {
|
|
154
|
+
connector: e.connector,
|
|
155
|
+
redirectView: n,
|
|
156
|
+
wallet: e.connector.explorerWallet
|
|
157
|
+
});
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
E.push("ConnectingExternal", {
|
|
161
|
+
connector: e.connector,
|
|
162
|
+
redirectView: n
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
renderWallet(e, n) {
|
|
166
|
+
const o = e.wallet, r = re.getWalletImage(o), s = _.hasAnyConnection(ft.CONNECTOR_ID.WALLET_CONNECT), a = this.loadingTelegram, l = e.subtype === "recent" ? "recent" : void 0, c = e.subtype === "recent" ? "info" : void 0;
|
|
167
|
+
return u`
|
|
168
|
+
<w3m-list-wallet
|
|
169
|
+
displayIndex=${n}
|
|
170
|
+
imageSrc=${W(r)}
|
|
171
|
+
name=${o.name ?? "Unknown"}
|
|
172
|
+
@click=${() => this.onClickWallet(e)}
|
|
173
|
+
size="sm"
|
|
174
|
+
data-testid=${`wallet-selector-${o.id}`}
|
|
175
|
+
tabIdx=${W(this.tabIdx)}
|
|
176
|
+
?loading=${a}
|
|
177
|
+
?disabled=${s}
|
|
178
|
+
rdnsId=${W(o.rdns || void 0)}
|
|
179
|
+
walletRank=${W(o.order)}
|
|
180
|
+
tagLabel=${W(l)}
|
|
181
|
+
.tagVariant=${c}
|
|
182
|
+
>
|
|
183
|
+
</w3m-list-wallet>
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
onClickWallet(e) {
|
|
187
|
+
var i;
|
|
188
|
+
const n = (i = E.state.data) == null ? void 0 : i.redirectView, o = ee.state.activeChain;
|
|
189
|
+
if (e.subtype === "featured") {
|
|
190
|
+
q.selectWalletConnector(e.wallet);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (e.subtype === "recent") {
|
|
194
|
+
if (this.loadingTelegram)
|
|
195
|
+
return;
|
|
196
|
+
q.selectWalletConnector(e.wallet);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (e.subtype === "custom") {
|
|
200
|
+
if (this.loadingTelegram)
|
|
201
|
+
return;
|
|
202
|
+
E.push("ConnectingWalletConnect", { wallet: e.wallet, redirectView: n });
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (this.loadingTelegram)
|
|
206
|
+
return;
|
|
207
|
+
const r = o ? q.getConnector({ id: e.wallet.id, namespace: o }) : void 0;
|
|
208
|
+
r ? E.push("ConnectingExternal", { connector: r, redirectView: n }) : E.push("ConnectingWalletConnect", { wallet: e.wallet, redirectView: n });
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
se.styles = _n;
|
|
212
|
+
Ee([
|
|
213
|
+
f({ type: Number })
|
|
214
|
+
], se.prototype, "tabIdx", void 0);
|
|
215
|
+
Ee([
|
|
216
|
+
$()
|
|
217
|
+
], se.prototype, "explorerWallets", void 0);
|
|
218
|
+
Ee([
|
|
219
|
+
$()
|
|
220
|
+
], se.prototype, "connections", void 0);
|
|
221
|
+
Ee([
|
|
222
|
+
$()
|
|
223
|
+
], se.prototype, "connectorImages", void 0);
|
|
224
|
+
Ee([
|
|
225
|
+
$()
|
|
226
|
+
], se.prototype, "loadingTelegram", void 0);
|
|
227
|
+
se = Ee([
|
|
228
|
+
S("w3m-connector-list")
|
|
229
|
+
], se);
|
|
230
|
+
const Sn = k`
|
|
231
|
+
:host {
|
|
232
|
+
flex: 1;
|
|
233
|
+
height: 100%;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
button {
|
|
237
|
+
width: 100%;
|
|
238
|
+
height: 100%;
|
|
239
|
+
display: inline-flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
padding: ${({ spacing: t }) => t[1]} ${({ spacing: t }) => t[2]};
|
|
242
|
+
column-gap: ${({ spacing: t }) => t[1]};
|
|
243
|
+
color: ${({ tokens: t }) => t.theme.textSecondary};
|
|
244
|
+
border-radius: ${({ borderRadius: t }) => t[20]};
|
|
245
|
+
background-color: transparent;
|
|
246
|
+
transition: background-color ${({ durations: t }) => t.lg}
|
|
247
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
248
|
+
will-change: background-color;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
252
|
+
button[data-active='true'] {
|
|
253
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
254
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundTertiary};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
button:hover:enabled:not([data-active='true']),
|
|
258
|
+
button:active:enabled:not([data-active='true']) {
|
|
259
|
+
wui-text,
|
|
260
|
+
wui-icon {
|
|
261
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
`;
|
|
265
|
+
var We = function(t, e, n, o) {
|
|
266
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
267
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
268
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
269
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
270
|
+
};
|
|
271
|
+
const Tn = {
|
|
272
|
+
lg: "lg-regular",
|
|
273
|
+
md: "md-regular",
|
|
274
|
+
sm: "sm-regular"
|
|
275
|
+
}, In = {
|
|
276
|
+
lg: "md",
|
|
277
|
+
md: "sm",
|
|
278
|
+
sm: "sm"
|
|
279
|
+
};
|
|
280
|
+
let ue = class extends I {
|
|
281
|
+
constructor() {
|
|
282
|
+
super(...arguments), this.icon = "mobile", this.size = "md", this.label = "", this.active = !1;
|
|
283
|
+
}
|
|
284
|
+
render() {
|
|
285
|
+
return u`
|
|
286
|
+
<button data-active=${this.active}>
|
|
287
|
+
${this.icon ? u`<wui-icon size=${In[this.size]} name=${this.icon}></wui-icon>` : ""}
|
|
288
|
+
<wui-text variant=${Tn[this.size]}> ${this.label} </wui-text>
|
|
289
|
+
</button>
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
ue.styles = [H, ge, Sn];
|
|
294
|
+
We([
|
|
295
|
+
f()
|
|
296
|
+
], ue.prototype, "icon", void 0);
|
|
297
|
+
We([
|
|
298
|
+
f()
|
|
299
|
+
], ue.prototype, "size", void 0);
|
|
300
|
+
We([
|
|
301
|
+
f()
|
|
302
|
+
], ue.prototype, "label", void 0);
|
|
303
|
+
We([
|
|
304
|
+
f({ type: Boolean })
|
|
305
|
+
], ue.prototype, "active", void 0);
|
|
306
|
+
ue = We([
|
|
307
|
+
S("wui-tab-item")
|
|
308
|
+
], ue);
|
|
309
|
+
const An = k`
|
|
310
|
+
:host {
|
|
311
|
+
display: inline-flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
|
|
314
|
+
border-radius: ${({ borderRadius: t }) => t[32]};
|
|
315
|
+
padding: ${({ spacing: t }) => t["01"]};
|
|
316
|
+
box-sizing: border-box;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
:host([data-size='sm']) {
|
|
320
|
+
height: 26px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
:host([data-size='md']) {
|
|
324
|
+
height: 36px;
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
var Pe = function(t, e, n, o) {
|
|
328
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
329
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
330
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
331
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
332
|
+
};
|
|
333
|
+
let de = class extends I {
|
|
334
|
+
constructor() {
|
|
335
|
+
super(...arguments), this.tabs = [], this.onTabChange = () => null, this.size = "md", this.activeTab = 0;
|
|
336
|
+
}
|
|
337
|
+
render() {
|
|
338
|
+
return this.dataset.size = this.size, this.tabs.map((e, n) => {
|
|
339
|
+
var r;
|
|
340
|
+
const o = n === this.activeTab;
|
|
341
|
+
return u`
|
|
342
|
+
<wui-tab-item
|
|
343
|
+
@click=${() => this.onTabClick(n)}
|
|
344
|
+
icon=${e.icon}
|
|
345
|
+
size=${this.size}
|
|
346
|
+
label=${e.label}
|
|
347
|
+
?active=${o}
|
|
348
|
+
data-active=${o}
|
|
349
|
+
data-testid="tab-${(r = e.label) == null ? void 0 : r.toLowerCase()}"
|
|
350
|
+
></wui-tab-item>
|
|
351
|
+
`;
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
onTabClick(e) {
|
|
355
|
+
this.activeTab = e, this.onTabChange(e);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
de.styles = [H, ge, An];
|
|
359
|
+
Pe([
|
|
360
|
+
f({ type: Array })
|
|
361
|
+
], de.prototype, "tabs", void 0);
|
|
362
|
+
Pe([
|
|
363
|
+
f()
|
|
364
|
+
], de.prototype, "onTabChange", void 0);
|
|
365
|
+
Pe([
|
|
366
|
+
f()
|
|
367
|
+
], de.prototype, "size", void 0);
|
|
368
|
+
Pe([
|
|
369
|
+
$()
|
|
370
|
+
], de.prototype, "activeTab", void 0);
|
|
371
|
+
de = Pe([
|
|
372
|
+
S("wui-tabs")
|
|
373
|
+
], de);
|
|
374
|
+
var vt = function(t, e, n, o) {
|
|
375
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
376
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
377
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
378
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
379
|
+
};
|
|
380
|
+
let Ue = class extends I {
|
|
381
|
+
constructor() {
|
|
382
|
+
super(...arguments), this.platformTabs = [], this.unsubscribe = [], this.platforms = [], this.onSelectPlatfrom = void 0;
|
|
383
|
+
}
|
|
384
|
+
disconnectCallback() {
|
|
385
|
+
this.unsubscribe.forEach((e) => e());
|
|
386
|
+
}
|
|
387
|
+
render() {
|
|
388
|
+
const e = this.generateTabs();
|
|
389
|
+
return u`
|
|
390
|
+
<wui-flex justifyContent="center" .padding=${["0", "0", "4", "0"]}>
|
|
391
|
+
<wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
392
|
+
</wui-flex>
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
generateTabs() {
|
|
396
|
+
const e = this.platforms.map((n) => n === "browser" ? { label: "Browser", icon: "extension", platform: "browser" } : n === "mobile" ? { label: "Mobile", icon: "mobile", platform: "mobile" } : n === "qrcode" ? { label: "Mobile", icon: "mobile", platform: "qrcode" } : n === "web" ? { label: "Webapp", icon: "browser", platform: "web" } : n === "desktop" ? { label: "Desktop", icon: "desktop", platform: "desktop" } : { label: "Browser", icon: "extension", platform: "unsupported" });
|
|
397
|
+
return this.platformTabs = e.map(({ platform: n }) => n), e;
|
|
398
|
+
}
|
|
399
|
+
onTabChange(e) {
|
|
400
|
+
var o;
|
|
401
|
+
const n = this.platformTabs[e];
|
|
402
|
+
n && ((o = this.onSelectPlatfrom) == null || o.call(this, n));
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
vt([
|
|
406
|
+
f({ type: Array })
|
|
407
|
+
], Ue.prototype, "platforms", void 0);
|
|
408
|
+
vt([
|
|
409
|
+
f()
|
|
410
|
+
], Ue.prototype, "onSelectPlatfrom", void 0);
|
|
411
|
+
Ue = vt([
|
|
412
|
+
S("w3m-connecting-header")
|
|
413
|
+
], Ue);
|
|
414
|
+
const Wn = k`
|
|
415
|
+
:host {
|
|
416
|
+
display: block;
|
|
417
|
+
width: 100px;
|
|
418
|
+
height: 100px;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
svg {
|
|
422
|
+
width: 100px;
|
|
423
|
+
height: 100px;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
rect {
|
|
427
|
+
fill: none;
|
|
428
|
+
stroke: ${(t) => t.colors.accent100};
|
|
429
|
+
stroke-width: 3px;
|
|
430
|
+
stroke-linecap: round;
|
|
431
|
+
animation: dash 1s linear infinite;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
@keyframes dash {
|
|
435
|
+
to {
|
|
436
|
+
stroke-dashoffset: 0px;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
`;
|
|
440
|
+
var Ht = function(t, e, n, o) {
|
|
441
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
442
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
443
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
444
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
445
|
+
};
|
|
446
|
+
let ze = class extends I {
|
|
447
|
+
constructor() {
|
|
448
|
+
super(...arguments), this.radius = 36;
|
|
449
|
+
}
|
|
450
|
+
render() {
|
|
451
|
+
return this.svgLoaderTemplate();
|
|
452
|
+
}
|
|
453
|
+
svgLoaderTemplate() {
|
|
454
|
+
const e = this.radius > 50 ? 50 : this.radius, o = 36 - e, r = 116 + o, i = 245 + o, s = 360 + o * 1.75;
|
|
455
|
+
return u`
|
|
456
|
+
<svg viewBox="0 0 110 110" width="110" height="110">
|
|
457
|
+
<rect
|
|
458
|
+
x="2"
|
|
459
|
+
y="2"
|
|
460
|
+
width="106"
|
|
461
|
+
height="106"
|
|
462
|
+
rx=${e}
|
|
463
|
+
stroke-dasharray="${r} ${i}"
|
|
464
|
+
stroke-dashoffset=${s}
|
|
465
|
+
/>
|
|
466
|
+
</svg>
|
|
467
|
+
`;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
ze.styles = [H, Wn];
|
|
471
|
+
Ht([
|
|
472
|
+
f({ type: Number })
|
|
473
|
+
], ze.prototype, "radius", void 0);
|
|
474
|
+
ze = Ht([
|
|
475
|
+
S("wui-loading-thumbnail")
|
|
476
|
+
], ze);
|
|
477
|
+
const Pn = k`
|
|
478
|
+
wui-flex {
|
|
479
|
+
width: 100%;
|
|
480
|
+
height: 52px;
|
|
481
|
+
box-sizing: border-box;
|
|
482
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
483
|
+
border-radius: ${({ borderRadius: t }) => t[5]};
|
|
484
|
+
padding-left: ${({ spacing: t }) => t[3]};
|
|
485
|
+
padding-right: ${({ spacing: t }) => t[3]};
|
|
486
|
+
display: flex;
|
|
487
|
+
align-items: center;
|
|
488
|
+
justify-content: space-between;
|
|
489
|
+
gap: ${({ spacing: t }) => t[6]};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
wui-text {
|
|
493
|
+
color: ${({ tokens: t }) => t.theme.textSecondary};
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
wui-icon {
|
|
497
|
+
width: 12px;
|
|
498
|
+
height: 12px;
|
|
499
|
+
}
|
|
500
|
+
`;
|
|
501
|
+
var Ze = function(t, e, n, o) {
|
|
502
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
503
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
504
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
505
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
506
|
+
};
|
|
507
|
+
let me = class extends I {
|
|
508
|
+
constructor() {
|
|
509
|
+
super(...arguments), this.disabled = !1, this.label = "", this.buttonLabel = "";
|
|
510
|
+
}
|
|
511
|
+
render() {
|
|
512
|
+
return u`
|
|
513
|
+
<wui-flex justifyContent="space-between" alignItems="center">
|
|
514
|
+
<wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
|
|
515
|
+
<wui-button variant="accent-secondary" size="sm">
|
|
516
|
+
${this.buttonLabel}
|
|
517
|
+
<wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
|
|
518
|
+
</wui-button>
|
|
519
|
+
</wui-flex>
|
|
520
|
+
`;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
me.styles = [H, ge, Pn];
|
|
524
|
+
Ze([
|
|
525
|
+
f({ type: Boolean })
|
|
526
|
+
], me.prototype, "disabled", void 0);
|
|
527
|
+
Ze([
|
|
528
|
+
f()
|
|
529
|
+
], me.prototype, "label", void 0);
|
|
530
|
+
Ze([
|
|
531
|
+
f()
|
|
532
|
+
], me.prototype, "buttonLabel", void 0);
|
|
533
|
+
me = Ze([
|
|
534
|
+
S("wui-cta-button")
|
|
535
|
+
], me);
|
|
536
|
+
const Bn = k`
|
|
537
|
+
:host {
|
|
538
|
+
display: block;
|
|
539
|
+
padding: 0 ${({ spacing: t }) => t[5]} ${({ spacing: t }) => t[5]};
|
|
540
|
+
}
|
|
541
|
+
`;
|
|
542
|
+
var Kt = function(t, e, n, o) {
|
|
543
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
544
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
545
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
546
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
547
|
+
};
|
|
548
|
+
let Fe = class extends I {
|
|
549
|
+
constructor() {
|
|
550
|
+
super(...arguments), this.wallet = void 0;
|
|
551
|
+
}
|
|
552
|
+
render() {
|
|
553
|
+
if (!this.wallet)
|
|
554
|
+
return this.style.display = "none", null;
|
|
555
|
+
const { name: e, app_store: n, play_store: o, chrome_store: r, homepage: i } = this.wallet, s = T.isMobile(), a = T.isIos(), l = T.isAndroid(), c = [n, o, i, r].filter(Boolean).length > 1, d = te.getTruncateString({
|
|
556
|
+
string: e,
|
|
557
|
+
charsStart: 12,
|
|
558
|
+
charsEnd: 0,
|
|
559
|
+
truncate: "end"
|
|
560
|
+
});
|
|
561
|
+
return c && !s ? u`
|
|
562
|
+
<wui-cta-button
|
|
563
|
+
label=${`Don't have ${d}?`}
|
|
564
|
+
buttonLabel="Get"
|
|
565
|
+
@click=${() => E.push("Downloads", { wallet: this.wallet })}
|
|
566
|
+
></wui-cta-button>
|
|
567
|
+
` : !c && i ? u`
|
|
568
|
+
<wui-cta-button
|
|
569
|
+
label=${`Don't have ${d}?`}
|
|
570
|
+
buttonLabel="Get"
|
|
571
|
+
@click=${this.onHomePage.bind(this)}
|
|
572
|
+
></wui-cta-button>
|
|
573
|
+
` : n && a ? u`
|
|
574
|
+
<wui-cta-button
|
|
575
|
+
label=${`Don't have ${d}?`}
|
|
576
|
+
buttonLabel="Get"
|
|
577
|
+
@click=${this.onAppStore.bind(this)}
|
|
578
|
+
></wui-cta-button>
|
|
579
|
+
` : o && l ? u`
|
|
580
|
+
<wui-cta-button
|
|
581
|
+
label=${`Don't have ${d}?`}
|
|
582
|
+
buttonLabel="Get"
|
|
583
|
+
@click=${this.onPlayStore.bind(this)}
|
|
584
|
+
></wui-cta-button>
|
|
585
|
+
` : (this.style.display = "none", null);
|
|
586
|
+
}
|
|
587
|
+
onAppStore() {
|
|
588
|
+
var e;
|
|
589
|
+
(e = this.wallet) != null && e.app_store && T.openHref(this.wallet.app_store, "_blank");
|
|
590
|
+
}
|
|
591
|
+
onPlayStore() {
|
|
592
|
+
var e;
|
|
593
|
+
(e = this.wallet) != null && e.play_store && T.openHref(this.wallet.play_store, "_blank");
|
|
594
|
+
}
|
|
595
|
+
onHomePage() {
|
|
596
|
+
var e;
|
|
597
|
+
(e = this.wallet) != null && e.homepage && T.openHref(this.wallet.homepage, "_blank");
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
Fe.styles = [Bn];
|
|
601
|
+
Kt([
|
|
602
|
+
f({ type: Object })
|
|
603
|
+
], Fe.prototype, "wallet", void 0);
|
|
604
|
+
Fe = Kt([
|
|
605
|
+
S("w3m-mobile-download-links")
|
|
606
|
+
], Fe);
|
|
607
|
+
const kn = k`
|
|
608
|
+
@keyframes shake {
|
|
609
|
+
0% {
|
|
610
|
+
transform: translateX(0);
|
|
611
|
+
}
|
|
612
|
+
25% {
|
|
613
|
+
transform: translateX(3px);
|
|
614
|
+
}
|
|
615
|
+
50% {
|
|
616
|
+
transform: translateX(-3px);
|
|
617
|
+
}
|
|
618
|
+
75% {
|
|
619
|
+
transform: translateX(3px);
|
|
620
|
+
}
|
|
621
|
+
100% {
|
|
622
|
+
transform: translateX(0);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
wui-flex:first-child:not(:only-child) {
|
|
627
|
+
position: relative;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
wui-wallet-image {
|
|
631
|
+
width: 56px;
|
|
632
|
+
height: 56px;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
wui-loading-thumbnail {
|
|
636
|
+
position: absolute;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
wui-icon-box {
|
|
640
|
+
position: absolute;
|
|
641
|
+
right: calc(${({ spacing: t }) => t[1]} * -1);
|
|
642
|
+
bottom: calc(${({ spacing: t }) => t[1]} * -1);
|
|
643
|
+
opacity: 0;
|
|
644
|
+
transform: scale(0.5);
|
|
645
|
+
transition-property: opacity, transform;
|
|
646
|
+
transition-duration: ${({ durations: t }) => t.lg};
|
|
647
|
+
transition-timing-function: ${({ easings: t }) => t["ease-out-power-2"]};
|
|
648
|
+
will-change: opacity, transform;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
wui-text[align='center'] {
|
|
652
|
+
width: 100%;
|
|
653
|
+
padding: 0px ${({ spacing: t }) => t[4]};
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
[data-error='true'] wui-icon-box {
|
|
657
|
+
opacity: 1;
|
|
658
|
+
transform: scale(1);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
[data-error='true'] > wui-flex:first-child {
|
|
662
|
+
animation: shake 250ms ${({ easings: t }) => t["ease-out-power-2"]} both;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
[data-retry='false'] wui-link {
|
|
666
|
+
display: none;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
[data-retry='true'] wui-link {
|
|
670
|
+
display: block;
|
|
671
|
+
opacity: 1;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
w3m-mobile-download-links {
|
|
675
|
+
padding: 0px;
|
|
676
|
+
width: 100%;
|
|
677
|
+
}
|
|
678
|
+
`;
|
|
679
|
+
var K = function(t, e, n, o) {
|
|
680
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
681
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
682
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
683
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
684
|
+
};
|
|
685
|
+
class L extends I {
|
|
686
|
+
constructor() {
|
|
687
|
+
var e, n, o, r, i;
|
|
688
|
+
super(), this.wallet = (e = E.state.data) == null ? void 0 : e.wallet, this.connector = (n = E.state.data) == null ? void 0 : n.connector, this.timeout = void 0, this.secondaryBtnIcon = "refresh", this.onConnect = void 0, this.onRender = void 0, this.onAutoConnect = void 0, this.isWalletConnect = !0, this.unsubscribe = [], this.imageSrc = re.getConnectorImage(this.connector) ?? re.getWalletImage(this.wallet), this.name = ((o = this.wallet) == null ? void 0 : o.name) ?? ((r = this.connector) == null ? void 0 : r.name) ?? "Wallet", this.isRetrying = !1, this.uri = _.state.wcUri, this.error = _.state.wcError, this.ready = !1, this.showRetry = !1, this.label = void 0, this.secondaryBtnLabel = "Try again", this.secondaryLabel = "Accept connection request in the wallet", this.isLoading = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(_.subscribeKey("wcUri", (s) => {
|
|
689
|
+
var a;
|
|
690
|
+
this.uri = s, this.isRetrying && this.onRetry && (this.isRetrying = !1, (a = this.onConnect) == null || a.call(this));
|
|
691
|
+
}), _.subscribeKey("wcError", (s) => this.error = s)), (T.isTelegram() || T.isSafari()) && T.isIos() && _.state.wcUri && ((i = this.onConnect) == null || i.call(this));
|
|
692
|
+
}
|
|
693
|
+
firstUpdated() {
|
|
694
|
+
var e;
|
|
695
|
+
(e = this.onAutoConnect) == null || e.call(this), this.showRetry = !this.onAutoConnect;
|
|
696
|
+
}
|
|
697
|
+
disconnectedCallback() {
|
|
698
|
+
this.unsubscribe.forEach((e) => e()), _.setWcError(!1), clearTimeout(this.timeout);
|
|
699
|
+
}
|
|
700
|
+
render() {
|
|
701
|
+
var o;
|
|
702
|
+
(o = this.onRender) == null || o.call(this), this.onShowRetry();
|
|
703
|
+
const e = this.error ? "Connection can be declined if a previous request is still active" : this.secondaryLabel;
|
|
704
|
+
let n = "";
|
|
705
|
+
return this.label ? n = this.label : (n = `Continue in ${this.name}`, this.error && (n = "Connection declined")), u`
|
|
706
|
+
<wui-flex
|
|
707
|
+
data-error=${W(this.error)}
|
|
708
|
+
data-retry=${this.showRetry}
|
|
709
|
+
flexDirection="column"
|
|
710
|
+
alignItems="center"
|
|
711
|
+
.padding=${["10", "5", "5", "5"]}
|
|
712
|
+
gap="6"
|
|
713
|
+
>
|
|
714
|
+
<wui-flex gap="2" justifyContent="center" alignItems="center">
|
|
715
|
+
<wui-wallet-image size="lg" imageSrc=${W(this.imageSrc)}></wui-wallet-image>
|
|
716
|
+
|
|
717
|
+
${this.error ? null : this.loaderTemplate()}
|
|
718
|
+
|
|
719
|
+
<wui-icon-box
|
|
720
|
+
color="error"
|
|
721
|
+
icon="close"
|
|
722
|
+
size="sm"
|
|
723
|
+
border
|
|
724
|
+
borderColor="wui-color-bg-125"
|
|
725
|
+
></wui-icon-box>
|
|
726
|
+
</wui-flex>
|
|
727
|
+
|
|
728
|
+
<wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
|
|
729
|
+
flexDirection="column"
|
|
730
|
+
alignItems="center"
|
|
731
|
+
gap="2"
|
|
732
|
+
.padding=${["2", "0", "0", "0"]}
|
|
733
|
+
>
|
|
734
|
+
<wui-text align="center" variant="lg-medium" color=${this.error ? "error" : "primary"}>
|
|
735
|
+
${n}
|
|
736
|
+
</wui-text>
|
|
737
|
+
<wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text>
|
|
738
|
+
</wui-flex>
|
|
739
|
+
|
|
740
|
+
${this.secondaryBtnLabel ? u`
|
|
741
|
+
<wui-button
|
|
742
|
+
variant="neutral-secondary"
|
|
743
|
+
size="md"
|
|
744
|
+
?disabled=${this.isRetrying || this.isLoading}
|
|
745
|
+
@click=${this.onTryAgain.bind(this)}
|
|
746
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
747
|
+
>
|
|
748
|
+
<wui-icon
|
|
749
|
+
color="inherit"
|
|
750
|
+
slot="iconLeft"
|
|
751
|
+
name=${this.secondaryBtnIcon}
|
|
752
|
+
></wui-icon>
|
|
753
|
+
${this.secondaryBtnLabel}
|
|
754
|
+
</wui-button>
|
|
755
|
+
` : null}
|
|
756
|
+
</wui-flex>
|
|
757
|
+
|
|
758
|
+
${this.isWalletConnect ? u`
|
|
759
|
+
<wui-flex .padding=${["0", "5", "5", "5"]} justifyContent="center">
|
|
760
|
+
<wui-link
|
|
761
|
+
@click=${this.onCopyUri}
|
|
762
|
+
variant="secondary"
|
|
763
|
+
icon="copy"
|
|
764
|
+
data-testid="wui-link-copy"
|
|
765
|
+
>
|
|
766
|
+
Copy link
|
|
767
|
+
</wui-link>
|
|
768
|
+
</wui-flex>
|
|
769
|
+
` : null}
|
|
770
|
+
|
|
771
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
|
|
772
|
+
</wui-flex>
|
|
773
|
+
`;
|
|
774
|
+
}
|
|
775
|
+
onShowRetry() {
|
|
776
|
+
var e;
|
|
777
|
+
if (this.error && !this.showRetry) {
|
|
778
|
+
this.showRetry = !0;
|
|
779
|
+
const n = (e = this.shadowRoot) == null ? void 0 : e.querySelector("wui-button");
|
|
780
|
+
n == null || n.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
781
|
+
fill: "forwards",
|
|
782
|
+
easing: "ease"
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
onTryAgain() {
|
|
787
|
+
var e, n;
|
|
788
|
+
_.setWcError(!1), this.onRetry ? (this.isRetrying = !0, (e = this.onRetry) == null || e.call(this)) : (n = this.onConnect) == null || n.call(this);
|
|
789
|
+
}
|
|
790
|
+
loaderTemplate() {
|
|
791
|
+
const e = De.state.themeVariables["--w3m-border-radius-master"], n = e ? parseInt(e.replace("px", ""), 10) : 4;
|
|
792
|
+
return u`<wui-loading-thumbnail radius=${n * 9}></wui-loading-thumbnail>`;
|
|
793
|
+
}
|
|
794
|
+
onCopyUri() {
|
|
795
|
+
try {
|
|
796
|
+
this.uri && (T.copyToClopboard(this.uri), Ie.showSuccess("Link copied"));
|
|
797
|
+
} catch {
|
|
798
|
+
Ie.showError("Failed to copy");
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
L.styles = kn;
|
|
803
|
+
K([
|
|
804
|
+
$()
|
|
805
|
+
], L.prototype, "isRetrying", void 0);
|
|
806
|
+
K([
|
|
807
|
+
$()
|
|
808
|
+
], L.prototype, "uri", void 0);
|
|
809
|
+
K([
|
|
810
|
+
$()
|
|
811
|
+
], L.prototype, "error", void 0);
|
|
812
|
+
K([
|
|
813
|
+
$()
|
|
814
|
+
], L.prototype, "ready", void 0);
|
|
815
|
+
K([
|
|
816
|
+
$()
|
|
817
|
+
], L.prototype, "showRetry", void 0);
|
|
818
|
+
K([
|
|
819
|
+
$()
|
|
820
|
+
], L.prototype, "label", void 0);
|
|
821
|
+
K([
|
|
822
|
+
$()
|
|
823
|
+
], L.prototype, "secondaryBtnLabel", void 0);
|
|
824
|
+
K([
|
|
825
|
+
$()
|
|
826
|
+
], L.prototype, "secondaryLabel", void 0);
|
|
827
|
+
K([
|
|
828
|
+
$()
|
|
829
|
+
], L.prototype, "isLoading", void 0);
|
|
830
|
+
K([
|
|
831
|
+
f({ type: Boolean })
|
|
832
|
+
], L.prototype, "isMobile", void 0);
|
|
833
|
+
K([
|
|
834
|
+
f()
|
|
835
|
+
], L.prototype, "onRetry", void 0);
|
|
836
|
+
var Ln = function(t, e, n, o) {
|
|
837
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
838
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
839
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
840
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
841
|
+
};
|
|
842
|
+
let Pt = class extends L {
|
|
843
|
+
constructor() {
|
|
844
|
+
var e;
|
|
845
|
+
if (super(), !this.wallet)
|
|
846
|
+
throw new Error("w3m-connecting-wc-browser: No wallet provided");
|
|
847
|
+
this.onConnect = this.onConnectProxy.bind(this), this.onAutoConnect = this.onConnectProxy.bind(this), D.sendEvent({
|
|
848
|
+
type: "track",
|
|
849
|
+
event: "SELECT_WALLET",
|
|
850
|
+
properties: {
|
|
851
|
+
name: this.wallet.name,
|
|
852
|
+
platform: "browser",
|
|
853
|
+
displayIndex: (e = this.wallet) == null ? void 0 : e.display_index,
|
|
854
|
+
walletRank: this.wallet.order,
|
|
855
|
+
view: E.state.view
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
async onConnectProxy() {
|
|
860
|
+
try {
|
|
861
|
+
this.error = !1;
|
|
862
|
+
const { connectors: e } = q.state, n = e.find((o) => {
|
|
863
|
+
var r, i, s;
|
|
864
|
+
return o.type === "ANNOUNCED" && ((r = o.info) == null ? void 0 : r.rdns) === ((i = this.wallet) == null ? void 0 : i.rdns) || o.type === "INJECTED" || o.name === ((s = this.wallet) == null ? void 0 : s.name);
|
|
865
|
+
});
|
|
866
|
+
if (n)
|
|
867
|
+
await _.connectExternal(n, n.chain);
|
|
868
|
+
else
|
|
869
|
+
throw new Error("w3m-connecting-wc-browser: No connector found");
|
|
870
|
+
Ut.close();
|
|
871
|
+
} catch (e) {
|
|
872
|
+
e instanceof zt && e.originalName === Ft.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST ? D.sendEvent({
|
|
873
|
+
type: "track",
|
|
874
|
+
event: "USER_REJECTED",
|
|
875
|
+
properties: { message: e.message }
|
|
876
|
+
}) : D.sendEvent({
|
|
877
|
+
type: "track",
|
|
878
|
+
event: "CONNECT_ERROR",
|
|
879
|
+
properties: { message: (e == null ? void 0 : e.message) ?? "Unknown" }
|
|
880
|
+
}), this.error = !0;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
Pt = Ln([
|
|
885
|
+
S("w3m-connecting-wc-browser")
|
|
886
|
+
], Pt);
|
|
887
|
+
var Nn = function(t, e, n, o) {
|
|
888
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
889
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
890
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
891
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
892
|
+
};
|
|
893
|
+
let Bt = class extends L {
|
|
894
|
+
constructor() {
|
|
895
|
+
var e;
|
|
896
|
+
if (super(), !this.wallet)
|
|
897
|
+
throw new Error("w3m-connecting-wc-desktop: No wallet provided");
|
|
898
|
+
this.onConnect = this.onConnectProxy.bind(this), this.onRender = this.onRenderProxy.bind(this), D.sendEvent({
|
|
899
|
+
type: "track",
|
|
900
|
+
event: "SELECT_WALLET",
|
|
901
|
+
properties: {
|
|
902
|
+
name: this.wallet.name,
|
|
903
|
+
platform: "desktop",
|
|
904
|
+
displayIndex: (e = this.wallet) == null ? void 0 : e.display_index,
|
|
905
|
+
walletRank: this.wallet.order,
|
|
906
|
+
view: E.state.view
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
onRenderProxy() {
|
|
911
|
+
var e;
|
|
912
|
+
!this.ready && this.uri && (this.ready = !0, (e = this.onConnect) == null || e.call(this));
|
|
913
|
+
}
|
|
914
|
+
onConnectProxy() {
|
|
915
|
+
var e;
|
|
916
|
+
if ((e = this.wallet) != null && e.desktop_link && this.uri)
|
|
917
|
+
try {
|
|
918
|
+
this.error = !1;
|
|
919
|
+
const { desktop_link: n, name: o } = this.wallet, { redirect: r, href: i } = T.formatNativeUrl(n, this.uri);
|
|
920
|
+
_.setWcLinking({ name: o, href: i }), _.setRecentWallet(this.wallet), T.openHref(r, "_blank");
|
|
921
|
+
} catch {
|
|
922
|
+
this.error = !0;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
Bt = Nn([
|
|
927
|
+
S("w3m-connecting-wc-desktop")
|
|
928
|
+
], Bt);
|
|
929
|
+
var Re = function(t, e, n, o) {
|
|
930
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
931
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
932
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
933
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
934
|
+
};
|
|
935
|
+
let he = class extends L {
|
|
936
|
+
constructor() {
|
|
937
|
+
var e;
|
|
938
|
+
if (super(), this.btnLabelTimeout = void 0, this.redirectDeeplink = void 0, this.redirectUniversalLink = void 0, this.target = void 0, this.preferUniversalLinks = N.state.experimental_preferUniversalLinks, this.isLoading = !0, this.onConnect = () => {
|
|
939
|
+
yn.onConnectMobile(this.wallet);
|
|
940
|
+
}, !this.wallet)
|
|
941
|
+
throw new Error("w3m-connecting-wc-mobile: No wallet provided");
|
|
942
|
+
this.secondaryBtnLabel = "Open", this.secondaryLabel = Vt.CONNECT_LABELS.MOBILE, this.secondaryBtnIcon = "externalLink", this.onHandleURI(), this.unsubscribe.push(_.subscribeKey("wcUri", () => {
|
|
943
|
+
this.onHandleURI();
|
|
944
|
+
})), D.sendEvent({
|
|
945
|
+
type: "track",
|
|
946
|
+
event: "SELECT_WALLET",
|
|
947
|
+
properties: {
|
|
948
|
+
name: this.wallet.name,
|
|
949
|
+
platform: "mobile",
|
|
950
|
+
displayIndex: (e = this.wallet) == null ? void 0 : e.display_index,
|
|
951
|
+
walletRank: this.wallet.order,
|
|
952
|
+
view: E.state.view
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
disconnectedCallback() {
|
|
957
|
+
super.disconnectedCallback(), clearTimeout(this.btnLabelTimeout);
|
|
958
|
+
}
|
|
959
|
+
onHandleURI() {
|
|
960
|
+
var e;
|
|
961
|
+
this.isLoading = !this.uri, !this.ready && this.uri && (this.ready = !0, (e = this.onConnect) == null || e.call(this));
|
|
962
|
+
}
|
|
963
|
+
onTryAgain() {
|
|
964
|
+
var e;
|
|
965
|
+
_.setWcError(!1), (e = this.onConnect) == null || e.call(this);
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
Re([
|
|
969
|
+
$()
|
|
970
|
+
], he.prototype, "redirectDeeplink", void 0);
|
|
971
|
+
Re([
|
|
972
|
+
$()
|
|
973
|
+
], he.prototype, "redirectUniversalLink", void 0);
|
|
974
|
+
Re([
|
|
975
|
+
$()
|
|
976
|
+
], he.prototype, "target", void 0);
|
|
977
|
+
Re([
|
|
978
|
+
$()
|
|
979
|
+
], he.prototype, "preferUniversalLinks", void 0);
|
|
980
|
+
Re([
|
|
981
|
+
$()
|
|
982
|
+
], he.prototype, "isLoading", void 0);
|
|
983
|
+
he = Re([
|
|
984
|
+
S("w3m-connecting-wc-mobile")
|
|
985
|
+
], he);
|
|
986
|
+
var Be = {}, On = function() {
|
|
987
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
988
|
+
}, Gt = {}, j = {};
|
|
989
|
+
let Ct;
|
|
990
|
+
const Mn = [
|
|
991
|
+
0,
|
|
992
|
+
// Not used
|
|
993
|
+
26,
|
|
994
|
+
44,
|
|
995
|
+
70,
|
|
996
|
+
100,
|
|
997
|
+
134,
|
|
998
|
+
172,
|
|
999
|
+
196,
|
|
1000
|
+
242,
|
|
1001
|
+
292,
|
|
1002
|
+
346,
|
|
1003
|
+
404,
|
|
1004
|
+
466,
|
|
1005
|
+
532,
|
|
1006
|
+
581,
|
|
1007
|
+
655,
|
|
1008
|
+
733,
|
|
1009
|
+
815,
|
|
1010
|
+
901,
|
|
1011
|
+
991,
|
|
1012
|
+
1085,
|
|
1013
|
+
1156,
|
|
1014
|
+
1258,
|
|
1015
|
+
1364,
|
|
1016
|
+
1474,
|
|
1017
|
+
1588,
|
|
1018
|
+
1706,
|
|
1019
|
+
1828,
|
|
1020
|
+
1921,
|
|
1021
|
+
2051,
|
|
1022
|
+
2185,
|
|
1023
|
+
2323,
|
|
1024
|
+
2465,
|
|
1025
|
+
2611,
|
|
1026
|
+
2761,
|
|
1027
|
+
2876,
|
|
1028
|
+
3034,
|
|
1029
|
+
3196,
|
|
1030
|
+
3362,
|
|
1031
|
+
3532,
|
|
1032
|
+
3706
|
|
1033
|
+
];
|
|
1034
|
+
j.getSymbolSize = function(e) {
|
|
1035
|
+
if (!e) throw new Error('"version" cannot be null or undefined');
|
|
1036
|
+
if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
1037
|
+
return e * 4 + 17;
|
|
1038
|
+
};
|
|
1039
|
+
j.getSymbolTotalCodewords = function(e) {
|
|
1040
|
+
return Mn[e];
|
|
1041
|
+
};
|
|
1042
|
+
j.getBCHDigit = function(t) {
|
|
1043
|
+
let e = 0;
|
|
1044
|
+
for (; t !== 0; )
|
|
1045
|
+
e++, t >>>= 1;
|
|
1046
|
+
return e;
|
|
1047
|
+
};
|
|
1048
|
+
j.setToSJISFunction = function(e) {
|
|
1049
|
+
if (typeof e != "function")
|
|
1050
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
1051
|
+
Ct = e;
|
|
1052
|
+
};
|
|
1053
|
+
j.isKanjiModeEnabled = function() {
|
|
1054
|
+
return typeof Ct < "u";
|
|
1055
|
+
};
|
|
1056
|
+
j.toSJIS = function(e) {
|
|
1057
|
+
return Ct(e);
|
|
1058
|
+
};
|
|
1059
|
+
var et = {};
|
|
1060
|
+
(function(t) {
|
|
1061
|
+
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
1062
|
+
function e(n) {
|
|
1063
|
+
if (typeof n != "string")
|
|
1064
|
+
throw new Error("Param is not a string");
|
|
1065
|
+
switch (n.toLowerCase()) {
|
|
1066
|
+
case "l":
|
|
1067
|
+
case "low":
|
|
1068
|
+
return t.L;
|
|
1069
|
+
case "m":
|
|
1070
|
+
case "medium":
|
|
1071
|
+
return t.M;
|
|
1072
|
+
case "q":
|
|
1073
|
+
case "quartile":
|
|
1074
|
+
return t.Q;
|
|
1075
|
+
case "h":
|
|
1076
|
+
case "high":
|
|
1077
|
+
return t.H;
|
|
1078
|
+
default:
|
|
1079
|
+
throw new Error("Unknown EC Level: " + n);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
t.isValid = function(o) {
|
|
1083
|
+
return o && typeof o.bit < "u" && o.bit >= 0 && o.bit < 4;
|
|
1084
|
+
}, t.from = function(o, r) {
|
|
1085
|
+
if (t.isValid(o))
|
|
1086
|
+
return o;
|
|
1087
|
+
try {
|
|
1088
|
+
return e(o);
|
|
1089
|
+
} catch {
|
|
1090
|
+
return r;
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
})(et);
|
|
1094
|
+
function Qt() {
|
|
1095
|
+
this.buffer = [], this.length = 0;
|
|
1096
|
+
}
|
|
1097
|
+
Qt.prototype = {
|
|
1098
|
+
get: function(t) {
|
|
1099
|
+
const e = Math.floor(t / 8);
|
|
1100
|
+
return (this.buffer[e] >>> 7 - t % 8 & 1) === 1;
|
|
1101
|
+
},
|
|
1102
|
+
put: function(t, e) {
|
|
1103
|
+
for (let n = 0; n < e; n++)
|
|
1104
|
+
this.putBit((t >>> e - n - 1 & 1) === 1);
|
|
1105
|
+
},
|
|
1106
|
+
getLengthInBits: function() {
|
|
1107
|
+
return this.length;
|
|
1108
|
+
},
|
|
1109
|
+
putBit: function(t) {
|
|
1110
|
+
const e = Math.floor(this.length / 8);
|
|
1111
|
+
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
var Dn = Qt;
|
|
1115
|
+
function ke(t) {
|
|
1116
|
+
if (!t || t < 1)
|
|
1117
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
1118
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
1119
|
+
}
|
|
1120
|
+
ke.prototype.set = function(t, e, n, o) {
|
|
1121
|
+
const r = t * this.size + e;
|
|
1122
|
+
this.data[r] = n, o && (this.reservedBit[r] = !0);
|
|
1123
|
+
};
|
|
1124
|
+
ke.prototype.get = function(t, e) {
|
|
1125
|
+
return this.data[t * this.size + e];
|
|
1126
|
+
};
|
|
1127
|
+
ke.prototype.xor = function(t, e, n) {
|
|
1128
|
+
this.data[t * this.size + e] ^= n;
|
|
1129
|
+
};
|
|
1130
|
+
ke.prototype.isReserved = function(t, e) {
|
|
1131
|
+
return this.reservedBit[t * this.size + e];
|
|
1132
|
+
};
|
|
1133
|
+
var jn = ke, Jt = {};
|
|
1134
|
+
(function(t) {
|
|
1135
|
+
const e = j.getSymbolSize;
|
|
1136
|
+
t.getRowColCoords = function(o) {
|
|
1137
|
+
if (o === 1) return [];
|
|
1138
|
+
const r = Math.floor(o / 7) + 2, i = e(o), s = i === 145 ? 26 : Math.ceil((i - 13) / (2 * r - 2)) * 2, a = [i - 7];
|
|
1139
|
+
for (let l = 1; l < r - 1; l++)
|
|
1140
|
+
a[l] = a[l - 1] - s;
|
|
1141
|
+
return a.push(6), a.reverse();
|
|
1142
|
+
}, t.getPositions = function(o) {
|
|
1143
|
+
const r = [], i = t.getRowColCoords(o), s = i.length;
|
|
1144
|
+
for (let a = 0; a < s; a++)
|
|
1145
|
+
for (let l = 0; l < s; l++)
|
|
1146
|
+
a === 0 && l === 0 || // top-left
|
|
1147
|
+
a === 0 && l === s - 1 || // bottom-left
|
|
1148
|
+
a === s - 1 && l === 0 || r.push([i[a], i[l]]);
|
|
1149
|
+
return r;
|
|
1150
|
+
};
|
|
1151
|
+
})(Jt);
|
|
1152
|
+
var Yt = {};
|
|
1153
|
+
const Un = j.getSymbolSize, kt = 7;
|
|
1154
|
+
Yt.getPositions = function(e) {
|
|
1155
|
+
const n = Un(e);
|
|
1156
|
+
return [
|
|
1157
|
+
// top-left
|
|
1158
|
+
[0, 0],
|
|
1159
|
+
// top-right
|
|
1160
|
+
[n - kt, 0],
|
|
1161
|
+
// bottom-left
|
|
1162
|
+
[0, n - kt]
|
|
1163
|
+
];
|
|
1164
|
+
};
|
|
1165
|
+
var Xt = {};
|
|
1166
|
+
(function(t) {
|
|
1167
|
+
t.Patterns = {
|
|
1168
|
+
PATTERN000: 0,
|
|
1169
|
+
PATTERN001: 1,
|
|
1170
|
+
PATTERN010: 2,
|
|
1171
|
+
PATTERN011: 3,
|
|
1172
|
+
PATTERN100: 4,
|
|
1173
|
+
PATTERN101: 5,
|
|
1174
|
+
PATTERN110: 6,
|
|
1175
|
+
PATTERN111: 7
|
|
1176
|
+
};
|
|
1177
|
+
const e = {
|
|
1178
|
+
N1: 3,
|
|
1179
|
+
N2: 3,
|
|
1180
|
+
N3: 40,
|
|
1181
|
+
N4: 10
|
|
1182
|
+
};
|
|
1183
|
+
t.isValid = function(r) {
|
|
1184
|
+
return r != null && r !== "" && !isNaN(r) && r >= 0 && r <= 7;
|
|
1185
|
+
}, t.from = function(r) {
|
|
1186
|
+
return t.isValid(r) ? parseInt(r, 10) : void 0;
|
|
1187
|
+
}, t.getPenaltyN1 = function(r) {
|
|
1188
|
+
const i = r.size;
|
|
1189
|
+
let s = 0, a = 0, l = 0, c = null, d = null;
|
|
1190
|
+
for (let R = 0; R < i; R++) {
|
|
1191
|
+
a = l = 0, c = d = null;
|
|
1192
|
+
for (let y = 0; y < i; y++) {
|
|
1193
|
+
let b = r.get(R, y);
|
|
1194
|
+
b === c ? a++ : (a >= 5 && (s += e.N1 + (a - 5)), c = b, a = 1), b = r.get(y, R), b === d ? l++ : (l >= 5 && (s += e.N1 + (l - 5)), d = b, l = 1);
|
|
1195
|
+
}
|
|
1196
|
+
a >= 5 && (s += e.N1 + (a - 5)), l >= 5 && (s += e.N1 + (l - 5));
|
|
1197
|
+
}
|
|
1198
|
+
return s;
|
|
1199
|
+
}, t.getPenaltyN2 = function(r) {
|
|
1200
|
+
const i = r.size;
|
|
1201
|
+
let s = 0;
|
|
1202
|
+
for (let a = 0; a < i - 1; a++)
|
|
1203
|
+
for (let l = 0; l < i - 1; l++) {
|
|
1204
|
+
const c = r.get(a, l) + r.get(a, l + 1) + r.get(a + 1, l) + r.get(a + 1, l + 1);
|
|
1205
|
+
(c === 4 || c === 0) && s++;
|
|
1206
|
+
}
|
|
1207
|
+
return s * e.N2;
|
|
1208
|
+
}, t.getPenaltyN3 = function(r) {
|
|
1209
|
+
const i = r.size;
|
|
1210
|
+
let s = 0, a = 0, l = 0;
|
|
1211
|
+
for (let c = 0; c < i; c++) {
|
|
1212
|
+
a = l = 0;
|
|
1213
|
+
for (let d = 0; d < i; d++)
|
|
1214
|
+
a = a << 1 & 2047 | r.get(c, d), d >= 10 && (a === 1488 || a === 93) && s++, l = l << 1 & 2047 | r.get(d, c), d >= 10 && (l === 1488 || l === 93) && s++;
|
|
1215
|
+
}
|
|
1216
|
+
return s * e.N3;
|
|
1217
|
+
}, t.getPenaltyN4 = function(r) {
|
|
1218
|
+
let i = 0;
|
|
1219
|
+
const s = r.data.length;
|
|
1220
|
+
for (let l = 0; l < s; l++) i += r.data[l];
|
|
1221
|
+
return Math.abs(Math.ceil(i * 100 / s / 5) - 10) * e.N4;
|
|
1222
|
+
};
|
|
1223
|
+
function n(o, r, i) {
|
|
1224
|
+
switch (o) {
|
|
1225
|
+
case t.Patterns.PATTERN000:
|
|
1226
|
+
return (r + i) % 2 === 0;
|
|
1227
|
+
case t.Patterns.PATTERN001:
|
|
1228
|
+
return r % 2 === 0;
|
|
1229
|
+
case t.Patterns.PATTERN010:
|
|
1230
|
+
return i % 3 === 0;
|
|
1231
|
+
case t.Patterns.PATTERN011:
|
|
1232
|
+
return (r + i) % 3 === 0;
|
|
1233
|
+
case t.Patterns.PATTERN100:
|
|
1234
|
+
return (Math.floor(r / 2) + Math.floor(i / 3)) % 2 === 0;
|
|
1235
|
+
case t.Patterns.PATTERN101:
|
|
1236
|
+
return r * i % 2 + r * i % 3 === 0;
|
|
1237
|
+
case t.Patterns.PATTERN110:
|
|
1238
|
+
return (r * i % 2 + r * i % 3) % 2 === 0;
|
|
1239
|
+
case t.Patterns.PATTERN111:
|
|
1240
|
+
return (r * i % 3 + (r + i) % 2) % 2 === 0;
|
|
1241
|
+
default:
|
|
1242
|
+
throw new Error("bad maskPattern:" + o);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
t.applyMask = function(r, i) {
|
|
1246
|
+
const s = i.size;
|
|
1247
|
+
for (let a = 0; a < s; a++)
|
|
1248
|
+
for (let l = 0; l < s; l++)
|
|
1249
|
+
i.isReserved(l, a) || i.xor(l, a, n(r, l, a));
|
|
1250
|
+
}, t.getBestMask = function(r, i) {
|
|
1251
|
+
const s = Object.keys(t.Patterns).length;
|
|
1252
|
+
let a = 0, l = 1 / 0;
|
|
1253
|
+
for (let c = 0; c < s; c++) {
|
|
1254
|
+
i(c), t.applyMask(c, r);
|
|
1255
|
+
const d = t.getPenaltyN1(r) + t.getPenaltyN2(r) + t.getPenaltyN3(r) + t.getPenaltyN4(r);
|
|
1256
|
+
t.applyMask(c, r), d < l && (l = d, a = c);
|
|
1257
|
+
}
|
|
1258
|
+
return a;
|
|
1259
|
+
};
|
|
1260
|
+
})(Xt);
|
|
1261
|
+
var tt = {};
|
|
1262
|
+
const oe = et, Oe = [
|
|
1263
|
+
// L M Q H
|
|
1264
|
+
1,
|
|
1265
|
+
1,
|
|
1266
|
+
1,
|
|
1267
|
+
1,
|
|
1268
|
+
1,
|
|
1269
|
+
1,
|
|
1270
|
+
1,
|
|
1271
|
+
1,
|
|
1272
|
+
1,
|
|
1273
|
+
1,
|
|
1274
|
+
2,
|
|
1275
|
+
2,
|
|
1276
|
+
1,
|
|
1277
|
+
2,
|
|
1278
|
+
2,
|
|
1279
|
+
4,
|
|
1280
|
+
1,
|
|
1281
|
+
2,
|
|
1282
|
+
4,
|
|
1283
|
+
4,
|
|
1284
|
+
2,
|
|
1285
|
+
4,
|
|
1286
|
+
4,
|
|
1287
|
+
4,
|
|
1288
|
+
2,
|
|
1289
|
+
4,
|
|
1290
|
+
6,
|
|
1291
|
+
5,
|
|
1292
|
+
2,
|
|
1293
|
+
4,
|
|
1294
|
+
6,
|
|
1295
|
+
6,
|
|
1296
|
+
2,
|
|
1297
|
+
5,
|
|
1298
|
+
8,
|
|
1299
|
+
8,
|
|
1300
|
+
4,
|
|
1301
|
+
5,
|
|
1302
|
+
8,
|
|
1303
|
+
8,
|
|
1304
|
+
4,
|
|
1305
|
+
5,
|
|
1306
|
+
8,
|
|
1307
|
+
11,
|
|
1308
|
+
4,
|
|
1309
|
+
8,
|
|
1310
|
+
10,
|
|
1311
|
+
11,
|
|
1312
|
+
4,
|
|
1313
|
+
9,
|
|
1314
|
+
12,
|
|
1315
|
+
16,
|
|
1316
|
+
4,
|
|
1317
|
+
9,
|
|
1318
|
+
16,
|
|
1319
|
+
16,
|
|
1320
|
+
6,
|
|
1321
|
+
10,
|
|
1322
|
+
12,
|
|
1323
|
+
18,
|
|
1324
|
+
6,
|
|
1325
|
+
10,
|
|
1326
|
+
17,
|
|
1327
|
+
16,
|
|
1328
|
+
6,
|
|
1329
|
+
11,
|
|
1330
|
+
16,
|
|
1331
|
+
19,
|
|
1332
|
+
6,
|
|
1333
|
+
13,
|
|
1334
|
+
18,
|
|
1335
|
+
21,
|
|
1336
|
+
7,
|
|
1337
|
+
14,
|
|
1338
|
+
21,
|
|
1339
|
+
25,
|
|
1340
|
+
8,
|
|
1341
|
+
16,
|
|
1342
|
+
20,
|
|
1343
|
+
25,
|
|
1344
|
+
8,
|
|
1345
|
+
17,
|
|
1346
|
+
23,
|
|
1347
|
+
25,
|
|
1348
|
+
9,
|
|
1349
|
+
17,
|
|
1350
|
+
23,
|
|
1351
|
+
34,
|
|
1352
|
+
9,
|
|
1353
|
+
18,
|
|
1354
|
+
25,
|
|
1355
|
+
30,
|
|
1356
|
+
10,
|
|
1357
|
+
20,
|
|
1358
|
+
27,
|
|
1359
|
+
32,
|
|
1360
|
+
12,
|
|
1361
|
+
21,
|
|
1362
|
+
29,
|
|
1363
|
+
35,
|
|
1364
|
+
12,
|
|
1365
|
+
23,
|
|
1366
|
+
34,
|
|
1367
|
+
37,
|
|
1368
|
+
12,
|
|
1369
|
+
25,
|
|
1370
|
+
34,
|
|
1371
|
+
40,
|
|
1372
|
+
13,
|
|
1373
|
+
26,
|
|
1374
|
+
35,
|
|
1375
|
+
42,
|
|
1376
|
+
14,
|
|
1377
|
+
28,
|
|
1378
|
+
38,
|
|
1379
|
+
45,
|
|
1380
|
+
15,
|
|
1381
|
+
29,
|
|
1382
|
+
40,
|
|
1383
|
+
48,
|
|
1384
|
+
16,
|
|
1385
|
+
31,
|
|
1386
|
+
43,
|
|
1387
|
+
51,
|
|
1388
|
+
17,
|
|
1389
|
+
33,
|
|
1390
|
+
45,
|
|
1391
|
+
54,
|
|
1392
|
+
18,
|
|
1393
|
+
35,
|
|
1394
|
+
48,
|
|
1395
|
+
57,
|
|
1396
|
+
19,
|
|
1397
|
+
37,
|
|
1398
|
+
51,
|
|
1399
|
+
60,
|
|
1400
|
+
19,
|
|
1401
|
+
38,
|
|
1402
|
+
53,
|
|
1403
|
+
63,
|
|
1404
|
+
20,
|
|
1405
|
+
40,
|
|
1406
|
+
56,
|
|
1407
|
+
66,
|
|
1408
|
+
21,
|
|
1409
|
+
43,
|
|
1410
|
+
59,
|
|
1411
|
+
70,
|
|
1412
|
+
22,
|
|
1413
|
+
45,
|
|
1414
|
+
62,
|
|
1415
|
+
74,
|
|
1416
|
+
24,
|
|
1417
|
+
47,
|
|
1418
|
+
65,
|
|
1419
|
+
77,
|
|
1420
|
+
25,
|
|
1421
|
+
49,
|
|
1422
|
+
68,
|
|
1423
|
+
81
|
|
1424
|
+
], Me = [
|
|
1425
|
+
// L M Q H
|
|
1426
|
+
7,
|
|
1427
|
+
10,
|
|
1428
|
+
13,
|
|
1429
|
+
17,
|
|
1430
|
+
10,
|
|
1431
|
+
16,
|
|
1432
|
+
22,
|
|
1433
|
+
28,
|
|
1434
|
+
15,
|
|
1435
|
+
26,
|
|
1436
|
+
36,
|
|
1437
|
+
44,
|
|
1438
|
+
20,
|
|
1439
|
+
36,
|
|
1440
|
+
52,
|
|
1441
|
+
64,
|
|
1442
|
+
26,
|
|
1443
|
+
48,
|
|
1444
|
+
72,
|
|
1445
|
+
88,
|
|
1446
|
+
36,
|
|
1447
|
+
64,
|
|
1448
|
+
96,
|
|
1449
|
+
112,
|
|
1450
|
+
40,
|
|
1451
|
+
72,
|
|
1452
|
+
108,
|
|
1453
|
+
130,
|
|
1454
|
+
48,
|
|
1455
|
+
88,
|
|
1456
|
+
132,
|
|
1457
|
+
156,
|
|
1458
|
+
60,
|
|
1459
|
+
110,
|
|
1460
|
+
160,
|
|
1461
|
+
192,
|
|
1462
|
+
72,
|
|
1463
|
+
130,
|
|
1464
|
+
192,
|
|
1465
|
+
224,
|
|
1466
|
+
80,
|
|
1467
|
+
150,
|
|
1468
|
+
224,
|
|
1469
|
+
264,
|
|
1470
|
+
96,
|
|
1471
|
+
176,
|
|
1472
|
+
260,
|
|
1473
|
+
308,
|
|
1474
|
+
104,
|
|
1475
|
+
198,
|
|
1476
|
+
288,
|
|
1477
|
+
352,
|
|
1478
|
+
120,
|
|
1479
|
+
216,
|
|
1480
|
+
320,
|
|
1481
|
+
384,
|
|
1482
|
+
132,
|
|
1483
|
+
240,
|
|
1484
|
+
360,
|
|
1485
|
+
432,
|
|
1486
|
+
144,
|
|
1487
|
+
280,
|
|
1488
|
+
408,
|
|
1489
|
+
480,
|
|
1490
|
+
168,
|
|
1491
|
+
308,
|
|
1492
|
+
448,
|
|
1493
|
+
532,
|
|
1494
|
+
180,
|
|
1495
|
+
338,
|
|
1496
|
+
504,
|
|
1497
|
+
588,
|
|
1498
|
+
196,
|
|
1499
|
+
364,
|
|
1500
|
+
546,
|
|
1501
|
+
650,
|
|
1502
|
+
224,
|
|
1503
|
+
416,
|
|
1504
|
+
600,
|
|
1505
|
+
700,
|
|
1506
|
+
224,
|
|
1507
|
+
442,
|
|
1508
|
+
644,
|
|
1509
|
+
750,
|
|
1510
|
+
252,
|
|
1511
|
+
476,
|
|
1512
|
+
690,
|
|
1513
|
+
816,
|
|
1514
|
+
270,
|
|
1515
|
+
504,
|
|
1516
|
+
750,
|
|
1517
|
+
900,
|
|
1518
|
+
300,
|
|
1519
|
+
560,
|
|
1520
|
+
810,
|
|
1521
|
+
960,
|
|
1522
|
+
312,
|
|
1523
|
+
588,
|
|
1524
|
+
870,
|
|
1525
|
+
1050,
|
|
1526
|
+
336,
|
|
1527
|
+
644,
|
|
1528
|
+
952,
|
|
1529
|
+
1110,
|
|
1530
|
+
360,
|
|
1531
|
+
700,
|
|
1532
|
+
1020,
|
|
1533
|
+
1200,
|
|
1534
|
+
390,
|
|
1535
|
+
728,
|
|
1536
|
+
1050,
|
|
1537
|
+
1260,
|
|
1538
|
+
420,
|
|
1539
|
+
784,
|
|
1540
|
+
1140,
|
|
1541
|
+
1350,
|
|
1542
|
+
450,
|
|
1543
|
+
812,
|
|
1544
|
+
1200,
|
|
1545
|
+
1440,
|
|
1546
|
+
480,
|
|
1547
|
+
868,
|
|
1548
|
+
1290,
|
|
1549
|
+
1530,
|
|
1550
|
+
510,
|
|
1551
|
+
924,
|
|
1552
|
+
1350,
|
|
1553
|
+
1620,
|
|
1554
|
+
540,
|
|
1555
|
+
980,
|
|
1556
|
+
1440,
|
|
1557
|
+
1710,
|
|
1558
|
+
570,
|
|
1559
|
+
1036,
|
|
1560
|
+
1530,
|
|
1561
|
+
1800,
|
|
1562
|
+
570,
|
|
1563
|
+
1064,
|
|
1564
|
+
1590,
|
|
1565
|
+
1890,
|
|
1566
|
+
600,
|
|
1567
|
+
1120,
|
|
1568
|
+
1680,
|
|
1569
|
+
1980,
|
|
1570
|
+
630,
|
|
1571
|
+
1204,
|
|
1572
|
+
1770,
|
|
1573
|
+
2100,
|
|
1574
|
+
660,
|
|
1575
|
+
1260,
|
|
1576
|
+
1860,
|
|
1577
|
+
2220,
|
|
1578
|
+
720,
|
|
1579
|
+
1316,
|
|
1580
|
+
1950,
|
|
1581
|
+
2310,
|
|
1582
|
+
750,
|
|
1583
|
+
1372,
|
|
1584
|
+
2040,
|
|
1585
|
+
2430
|
|
1586
|
+
];
|
|
1587
|
+
tt.getBlocksCount = function(e, n) {
|
|
1588
|
+
switch (n) {
|
|
1589
|
+
case oe.L:
|
|
1590
|
+
return Oe[(e - 1) * 4 + 0];
|
|
1591
|
+
case oe.M:
|
|
1592
|
+
return Oe[(e - 1) * 4 + 1];
|
|
1593
|
+
case oe.Q:
|
|
1594
|
+
return Oe[(e - 1) * 4 + 2];
|
|
1595
|
+
case oe.H:
|
|
1596
|
+
return Oe[(e - 1) * 4 + 3];
|
|
1597
|
+
default:
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
tt.getTotalCodewordsCount = function(e, n) {
|
|
1602
|
+
switch (n) {
|
|
1603
|
+
case oe.L:
|
|
1604
|
+
return Me[(e - 1) * 4 + 0];
|
|
1605
|
+
case oe.M:
|
|
1606
|
+
return Me[(e - 1) * 4 + 1];
|
|
1607
|
+
case oe.Q:
|
|
1608
|
+
return Me[(e - 1) * 4 + 2];
|
|
1609
|
+
case oe.H:
|
|
1610
|
+
return Me[(e - 1) * 4 + 3];
|
|
1611
|
+
default:
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
var Zt = {}, nt = {};
|
|
1616
|
+
const Se = new Uint8Array(512), Ve = new Uint8Array(256);
|
|
1617
|
+
(function() {
|
|
1618
|
+
let e = 1;
|
|
1619
|
+
for (let n = 0; n < 255; n++)
|
|
1620
|
+
Se[n] = e, Ve[e] = n, e <<= 1, e & 256 && (e ^= 285);
|
|
1621
|
+
for (let n = 255; n < 512; n++)
|
|
1622
|
+
Se[n] = Se[n - 255];
|
|
1623
|
+
})();
|
|
1624
|
+
nt.log = function(e) {
|
|
1625
|
+
if (e < 1) throw new Error("log(" + e + ")");
|
|
1626
|
+
return Ve[e];
|
|
1627
|
+
};
|
|
1628
|
+
nt.exp = function(e) {
|
|
1629
|
+
return Se[e];
|
|
1630
|
+
};
|
|
1631
|
+
nt.mul = function(e, n) {
|
|
1632
|
+
return e === 0 || n === 0 ? 0 : Se[Ve[e] + Ve[n]];
|
|
1633
|
+
};
|
|
1634
|
+
(function(t) {
|
|
1635
|
+
const e = nt;
|
|
1636
|
+
t.mul = function(o, r) {
|
|
1637
|
+
const i = new Uint8Array(o.length + r.length - 1);
|
|
1638
|
+
for (let s = 0; s < o.length; s++)
|
|
1639
|
+
for (let a = 0; a < r.length; a++)
|
|
1640
|
+
i[s + a] ^= e.mul(o[s], r[a]);
|
|
1641
|
+
return i;
|
|
1642
|
+
}, t.mod = function(o, r) {
|
|
1643
|
+
let i = new Uint8Array(o);
|
|
1644
|
+
for (; i.length - r.length >= 0; ) {
|
|
1645
|
+
const s = i[0];
|
|
1646
|
+
for (let l = 0; l < r.length; l++)
|
|
1647
|
+
i[l] ^= e.mul(r[l], s);
|
|
1648
|
+
let a = 0;
|
|
1649
|
+
for (; a < i.length && i[a] === 0; ) a++;
|
|
1650
|
+
i = i.slice(a);
|
|
1651
|
+
}
|
|
1652
|
+
return i;
|
|
1653
|
+
}, t.generateECPolynomial = function(o) {
|
|
1654
|
+
let r = new Uint8Array([1]);
|
|
1655
|
+
for (let i = 0; i < o; i++)
|
|
1656
|
+
r = t.mul(r, new Uint8Array([1, e.exp(i)]));
|
|
1657
|
+
return r;
|
|
1658
|
+
};
|
|
1659
|
+
})(Zt);
|
|
1660
|
+
const en = Zt;
|
|
1661
|
+
function $t(t) {
|
|
1662
|
+
this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
|
|
1663
|
+
}
|
|
1664
|
+
$t.prototype.initialize = function(e) {
|
|
1665
|
+
this.degree = e, this.genPoly = en.generateECPolynomial(this.degree);
|
|
1666
|
+
};
|
|
1667
|
+
$t.prototype.encode = function(e) {
|
|
1668
|
+
if (!this.genPoly)
|
|
1669
|
+
throw new Error("Encoder not initialized");
|
|
1670
|
+
const n = new Uint8Array(e.length + this.degree);
|
|
1671
|
+
n.set(e);
|
|
1672
|
+
const o = en.mod(n, this.genPoly), r = this.degree - o.length;
|
|
1673
|
+
if (r > 0) {
|
|
1674
|
+
const i = new Uint8Array(this.degree);
|
|
1675
|
+
return i.set(o, r), i;
|
|
1676
|
+
}
|
|
1677
|
+
return o;
|
|
1678
|
+
};
|
|
1679
|
+
var zn = $t, tn = {}, ae = {}, xt = {};
|
|
1680
|
+
xt.isValid = function(e) {
|
|
1681
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
1682
|
+
};
|
|
1683
|
+
var J = {};
|
|
1684
|
+
const nn = "[0-9]+", Fn = "[A-Z $%*+\\-./:]+";
|
|
1685
|
+
let Ae = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
1686
|
+
Ae = Ae.replace(/u/g, "\\u");
|
|
1687
|
+
const Vn = "(?:(?![A-Z0-9 $%*+\\-./:]|" + Ae + `)(?:.|[\r
|
|
1688
|
+
]))+`;
|
|
1689
|
+
J.KANJI = new RegExp(Ae, "g");
|
|
1690
|
+
J.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
1691
|
+
J.BYTE = new RegExp(Vn, "g");
|
|
1692
|
+
J.NUMERIC = new RegExp(nn, "g");
|
|
1693
|
+
J.ALPHANUMERIC = new RegExp(Fn, "g");
|
|
1694
|
+
const qn = new RegExp("^" + Ae + "$"), Hn = new RegExp("^" + nn + "$"), Kn = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
1695
|
+
J.testKanji = function(e) {
|
|
1696
|
+
return qn.test(e);
|
|
1697
|
+
};
|
|
1698
|
+
J.testNumeric = function(e) {
|
|
1699
|
+
return Hn.test(e);
|
|
1700
|
+
};
|
|
1701
|
+
J.testAlphanumeric = function(e) {
|
|
1702
|
+
return Kn.test(e);
|
|
1703
|
+
};
|
|
1704
|
+
(function(t) {
|
|
1705
|
+
const e = xt, n = J;
|
|
1706
|
+
t.NUMERIC = {
|
|
1707
|
+
id: "Numeric",
|
|
1708
|
+
bit: 1,
|
|
1709
|
+
ccBits: [10, 12, 14]
|
|
1710
|
+
}, t.ALPHANUMERIC = {
|
|
1711
|
+
id: "Alphanumeric",
|
|
1712
|
+
bit: 2,
|
|
1713
|
+
ccBits: [9, 11, 13]
|
|
1714
|
+
}, t.BYTE = {
|
|
1715
|
+
id: "Byte",
|
|
1716
|
+
bit: 4,
|
|
1717
|
+
ccBits: [8, 16, 16]
|
|
1718
|
+
}, t.KANJI = {
|
|
1719
|
+
id: "Kanji",
|
|
1720
|
+
bit: 8,
|
|
1721
|
+
ccBits: [8, 10, 12]
|
|
1722
|
+
}, t.MIXED = {
|
|
1723
|
+
bit: -1
|
|
1724
|
+
}, t.getCharCountIndicator = function(i, s) {
|
|
1725
|
+
if (!i.ccBits) throw new Error("Invalid mode: " + i);
|
|
1726
|
+
if (!e.isValid(s))
|
|
1727
|
+
throw new Error("Invalid version: " + s);
|
|
1728
|
+
return s >= 1 && s < 10 ? i.ccBits[0] : s < 27 ? i.ccBits[1] : i.ccBits[2];
|
|
1729
|
+
}, t.getBestModeForData = function(i) {
|
|
1730
|
+
return n.testNumeric(i) ? t.NUMERIC : n.testAlphanumeric(i) ? t.ALPHANUMERIC : n.testKanji(i) ? t.KANJI : t.BYTE;
|
|
1731
|
+
}, t.toString = function(i) {
|
|
1732
|
+
if (i && i.id) return i.id;
|
|
1733
|
+
throw new Error("Invalid mode");
|
|
1734
|
+
}, t.isValid = function(i) {
|
|
1735
|
+
return i && i.bit && i.ccBits;
|
|
1736
|
+
};
|
|
1737
|
+
function o(r) {
|
|
1738
|
+
if (typeof r != "string")
|
|
1739
|
+
throw new Error("Param is not a string");
|
|
1740
|
+
switch (r.toLowerCase()) {
|
|
1741
|
+
case "numeric":
|
|
1742
|
+
return t.NUMERIC;
|
|
1743
|
+
case "alphanumeric":
|
|
1744
|
+
return t.ALPHANUMERIC;
|
|
1745
|
+
case "kanji":
|
|
1746
|
+
return t.KANJI;
|
|
1747
|
+
case "byte":
|
|
1748
|
+
return t.BYTE;
|
|
1749
|
+
default:
|
|
1750
|
+
throw new Error("Unknown mode: " + r);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
t.from = function(i, s) {
|
|
1754
|
+
if (t.isValid(i))
|
|
1755
|
+
return i;
|
|
1756
|
+
try {
|
|
1757
|
+
return o(i);
|
|
1758
|
+
} catch {
|
|
1759
|
+
return s;
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
})(ae);
|
|
1763
|
+
(function(t) {
|
|
1764
|
+
const e = j, n = tt, o = et, r = ae, i = xt, s = 7973, a = e.getBCHDigit(s);
|
|
1765
|
+
function l(y, b, v) {
|
|
1766
|
+
for (let m = 1; m <= 40; m++)
|
|
1767
|
+
if (b <= t.getCapacity(m, v, y))
|
|
1768
|
+
return m;
|
|
1769
|
+
}
|
|
1770
|
+
function c(y, b) {
|
|
1771
|
+
return r.getCharCountIndicator(y, b) + 4;
|
|
1772
|
+
}
|
|
1773
|
+
function d(y, b) {
|
|
1774
|
+
let v = 0;
|
|
1775
|
+
return y.forEach(function(m) {
|
|
1776
|
+
const C = c(m.mode, b);
|
|
1777
|
+
v += C + m.getBitsLength();
|
|
1778
|
+
}), v;
|
|
1779
|
+
}
|
|
1780
|
+
function R(y, b) {
|
|
1781
|
+
for (let v = 1; v <= 40; v++)
|
|
1782
|
+
if (d(y, v) <= t.getCapacity(v, b, r.MIXED))
|
|
1783
|
+
return v;
|
|
1784
|
+
}
|
|
1785
|
+
t.from = function(b, v) {
|
|
1786
|
+
return i.isValid(b) ? parseInt(b, 10) : v;
|
|
1787
|
+
}, t.getCapacity = function(b, v, m) {
|
|
1788
|
+
if (!i.isValid(b))
|
|
1789
|
+
throw new Error("Invalid QR Code version");
|
|
1790
|
+
typeof m > "u" && (m = r.BYTE);
|
|
1791
|
+
const C = e.getSymbolTotalCodewords(b), g = n.getTotalCodewordsCount(b, v), p = (C - g) * 8;
|
|
1792
|
+
if (m === r.MIXED) return p;
|
|
1793
|
+
const w = p - c(m, b);
|
|
1794
|
+
switch (m) {
|
|
1795
|
+
case r.NUMERIC:
|
|
1796
|
+
return Math.floor(w / 10 * 3);
|
|
1797
|
+
case r.ALPHANUMERIC:
|
|
1798
|
+
return Math.floor(w / 11 * 2);
|
|
1799
|
+
case r.KANJI:
|
|
1800
|
+
return Math.floor(w / 13);
|
|
1801
|
+
case r.BYTE:
|
|
1802
|
+
default:
|
|
1803
|
+
return Math.floor(w / 8);
|
|
1804
|
+
}
|
|
1805
|
+
}, t.getBestVersionForData = function(b, v) {
|
|
1806
|
+
let m;
|
|
1807
|
+
const C = o.from(v, o.M);
|
|
1808
|
+
if (Array.isArray(b)) {
|
|
1809
|
+
if (b.length > 1)
|
|
1810
|
+
return R(b, C);
|
|
1811
|
+
if (b.length === 0)
|
|
1812
|
+
return 1;
|
|
1813
|
+
m = b[0];
|
|
1814
|
+
} else
|
|
1815
|
+
m = b;
|
|
1816
|
+
return l(m.mode, m.getLength(), C);
|
|
1817
|
+
}, t.getEncodedBits = function(b) {
|
|
1818
|
+
if (!i.isValid(b) || b < 7)
|
|
1819
|
+
throw new Error("Invalid QR Code version");
|
|
1820
|
+
let v = b << 12;
|
|
1821
|
+
for (; e.getBCHDigit(v) - a >= 0; )
|
|
1822
|
+
v ^= s << e.getBCHDigit(v) - a;
|
|
1823
|
+
return b << 12 | v;
|
|
1824
|
+
};
|
|
1825
|
+
})(tn);
|
|
1826
|
+
var on = {};
|
|
1827
|
+
const gt = j, rn = 1335, Gn = 21522, Lt = gt.getBCHDigit(rn);
|
|
1828
|
+
on.getEncodedBits = function(e, n) {
|
|
1829
|
+
const o = e.bit << 3 | n;
|
|
1830
|
+
let r = o << 10;
|
|
1831
|
+
for (; gt.getBCHDigit(r) - Lt >= 0; )
|
|
1832
|
+
r ^= rn << gt.getBCHDigit(r) - Lt;
|
|
1833
|
+
return (o << 10 | r) ^ Gn;
|
|
1834
|
+
};
|
|
1835
|
+
var sn = {};
|
|
1836
|
+
const Qn = ae;
|
|
1837
|
+
function be(t) {
|
|
1838
|
+
this.mode = Qn.NUMERIC, this.data = t.toString();
|
|
1839
|
+
}
|
|
1840
|
+
be.getBitsLength = function(e) {
|
|
1841
|
+
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
1842
|
+
};
|
|
1843
|
+
be.prototype.getLength = function() {
|
|
1844
|
+
return this.data.length;
|
|
1845
|
+
};
|
|
1846
|
+
be.prototype.getBitsLength = function() {
|
|
1847
|
+
return be.getBitsLength(this.data.length);
|
|
1848
|
+
};
|
|
1849
|
+
be.prototype.write = function(e) {
|
|
1850
|
+
let n, o, r;
|
|
1851
|
+
for (n = 0; n + 3 <= this.data.length; n += 3)
|
|
1852
|
+
o = this.data.substr(n, 3), r = parseInt(o, 10), e.put(r, 10);
|
|
1853
|
+
const i = this.data.length - n;
|
|
1854
|
+
i > 0 && (o = this.data.substr(n), r = parseInt(o, 10), e.put(r, i * 3 + 1));
|
|
1855
|
+
};
|
|
1856
|
+
var Jn = be;
|
|
1857
|
+
const Yn = ae, st = [
|
|
1858
|
+
"0",
|
|
1859
|
+
"1",
|
|
1860
|
+
"2",
|
|
1861
|
+
"3",
|
|
1862
|
+
"4",
|
|
1863
|
+
"5",
|
|
1864
|
+
"6",
|
|
1865
|
+
"7",
|
|
1866
|
+
"8",
|
|
1867
|
+
"9",
|
|
1868
|
+
"A",
|
|
1869
|
+
"B",
|
|
1870
|
+
"C",
|
|
1871
|
+
"D",
|
|
1872
|
+
"E",
|
|
1873
|
+
"F",
|
|
1874
|
+
"G",
|
|
1875
|
+
"H",
|
|
1876
|
+
"I",
|
|
1877
|
+
"J",
|
|
1878
|
+
"K",
|
|
1879
|
+
"L",
|
|
1880
|
+
"M",
|
|
1881
|
+
"N",
|
|
1882
|
+
"O",
|
|
1883
|
+
"P",
|
|
1884
|
+
"Q",
|
|
1885
|
+
"R",
|
|
1886
|
+
"S",
|
|
1887
|
+
"T",
|
|
1888
|
+
"U",
|
|
1889
|
+
"V",
|
|
1890
|
+
"W",
|
|
1891
|
+
"X",
|
|
1892
|
+
"Y",
|
|
1893
|
+
"Z",
|
|
1894
|
+
" ",
|
|
1895
|
+
"$",
|
|
1896
|
+
"%",
|
|
1897
|
+
"*",
|
|
1898
|
+
"+",
|
|
1899
|
+
"-",
|
|
1900
|
+
".",
|
|
1901
|
+
"/",
|
|
1902
|
+
":"
|
|
1903
|
+
];
|
|
1904
|
+
function ye(t) {
|
|
1905
|
+
this.mode = Yn.ALPHANUMERIC, this.data = t;
|
|
1906
|
+
}
|
|
1907
|
+
ye.getBitsLength = function(e) {
|
|
1908
|
+
return 11 * Math.floor(e / 2) + 6 * (e % 2);
|
|
1909
|
+
};
|
|
1910
|
+
ye.prototype.getLength = function() {
|
|
1911
|
+
return this.data.length;
|
|
1912
|
+
};
|
|
1913
|
+
ye.prototype.getBitsLength = function() {
|
|
1914
|
+
return ye.getBitsLength(this.data.length);
|
|
1915
|
+
};
|
|
1916
|
+
ye.prototype.write = function(e) {
|
|
1917
|
+
let n;
|
|
1918
|
+
for (n = 0; n + 2 <= this.data.length; n += 2) {
|
|
1919
|
+
let o = st.indexOf(this.data[n]) * 45;
|
|
1920
|
+
o += st.indexOf(this.data[n + 1]), e.put(o, 11);
|
|
1921
|
+
}
|
|
1922
|
+
this.data.length % 2 && e.put(st.indexOf(this.data[n]), 6);
|
|
1923
|
+
};
|
|
1924
|
+
var Xn = ye, Zn = function(e) {
|
|
1925
|
+
for (var n = [], o = e.length, r = 0; r < o; r++) {
|
|
1926
|
+
var i = e.charCodeAt(r);
|
|
1927
|
+
if (i >= 55296 && i <= 56319 && o > r + 1) {
|
|
1928
|
+
var s = e.charCodeAt(r + 1);
|
|
1929
|
+
s >= 56320 && s <= 57343 && (i = (i - 55296) * 1024 + s - 56320 + 65536, r += 1);
|
|
1930
|
+
}
|
|
1931
|
+
if (i < 128) {
|
|
1932
|
+
n.push(i);
|
|
1933
|
+
continue;
|
|
1934
|
+
}
|
|
1935
|
+
if (i < 2048) {
|
|
1936
|
+
n.push(i >> 6 | 192), n.push(i & 63 | 128);
|
|
1937
|
+
continue;
|
|
1938
|
+
}
|
|
1939
|
+
if (i < 55296 || i >= 57344 && i < 65536) {
|
|
1940
|
+
n.push(i >> 12 | 224), n.push(i >> 6 & 63 | 128), n.push(i & 63 | 128);
|
|
1941
|
+
continue;
|
|
1942
|
+
}
|
|
1943
|
+
if (i >= 65536 && i <= 1114111) {
|
|
1944
|
+
n.push(i >> 18 | 240), n.push(i >> 12 & 63 | 128), n.push(i >> 6 & 63 | 128), n.push(i & 63 | 128);
|
|
1945
|
+
continue;
|
|
1946
|
+
}
|
|
1947
|
+
n.push(239, 191, 189);
|
|
1948
|
+
}
|
|
1949
|
+
return new Uint8Array(n).buffer;
|
|
1950
|
+
};
|
|
1951
|
+
const ei = Zn, ti = ae;
|
|
1952
|
+
function ve(t) {
|
|
1953
|
+
this.mode = ti.BYTE, typeof t == "string" && (t = ei(t)), this.data = new Uint8Array(t);
|
|
1954
|
+
}
|
|
1955
|
+
ve.getBitsLength = function(e) {
|
|
1956
|
+
return e * 8;
|
|
1957
|
+
};
|
|
1958
|
+
ve.prototype.getLength = function() {
|
|
1959
|
+
return this.data.length;
|
|
1960
|
+
};
|
|
1961
|
+
ve.prototype.getBitsLength = function() {
|
|
1962
|
+
return ve.getBitsLength(this.data.length);
|
|
1963
|
+
};
|
|
1964
|
+
ve.prototype.write = function(t) {
|
|
1965
|
+
for (let e = 0, n = this.data.length; e < n; e++)
|
|
1966
|
+
t.put(this.data[e], 8);
|
|
1967
|
+
};
|
|
1968
|
+
var ni = ve;
|
|
1969
|
+
const ii = ae, oi = j;
|
|
1970
|
+
function Ce(t) {
|
|
1971
|
+
this.mode = ii.KANJI, this.data = t;
|
|
1972
|
+
}
|
|
1973
|
+
Ce.getBitsLength = function(e) {
|
|
1974
|
+
return e * 13;
|
|
1975
|
+
};
|
|
1976
|
+
Ce.prototype.getLength = function() {
|
|
1977
|
+
return this.data.length;
|
|
1978
|
+
};
|
|
1979
|
+
Ce.prototype.getBitsLength = function() {
|
|
1980
|
+
return Ce.getBitsLength(this.data.length);
|
|
1981
|
+
};
|
|
1982
|
+
Ce.prototype.write = function(t) {
|
|
1983
|
+
let e;
|
|
1984
|
+
for (e = 0; e < this.data.length; e++) {
|
|
1985
|
+
let n = oi.toSJIS(this.data[e]);
|
|
1986
|
+
if (n >= 33088 && n <= 40956)
|
|
1987
|
+
n -= 33088;
|
|
1988
|
+
else if (n >= 57408 && n <= 60351)
|
|
1989
|
+
n -= 49472;
|
|
1990
|
+
else
|
|
1991
|
+
throw new Error(
|
|
1992
|
+
"Invalid SJIS character: " + this.data[e] + `
|
|
1993
|
+
Make sure your charset is UTF-8`
|
|
1994
|
+
);
|
|
1995
|
+
n = (n >>> 8 & 255) * 192 + (n & 255), t.put(n, 13);
|
|
1996
|
+
}
|
|
1997
|
+
};
|
|
1998
|
+
var ri = Ce, an = { exports: {} };
|
|
1999
|
+
(function(t) {
|
|
2000
|
+
var e = {
|
|
2001
|
+
single_source_shortest_paths: function(n, o, r) {
|
|
2002
|
+
var i = {}, s = {};
|
|
2003
|
+
s[o] = 0;
|
|
2004
|
+
var a = e.PriorityQueue.make();
|
|
2005
|
+
a.push(o, 0);
|
|
2006
|
+
for (var l, c, d, R, y, b, v, m, C; !a.empty(); ) {
|
|
2007
|
+
l = a.pop(), c = l.value, R = l.cost, y = n[c] || {};
|
|
2008
|
+
for (d in y)
|
|
2009
|
+
y.hasOwnProperty(d) && (b = y[d], v = R + b, m = s[d], C = typeof s[d] > "u", (C || m > v) && (s[d] = v, a.push(d, v), i[d] = c));
|
|
2010
|
+
}
|
|
2011
|
+
if (typeof r < "u" && typeof s[r] > "u") {
|
|
2012
|
+
var g = ["Could not find a path from ", o, " to ", r, "."].join("");
|
|
2013
|
+
throw new Error(g);
|
|
2014
|
+
}
|
|
2015
|
+
return i;
|
|
2016
|
+
},
|
|
2017
|
+
extract_shortest_path_from_predecessor_list: function(n, o) {
|
|
2018
|
+
for (var r = [], i = o; i; )
|
|
2019
|
+
r.push(i), n[i], i = n[i];
|
|
2020
|
+
return r.reverse(), r;
|
|
2021
|
+
},
|
|
2022
|
+
find_path: function(n, o, r) {
|
|
2023
|
+
var i = e.single_source_shortest_paths(n, o, r);
|
|
2024
|
+
return e.extract_shortest_path_from_predecessor_list(
|
|
2025
|
+
i,
|
|
2026
|
+
r
|
|
2027
|
+
);
|
|
2028
|
+
},
|
|
2029
|
+
/**
|
|
2030
|
+
* A very naive priority queue implementation.
|
|
2031
|
+
*/
|
|
2032
|
+
PriorityQueue: {
|
|
2033
|
+
make: function(n) {
|
|
2034
|
+
var o = e.PriorityQueue, r = {}, i;
|
|
2035
|
+
n = n || {};
|
|
2036
|
+
for (i in o)
|
|
2037
|
+
o.hasOwnProperty(i) && (r[i] = o[i]);
|
|
2038
|
+
return r.queue = [], r.sorter = n.sorter || o.default_sorter, r;
|
|
2039
|
+
},
|
|
2040
|
+
default_sorter: function(n, o) {
|
|
2041
|
+
return n.cost - o.cost;
|
|
2042
|
+
},
|
|
2043
|
+
/**
|
|
2044
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
2045
|
+
* is at the front of the queue.
|
|
2046
|
+
*/
|
|
2047
|
+
push: function(n, o) {
|
|
2048
|
+
var r = { value: n, cost: o };
|
|
2049
|
+
this.queue.push(r), this.queue.sort(this.sorter);
|
|
2050
|
+
},
|
|
2051
|
+
/**
|
|
2052
|
+
* Return the highest priority element in the queue.
|
|
2053
|
+
*/
|
|
2054
|
+
pop: function() {
|
|
2055
|
+
return this.queue.shift();
|
|
2056
|
+
},
|
|
2057
|
+
empty: function() {
|
|
2058
|
+
return this.queue.length === 0;
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
};
|
|
2062
|
+
t.exports = e;
|
|
2063
|
+
})(an);
|
|
2064
|
+
var si = an.exports;
|
|
2065
|
+
(function(t) {
|
|
2066
|
+
const e = ae, n = Jn, o = Xn, r = ni, i = ri, s = J, a = j, l = si;
|
|
2067
|
+
function c(g) {
|
|
2068
|
+
return unescape(encodeURIComponent(g)).length;
|
|
2069
|
+
}
|
|
2070
|
+
function d(g, p, w) {
|
|
2071
|
+
const h = [];
|
|
2072
|
+
let x;
|
|
2073
|
+
for (; (x = g.exec(w)) !== null; )
|
|
2074
|
+
h.push({
|
|
2075
|
+
data: x[0],
|
|
2076
|
+
index: x.index,
|
|
2077
|
+
mode: p,
|
|
2078
|
+
length: x[0].length
|
|
2079
|
+
});
|
|
2080
|
+
return h;
|
|
2081
|
+
}
|
|
2082
|
+
function R(g) {
|
|
2083
|
+
const p = d(s.NUMERIC, e.NUMERIC, g), w = d(s.ALPHANUMERIC, e.ALPHANUMERIC, g);
|
|
2084
|
+
let h, x;
|
|
2085
|
+
return a.isKanjiModeEnabled() ? (h = d(s.BYTE, e.BYTE, g), x = d(s.KANJI, e.KANJI, g)) : (h = d(s.BYTE_KANJI, e.BYTE, g), x = []), p.concat(w, h, x).sort(function(B, V) {
|
|
2086
|
+
return B.index - V.index;
|
|
2087
|
+
}).map(function(B) {
|
|
2088
|
+
return {
|
|
2089
|
+
data: B.data,
|
|
2090
|
+
mode: B.mode,
|
|
2091
|
+
length: B.length
|
|
2092
|
+
};
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
function y(g, p) {
|
|
2096
|
+
switch (p) {
|
|
2097
|
+
case e.NUMERIC:
|
|
2098
|
+
return n.getBitsLength(g);
|
|
2099
|
+
case e.ALPHANUMERIC:
|
|
2100
|
+
return o.getBitsLength(g);
|
|
2101
|
+
case e.KANJI:
|
|
2102
|
+
return i.getBitsLength(g);
|
|
2103
|
+
case e.BYTE:
|
|
2104
|
+
return r.getBitsLength(g);
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
function b(g) {
|
|
2108
|
+
return g.reduce(function(p, w) {
|
|
2109
|
+
const h = p.length - 1 >= 0 ? p[p.length - 1] : null;
|
|
2110
|
+
return h && h.mode === w.mode ? (p[p.length - 1].data += w.data, p) : (p.push(w), p);
|
|
2111
|
+
}, []);
|
|
2112
|
+
}
|
|
2113
|
+
function v(g) {
|
|
2114
|
+
const p = [];
|
|
2115
|
+
for (let w = 0; w < g.length; w++) {
|
|
2116
|
+
const h = g[w];
|
|
2117
|
+
switch (h.mode) {
|
|
2118
|
+
case e.NUMERIC:
|
|
2119
|
+
p.push([
|
|
2120
|
+
h,
|
|
2121
|
+
{ data: h.data, mode: e.ALPHANUMERIC, length: h.length },
|
|
2122
|
+
{ data: h.data, mode: e.BYTE, length: h.length }
|
|
2123
|
+
]);
|
|
2124
|
+
break;
|
|
2125
|
+
case e.ALPHANUMERIC:
|
|
2126
|
+
p.push([
|
|
2127
|
+
h,
|
|
2128
|
+
{ data: h.data, mode: e.BYTE, length: h.length }
|
|
2129
|
+
]);
|
|
2130
|
+
break;
|
|
2131
|
+
case e.KANJI:
|
|
2132
|
+
p.push([
|
|
2133
|
+
h,
|
|
2134
|
+
{ data: h.data, mode: e.BYTE, length: c(h.data) }
|
|
2135
|
+
]);
|
|
2136
|
+
break;
|
|
2137
|
+
case e.BYTE:
|
|
2138
|
+
p.push([
|
|
2139
|
+
{ data: h.data, mode: e.BYTE, length: c(h.data) }
|
|
2140
|
+
]);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
return p;
|
|
2144
|
+
}
|
|
2145
|
+
function m(g, p) {
|
|
2146
|
+
const w = {}, h = { start: {} };
|
|
2147
|
+
let x = ["start"];
|
|
2148
|
+
for (let A = 0; A < g.length; A++) {
|
|
2149
|
+
const B = g[A], V = [];
|
|
2150
|
+
for (let ie = 0; ie < B.length; ie++) {
|
|
2151
|
+
const G = B[ie], _e = "" + A + ie;
|
|
2152
|
+
V.push(_e), w[_e] = { node: G, lastCount: 0 }, h[_e] = {};
|
|
2153
|
+
for (let rt = 0; rt < x.length; rt++) {
|
|
2154
|
+
const X = x[rt];
|
|
2155
|
+
w[X] && w[X].node.mode === G.mode ? (h[X][_e] = y(w[X].lastCount + G.length, G.mode) - y(w[X].lastCount, G.mode), w[X].lastCount += G.length) : (w[X] && (w[X].lastCount = G.length), h[X][_e] = y(G.length, G.mode) + 4 + e.getCharCountIndicator(G.mode, p));
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
x = V;
|
|
2159
|
+
}
|
|
2160
|
+
for (let A = 0; A < x.length; A++)
|
|
2161
|
+
h[x[A]].end = 0;
|
|
2162
|
+
return { map: h, table: w };
|
|
2163
|
+
}
|
|
2164
|
+
function C(g, p) {
|
|
2165
|
+
let w;
|
|
2166
|
+
const h = e.getBestModeForData(g);
|
|
2167
|
+
if (w = e.from(p, h), w !== e.BYTE && w.bit < h.bit)
|
|
2168
|
+
throw new Error('"' + g + '" cannot be encoded with mode ' + e.toString(w) + `.
|
|
2169
|
+
Suggested mode is: ` + e.toString(h));
|
|
2170
|
+
switch (w === e.KANJI && !a.isKanjiModeEnabled() && (w = e.BYTE), w) {
|
|
2171
|
+
case e.NUMERIC:
|
|
2172
|
+
return new n(g);
|
|
2173
|
+
case e.ALPHANUMERIC:
|
|
2174
|
+
return new o(g);
|
|
2175
|
+
case e.KANJI:
|
|
2176
|
+
return new i(g);
|
|
2177
|
+
case e.BYTE:
|
|
2178
|
+
return new r(g);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
t.fromArray = function(p) {
|
|
2182
|
+
return p.reduce(function(w, h) {
|
|
2183
|
+
return typeof h == "string" ? w.push(C(h, null)) : h.data && w.push(C(h.data, h.mode)), w;
|
|
2184
|
+
}, []);
|
|
2185
|
+
}, t.fromString = function(p, w) {
|
|
2186
|
+
const h = R(p, a.isKanjiModeEnabled()), x = v(h), A = m(x, w), B = l.find_path(A.map, "start", "end"), V = [];
|
|
2187
|
+
for (let ie = 1; ie < B.length - 1; ie++)
|
|
2188
|
+
V.push(A.table[B[ie]].node);
|
|
2189
|
+
return t.fromArray(b(V));
|
|
2190
|
+
}, t.rawSplit = function(p) {
|
|
2191
|
+
return t.fromArray(
|
|
2192
|
+
R(p, a.isKanjiModeEnabled())
|
|
2193
|
+
);
|
|
2194
|
+
};
|
|
2195
|
+
})(sn);
|
|
2196
|
+
const it = j, at = et, ai = Dn, li = jn, ci = Jt, ui = Yt, wt = Xt, mt = tt, di = zn, qe = tn, hi = on, fi = ae, lt = sn;
|
|
2197
|
+
function pi(t, e) {
|
|
2198
|
+
const n = t.size, o = ui.getPositions(e);
|
|
2199
|
+
for (let r = 0; r < o.length; r++) {
|
|
2200
|
+
const i = o[r][0], s = o[r][1];
|
|
2201
|
+
for (let a = -1; a <= 7; a++)
|
|
2202
|
+
if (!(i + a <= -1 || n <= i + a))
|
|
2203
|
+
for (let l = -1; l <= 7; l++)
|
|
2204
|
+
s + l <= -1 || n <= s + l || (a >= 0 && a <= 6 && (l === 0 || l === 6) || l >= 0 && l <= 6 && (a === 0 || a === 6) || a >= 2 && a <= 4 && l >= 2 && l <= 4 ? t.set(i + a, s + l, !0, !0) : t.set(i + a, s + l, !1, !0));
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
function gi(t) {
|
|
2208
|
+
const e = t.size;
|
|
2209
|
+
for (let n = 8; n < e - 8; n++) {
|
|
2210
|
+
const o = n % 2 === 0;
|
|
2211
|
+
t.set(n, 6, o, !0), t.set(6, n, o, !0);
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
function wi(t, e) {
|
|
2215
|
+
const n = ci.getPositions(e);
|
|
2216
|
+
for (let o = 0; o < n.length; o++) {
|
|
2217
|
+
const r = n[o][0], i = n[o][1];
|
|
2218
|
+
for (let s = -2; s <= 2; s++)
|
|
2219
|
+
for (let a = -2; a <= 2; a++)
|
|
2220
|
+
s === -2 || s === 2 || a === -2 || a === 2 || s === 0 && a === 0 ? t.set(r + s, i + a, !0, !0) : t.set(r + s, i + a, !1, !0);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
function mi(t, e) {
|
|
2224
|
+
const n = t.size, o = qe.getEncodedBits(e);
|
|
2225
|
+
let r, i, s;
|
|
2226
|
+
for (let a = 0; a < 18; a++)
|
|
2227
|
+
r = Math.floor(a / 3), i = a % 3 + n - 8 - 3, s = (o >> a & 1) === 1, t.set(r, i, s, !0), t.set(i, r, s, !0);
|
|
2228
|
+
}
|
|
2229
|
+
function ct(t, e, n) {
|
|
2230
|
+
const o = t.size, r = hi.getEncodedBits(e, n);
|
|
2231
|
+
let i, s;
|
|
2232
|
+
for (i = 0; i < 15; i++)
|
|
2233
|
+
s = (r >> i & 1) === 1, i < 6 ? t.set(i, 8, s, !0) : i < 8 ? t.set(i + 1, 8, s, !0) : t.set(o - 15 + i, 8, s, !0), i < 8 ? t.set(8, o - i - 1, s, !0) : i < 9 ? t.set(8, 15 - i - 1 + 1, s, !0) : t.set(8, 15 - i - 1, s, !0);
|
|
2234
|
+
t.set(o - 8, 8, 1, !0);
|
|
2235
|
+
}
|
|
2236
|
+
function bi(t, e) {
|
|
2237
|
+
const n = t.size;
|
|
2238
|
+
let o = -1, r = n - 1, i = 7, s = 0;
|
|
2239
|
+
for (let a = n - 1; a > 0; a -= 2)
|
|
2240
|
+
for (a === 6 && a--; ; ) {
|
|
2241
|
+
for (let l = 0; l < 2; l++)
|
|
2242
|
+
if (!t.isReserved(r, a - l)) {
|
|
2243
|
+
let c = !1;
|
|
2244
|
+
s < e.length && (c = (e[s] >>> i & 1) === 1), t.set(r, a - l, c), i--, i === -1 && (s++, i = 7);
|
|
2245
|
+
}
|
|
2246
|
+
if (r += o, r < 0 || n <= r) {
|
|
2247
|
+
r -= o, o = -o;
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
function yi(t, e, n) {
|
|
2253
|
+
const o = new ai();
|
|
2254
|
+
n.forEach(function(l) {
|
|
2255
|
+
o.put(l.mode.bit, 4), o.put(l.getLength(), fi.getCharCountIndicator(l.mode, t)), l.write(o);
|
|
2256
|
+
});
|
|
2257
|
+
const r = it.getSymbolTotalCodewords(t), i = mt.getTotalCodewordsCount(t, e), s = (r - i) * 8;
|
|
2258
|
+
for (o.getLengthInBits() + 4 <= s && o.put(0, 4); o.getLengthInBits() % 8 !== 0; )
|
|
2259
|
+
o.putBit(0);
|
|
2260
|
+
const a = (s - o.getLengthInBits()) / 8;
|
|
2261
|
+
for (let l = 0; l < a; l++)
|
|
2262
|
+
o.put(l % 2 ? 17 : 236, 8);
|
|
2263
|
+
return vi(o, t, e);
|
|
2264
|
+
}
|
|
2265
|
+
function vi(t, e, n) {
|
|
2266
|
+
const o = it.getSymbolTotalCodewords(e), r = mt.getTotalCodewordsCount(e, n), i = o - r, s = mt.getBlocksCount(e, n), a = o % s, l = s - a, c = Math.floor(o / s), d = Math.floor(i / s), R = d + 1, y = c - d, b = new di(y);
|
|
2267
|
+
let v = 0;
|
|
2268
|
+
const m = new Array(s), C = new Array(s);
|
|
2269
|
+
let g = 0;
|
|
2270
|
+
const p = new Uint8Array(t.buffer);
|
|
2271
|
+
for (let B = 0; B < s; B++) {
|
|
2272
|
+
const V = B < l ? d : R;
|
|
2273
|
+
m[B] = p.slice(v, v + V), C[B] = b.encode(m[B]), v += V, g = Math.max(g, V);
|
|
2274
|
+
}
|
|
2275
|
+
const w = new Uint8Array(o);
|
|
2276
|
+
let h = 0, x, A;
|
|
2277
|
+
for (x = 0; x < g; x++)
|
|
2278
|
+
for (A = 0; A < s; A++)
|
|
2279
|
+
x < m[A].length && (w[h++] = m[A][x]);
|
|
2280
|
+
for (x = 0; x < y; x++)
|
|
2281
|
+
for (A = 0; A < s; A++)
|
|
2282
|
+
w[h++] = C[A][x];
|
|
2283
|
+
return w;
|
|
2284
|
+
}
|
|
2285
|
+
function Ci(t, e, n, o) {
|
|
2286
|
+
let r;
|
|
2287
|
+
if (Array.isArray(t))
|
|
2288
|
+
r = lt.fromArray(t);
|
|
2289
|
+
else if (typeof t == "string") {
|
|
2290
|
+
let c = e;
|
|
2291
|
+
if (!c) {
|
|
2292
|
+
const d = lt.rawSplit(t);
|
|
2293
|
+
c = qe.getBestVersionForData(d, n);
|
|
2294
|
+
}
|
|
2295
|
+
r = lt.fromString(t, c || 40);
|
|
2296
|
+
} else
|
|
2297
|
+
throw new Error("Invalid data");
|
|
2298
|
+
const i = qe.getBestVersionForData(r, n);
|
|
2299
|
+
if (!i)
|
|
2300
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
2301
|
+
if (!e)
|
|
2302
|
+
e = i;
|
|
2303
|
+
else if (e < i)
|
|
2304
|
+
throw new Error(
|
|
2305
|
+
`
|
|
2306
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
2307
|
+
Minimum version required to store current data is: ` + i + `.
|
|
2308
|
+
`
|
|
2309
|
+
);
|
|
2310
|
+
const s = yi(e, n, r), a = it.getSymbolSize(e), l = new li(a);
|
|
2311
|
+
return pi(l, e), gi(l), wi(l, e), ct(l, n, 0), e >= 7 && mi(l, e), bi(l, s), isNaN(o) && (o = wt.getBestMask(
|
|
2312
|
+
l,
|
|
2313
|
+
ct.bind(null, l, n)
|
|
2314
|
+
)), wt.applyMask(o, l), ct(l, n, o), {
|
|
2315
|
+
modules: l,
|
|
2316
|
+
version: e,
|
|
2317
|
+
errorCorrectionLevel: n,
|
|
2318
|
+
maskPattern: o,
|
|
2319
|
+
segments: r
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
Gt.create = function(e, n) {
|
|
2323
|
+
if (typeof e > "u" || e === "")
|
|
2324
|
+
throw new Error("No input text");
|
|
2325
|
+
let o = at.M, r, i;
|
|
2326
|
+
return typeof n < "u" && (o = at.from(n.errorCorrectionLevel, at.M), r = qe.from(n.version), i = wt.from(n.maskPattern), n.toSJISFunc && it.setToSJISFunction(n.toSJISFunc)), Ci(e, r, o, i);
|
|
2327
|
+
};
|
|
2328
|
+
var ln = {}, Et = {};
|
|
2329
|
+
(function(t) {
|
|
2330
|
+
function e(n) {
|
|
2331
|
+
if (typeof n == "number" && (n = n.toString()), typeof n != "string")
|
|
2332
|
+
throw new Error("Color should be defined as hex string");
|
|
2333
|
+
let o = n.slice().replace("#", "").split("");
|
|
2334
|
+
if (o.length < 3 || o.length === 5 || o.length > 8)
|
|
2335
|
+
throw new Error("Invalid hex color: " + n);
|
|
2336
|
+
(o.length === 3 || o.length === 4) && (o = Array.prototype.concat.apply([], o.map(function(i) {
|
|
2337
|
+
return [i, i];
|
|
2338
|
+
}))), o.length === 6 && o.push("F", "F");
|
|
2339
|
+
const r = parseInt(o.join(""), 16);
|
|
2340
|
+
return {
|
|
2341
|
+
r: r >> 24 & 255,
|
|
2342
|
+
g: r >> 16 & 255,
|
|
2343
|
+
b: r >> 8 & 255,
|
|
2344
|
+
a: r & 255,
|
|
2345
|
+
hex: "#" + o.slice(0, 6).join("")
|
|
2346
|
+
};
|
|
2347
|
+
}
|
|
2348
|
+
t.getOptions = function(o) {
|
|
2349
|
+
o || (o = {}), o.color || (o.color = {});
|
|
2350
|
+
const r = typeof o.margin > "u" || o.margin === null || o.margin < 0 ? 4 : o.margin, i = o.width && o.width >= 21 ? o.width : void 0, s = o.scale || 4;
|
|
2351
|
+
return {
|
|
2352
|
+
width: i,
|
|
2353
|
+
scale: i ? 4 : s,
|
|
2354
|
+
margin: r,
|
|
2355
|
+
color: {
|
|
2356
|
+
dark: e(o.color.dark || "#000000ff"),
|
|
2357
|
+
light: e(o.color.light || "#ffffffff")
|
|
2358
|
+
},
|
|
2359
|
+
type: o.type,
|
|
2360
|
+
rendererOpts: o.rendererOpts || {}
|
|
2361
|
+
};
|
|
2362
|
+
}, t.getScale = function(o, r) {
|
|
2363
|
+
return r.width && r.width >= o + r.margin * 2 ? r.width / (o + r.margin * 2) : r.scale;
|
|
2364
|
+
}, t.getImageWidth = function(o, r) {
|
|
2365
|
+
const i = t.getScale(o, r);
|
|
2366
|
+
return Math.floor((o + r.margin * 2) * i);
|
|
2367
|
+
}, t.qrToImageData = function(o, r, i) {
|
|
2368
|
+
const s = r.modules.size, a = r.modules.data, l = t.getScale(s, i), c = Math.floor((s + i.margin * 2) * l), d = i.margin * l, R = [i.color.light, i.color.dark];
|
|
2369
|
+
for (let y = 0; y < c; y++)
|
|
2370
|
+
for (let b = 0; b < c; b++) {
|
|
2371
|
+
let v = (y * c + b) * 4, m = i.color.light;
|
|
2372
|
+
if (y >= d && b >= d && y < c - d && b < c - d) {
|
|
2373
|
+
const C = Math.floor((y - d) / l), g = Math.floor((b - d) / l);
|
|
2374
|
+
m = R[a[C * s + g] ? 1 : 0];
|
|
2375
|
+
}
|
|
2376
|
+
o[v++] = m.r, o[v++] = m.g, o[v++] = m.b, o[v] = m.a;
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
})(Et);
|
|
2380
|
+
(function(t) {
|
|
2381
|
+
const e = Et;
|
|
2382
|
+
function n(r, i, s) {
|
|
2383
|
+
r.clearRect(0, 0, i.width, i.height), i.style || (i.style = {}), i.height = s, i.width = s, i.style.height = s + "px", i.style.width = s + "px";
|
|
2384
|
+
}
|
|
2385
|
+
function o() {
|
|
2386
|
+
try {
|
|
2387
|
+
return document.createElement("canvas");
|
|
2388
|
+
} catch {
|
|
2389
|
+
throw new Error("You need to specify a canvas element");
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
t.render = function(i, s, a) {
|
|
2393
|
+
let l = a, c = s;
|
|
2394
|
+
typeof l > "u" && (!s || !s.getContext) && (l = s, s = void 0), s || (c = o()), l = e.getOptions(l);
|
|
2395
|
+
const d = e.getImageWidth(i.modules.size, l), R = c.getContext("2d"), y = R.createImageData(d, d);
|
|
2396
|
+
return e.qrToImageData(y.data, i, l), n(R, c, d), R.putImageData(y, 0, 0), c;
|
|
2397
|
+
}, t.renderToDataURL = function(i, s, a) {
|
|
2398
|
+
let l = a;
|
|
2399
|
+
typeof l > "u" && (!s || !s.getContext) && (l = s, s = void 0), l || (l = {});
|
|
2400
|
+
const c = t.render(i, s, l), d = l.type || "image/png", R = l.rendererOpts || {};
|
|
2401
|
+
return c.toDataURL(d, R.quality);
|
|
2402
|
+
};
|
|
2403
|
+
})(ln);
|
|
2404
|
+
var cn = {};
|
|
2405
|
+
const $i = Et;
|
|
2406
|
+
function Nt(t, e) {
|
|
2407
|
+
const n = t.a / 255, o = e + '="' + t.hex + '"';
|
|
2408
|
+
return n < 1 ? o + " " + e + '-opacity="' + n.toFixed(2).slice(1) + '"' : o;
|
|
2409
|
+
}
|
|
2410
|
+
function ut(t, e, n) {
|
|
2411
|
+
let o = t + e;
|
|
2412
|
+
return typeof n < "u" && (o += " " + n), o;
|
|
2413
|
+
}
|
|
2414
|
+
function xi(t, e, n) {
|
|
2415
|
+
let o = "", r = 0, i = !1, s = 0;
|
|
2416
|
+
for (let a = 0; a < t.length; a++) {
|
|
2417
|
+
const l = Math.floor(a % e), c = Math.floor(a / e);
|
|
2418
|
+
!l && !i && (i = !0), t[a] ? (s++, a > 0 && l > 0 && t[a - 1] || (o += i ? ut("M", l + n, 0.5 + c + n) : ut("m", r, 0), r = 0, i = !1), l + 1 < e && t[a + 1] || (o += ut("h", s), s = 0)) : r++;
|
|
2419
|
+
}
|
|
2420
|
+
return o;
|
|
2421
|
+
}
|
|
2422
|
+
cn.render = function(e, n, o) {
|
|
2423
|
+
const r = $i.getOptions(n), i = e.modules.size, s = e.modules.data, a = i + r.margin * 2, l = r.color.light.a ? "<path " + Nt(r.color.light, "fill") + ' d="M0 0h' + a + "v" + a + 'H0z"/>' : "", c = "<path " + Nt(r.color.dark, "stroke") + ' d="' + xi(s, i, r.margin) + '"/>', d = 'viewBox="0 0 ' + a + " " + a + '"', y = '<svg xmlns="http://www.w3.org/2000/svg" ' + (r.width ? 'width="' + r.width + '" height="' + r.width + '" ' : "") + d + ' shape-rendering="crispEdges">' + l + c + `</svg>
|
|
2424
|
+
`;
|
|
2425
|
+
return typeof o == "function" && o(null, y), y;
|
|
2426
|
+
};
|
|
2427
|
+
const Ei = On, bt = Gt, un = ln, Ri = cn;
|
|
2428
|
+
function Rt(t, e, n, o, r) {
|
|
2429
|
+
const i = [].slice.call(arguments, 1), s = i.length, a = typeof i[s - 1] == "function";
|
|
2430
|
+
if (!a && !Ei())
|
|
2431
|
+
throw new Error("Callback required as last argument");
|
|
2432
|
+
if (a) {
|
|
2433
|
+
if (s < 2)
|
|
2434
|
+
throw new Error("Too few arguments provided");
|
|
2435
|
+
s === 2 ? (r = n, n = e, e = o = void 0) : s === 3 && (e.getContext && typeof r > "u" ? (r = o, o = void 0) : (r = o, o = n, n = e, e = void 0));
|
|
2436
|
+
} else {
|
|
2437
|
+
if (s < 1)
|
|
2438
|
+
throw new Error("Too few arguments provided");
|
|
2439
|
+
return s === 1 ? (n = e, e = o = void 0) : s === 2 && !e.getContext && (o = n, n = e, e = void 0), new Promise(function(l, c) {
|
|
2440
|
+
try {
|
|
2441
|
+
const d = bt.create(n, o);
|
|
2442
|
+
l(t(d, e, o));
|
|
2443
|
+
} catch (d) {
|
|
2444
|
+
c(d);
|
|
2445
|
+
}
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
try {
|
|
2449
|
+
const l = bt.create(n, o);
|
|
2450
|
+
r(null, t(l, e, o));
|
|
2451
|
+
} catch (l) {
|
|
2452
|
+
r(l);
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
Be.create = bt.create;
|
|
2456
|
+
Be.toCanvas = Rt.bind(null, un.render);
|
|
2457
|
+
Be.toDataURL = Rt.bind(null, un.renderToDataURL);
|
|
2458
|
+
Be.toString = Rt.bind(null, function(t, e, n) {
|
|
2459
|
+
return Ri.render(t, n);
|
|
2460
|
+
});
|
|
2461
|
+
const _i = 0.1, Ot = 2.5, Z = 7;
|
|
2462
|
+
function dt(t, e, n) {
|
|
2463
|
+
return t === e ? !1 : (t - e < 0 ? e - t : t - e) <= n + _i;
|
|
2464
|
+
}
|
|
2465
|
+
function Si(t, e) {
|
|
2466
|
+
const n = Array.prototype.slice.call(Be.create(t, { errorCorrectionLevel: e }).modules.data, 0), o = Math.sqrt(n.length);
|
|
2467
|
+
return n.reduce((r, i, s) => (s % o === 0 ? r.push([i]) : r[r.length - 1].push(i)) && r, []);
|
|
2468
|
+
}
|
|
2469
|
+
const Ti = {
|
|
2470
|
+
generate({ uri: t, size: e, logoSize: n, padding: o = 8, dotColor: r = "var(--apkt-colors-black)" }) {
|
|
2471
|
+
const s = [], a = Si(t, "Q"), l = (e - 2 * o) / a.length, c = [
|
|
2472
|
+
{ x: 0, y: 0 },
|
|
2473
|
+
{ x: 1, y: 0 },
|
|
2474
|
+
{ x: 0, y: 1 }
|
|
2475
|
+
];
|
|
2476
|
+
c.forEach(({ x: m, y: C }) => {
|
|
2477
|
+
const g = (a.length - Z) * l * m + o, p = (a.length - Z) * l * C + o, w = 0.45;
|
|
2478
|
+
for (let h = 0; h < c.length; h += 1) {
|
|
2479
|
+
const x = l * (Z - h * 2);
|
|
2480
|
+
s.push(je`
|
|
2481
|
+
<rect
|
|
2482
|
+
fill=${h === 2 ? "var(--apkt-colors-black)" : "var(--apkt-colors-white)"}
|
|
2483
|
+
width=${h === 0 ? x - 10 : x}
|
|
2484
|
+
rx= ${h === 0 ? (x - 10) * w : x * w}
|
|
2485
|
+
ry= ${h === 0 ? (x - 10) * w : x * w}
|
|
2486
|
+
stroke=${r}
|
|
2487
|
+
stroke-width=${h === 0 ? 10 : 0}
|
|
2488
|
+
height=${h === 0 ? x - 10 : x}
|
|
2489
|
+
x= ${h === 0 ? p + l * h + 10 / 2 : p + l * h}
|
|
2490
|
+
y= ${h === 0 ? g + l * h + 10 / 2 : g + l * h}
|
|
2491
|
+
/>
|
|
2492
|
+
`);
|
|
2493
|
+
}
|
|
2494
|
+
});
|
|
2495
|
+
const d = Math.floor((n + 25) / l), R = a.length / 2 - d / 2, y = a.length / 2 + d / 2 - 1, b = [];
|
|
2496
|
+
a.forEach((m, C) => {
|
|
2497
|
+
m.forEach((g, p) => {
|
|
2498
|
+
if (a[C][p] && !(C < Z && p < Z || C > a.length - (Z + 1) && p < Z || C < Z && p > a.length - (Z + 1)) && !(C > R && C < y && p > R && p < y)) {
|
|
2499
|
+
const w = C * l + l / 2 + o, h = p * l + l / 2 + o;
|
|
2500
|
+
b.push([w, h]);
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
});
|
|
2504
|
+
const v = {};
|
|
2505
|
+
return b.forEach(([m, C]) => {
|
|
2506
|
+
var g;
|
|
2507
|
+
v[m] ? (g = v[m]) == null || g.push(C) : v[m] = [C];
|
|
2508
|
+
}), Object.entries(v).map(([m, C]) => {
|
|
2509
|
+
const g = C.filter((p) => C.every((w) => !dt(p, w, l)));
|
|
2510
|
+
return [Number(m), g];
|
|
2511
|
+
}).forEach(([m, C]) => {
|
|
2512
|
+
C.forEach((g) => {
|
|
2513
|
+
s.push(je`<circle cx=${m} cy=${g} fill=${r} r=${l / Ot} />`);
|
|
2514
|
+
});
|
|
2515
|
+
}), Object.entries(v).filter(([m, C]) => C.length > 1).map(([m, C]) => {
|
|
2516
|
+
const g = C.filter((p) => C.some((w) => dt(p, w, l)));
|
|
2517
|
+
return [Number(m), g];
|
|
2518
|
+
}).map(([m, C]) => {
|
|
2519
|
+
C.sort((p, w) => p < w ? -1 : 1);
|
|
2520
|
+
const g = [];
|
|
2521
|
+
for (const p of C) {
|
|
2522
|
+
const w = g.find((h) => h.some((x) => dt(p, x, l)));
|
|
2523
|
+
w ? w.push(p) : g.push([p]);
|
|
2524
|
+
}
|
|
2525
|
+
return [m, g.map((p) => [p[0], p[p.length - 1]])];
|
|
2526
|
+
}).forEach(([m, C]) => {
|
|
2527
|
+
C.forEach(([g, p]) => {
|
|
2528
|
+
s.push(je`
|
|
2529
|
+
<line
|
|
2530
|
+
x1=${m}
|
|
2531
|
+
x2=${m}
|
|
2532
|
+
y1=${g}
|
|
2533
|
+
y2=${p}
|
|
2534
|
+
stroke=${r}
|
|
2535
|
+
stroke-width=${l / (Ot / 2)}
|
|
2536
|
+
stroke-linecap="round"
|
|
2537
|
+
/>
|
|
2538
|
+
`);
|
|
2539
|
+
});
|
|
2540
|
+
}), s;
|
|
2541
|
+
}
|
|
2542
|
+
}, Ii = k`
|
|
2543
|
+
:host {
|
|
2544
|
+
position: relative;
|
|
2545
|
+
user-select: none;
|
|
2546
|
+
display: block;
|
|
2547
|
+
overflow: hidden;
|
|
2548
|
+
aspect-ratio: 1 / 1;
|
|
2549
|
+
width: 100%;
|
|
2550
|
+
height: 100%;
|
|
2551
|
+
background-color: ${({ colors: t }) => t.white};
|
|
2552
|
+
border: 1px solid ${({ tokens: t }) => t.theme.borderPrimary};
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
:host {
|
|
2556
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
2557
|
+
display: flex;
|
|
2558
|
+
align-items: center;
|
|
2559
|
+
justify-content: center;
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
:host([data-clear='true']) > wui-icon {
|
|
2563
|
+
display: none;
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
svg:first-child,
|
|
2567
|
+
wui-image,
|
|
2568
|
+
wui-icon {
|
|
2569
|
+
position: absolute;
|
|
2570
|
+
top: 50%;
|
|
2571
|
+
left: 50%;
|
|
2572
|
+
transform: translateY(-50%) translateX(-50%);
|
|
2573
|
+
background-color: ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
2574
|
+
box-shadow: inset 0 0 0 4px ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
2575
|
+
border-radius: ${({ borderRadius: t }) => t[6]};
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
wui-image {
|
|
2579
|
+
width: 25%;
|
|
2580
|
+
height: 25%;
|
|
2581
|
+
border-radius: ${({ borderRadius: t }) => t[2]};
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
wui-icon {
|
|
2585
|
+
width: 100%;
|
|
2586
|
+
height: 100%;
|
|
2587
|
+
color: #3396ff !important;
|
|
2588
|
+
transform: translateY(-50%) translateX(-50%) scale(0.25);
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
wui-icon > svg {
|
|
2592
|
+
width: inherit;
|
|
2593
|
+
height: inherit;
|
|
2594
|
+
}
|
|
2595
|
+
`;
|
|
2596
|
+
var le = function(t, e, n, o) {
|
|
2597
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
2598
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
2599
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
2600
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
2601
|
+
};
|
|
2602
|
+
let Q = class extends I {
|
|
2603
|
+
constructor() {
|
|
2604
|
+
super(...arguments), this.uri = "", this.size = 500, this.theme = "dark", this.imageSrc = void 0, this.alt = void 0, this.arenaClear = void 0, this.farcaster = void 0;
|
|
2605
|
+
}
|
|
2606
|
+
render() {
|
|
2607
|
+
return this.dataset.theme = this.theme, this.dataset.clear = String(this.arenaClear), u`<wui-flex
|
|
2608
|
+
alignItems="center"
|
|
2609
|
+
justifyContent="center"
|
|
2610
|
+
class="wui-qr-code"
|
|
2611
|
+
direction="column"
|
|
2612
|
+
gap="4"
|
|
2613
|
+
width="100%"
|
|
2614
|
+
style="height: 100%"
|
|
2615
|
+
>
|
|
2616
|
+
${this.templateVisual()} ${this.templateSvg()}
|
|
2617
|
+
</wui-flex>`;
|
|
2618
|
+
}
|
|
2619
|
+
templateSvg() {
|
|
2620
|
+
return je`
|
|
2621
|
+
<svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
|
|
2622
|
+
${Ti.generate({
|
|
2623
|
+
uri: this.uri,
|
|
2624
|
+
size: this.size,
|
|
2625
|
+
logoSize: this.arenaClear ? 0 : this.size / 4
|
|
2626
|
+
})}
|
|
2627
|
+
</svg>
|
|
2628
|
+
`;
|
|
2629
|
+
}
|
|
2630
|
+
templateVisual() {
|
|
2631
|
+
return this.imageSrc ? u`<wui-image src=${this.imageSrc} alt=${this.alt ?? "logo"}></wui-image>` : this.farcaster ? u`<wui-icon
|
|
2632
|
+
class="farcaster"
|
|
2633
|
+
size="inherit"
|
|
2634
|
+
color="inherit"
|
|
2635
|
+
name="farcaster"
|
|
2636
|
+
></wui-icon>` : u`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`;
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
Q.styles = [H, Ii];
|
|
2640
|
+
le([
|
|
2641
|
+
f()
|
|
2642
|
+
], Q.prototype, "uri", void 0);
|
|
2643
|
+
le([
|
|
2644
|
+
f({ type: Number })
|
|
2645
|
+
], Q.prototype, "size", void 0);
|
|
2646
|
+
le([
|
|
2647
|
+
f()
|
|
2648
|
+
], Q.prototype, "theme", void 0);
|
|
2649
|
+
le([
|
|
2650
|
+
f()
|
|
2651
|
+
], Q.prototype, "imageSrc", void 0);
|
|
2652
|
+
le([
|
|
2653
|
+
f()
|
|
2654
|
+
], Q.prototype, "alt", void 0);
|
|
2655
|
+
le([
|
|
2656
|
+
f({ type: Boolean })
|
|
2657
|
+
], Q.prototype, "arenaClear", void 0);
|
|
2658
|
+
le([
|
|
2659
|
+
f({ type: Boolean })
|
|
2660
|
+
], Q.prototype, "farcaster", void 0);
|
|
2661
|
+
Q = le([
|
|
2662
|
+
S("wui-qr-code")
|
|
2663
|
+
], Q);
|
|
2664
|
+
const Ai = k`
|
|
2665
|
+
wui-shimmer {
|
|
2666
|
+
width: 100%;
|
|
2667
|
+
aspect-ratio: 1 / 1;
|
|
2668
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
wui-qr-code {
|
|
2672
|
+
opacity: 0;
|
|
2673
|
+
animation-duration: ${({ durations: t }) => t.xl};
|
|
2674
|
+
animation-timing-function: ${({ easings: t }) => t["ease-out-power-2"]};
|
|
2675
|
+
animation-name: fade-in;
|
|
2676
|
+
animation-fill-mode: forwards;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
@keyframes fade-in {
|
|
2680
|
+
from {
|
|
2681
|
+
opacity: 0;
|
|
2682
|
+
}
|
|
2683
|
+
to {
|
|
2684
|
+
opacity: 1;
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
`;
|
|
2688
|
+
var dn = function(t, e, n, o) {
|
|
2689
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
2690
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
2691
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
2692
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
2693
|
+
};
|
|
2694
|
+
let He = class extends L {
|
|
2695
|
+
constructor() {
|
|
2696
|
+
super(), this.basic = !1;
|
|
2697
|
+
}
|
|
2698
|
+
firstUpdated() {
|
|
2699
|
+
var e, n, o;
|
|
2700
|
+
this.basic || D.sendEvent({
|
|
2701
|
+
type: "track",
|
|
2702
|
+
event: "SELECT_WALLET",
|
|
2703
|
+
properties: {
|
|
2704
|
+
name: ((e = this.wallet) == null ? void 0 : e.name) ?? "WalletConnect",
|
|
2705
|
+
platform: "qrcode",
|
|
2706
|
+
displayIndex: (n = this.wallet) == null ? void 0 : n.display_index,
|
|
2707
|
+
walletRank: (o = this.wallet) == null ? void 0 : o.order,
|
|
2708
|
+
view: E.state.view
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
disconnectedCallback() {
|
|
2713
|
+
var e;
|
|
2714
|
+
super.disconnectedCallback(), (e = this.unsubscribe) == null || e.forEach((n) => n());
|
|
2715
|
+
}
|
|
2716
|
+
render() {
|
|
2717
|
+
return this.onRenderProxy(), u`
|
|
2718
|
+
<wui-flex
|
|
2719
|
+
flexDirection="column"
|
|
2720
|
+
alignItems="center"
|
|
2721
|
+
.padding=${["0", "5", "5", "5"]}
|
|
2722
|
+
gap="5"
|
|
2723
|
+
>
|
|
2724
|
+
<wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
2725
|
+
<wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
|
|
2726
|
+
${this.copyTemplate()}
|
|
2727
|
+
</wui-flex>
|
|
2728
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
2729
|
+
`;
|
|
2730
|
+
}
|
|
2731
|
+
onRenderProxy() {
|
|
2732
|
+
!this.ready && this.uri && (this.ready = !0);
|
|
2733
|
+
}
|
|
2734
|
+
qrCodeTemplate() {
|
|
2735
|
+
if (!this.uri || !this.ready)
|
|
2736
|
+
return null;
|
|
2737
|
+
const e = this.wallet ? this.wallet.name : void 0;
|
|
2738
|
+
_.setWcLinking(void 0), _.setRecentWallet(this.wallet);
|
|
2739
|
+
const n = De.state.themeVariables["--apkt-qr-color"] ?? De.state.themeVariables["--w3m-qr-color"];
|
|
2740
|
+
return u` <wui-qr-code
|
|
2741
|
+
theme=${De.state.themeMode}
|
|
2742
|
+
uri=${this.uri}
|
|
2743
|
+
imageSrc=${W(re.getWalletImage(this.wallet))}
|
|
2744
|
+
color=${W(n)}
|
|
2745
|
+
alt=${W(e)}
|
|
2746
|
+
data-testid="wui-qr-code"
|
|
2747
|
+
></wui-qr-code>`;
|
|
2748
|
+
}
|
|
2749
|
+
copyTemplate() {
|
|
2750
|
+
const e = !this.uri || !this.ready;
|
|
2751
|
+
return u`<wui-button
|
|
2752
|
+
.disabled=${e}
|
|
2753
|
+
@click=${this.onCopyUri}
|
|
2754
|
+
variant="neutral-secondary"
|
|
2755
|
+
size="sm"
|
|
2756
|
+
data-testid="copy-wc2-uri"
|
|
2757
|
+
>
|
|
2758
|
+
Copy link
|
|
2759
|
+
<wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
|
|
2760
|
+
</wui-button>`;
|
|
2761
|
+
}
|
|
2762
|
+
};
|
|
2763
|
+
He.styles = Ai;
|
|
2764
|
+
dn([
|
|
2765
|
+
f({ type: Boolean })
|
|
2766
|
+
], He.prototype, "basic", void 0);
|
|
2767
|
+
He = dn([
|
|
2768
|
+
S("w3m-connecting-wc-qrcode")
|
|
2769
|
+
], He);
|
|
2770
|
+
var Wi = function(t, e, n, o) {
|
|
2771
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
2772
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
2773
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
2774
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
2775
|
+
};
|
|
2776
|
+
let Mt = class extends I {
|
|
2777
|
+
constructor() {
|
|
2778
|
+
var e, n, o;
|
|
2779
|
+
if (super(), this.wallet = (e = E.state.data) == null ? void 0 : e.wallet, !this.wallet)
|
|
2780
|
+
throw new Error("w3m-connecting-wc-unsupported: No wallet provided");
|
|
2781
|
+
D.sendEvent({
|
|
2782
|
+
type: "track",
|
|
2783
|
+
event: "SELECT_WALLET",
|
|
2784
|
+
properties: {
|
|
2785
|
+
name: this.wallet.name,
|
|
2786
|
+
platform: "browser",
|
|
2787
|
+
displayIndex: (n = this.wallet) == null ? void 0 : n.display_index,
|
|
2788
|
+
walletRank: (o = this.wallet) == null ? void 0 : o.order,
|
|
2789
|
+
view: E.state.view
|
|
2790
|
+
}
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
render() {
|
|
2794
|
+
return u`
|
|
2795
|
+
<wui-flex
|
|
2796
|
+
flexDirection="column"
|
|
2797
|
+
alignItems="center"
|
|
2798
|
+
.padding=${["10", "5", "5", "5"]}
|
|
2799
|
+
gap="5"
|
|
2800
|
+
>
|
|
2801
|
+
<wui-wallet-image
|
|
2802
|
+
size="lg"
|
|
2803
|
+
imageSrc=${W(re.getWalletImage(this.wallet))}
|
|
2804
|
+
></wui-wallet-image>
|
|
2805
|
+
|
|
2806
|
+
<wui-text variant="md-regular" color="primary">Not Detected</wui-text>
|
|
2807
|
+
</wui-flex>
|
|
2808
|
+
|
|
2809
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
2810
|
+
`;
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
Mt = Wi([
|
|
2814
|
+
S("w3m-connecting-wc-unsupported")
|
|
2815
|
+
], Mt);
|
|
2816
|
+
var hn = function(t, e, n, o) {
|
|
2817
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
2818
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
2819
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
2820
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
2821
|
+
};
|
|
2822
|
+
let yt = class extends L {
|
|
2823
|
+
constructor() {
|
|
2824
|
+
var e, n;
|
|
2825
|
+
if (super(), this.isLoading = !0, !this.wallet)
|
|
2826
|
+
throw new Error("w3m-connecting-wc-web: No wallet provided");
|
|
2827
|
+
this.onConnect = this.onConnectProxy.bind(this), this.secondaryBtnLabel = "Open", this.secondaryLabel = Vt.CONNECT_LABELS.MOBILE, this.secondaryBtnIcon = "externalLink", this.updateLoadingState(), this.unsubscribe.push(_.subscribeKey("wcUri", () => {
|
|
2828
|
+
this.updateLoadingState();
|
|
2829
|
+
})), D.sendEvent({
|
|
2830
|
+
type: "track",
|
|
2831
|
+
event: "SELECT_WALLET",
|
|
2832
|
+
properties: {
|
|
2833
|
+
name: this.wallet.name,
|
|
2834
|
+
platform: "web",
|
|
2835
|
+
displayIndex: (e = this.wallet) == null ? void 0 : e.display_index,
|
|
2836
|
+
walletRank: (n = this.wallet) == null ? void 0 : n.order,
|
|
2837
|
+
view: E.state.view
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
updateLoadingState() {
|
|
2842
|
+
this.isLoading = !this.uri;
|
|
2843
|
+
}
|
|
2844
|
+
onConnectProxy() {
|
|
2845
|
+
var e;
|
|
2846
|
+
if ((e = this.wallet) != null && e.webapp_link && this.uri)
|
|
2847
|
+
try {
|
|
2848
|
+
this.error = !1;
|
|
2849
|
+
const { webapp_link: n, name: o } = this.wallet, { redirect: r, href: i } = T.formatUniversalUrl(n, this.uri);
|
|
2850
|
+
_.setWcLinking({ name: o, href: i }), _.setRecentWallet(this.wallet), T.openHref(r, "_blank");
|
|
2851
|
+
} catch {
|
|
2852
|
+
this.error = !0;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
};
|
|
2856
|
+
hn([
|
|
2857
|
+
$()
|
|
2858
|
+
], yt.prototype, "isLoading", void 0);
|
|
2859
|
+
yt = hn([
|
|
2860
|
+
S("w3m-connecting-wc-web")
|
|
2861
|
+
], yt);
|
|
2862
|
+
const Pi = k`
|
|
2863
|
+
:host([data-mobile-fullscreen='true']) {
|
|
2864
|
+
height: 100%;
|
|
2865
|
+
display: flex;
|
|
2866
|
+
flex-direction: column;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
:host([data-mobile-fullscreen='true']) wui-ux-by-reown {
|
|
2870
|
+
margin-top: auto;
|
|
2871
|
+
}
|
|
2872
|
+
`;
|
|
2873
|
+
var we = function(t, e, n, o) {
|
|
2874
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
2875
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
2876
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
2877
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
2878
|
+
};
|
|
2879
|
+
let ne = class extends I {
|
|
2880
|
+
constructor() {
|
|
2881
|
+
var e;
|
|
2882
|
+
super(), this.wallet = (e = E.state.data) == null ? void 0 : e.wallet, this.unsubscribe = [], this.platform = void 0, this.platforms = [], this.isSiwxEnabled = !!N.state.siwx, this.remoteFeatures = N.state.remoteFeatures, this.displayBranding = !0, this.basic = !1, this.determinePlatforms(), this.initializeConnection(), this.unsubscribe.push(N.subscribeKey("remoteFeatures", (n) => this.remoteFeatures = n));
|
|
2883
|
+
}
|
|
2884
|
+
disconnectedCallback() {
|
|
2885
|
+
this.unsubscribe.forEach((e) => e());
|
|
2886
|
+
}
|
|
2887
|
+
render() {
|
|
2888
|
+
return N.state.enableMobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), u`
|
|
2889
|
+
${this.headerTemplate()}
|
|
2890
|
+
<div class="platform-container">${this.platformTemplate()}</div>
|
|
2891
|
+
${this.reownBrandingTemplate()}
|
|
2892
|
+
`;
|
|
2893
|
+
}
|
|
2894
|
+
reownBrandingTemplate() {
|
|
2895
|
+
var e;
|
|
2896
|
+
return !((e = this.remoteFeatures) != null && e.reownBranding) || !this.displayBranding ? null : u`<wui-ux-by-reown></wui-ux-by-reown>`;
|
|
2897
|
+
}
|
|
2898
|
+
async initializeConnection(e = !1) {
|
|
2899
|
+
var n, o;
|
|
2900
|
+
if (!(this.platform === "browser" || N.state.manualWCControl && !e))
|
|
2901
|
+
try {
|
|
2902
|
+
const { wcPairingExpiry: r, status: i } = _.state, { redirectView: s } = E.state.data ?? {};
|
|
2903
|
+
if (e || N.state.enableEmbedded || T.isPairingExpired(r) || i === "connecting") {
|
|
2904
|
+
const a = _.getConnections(ee.state.activeChain), l = (n = this.remoteFeatures) == null ? void 0 : n.multiWallet, c = a.length > 0;
|
|
2905
|
+
await _.connectWalletConnect({ cache: "never" }), this.isSiwxEnabled || (c && l ? (E.replace("ProfileWallets"), Ie.showSuccess("New Wallet Added")) : s ? E.replace(s) : Ut.close());
|
|
2906
|
+
}
|
|
2907
|
+
} catch (r) {
|
|
2908
|
+
if (r instanceof Error && r.message.includes("An error occurred when attempting to switch chain") && !N.state.enableNetworkSwitch && ee.state.activeChain) {
|
|
2909
|
+
ee.setActiveCaipNetwork(vn.getUnsupportedNetwork(`${ee.state.activeChain}:${(o = ee.state.activeCaipNetwork) == null ? void 0 : o.id}`)), ee.showUnsupportedChainUI();
|
|
2910
|
+
return;
|
|
2911
|
+
}
|
|
2912
|
+
r instanceof zt && r.originalName === Ft.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST ? D.sendEvent({
|
|
2913
|
+
type: "track",
|
|
2914
|
+
event: "USER_REJECTED",
|
|
2915
|
+
properties: { message: r.message }
|
|
2916
|
+
}) : D.sendEvent({
|
|
2917
|
+
type: "track",
|
|
2918
|
+
event: "CONNECT_ERROR",
|
|
2919
|
+
properties: { message: (r == null ? void 0 : r.message) ?? "Unknown" }
|
|
2920
|
+
}), _.setWcError(!0), Ie.showError(r.message ?? "Connection error"), _.resetWcConnection(), E.goBack();
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
determinePlatforms() {
|
|
2924
|
+
if (!this.wallet) {
|
|
2925
|
+
this.platforms.push("qrcode"), this.platform = "qrcode";
|
|
2926
|
+
return;
|
|
2927
|
+
}
|
|
2928
|
+
if (this.platform)
|
|
2929
|
+
return;
|
|
2930
|
+
const { mobile_link: e, desktop_link: n, webapp_link: o, injected: r, rdns: i } = this.wallet, s = r == null ? void 0 : r.map(({ injected_id: v }) => v).filter(Boolean), a = [...i ? [i] : s ?? []], l = N.state.isUniversalProvider ? !1 : a.length, c = e, d = o, R = _.checkInstalled(a), y = l && R, b = n && !T.isMobile();
|
|
2931
|
+
y && !ee.state.noAdapters && this.platforms.push("browser"), c && this.platforms.push(T.isMobile() ? "mobile" : "qrcode"), d && this.platforms.push("web"), b && this.platforms.push("desktop"), !y && l && !ee.state.noAdapters && this.platforms.push("unsupported"), this.platform = this.platforms[0];
|
|
2932
|
+
}
|
|
2933
|
+
platformTemplate() {
|
|
2934
|
+
switch (this.platform) {
|
|
2935
|
+
case "browser":
|
|
2936
|
+
return u`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;
|
|
2937
|
+
case "web":
|
|
2938
|
+
return u`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;
|
|
2939
|
+
case "desktop":
|
|
2940
|
+
return u`
|
|
2941
|
+
<w3m-connecting-wc-desktop .onRetry=${() => this.initializeConnection(!0)}>
|
|
2942
|
+
</w3m-connecting-wc-desktop>
|
|
2943
|
+
`;
|
|
2944
|
+
case "mobile":
|
|
2945
|
+
return u`
|
|
2946
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${() => this.initializeConnection(!0)}>
|
|
2947
|
+
</w3m-connecting-wc-mobile>
|
|
2948
|
+
`;
|
|
2949
|
+
case "qrcode":
|
|
2950
|
+
return u`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;
|
|
2951
|
+
default:
|
|
2952
|
+
return u`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`;
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
headerTemplate() {
|
|
2956
|
+
return this.platforms.length > 1 ? u`
|
|
2957
|
+
<w3m-connecting-header
|
|
2958
|
+
.platforms=${this.platforms}
|
|
2959
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
2960
|
+
>
|
|
2961
|
+
</w3m-connecting-header>
|
|
2962
|
+
` : null;
|
|
2963
|
+
}
|
|
2964
|
+
async onSelectPlatform(e) {
|
|
2965
|
+
var o;
|
|
2966
|
+
const n = (o = this.shadowRoot) == null ? void 0 : o.querySelector("div");
|
|
2967
|
+
n && (await n.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
2968
|
+
duration: 200,
|
|
2969
|
+
fill: "forwards",
|
|
2970
|
+
easing: "ease"
|
|
2971
|
+
}).finished, this.platform = e, n.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
2972
|
+
duration: 200,
|
|
2973
|
+
fill: "forwards",
|
|
2974
|
+
easing: "ease"
|
|
2975
|
+
}));
|
|
2976
|
+
}
|
|
2977
|
+
};
|
|
2978
|
+
ne.styles = Pi;
|
|
2979
|
+
we([
|
|
2980
|
+
$()
|
|
2981
|
+
], ne.prototype, "platform", void 0);
|
|
2982
|
+
we([
|
|
2983
|
+
$()
|
|
2984
|
+
], ne.prototype, "platforms", void 0);
|
|
2985
|
+
we([
|
|
2986
|
+
$()
|
|
2987
|
+
], ne.prototype, "isSiwxEnabled", void 0);
|
|
2988
|
+
we([
|
|
2989
|
+
$()
|
|
2990
|
+
], ne.prototype, "remoteFeatures", void 0);
|
|
2991
|
+
we([
|
|
2992
|
+
f({ type: Boolean })
|
|
2993
|
+
], ne.prototype, "displayBranding", void 0);
|
|
2994
|
+
we([
|
|
2995
|
+
f({ type: Boolean })
|
|
2996
|
+
], ne.prototype, "basic", void 0);
|
|
2997
|
+
ne = we([
|
|
2998
|
+
S("w3m-connecting-wc-view")
|
|
2999
|
+
], ne);
|
|
3000
|
+
var _t = function(t, e, n, o) {
|
|
3001
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3002
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3003
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3004
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3005
|
+
};
|
|
3006
|
+
let Ke = class extends I {
|
|
3007
|
+
constructor() {
|
|
3008
|
+
super(), this.unsubscribe = [], this.isMobile = T.isMobile(), this.remoteFeatures = N.state.remoteFeatures, this.unsubscribe.push(N.subscribeKey("remoteFeatures", (e) => this.remoteFeatures = e));
|
|
3009
|
+
}
|
|
3010
|
+
disconnectedCallback() {
|
|
3011
|
+
this.unsubscribe.forEach((e) => e());
|
|
3012
|
+
}
|
|
3013
|
+
render() {
|
|
3014
|
+
if (this.isMobile) {
|
|
3015
|
+
const { featured: e, recommended: n } = P.state, { customWallets: o } = N.state, r = Cn.getRecentWallets(), i = e.length || n.length || (o == null ? void 0 : o.length) || r.length;
|
|
3016
|
+
return u`<wui-flex flexDirection="column" gap="2" .margin=${["1", "3", "3", "3"]}>
|
|
3017
|
+
${i ? u`<w3m-connector-list></w3m-connector-list>` : null}
|
|
3018
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
3019
|
+
</wui-flex>`;
|
|
3020
|
+
}
|
|
3021
|
+
return u`<wui-flex flexDirection="column" .padding=${["0", "0", "4", "0"]}>
|
|
3022
|
+
<w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
|
|
3023
|
+
<wui-flex flexDirection="column" .padding=${["0", "3", "0", "3"]}>
|
|
3024
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
3025
|
+
</wui-flex>
|
|
3026
|
+
</wui-flex>
|
|
3027
|
+
${this.reownBrandingTemplate()} `;
|
|
3028
|
+
}
|
|
3029
|
+
reownBrandingTemplate() {
|
|
3030
|
+
var e;
|
|
3031
|
+
return (e = this.remoteFeatures) != null && e.reownBranding ? u` <wui-flex flexDirection="column" .padding=${["1", "0", "1", "0"]}>
|
|
3032
|
+
<wui-ux-by-reown></wui-ux-by-reown>
|
|
3033
|
+
</wui-flex>` : null;
|
|
3034
|
+
}
|
|
3035
|
+
};
|
|
3036
|
+
_t([
|
|
3037
|
+
$()
|
|
3038
|
+
], Ke.prototype, "isMobile", void 0);
|
|
3039
|
+
_t([
|
|
3040
|
+
$()
|
|
3041
|
+
], Ke.prototype, "remoteFeatures", void 0);
|
|
3042
|
+
Ke = _t([
|
|
3043
|
+
S("w3m-connecting-wc-basic-view")
|
|
3044
|
+
], Ke);
|
|
3045
|
+
/**
|
|
3046
|
+
* @license
|
|
3047
|
+
* Copyright 2020 Google LLC
|
|
3048
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3049
|
+
*/
|
|
3050
|
+
const Bi = (t) => t.strings === void 0;
|
|
3051
|
+
/**
|
|
3052
|
+
* @license
|
|
3053
|
+
* Copyright 2017 Google LLC
|
|
3054
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3055
|
+
*/
|
|
3056
|
+
const Te = (t, e) => {
|
|
3057
|
+
var o;
|
|
3058
|
+
const n = t._$AN;
|
|
3059
|
+
if (n === void 0) return !1;
|
|
3060
|
+
for (const r of n) (o = r._$AO) == null || o.call(r, e, !1), Te(r, e);
|
|
3061
|
+
return !0;
|
|
3062
|
+
}, Ge = (t) => {
|
|
3063
|
+
let e, n;
|
|
3064
|
+
do {
|
|
3065
|
+
if ((e = t._$AM) === void 0) break;
|
|
3066
|
+
n = e._$AN, n.delete(t), t = e;
|
|
3067
|
+
} while ((n == null ? void 0 : n.size) === 0);
|
|
3068
|
+
}, fn = (t) => {
|
|
3069
|
+
for (let e; e = t._$AM; t = e) {
|
|
3070
|
+
let n = e._$AN;
|
|
3071
|
+
if (n === void 0) e._$AN = n = /* @__PURE__ */ new Set();
|
|
3072
|
+
else if (n.has(t)) break;
|
|
3073
|
+
n.add(t), Ni(e);
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
function ki(t) {
|
|
3077
|
+
this._$AN !== void 0 ? (Ge(this), this._$AM = t, fn(this)) : this._$AM = t;
|
|
3078
|
+
}
|
|
3079
|
+
function Li(t, e = !1, n = 0) {
|
|
3080
|
+
const o = this._$AH, r = this._$AN;
|
|
3081
|
+
if (r !== void 0 && r.size !== 0) if (e) if (Array.isArray(o)) for (let i = n; i < o.length; i++) Te(o[i], !1), Ge(o[i]);
|
|
3082
|
+
else o != null && (Te(o, !1), Ge(o));
|
|
3083
|
+
else Te(this, t);
|
|
3084
|
+
}
|
|
3085
|
+
const Ni = (t) => {
|
|
3086
|
+
t.type == xn.CHILD && (t._$AP ?? (t._$AP = Li), t._$AQ ?? (t._$AQ = ki));
|
|
3087
|
+
};
|
|
3088
|
+
class Oi extends $n {
|
|
3089
|
+
constructor() {
|
|
3090
|
+
super(...arguments), this._$AN = void 0;
|
|
3091
|
+
}
|
|
3092
|
+
_$AT(e, n, o) {
|
|
3093
|
+
super._$AT(e, n, o), fn(this), this.isConnected = e._$AU;
|
|
3094
|
+
}
|
|
3095
|
+
_$AO(e, n = !0) {
|
|
3096
|
+
var o, r;
|
|
3097
|
+
e !== this.isConnected && (this.isConnected = e, e ? (o = this.reconnected) == null || o.call(this) : (r = this.disconnected) == null || r.call(this)), n && (Te(this, e), Ge(this));
|
|
3098
|
+
}
|
|
3099
|
+
setValue(e) {
|
|
3100
|
+
if (Bi(this._$Ct)) this._$Ct._$AI(e, this);
|
|
3101
|
+
else {
|
|
3102
|
+
const n = [...this._$Ct._$AH];
|
|
3103
|
+
n[this._$Ci] = e, this._$Ct._$AI(n, this, 0);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
disconnected() {
|
|
3107
|
+
}
|
|
3108
|
+
reconnected() {
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
/**
|
|
3112
|
+
* @license
|
|
3113
|
+
* Copyright 2020 Google LLC
|
|
3114
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
3115
|
+
*/
|
|
3116
|
+
const St = () => new Mi();
|
|
3117
|
+
class Mi {
|
|
3118
|
+
}
|
|
3119
|
+
const ht = /* @__PURE__ */ new WeakMap(), Tt = En(class extends Oi {
|
|
3120
|
+
render(t) {
|
|
3121
|
+
return Wt;
|
|
3122
|
+
}
|
|
3123
|
+
update(t, [e]) {
|
|
3124
|
+
var o;
|
|
3125
|
+
const n = e !== this.G;
|
|
3126
|
+
return n && this.G !== void 0 && this.rt(void 0), (n || this.lt !== this.ct) && (this.G = e, this.ht = (o = t.options) == null ? void 0 : o.host, this.rt(this.ct = t.element)), Wt;
|
|
3127
|
+
}
|
|
3128
|
+
rt(t) {
|
|
3129
|
+
if (this.isConnected || (t = void 0), typeof this.G == "function") {
|
|
3130
|
+
const e = this.ht ?? globalThis;
|
|
3131
|
+
let n = ht.get(e);
|
|
3132
|
+
n === void 0 && (n = /* @__PURE__ */ new WeakMap(), ht.set(e, n)), n.get(this.G) !== void 0 && this.G.call(this.ht, void 0), n.set(this.G, t), t !== void 0 && this.G.call(this.ht, t);
|
|
3133
|
+
} else this.G.value = t;
|
|
3134
|
+
}
|
|
3135
|
+
get lt() {
|
|
3136
|
+
var t, e;
|
|
3137
|
+
return typeof this.G == "function" ? (t = ht.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.G) : (e = this.G) == null ? void 0 : e.value;
|
|
3138
|
+
}
|
|
3139
|
+
disconnected() {
|
|
3140
|
+
this.lt === this.ct && this.rt(void 0);
|
|
3141
|
+
}
|
|
3142
|
+
reconnected() {
|
|
3143
|
+
this.rt(this.ct);
|
|
3144
|
+
}
|
|
3145
|
+
}), Di = k`
|
|
3146
|
+
:host {
|
|
3147
|
+
display: flex;
|
|
3148
|
+
align-items: center;
|
|
3149
|
+
justify-content: center;
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
label {
|
|
3153
|
+
position: relative;
|
|
3154
|
+
display: inline-block;
|
|
3155
|
+
user-select: none;
|
|
3156
|
+
transition:
|
|
3157
|
+
background-color ${({ durations: t }) => t.lg}
|
|
3158
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3159
|
+
color ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3160
|
+
border ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3161
|
+
box-shadow ${({ durations: t }) => t.lg}
|
|
3162
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3163
|
+
width ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3164
|
+
height ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3165
|
+
transform ${({ durations: t }) => t.lg}
|
|
3166
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3167
|
+
opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]};
|
|
3168
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
input {
|
|
3172
|
+
width: 0;
|
|
3173
|
+
height: 0;
|
|
3174
|
+
opacity: 0;
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
span {
|
|
3178
|
+
position: absolute;
|
|
3179
|
+
cursor: pointer;
|
|
3180
|
+
top: 0;
|
|
3181
|
+
left: 0;
|
|
3182
|
+
right: 0;
|
|
3183
|
+
bottom: 0;
|
|
3184
|
+
background-color: ${({ colors: t }) => t.neutrals300};
|
|
3185
|
+
border-radius: ${({ borderRadius: t }) => t.round};
|
|
3186
|
+
border: 1px solid transparent;
|
|
3187
|
+
will-change: border;
|
|
3188
|
+
transition:
|
|
3189
|
+
background-color ${({ durations: t }) => t.lg}
|
|
3190
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3191
|
+
color ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3192
|
+
border ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3193
|
+
box-shadow ${({ durations: t }) => t.lg}
|
|
3194
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3195
|
+
width ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3196
|
+
height ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
3197
|
+
transform ${({ durations: t }) => t.lg}
|
|
3198
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
3199
|
+
opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]};
|
|
3200
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
span:before {
|
|
3204
|
+
content: '';
|
|
3205
|
+
position: absolute;
|
|
3206
|
+
background-color: ${({ colors: t }) => t.white};
|
|
3207
|
+
border-radius: 50%;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
/* -- Sizes --------------------------------------------------------- */
|
|
3211
|
+
label[data-size='lg'] {
|
|
3212
|
+
width: 48px;
|
|
3213
|
+
height: 32px;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
label[data-size='md'] {
|
|
3217
|
+
width: 40px;
|
|
3218
|
+
height: 28px;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
label[data-size='sm'] {
|
|
3222
|
+
width: 32px;
|
|
3223
|
+
height: 22px;
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
label[data-size='lg'] > span:before {
|
|
3227
|
+
height: 24px;
|
|
3228
|
+
width: 24px;
|
|
3229
|
+
left: 4px;
|
|
3230
|
+
top: 3px;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
label[data-size='md'] > span:before {
|
|
3234
|
+
height: 20px;
|
|
3235
|
+
width: 20px;
|
|
3236
|
+
left: 4px;
|
|
3237
|
+
top: 3px;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
label[data-size='sm'] > span:before {
|
|
3241
|
+
height: 16px;
|
|
3242
|
+
width: 16px;
|
|
3243
|
+
left: 3px;
|
|
3244
|
+
top: 2px;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
/* -- Focus states --------------------------------------------------- */
|
|
3248
|
+
input:focus-visible:not(:checked) + span,
|
|
3249
|
+
input:focus:not(:checked) + span {
|
|
3250
|
+
border: 1px solid ${({ tokens: t }) => t.core.iconAccentPrimary};
|
|
3251
|
+
background-color: ${({ tokens: t }) => t.theme.textTertiary};
|
|
3252
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
input:focus-visible:checked + span,
|
|
3256
|
+
input:focus:checked + span {
|
|
3257
|
+
border: 1px solid ${({ tokens: t }) => t.core.iconAccentPrimary};
|
|
3258
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3261
|
+
/* -- Checked states --------------------------------------------------- */
|
|
3262
|
+
input:checked + span {
|
|
3263
|
+
background-color: ${({ tokens: t }) => t.core.iconAccentPrimary};
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
label[data-size='lg'] > input:checked + span:before {
|
|
3267
|
+
transform: translateX(calc(100% - 9px));
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
label[data-size='md'] > input:checked + span:before {
|
|
3271
|
+
transform: translateX(calc(100% - 9px));
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
label[data-size='sm'] > input:checked + span:before {
|
|
3275
|
+
transform: translateX(calc(100% - 7px));
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
/* -- Hover states ------------------------------------------------------- */
|
|
3279
|
+
label:hover > input:not(:checked):not(:disabled) + span {
|
|
3280
|
+
background-color: ${({ colors: t }) => t.neutrals400};
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
label:hover > input:checked:not(:disabled) + span {
|
|
3284
|
+
background-color: ${({ colors: t }) => t.accent080};
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
3288
|
+
label:has(input:disabled) {
|
|
3289
|
+
pointer-events: none;
|
|
3290
|
+
user-select: none;
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
input:not(:checked):disabled + span {
|
|
3294
|
+
background-color: ${({ colors: t }) => t.neutrals700};
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
input:checked:disabled + span {
|
|
3298
|
+
background-color: ${({ colors: t }) => t.neutrals700};
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
input:not(:checked):disabled + span::before {
|
|
3302
|
+
background-color: ${({ colors: t }) => t.neutrals400};
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
input:checked:disabled + span::before {
|
|
3306
|
+
background-color: ${({ tokens: t }) => t.theme.textTertiary};
|
|
3307
|
+
}
|
|
3308
|
+
`;
|
|
3309
|
+
var ot = function(t, e, n, o) {
|
|
3310
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3311
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3312
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3313
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3314
|
+
};
|
|
3315
|
+
let $e = class extends I {
|
|
3316
|
+
constructor() {
|
|
3317
|
+
super(...arguments), this.inputElementRef = St(), this.checked = !1, this.disabled = !1, this.size = "md";
|
|
3318
|
+
}
|
|
3319
|
+
render() {
|
|
3320
|
+
return u`
|
|
3321
|
+
<label data-size=${this.size}>
|
|
3322
|
+
<input
|
|
3323
|
+
${Tt(this.inputElementRef)}
|
|
3324
|
+
type="checkbox"
|
|
3325
|
+
?checked=${this.checked}
|
|
3326
|
+
?disabled=${this.disabled}
|
|
3327
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
3328
|
+
/>
|
|
3329
|
+
<span></span>
|
|
3330
|
+
</label>
|
|
3331
|
+
`;
|
|
3332
|
+
}
|
|
3333
|
+
dispatchChangeEvent() {
|
|
3334
|
+
var e;
|
|
3335
|
+
this.dispatchEvent(new CustomEvent("switchChange", {
|
|
3336
|
+
detail: (e = this.inputElementRef.value) == null ? void 0 : e.checked,
|
|
3337
|
+
bubbles: !0,
|
|
3338
|
+
composed: !0
|
|
3339
|
+
}));
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
$e.styles = [H, ge, Di];
|
|
3343
|
+
ot([
|
|
3344
|
+
f({ type: Boolean })
|
|
3345
|
+
], $e.prototype, "checked", void 0);
|
|
3346
|
+
ot([
|
|
3347
|
+
f({ type: Boolean })
|
|
3348
|
+
], $e.prototype, "disabled", void 0);
|
|
3349
|
+
ot([
|
|
3350
|
+
f()
|
|
3351
|
+
], $e.prototype, "size", void 0);
|
|
3352
|
+
$e = ot([
|
|
3353
|
+
S("wui-toggle")
|
|
3354
|
+
], $e);
|
|
3355
|
+
const ji = k`
|
|
3356
|
+
:host {
|
|
3357
|
+
height: auto;
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
:host > wui-flex {
|
|
3361
|
+
height: 100%;
|
|
3362
|
+
display: flex;
|
|
3363
|
+
align-items: center;
|
|
3364
|
+
justify-content: center;
|
|
3365
|
+
column-gap: ${({ spacing: t }) => t[2]};
|
|
3366
|
+
padding: ${({ spacing: t }) => t[2]} ${({ spacing: t }) => t[3]};
|
|
3367
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
3368
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
3369
|
+
box-shadow: inset 0 0 0 1px ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
3370
|
+
transition: background-color ${({ durations: t }) => t.lg}
|
|
3371
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
3372
|
+
will-change: background-color;
|
|
3373
|
+
cursor: pointer;
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
wui-switch {
|
|
3377
|
+
pointer-events: none;
|
|
3378
|
+
}
|
|
3379
|
+
`;
|
|
3380
|
+
var pn = function(t, e, n, o) {
|
|
3381
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3382
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3383
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3384
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3385
|
+
};
|
|
3386
|
+
let Qe = class extends I {
|
|
3387
|
+
constructor() {
|
|
3388
|
+
super(...arguments), this.checked = !1;
|
|
3389
|
+
}
|
|
3390
|
+
render() {
|
|
3391
|
+
return u`
|
|
3392
|
+
<wui-flex>
|
|
3393
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
3394
|
+
<wui-toggle
|
|
3395
|
+
?checked=${this.checked}
|
|
3396
|
+
size="sm"
|
|
3397
|
+
@switchChange=${this.handleToggleChange.bind(this)}
|
|
3398
|
+
></wui-toggle>
|
|
3399
|
+
</wui-flex>
|
|
3400
|
+
`;
|
|
3401
|
+
}
|
|
3402
|
+
handleToggleChange(e) {
|
|
3403
|
+
e.stopPropagation(), this.checked = e.detail, this.dispatchSwitchEvent();
|
|
3404
|
+
}
|
|
3405
|
+
dispatchSwitchEvent() {
|
|
3406
|
+
this.dispatchEvent(new CustomEvent("certifiedSwitchChange", {
|
|
3407
|
+
detail: this.checked,
|
|
3408
|
+
bubbles: !0,
|
|
3409
|
+
composed: !0
|
|
3410
|
+
}));
|
|
3411
|
+
}
|
|
3412
|
+
};
|
|
3413
|
+
Qe.styles = [H, ge, ji];
|
|
3414
|
+
pn([
|
|
3415
|
+
f({ type: Boolean })
|
|
3416
|
+
], Qe.prototype, "checked", void 0);
|
|
3417
|
+
Qe = pn([
|
|
3418
|
+
S("wui-certified-switch")
|
|
3419
|
+
], Qe);
|
|
3420
|
+
const Ui = k`
|
|
3421
|
+
:host {
|
|
3422
|
+
position: relative;
|
|
3423
|
+
width: 100%;
|
|
3424
|
+
display: inline-flex;
|
|
3425
|
+
flex-direction: column;
|
|
3426
|
+
gap: ${({ spacing: t }) => t[3]};
|
|
3427
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
3428
|
+
caret-color: ${({ tokens: t }) => t.core.textAccentPrimary};
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
.wui-input-text-container {
|
|
3432
|
+
position: relative;
|
|
3433
|
+
display: flex;
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
input {
|
|
3437
|
+
width: 100%;
|
|
3438
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
3439
|
+
color: inherit;
|
|
3440
|
+
background: transparent;
|
|
3441
|
+
border: 1px solid ${({ tokens: t }) => t.theme.borderPrimary};
|
|
3442
|
+
caret-color: ${({ tokens: t }) => t.core.textAccentPrimary};
|
|
3443
|
+
padding: ${({ spacing: t }) => t[3]} ${({ spacing: t }) => t[3]}
|
|
3444
|
+
${({ spacing: t }) => t[3]} ${({ spacing: t }) => t[10]};
|
|
3445
|
+
font-size: ${({ textSize: t }) => t.large};
|
|
3446
|
+
line-height: ${({ typography: t }) => t["lg-regular"].lineHeight};
|
|
3447
|
+
letter-spacing: ${({ typography: t }) => t["lg-regular"].letterSpacing};
|
|
3448
|
+
font-weight: ${({ fontWeight: t }) => t.regular};
|
|
3449
|
+
font-family: ${({ fontFamily: t }) => t.regular};
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3452
|
+
input[data-size='lg'] {
|
|
3453
|
+
padding: ${({ spacing: t }) => t[4]} ${({ spacing: t }) => t[3]}
|
|
3454
|
+
${({ spacing: t }) => t[4]} ${({ spacing: t }) => t[10]};
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
@media (hover: hover) and (pointer: fine) {
|
|
3458
|
+
input:hover:enabled {
|
|
3459
|
+
border: 1px solid ${({ tokens: t }) => t.theme.borderSecondary};
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
input:disabled {
|
|
3464
|
+
cursor: unset;
|
|
3465
|
+
border: 1px solid ${({ tokens: t }) => t.theme.borderPrimary};
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
input::placeholder {
|
|
3469
|
+
color: ${({ tokens: t }) => t.theme.textSecondary};
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
input:focus:enabled {
|
|
3473
|
+
border: 1px solid ${({ tokens: t }) => t.theme.borderSecondary};
|
|
3474
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
3475
|
+
-webkit-box-shadow: 0px 0px 0px 4px ${({ tokens: t }) => t.core.foregroundAccent040};
|
|
3476
|
+
-moz-box-shadow: 0px 0px 0px 4px ${({ tokens: t }) => t.core.foregroundAccent040};
|
|
3477
|
+
box-shadow: 0px 0px 0px 4px ${({ tokens: t }) => t.core.foregroundAccent040};
|
|
3478
|
+
}
|
|
3479
|
+
|
|
3480
|
+
div.wui-input-text-container:has(input:disabled) {
|
|
3481
|
+
opacity: 0.5;
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
wui-icon.wui-input-text-left-icon {
|
|
3485
|
+
position: absolute;
|
|
3486
|
+
top: 50%;
|
|
3487
|
+
transform: translateY(-50%);
|
|
3488
|
+
pointer-events: none;
|
|
3489
|
+
left: ${({ spacing: t }) => t[4]};
|
|
3490
|
+
color: ${({ tokens: t }) => t.theme.iconDefault};
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
button.wui-input-text-submit-button {
|
|
3494
|
+
position: absolute;
|
|
3495
|
+
top: 50%;
|
|
3496
|
+
transform: translateY(-50%);
|
|
3497
|
+
right: ${({ spacing: t }) => t[3]};
|
|
3498
|
+
width: 24px;
|
|
3499
|
+
height: 24px;
|
|
3500
|
+
border: none;
|
|
3501
|
+
background: transparent;
|
|
3502
|
+
border-radius: ${({ borderRadius: t }) => t[2]};
|
|
3503
|
+
color: ${({ tokens: t }) => t.core.textAccentPrimary};
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
button.wui-input-text-submit-button:disabled {
|
|
3507
|
+
opacity: 1;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
button.wui-input-text-submit-button.loading wui-icon {
|
|
3511
|
+
animation: spin 1s linear infinite;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
button.wui-input-text-submit-button:hover {
|
|
3515
|
+
background: ${({ tokens: t }) => t.core.foregroundAccent010};
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
input:has(+ .wui-input-text-submit-button) {
|
|
3519
|
+
padding-right: ${({ spacing: t }) => t[12]};
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
input[type='number'] {
|
|
3523
|
+
-moz-appearance: textfield;
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
input[type='search']::-webkit-search-decoration,
|
|
3527
|
+
input[type='search']::-webkit-search-cancel-button,
|
|
3528
|
+
input[type='search']::-webkit-search-results-button,
|
|
3529
|
+
input[type='search']::-webkit-search-results-decoration {
|
|
3530
|
+
-webkit-appearance: none;
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
/* -- Keyframes --------------------------------------------------- */
|
|
3534
|
+
@keyframes spin {
|
|
3535
|
+
from {
|
|
3536
|
+
transform: rotate(0deg);
|
|
3537
|
+
}
|
|
3538
|
+
to {
|
|
3539
|
+
transform: rotate(360deg);
|
|
3540
|
+
}
|
|
3541
|
+
}
|
|
3542
|
+
`;
|
|
3543
|
+
var z = function(t, e, n, o) {
|
|
3544
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3545
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3546
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3547
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3548
|
+
};
|
|
3549
|
+
let O = class extends I {
|
|
3550
|
+
constructor() {
|
|
3551
|
+
super(...arguments), this.inputElementRef = St(), this.disabled = !1, this.loading = !1, this.placeholder = "", this.type = "text", this.value = "", this.size = "md";
|
|
3552
|
+
}
|
|
3553
|
+
render() {
|
|
3554
|
+
return u` <div class="wui-input-text-container">
|
|
3555
|
+
${this.templateLeftIcon()}
|
|
3556
|
+
<input
|
|
3557
|
+
data-size=${this.size}
|
|
3558
|
+
${Tt(this.inputElementRef)}
|
|
3559
|
+
data-testid="wui-input-text"
|
|
3560
|
+
type=${this.type}
|
|
3561
|
+
enterkeyhint=${W(this.enterKeyHint)}
|
|
3562
|
+
?disabled=${this.disabled}
|
|
3563
|
+
placeholder=${this.placeholder}
|
|
3564
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
3565
|
+
@keydown=${this.onKeyDown}
|
|
3566
|
+
.value=${this.value || ""}
|
|
3567
|
+
/>
|
|
3568
|
+
${this.templateSubmitButton()}
|
|
3569
|
+
<slot class="wui-input-text-slot"></slot>
|
|
3570
|
+
</div>
|
|
3571
|
+
${this.templateError()} ${this.templateWarning()}`;
|
|
3572
|
+
}
|
|
3573
|
+
templateLeftIcon() {
|
|
3574
|
+
return this.icon ? u`<wui-icon
|
|
3575
|
+
class="wui-input-text-left-icon"
|
|
3576
|
+
size="md"
|
|
3577
|
+
data-size=${this.size}
|
|
3578
|
+
color="inherit"
|
|
3579
|
+
name=${this.icon}
|
|
3580
|
+
></wui-icon>` : null;
|
|
3581
|
+
}
|
|
3582
|
+
templateSubmitButton() {
|
|
3583
|
+
var e;
|
|
3584
|
+
return this.onSubmit ? u`<button
|
|
3585
|
+
class="wui-input-text-submit-button ${this.loading ? "loading" : ""}"
|
|
3586
|
+
@click=${(e = this.onSubmit) == null ? void 0 : e.bind(this)}
|
|
3587
|
+
?disabled=${this.disabled || this.loading}
|
|
3588
|
+
>
|
|
3589
|
+
${this.loading ? u`<wui-icon name="spinner" size="md"></wui-icon>` : u`<wui-icon name="chevronRight" size="md"></wui-icon>`}
|
|
3590
|
+
</button>` : null;
|
|
3591
|
+
}
|
|
3592
|
+
templateError() {
|
|
3593
|
+
return this.errorText ? u`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>` : null;
|
|
3594
|
+
}
|
|
3595
|
+
templateWarning() {
|
|
3596
|
+
return this.warningText ? u`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>` : null;
|
|
3597
|
+
}
|
|
3598
|
+
dispatchInputChangeEvent() {
|
|
3599
|
+
var e;
|
|
3600
|
+
this.dispatchEvent(new CustomEvent("inputChange", {
|
|
3601
|
+
detail: (e = this.inputElementRef.value) == null ? void 0 : e.value,
|
|
3602
|
+
bubbles: !0,
|
|
3603
|
+
composed: !0
|
|
3604
|
+
}));
|
|
3605
|
+
}
|
|
3606
|
+
};
|
|
3607
|
+
O.styles = [H, ge, Ui];
|
|
3608
|
+
z([
|
|
3609
|
+
f()
|
|
3610
|
+
], O.prototype, "icon", void 0);
|
|
3611
|
+
z([
|
|
3612
|
+
f({ type: Boolean })
|
|
3613
|
+
], O.prototype, "disabled", void 0);
|
|
3614
|
+
z([
|
|
3615
|
+
f({ type: Boolean })
|
|
3616
|
+
], O.prototype, "loading", void 0);
|
|
3617
|
+
z([
|
|
3618
|
+
f()
|
|
3619
|
+
], O.prototype, "placeholder", void 0);
|
|
3620
|
+
z([
|
|
3621
|
+
f()
|
|
3622
|
+
], O.prototype, "type", void 0);
|
|
3623
|
+
z([
|
|
3624
|
+
f()
|
|
3625
|
+
], O.prototype, "value", void 0);
|
|
3626
|
+
z([
|
|
3627
|
+
f()
|
|
3628
|
+
], O.prototype, "errorText", void 0);
|
|
3629
|
+
z([
|
|
3630
|
+
f()
|
|
3631
|
+
], O.prototype, "warningText", void 0);
|
|
3632
|
+
z([
|
|
3633
|
+
f()
|
|
3634
|
+
], O.prototype, "onSubmit", void 0);
|
|
3635
|
+
z([
|
|
3636
|
+
f()
|
|
3637
|
+
], O.prototype, "size", void 0);
|
|
3638
|
+
z([
|
|
3639
|
+
f({ attribute: !1 })
|
|
3640
|
+
], O.prototype, "onKeyDown", void 0);
|
|
3641
|
+
O = z([
|
|
3642
|
+
S("wui-input-text")
|
|
3643
|
+
], O);
|
|
3644
|
+
const zi = k`
|
|
3645
|
+
:host {
|
|
3646
|
+
position: relative;
|
|
3647
|
+
display: inline-block;
|
|
3648
|
+
width: 100%;
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
wui-icon {
|
|
3652
|
+
position: absolute;
|
|
3653
|
+
top: 50%;
|
|
3654
|
+
transform: translateY(-50%);
|
|
3655
|
+
right: ${({ spacing: t }) => t[3]};
|
|
3656
|
+
color: ${({ tokens: t }) => t.theme.iconDefault};
|
|
3657
|
+
cursor: pointer;
|
|
3658
|
+
padding: ${({ spacing: t }) => t[2]};
|
|
3659
|
+
background-color: transparent;
|
|
3660
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
3661
|
+
transition: background-color ${({ durations: t }) => t.lg}
|
|
3662
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
@media (hover: hover) {
|
|
3666
|
+
wui-icon:hover {
|
|
3667
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
`;
|
|
3671
|
+
var gn = function(t, e, n, o) {
|
|
3672
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3673
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3674
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3675
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3676
|
+
};
|
|
3677
|
+
let Je = class extends I {
|
|
3678
|
+
constructor() {
|
|
3679
|
+
super(...arguments), this.inputComponentRef = St(), this.inputValue = "";
|
|
3680
|
+
}
|
|
3681
|
+
render() {
|
|
3682
|
+
return u`
|
|
3683
|
+
<wui-input-text
|
|
3684
|
+
${Tt(this.inputComponentRef)}
|
|
3685
|
+
placeholder="Search wallet"
|
|
3686
|
+
icon="search"
|
|
3687
|
+
type="search"
|
|
3688
|
+
enterKeyHint="search"
|
|
3689
|
+
size="sm"
|
|
3690
|
+
@inputChange=${this.onInputChange}
|
|
3691
|
+
>
|
|
3692
|
+
${this.inputValue ? u`<wui-icon
|
|
3693
|
+
@click=${this.clearValue}
|
|
3694
|
+
color="inherit"
|
|
3695
|
+
size="sm"
|
|
3696
|
+
name="close"
|
|
3697
|
+
></wui-icon>` : null}
|
|
3698
|
+
</wui-input-text>
|
|
3699
|
+
`;
|
|
3700
|
+
}
|
|
3701
|
+
onInputChange(e) {
|
|
3702
|
+
this.inputValue = e.detail || "";
|
|
3703
|
+
}
|
|
3704
|
+
clearValue() {
|
|
3705
|
+
const e = this.inputComponentRef.value, n = e == null ? void 0 : e.inputElementRef.value;
|
|
3706
|
+
n && (n.value = "", this.inputValue = "", n.focus(), n.dispatchEvent(new Event("input")));
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
Je.styles = [H, zi];
|
|
3710
|
+
gn([
|
|
3711
|
+
f()
|
|
3712
|
+
], Je.prototype, "inputValue", void 0);
|
|
3713
|
+
Je = gn([
|
|
3714
|
+
S("wui-search-bar")
|
|
3715
|
+
], Je);
|
|
3716
|
+
const Fi = k`
|
|
3717
|
+
:host {
|
|
3718
|
+
display: flex;
|
|
3719
|
+
flex-direction: column;
|
|
3720
|
+
justify-content: center;
|
|
3721
|
+
align-items: center;
|
|
3722
|
+
height: 104px;
|
|
3723
|
+
width: 104px;
|
|
3724
|
+
row-gap: ${({ spacing: t }) => t[2]};
|
|
3725
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
3726
|
+
border-radius: ${({ borderRadius: t }) => t[5]};
|
|
3727
|
+
position: relative;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
wui-shimmer[data-type='network'] {
|
|
3731
|
+
border: none;
|
|
3732
|
+
-webkit-clip-path: var(--apkt-path-network);
|
|
3733
|
+
clip-path: var(--apkt-path-network);
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
svg {
|
|
3737
|
+
position: absolute;
|
|
3738
|
+
width: 48px;
|
|
3739
|
+
height: 54px;
|
|
3740
|
+
z-index: 1;
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
svg > path {
|
|
3744
|
+
stroke: ${({ tokens: t }) => t.theme.foregroundSecondary};
|
|
3745
|
+
stroke-width: 1px;
|
|
3746
|
+
}
|
|
3747
|
+
|
|
3748
|
+
@media (max-width: 350px) {
|
|
3749
|
+
:host {
|
|
3750
|
+
width: 100%;
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
`;
|
|
3754
|
+
var wn = function(t, e, n, o) {
|
|
3755
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3756
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3757
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3758
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3759
|
+
};
|
|
3760
|
+
let Ye = class extends I {
|
|
3761
|
+
constructor() {
|
|
3762
|
+
super(...arguments), this.type = "wallet";
|
|
3763
|
+
}
|
|
3764
|
+
render() {
|
|
3765
|
+
return u`
|
|
3766
|
+
${this.shimmerTemplate()}
|
|
3767
|
+
<wui-shimmer width="80px" height="20px"></wui-shimmer>
|
|
3768
|
+
`;
|
|
3769
|
+
}
|
|
3770
|
+
shimmerTemplate() {
|
|
3771
|
+
return this.type === "network" ? u` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
|
|
3772
|
+
${Rn}` : u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`;
|
|
3773
|
+
}
|
|
3774
|
+
};
|
|
3775
|
+
Ye.styles = [H, ge, Fi];
|
|
3776
|
+
wn([
|
|
3777
|
+
f()
|
|
3778
|
+
], Ye.prototype, "type", void 0);
|
|
3779
|
+
Ye = wn([
|
|
3780
|
+
S("wui-card-select-loader")
|
|
3781
|
+
], Ye);
|
|
3782
|
+
const Vi = qt`
|
|
3783
|
+
:host {
|
|
3784
|
+
display: grid;
|
|
3785
|
+
width: inherit;
|
|
3786
|
+
height: inherit;
|
|
3787
|
+
}
|
|
3788
|
+
`;
|
|
3789
|
+
var F = function(t, e, n, o) {
|
|
3790
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3791
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3792
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3793
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3794
|
+
};
|
|
3795
|
+
let M = class extends I {
|
|
3796
|
+
render() {
|
|
3797
|
+
return this.style.cssText = `
|
|
3798
|
+
grid-template-rows: ${this.gridTemplateRows};
|
|
3799
|
+
grid-template-columns: ${this.gridTemplateColumns};
|
|
3800
|
+
justify-items: ${this.justifyItems};
|
|
3801
|
+
align-items: ${this.alignItems};
|
|
3802
|
+
justify-content: ${this.justifyContent};
|
|
3803
|
+
align-content: ${this.alignContent};
|
|
3804
|
+
column-gap: ${this.columnGap && `var(--apkt-spacing-${this.columnGap})`};
|
|
3805
|
+
row-gap: ${this.rowGap && `var(--apkt-spacing-${this.rowGap})`};
|
|
3806
|
+
gap: ${this.gap && `var(--apkt-spacing-${this.gap})`};
|
|
3807
|
+
padding-top: ${this.padding && te.getSpacingStyles(this.padding, 0)};
|
|
3808
|
+
padding-right: ${this.padding && te.getSpacingStyles(this.padding, 1)};
|
|
3809
|
+
padding-bottom: ${this.padding && te.getSpacingStyles(this.padding, 2)};
|
|
3810
|
+
padding-left: ${this.padding && te.getSpacingStyles(this.padding, 3)};
|
|
3811
|
+
margin-top: ${this.margin && te.getSpacingStyles(this.margin, 0)};
|
|
3812
|
+
margin-right: ${this.margin && te.getSpacingStyles(this.margin, 1)};
|
|
3813
|
+
margin-bottom: ${this.margin && te.getSpacingStyles(this.margin, 2)};
|
|
3814
|
+
margin-left: ${this.margin && te.getSpacingStyles(this.margin, 3)};
|
|
3815
|
+
`, u`<slot></slot>`;
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
M.styles = [H, Vi];
|
|
3819
|
+
F([
|
|
3820
|
+
f()
|
|
3821
|
+
], M.prototype, "gridTemplateRows", void 0);
|
|
3822
|
+
F([
|
|
3823
|
+
f()
|
|
3824
|
+
], M.prototype, "gridTemplateColumns", void 0);
|
|
3825
|
+
F([
|
|
3826
|
+
f()
|
|
3827
|
+
], M.prototype, "justifyItems", void 0);
|
|
3828
|
+
F([
|
|
3829
|
+
f()
|
|
3830
|
+
], M.prototype, "alignItems", void 0);
|
|
3831
|
+
F([
|
|
3832
|
+
f()
|
|
3833
|
+
], M.prototype, "justifyContent", void 0);
|
|
3834
|
+
F([
|
|
3835
|
+
f()
|
|
3836
|
+
], M.prototype, "alignContent", void 0);
|
|
3837
|
+
F([
|
|
3838
|
+
f()
|
|
3839
|
+
], M.prototype, "columnGap", void 0);
|
|
3840
|
+
F([
|
|
3841
|
+
f()
|
|
3842
|
+
], M.prototype, "rowGap", void 0);
|
|
3843
|
+
F([
|
|
3844
|
+
f()
|
|
3845
|
+
], M.prototype, "gap", void 0);
|
|
3846
|
+
F([
|
|
3847
|
+
f()
|
|
3848
|
+
], M.prototype, "padding", void 0);
|
|
3849
|
+
F([
|
|
3850
|
+
f()
|
|
3851
|
+
], M.prototype, "margin", void 0);
|
|
3852
|
+
M = F([
|
|
3853
|
+
S("wui-grid")
|
|
3854
|
+
], M);
|
|
3855
|
+
const qi = k`
|
|
3856
|
+
button {
|
|
3857
|
+
display: flex;
|
|
3858
|
+
flex-direction: column;
|
|
3859
|
+
justify-content: center;
|
|
3860
|
+
align-items: center;
|
|
3861
|
+
cursor: pointer;
|
|
3862
|
+
width: 104px;
|
|
3863
|
+
row-gap: ${({ spacing: t }) => t[2]};
|
|
3864
|
+
padding: ${({ spacing: t }) => t[3]} ${({ spacing: t }) => t[0]};
|
|
3865
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
3866
|
+
border-radius: clamp(0px, ${({ borderRadius: t }) => t[4]}, 20px);
|
|
3867
|
+
transition:
|
|
3868
|
+
color ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-1"]},
|
|
3869
|
+
background-color ${({ durations: t }) => t.lg}
|
|
3870
|
+
${({ easings: t }) => t["ease-out-power-1"]},
|
|
3871
|
+
border-radius ${({ durations: t }) => t.lg}
|
|
3872
|
+
${({ easings: t }) => t["ease-out-power-1"]};
|
|
3873
|
+
will-change: background-color, color, border-radius;
|
|
3874
|
+
outline: none;
|
|
3875
|
+
border: none;
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
button > wui-flex > wui-text {
|
|
3879
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
3880
|
+
max-width: 86px;
|
|
3881
|
+
white-space: nowrap;
|
|
3882
|
+
overflow: hidden;
|
|
3883
|
+
text-overflow: ellipsis;
|
|
3884
|
+
justify-content: center;
|
|
3885
|
+
}
|
|
3886
|
+
|
|
3887
|
+
button > wui-flex > wui-text.certified {
|
|
3888
|
+
max-width: 66px;
|
|
3889
|
+
}
|
|
3890
|
+
|
|
3891
|
+
@media (hover: hover) and (pointer: fine) {
|
|
3892
|
+
button:hover:enabled {
|
|
3893
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
button:disabled > wui-flex > wui-text {
|
|
3898
|
+
color: ${({ tokens: t }) => t.core.glass010};
|
|
3899
|
+
}
|
|
3900
|
+
|
|
3901
|
+
[data-selected='true'] {
|
|
3902
|
+
background-color: ${({ colors: t }) => t.accent020};
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
@media (hover: hover) and (pointer: fine) {
|
|
3906
|
+
[data-selected='true']:hover:enabled {
|
|
3907
|
+
background-color: ${({ colors: t }) => t.accent010};
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
[data-selected='true']:active:enabled {
|
|
3912
|
+
background-color: ${({ colors: t }) => t.accent010};
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
@media (max-width: 350px) {
|
|
3916
|
+
button {
|
|
3917
|
+
width: 100%;
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
`;
|
|
3921
|
+
var Y = function(t, e, n, o) {
|
|
3922
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
3923
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
3924
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
3925
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
3926
|
+
};
|
|
3927
|
+
let U = class extends I {
|
|
3928
|
+
constructor() {
|
|
3929
|
+
super(), this.observer = new IntersectionObserver(() => {
|
|
3930
|
+
}), this.visible = !1, this.imageSrc = void 0, this.imageLoading = !1, this.isImpressed = !1, this.explorerId = "", this.walletQuery = "", this.certified = !1, this.displayIndex = 0, this.wallet = void 0, this.observer = new IntersectionObserver((e) => {
|
|
3931
|
+
e.forEach((n) => {
|
|
3932
|
+
n.isIntersecting ? (this.visible = !0, this.fetchImageSrc(), this.sendImpressionEvent()) : this.visible = !1;
|
|
3933
|
+
});
|
|
3934
|
+
}, { threshold: 0.01 });
|
|
3935
|
+
}
|
|
3936
|
+
firstUpdated() {
|
|
3937
|
+
this.observer.observe(this);
|
|
3938
|
+
}
|
|
3939
|
+
disconnectedCallback() {
|
|
3940
|
+
this.observer.disconnect();
|
|
3941
|
+
}
|
|
3942
|
+
render() {
|
|
3943
|
+
var n, o;
|
|
3944
|
+
const e = ((n = this.wallet) == null ? void 0 : n.badge_type) === "certified";
|
|
3945
|
+
return u`
|
|
3946
|
+
<button>
|
|
3947
|
+
${this.imageTemplate()}
|
|
3948
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
|
|
3949
|
+
<wui-text
|
|
3950
|
+
variant="md-regular"
|
|
3951
|
+
color="inherit"
|
|
3952
|
+
class=${W(e ? "certified" : void 0)}
|
|
3953
|
+
>${(o = this.wallet) == null ? void 0 : o.name}</wui-text
|
|
3954
|
+
>
|
|
3955
|
+
${e ? u`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>` : null}
|
|
3956
|
+
</wui-flex>
|
|
3957
|
+
</button>
|
|
3958
|
+
`;
|
|
3959
|
+
}
|
|
3960
|
+
imageTemplate() {
|
|
3961
|
+
var e, n;
|
|
3962
|
+
return !this.visible && !this.imageSrc || this.imageLoading ? this.shimmerTemplate() : u`
|
|
3963
|
+
<wui-wallet-image
|
|
3964
|
+
size="lg"
|
|
3965
|
+
imageSrc=${W(this.imageSrc)}
|
|
3966
|
+
name=${W((e = this.wallet) == null ? void 0 : e.name)}
|
|
3967
|
+
.installed=${((n = this.wallet) == null ? void 0 : n.installed) ?? !1}
|
|
3968
|
+
badgeSize="sm"
|
|
3969
|
+
>
|
|
3970
|
+
</wui-wallet-image>
|
|
3971
|
+
`;
|
|
3972
|
+
}
|
|
3973
|
+
shimmerTemplate() {
|
|
3974
|
+
return u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`;
|
|
3975
|
+
}
|
|
3976
|
+
async fetchImageSrc() {
|
|
3977
|
+
this.wallet && (this.imageSrc = re.getWalletImage(this.wallet), !this.imageSrc && (this.imageLoading = !0, this.imageSrc = await re.fetchWalletImage(this.wallet.image_id), this.imageLoading = !1));
|
|
3978
|
+
}
|
|
3979
|
+
sendImpressionEvent() {
|
|
3980
|
+
!this.wallet || this.isImpressed || (this.isImpressed = !0, D.sendWalletImpressionEvent({
|
|
3981
|
+
name: this.wallet.name,
|
|
3982
|
+
walletRank: this.wallet.order,
|
|
3983
|
+
explorerId: this.explorerId,
|
|
3984
|
+
view: E.state.view,
|
|
3985
|
+
query: this.walletQuery,
|
|
3986
|
+
certified: this.certified,
|
|
3987
|
+
displayIndex: this.displayIndex
|
|
3988
|
+
}));
|
|
3989
|
+
}
|
|
3990
|
+
};
|
|
3991
|
+
U.styles = qi;
|
|
3992
|
+
Y([
|
|
3993
|
+
$()
|
|
3994
|
+
], U.prototype, "visible", void 0);
|
|
3995
|
+
Y([
|
|
3996
|
+
$()
|
|
3997
|
+
], U.prototype, "imageSrc", void 0);
|
|
3998
|
+
Y([
|
|
3999
|
+
$()
|
|
4000
|
+
], U.prototype, "imageLoading", void 0);
|
|
4001
|
+
Y([
|
|
4002
|
+
$()
|
|
4003
|
+
], U.prototype, "isImpressed", void 0);
|
|
4004
|
+
Y([
|
|
4005
|
+
f()
|
|
4006
|
+
], U.prototype, "explorerId", void 0);
|
|
4007
|
+
Y([
|
|
4008
|
+
f()
|
|
4009
|
+
], U.prototype, "walletQuery", void 0);
|
|
4010
|
+
Y([
|
|
4011
|
+
f()
|
|
4012
|
+
], U.prototype, "certified", void 0);
|
|
4013
|
+
Y([
|
|
4014
|
+
f()
|
|
4015
|
+
], U.prototype, "displayIndex", void 0);
|
|
4016
|
+
Y([
|
|
4017
|
+
f({ type: Object })
|
|
4018
|
+
], U.prototype, "wallet", void 0);
|
|
4019
|
+
U = Y([
|
|
4020
|
+
S("w3m-all-wallets-list-item")
|
|
4021
|
+
], U);
|
|
4022
|
+
const Hi = k`
|
|
4023
|
+
wui-grid {
|
|
4024
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
4025
|
+
overflow: scroll;
|
|
4026
|
+
scrollbar-width: none;
|
|
4027
|
+
grid-auto-rows: min-content;
|
|
4028
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
4032
|
+
max-height: none;
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
@media (max-width: 350px) {
|
|
4036
|
+
wui-grid {
|
|
4037
|
+
grid-template-columns: repeat(2, 1fr);
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
wui-grid[data-scroll='false'] {
|
|
4042
|
+
overflow: hidden;
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
wui-grid::-webkit-scrollbar {
|
|
4046
|
+
display: none;
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
w3m-all-wallets-list-item {
|
|
4050
|
+
opacity: 0;
|
|
4051
|
+
animation-duration: ${({ durations: t }) => t.xl};
|
|
4052
|
+
animation-timing-function: ${({ easings: t }) => t["ease-inout-power-2"]};
|
|
4053
|
+
animation-name: fade-in;
|
|
4054
|
+
animation-fill-mode: forwards;
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
@keyframes fade-in {
|
|
4058
|
+
from {
|
|
4059
|
+
opacity: 0;
|
|
4060
|
+
}
|
|
4061
|
+
to {
|
|
4062
|
+
opacity: 1;
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
wui-loading-spinner {
|
|
4067
|
+
padding-top: ${({ spacing: t }) => t[4]};
|
|
4068
|
+
padding-bottom: ${({ spacing: t }) => t[4]};
|
|
4069
|
+
justify-content: center;
|
|
4070
|
+
grid-column: 1 / span 4;
|
|
4071
|
+
}
|
|
4072
|
+
`;
|
|
4073
|
+
var Le = function(t, e, n, o) {
|
|
4074
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
4075
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
4076
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
4077
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
4078
|
+
};
|
|
4079
|
+
const Dt = "local-paginator";
|
|
4080
|
+
let fe = class extends I {
|
|
4081
|
+
constructor() {
|
|
4082
|
+
super(), this.unsubscribe = [], this.paginationObserver = void 0, this.loading = !P.state.wallets.length, this.wallets = P.state.wallets, this.mobileFullScreen = N.state.enableMobileFullScreen, this.unsubscribe.push(P.subscribeKey("wallets", (e) => this.wallets = e));
|
|
4083
|
+
}
|
|
4084
|
+
firstUpdated() {
|
|
4085
|
+
this.initialFetch(), this.createPaginationObserver();
|
|
4086
|
+
}
|
|
4087
|
+
disconnectedCallback() {
|
|
4088
|
+
var e;
|
|
4089
|
+
this.unsubscribe.forEach((n) => n()), (e = this.paginationObserver) == null || e.disconnect();
|
|
4090
|
+
}
|
|
4091
|
+
render() {
|
|
4092
|
+
return this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), u`
|
|
4093
|
+
<wui-grid
|
|
4094
|
+
data-scroll=${!this.loading}
|
|
4095
|
+
.padding=${["0", "3", "3", "3"]}
|
|
4096
|
+
gap="2"
|
|
4097
|
+
justifyContent="space-between"
|
|
4098
|
+
>
|
|
4099
|
+
${this.loading ? this.shimmerTemplate(16) : this.walletsTemplate()}
|
|
4100
|
+
${this.paginationLoaderTemplate()}
|
|
4101
|
+
</wui-grid>
|
|
4102
|
+
`;
|
|
4103
|
+
}
|
|
4104
|
+
async initialFetch() {
|
|
4105
|
+
var n;
|
|
4106
|
+
this.loading = !0;
|
|
4107
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector("wui-grid");
|
|
4108
|
+
e && (await P.fetchWalletsByPage({ page: 1 }), await e.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
4109
|
+
duration: 200,
|
|
4110
|
+
fill: "forwards",
|
|
4111
|
+
easing: "ease"
|
|
4112
|
+
}).finished, this.loading = !1, e.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
4113
|
+
duration: 200,
|
|
4114
|
+
fill: "forwards",
|
|
4115
|
+
easing: "ease"
|
|
4116
|
+
}));
|
|
4117
|
+
}
|
|
4118
|
+
shimmerTemplate(e, n) {
|
|
4119
|
+
return [...Array(e)].map(() => u`
|
|
4120
|
+
<wui-card-select-loader type="wallet" id=${W(n)}></wui-card-select-loader>
|
|
4121
|
+
`);
|
|
4122
|
+
}
|
|
4123
|
+
walletsTemplate() {
|
|
4124
|
+
return pt.getWalletConnectWallets(this.wallets).map((e, n) => u`
|
|
4125
|
+
<w3m-all-wallets-list-item
|
|
4126
|
+
data-testid="wallet-search-item-${e.id}"
|
|
4127
|
+
@click=${() => this.onConnectWallet(e)}
|
|
4128
|
+
.wallet=${e}
|
|
4129
|
+
explorerId=${e.id}
|
|
4130
|
+
certified=${this.badge === "certified"}
|
|
4131
|
+
displayIndex=${n}
|
|
4132
|
+
></w3m-all-wallets-list-item>
|
|
4133
|
+
`);
|
|
4134
|
+
}
|
|
4135
|
+
paginationLoaderTemplate() {
|
|
4136
|
+
const { wallets: e, recommended: n, featured: o, count: r, mobileFilteredOutWalletsLength: i } = P.state, s = window.innerWidth < 352 ? 3 : 4, a = e.length + n.length;
|
|
4137
|
+
let c = Math.ceil(a / s) * s - a + s;
|
|
4138
|
+
return c -= e.length ? o.length % s : 0, r === 0 && o.length > 0 ? null : r === 0 || [...o, ...e, ...n].length < r - (i ?? 0) ? this.shimmerTemplate(c, Dt) : null;
|
|
4139
|
+
}
|
|
4140
|
+
createPaginationObserver() {
|
|
4141
|
+
var n;
|
|
4142
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(`#${Dt}`);
|
|
4143
|
+
e && (this.paginationObserver = new IntersectionObserver(([o]) => {
|
|
4144
|
+
if (o != null && o.isIntersecting && !this.loading) {
|
|
4145
|
+
const { page: r, count: i, wallets: s } = P.state;
|
|
4146
|
+
s.length < i && P.fetchWalletsByPage({ page: r + 1 });
|
|
4147
|
+
}
|
|
4148
|
+
}), this.paginationObserver.observe(e));
|
|
4149
|
+
}
|
|
4150
|
+
onConnectWallet(e) {
|
|
4151
|
+
q.selectWalletConnector(e);
|
|
4152
|
+
}
|
|
4153
|
+
};
|
|
4154
|
+
fe.styles = Hi;
|
|
4155
|
+
Le([
|
|
4156
|
+
$()
|
|
4157
|
+
], fe.prototype, "loading", void 0);
|
|
4158
|
+
Le([
|
|
4159
|
+
$()
|
|
4160
|
+
], fe.prototype, "wallets", void 0);
|
|
4161
|
+
Le([
|
|
4162
|
+
$()
|
|
4163
|
+
], fe.prototype, "badge", void 0);
|
|
4164
|
+
Le([
|
|
4165
|
+
$()
|
|
4166
|
+
], fe.prototype, "mobileFullScreen", void 0);
|
|
4167
|
+
fe = Le([
|
|
4168
|
+
S("w3m-all-wallets-list")
|
|
4169
|
+
], fe);
|
|
4170
|
+
const Ki = qt`
|
|
4171
|
+
wui-grid,
|
|
4172
|
+
wui-loading-spinner,
|
|
4173
|
+
wui-flex {
|
|
4174
|
+
height: 360px;
|
|
4175
|
+
}
|
|
4176
|
+
|
|
4177
|
+
wui-grid {
|
|
4178
|
+
overflow: scroll;
|
|
4179
|
+
scrollbar-width: none;
|
|
4180
|
+
grid-auto-rows: min-content;
|
|
4181
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
4185
|
+
max-height: none;
|
|
4186
|
+
height: auto;
|
|
4187
|
+
}
|
|
4188
|
+
|
|
4189
|
+
wui-grid[data-scroll='false'] {
|
|
4190
|
+
overflow: hidden;
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
wui-grid::-webkit-scrollbar {
|
|
4194
|
+
display: none;
|
|
4195
|
+
}
|
|
4196
|
+
|
|
4197
|
+
wui-loading-spinner {
|
|
4198
|
+
justify-content: center;
|
|
4199
|
+
align-items: center;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
@media (max-width: 350px) {
|
|
4203
|
+
wui-grid {
|
|
4204
|
+
grid-template-columns: repeat(2, 1fr);
|
|
4205
|
+
}
|
|
4206
|
+
}
|
|
4207
|
+
`;
|
|
4208
|
+
var Ne = function(t, e, n, o) {
|
|
4209
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
4210
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
4211
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
4212
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
4213
|
+
};
|
|
4214
|
+
let pe = class extends I {
|
|
4215
|
+
constructor() {
|
|
4216
|
+
super(...arguments), this.prevQuery = "", this.prevBadge = void 0, this.loading = !0, this.mobileFullScreen = N.state.enableMobileFullScreen, this.query = "";
|
|
4217
|
+
}
|
|
4218
|
+
render() {
|
|
4219
|
+
return this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), this.onSearch(), this.loading ? u`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>` : this.walletsTemplate();
|
|
4220
|
+
}
|
|
4221
|
+
async onSearch() {
|
|
4222
|
+
(this.query.trim() !== this.prevQuery.trim() || this.badge !== this.prevBadge) && (this.prevQuery = this.query, this.prevBadge = this.badge, this.loading = !0, await P.searchWallet({ search: this.query, badge: this.badge }), this.loading = !1);
|
|
4223
|
+
}
|
|
4224
|
+
walletsTemplate() {
|
|
4225
|
+
const { search: e } = P.state, n = pt.markWalletsAsInstalled(e), o = pt.filterWalletsByWcSupport(n);
|
|
4226
|
+
return o.length ? u`
|
|
4227
|
+
<wui-grid
|
|
4228
|
+
data-testid="wallet-list"
|
|
4229
|
+
.padding=${["0", "3", "3", "3"]}
|
|
4230
|
+
rowGap="4"
|
|
4231
|
+
columngap="2"
|
|
4232
|
+
justifyContent="space-between"
|
|
4233
|
+
>
|
|
4234
|
+
${o.map((r, i) => u`
|
|
4235
|
+
<w3m-all-wallets-list-item
|
|
4236
|
+
@click=${() => this.onConnectWallet(r)}
|
|
4237
|
+
.wallet=${r}
|
|
4238
|
+
data-testid="wallet-search-item-${r.id}"
|
|
4239
|
+
explorerId=${r.id}
|
|
4240
|
+
certified=${this.badge === "certified"}
|
|
4241
|
+
walletQuery=${this.query}
|
|
4242
|
+
displayIndex=${i}
|
|
4243
|
+
></w3m-all-wallets-list-item>
|
|
4244
|
+
`)}
|
|
4245
|
+
</wui-grid>
|
|
4246
|
+
` : u`
|
|
4247
|
+
<wui-flex
|
|
4248
|
+
data-testid="no-wallet-found"
|
|
4249
|
+
justifyContent="center"
|
|
4250
|
+
alignItems="center"
|
|
4251
|
+
gap="3"
|
|
4252
|
+
flexDirection="column"
|
|
4253
|
+
>
|
|
4254
|
+
<wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
|
|
4255
|
+
<wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
|
|
4256
|
+
No Wallet found
|
|
4257
|
+
</wui-text>
|
|
4258
|
+
</wui-flex>
|
|
4259
|
+
`;
|
|
4260
|
+
}
|
|
4261
|
+
onConnectWallet(e) {
|
|
4262
|
+
q.selectWalletConnector(e);
|
|
4263
|
+
}
|
|
4264
|
+
};
|
|
4265
|
+
pe.styles = Ki;
|
|
4266
|
+
Ne([
|
|
4267
|
+
$()
|
|
4268
|
+
], pe.prototype, "loading", void 0);
|
|
4269
|
+
Ne([
|
|
4270
|
+
$()
|
|
4271
|
+
], pe.prototype, "mobileFullScreen", void 0);
|
|
4272
|
+
Ne([
|
|
4273
|
+
f()
|
|
4274
|
+
], pe.prototype, "query", void 0);
|
|
4275
|
+
Ne([
|
|
4276
|
+
f()
|
|
4277
|
+
], pe.prototype, "badge", void 0);
|
|
4278
|
+
pe = Ne([
|
|
4279
|
+
S("w3m-all-wallets-search")
|
|
4280
|
+
], pe);
|
|
4281
|
+
var It = function(t, e, n, o) {
|
|
4282
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
4283
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
4284
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
4285
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
4286
|
+
};
|
|
4287
|
+
let Xe = class extends I {
|
|
4288
|
+
constructor() {
|
|
4289
|
+
super(...arguments), this.search = "", this.badge = void 0, this.onDebouncedSearch = T.debounce((e) => {
|
|
4290
|
+
this.search = e;
|
|
4291
|
+
});
|
|
4292
|
+
}
|
|
4293
|
+
render() {
|
|
4294
|
+
const e = this.search.length >= 2;
|
|
4295
|
+
return u`
|
|
4296
|
+
<wui-flex .padding=${["1", "3", "3", "3"]} gap="2" alignItems="center">
|
|
4297
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
4298
|
+
<wui-certified-switch
|
|
4299
|
+
?checked=${this.badge === "certified"}
|
|
4300
|
+
@certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
|
|
4301
|
+
data-testid="wui-certified-switch"
|
|
4302
|
+
></wui-certified-switch>
|
|
4303
|
+
${this.qrButtonTemplate()}
|
|
4304
|
+
</wui-flex>
|
|
4305
|
+
${e || this.badge ? u`<w3m-all-wallets-search
|
|
4306
|
+
query=${this.search}
|
|
4307
|
+
.badge=${this.badge}
|
|
4308
|
+
></w3m-all-wallets-search>` : u`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
|
|
4309
|
+
`;
|
|
4310
|
+
}
|
|
4311
|
+
onInputChange(e) {
|
|
4312
|
+
this.onDebouncedSearch(e.detail);
|
|
4313
|
+
}
|
|
4314
|
+
onCertifiedSwitchChange(e) {
|
|
4315
|
+
e.detail ? (this.badge = "certified", Ie.showSvg("Only WalletConnect certified", {
|
|
4316
|
+
icon: "walletConnectBrown",
|
|
4317
|
+
iconColor: "accent-100"
|
|
4318
|
+
})) : this.badge = void 0;
|
|
4319
|
+
}
|
|
4320
|
+
qrButtonTemplate() {
|
|
4321
|
+
return T.isMobile() ? u`
|
|
4322
|
+
<wui-icon-box
|
|
4323
|
+
size="xl"
|
|
4324
|
+
iconSize="xl"
|
|
4325
|
+
color="accent-primary"
|
|
4326
|
+
icon="qrCode"
|
|
4327
|
+
border
|
|
4328
|
+
borderColor="wui-accent-glass-010"
|
|
4329
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
4330
|
+
></wui-icon-box>
|
|
4331
|
+
` : null;
|
|
4332
|
+
}
|
|
4333
|
+
onWalletConnectQr() {
|
|
4334
|
+
E.push("ConnectingWalletConnect");
|
|
4335
|
+
}
|
|
4336
|
+
};
|
|
4337
|
+
It([
|
|
4338
|
+
$()
|
|
4339
|
+
], Xe.prototype, "search", void 0);
|
|
4340
|
+
It([
|
|
4341
|
+
$()
|
|
4342
|
+
], Xe.prototype, "badge", void 0);
|
|
4343
|
+
Xe = It([
|
|
4344
|
+
S("w3m-all-wallets-view")
|
|
4345
|
+
], Xe);
|
|
4346
|
+
var Gi = function(t, e, n, o) {
|
|
4347
|
+
var r = arguments.length, i = r < 3 ? e : o === null ? o = Object.getOwnPropertyDescriptor(e, n) : o, s;
|
|
4348
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, n, o);
|
|
4349
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (r < 3 ? s(i) : r > 3 ? s(e, n, i) : s(e, n)) || i);
|
|
4350
|
+
return r > 3 && i && Object.defineProperty(e, n, i), i;
|
|
4351
|
+
};
|
|
4352
|
+
let jt = class extends I {
|
|
4353
|
+
constructor() {
|
|
4354
|
+
var e;
|
|
4355
|
+
super(...arguments), this.wallet = (e = E.state.data) == null ? void 0 : e.wallet;
|
|
4356
|
+
}
|
|
4357
|
+
render() {
|
|
4358
|
+
if (!this.wallet)
|
|
4359
|
+
throw new Error("w3m-downloads-view");
|
|
4360
|
+
return u`
|
|
4361
|
+
<wui-flex gap="2" flexDirection="column" .padding=${["3", "3", "4", "3"]}>
|
|
4362
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
4363
|
+
${this.homepageTemplate()}
|
|
4364
|
+
</wui-flex>
|
|
4365
|
+
`;
|
|
4366
|
+
}
|
|
4367
|
+
chromeTemplate() {
|
|
4368
|
+
var e;
|
|
4369
|
+
return (e = this.wallet) != null && e.chrome_store ? u`<wui-list-item
|
|
4370
|
+
variant="icon"
|
|
4371
|
+
icon="chromeStore"
|
|
4372
|
+
iconVariant="square"
|
|
4373
|
+
@click=${this.onChromeStore.bind(this)}
|
|
4374
|
+
chevron
|
|
4375
|
+
>
|
|
4376
|
+
<wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
|
|
4377
|
+
</wui-list-item>` : null;
|
|
4378
|
+
}
|
|
4379
|
+
iosTemplate() {
|
|
4380
|
+
var e;
|
|
4381
|
+
return (e = this.wallet) != null && e.app_store ? u`<wui-list-item
|
|
4382
|
+
variant="icon"
|
|
4383
|
+
icon="appStore"
|
|
4384
|
+
iconVariant="square"
|
|
4385
|
+
@click=${this.onAppStore.bind(this)}
|
|
4386
|
+
chevron
|
|
4387
|
+
>
|
|
4388
|
+
<wui-text variant="md-medium" color="primary">iOS App</wui-text>
|
|
4389
|
+
</wui-list-item>` : null;
|
|
4390
|
+
}
|
|
4391
|
+
androidTemplate() {
|
|
4392
|
+
var e;
|
|
4393
|
+
return (e = this.wallet) != null && e.play_store ? u`<wui-list-item
|
|
4394
|
+
variant="icon"
|
|
4395
|
+
icon="playStore"
|
|
4396
|
+
iconVariant="square"
|
|
4397
|
+
@click=${this.onPlayStore.bind(this)}
|
|
4398
|
+
chevron
|
|
4399
|
+
>
|
|
4400
|
+
<wui-text variant="md-medium" color="primary">Android App</wui-text>
|
|
4401
|
+
</wui-list-item>` : null;
|
|
4402
|
+
}
|
|
4403
|
+
homepageTemplate() {
|
|
4404
|
+
var e;
|
|
4405
|
+
return (e = this.wallet) != null && e.homepage ? u`
|
|
4406
|
+
<wui-list-item
|
|
4407
|
+
variant="icon"
|
|
4408
|
+
icon="browser"
|
|
4409
|
+
iconVariant="square-blue"
|
|
4410
|
+
@click=${this.onHomePage.bind(this)}
|
|
4411
|
+
chevron
|
|
4412
|
+
>
|
|
4413
|
+
<wui-text variant="md-medium" color="primary">Website</wui-text>
|
|
4414
|
+
</wui-list-item>
|
|
4415
|
+
` : null;
|
|
4416
|
+
}
|
|
4417
|
+
openStore(e) {
|
|
4418
|
+
e.href && this.wallet && (D.sendEvent({
|
|
4419
|
+
type: "track",
|
|
4420
|
+
event: "GET_WALLET",
|
|
4421
|
+
properties: {
|
|
4422
|
+
name: this.wallet.name,
|
|
4423
|
+
walletRank: this.wallet.order,
|
|
4424
|
+
explorerId: this.wallet.id,
|
|
4425
|
+
type: e.type
|
|
4426
|
+
}
|
|
4427
|
+
}), T.openHref(e.href, "_blank"));
|
|
4428
|
+
}
|
|
4429
|
+
onChromeStore() {
|
|
4430
|
+
var e;
|
|
4431
|
+
(e = this.wallet) != null && e.chrome_store && this.openStore({ href: this.wallet.chrome_store, type: "chrome_store" });
|
|
4432
|
+
}
|
|
4433
|
+
onAppStore() {
|
|
4434
|
+
var e;
|
|
4435
|
+
(e = this.wallet) != null && e.app_store && this.openStore({ href: this.wallet.app_store, type: "app_store" });
|
|
4436
|
+
}
|
|
4437
|
+
onPlayStore() {
|
|
4438
|
+
var e;
|
|
4439
|
+
(e = this.wallet) != null && e.play_store && this.openStore({ href: this.wallet.play_store, type: "play_store" });
|
|
4440
|
+
}
|
|
4441
|
+
onHomePage() {
|
|
4442
|
+
var e;
|
|
4443
|
+
(e = this.wallet) != null && e.homepage && this.openStore({ href: this.wallet.homepage, type: "homepage" });
|
|
4444
|
+
}
|
|
4445
|
+
};
|
|
4446
|
+
jt = Gi([
|
|
4447
|
+
S("w3m-downloads-view")
|
|
4448
|
+
], jt);
|
|
4449
|
+
export {
|
|
4450
|
+
Xe as W3mAllWalletsView,
|
|
4451
|
+
Ke as W3mConnectingWcBasicView,
|
|
4452
|
+
jt as W3mDownloadsView
|
|
4453
|
+
};
|
|
4454
|
+
//# sourceMappingURL=basic-zhUNun3W.js.map
|