@seams/wallet 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +201 -0
- package/THIRD_PARTY_NOTICES.md +15095 -0
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
- package/dist/esm/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
- package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
- package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
- package/dist/esm/sdk/export-private-key-viewer.js +1420 -1425
- package/dist/esm/sdk/halo-border.js +1424 -1429
- package/dist/esm/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
- package/dist/esm/sdk/passkey-halo-loading.js +1426 -1431
- package/dist/{public/sdk/registrationPreparationPreload-u3ruCmpF.js → esm/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/{public/sdk/runtime-auth-Da9yQyaD.js → esm/sdk/runtime-auth-dpoaCtkK.js} +2 -2
- package/dist/esm/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
- package/dist/{public/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → esm/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
- package/dist/{public/sdk/runtime-email-otp-CckVQZJC.js → esm/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
- package/dist/{public/sdk/runtime-export-WAiBwZL_.js → esm/sdk/runtime-export-C4HO5ysH.js} +1 -1
- package/dist/esm/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
- package/dist/{public/sdk/runtime-preferences-DmH7eMHH.js → esm/sdk/runtime-preferences-DyJidFuf.js} +1 -1
- package/dist/esm/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
- package/dist/esm/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
- package/dist/esm/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
- package/dist/esm/sdk/tx-confirm-ui.js +1400 -1407
- package/dist/esm/sdk/w3a-tx-confirmer.js +1442 -1447
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +4 -4
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/export-private-key-viewer.js +1420 -1425
- package/dist/public/sdk/halo-border.js +1424 -1429
- package/dist/public/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
- package/dist/public/sdk/passkey-halo-loading.js +1426 -1431
- package/dist/{esm/sdk/registrationPreparationPreload-u3ruCmpF.js → public/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/{esm/sdk/runtime-auth-Da9yQyaD.js → public/sdk/runtime-auth-dpoaCtkK.js} +2 -2
- package/dist/public/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
- package/dist/{esm/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → public/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
- package/dist/{esm/sdk/runtime-email-otp-CckVQZJC.js → public/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
- package/dist/{esm/sdk/runtime-export-WAiBwZL_.js → public/sdk/runtime-export-C4HO5ysH.js} +1 -1
- package/dist/public/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
- package/dist/{esm/sdk/runtime-preferences-DmH7eMHH.js → public/sdk/runtime-preferences-DyJidFuf.js} +1 -1
- package/dist/public/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
- package/dist/public/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
- package/dist/public/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
- package/dist/public/sdk/tx-confirm-ui.js +1400 -1407
- package/dist/public/sdk/w3a-tx-confirmer.js +1442 -1447
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/workers/device-linking-key.worker.js +133 -140
- package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +94 -188
- package/dist/public/sdk/workers/ecdsa-online-client.worker.js +6 -7
- package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +6 -7
- package/dist/public/sdk/workers/email-otp.worker.js +39 -52
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm-crypto.worker.js +3 -3
- package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- package/dist/public/sdk/workers/near-signer.worker.js +9 -9
- package/dist/public/sdk/workers/near_signer.wasm +0 -0
- package/dist/public/sdk/workers/passkey-confirm.worker.js +4 -4
- package/dist/public/sdk/workers/passkey-mpc-export.worker.js +9 -19
- package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/shamir3pass.worker.js +3 -3
- package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo-signer.worker.js +3 -3
- package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +55 -1244
- package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
- package/dist/public/wallet-assets.manifest.json +32 -32
- package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +4 -4
- package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionReader.d.ts +1 -9
- package/dist/workers/device-linking-key.worker.js +133 -140
- package/dist/workers/ecdsa-derivation-client.worker.js +94 -188
- package/dist/workers/ecdsa-online-client.worker.js +6 -7
- package/dist/workers/ecdsa-presign-client.worker.js +6 -7
- package/dist/workers/email-otp.worker.js +39 -52
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm-crypto.worker.js +3 -3
- package/dist/workers/evm_crypto.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- package/dist/workers/near-signer.worker.js +9 -9
- package/dist/workers/near_signer.wasm +0 -0
- package/dist/workers/passkey-confirm.worker.js +4 -4
- package/dist/workers/passkey-mpc-export.worker.js +9 -19
- package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/workers/shamir3pass.worker.js +3 -3
- package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/workers/tempo-signer.worker.js +3 -3
- package/dist/workers/tempo_signer.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet-custody-ceremony.worker.js +55 -1244
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +6 -3
- package/LICENSE +0 -21
|
@@ -1,42 +1,56 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
2
6
|
var __export = (target, all) => {
|
|
3
7
|
for (var name in all)
|
|
4
8
|
__defProp(target, name, {
|
|
5
9
|
get: all[name],
|
|
6
10
|
enumerable: true,
|
|
7
11
|
configurable: true,
|
|
8
|
-
set: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
|
-
var __esm = (fn, res) => () =>
|
|
15
|
+
var __esm = (fn, res, err) => () => {
|
|
16
|
+
if (fn)
|
|
17
|
+
try {
|
|
18
|
+
res = fn(fn = 0);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
err = [e];
|
|
21
|
+
}
|
|
22
|
+
if (err)
|
|
23
|
+
throw err[0];
|
|
24
|
+
return res;
|
|
25
|
+
};
|
|
12
26
|
|
|
13
27
|
// ../../node_modules/@lit/reactive-element/css-tag.js
|
|
14
28
|
class n {
|
|
15
|
-
constructor(
|
|
16
|
-
if (this._$cssResult$ = true,
|
|
29
|
+
constructor(t, e, o) {
|
|
30
|
+
if (this._$cssResult$ = true, o !== s)
|
|
17
31
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
18
|
-
this.cssText =
|
|
32
|
+
this.cssText = t, this.t = e;
|
|
19
33
|
}
|
|
20
34
|
get styleSheet() {
|
|
21
|
-
let
|
|
22
|
-
const
|
|
23
|
-
if (e &&
|
|
24
|
-
const
|
|
25
|
-
|
|
35
|
+
let t = this.o;
|
|
36
|
+
const s = this.t;
|
|
37
|
+
if (e && t === undefined) {
|
|
38
|
+
const e = s !== undefined && s.length === 1;
|
|
39
|
+
e && (t = o.get(s)), t === undefined && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e && o.set(s, t));
|
|
26
40
|
}
|
|
27
|
-
return
|
|
41
|
+
return t;
|
|
28
42
|
}
|
|
29
43
|
toString() {
|
|
30
44
|
return this.cssText;
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
|
-
var t, e, s, o, r = (
|
|
47
|
+
var t, e, s, o, r = (t) => new n(typeof t == "string" ? t : t + "", undefined, s), S = (s, o) => {
|
|
34
48
|
if (e)
|
|
35
|
-
|
|
49
|
+
s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
36
50
|
else
|
|
37
|
-
for (const
|
|
38
|
-
const
|
|
39
|
-
|
|
51
|
+
for (const e of o) {
|
|
52
|
+
const o = document.createElement("style"), n = t.litNonce;
|
|
53
|
+
n !== undefined && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
40
54
|
}
|
|
41
55
|
}, c;
|
|
42
56
|
var init_css_tag = __esm(() => {
|
|
@@ -44,16 +58,16 @@ var init_css_tag = __esm(() => {
|
|
|
44
58
|
e = t.ShadowRoot && (t.ShadyCSS === undefined || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
45
59
|
s = Symbol();
|
|
46
60
|
o = new WeakMap;
|
|
47
|
-
c = e ? (
|
|
48
|
-
let
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
return r(
|
|
52
|
-
})(
|
|
61
|
+
c = e ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
|
|
62
|
+
let e = "";
|
|
63
|
+
for (const s of t.cssRules)
|
|
64
|
+
e += s.cssText;
|
|
65
|
+
return r(e);
|
|
66
|
+
})(t) : t;
|
|
53
67
|
});
|
|
54
68
|
|
|
55
69
|
// ../../node_modules/@lit/reactive-element/reactive-element.js
|
|
56
|
-
var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (
|
|
70
|
+
var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t, s) => t, u, f = (t, s) => !i2(t, s), b, y;
|
|
57
71
|
var init_reactive_element = __esm(() => {
|
|
58
72
|
init_css_tag();
|
|
59
73
|
init_css_tag();
|
|
@@ -62,175 +76,175 @@ var init_reactive_element = __esm(() => {
|
|
|
62
76
|
c2 = a.trustedTypes;
|
|
63
77
|
l = c2 ? c2.emptyScript : "";
|
|
64
78
|
p = a.reactiveElementPolyfillSupport;
|
|
65
|
-
u = { toAttribute(
|
|
66
|
-
switch (
|
|
79
|
+
u = { toAttribute(t, s) {
|
|
80
|
+
switch (s) {
|
|
67
81
|
case Boolean:
|
|
68
|
-
|
|
82
|
+
t = t ? l : null;
|
|
69
83
|
break;
|
|
70
84
|
case Object:
|
|
71
85
|
case Array:
|
|
72
|
-
|
|
86
|
+
t = t == null ? t : JSON.stringify(t);
|
|
73
87
|
}
|
|
74
|
-
return
|
|
75
|
-
}, fromAttribute(
|
|
76
|
-
let
|
|
77
|
-
switch (
|
|
88
|
+
return t;
|
|
89
|
+
}, fromAttribute(t, s) {
|
|
90
|
+
let i = t;
|
|
91
|
+
switch (s) {
|
|
78
92
|
case Boolean:
|
|
79
|
-
|
|
93
|
+
i = t !== null;
|
|
80
94
|
break;
|
|
81
95
|
case Number:
|
|
82
|
-
|
|
96
|
+
i = t === null ? null : Number(t);
|
|
83
97
|
break;
|
|
84
98
|
case Object:
|
|
85
99
|
case Array:
|
|
86
100
|
try {
|
|
87
|
-
|
|
88
|
-
} catch (
|
|
89
|
-
|
|
101
|
+
i = JSON.parse(t);
|
|
102
|
+
} catch (t) {
|
|
103
|
+
i = null;
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
|
-
return
|
|
106
|
+
return i;
|
|
93
107
|
} };
|
|
94
108
|
b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
|
|
95
109
|
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap;
|
|
96
110
|
y = class y extends HTMLElement {
|
|
97
|
-
static addInitializer(
|
|
98
|
-
this._$Ei(), (this.l ??= []).push(
|
|
111
|
+
static addInitializer(t) {
|
|
112
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
99
113
|
}
|
|
100
114
|
static get observedAttributes() {
|
|
101
115
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
102
116
|
}
|
|
103
|
-
static createProperty(
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
|
|
117
|
+
static createProperty(t, s = b) {
|
|
118
|
+
if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
|
|
119
|
+
const i = Symbol(), h = this.getPropertyDescriptor(t, i, s);
|
|
120
|
+
h !== undefined && e2(this.prototype, t, h);
|
|
107
121
|
}
|
|
108
122
|
}
|
|
109
|
-
static getPropertyDescriptor(
|
|
110
|
-
const { get:
|
|
111
|
-
return this[
|
|
112
|
-
}, set(
|
|
113
|
-
this[
|
|
123
|
+
static getPropertyDescriptor(t, s, i) {
|
|
124
|
+
const { get: e, set: r } = h(this.prototype, t) ?? { get() {
|
|
125
|
+
return this[s];
|
|
126
|
+
}, set(t) {
|
|
127
|
+
this[s] = t;
|
|
114
128
|
} };
|
|
115
|
-
return { get:
|
|
116
|
-
const
|
|
117
|
-
|
|
129
|
+
return { get: e, set(s) {
|
|
130
|
+
const h = e?.call(this);
|
|
131
|
+
r?.call(this, s), this.requestUpdate(t, h, i);
|
|
118
132
|
}, configurable: true, enumerable: true };
|
|
119
133
|
}
|
|
120
|
-
static getPropertyOptions(
|
|
121
|
-
return this.elementProperties.get(
|
|
134
|
+
static getPropertyOptions(t) {
|
|
135
|
+
return this.elementProperties.get(t) ?? b;
|
|
122
136
|
}
|
|
123
137
|
static _$Ei() {
|
|
124
138
|
if (this.hasOwnProperty(d("elementProperties")))
|
|
125
139
|
return;
|
|
126
|
-
const
|
|
127
|
-
|
|
140
|
+
const t = n2(this);
|
|
141
|
+
t.finalize(), t.l !== undefined && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
128
142
|
}
|
|
129
143
|
static finalize() {
|
|
130
144
|
if (this.hasOwnProperty(d("finalized")))
|
|
131
145
|
return;
|
|
132
146
|
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
133
|
-
const
|
|
134
|
-
for (const
|
|
135
|
-
this.createProperty(
|
|
147
|
+
const t = this.properties, s = [...r2(t), ...o2(t)];
|
|
148
|
+
for (const i of s)
|
|
149
|
+
this.createProperty(i, t[i]);
|
|
136
150
|
}
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
for (const [
|
|
142
|
-
this.elementProperties.set(
|
|
151
|
+
const t = this[Symbol.metadata];
|
|
152
|
+
if (t !== null) {
|
|
153
|
+
const s = litPropertyMetadata.get(t);
|
|
154
|
+
if (s !== undefined)
|
|
155
|
+
for (const [t, i] of s)
|
|
156
|
+
this.elementProperties.set(t, i);
|
|
143
157
|
}
|
|
144
158
|
this._$Eh = new Map;
|
|
145
|
-
for (const [
|
|
146
|
-
const
|
|
147
|
-
|
|
159
|
+
for (const [t, s] of this.elementProperties) {
|
|
160
|
+
const i = this._$Eu(t, s);
|
|
161
|
+
i !== undefined && this._$Eh.set(i, t);
|
|
148
162
|
}
|
|
149
163
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
150
164
|
}
|
|
151
|
-
static finalizeStyles(
|
|
152
|
-
const
|
|
153
|
-
if (Array.isArray(
|
|
154
|
-
const
|
|
155
|
-
for (const
|
|
156
|
-
|
|
165
|
+
static finalizeStyles(s) {
|
|
166
|
+
const i = [];
|
|
167
|
+
if (Array.isArray(s)) {
|
|
168
|
+
const e = new Set(s.flat(1 / 0).reverse());
|
|
169
|
+
for (const s of e)
|
|
170
|
+
i.unshift(c(s));
|
|
157
171
|
} else
|
|
158
|
-
|
|
159
|
-
return
|
|
172
|
+
s !== undefined && i.push(c(s));
|
|
173
|
+
return i;
|
|
160
174
|
}
|
|
161
|
-
static _$Eu(
|
|
162
|
-
const
|
|
163
|
-
return
|
|
175
|
+
static _$Eu(t, s) {
|
|
176
|
+
const i = s.attribute;
|
|
177
|
+
return i === false ? undefined : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : undefined;
|
|
164
178
|
}
|
|
165
179
|
constructor() {
|
|
166
180
|
super(), this._$Ep = undefined, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
167
181
|
}
|
|
168
182
|
_$Ev() {
|
|
169
|
-
this._$ES = new Promise((
|
|
183
|
+
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
|
|
170
184
|
}
|
|
171
|
-
addController(
|
|
172
|
-
(this._$EO ??= new Set).add(
|
|
185
|
+
addController(t) {
|
|
186
|
+
(this._$EO ??= new Set).add(t), this.renderRoot !== undefined && this.isConnected && t.hostConnected?.();
|
|
173
187
|
}
|
|
174
|
-
removeController(
|
|
175
|
-
this._$EO?.delete(
|
|
188
|
+
removeController(t) {
|
|
189
|
+
this._$EO?.delete(t);
|
|
176
190
|
}
|
|
177
191
|
_$E_() {
|
|
178
|
-
const
|
|
179
|
-
for (const
|
|
180
|
-
this.hasOwnProperty(
|
|
181
|
-
|
|
192
|
+
const t = new Map, s = this.constructor.elementProperties;
|
|
193
|
+
for (const i of s.keys())
|
|
194
|
+
this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
195
|
+
t.size > 0 && (this._$Ep = t);
|
|
182
196
|
}
|
|
183
197
|
createRenderRoot() {
|
|
184
|
-
const
|
|
185
|
-
return S(
|
|
198
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
199
|
+
return S(t, this.constructor.elementStyles), t;
|
|
186
200
|
}
|
|
187
201
|
connectedCallback() {
|
|
188
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((
|
|
202
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
189
203
|
}
|
|
190
|
-
enableUpdating(
|
|
204
|
+
enableUpdating(t) {}
|
|
191
205
|
disconnectedCallback() {
|
|
192
|
-
this._$EO?.forEach((
|
|
206
|
+
this._$EO?.forEach((t) => t.hostDisconnected?.());
|
|
193
207
|
}
|
|
194
|
-
attributeChangedCallback(
|
|
195
|
-
this._$AK(
|
|
208
|
+
attributeChangedCallback(t, s, i) {
|
|
209
|
+
this._$AK(t, i);
|
|
196
210
|
}
|
|
197
|
-
_$ET(
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
this._$Em =
|
|
211
|
+
_$ET(t, s) {
|
|
212
|
+
const i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
|
|
213
|
+
if (e !== undefined && i.reflect === true) {
|
|
214
|
+
const h = (i.converter?.toAttribute !== undefined ? i.converter : u).toAttribute(s, i.type);
|
|
215
|
+
this._$Em = t, h == null ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
202
216
|
}
|
|
203
217
|
}
|
|
204
|
-
_$AK(
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
this._$Em =
|
|
209
|
-
const
|
|
210
|
-
this[
|
|
218
|
+
_$AK(t, s) {
|
|
219
|
+
const i = this.constructor, e = i._$Eh.get(t);
|
|
220
|
+
if (e !== undefined && this._$Em !== e) {
|
|
221
|
+
const t = i.getPropertyOptions(e), h = typeof t.converter == "function" ? { fromAttribute: t.converter } : t.converter?.fromAttribute !== undefined ? t.converter : u;
|
|
222
|
+
this._$Em = e;
|
|
223
|
+
const r = h.fromAttribute(s, t.type);
|
|
224
|
+
this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
|
|
211
225
|
}
|
|
212
226
|
}
|
|
213
|
-
requestUpdate(
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
227
|
+
requestUpdate(t, s, i) {
|
|
228
|
+
if (t !== undefined) {
|
|
229
|
+
const e = this.constructor, h = this[t];
|
|
230
|
+
if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i))))
|
|
217
231
|
return;
|
|
218
|
-
this.C(
|
|
232
|
+
this.C(t, s, i);
|
|
219
233
|
}
|
|
220
234
|
this.isUpdatePending === false && (this._$ES = this._$EP());
|
|
221
235
|
}
|
|
222
|
-
C(
|
|
223
|
-
|
|
236
|
+
C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) {
|
|
237
|
+
i && !(this._$Ej ??= new Map).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), h !== true || r !== undefined) || (this._$AL.has(t) || (this.hasUpdated || i || (s = undefined), this._$AL.set(t, s)), e === true && this._$Em !== t && (this._$Eq ??= new Set).add(t));
|
|
224
238
|
}
|
|
225
239
|
async _$EP() {
|
|
226
240
|
this.isUpdatePending = true;
|
|
227
241
|
try {
|
|
228
242
|
await this._$ES;
|
|
229
|
-
} catch (
|
|
230
|
-
Promise.reject(
|
|
243
|
+
} catch (t) {
|
|
244
|
+
Promise.reject(t);
|
|
231
245
|
}
|
|
232
|
-
const
|
|
233
|
-
return
|
|
246
|
+
const t = this.scheduleUpdate();
|
|
247
|
+
return t != null && await t, !this.isUpdatePending;
|
|
234
248
|
}
|
|
235
249
|
scheduleUpdate() {
|
|
236
250
|
return this.performUpdate();
|
|
@@ -240,29 +254,29 @@ var init_reactive_element = __esm(() => {
|
|
|
240
254
|
return;
|
|
241
255
|
if (!this.hasUpdated) {
|
|
242
256
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
243
|
-
for (const [
|
|
244
|
-
this[
|
|
257
|
+
for (const [t, s] of this._$Ep)
|
|
258
|
+
this[t] = s;
|
|
245
259
|
this._$Ep = undefined;
|
|
246
260
|
}
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
249
|
-
for (const [
|
|
250
|
-
const { wrapped:
|
|
251
|
-
|
|
261
|
+
const t = this.constructor.elementProperties;
|
|
262
|
+
if (t.size > 0)
|
|
263
|
+
for (const [s, i] of t) {
|
|
264
|
+
const { wrapped: t } = i, e = this[s];
|
|
265
|
+
t !== true || this._$AL.has(s) || e === undefined || this.C(s, undefined, i, e);
|
|
252
266
|
}
|
|
253
267
|
}
|
|
254
|
-
let
|
|
255
|
-
const
|
|
268
|
+
let t = false;
|
|
269
|
+
const s = this._$AL;
|
|
256
270
|
try {
|
|
257
|
-
|
|
258
|
-
} catch (
|
|
259
|
-
throw
|
|
271
|
+
t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((t) => t.hostUpdate?.()), this.update(s)) : this._$EM();
|
|
272
|
+
} catch (s) {
|
|
273
|
+
throw t = false, this._$EM(), s;
|
|
260
274
|
}
|
|
261
|
-
|
|
275
|
+
t && this._$AE(s);
|
|
262
276
|
}
|
|
263
|
-
willUpdate(
|
|
264
|
-
_$AE(
|
|
265
|
-
this._$EO?.forEach((
|
|
277
|
+
willUpdate(t) {}
|
|
278
|
+
_$AE(t) {
|
|
279
|
+
this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
|
|
266
280
|
}
|
|
267
281
|
_$EM() {
|
|
268
282
|
this._$AL = new Map, this.isUpdatePending = false;
|
|
@@ -273,80 +287,80 @@ var init_reactive_element = __esm(() => {
|
|
|
273
287
|
getUpdateComplete() {
|
|
274
288
|
return this._$ES;
|
|
275
289
|
}
|
|
276
|
-
shouldUpdate(
|
|
290
|
+
shouldUpdate(t) {
|
|
277
291
|
return true;
|
|
278
292
|
}
|
|
279
|
-
update(
|
|
280
|
-
this._$Eq &&= this._$Eq.forEach((
|
|
293
|
+
update(t) {
|
|
294
|
+
this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
|
|
281
295
|
}
|
|
282
|
-
updated(
|
|
283
|
-
firstUpdated(
|
|
296
|
+
updated(t) {}
|
|
297
|
+
firstUpdated(t) {}
|
|
284
298
|
};
|
|
285
299
|
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = new Map, y[d("finalized")] = new Map, p?.({ ReactiveElement: y }), (a.reactiveElementVersions ??= []).push("2.1.1");
|
|
286
300
|
});
|
|
287
301
|
|
|
288
302
|
// ../../node_modules/lit-html/lit-html.js
|
|
289
|
-
function P(
|
|
290
|
-
if (!a2(
|
|
303
|
+
function P(t, i) {
|
|
304
|
+
if (!a2(t) || !t.hasOwnProperty("raw"))
|
|
291
305
|
throw Error("invalid template strings array");
|
|
292
|
-
return s2 !== undefined ? s2.createHTML(
|
|
306
|
+
return s2 !== undefined ? s2.createHTML(i) : i;
|
|
293
307
|
}
|
|
294
308
|
|
|
295
309
|
class N {
|
|
296
|
-
constructor({ strings:
|
|
297
|
-
let
|
|
310
|
+
constructor({ strings: t, _$litType$: s }, n) {
|
|
311
|
+
let r;
|
|
298
312
|
this.parts = [];
|
|
299
|
-
let
|
|
300
|
-
const
|
|
301
|
-
if (this.el = N.createElement(
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
for (;(
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
308
|
-
for (const
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
|
|
313
|
+
let c = 0, a = 0;
|
|
314
|
+
const u = t.length - 1, d = this.parts, [f, v] = V(t, s);
|
|
315
|
+
if (this.el = N.createElement(f, n), C.currentNode = this.el.content, s === 2 || s === 3) {
|
|
316
|
+
const t = this.el.content.firstChild;
|
|
317
|
+
t.replaceWith(...t.childNodes);
|
|
318
|
+
}
|
|
319
|
+
for (;(r = C.nextNode()) !== null && d.length < u; ) {
|
|
320
|
+
if (r.nodeType === 1) {
|
|
321
|
+
if (r.hasAttributes())
|
|
322
|
+
for (const t of r.getAttributeNames())
|
|
323
|
+
if (t.endsWith(e3)) {
|
|
324
|
+
const i = v[a++], s = r.getAttribute(t).split(h2), e = /([.?@])?(.*)/.exec(i);
|
|
325
|
+
d.push({ type: 1, index: c, name: e[2], strings: s, ctor: e[1] === "." ? H : e[1] === "?" ? I : e[1] === "@" ? L : k }), r.removeAttribute(t);
|
|
312
326
|
} else
|
|
313
|
-
|
|
314
|
-
if ($.test(
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
for (let
|
|
319
|
-
|
|
320
|
-
|
|
327
|
+
t.startsWith(h2) && (d.push({ type: 6, index: c }), r.removeAttribute(t));
|
|
328
|
+
if ($.test(r.tagName)) {
|
|
329
|
+
const t = r.textContent.split(h2), s = t.length - 1;
|
|
330
|
+
if (s > 0) {
|
|
331
|
+
r.textContent = i3 ? i3.emptyScript : "";
|
|
332
|
+
for (let i = 0;i < s; i++)
|
|
333
|
+
r.append(t[i], l2()), C.nextNode(), d.push({ type: 2, index: ++c });
|
|
334
|
+
r.append(t[s], l2());
|
|
321
335
|
}
|
|
322
336
|
}
|
|
323
|
-
} else if (
|
|
324
|
-
if (
|
|
325
|
-
|
|
337
|
+
} else if (r.nodeType === 8)
|
|
338
|
+
if (r.data === o3)
|
|
339
|
+
d.push({ type: 2, index: c });
|
|
326
340
|
else {
|
|
327
|
-
let
|
|
328
|
-
for (;(
|
|
329
|
-
|
|
341
|
+
let t = -1;
|
|
342
|
+
for (;(t = r.data.indexOf(h2, t + 1)) !== -1; )
|
|
343
|
+
d.push({ type: 7, index: c }), t += h2.length - 1;
|
|
330
344
|
}
|
|
331
|
-
|
|
345
|
+
c++;
|
|
332
346
|
}
|
|
333
347
|
}
|
|
334
|
-
static createElement(
|
|
335
|
-
const
|
|
336
|
-
return
|
|
348
|
+
static createElement(t, i) {
|
|
349
|
+
const s = r3.createElement("template");
|
|
350
|
+
return s.innerHTML = t, s;
|
|
337
351
|
}
|
|
338
352
|
}
|
|
339
|
-
function S2(
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
342
|
-
let
|
|
343
|
-
const
|
|
344
|
-
return
|
|
353
|
+
function S2(t, i, s = t, e) {
|
|
354
|
+
if (i === T)
|
|
355
|
+
return i;
|
|
356
|
+
let h = e !== undefined ? s._$Co?.[e] : s._$Cl;
|
|
357
|
+
const o = c3(i) ? undefined : i._$litDirective$;
|
|
358
|
+
return h?.constructor !== o && (h?._$AO?.(false), o === undefined ? h = undefined : (h = new o(t), h._$AT(t, s, e)), e !== undefined ? (s._$Co ??= [])[e] = h : s._$Cl = h), h !== undefined && (i = S2(t, h._$AS(t, i.values), h, e)), i;
|
|
345
359
|
}
|
|
346
360
|
|
|
347
361
|
class M {
|
|
348
|
-
constructor(
|
|
349
|
-
this._$AV = [], this._$AN = undefined, this._$AD =
|
|
362
|
+
constructor(t, i) {
|
|
363
|
+
this._$AV = [], this._$AN = undefined, this._$AD = t, this._$AM = i;
|
|
350
364
|
}
|
|
351
365
|
get parentNode() {
|
|
352
366
|
return this._$AM.parentNode;
|
|
@@ -354,23 +368,23 @@ class M {
|
|
|
354
368
|
get _$AU() {
|
|
355
369
|
return this._$AM._$AU;
|
|
356
370
|
}
|
|
357
|
-
u(
|
|
358
|
-
const { el: { content:
|
|
359
|
-
C.currentNode =
|
|
360
|
-
let
|
|
361
|
-
for (;
|
|
362
|
-
if (
|
|
363
|
-
let
|
|
364
|
-
|
|
371
|
+
u(t) {
|
|
372
|
+
const { el: { content: i }, parts: s } = this._$AD, e = (t?.creationScope ?? r3).importNode(i, true);
|
|
373
|
+
C.currentNode = e;
|
|
374
|
+
let h = C.nextNode(), o = 0, n = 0, l = s[0];
|
|
375
|
+
for (;l !== undefined; ) {
|
|
376
|
+
if (o === l.index) {
|
|
377
|
+
let i;
|
|
378
|
+
l.type === 2 ? i = new R(h, h.nextSibling, this, t) : l.type === 1 ? i = new l.ctor(h, l.name, l.strings, this, t) : l.type === 6 && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
|
|
365
379
|
}
|
|
366
|
-
|
|
380
|
+
o !== l?.index && (h = C.nextNode(), o++);
|
|
367
381
|
}
|
|
368
|
-
return C.currentNode = r3,
|
|
382
|
+
return C.currentNode = r3, e;
|
|
369
383
|
}
|
|
370
|
-
p(
|
|
371
|
-
let
|
|
372
|
-
for (const
|
|
373
|
-
|
|
384
|
+
p(t) {
|
|
385
|
+
let i = 0;
|
|
386
|
+
for (const s of this._$AV)
|
|
387
|
+
s !== undefined && (s.strings !== undefined ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
|
|
374
388
|
}
|
|
375
389
|
}
|
|
376
390
|
|
|
@@ -378,13 +392,13 @@ class R {
|
|
|
378
392
|
get _$AU() {
|
|
379
393
|
return this._$AM?._$AU ?? this._$Cv;
|
|
380
394
|
}
|
|
381
|
-
constructor(
|
|
382
|
-
this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA =
|
|
395
|
+
constructor(t, i, s, e) {
|
|
396
|
+
this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
|
|
383
397
|
}
|
|
384
398
|
get parentNode() {
|
|
385
|
-
let
|
|
386
|
-
const
|
|
387
|
-
return
|
|
399
|
+
let t = this._$AA.parentNode;
|
|
400
|
+
const i = this._$AM;
|
|
401
|
+
return i !== undefined && t?.nodeType === 11 && (t = i.parentNode), t;
|
|
388
402
|
}
|
|
389
403
|
get startNode() {
|
|
390
404
|
return this._$AA;
|
|
@@ -392,47 +406,47 @@ class R {
|
|
|
392
406
|
get endNode() {
|
|
393
407
|
return this._$AB;
|
|
394
408
|
}
|
|
395
|
-
_$AI(
|
|
396
|
-
|
|
409
|
+
_$AI(t, i = this) {
|
|
410
|
+
t = S2(this, t, i), c3(t) ? t === E || t == null || t === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : t._$litType$ !== undefined ? this.$(t) : t.nodeType !== undefined ? this.T(t) : u2(t) ? this.k(t) : this._(t);
|
|
397
411
|
}
|
|
398
|
-
O(
|
|
399
|
-
return this._$AA.parentNode.insertBefore(
|
|
412
|
+
O(t) {
|
|
413
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
400
414
|
}
|
|
401
|
-
T(
|
|
402
|
-
this._$AH !==
|
|
415
|
+
T(t) {
|
|
416
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
403
417
|
}
|
|
404
|
-
_(
|
|
405
|
-
this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data =
|
|
418
|
+
_(t) {
|
|
419
|
+
this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r3.createTextNode(t)), this._$AH = t;
|
|
406
420
|
}
|
|
407
|
-
$(
|
|
408
|
-
const { values:
|
|
409
|
-
if (this._$AH?._$AD ===
|
|
410
|
-
this._$AH.p(
|
|
421
|
+
$(t) {
|
|
422
|
+
const { values: i, _$litType$: s } = t, e = typeof s == "number" ? this._$AC(t) : (s.el === undefined && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
|
|
423
|
+
if (this._$AH?._$AD === e)
|
|
424
|
+
this._$AH.p(i);
|
|
411
425
|
else {
|
|
412
|
-
const
|
|
413
|
-
|
|
426
|
+
const t = new M(e, this), s = t.u(this.options);
|
|
427
|
+
t.p(i), this.T(s), this._$AH = t;
|
|
414
428
|
}
|
|
415
429
|
}
|
|
416
|
-
_$AC(
|
|
417
|
-
let
|
|
418
|
-
return
|
|
430
|
+
_$AC(t) {
|
|
431
|
+
let i = A.get(t.strings);
|
|
432
|
+
return i === undefined && A.set(t.strings, i = new N(t)), i;
|
|
419
433
|
}
|
|
420
|
-
k(
|
|
434
|
+
k(t) {
|
|
421
435
|
a2(this._$AH) || (this._$AH = [], this._$AR());
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
for (const
|
|
425
|
-
|
|
426
|
-
|
|
436
|
+
const i = this._$AH;
|
|
437
|
+
let s, e = 0;
|
|
438
|
+
for (const h of t)
|
|
439
|
+
e === i.length ? i.push(s = new R(this.O(l2()), this.O(l2()), this, this.options)) : s = i[e], s._$AI(h), e++;
|
|
440
|
+
e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
|
|
427
441
|
}
|
|
428
|
-
_$AR(
|
|
429
|
-
for (this._$AP?.(false, true,
|
|
430
|
-
const
|
|
431
|
-
|
|
442
|
+
_$AR(t = this._$AA.nextSibling, i) {
|
|
443
|
+
for (this._$AP?.(false, true, i);t !== this._$AB; ) {
|
|
444
|
+
const i = t.nextSibling;
|
|
445
|
+
t.remove(), t = i;
|
|
432
446
|
}
|
|
433
447
|
}
|
|
434
|
-
setConnected(
|
|
435
|
-
this._$AM === undefined && (this._$Cv =
|
|
448
|
+
setConnected(t) {
|
|
449
|
+
this._$AM === undefined && (this._$Cv = t, this._$AP?.(t));
|
|
436
450
|
}
|
|
437
451
|
}
|
|
438
452
|
|
|
@@ -443,64 +457,64 @@ class k {
|
|
|
443
457
|
get _$AU() {
|
|
444
458
|
return this._$AM._$AU;
|
|
445
459
|
}
|
|
446
|
-
constructor(
|
|
447
|
-
this.type = 1, this._$AH = E, this._$AN = undefined, this.element =
|
|
460
|
+
constructor(t, i, s, e, h) {
|
|
461
|
+
this.type = 1, this._$AH = E, this._$AN = undefined, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String), this.strings = s) : this._$AH = E;
|
|
448
462
|
}
|
|
449
|
-
_$AI(
|
|
450
|
-
const
|
|
451
|
-
let
|
|
452
|
-
if (
|
|
453
|
-
|
|
463
|
+
_$AI(t, i = this, s, e) {
|
|
464
|
+
const h = this.strings;
|
|
465
|
+
let o = false;
|
|
466
|
+
if (h === undefined)
|
|
467
|
+
t = S2(this, t, i, 0), o = !c3(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
|
|
454
468
|
else {
|
|
455
|
-
const
|
|
456
|
-
let
|
|
457
|
-
for (
|
|
458
|
-
|
|
469
|
+
const e = t;
|
|
470
|
+
let n, r;
|
|
471
|
+
for (t = h[0], n = 0;n < h.length - 1; n++)
|
|
472
|
+
r = S2(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c3(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
|
|
459
473
|
}
|
|
460
|
-
|
|
474
|
+
o && !e && this.j(t);
|
|
461
475
|
}
|
|
462
|
-
j(
|
|
463
|
-
|
|
476
|
+
j(t) {
|
|
477
|
+
t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
464
478
|
}
|
|
465
479
|
}
|
|
466
480
|
|
|
467
481
|
class z {
|
|
468
|
-
constructor(
|
|
469
|
-
this.element =
|
|
482
|
+
constructor(t, i, s) {
|
|
483
|
+
this.element = t, this.type = 6, this._$AN = undefined, this._$AM = i, this.options = s;
|
|
470
484
|
}
|
|
471
485
|
get _$AU() {
|
|
472
486
|
return this._$AM._$AU;
|
|
473
487
|
}
|
|
474
|
-
_$AI(
|
|
475
|
-
S2(this,
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (
|
|
479
|
-
\f\r]`, f2, v, _, m, p2, g, $, y2 = (
|
|
480
|
-
const
|
|
481
|
-
let
|
|
482
|
-
for (let
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
for (;
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
return [P(
|
|
491
|
-
}, H, I, L, Z, j, B = (
|
|
492
|
-
const
|
|
493
|
-
let
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
return
|
|
488
|
+
_$AI(t) {
|
|
489
|
+
S2(this, t);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (t) => t === null || typeof t != "object" && typeof t != "function", a2, u2 = (t) => a2(t) || typeof t?.[Symbol.iterator] == "function", d2 = `[
|
|
493
|
+
\f\r]`, f2, v, _, m, p2, g, $, y2 = (t) => (i, ...s) => ({ _$litType$: t, strings: i, values: s }), x, b2, w, T, E, A, C, V = (t, i) => {
|
|
494
|
+
const s = t.length - 1, o = [];
|
|
495
|
+
let r, l = i === 2 ? "<svg>" : i === 3 ? "<math>" : "", c = f2;
|
|
496
|
+
for (let i = 0;i < s; i++) {
|
|
497
|
+
const s = t[i];
|
|
498
|
+
let a, u, d = -1, y = 0;
|
|
499
|
+
for (;y < s.length && (c.lastIndex = y, u = c.exec(s), u !== null); )
|
|
500
|
+
y = c.lastIndex, c === f2 ? u[1] === "!--" ? c = v : u[1] !== undefined ? c = _ : u[2] !== undefined ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : u[3] !== undefined && (c = m) : c === m ? u[0] === ">" ? (c = r ?? f2, d = -1) : u[1] === undefined ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = u[3] === undefined ? m : u[3] === '"' ? g : p2) : c === g || c === p2 ? c = m : c === v || c === _ ? c = f2 : (c = m, r = undefined);
|
|
501
|
+
const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
|
|
502
|
+
l += c === f2 ? s + n3 : d >= 0 ? (o.push(a), s.slice(0, d) + e3 + s.slice(d) + h2 + x) : s + h2 + (d === -2 ? i : x);
|
|
503
|
+
}
|
|
504
|
+
return [P(t, l + (t[s] || "<?>") + (i === 2 ? "</svg>" : i === 3 ? "</math>" : "")), o];
|
|
505
|
+
}, H, I, L, Z, j, B = (t, i, s) => {
|
|
506
|
+
const e = s?.renderBefore ?? i;
|
|
507
|
+
let h = e._$litPart$;
|
|
508
|
+
if (h === undefined) {
|
|
509
|
+
const t = s?.renderBefore ?? null;
|
|
510
|
+
e._$litPart$ = h = new R(i.insertBefore(l2(), t), t, undefined, s ?? {});
|
|
511
|
+
}
|
|
512
|
+
return h._$AI(t), h;
|
|
499
513
|
};
|
|
500
514
|
var init_lit_html = __esm(() => {
|
|
501
515
|
t2 = globalThis;
|
|
502
516
|
i3 = t2.trustedTypes;
|
|
503
|
-
s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (
|
|
517
|
+
s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t) => t }) : undefined;
|
|
504
518
|
h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
505
519
|
o3 = "?" + h2;
|
|
506
520
|
n3 = `<${o3}>`;
|
|
@@ -525,30 +539,30 @@ var init_lit_html = __esm(() => {
|
|
|
525
539
|
constructor() {
|
|
526
540
|
super(...arguments), this.type = 3;
|
|
527
541
|
}
|
|
528
|
-
j(
|
|
529
|
-
this.element[this.name] =
|
|
542
|
+
j(t) {
|
|
543
|
+
this.element[this.name] = t === E ? undefined : t;
|
|
530
544
|
}
|
|
531
545
|
};
|
|
532
546
|
I = class I extends k {
|
|
533
547
|
constructor() {
|
|
534
548
|
super(...arguments), this.type = 4;
|
|
535
549
|
}
|
|
536
|
-
j(
|
|
537
|
-
this.element.toggleAttribute(this.name, !!
|
|
550
|
+
j(t) {
|
|
551
|
+
this.element.toggleAttribute(this.name, !!t && t !== E);
|
|
538
552
|
}
|
|
539
553
|
};
|
|
540
554
|
L = class L extends k {
|
|
541
|
-
constructor(
|
|
542
|
-
super(
|
|
555
|
+
constructor(t, i, s, e, h) {
|
|
556
|
+
super(t, i, s, e, h), this.type = 5;
|
|
543
557
|
}
|
|
544
|
-
_$AI(
|
|
545
|
-
if ((
|
|
558
|
+
_$AI(t, i = this) {
|
|
559
|
+
if ((t = S2(this, t, i, 0) ?? E) === T)
|
|
546
560
|
return;
|
|
547
|
-
const
|
|
548
|
-
|
|
561
|
+
const s = this._$AH, e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== E && (s === E || e);
|
|
562
|
+
e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
549
563
|
}
|
|
550
|
-
handleEvent(
|
|
551
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element,
|
|
564
|
+
handleEvent(t) {
|
|
565
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
552
566
|
}
|
|
553
567
|
};
|
|
554
568
|
Z = { M: e3, P: h2, A: o3, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z };
|
|
@@ -559,9 +573,9 @@ var init_lit_html = __esm(() => {
|
|
|
559
573
|
// ../../node_modules/lit-element/lit-element.js
|
|
560
574
|
var s3, i4, o4;
|
|
561
575
|
var init_lit_element = __esm(() => {
|
|
562
|
-
init_reactive_element();
|
|
563
576
|
init_reactive_element();
|
|
564
577
|
init_lit_html();
|
|
578
|
+
init_reactive_element();
|
|
565
579
|
init_lit_html();
|
|
566
580
|
s3 = globalThis;
|
|
567
581
|
i4 = class i4 extends y {
|
|
@@ -569,12 +583,12 @@ var init_lit_element = __esm(() => {
|
|
|
569
583
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = undefined;
|
|
570
584
|
}
|
|
571
585
|
createRenderRoot() {
|
|
572
|
-
const
|
|
573
|
-
return this.renderOptions.renderBefore ??=
|
|
586
|
+
const t = super.createRenderRoot();
|
|
587
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
574
588
|
}
|
|
575
|
-
update(
|
|
576
|
-
const
|
|
577
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
589
|
+
update(t) {
|
|
590
|
+
const r = this.render();
|
|
591
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
|
|
578
592
|
}
|
|
579
593
|
connectedCallback() {
|
|
580
594
|
super.connectedCallback(), this._$Do?.setConnected(true);
|
|
@@ -608,16 +622,16 @@ function base(ALPHABET) {
|
|
|
608
622
|
throw new TypeError("Alphabet too long");
|
|
609
623
|
}
|
|
610
624
|
const BASE_MAP = new Uint8Array(256);
|
|
611
|
-
for (let
|
|
612
|
-
BASE_MAP[
|
|
625
|
+
for (let j = 0;j < BASE_MAP.length; j++) {
|
|
626
|
+
BASE_MAP[j] = 255;
|
|
613
627
|
}
|
|
614
|
-
for (let
|
|
615
|
-
const
|
|
616
|
-
const xc =
|
|
628
|
+
for (let i = 0;i < ALPHABET.length; i++) {
|
|
629
|
+
const x = ALPHABET.charAt(i);
|
|
630
|
+
const xc = x.charCodeAt(0);
|
|
617
631
|
if (BASE_MAP[xc] !== 255) {
|
|
618
|
-
throw new TypeError(
|
|
632
|
+
throw new TypeError(x + " is ambiguous");
|
|
619
633
|
}
|
|
620
|
-
BASE_MAP[xc] =
|
|
634
|
+
BASE_MAP[xc] = i;
|
|
621
635
|
}
|
|
622
636
|
const BASE = ALPHABET.length;
|
|
623
637
|
const LEADER = ALPHABET.charAt(0);
|
|
@@ -647,8 +661,8 @@ function base(ALPHABET) {
|
|
|
647
661
|
const b58 = new Uint8Array(size);
|
|
648
662
|
while (pbegin !== pend) {
|
|
649
663
|
let carry = source[pbegin];
|
|
650
|
-
let
|
|
651
|
-
for (let it1 = size - 1;(carry !== 0 ||
|
|
664
|
+
let i = 0;
|
|
665
|
+
for (let it1 = size - 1;(carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
652
666
|
carry += 256 * b58[it1] >>> 0;
|
|
653
667
|
b58[it1] = carry % BASE >>> 0;
|
|
654
668
|
carry = carry / BASE >>> 0;
|
|
@@ -656,7 +670,7 @@ function base(ALPHABET) {
|
|
|
656
670
|
if (carry !== 0) {
|
|
657
671
|
throw new Error("Non-zero carry");
|
|
658
672
|
}
|
|
659
|
-
length =
|
|
673
|
+
length = i;
|
|
660
674
|
pbegin++;
|
|
661
675
|
}
|
|
662
676
|
let it2 = size - length;
|
|
@@ -694,8 +708,8 @@ function base(ALPHABET) {
|
|
|
694
708
|
if (carry === 255) {
|
|
695
709
|
return;
|
|
696
710
|
}
|
|
697
|
-
let
|
|
698
|
-
for (let it3 = size - 1;(carry !== 0 ||
|
|
711
|
+
let i = 0;
|
|
712
|
+
for (let it3 = size - 1;(carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
699
713
|
carry += BASE * b256[it3] >>> 0;
|
|
700
714
|
b256[it3] = carry % 256 >>> 0;
|
|
701
715
|
carry = carry / 256 >>> 0;
|
|
@@ -703,7 +717,7 @@ function base(ALPHABET) {
|
|
|
703
717
|
if (carry !== 0) {
|
|
704
718
|
throw new Error("Non-zero carry");
|
|
705
719
|
}
|
|
706
|
-
length =
|
|
720
|
+
length = i;
|
|
707
721
|
psz++;
|
|
708
722
|
}
|
|
709
723
|
let it4 = size - length;
|
|
@@ -711,9 +725,9 @@ function base(ALPHABET) {
|
|
|
711
725
|
it4++;
|
|
712
726
|
}
|
|
713
727
|
const vch = new Uint8Array(zeroes + (size - it4));
|
|
714
|
-
let
|
|
728
|
+
let j = zeroes;
|
|
715
729
|
while (it4 !== size) {
|
|
716
|
-
vch[
|
|
730
|
+
vch[j++] = b256[it4++];
|
|
717
731
|
}
|
|
718
732
|
return vch;
|
|
719
733
|
}
|
|
@@ -753,14 +767,14 @@ var init_near = __esm(() => {
|
|
|
753
767
|
});
|
|
754
768
|
|
|
755
769
|
// ../shared-ts/src/utils/validation.ts
|
|
756
|
-
function isObject(
|
|
757
|
-
return
|
|
770
|
+
function isObject(x) {
|
|
771
|
+
return x !== null && typeof x === "object";
|
|
758
772
|
}
|
|
759
|
-
function isString(
|
|
760
|
-
return typeof
|
|
773
|
+
function isString(x) {
|
|
774
|
+
return typeof x === "string";
|
|
761
775
|
}
|
|
762
|
-
function isNumber(
|
|
763
|
-
return typeof
|
|
776
|
+
function isNumber(x) {
|
|
777
|
+
return typeof x === "number";
|
|
764
778
|
}
|
|
765
779
|
var init_validation = __esm(() => {
|
|
766
780
|
init_near();
|
|
@@ -806,11 +820,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
806
820
|
init_lit();
|
|
807
821
|
init_validation();
|
|
808
822
|
LitElementWithProps = class LitElementWithProps extends i4 {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
823
|
+
constructor() {
|
|
824
|
+
super(...arguments);
|
|
825
|
+
this._varsSheet = null;
|
|
826
|
+
this._varsMap = {};
|
|
827
|
+
this._appearanceVarNames = new Set;
|
|
828
|
+
this._varsDocSheet = null;
|
|
829
|
+
this._varsClassName = null;
|
|
830
|
+
}
|
|
814
831
|
static keepDefinitions;
|
|
815
832
|
static requiredChildTags;
|
|
816
833
|
static strictChildDefinitions;
|
|
@@ -830,7 +847,6 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
830
847
|
propertyNames.forEach((prop) => this.upgradeProperty(prop));
|
|
831
848
|
}
|
|
832
849
|
}
|
|
833
|
-
styles;
|
|
834
850
|
connectedCallback() {
|
|
835
851
|
super.connectedCallback();
|
|
836
852
|
this.upgradeAllProperties();
|
|
@@ -842,7 +858,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
842
858
|
const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
|
|
843
859
|
const defs = keepDefinitions;
|
|
844
860
|
if (defs && defs.length) {
|
|
845
|
-
for (const
|
|
861
|
+
for (const d of defs)
|
|
846
862
|
;
|
|
847
863
|
}
|
|
848
864
|
const req = requiredChildTags;
|
|
@@ -877,7 +893,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
877
893
|
const setVar = (name, val) => {
|
|
878
894
|
vars[name] = val;
|
|
879
895
|
};
|
|
880
|
-
const toKebab = (
|
|
896
|
+
const toKebab = (s) => this.camelToKebab(s);
|
|
881
897
|
const transformViewportUnits = (val) => {
|
|
882
898
|
if (!val || typeof val !== "string")
|
|
883
899
|
return val;
|
|
@@ -924,14 +940,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
924
940
|
setVar(colorMappings[key], maybeTransformed);
|
|
925
941
|
return;
|
|
926
942
|
}
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
setVar(`--w3a-border-radius-${
|
|
943
|
+
const r = key.match(radiusMatcher);
|
|
944
|
+
if (r) {
|
|
945
|
+
setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
|
|
930
946
|
return;
|
|
931
947
|
}
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
setVar(`--w3a-shadows-${
|
|
948
|
+
const s = key.match(shadowMatcher);
|
|
949
|
+
if (s) {
|
|
950
|
+
setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
|
|
935
951
|
return;
|
|
936
952
|
}
|
|
937
953
|
setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
|
|
@@ -942,8 +958,8 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
942
958
|
const kebabSection = toKebab(section);
|
|
943
959
|
const kebabProp = toKebab(prop);
|
|
944
960
|
const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
|
|
945
|
-
const
|
|
946
|
-
vars[cssVarNew] =
|
|
961
|
+
const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
|
|
962
|
+
vars[cssVarNew] = v;
|
|
947
963
|
});
|
|
948
964
|
}
|
|
949
965
|
});
|
|
@@ -954,12 +970,12 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
954
970
|
}
|
|
955
971
|
setCssVars(vars) {
|
|
956
972
|
try {
|
|
957
|
-
for (const [
|
|
958
|
-
if (
|
|
973
|
+
for (const [k, v] of Object.entries(vars)) {
|
|
974
|
+
if (v == null)
|
|
959
975
|
continue;
|
|
960
|
-
this._varsMap[
|
|
976
|
+
this._varsMap[k] = String(v);
|
|
961
977
|
}
|
|
962
|
-
const decls = Object.entries(this._varsMap).map(([
|
|
978
|
+
const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
|
|
963
979
|
const cssTextShadow = `:host{ ${decls} }`;
|
|
964
980
|
const canUseConstructable = supportsConstructableStylesheets();
|
|
965
981
|
if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
|
|
@@ -1026,16 +1042,16 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1026
1042
|
});
|
|
1027
1043
|
|
|
1028
1044
|
// src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
|
|
1029
|
-
function withTrailingSlash(
|
|
1030
|
-
return
|
|
1045
|
+
function withTrailingSlash(s) {
|
|
1046
|
+
return s.endsWith("/") ? s : s + "/";
|
|
1031
1047
|
}
|
|
1032
1048
|
function readGlobalEmbeddedBase() {
|
|
1033
1049
|
try {
|
|
1034
1050
|
if (typeof window === "undefined")
|
|
1035
1051
|
return;
|
|
1036
|
-
const
|
|
1037
|
-
if (typeof
|
|
1038
|
-
return withTrailingSlash(
|
|
1052
|
+
const v = window.__W3A_WALLET_SDK_BASE__;
|
|
1053
|
+
if (typeof v === "string" && v.length > 0)
|
|
1054
|
+
return withTrailingSlash(v);
|
|
1039
1055
|
} catch {}
|
|
1040
1056
|
return;
|
|
1041
1057
|
}
|
|
@@ -1044,14 +1060,14 @@ function deriveFromModuleUrl() {
|
|
|
1044
1060
|
const moduleUrl = String(import.meta.url || "").trim();
|
|
1045
1061
|
if (!moduleUrl)
|
|
1046
1062
|
return;
|
|
1047
|
-
const
|
|
1048
|
-
const
|
|
1049
|
-
const href =
|
|
1063
|
+
const base = typeof window !== "undefined" ? window.location.href : undefined;
|
|
1064
|
+
const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
|
|
1065
|
+
const href = u.toString();
|
|
1050
1066
|
const idx = href.indexOf(SDK_SEGMENT);
|
|
1051
1067
|
if (idx > 0) {
|
|
1052
1068
|
return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
|
|
1053
1069
|
}
|
|
1054
|
-
const origin =
|
|
1070
|
+
const origin = u.origin;
|
|
1055
1071
|
if (origin && /^https?:/i.test(origin)) {
|
|
1056
1072
|
return withTrailingSlash(origin + "/sdk");
|
|
1057
1073
|
}
|
|
@@ -1065,22 +1081,22 @@ var SDK_SEGMENT = "/sdk/";
|
|
|
1065
1081
|
|
|
1066
1082
|
// src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
|
|
1067
1083
|
function resolveStylesheetUrl(assetName) {
|
|
1068
|
-
const
|
|
1069
|
-
const join = (
|
|
1070
|
-
if (/^https?:/i.test(
|
|
1071
|
-
return `${join(
|
|
1084
|
+
const base = resolveEmbeddedBase();
|
|
1085
|
+
const join = (s) => s.endsWith("/") ? s : s + "/";
|
|
1086
|
+
if (/^https?:/i.test(base))
|
|
1087
|
+
return `${join(base)}${assetName}`;
|
|
1072
1088
|
try {
|
|
1073
1089
|
if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
|
|
1074
1090
|
warnedRelativeBaseOnce = true;
|
|
1075
|
-
console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${
|
|
1091
|
+
console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${base}". ` + `In production, configure an absolute base so iframe assets resolve: ` + `set SeamsWebProvider config { iframeWallet: { walletOrigin: "https://wallet.example.com", sdkBasePath: "/sdk" } }, `);
|
|
1076
1092
|
}
|
|
1077
1093
|
} catch {}
|
|
1078
1094
|
const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
|
|
1079
1095
|
if (origin && origin !== "null" && /^https?:/i.test(origin)) {
|
|
1080
|
-
const prefix =
|
|
1096
|
+
const prefix = base.startsWith("/") ? base : `/${base}`;
|
|
1081
1097
|
return `${join(origin + prefix)}${assetName}`;
|
|
1082
1098
|
}
|
|
1083
|
-
const normalized =
|
|
1099
|
+
const normalized = base.startsWith("/") ? base : `/${base}`;
|
|
1084
1100
|
return `${join(normalized)}${assetName}`;
|
|
1085
1101
|
}
|
|
1086
1102
|
function getDoc(root) {
|
|
@@ -1126,9 +1142,9 @@ async function adoptConstructable(root, assetName) {
|
|
|
1126
1142
|
if (!res.ok)
|
|
1127
1143
|
return null;
|
|
1128
1144
|
const cssText = await res.text();
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
return
|
|
1145
|
+
const sheet = new CSSStyleSheet;
|
|
1146
|
+
sheet.replaceSync(cssText);
|
|
1147
|
+
return sheet;
|
|
1132
1148
|
} catch {
|
|
1133
1149
|
return null;
|
|
1134
1150
|
}
|
|
@@ -1178,28 +1194,28 @@ var init_css_loader = __esm(() => {
|
|
|
1178
1194
|
});
|
|
1179
1195
|
|
|
1180
1196
|
// ../../node_modules/lit-html/directive-helpers.js
|
|
1181
|
-
var t3, f3 = (
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1197
|
+
var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
|
|
1198
|
+
const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
|
|
1199
|
+
if (n === undefined) {
|
|
1200
|
+
const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
|
|
1201
|
+
n = new t3(i, d, o, o.options);
|
|
1186
1202
|
} else {
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
let
|
|
1190
|
-
|
|
1203
|
+
const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
|
|
1204
|
+
if (d) {
|
|
1205
|
+
let t;
|
|
1206
|
+
n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
|
|
1191
1207
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
let
|
|
1194
|
-
for (;
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1208
|
+
if (t !== l || d) {
|
|
1209
|
+
let o = n._$AA;
|
|
1210
|
+
for (;o !== t; ) {
|
|
1211
|
+
const t = o.nextSibling;
|
|
1212
|
+
e.insertBefore(o, l), o = t;
|
|
1197
1213
|
}
|
|
1198
1214
|
}
|
|
1199
1215
|
}
|
|
1200
|
-
return
|
|
1201
|
-
}, v2 = (
|
|
1202
|
-
|
|
1216
|
+
return n;
|
|
1217
|
+
}, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
|
|
1218
|
+
o._$AR(), o._$AA.remove();
|
|
1203
1219
|
};
|
|
1204
1220
|
var init_directive_helpers = __esm(() => {
|
|
1205
1221
|
init_lit_html();
|
|
@@ -1209,66 +1225,66 @@ var init_directive_helpers = __esm(() => {
|
|
|
1209
1225
|
|
|
1210
1226
|
// ../../node_modules/lit-html/directive.js
|
|
1211
1227
|
class i5 {
|
|
1212
|
-
constructor(
|
|
1228
|
+
constructor(t) {}
|
|
1213
1229
|
get _$AU() {
|
|
1214
1230
|
return this._$AM._$AU;
|
|
1215
1231
|
}
|
|
1216
|
-
_$AT(
|
|
1217
|
-
this._$Ct =
|
|
1232
|
+
_$AT(t, e, i) {
|
|
1233
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
1218
1234
|
}
|
|
1219
|
-
_$AS(
|
|
1220
|
-
return this.update(
|
|
1235
|
+
_$AS(t, e) {
|
|
1236
|
+
return this.update(t, e);
|
|
1221
1237
|
}
|
|
1222
|
-
update(
|
|
1223
|
-
return this.render(...
|
|
1238
|
+
update(t, e) {
|
|
1239
|
+
return this.render(...e);
|
|
1224
1240
|
}
|
|
1225
1241
|
}
|
|
1226
|
-
var t4, e4 = (
|
|
1242
|
+
var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
1227
1243
|
var init_directive = __esm(() => {
|
|
1228
1244
|
t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
1229
1245
|
});
|
|
1230
1246
|
|
|
1231
1247
|
// ../../node_modules/lit-html/async-directive.js
|
|
1232
|
-
function h3(
|
|
1233
|
-
this._$AN !== undefined ? (o5(this), this._$AM =
|
|
1234
|
-
}
|
|
1235
|
-
function n4(
|
|
1236
|
-
const
|
|
1237
|
-
if (
|
|
1238
|
-
if (
|
|
1239
|
-
if (Array.isArray(
|
|
1240
|
-
for (let
|
|
1241
|
-
s5(
|
|
1248
|
+
function h3(i) {
|
|
1249
|
+
this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
|
|
1250
|
+
}
|
|
1251
|
+
function n4(i, t = false, e = 0) {
|
|
1252
|
+
const r = this._$AH, h = this._$AN;
|
|
1253
|
+
if (h !== undefined && h.size !== 0)
|
|
1254
|
+
if (t)
|
|
1255
|
+
if (Array.isArray(r))
|
|
1256
|
+
for (let i = e;i < r.length; i++)
|
|
1257
|
+
s5(r[i], false), o5(r[i]);
|
|
1242
1258
|
else
|
|
1243
|
-
|
|
1259
|
+
r != null && (s5(r, false), o5(r));
|
|
1244
1260
|
else
|
|
1245
|
-
s5(this,
|
|
1261
|
+
s5(this, i);
|
|
1246
1262
|
}
|
|
1247
|
-
var s5 = (
|
|
1248
|
-
const
|
|
1249
|
-
if (
|
|
1263
|
+
var s5 = (i, t) => {
|
|
1264
|
+
const e = i._$AN;
|
|
1265
|
+
if (e === undefined)
|
|
1250
1266
|
return false;
|
|
1251
|
-
for (const
|
|
1252
|
-
|
|
1267
|
+
for (const i of e)
|
|
1268
|
+
i._$AO?.(t, false), s5(i, t);
|
|
1253
1269
|
return true;
|
|
1254
|
-
}, o5 = (
|
|
1255
|
-
let
|
|
1270
|
+
}, o5 = (i) => {
|
|
1271
|
+
let t, e;
|
|
1256
1272
|
do {
|
|
1257
|
-
if ((
|
|
1273
|
+
if ((t = i._$AM) === undefined)
|
|
1258
1274
|
break;
|
|
1259
|
-
|
|
1260
|
-
} while (
|
|
1261
|
-
}, r5 = (
|
|
1262
|
-
for (let
|
|
1263
|
-
let
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1266
|
-
else if (
|
|
1275
|
+
e = t._$AN, e.delete(i), i = t;
|
|
1276
|
+
} while (e?.size === 0);
|
|
1277
|
+
}, r5 = (i) => {
|
|
1278
|
+
for (let t;t = i._$AM; i = t) {
|
|
1279
|
+
let e = t._$AN;
|
|
1280
|
+
if (e === undefined)
|
|
1281
|
+
t._$AN = e = new Set;
|
|
1282
|
+
else if (e.has(i))
|
|
1267
1283
|
break;
|
|
1268
|
-
|
|
1284
|
+
e.add(i), c4(t);
|
|
1269
1285
|
}
|
|
1270
|
-
}, c4 = (
|
|
1271
|
-
|
|
1286
|
+
}, c4 = (i) => {
|
|
1287
|
+
i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
|
|
1272
1288
|
}, f4;
|
|
1273
1289
|
var init_async_directive = __esm(() => {
|
|
1274
1290
|
init_directive_helpers();
|
|
@@ -1278,18 +1294,18 @@ var init_async_directive = __esm(() => {
|
|
|
1278
1294
|
constructor() {
|
|
1279
1295
|
super(...arguments), this._$AN = undefined;
|
|
1280
1296
|
}
|
|
1281
|
-
_$AT(
|
|
1282
|
-
super._$AT(
|
|
1297
|
+
_$AT(i, t, e) {
|
|
1298
|
+
super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
|
|
1283
1299
|
}
|
|
1284
|
-
_$AO(
|
|
1285
|
-
|
|
1300
|
+
_$AO(i, t = true) {
|
|
1301
|
+
i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
|
|
1286
1302
|
}
|
|
1287
|
-
setValue(
|
|
1303
|
+
setValue(t) {
|
|
1288
1304
|
if (f3(this._$Ct))
|
|
1289
|
-
this._$Ct._$AI(
|
|
1305
|
+
this._$Ct._$AI(t, this);
|
|
1290
1306
|
else {
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1307
|
+
const i = [...this._$Ct._$AH];
|
|
1308
|
+
i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
|
|
1293
1309
|
}
|
|
1294
1310
|
}
|
|
1295
1311
|
disconnected() {}
|
|
@@ -1307,20 +1323,20 @@ var init_ref = __esm(() => {
|
|
|
1307
1323
|
init_directive();
|
|
1308
1324
|
o6 = new WeakMap;
|
|
1309
1325
|
n5 = e4(class extends f4 {
|
|
1310
|
-
render(
|
|
1326
|
+
render(i) {
|
|
1311
1327
|
return E;
|
|
1312
1328
|
}
|
|
1313
|
-
update(
|
|
1314
|
-
const
|
|
1315
|
-
return
|
|
1329
|
+
update(i, [s]) {
|
|
1330
|
+
const e = s !== this.G;
|
|
1331
|
+
return e && this.G !== undefined && this.rt(undefined), (e || this.lt !== this.ct) && (this.G = s, this.ht = i.options?.host, this.rt(this.ct = i.element)), E;
|
|
1316
1332
|
}
|
|
1317
|
-
rt(
|
|
1318
|
-
if (this.isConnected || (
|
|
1319
|
-
const
|
|
1320
|
-
let
|
|
1321
|
-
|
|
1333
|
+
rt(t) {
|
|
1334
|
+
if (this.isConnected || (t = undefined), typeof this.G == "function") {
|
|
1335
|
+
const i = this.ht ?? globalThis;
|
|
1336
|
+
let s = o6.get(i);
|
|
1337
|
+
s === undefined && (s = new WeakMap, o6.set(i, s)), s.get(this.G) !== undefined && this.G.call(this.ht, undefined), s.set(this.G, t), t !== undefined && this.G.call(this.ht, t);
|
|
1322
1338
|
} else
|
|
1323
|
-
this.G.value =
|
|
1339
|
+
this.G.value = t;
|
|
1324
1340
|
}
|
|
1325
1341
|
get lt() {
|
|
1326
1342
|
return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
@@ -1373,8 +1389,8 @@ var init_lit_events = __esm(() => {
|
|
|
1373
1389
|
});
|
|
1374
1390
|
|
|
1375
1391
|
// src/core/signingEngine/uiConfirm/ui/lit-components/Drawer/index.ts
|
|
1376
|
-
function clamp(
|
|
1377
|
-
return Math.max(min, Math.min(max,
|
|
1392
|
+
function clamp(n, min, max) {
|
|
1393
|
+
return Math.max(min, Math.min(max, n));
|
|
1378
1394
|
}
|
|
1379
1395
|
var SHEET_HEIGHT_VH = 100, DEFAULT_VISIBLE_VH = 50, FLICK_UP_CLOSE_THRESHOLD = -0.6, FLICK_DOWN_CLOSE_THRESHOLD = 0.7, NEAR_CLOSED_PX = 50, OVERPULL_SHEET_FACTOR = 0.5, OVERPULL_VIEWPORT_FACTOR = 0.5, DrawerElement, Drawer_default;
|
|
1380
1396
|
var init_Drawer = __esm(() => {
|
|
@@ -1396,44 +1412,185 @@ var init_Drawer = __esm(() => {
|
|
|
1396
1412
|
height: { type: String },
|
|
1397
1413
|
overpullPx: { type: Number, attribute: "overpull-px" }
|
|
1398
1414
|
};
|
|
1399
|
-
isDragging = false;
|
|
1400
|
-
pendingDrag = false;
|
|
1401
|
-
startY = 0;
|
|
1402
|
-
currentY = 0;
|
|
1403
|
-
dragDistance = 0;
|
|
1404
|
-
lastDragTime = 0;
|
|
1405
|
-
velocity = 0;
|
|
1406
|
-
drawerElement = null;
|
|
1407
|
-
overlayElement = null;
|
|
1408
|
-
bodyElement = null;
|
|
1409
|
-
drawerHeight = 0;
|
|
1410
|
-
startTranslateYPx = 0;
|
|
1411
|
-
openRestTranslateYPx = 0;
|
|
1412
|
-
dragStartTime = 0;
|
|
1413
|
-
isClosing = false;
|
|
1414
|
-
aboveFoldResizeObserver;
|
|
1415
|
-
drawerResizeObserver;
|
|
1416
|
-
detachViewportSync;
|
|
1417
|
-
_syncRAF = null;
|
|
1418
|
-
_lastOpenTranslatePct;
|
|
1419
|
-
_contentAnimRAF = null;
|
|
1420
|
-
_activeHeightTransitions = 0;
|
|
1421
|
-
detachContentAnimSync;
|
|
1422
|
-
_initialMount = true;
|
|
1423
|
-
_firstOpen = true;
|
|
1424
|
-
_stylesReady = false;
|
|
1425
|
-
_stylePromises = [];
|
|
1426
|
-
_stylesAwaiting = null;
|
|
1427
|
-
_childObserver = null;
|
|
1428
1415
|
createRenderRoot() {
|
|
1429
1416
|
const root = this;
|
|
1430
|
-
const
|
|
1431
|
-
this._stylePromises.push(
|
|
1432
|
-
|
|
1417
|
+
const p = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
|
|
1418
|
+
this._stylePromises.push(p);
|
|
1419
|
+
p.catch(() => {});
|
|
1433
1420
|
return root;
|
|
1434
1421
|
}
|
|
1435
1422
|
constructor() {
|
|
1436
1423
|
super();
|
|
1424
|
+
this.isDragging = false;
|
|
1425
|
+
this.pendingDrag = false;
|
|
1426
|
+
this.startY = 0;
|
|
1427
|
+
this.currentY = 0;
|
|
1428
|
+
this.dragDistance = 0;
|
|
1429
|
+
this.lastDragTime = 0;
|
|
1430
|
+
this.velocity = 0;
|
|
1431
|
+
this.drawerElement = null;
|
|
1432
|
+
this.overlayElement = null;
|
|
1433
|
+
this.bodyElement = null;
|
|
1434
|
+
this.drawerHeight = 0;
|
|
1435
|
+
this.startTranslateYPx = 0;
|
|
1436
|
+
this.openRestTranslateYPx = 0;
|
|
1437
|
+
this.dragStartTime = 0;
|
|
1438
|
+
this.isClosing = false;
|
|
1439
|
+
this._syncRAF = null;
|
|
1440
|
+
this._contentAnimRAF = null;
|
|
1441
|
+
this._activeHeightTransitions = 0;
|
|
1442
|
+
this._initialMount = true;
|
|
1443
|
+
this._firstOpen = true;
|
|
1444
|
+
this._stylesReady = false;
|
|
1445
|
+
this._stylePromises = [];
|
|
1446
|
+
this._stylesAwaiting = null;
|
|
1447
|
+
this._childObserver = null;
|
|
1448
|
+
this._initialChildren = null;
|
|
1449
|
+
this.handleTransitionEnd = (e) => {
|
|
1450
|
+
if (!this.drawerElement)
|
|
1451
|
+
return;
|
|
1452
|
+
if (e.target !== this.drawerElement)
|
|
1453
|
+
return;
|
|
1454
|
+
if (e.propertyName !== "transform")
|
|
1455
|
+
return;
|
|
1456
|
+
const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
|
|
1457
|
+
this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
|
|
1458
|
+
};
|
|
1459
|
+
this.handlePointerDown = (e) => {
|
|
1460
|
+
if (this.loading || !this.open)
|
|
1461
|
+
return;
|
|
1462
|
+
if (e.pointerType === "mouse" && e.button !== 0)
|
|
1463
|
+
return;
|
|
1464
|
+
this.pendingDrag = true;
|
|
1465
|
+
this.startY = e.clientY;
|
|
1466
|
+
this.currentY = e.clientY;
|
|
1467
|
+
this.dragStartTime = Date.now();
|
|
1468
|
+
};
|
|
1469
|
+
this.handlePointerMove = (e) => {
|
|
1470
|
+
if (!this.pendingDrag && !this.isDragging)
|
|
1471
|
+
return;
|
|
1472
|
+
const y = e.clientY;
|
|
1473
|
+
if (this.pendingDrag) {
|
|
1474
|
+
const dy = y - this.startY;
|
|
1475
|
+
const absDy = Math.abs(dy);
|
|
1476
|
+
const ACTIVATE_PX = 8;
|
|
1477
|
+
const body = this.bodyElement;
|
|
1478
|
+
const atTop = !body || body.scrollTop <= 0;
|
|
1479
|
+
if (absDy >= ACTIVATE_PX && atTop) {
|
|
1480
|
+
this.pendingDrag = false;
|
|
1481
|
+
this.startDrag(this.startY);
|
|
1482
|
+
e.target?.setPointerCapture?.(e.pointerId);
|
|
1483
|
+
} else {
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
if (this.isDragging) {
|
|
1488
|
+
this.updateDrag(y);
|
|
1489
|
+
e.preventDefault();
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
this.handlePointerUp = (e) => {
|
|
1493
|
+
if (this.pendingDrag) {
|
|
1494
|
+
this.pendingDrag = false;
|
|
1495
|
+
}
|
|
1496
|
+
if (this.isDragging) {
|
|
1497
|
+
this.endDrag();
|
|
1498
|
+
e.preventDefault();
|
|
1499
|
+
}
|
|
1500
|
+
e.target?.releasePointerCapture?.(e.pointerId);
|
|
1501
|
+
};
|
|
1502
|
+
this.handlePointerCancel = (e) => {
|
|
1503
|
+
if (this.pendingDrag)
|
|
1504
|
+
this.pendingDrag = false;
|
|
1505
|
+
if (this.isDragging)
|
|
1506
|
+
this.endDrag();
|
|
1507
|
+
e.target?.releasePointerCapture?.(e.pointerId);
|
|
1508
|
+
};
|
|
1509
|
+
this.handleTouchStart = (e) => {
|
|
1510
|
+
if (this.loading || !this.open)
|
|
1511
|
+
return;
|
|
1512
|
+
const target = e.target;
|
|
1513
|
+
if (target && target.closest && target.closest(".close-btn")) {
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
const touch = e.touches[0];
|
|
1517
|
+
this.pendingDrag = true;
|
|
1518
|
+
this.startY = touch.clientY;
|
|
1519
|
+
this.currentY = touch.clientY;
|
|
1520
|
+
};
|
|
1521
|
+
this.handleTouchMove = (e) => {
|
|
1522
|
+
const touch = e.touches[0];
|
|
1523
|
+
if (this.pendingDrag && !this.isDragging) {
|
|
1524
|
+
const dy = touch.clientY - this.startY;
|
|
1525
|
+
const absDy = Math.abs(dy);
|
|
1526
|
+
const ACTIVATE_PX = 8;
|
|
1527
|
+
const body = this.bodyElement;
|
|
1528
|
+
const atTop = !body || body.scrollTop <= 0;
|
|
1529
|
+
if (absDy >= ACTIVATE_PX) {
|
|
1530
|
+
if (atTop) {
|
|
1531
|
+
this.startDrag(this.startY);
|
|
1532
|
+
this.isDragging = true;
|
|
1533
|
+
this.pendingDrag = false;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
if (!this.isDragging)
|
|
1538
|
+
return;
|
|
1539
|
+
this.updateDrag(touch.clientY);
|
|
1540
|
+
e.preventDefault();
|
|
1541
|
+
};
|
|
1542
|
+
this.handleTouchEnd = (e) => {
|
|
1543
|
+
this.pendingDrag = false;
|
|
1544
|
+
if (!this.isDragging)
|
|
1545
|
+
return;
|
|
1546
|
+
this.endDrag();
|
|
1547
|
+
e.preventDefault();
|
|
1548
|
+
};
|
|
1549
|
+
this.handleMouseDown = (e) => {
|
|
1550
|
+
if (this.loading || !this.open)
|
|
1551
|
+
return;
|
|
1552
|
+
this.startDrag(e.clientY);
|
|
1553
|
+
e.preventDefault();
|
|
1554
|
+
};
|
|
1555
|
+
this.handleMouseMove = (e) => {
|
|
1556
|
+
if (!this.isDragging)
|
|
1557
|
+
return;
|
|
1558
|
+
this.updateDrag(e.clientY);
|
|
1559
|
+
e.preventDefault();
|
|
1560
|
+
};
|
|
1561
|
+
this.handleMouseUp = (e) => {
|
|
1562
|
+
if (!this.isDragging)
|
|
1563
|
+
return;
|
|
1564
|
+
this.endDrag();
|
|
1565
|
+
e.preventDefault();
|
|
1566
|
+
};
|
|
1567
|
+
this.onClose = () => {
|
|
1568
|
+
if (this.loading)
|
|
1569
|
+
return;
|
|
1570
|
+
if (this.isClosing)
|
|
1571
|
+
return;
|
|
1572
|
+
if (this.drawerElement) {
|
|
1573
|
+
this.drawerElement.classList.remove("dragging");
|
|
1574
|
+
}
|
|
1575
|
+
this.open = false;
|
|
1576
|
+
dispatchLitCancel(this);
|
|
1577
|
+
this.isClosing = true;
|
|
1578
|
+
setTimeout(() => {
|
|
1579
|
+
this.isClosing = false;
|
|
1580
|
+
}, 300);
|
|
1581
|
+
};
|
|
1582
|
+
this.onHandleClick = () => {
|
|
1583
|
+
if (!this.open) {
|
|
1584
|
+
this.show();
|
|
1585
|
+
} else {
|
|
1586
|
+
this.hide("handle");
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
this.onOverlayClick = () => {
|
|
1590
|
+
if (!this.closeOnOverlayClick)
|
|
1591
|
+
return;
|
|
1592
|
+
this.onClose();
|
|
1593
|
+
};
|
|
1437
1594
|
this.open = false;
|
|
1438
1595
|
this.theme = "dark";
|
|
1439
1596
|
this.appearance = undefined;
|
|
@@ -1447,13 +1604,12 @@ var init_Drawer = __esm(() => {
|
|
|
1447
1604
|
getComponentPrefix() {
|
|
1448
1605
|
return "modal";
|
|
1449
1606
|
}
|
|
1450
|
-
_initialChildren = null;
|
|
1451
1607
|
connectedCallback() {
|
|
1452
1608
|
if (!this._initialChildren) {
|
|
1453
1609
|
this._initialChildren = Array.from(this.childNodes);
|
|
1454
1610
|
try {
|
|
1455
|
-
for (const
|
|
1456
|
-
this.removeChild(
|
|
1611
|
+
for (const n of this._initialChildren)
|
|
1612
|
+
this.removeChild(n);
|
|
1457
1613
|
} catch {}
|
|
1458
1614
|
}
|
|
1459
1615
|
super.connectedCallback();
|
|
@@ -1464,7 +1620,7 @@ var init_Drawer = __esm(() => {
|
|
|
1464
1620
|
if (this._stylesReady)
|
|
1465
1621
|
return true;
|
|
1466
1622
|
if (!this._stylesAwaiting) {
|
|
1467
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
1623
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
1468
1624
|
this._stylesAwaiting = settle.then(() => {
|
|
1469
1625
|
this._stylesReady = true;
|
|
1470
1626
|
this.requestUpdate();
|
|
@@ -1561,17 +1717,17 @@ var init_Drawer = __esm(() => {
|
|
|
1561
1717
|
return;
|
|
1562
1718
|
const host = this;
|
|
1563
1719
|
const toMove = [];
|
|
1564
|
-
host.childNodes.forEach((
|
|
1565
|
-
if (
|
|
1720
|
+
host.childNodes.forEach((n) => {
|
|
1721
|
+
if (n.nodeType !== Node.ELEMENT_NODE)
|
|
1566
1722
|
return;
|
|
1567
|
-
const el =
|
|
1723
|
+
const el = n;
|
|
1568
1724
|
if (el.classList?.contains("overlay"))
|
|
1569
1725
|
return;
|
|
1570
1726
|
if (el.classList?.contains("drawer"))
|
|
1571
1727
|
return;
|
|
1572
|
-
toMove.push(
|
|
1728
|
+
toMove.push(n);
|
|
1573
1729
|
});
|
|
1574
|
-
toMove.forEach((
|
|
1730
|
+
toMove.forEach((n) => above.appendChild(n));
|
|
1575
1731
|
this.syncCssVarsForOpenTranslate();
|
|
1576
1732
|
}
|
|
1577
1733
|
get contentRoot() {
|
|
@@ -1579,10 +1735,10 @@ var init_Drawer = __esm(() => {
|
|
|
1579
1735
|
return root && root.querySelector(".above-fold") || null;
|
|
1580
1736
|
}
|
|
1581
1737
|
getVisibleVh() {
|
|
1582
|
-
const
|
|
1583
|
-
const
|
|
1584
|
-
if (
|
|
1585
|
-
return clamp(parseFloat(
|
|
1738
|
+
const h = (this.height || "").trim();
|
|
1739
|
+
const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
|
|
1740
|
+
if (m)
|
|
1741
|
+
return clamp(parseFloat(m[1]), 0, 100);
|
|
1586
1742
|
return DEFAULT_VISIBLE_VH;
|
|
1587
1743
|
}
|
|
1588
1744
|
getOpenTranslateRatio() {
|
|
@@ -1595,15 +1751,15 @@ var init_Drawer = __esm(() => {
|
|
|
1595
1751
|
return;
|
|
1596
1752
|
if (this.isDragging || this.pendingDrag)
|
|
1597
1753
|
return;
|
|
1598
|
-
const
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1601
|
-
const
|
|
1602
|
-
const visibleVh = clamp(parseFloat(
|
|
1603
|
-
const
|
|
1604
|
-
this.setCssVars({ "--w3a-drawer__sheet-height": `100${
|
|
1754
|
+
const h = (this.height || "").trim();
|
|
1755
|
+
const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
|
|
1756
|
+
if (m) {
|
|
1757
|
+
const unit = (m[2] || "vh").toLowerCase();
|
|
1758
|
+
const visibleVh = clamp(parseFloat(m[1]), 0, 100);
|
|
1759
|
+
const pct = clamp(100 - visibleVh, 0, 100);
|
|
1760
|
+
this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit}` });
|
|
1605
1761
|
if (!this.open) {
|
|
1606
|
-
this.setCssVars({ "--w3a-drawer__open-translate":
|
|
1762
|
+
this.setCssVars({ "--w3a-drawer__open-translate": pct + "%" });
|
|
1607
1763
|
}
|
|
1608
1764
|
return;
|
|
1609
1765
|
}
|
|
@@ -1636,16 +1792,6 @@ var init_Drawer = __esm(() => {
|
|
|
1636
1792
|
this._performSyncCssVarsForOpenTranslate();
|
|
1637
1793
|
});
|
|
1638
1794
|
}
|
|
1639
|
-
handleTransitionEnd = (e6) => {
|
|
1640
|
-
if (!this.drawerElement)
|
|
1641
|
-
return;
|
|
1642
|
-
if (e6.target !== this.drawerElement)
|
|
1643
|
-
return;
|
|
1644
|
-
if (e6.propertyName !== "transform")
|
|
1645
|
-
return;
|
|
1646
|
-
const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
|
|
1647
|
-
this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
|
|
1648
|
-
};
|
|
1649
1795
|
setupAnimateWithContentSync() {
|
|
1650
1796
|
const root = this.renderRoot;
|
|
1651
1797
|
const host = root.querySelector(".drawer");
|
|
@@ -1670,12 +1816,12 @@ var init_Drawer = __esm(() => {
|
|
|
1670
1816
|
};
|
|
1671
1817
|
const syncTimingFromElement = (el) => {
|
|
1672
1818
|
const cs = getComputedStyle(el);
|
|
1673
|
-
const props = (cs.transitionProperty || "").split(",").map((
|
|
1674
|
-
const durations = (cs.transitionDuration || "").split(",").map((
|
|
1675
|
-
const easings = (cs.transitionTimingFunction || "").split(",").map((
|
|
1676
|
-
let idx = props.findIndex((
|
|
1819
|
+
const props = (cs.transitionProperty || "").split(",").map((s) => s.trim());
|
|
1820
|
+
const durations = (cs.transitionDuration || "").split(",").map((s) => s.trim());
|
|
1821
|
+
const easings = (cs.transitionTimingFunction || "").split(",").map((s) => s.trim());
|
|
1822
|
+
let idx = props.findIndex((p) => p === "height");
|
|
1677
1823
|
if (idx < 0)
|
|
1678
|
-
idx = props.findIndex((
|
|
1824
|
+
idx = props.findIndex((p) => p === "all");
|
|
1679
1825
|
if (idx < 0)
|
|
1680
1826
|
idx = 0;
|
|
1681
1827
|
const dur = durations[Math.min(idx, durations.length - 1)] || "100ms";
|
|
@@ -1686,28 +1832,28 @@ var init_Drawer = __esm(() => {
|
|
|
1686
1832
|
});
|
|
1687
1833
|
};
|
|
1688
1834
|
const onRun = (ev) => {
|
|
1689
|
-
const
|
|
1835
|
+
const e = ev;
|
|
1690
1836
|
if (!this.open)
|
|
1691
1837
|
return;
|
|
1692
|
-
if (
|
|
1838
|
+
if (e.propertyName !== "height")
|
|
1693
1839
|
return;
|
|
1694
1840
|
this._activeHeightTransitions++;
|
|
1695
1841
|
ensureLoop();
|
|
1696
1842
|
};
|
|
1697
1843
|
const onStart = (ev) => {
|
|
1698
|
-
const
|
|
1844
|
+
const e = ev;
|
|
1699
1845
|
if (!this.open)
|
|
1700
1846
|
return;
|
|
1701
|
-
if (
|
|
1847
|
+
if (e.propertyName !== "height")
|
|
1702
1848
|
return;
|
|
1703
|
-
if (
|
|
1704
|
-
syncTimingFromElement(
|
|
1849
|
+
if (e.target && e.target instanceof Element)
|
|
1850
|
+
syncTimingFromElement(e.target);
|
|
1705
1851
|
this._activeHeightTransitions++;
|
|
1706
1852
|
ensureLoop();
|
|
1707
1853
|
};
|
|
1708
1854
|
const onEnd = (ev) => {
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1855
|
+
const e = ev;
|
|
1856
|
+
if (e.propertyName !== "height")
|
|
1711
1857
|
return;
|
|
1712
1858
|
this._activeHeightTransitions = Math.max(0, this._activeHeightTransitions - 1);
|
|
1713
1859
|
if (this._activeHeightTransitions === 0)
|
|
@@ -1803,118 +1949,10 @@ var init_Drawer = __esm(() => {
|
|
|
1803
1949
|
document.removeEventListener("pointerup", this.handlePointerUp);
|
|
1804
1950
|
document.removeEventListener("pointercancel", this.handlePointerCancel);
|
|
1805
1951
|
}
|
|
1806
|
-
|
|
1807
|
-
if (this.loading || !this.open)
|
|
1808
|
-
return;
|
|
1809
|
-
if (e6.pointerType === "mouse" && e6.button !== 0)
|
|
1810
|
-
return;
|
|
1811
|
-
this.pendingDrag = true;
|
|
1812
|
-
this.startY = e6.clientY;
|
|
1813
|
-
this.currentY = e6.clientY;
|
|
1814
|
-
this.dragStartTime = Date.now();
|
|
1815
|
-
};
|
|
1816
|
-
handlePointerMove = (e6) => {
|
|
1817
|
-
if (!this.pendingDrag && !this.isDragging)
|
|
1818
|
-
return;
|
|
1819
|
-
const y3 = e6.clientY;
|
|
1820
|
-
if (this.pendingDrag) {
|
|
1821
|
-
const dy = y3 - this.startY;
|
|
1822
|
-
const absDy = Math.abs(dy);
|
|
1823
|
-
const ACTIVATE_PX = 8;
|
|
1824
|
-
const body = this.bodyElement;
|
|
1825
|
-
const atTop = !body || body.scrollTop <= 0;
|
|
1826
|
-
if (absDy >= ACTIVATE_PX && atTop) {
|
|
1827
|
-
this.pendingDrag = false;
|
|
1828
|
-
this.startDrag(this.startY);
|
|
1829
|
-
e6.target?.setPointerCapture?.(e6.pointerId);
|
|
1830
|
-
} else {
|
|
1831
|
-
return;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
if (this.isDragging) {
|
|
1835
|
-
this.updateDrag(y3);
|
|
1836
|
-
e6.preventDefault();
|
|
1837
|
-
}
|
|
1838
|
-
};
|
|
1839
|
-
handlePointerUp = (e6) => {
|
|
1840
|
-
if (this.pendingDrag) {
|
|
1841
|
-
this.pendingDrag = false;
|
|
1842
|
-
}
|
|
1843
|
-
if (this.isDragging) {
|
|
1844
|
-
this.endDrag();
|
|
1845
|
-
e6.preventDefault();
|
|
1846
|
-
}
|
|
1847
|
-
e6.target?.releasePointerCapture?.(e6.pointerId);
|
|
1848
|
-
};
|
|
1849
|
-
handlePointerCancel = (e6) => {
|
|
1850
|
-
if (this.pendingDrag)
|
|
1851
|
-
this.pendingDrag = false;
|
|
1852
|
-
if (this.isDragging)
|
|
1853
|
-
this.endDrag();
|
|
1854
|
-
e6.target?.releasePointerCapture?.(e6.pointerId);
|
|
1855
|
-
};
|
|
1856
|
-
handleTouchStart = (e6) => {
|
|
1857
|
-
if (this.loading || !this.open)
|
|
1858
|
-
return;
|
|
1859
|
-
const target = e6.target;
|
|
1860
|
-
if (target && target.closest && target.closest(".close-btn")) {
|
|
1861
|
-
return;
|
|
1862
|
-
}
|
|
1863
|
-
const touch = e6.touches[0];
|
|
1864
|
-
this.pendingDrag = true;
|
|
1865
|
-
this.startY = touch.clientY;
|
|
1866
|
-
this.currentY = touch.clientY;
|
|
1867
|
-
};
|
|
1868
|
-
handleTouchMove = (e6) => {
|
|
1869
|
-
const touch = e6.touches[0];
|
|
1870
|
-
if (this.pendingDrag && !this.isDragging) {
|
|
1871
|
-
const dy = touch.clientY - this.startY;
|
|
1872
|
-
const absDy = Math.abs(dy);
|
|
1873
|
-
const ACTIVATE_PX = 8;
|
|
1874
|
-
const body = this.bodyElement;
|
|
1875
|
-
const atTop = !body || body.scrollTop <= 0;
|
|
1876
|
-
if (absDy >= ACTIVATE_PX) {
|
|
1877
|
-
if (atTop) {
|
|
1878
|
-
this.startDrag(this.startY);
|
|
1879
|
-
this.isDragging = true;
|
|
1880
|
-
this.pendingDrag = false;
|
|
1881
|
-
} else {}
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
if (!this.isDragging)
|
|
1885
|
-
return;
|
|
1886
|
-
this.updateDrag(touch.clientY);
|
|
1887
|
-
e6.preventDefault();
|
|
1888
|
-
};
|
|
1889
|
-
handleTouchEnd = (e6) => {
|
|
1890
|
-
this.pendingDrag = false;
|
|
1891
|
-
if (!this.isDragging)
|
|
1892
|
-
return;
|
|
1893
|
-
this.endDrag();
|
|
1894
|
-
e6.preventDefault();
|
|
1895
|
-
};
|
|
1896
|
-
handleMouseDown = (e6) => {
|
|
1897
|
-
if (this.loading || !this.open)
|
|
1898
|
-
return;
|
|
1899
|
-
this.startDrag(e6.clientY);
|
|
1900
|
-
e6.preventDefault();
|
|
1901
|
-
};
|
|
1902
|
-
handleMouseMove = (e6) => {
|
|
1903
|
-
if (!this.isDragging)
|
|
1904
|
-
return;
|
|
1905
|
-
this.updateDrag(e6.clientY);
|
|
1906
|
-
e6.preventDefault();
|
|
1907
|
-
};
|
|
1908
|
-
handleMouseUp = (e6) => {
|
|
1909
|
-
if (!this.isDragging)
|
|
1910
|
-
return;
|
|
1911
|
-
this.endDrag();
|
|
1912
|
-
e6.preventDefault();
|
|
1913
|
-
};
|
|
1914
|
-
startDrag(y3) {
|
|
1952
|
+
startDrag(y) {
|
|
1915
1953
|
this.isDragging = true;
|
|
1916
|
-
this.startY =
|
|
1917
|
-
this.currentY =
|
|
1954
|
+
this.startY = y;
|
|
1955
|
+
this.currentY = y;
|
|
1918
1956
|
this.dragDistance = 0;
|
|
1919
1957
|
this.dragStartTime = Date.now();
|
|
1920
1958
|
this.lastDragTime = this.dragStartTime;
|
|
@@ -1935,17 +1973,17 @@ var init_Drawer = __esm(() => {
|
|
|
1935
1973
|
this.drawerElement.classList.add("dragging");
|
|
1936
1974
|
}
|
|
1937
1975
|
}
|
|
1938
|
-
updateDrag(
|
|
1976
|
+
updateDrag(y) {
|
|
1939
1977
|
if (!this.isDragging || !this.drawerElement)
|
|
1940
1978
|
return;
|
|
1941
1979
|
const now = Date.now();
|
|
1942
1980
|
const deltaTime = now - this.lastDragTime;
|
|
1943
|
-
const deltaY =
|
|
1981
|
+
const deltaY = y - this.currentY;
|
|
1944
1982
|
if (deltaTime > 0) {
|
|
1945
1983
|
this.velocity = deltaY / deltaTime;
|
|
1946
1984
|
}
|
|
1947
|
-
this.currentY =
|
|
1948
|
-
this.dragDistance =
|
|
1985
|
+
this.currentY = y;
|
|
1986
|
+
this.dragDistance = y - this.startY;
|
|
1949
1987
|
const viewportHalf = typeof window !== "undefined" && window.innerHeight ? window.innerHeight * OVERPULL_VIEWPORT_FACTOR : 0;
|
|
1950
1988
|
const maxOverdragUpPx = Math.max(this.drawerHeight * OVERPULL_SHEET_FACTOR, viewportHalf, this.overpullPx);
|
|
1951
1989
|
const rawTargetTranslateY = this.startTranslateYPx + this.dragDistance;
|
|
@@ -1999,11 +2037,11 @@ var init_Drawer = __esm(() => {
|
|
|
1999
2037
|
if (!transform || transform === "none")
|
|
2000
2038
|
return NaN;
|
|
2001
2039
|
if (transform.startsWith("matrix(")) {
|
|
2002
|
-
const values = transform.slice(7, -1).split(",").map((
|
|
2040
|
+
const values = transform.slice(7, -1).split(",").map((v) => parseFloat(v.trim()));
|
|
2003
2041
|
return values.length === 6 ? values[5] : NaN;
|
|
2004
2042
|
}
|
|
2005
2043
|
if (transform.startsWith("matrix3d(")) {
|
|
2006
|
-
const values = transform.slice(9, -1).split(",").map((
|
|
2044
|
+
const values = transform.slice(9, -1).split(",").map((v) => parseFloat(v.trim()));
|
|
2007
2045
|
return values.length === 16 ? values[13] : NaN;
|
|
2008
2046
|
}
|
|
2009
2047
|
const match = transform.match(/translateY\(([-\d.]+)px\)/);
|
|
@@ -2024,28 +2062,6 @@ var init_Drawer = __esm(() => {
|
|
|
2024
2062
|
this.isClosing = false;
|
|
2025
2063
|
}, 300);
|
|
2026
2064
|
}
|
|
2027
|
-
onClose = () => {
|
|
2028
|
-
if (this.loading)
|
|
2029
|
-
return;
|
|
2030
|
-
if (this.isClosing)
|
|
2031
|
-
return;
|
|
2032
|
-
if (this.drawerElement) {
|
|
2033
|
-
this.drawerElement.classList.remove("dragging");
|
|
2034
|
-
}
|
|
2035
|
-
this.open = false;
|
|
2036
|
-
dispatchLitCancel(this);
|
|
2037
|
-
this.isClosing = true;
|
|
2038
|
-
setTimeout(() => {
|
|
2039
|
-
this.isClosing = false;
|
|
2040
|
-
}, 300);
|
|
2041
|
-
};
|
|
2042
|
-
onHandleClick = () => {
|
|
2043
|
-
if (!this.open) {
|
|
2044
|
-
this.show();
|
|
2045
|
-
} else {
|
|
2046
|
-
this.hide("handle");
|
|
2047
|
-
}
|
|
2048
|
-
};
|
|
2049
2065
|
show() {
|
|
2050
2066
|
if (this.drawerElement) {
|
|
2051
2067
|
this.drawerElement.classList.remove("dragging");
|
|
@@ -2095,11 +2111,6 @@ var init_Drawer = __esm(() => {
|
|
|
2095
2111
|
</section>
|
|
2096
2112
|
`;
|
|
2097
2113
|
}
|
|
2098
|
-
onOverlayClick = () => {
|
|
2099
|
-
if (!this.closeOnOverlayClick)
|
|
2100
|
-
return;
|
|
2101
|
-
this.onClose();
|
|
2102
|
-
};
|
|
2103
2114
|
};
|
|
2104
2115
|
Drawer_default = function ensureDefined() {
|
|
2105
2116
|
const TAG = W3A_DRAWER_ID;
|
|
@@ -2111,44 +2122,44 @@ var init_Drawer = __esm(() => {
|
|
|
2111
2122
|
});
|
|
2112
2123
|
|
|
2113
2124
|
// ../shared-ts/src/near/actions.ts
|
|
2114
|
-
function fromActionArgsWasm(
|
|
2115
|
-
switch (
|
|
2125
|
+
function fromActionArgsWasm(a) {
|
|
2126
|
+
switch (a.action_type) {
|
|
2116
2127
|
case "FunctionCall" /* FunctionCall */: {
|
|
2117
2128
|
let parsedArgs = {};
|
|
2118
2129
|
try {
|
|
2119
|
-
parsedArgs = typeof
|
|
2130
|
+
parsedArgs = typeof a.args === "string" ? a.args ? JSON.parse(a.args) : {} : a.args || {};
|
|
2120
2131
|
} catch {
|
|
2121
2132
|
parsedArgs = {};
|
|
2122
2133
|
}
|
|
2123
2134
|
return {
|
|
2124
2135
|
type: "FunctionCall" /* FunctionCall */,
|
|
2125
|
-
methodName:
|
|
2136
|
+
methodName: a.method_name,
|
|
2126
2137
|
args: parsedArgs,
|
|
2127
|
-
gas:
|
|
2128
|
-
deposit:
|
|
2138
|
+
gas: a.gas,
|
|
2139
|
+
deposit: a.deposit
|
|
2129
2140
|
};
|
|
2130
2141
|
}
|
|
2131
2142
|
case "Transfer" /* Transfer */:
|
|
2132
|
-
return { type: "Transfer" /* Transfer */, amount:
|
|
2143
|
+
return { type: "Transfer" /* Transfer */, amount: a.deposit };
|
|
2133
2144
|
case "CreateAccount" /* CreateAccount */:
|
|
2134
2145
|
return { type: "CreateAccount" /* CreateAccount */ };
|
|
2135
2146
|
case "DeployContract" /* DeployContract */:
|
|
2136
2147
|
return {
|
|
2137
2148
|
type: "DeployContract" /* DeployContract */,
|
|
2138
|
-
code: Array.isArray(
|
|
2149
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array
|
|
2139
2150
|
};
|
|
2140
2151
|
case "DeployGlobalContract" /* DeployGlobalContract */:
|
|
2141
2152
|
return {
|
|
2142
2153
|
type: "DeployGlobalContract" /* DeployGlobalContract */,
|
|
2143
|
-
code: Array.isArray(
|
|
2144
|
-
deployMode:
|
|
2154
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array,
|
|
2155
|
+
deployMode: a.deploy_mode
|
|
2145
2156
|
};
|
|
2146
2157
|
case "Stake" /* Stake */:
|
|
2147
|
-
return { type: "Stake" /* Stake */, stake:
|
|
2158
|
+
return { type: "Stake" /* Stake */, stake: a.stake, publicKey: a.public_key };
|
|
2148
2159
|
case "AddKey" /* AddKey */: {
|
|
2149
2160
|
let accessKey;
|
|
2150
2161
|
try {
|
|
2151
|
-
accessKey = JSON.parse(
|
|
2162
|
+
accessKey = JSON.parse(a.access_key);
|
|
2152
2163
|
} catch {
|
|
2153
2164
|
accessKey = { nonce: BigInt(0), permission: "FullAccess" };
|
|
2154
2165
|
}
|
|
@@ -2170,7 +2181,7 @@ function fromActionArgsWasm(a3) {
|
|
|
2170
2181
|
}
|
|
2171
2182
|
return {
|
|
2172
2183
|
type: "AddKey" /* AddKey */,
|
|
2173
|
-
publicKey:
|
|
2184
|
+
publicKey: a.public_key,
|
|
2174
2185
|
accessKey: {
|
|
2175
2186
|
nonce: typeof accessKey?.nonce === "number" ? accessKey.nonce : 0,
|
|
2176
2187
|
permission: normalizedPermission
|
|
@@ -2178,13 +2189,13 @@ function fromActionArgsWasm(a3) {
|
|
|
2178
2189
|
};
|
|
2179
2190
|
}
|
|
2180
2191
|
case "DeleteKey" /* DeleteKey */:
|
|
2181
|
-
return { type: "DeleteKey" /* DeleteKey */, publicKey:
|
|
2192
|
+
return { type: "DeleteKey" /* DeleteKey */, publicKey: a.public_key };
|
|
2182
2193
|
case "DeleteAccount" /* DeleteAccount */:
|
|
2183
|
-
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId:
|
|
2194
|
+
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a.beneficiary_id };
|
|
2184
2195
|
case "UseGlobalContract" /* UseGlobalContract */:
|
|
2185
|
-
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId:
|
|
2196
|
+
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a.account_id, codeHash: a.code_hash };
|
|
2186
2197
|
default:
|
|
2187
|
-
throw new Error(`Unsupported wasm action_type: ${
|
|
2198
|
+
throw new Error(`Unsupported wasm action_type: ${a?.action_type}`);
|
|
2188
2199
|
}
|
|
2189
2200
|
}
|
|
2190
2201
|
function fromTransactionInputWasm(tx) {
|
|
@@ -2206,74 +2217,74 @@ var init_actions2 = __esm(() => {
|
|
|
2206
2217
|
});
|
|
2207
2218
|
|
|
2208
2219
|
// ../../node_modules/lit-html/directives/repeat.js
|
|
2209
|
-
var u4 = (
|
|
2210
|
-
const
|
|
2211
|
-
for (let
|
|
2212
|
-
|
|
2213
|
-
return
|
|
2220
|
+
var u4 = (e, s, t) => {
|
|
2221
|
+
const r = new Map;
|
|
2222
|
+
for (let l = s;l <= t; l++)
|
|
2223
|
+
r.set(e[l], l);
|
|
2224
|
+
return r;
|
|
2214
2225
|
}, c5;
|
|
2215
2226
|
var init_repeat = __esm(() => {
|
|
2216
2227
|
init_lit_html();
|
|
2217
2228
|
init_directive();
|
|
2218
2229
|
init_directive_helpers();
|
|
2219
2230
|
c5 = e4(class extends i5 {
|
|
2220
|
-
constructor(
|
|
2221
|
-
if (super(
|
|
2231
|
+
constructor(e) {
|
|
2232
|
+
if (super(e), e.type !== t4.CHILD)
|
|
2222
2233
|
throw Error("repeat() can only be used in text expressions");
|
|
2223
2234
|
}
|
|
2224
|
-
dt(
|
|
2225
|
-
let
|
|
2226
|
-
|
|
2227
|
-
const
|
|
2228
|
-
let
|
|
2229
|
-
for (const
|
|
2230
|
-
|
|
2231
|
-
return { values:
|
|
2232
|
-
}
|
|
2233
|
-
render(
|
|
2234
|
-
return this.dt(
|
|
2235
|
-
}
|
|
2236
|
-
update(
|
|
2237
|
-
const
|
|
2238
|
-
if (!Array.isArray(
|
|
2239
|
-
return this.ut =
|
|
2240
|
-
const
|
|
2241
|
-
let
|
|
2242
|
-
for (;
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2245
|
-
else if (
|
|
2246
|
-
|
|
2247
|
-
else if (
|
|
2248
|
-
|
|
2249
|
-
else if (
|
|
2250
|
-
|
|
2251
|
-
else if (
|
|
2252
|
-
|
|
2253
|
-
else if (
|
|
2254
|
-
|
|
2255
|
-
else if (
|
|
2256
|
-
if (
|
|
2257
|
-
const
|
|
2258
|
-
if (
|
|
2259
|
-
const
|
|
2260
|
-
v2(
|
|
2235
|
+
dt(e, s, t) {
|
|
2236
|
+
let r;
|
|
2237
|
+
t === undefined ? t = s : s !== undefined && (r = s);
|
|
2238
|
+
const l = [], o = [];
|
|
2239
|
+
let i = 0;
|
|
2240
|
+
for (const s of e)
|
|
2241
|
+
l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
2242
|
+
return { values: o, keys: l };
|
|
2243
|
+
}
|
|
2244
|
+
render(e, s, t) {
|
|
2245
|
+
return this.dt(e, s, t).values;
|
|
2246
|
+
}
|
|
2247
|
+
update(s, [t, r, c]) {
|
|
2248
|
+
const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
|
|
2249
|
+
if (!Array.isArray(d))
|
|
2250
|
+
return this.ut = a, p;
|
|
2251
|
+
const h = this.ut ??= [], v = [];
|
|
2252
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
|
|
2253
|
+
for (;x <= j && k <= w; )
|
|
2254
|
+
if (d[x] === null)
|
|
2255
|
+
x++;
|
|
2256
|
+
else if (d[j] === null)
|
|
2257
|
+
j--;
|
|
2258
|
+
else if (h[x] === a[k])
|
|
2259
|
+
v[k] = v2(d[x], p[k]), x++, k++;
|
|
2260
|
+
else if (h[j] === a[w])
|
|
2261
|
+
v[w] = v2(d[j], p[w]), j--, w--;
|
|
2262
|
+
else if (h[x] === a[w])
|
|
2263
|
+
v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
|
|
2264
|
+
else if (h[j] === a[k])
|
|
2265
|
+
v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
|
|
2266
|
+
else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
|
|
2267
|
+
if (m.has(h[j])) {
|
|
2268
|
+
const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
|
|
2269
|
+
if (t === null) {
|
|
2270
|
+
const e = s4(s, d[x]);
|
|
2271
|
+
v2(e, p[k]), v[k] = e;
|
|
2261
2272
|
} else
|
|
2262
|
-
|
|
2263
|
-
|
|
2273
|
+
v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
|
|
2274
|
+
k++;
|
|
2264
2275
|
} else
|
|
2265
|
-
M2(
|
|
2276
|
+
M2(d[j]), j--;
|
|
2266
2277
|
else
|
|
2267
|
-
M2(
|
|
2268
|
-
for (;
|
|
2269
|
-
const
|
|
2270
|
-
v2(
|
|
2278
|
+
M2(d[x]), x++;
|
|
2279
|
+
for (;k <= w; ) {
|
|
2280
|
+
const e = s4(s, v[w + 1]);
|
|
2281
|
+
v2(e, p[k]), v[k++] = e;
|
|
2271
2282
|
}
|
|
2272
|
-
for (;
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2283
|
+
for (;x <= j; ) {
|
|
2284
|
+
const e = d[x++];
|
|
2285
|
+
e !== null && M2(e);
|
|
2275
2286
|
}
|
|
2276
|
-
return this.ut =
|
|
2287
|
+
return this.ut = a, m2(s, v), T;
|
|
2277
2288
|
}
|
|
2278
2289
|
});
|
|
2279
2290
|
});
|
|
@@ -2697,8 +2708,8 @@ var fromScale = (prefix, scale) => {
|
|
|
2697
2708
|
if (!scale)
|
|
2698
2709
|
return {};
|
|
2699
2710
|
const out = {};
|
|
2700
|
-
for (const
|
|
2701
|
-
out[`${prefix}${
|
|
2711
|
+
for (const k of Object.keys(scale))
|
|
2712
|
+
out[`${prefix}${k}`] = scale[k];
|
|
2702
2713
|
return out;
|
|
2703
2714
|
};
|
|
2704
2715
|
var init_base_styles = () => {};
|
|
@@ -2953,7 +2964,7 @@ function formatArgs(args) {
|
|
|
2953
2964
|
if (typeof args === "string")
|
|
2954
2965
|
return args;
|
|
2955
2966
|
try {
|
|
2956
|
-
return JSON.stringify(args, (_k,
|
|
2967
|
+
return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
|
|
2957
2968
|
} catch {
|
|
2958
2969
|
return String(args);
|
|
2959
2970
|
}
|
|
@@ -3028,6 +3039,98 @@ var init_TxTree = __esm(() => {
|
|
|
3028
3039
|
init_registry();
|
|
3029
3040
|
HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
|
|
3030
3041
|
TxTree = class TxTree extends LitElementWithProps {
|
|
3042
|
+
constructor() {
|
|
3043
|
+
super(...arguments);
|
|
3044
|
+
this.showShadow = true;
|
|
3045
|
+
this._copied = new Set;
|
|
3046
|
+
this._copyTimers = new Map;
|
|
3047
|
+
this._fileContentModes = new Map;
|
|
3048
|
+
this._animating = new WeakSet;
|
|
3049
|
+
this.onFileContentToggleClick = (e, node) => {
|
|
3050
|
+
e.preventDefault();
|
|
3051
|
+
e.stopPropagation();
|
|
3052
|
+
if (!this.hasFileContentToggle(node))
|
|
3053
|
+
return;
|
|
3054
|
+
const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
|
|
3055
|
+
const currentMode = this.resolveFileContentMode(node);
|
|
3056
|
+
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
3057
|
+
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
3058
|
+
if (shell) {
|
|
3059
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
3060
|
+
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
3061
|
+
}
|
|
3062
|
+
this._fileContentModes.set(node.id, nextMode);
|
|
3063
|
+
this.requestUpdate();
|
|
3064
|
+
if (!shell)
|
|
3065
|
+
return;
|
|
3066
|
+
this.updateComplete.then(() => {
|
|
3067
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
3068
|
+
const toCssPx = shell.getBoundingClientRect().height;
|
|
3069
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
3070
|
+
const claimed = announceClampedSurfaceResize({
|
|
3071
|
+
reason: `${node.id}:file-content-mode`,
|
|
3072
|
+
element: shell,
|
|
3073
|
+
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
3074
|
+
fromCssPx,
|
|
3075
|
+
toCssPx,
|
|
3076
|
+
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
3077
|
+
});
|
|
3078
|
+
if (!claimed)
|
|
3079
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
3080
|
+
});
|
|
3081
|
+
};
|
|
3082
|
+
this.onSummaryClick = (e) => {
|
|
3083
|
+
const summary = e.currentTarget;
|
|
3084
|
+
if (!summary)
|
|
3085
|
+
return;
|
|
3086
|
+
const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
|
|
3087
|
+
let clickedReceiverLink = null;
|
|
3088
|
+
if (Array.isArray(path)) {
|
|
3089
|
+
for (const t of path) {
|
|
3090
|
+
if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
|
|
3091
|
+
clickedReceiverLink = t;
|
|
3092
|
+
break;
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
} else {
|
|
3096
|
+
const target = e.target;
|
|
3097
|
+
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
3098
|
+
}
|
|
3099
|
+
if (clickedReceiverLink) {
|
|
3100
|
+
e.preventDefault();
|
|
3101
|
+
e.stopPropagation();
|
|
3102
|
+
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
3103
|
+
try {
|
|
3104
|
+
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
3105
|
+
} catch {}
|
|
3106
|
+
return;
|
|
3107
|
+
}
|
|
3108
|
+
e.preventDefault();
|
|
3109
|
+
e.stopPropagation();
|
|
3110
|
+
const details = summary.closest("details");
|
|
3111
|
+
if (!details || this._animating.has(details))
|
|
3112
|
+
return;
|
|
3113
|
+
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
3114
|
+
if (!body) {
|
|
3115
|
+
details.open = !details.open;
|
|
3116
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
const reduceMotion = (() => {
|
|
3120
|
+
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
3121
|
+
})();
|
|
3122
|
+
if (reduceMotion) {
|
|
3123
|
+
details.open = !details.open;
|
|
3124
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
3125
|
+
return;
|
|
3126
|
+
}
|
|
3127
|
+
if (!details.open) {
|
|
3128
|
+
this.animateOpen(details, body);
|
|
3129
|
+
} else {
|
|
3130
|
+
this.animateClose(details, body);
|
|
3131
|
+
}
|
|
3132
|
+
};
|
|
3133
|
+
}
|
|
3031
3134
|
static properties = {
|
|
3032
3135
|
node: { attribute: false },
|
|
3033
3136
|
depth: { type: Number, attribute: false },
|
|
@@ -3041,26 +3144,11 @@ var init_TxTree = __esm(() => {
|
|
|
3041
3144
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
3042
3145
|
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
3043
3146
|
};
|
|
3044
|
-
node;
|
|
3045
|
-
depth;
|
|
3046
|
-
theme;
|
|
3047
|
-
appearance;
|
|
3048
|
-
class;
|
|
3049
|
-
width;
|
|
3050
|
-
shadowDom;
|
|
3051
|
-
nearExplorerUrl;
|
|
3052
|
-
tempoExplorerUrl;
|
|
3053
|
-
evmExplorerUrl;
|
|
3054
|
-
showShadow = true;
|
|
3055
|
-
_copied = new Set;
|
|
3056
|
-
_copyTimers = new Map;
|
|
3057
|
-
_fileContentModes = new Map;
|
|
3058
|
-
_animating = new WeakSet;
|
|
3059
3147
|
isCopied(id) {
|
|
3060
3148
|
return this._copied.has(id);
|
|
3061
3149
|
}
|
|
3062
|
-
async handleCopyClick(
|
|
3063
|
-
|
|
3150
|
+
async handleCopyClick(e, node) {
|
|
3151
|
+
e.stopPropagation();
|
|
3064
3152
|
const value = node.copyValue;
|
|
3065
3153
|
if (!value)
|
|
3066
3154
|
return;
|
|
@@ -3122,94 +3210,10 @@ var init_TxTree = __esm(() => {
|
|
|
3122
3210
|
const mode = this.resolveFileContentMode(node);
|
|
3123
3211
|
return mode === "raw" ? variants.raw : variants.decoded;
|
|
3124
3212
|
}
|
|
3125
|
-
onFileContentToggleClick = (e6, node) => {
|
|
3126
|
-
e6.preventDefault();
|
|
3127
|
-
e6.stopPropagation();
|
|
3128
|
-
if (!this.hasFileContentToggle(node))
|
|
3129
|
-
return;
|
|
3130
|
-
const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
|
|
3131
|
-
const currentMode = this.resolveFileContentMode(node);
|
|
3132
|
-
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
3133
|
-
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
3134
|
-
if (shell) {
|
|
3135
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
3136
|
-
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
3137
|
-
}
|
|
3138
|
-
this._fileContentModes.set(node.id, nextMode);
|
|
3139
|
-
this.requestUpdate();
|
|
3140
|
-
if (!shell)
|
|
3141
|
-
return;
|
|
3142
|
-
this.updateComplete.then(() => {
|
|
3143
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
3144
|
-
const toCssPx = shell.getBoundingClientRect().height;
|
|
3145
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
3146
|
-
const claimed = announceClampedSurfaceResize({
|
|
3147
|
-
reason: `${node.id}:file-content-mode`,
|
|
3148
|
-
element: shell,
|
|
3149
|
-
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
3150
|
-
fromCssPx,
|
|
3151
|
-
toCssPx,
|
|
3152
|
-
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
3153
|
-
});
|
|
3154
|
-
if (!claimed)
|
|
3155
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
3156
|
-
});
|
|
3157
|
-
};
|
|
3158
3213
|
handleToggle(detail) {
|
|
3159
3214
|
dispatchLitTreeToggled(this);
|
|
3160
3215
|
dispatchTxReviewToggleNode(this, detail);
|
|
3161
3216
|
}
|
|
3162
|
-
onSummaryClick = (e6) => {
|
|
3163
|
-
const summary = e6.currentTarget;
|
|
3164
|
-
if (!summary)
|
|
3165
|
-
return;
|
|
3166
|
-
const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
|
|
3167
|
-
let clickedReceiverLink = null;
|
|
3168
|
-
if (Array.isArray(path)) {
|
|
3169
|
-
for (const t5 of path) {
|
|
3170
|
-
if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
|
|
3171
|
-
clickedReceiverLink = t5;
|
|
3172
|
-
break;
|
|
3173
|
-
}
|
|
3174
|
-
}
|
|
3175
|
-
} else {
|
|
3176
|
-
const target = e6.target;
|
|
3177
|
-
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
3178
|
-
}
|
|
3179
|
-
if (clickedReceiverLink) {
|
|
3180
|
-
e6.preventDefault();
|
|
3181
|
-
e6.stopPropagation();
|
|
3182
|
-
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
3183
|
-
try {
|
|
3184
|
-
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
3185
|
-
} catch {}
|
|
3186
|
-
return;
|
|
3187
|
-
}
|
|
3188
|
-
e6.preventDefault();
|
|
3189
|
-
e6.stopPropagation();
|
|
3190
|
-
const details = summary.closest("details");
|
|
3191
|
-
if (!details || this._animating.has(details))
|
|
3192
|
-
return;
|
|
3193
|
-
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
3194
|
-
if (!body) {
|
|
3195
|
-
details.open = !details.open;
|
|
3196
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
3197
|
-
return;
|
|
3198
|
-
}
|
|
3199
|
-
const reduceMotion = (() => {
|
|
3200
|
-
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
3201
|
-
})();
|
|
3202
|
-
if (reduceMotion) {
|
|
3203
|
-
details.open = !details.open;
|
|
3204
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
3205
|
-
return;
|
|
3206
|
-
}
|
|
3207
|
-
if (!details.open) {
|
|
3208
|
-
this.animateOpen(details, body);
|
|
3209
|
-
} else {
|
|
3210
|
-
this.animateClose(details, body);
|
|
3211
|
-
}
|
|
3212
|
-
};
|
|
3213
3217
|
animateOpen(details, body) {
|
|
3214
3218
|
this._animating.add(details);
|
|
3215
3219
|
body.classList.add("anim-h", "anim-h-hold");
|
|
@@ -3305,9 +3309,9 @@ var init_TxTree = __esm(() => {
|
|
|
3305
3309
|
}
|
|
3306
3310
|
createRenderRoot() {
|
|
3307
3311
|
if (this.shadowDom) {
|
|
3308
|
-
const
|
|
3309
|
-
ensureExternalStyles(
|
|
3310
|
-
return
|
|
3312
|
+
const root = super.createRenderRoot();
|
|
3313
|
+
ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
3314
|
+
return root;
|
|
3311
3315
|
}
|
|
3312
3316
|
ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
3313
3317
|
const root = this.getRootNode ? this.getRootNode() : null;
|
|
@@ -3363,7 +3367,7 @@ var init_TxTree = __esm(() => {
|
|
|
3363
3367
|
}
|
|
3364
3368
|
resolveContractExplorerHref(treeNode, contractAddress) {
|
|
3365
3369
|
const chain = treeNode.chain;
|
|
3366
|
-
const
|
|
3370
|
+
const base = (() => {
|
|
3367
3371
|
if (chain === "tempo")
|
|
3368
3372
|
return this.normalizeExplorerBase(this.tempoExplorerUrl);
|
|
3369
3373
|
if (chain === "evm")
|
|
@@ -3372,9 +3376,9 @@ var init_TxTree = __esm(() => {
|
|
|
3372
3376
|
return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
|
|
3373
3377
|
return;
|
|
3374
3378
|
})();
|
|
3375
|
-
if (!
|
|
3379
|
+
if (!base)
|
|
3376
3380
|
return;
|
|
3377
|
-
return `${
|
|
3381
|
+
return `${base}/address/${encodeURIComponent(contractAddress)}`;
|
|
3378
3382
|
}
|
|
3379
3383
|
renderContractTransactionLabel(treeNode) {
|
|
3380
3384
|
const contractAddress = String(treeNode.contractAddress || "").trim();
|
|
@@ -3416,17 +3420,17 @@ var init_TxTree = __esm(() => {
|
|
|
3416
3420
|
}
|
|
3417
3421
|
renderLabelWithSelectiveHighlight(treeNode) {
|
|
3418
3422
|
if (treeNode.action) {
|
|
3419
|
-
const
|
|
3420
|
-
switch (
|
|
3423
|
+
const a = treeNode.action;
|
|
3424
|
+
switch (a.type) {
|
|
3421
3425
|
case "FunctionCall": {
|
|
3422
|
-
const method =
|
|
3423
|
-
const gasStr = formatGas(
|
|
3424
|
-
const depositStr = formatDeposit(
|
|
3426
|
+
const method = a.methodName;
|
|
3427
|
+
const gasStr = formatGas(a.gas);
|
|
3428
|
+
const depositStr = formatDeposit(a.deposit);
|
|
3425
3429
|
return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
|
|
3426
3430
|
${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
|
|
3427
3431
|
}
|
|
3428
3432
|
case "Transfer": {
|
|
3429
|
-
const amount = formatDeposit(
|
|
3433
|
+
const amount = formatDeposit(a.amount);
|
|
3430
3434
|
return x`Transfer <span class="highlight-amount">${amount}</span>`;
|
|
3431
3435
|
}
|
|
3432
3436
|
case "CreateAccount":
|
|
@@ -3434,26 +3438,26 @@ var init_TxTree = __esm(() => {
|
|
|
3434
3438
|
case "DeleteAccount":
|
|
3435
3439
|
return "Deleting Account";
|
|
3436
3440
|
case "Stake":
|
|
3437
|
-
return `Staking ${formatDeposit(
|
|
3441
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
3438
3442
|
case "AddKey":
|
|
3439
3443
|
return "Adding Key";
|
|
3440
3444
|
case "DeleteKey":
|
|
3441
3445
|
return "Deleting Key";
|
|
3442
3446
|
case "DeployContract": {
|
|
3443
|
-
const codeSize = formatCodeSize(
|
|
3447
|
+
const codeSize = formatCodeSize(a.code);
|
|
3444
3448
|
return `Deploying WASM contract (${codeSize})`;
|
|
3445
3449
|
}
|
|
3446
3450
|
case "DeployGlobalContract": {
|
|
3447
|
-
const codeSize = formatCodeSize(
|
|
3448
|
-
const mode =
|
|
3451
|
+
const codeSize = formatCodeSize(a.code);
|
|
3452
|
+
const mode = a.deployMode || "Unknown";
|
|
3449
3453
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
3450
3454
|
}
|
|
3451
3455
|
case "UseGlobalContract": {
|
|
3452
|
-
const accountId =
|
|
3453
|
-
const codeHash =
|
|
3456
|
+
const accountId = a.accountId;
|
|
3457
|
+
const codeHash = a.codeHash;
|
|
3454
3458
|
if (accountId) {
|
|
3455
|
-
const
|
|
3456
|
-
const href = `${
|
|
3459
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
3460
|
+
const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
|
|
3457
3461
|
return x`Use global contract
|
|
3458
3462
|
<a
|
|
3459
3463
|
class="highlight-receiver-id"
|
|
@@ -3472,7 +3476,7 @@ var init_TxTree = __esm(() => {
|
|
|
3472
3476
|
}
|
|
3473
3477
|
default: {
|
|
3474
3478
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
3475
|
-
const typeText =
|
|
3479
|
+
const typeText = a.type || "Unknown";
|
|
3476
3480
|
return `Action${idxText}: ${typeText}`;
|
|
3477
3481
|
}
|
|
3478
3482
|
}
|
|
@@ -3482,8 +3486,8 @@ var init_TxTree = __esm(() => {
|
|
|
3482
3486
|
const idx = treeNode.transactionIndex ?? 0;
|
|
3483
3487
|
const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
|
|
3484
3488
|
const receiverId = treeNode.transaction.receiverId;
|
|
3485
|
-
const
|
|
3486
|
-
const href = `${
|
|
3489
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
3490
|
+
const href = `${base}/address/${encodeURIComponent(receiverId)}`;
|
|
3487
3491
|
return x`${prefix}<a
|
|
3488
3492
|
class="highlight-receiver-id"
|
|
3489
3493
|
href=${href}
|
|
@@ -3502,22 +3506,22 @@ var init_TxTree = __esm(() => {
|
|
|
3502
3506
|
}
|
|
3503
3507
|
computePlainLabel(treeNode) {
|
|
3504
3508
|
if (treeNode.action) {
|
|
3505
|
-
const
|
|
3506
|
-
switch (
|
|
3509
|
+
const a = treeNode.action;
|
|
3510
|
+
switch (a.type) {
|
|
3507
3511
|
case "FunctionCall": {
|
|
3508
|
-
const method =
|
|
3509
|
-
const gasStr = formatGas(
|
|
3510
|
-
const depositStr = formatDeposit(
|
|
3512
|
+
const method = a.methodName;
|
|
3513
|
+
const gasStr = formatGas(a.gas);
|
|
3514
|
+
const depositStr = formatDeposit(a.deposit);
|
|
3511
3515
|
return `Calling ${method} with ${depositStr} using ${gasStr}`;
|
|
3512
3516
|
}
|
|
3513
3517
|
case "Transfer":
|
|
3514
|
-
return `Transfer ${formatDeposit(
|
|
3518
|
+
return `Transfer ${formatDeposit(a.amount)}`;
|
|
3515
3519
|
case "CreateAccount":
|
|
3516
3520
|
return "Creating Account";
|
|
3517
3521
|
case "DeleteAccount":
|
|
3518
3522
|
return "Deleting Account";
|
|
3519
3523
|
case "Stake":
|
|
3520
|
-
return `Staking ${formatDeposit(
|
|
3524
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
3521
3525
|
case "AddKey":
|
|
3522
3526
|
return "Adding Key";
|
|
3523
3527
|
case "DeleteKey":
|
|
@@ -3525,13 +3529,13 @@ var init_TxTree = __esm(() => {
|
|
|
3525
3529
|
case "DeployContract":
|
|
3526
3530
|
return "Deploying WASM contract";
|
|
3527
3531
|
case "DeployGlobalContract": {
|
|
3528
|
-
const codeSize = formatCodeSize(
|
|
3529
|
-
const mode =
|
|
3532
|
+
const codeSize = formatCodeSize(a.code);
|
|
3533
|
+
const mode = a.deployMode || "Unknown";
|
|
3530
3534
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
3531
3535
|
}
|
|
3532
3536
|
case "UseGlobalContract": {
|
|
3533
|
-
const accountId =
|
|
3534
|
-
const codeHash =
|
|
3537
|
+
const accountId = a.accountId;
|
|
3538
|
+
const codeHash = a.codeHash;
|
|
3535
3539
|
if (accountId) {
|
|
3536
3540
|
return `Use global contract by account ${String(accountId)}`;
|
|
3537
3541
|
}
|
|
@@ -3542,7 +3546,7 @@ var init_TxTree = __esm(() => {
|
|
|
3542
3546
|
}
|
|
3543
3547
|
default: {
|
|
3544
3548
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
3545
|
-
const typeText =
|
|
3549
|
+
const typeText = a.type || "Unknown";
|
|
3546
3550
|
return `Action${idxText}: ${typeText}`;
|
|
3547
3551
|
}
|
|
3548
3552
|
}
|
|
@@ -3585,7 +3589,7 @@ var init_TxTree = __esm(() => {
|
|
|
3585
3589
|
${node.copyValue ? x` <span
|
|
3586
3590
|
class="copy-badge"
|
|
3587
3591
|
data-copied=${this.isCopied(node.id)}
|
|
3588
|
-
@click=${(
|
|
3592
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
3589
3593
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
3590
3594
|
>
|
|
3591
3595
|
${this.isCopied(node.id) ? "copied" : "copy"}
|
|
@@ -3598,7 +3602,7 @@ var init_TxTree = __esm(() => {
|
|
|
3598
3602
|
class="file-content-mode-toggle"
|
|
3599
3603
|
title=${`Show ${toggleLabel}`}
|
|
3600
3604
|
aria-label=${`Show ${toggleLabel}`}
|
|
3601
|
-
@click=${(
|
|
3605
|
+
@click=${(e) => this.onFileContentToggleClick(e, node)}
|
|
3602
3606
|
>
|
|
3603
3607
|
${toggleLabel}
|
|
3604
3608
|
</button>` : ""}
|
|
@@ -3624,7 +3628,7 @@ var init_TxTree = __esm(() => {
|
|
|
3624
3628
|
<span
|
|
3625
3629
|
class="copy-badge"
|
|
3626
3630
|
data-copied=${this.isCopied(node.id)}
|
|
3627
|
-
@click=${(
|
|
3631
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
3628
3632
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
3629
3633
|
>${this.isCopied(node.id) ? "copied" : "copy"}</span
|
|
3630
3634
|
>
|
|
@@ -3657,7 +3661,7 @@ var init_TxTree = __esm(() => {
|
|
|
3657
3661
|
</summary>
|
|
3658
3662
|
${nodeChildren && nodeChildren.length > 0 ? x`
|
|
3659
3663
|
<div class="folder-children">
|
|
3660
|
-
${c5(nodeChildren, (
|
|
3664
|
+
${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
|
|
3661
3665
|
</div>
|
|
3662
3666
|
` : x``}
|
|
3663
3667
|
</details>
|
|
@@ -4156,49 +4160,49 @@ function hexToBytes(hex) {
|
|
|
4156
4160
|
throw new Error(`Invalid hex (odd length): ${hex}`);
|
|
4157
4161
|
}
|
|
4158
4162
|
const bytes = new Uint8Array(normalized.length / 2);
|
|
4159
|
-
for (let
|
|
4160
|
-
const byte = normalized.slice(
|
|
4163
|
+
for (let i = 0;i < bytes.length; i++) {
|
|
4164
|
+
const byte = normalized.slice(i * 2, i * 2 + 2);
|
|
4161
4165
|
const value = Number.parseInt(byte, 16);
|
|
4162
4166
|
if (!Number.isFinite(value))
|
|
4163
4167
|
throw new Error(`Invalid hex: ${hex}`);
|
|
4164
|
-
bytes[
|
|
4168
|
+
bytes[i] = value;
|
|
4165
4169
|
}
|
|
4166
4170
|
return bytes;
|
|
4167
4171
|
}
|
|
4168
4172
|
function bytesToHex(bytes) {
|
|
4169
|
-
return `0x${Array.from(bytes).map((
|
|
4173
|
+
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
4170
4174
|
}
|
|
4171
4175
|
|
|
4172
4176
|
// ../shared-ts/src/utils/keccak.ts
|
|
4173
4177
|
function rotateLeft64(value, shift) {
|
|
4174
|
-
const
|
|
4175
|
-
return (value <<
|
|
4178
|
+
const n = BigInt(shift);
|
|
4179
|
+
return (value << n | value >> 64n - n) & UINT64_MASK;
|
|
4176
4180
|
}
|
|
4177
4181
|
function keccakF1600(state) {
|
|
4178
|
-
const
|
|
4179
|
-
const
|
|
4182
|
+
const c = new Array(5);
|
|
4183
|
+
const d = new Array(5);
|
|
4180
4184
|
for (let round = 0;round < 24; round += 1) {
|
|
4181
|
-
for (let
|
|
4182
|
-
|
|
4185
|
+
for (let x = 0;x < 5; x += 1) {
|
|
4186
|
+
c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
|
|
4183
4187
|
}
|
|
4184
|
-
for (let
|
|
4185
|
-
|
|
4188
|
+
for (let x = 0;x < 5; x += 1) {
|
|
4189
|
+
d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
|
|
4186
4190
|
}
|
|
4187
|
-
for (let
|
|
4188
|
-
const rowOffset =
|
|
4189
|
-
for (let
|
|
4190
|
-
state[rowOffset +
|
|
4191
|
+
for (let y = 0;y < 5; y += 1) {
|
|
4192
|
+
const rowOffset = y * 5;
|
|
4193
|
+
for (let x = 0;x < 5; x += 1) {
|
|
4194
|
+
state[rowOffset + x] ^= d[x];
|
|
4191
4195
|
}
|
|
4192
4196
|
}
|
|
4193
4197
|
let lane = state[1];
|
|
4194
|
-
for (let
|
|
4195
|
-
const targetIndex = PI_LANE_INDEXES[
|
|
4198
|
+
for (let i = 0;i < 24; i += 1) {
|
|
4199
|
+
const targetIndex = PI_LANE_INDEXES[i];
|
|
4196
4200
|
const nextLane = state[targetIndex];
|
|
4197
|
-
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[
|
|
4201
|
+
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
|
|
4198
4202
|
lane = nextLane;
|
|
4199
4203
|
}
|
|
4200
|
-
for (let
|
|
4201
|
-
const rowOffset =
|
|
4204
|
+
for (let y = 0;y < 5; y += 1) {
|
|
4205
|
+
const rowOffset = y * 5;
|
|
4202
4206
|
const lane0 = state[rowOffset];
|
|
4203
4207
|
const lane1 = state[rowOffset + 1];
|
|
4204
4208
|
const lane2 = state[rowOffset + 2];
|
|
@@ -4221,8 +4225,8 @@ function absorbByte(state, offset, byte) {
|
|
|
4221
4225
|
function keccak256Bytes(input) {
|
|
4222
4226
|
const state = new Array(25).fill(0n);
|
|
4223
4227
|
let offset = 0;
|
|
4224
|
-
for (let
|
|
4225
|
-
absorbByte(state, offset, input[
|
|
4228
|
+
for (let i = 0;i < input.length; i += 1) {
|
|
4229
|
+
absorbByte(state, offset, input[i]);
|
|
4226
4230
|
offset += 1;
|
|
4227
4231
|
if (offset === KECCAK_RATE_BYTES) {
|
|
4228
4232
|
keccakF1600(state);
|
|
@@ -4233,10 +4237,10 @@ function keccak256Bytes(input) {
|
|
|
4233
4237
|
absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
|
|
4234
4238
|
keccakF1600(state);
|
|
4235
4239
|
const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
|
|
4236
|
-
for (let
|
|
4237
|
-
const lane = state[Math.floor(
|
|
4238
|
-
const laneShift = BigInt(
|
|
4239
|
-
out[
|
|
4240
|
+
for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
|
|
4241
|
+
const lane = state[Math.floor(i / 8)];
|
|
4242
|
+
const laneShift = BigInt(i % 8 * 8);
|
|
4243
|
+
out[i] = Number(lane >> laneShift & 0xffn);
|
|
4240
4244
|
}
|
|
4241
4245
|
return out;
|
|
4242
4246
|
}
|
|
@@ -4477,8 +4481,8 @@ function parseAbiTypeNode(args) {
|
|
|
4477
4481
|
dynamic: baseType === "bytes" || baseType === "string"
|
|
4478
4482
|
};
|
|
4479
4483
|
}
|
|
4480
|
-
for (let
|
|
4481
|
-
const length = arrayDimensions[
|
|
4484
|
+
for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
|
|
4485
|
+
const length = arrayDimensions[i];
|
|
4482
4486
|
node = {
|
|
4483
4487
|
kind: "array",
|
|
4484
4488
|
canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
|
|
@@ -4605,16 +4609,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
4605
4609
|
if (!decodedItems)
|
|
4606
4610
|
return null;
|
|
4607
4611
|
const out = {};
|
|
4608
|
-
for (let
|
|
4609
|
-
const component = typeNode.components[
|
|
4610
|
-
const baseName = String(component.name || "").trim() || `item${
|
|
4612
|
+
for (let i = 0;i < typeNode.components.length; i += 1) {
|
|
4613
|
+
const component = typeNode.components[i];
|
|
4614
|
+
const baseName = String(component.name || "").trim() || `item${i}`;
|
|
4611
4615
|
let name = baseName;
|
|
4612
4616
|
let counter = 1;
|
|
4613
4617
|
while (Object.prototype.hasOwnProperty.call(out, name)) {
|
|
4614
4618
|
counter += 1;
|
|
4615
4619
|
name = `${baseName}_${counter}`;
|
|
4616
4620
|
}
|
|
4617
|
-
out[name] = decodedItems[
|
|
4621
|
+
out[name] = decodedItems[i];
|
|
4618
4622
|
}
|
|
4619
4623
|
return out;
|
|
4620
4624
|
}
|
|
@@ -4628,8 +4632,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
4628
4632
|
const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
|
|
4629
4633
|
const items = [];
|
|
4630
4634
|
if (typeNode.item.dynamic) {
|
|
4631
|
-
for (let
|
|
4632
|
-
const itemRelativeOffset = readWordNumber(bytes, baseOffset +
|
|
4635
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
4636
|
+
const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
|
|
4633
4637
|
if (itemRelativeOffset == null)
|
|
4634
4638
|
return null;
|
|
4635
4639
|
const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
|
|
@@ -4640,8 +4644,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
4640
4644
|
return items;
|
|
4641
4645
|
}
|
|
4642
4646
|
const itemWords = staticWordLength(typeNode.item);
|
|
4643
|
-
for (let
|
|
4644
|
-
const itemOffset = baseOffset +
|
|
4647
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
4648
|
+
const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
|
|
4645
4649
|
const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
|
|
4646
4650
|
if (decoded == null)
|
|
4647
4651
|
return null;
|
|
@@ -4657,17 +4661,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
|
|
|
4657
4661
|
cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
|
|
4658
4662
|
}
|
|
4659
4663
|
const out = [];
|
|
4660
|
-
for (let
|
|
4661
|
-
const component = components[
|
|
4662
|
-
const headOffset = tupleOffset + headOffsets[
|
|
4664
|
+
for (let i = 0;i < components.length; i += 1) {
|
|
4665
|
+
const component = components[i];
|
|
4666
|
+
const headOffset = tupleOffset + headOffsets[i];
|
|
4663
4667
|
if (component.typeNode.dynamic) {
|
|
4664
4668
|
const relativeOffset = readWordNumber(bytes, headOffset);
|
|
4665
4669
|
if (relativeOffset == null)
|
|
4666
4670
|
return null;
|
|
4667
|
-
const
|
|
4668
|
-
if (
|
|
4671
|
+
const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
|
|
4672
|
+
if (decoded == null)
|
|
4669
4673
|
return null;
|
|
4670
|
-
out.push(
|
|
4674
|
+
out.push(decoded);
|
|
4671
4675
|
continue;
|
|
4672
4676
|
}
|
|
4673
4677
|
const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
|
|
@@ -4750,10 +4754,6 @@ var init_abiDecode = __esm(() => {
|
|
|
4750
4754
|
});
|
|
4751
4755
|
|
|
4752
4756
|
// src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
|
|
4753
|
-
var exports_enrichDisplayModelWithAbi = {};
|
|
4754
|
-
__export(exports_enrichDisplayModelWithAbi, {
|
|
4755
|
-
enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
|
|
4756
|
-
});
|
|
4757
4757
|
function isGenericContractCallOperation(operation) {
|
|
4758
4758
|
return operation.kind === "generic.contractCall";
|
|
4759
4759
|
}
|
|
@@ -4851,12 +4851,6 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4851
4851
|
init_registry();
|
|
4852
4852
|
init_registry();
|
|
4853
4853
|
TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
|
|
4854
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
4855
|
-
reason: "tx-body",
|
|
4856
|
-
element: () => this.querySelector(".txc-root"),
|
|
4857
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
4858
|
-
settled: () => this.updateComplete
|
|
4859
|
-
});
|
|
4860
4854
|
static requiredChildTags = [W3A_TX_TREE_ID];
|
|
4861
4855
|
static keepDefinitions = [TxTree_default];
|
|
4862
4856
|
static properties = {
|
|
@@ -4879,22 +4873,39 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4879
4873
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
4880
4874
|
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
4881
4875
|
};
|
|
4882
|
-
_treeNode = null;
|
|
4883
|
-
_ensureTreeDefinition = TxTree_default;
|
|
4884
|
-
_stylesReady = false;
|
|
4885
|
-
_stylePromises = [];
|
|
4886
|
-
_stylesAwaiting = null;
|
|
4887
4876
|
static _STYLE_MARKERS = [
|
|
4888
4877
|
"data-w3a-tx-tree-css",
|
|
4889
4878
|
"data-w3a-tx-confirmer-css",
|
|
4890
4879
|
"data-w3a-components-css"
|
|
4891
4880
|
];
|
|
4892
|
-
_treeBuildVersion = 0;
|
|
4893
|
-
_confirmArmed = false;
|
|
4894
|
-
_confirmArmRaf1 = null;
|
|
4895
|
-
_confirmArmRaf2 = null;
|
|
4896
4881
|
constructor() {
|
|
4897
4882
|
super();
|
|
4883
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
4884
|
+
reason: "tx-body",
|
|
4885
|
+
element: () => this.querySelector(".txc-root"),
|
|
4886
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
4887
|
+
settled: () => this.updateComplete
|
|
4888
|
+
});
|
|
4889
|
+
this._treeNode = null;
|
|
4890
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
4891
|
+
this._stylesReady = false;
|
|
4892
|
+
this._stylePromises = [];
|
|
4893
|
+
this._stylesAwaiting = null;
|
|
4894
|
+
this._treeBuildVersion = 0;
|
|
4895
|
+
this._confirmArmed = false;
|
|
4896
|
+
this._confirmArmRaf1 = null;
|
|
4897
|
+
this._confirmArmRaf2 = null;
|
|
4898
|
+
this._stopDragStart = (e) => {
|
|
4899
|
+
e.stopPropagation();
|
|
4900
|
+
};
|
|
4901
|
+
this.onConfirm = () => {
|
|
4902
|
+
if (this.loading || !this._confirmArmed)
|
|
4903
|
+
return;
|
|
4904
|
+
dispatchLitConfirm(this);
|
|
4905
|
+
};
|
|
4906
|
+
this.onCancel = () => {
|
|
4907
|
+
dispatchLitCancel(this);
|
|
4908
|
+
};
|
|
4898
4909
|
const root = document?.documentElement || null;
|
|
4899
4910
|
if (root) {
|
|
4900
4911
|
this._stylePromises.push(ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"));
|
|
@@ -4944,8 +4955,8 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4944
4955
|
return true;
|
|
4945
4956
|
}
|
|
4946
4957
|
if (!this._stylesAwaiting) {
|
|
4947
|
-
const
|
|
4948
|
-
this._stylesAwaiting =
|
|
4958
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
4959
|
+
this._stylesAwaiting = p.then(() => {
|
|
4949
4960
|
this._stylesReady = true;
|
|
4950
4961
|
this._rebuildTree();
|
|
4951
4962
|
});
|
|
@@ -4985,17 +4996,17 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4985
4996
|
}
|
|
4986
4997
|
}
|
|
4987
4998
|
_applyTooltipWidthVar() {
|
|
4988
|
-
const
|
|
4989
|
-
if (
|
|
4990
|
-
this.setCssVars({ "--tooltip-width":
|
|
4999
|
+
const w = this._normalizeWidth(this.tooltipWidth);
|
|
5000
|
+
if (w)
|
|
5001
|
+
this.setCssVars({ "--tooltip-width": w });
|
|
4991
5002
|
}
|
|
4992
5003
|
_normalizeWidth(val) {
|
|
4993
5004
|
if (val === undefined || val === null)
|
|
4994
5005
|
return;
|
|
4995
5006
|
if (typeof val === "number" && Number.isFinite(val))
|
|
4996
5007
|
return `${val}px`;
|
|
4997
|
-
const
|
|
4998
|
-
return
|
|
5008
|
+
const s = String(val).trim();
|
|
5009
|
+
return s.length ? s : undefined;
|
|
4999
5010
|
}
|
|
5000
5011
|
_operationHasAbiDecodeHint(operation) {
|
|
5001
5012
|
const hint = operation.abiDecodeHint;
|
|
@@ -5021,10 +5032,10 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
5021
5032
|
}
|
|
5022
5033
|
async _enrichTreeWithAbi(args) {
|
|
5023
5034
|
try {
|
|
5024
|
-
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(),
|
|
5035
|
+
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
|
|
5025
5036
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
5026
5037
|
return;
|
|
5027
|
-
const enrichedModel =
|
|
5038
|
+
const enrichedModel = enrichDisplayModelWithAbi(args.model);
|
|
5028
5039
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
5029
5040
|
return;
|
|
5030
5041
|
this._treeNode = buildDisplayTreeFromModel(enrichedModel);
|
|
@@ -5067,23 +5078,12 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
5067
5078
|
return;
|
|
5068
5079
|
}
|
|
5069
5080
|
this._treeNode = null;
|
|
5070
|
-
} catch (
|
|
5071
|
-
console.warn("[TxConfirmContent] failed to build TxTree",
|
|
5081
|
+
} catch (e) {
|
|
5082
|
+
console.warn("[TxConfirmContent] failed to build TxTree", e);
|
|
5072
5083
|
this._treeNode = null;
|
|
5073
5084
|
}
|
|
5074
5085
|
maybeRequestUpdate();
|
|
5075
5086
|
}
|
|
5076
|
-
_stopDragStart = (e6) => {
|
|
5077
|
-
e6.stopPropagation();
|
|
5078
|
-
};
|
|
5079
|
-
onConfirm = () => {
|
|
5080
|
-
if (this.loading || !this._confirmArmed)
|
|
5081
|
-
return;
|
|
5082
|
-
dispatchLitConfirm(this);
|
|
5083
|
-
};
|
|
5084
|
-
onCancel = () => {
|
|
5085
|
-
dispatchLitCancel(this);
|
|
5086
|
-
};
|
|
5087
5087
|
render() {
|
|
5088
5088
|
const treeTheme = this.theme === "dark" ? "dark" : "light";
|
|
5089
5089
|
const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
|
|
@@ -5207,6 +5207,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
5207
5207
|
init_css_loader();
|
|
5208
5208
|
init_registry();
|
|
5209
5209
|
PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
|
|
5210
|
+
constructor() {
|
|
5211
|
+
super(...arguments);
|
|
5212
|
+
this._stylesReady = false;
|
|
5213
|
+
this._stylePromises = [];
|
|
5214
|
+
this._stylesAwaiting = null;
|
|
5215
|
+
}
|
|
5210
5216
|
static properties = {
|
|
5211
5217
|
animated: { type: Boolean },
|
|
5212
5218
|
theme: { type: String },
|
|
@@ -5225,15 +5231,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
5225
5231
|
iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
|
|
5226
5232
|
iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
|
|
5227
5233
|
};
|
|
5228
|
-
_stylesReady = false;
|
|
5229
|
-
_stylePromises = [];
|
|
5230
|
-
_stylesAwaiting = null;
|
|
5231
5234
|
static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
|
|
5232
5235
|
createRenderRoot() {
|
|
5233
5236
|
const root = super.createRenderRoot();
|
|
5234
|
-
const
|
|
5235
|
-
this._stylePromises.push(
|
|
5236
|
-
|
|
5237
|
+
const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
|
|
5238
|
+
this._stylePromises.push(p);
|
|
5239
|
+
p.catch(() => {});
|
|
5237
5240
|
return root;
|
|
5238
5241
|
}
|
|
5239
5242
|
shouldUpdate(_changed) {
|
|
@@ -5244,7 +5247,7 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
5244
5247
|
return true;
|
|
5245
5248
|
}
|
|
5246
5249
|
if (!this._stylesAwaiting) {
|
|
5247
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
5250
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
5248
5251
|
this._stylesAwaiting = settle.then(() => {
|
|
5249
5252
|
this._stylesReady = true;
|
|
5250
5253
|
this.requestUpdate();
|
|
@@ -5506,50 +5509,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5506
5509
|
otpResendStatus: { type: String, attribute: false },
|
|
5507
5510
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
5508
5511
|
};
|
|
5509
|
-
otpCode = "";
|
|
5510
|
-
otpError = "";
|
|
5511
|
-
otpResendBusy = false;
|
|
5512
|
-
otpResendUntilMs = 0;
|
|
5513
|
-
otpResendStatus = "";
|
|
5514
|
-
otpSubmitAnimating = false;
|
|
5515
|
-
_otpResendTimer = null;
|
|
5516
|
-
_otpSubmitTimer = null;
|
|
5517
|
-
_lastAutoOtpSubmitCode = "";
|
|
5518
|
-
_ensureDrawerDefinition = Drawer_default;
|
|
5519
|
-
_drawerEl = null;
|
|
5520
|
-
_open = false;
|
|
5521
|
-
_ownsThemeAttr = false;
|
|
5522
|
-
_onWindowMessage = (ev) => {
|
|
5523
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
5524
|
-
if (!data || typeof data.type !== "string")
|
|
5525
|
-
return;
|
|
5526
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
5527
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
5528
|
-
this.loading = false;
|
|
5529
|
-
this.errorMessage = msg;
|
|
5530
|
-
this._drawerEl?.handleClose?.();
|
|
5531
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5532
|
-
bubbles: true,
|
|
5533
|
-
composed: true,
|
|
5534
|
-
detail: { confirmed: false }
|
|
5535
|
-
}));
|
|
5536
|
-
}
|
|
5537
|
-
};
|
|
5538
|
-
_onKeyDown = (e6) => {
|
|
5539
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
5540
|
-
if (this.loading)
|
|
5541
|
-
return;
|
|
5542
|
-
e6.preventDefault();
|
|
5543
|
-
this._drawerEl?.handleClose();
|
|
5544
|
-
if (!this._drawerEl) {
|
|
5545
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5546
|
-
bubbles: true,
|
|
5547
|
-
composed: true,
|
|
5548
|
-
detail: { confirmed: false }
|
|
5549
|
-
}));
|
|
5550
|
-
}
|
|
5551
|
-
}
|
|
5552
|
-
};
|
|
5553
5512
|
_chainLabelForModel() {
|
|
5554
5513
|
switch (this.model?.chain) {
|
|
5555
5514
|
case "tempo":
|
|
@@ -5642,24 +5601,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5642
5601
|
</div>
|
|
5643
5602
|
`;
|
|
5644
5603
|
}
|
|
5645
|
-
onPasskeyRegistrationConfirm = () => {
|
|
5646
|
-
this.finishContentConfirm();
|
|
5647
|
-
};
|
|
5648
|
-
_onOtpInput = (event) => {
|
|
5649
|
-
const input = event.currentTarget;
|
|
5650
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5651
|
-
this.otpCode = code;
|
|
5652
|
-
this.otpError = "";
|
|
5653
|
-
if (code.length < 6) {
|
|
5654
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5655
|
-
this._resetOtpSubmitAnimation();
|
|
5656
|
-
return;
|
|
5657
|
-
}
|
|
5658
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5659
|
-
return;
|
|
5660
|
-
this._lastAutoOtpSubmitCode = code;
|
|
5661
|
-
this._submitEmailOtpAfterFade(code);
|
|
5662
|
-
};
|
|
5663
5604
|
_clearOtpSubmitTimer() {
|
|
5664
5605
|
if (this._otpSubmitTimer != null)
|
|
5665
5606
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -5703,40 +5644,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5703
5644
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
5704
5645
|
return this.otpResendStatus || "Resend code";
|
|
5705
5646
|
}
|
|
5706
|
-
_onOtpResend = () => {
|
|
5707
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
5708
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5709
|
-
return;
|
|
5710
|
-
if (this.otpResendUntilMs > Date.now())
|
|
5711
|
-
return;
|
|
5712
|
-
this.otpError = "";
|
|
5713
|
-
this.otpResendStatus = "";
|
|
5714
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5715
|
-
this._resetOtpSubmitAnimation();
|
|
5716
|
-
this.otpResendBusy = true;
|
|
5717
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5718
|
-
this.requestUpdate();
|
|
5719
|
-
(async () => {
|
|
5720
|
-
try {
|
|
5721
|
-
const result = await resend();
|
|
5722
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
5723
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
5724
|
-
if (challengeId) {
|
|
5725
|
-
this.emailOtpPrompt = {
|
|
5726
|
-
...this.emailOtpPrompt,
|
|
5727
|
-
challengeId,
|
|
5728
|
-
...emailHint ? { emailHint } : {}
|
|
5729
|
-
};
|
|
5730
|
-
}
|
|
5731
|
-
this.otpResendStatus = "Code sent";
|
|
5732
|
-
} catch (error) {
|
|
5733
|
-
this.otpError = formatEmailOtpResendError(error);
|
|
5734
|
-
} finally {
|
|
5735
|
-
this.otpResendBusy = false;
|
|
5736
|
-
this.requestUpdate();
|
|
5737
|
-
}
|
|
5738
|
-
})();
|
|
5739
|
-
};
|
|
5740
5647
|
_renderEmailOtpPrompt() {
|
|
5741
5648
|
if (!this._isEmailOtpMode())
|
|
5742
5649
|
return "";
|
|
@@ -5783,11 +5690,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5783
5690
|
</div>
|
|
5784
5691
|
`;
|
|
5785
5692
|
}
|
|
5786
|
-
_onFundingNoticeCopy = (event) => {
|
|
5787
|
-
const target = event.currentTarget;
|
|
5788
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5789
|
-
copyTextToClipboard(accountId);
|
|
5790
|
-
};
|
|
5791
5693
|
_renderConfirmationBody() {
|
|
5792
5694
|
const body = String(this.body || "").trim();
|
|
5793
5695
|
if (!body)
|
|
@@ -5818,12 +5720,153 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5818
5720
|
}
|
|
5819
5721
|
constructor() {
|
|
5820
5722
|
super();
|
|
5821
|
-
this.
|
|
5822
|
-
this.
|
|
5823
|
-
this.
|
|
5824
|
-
this.
|
|
5825
|
-
this.
|
|
5826
|
-
this.
|
|
5723
|
+
this.otpCode = "";
|
|
5724
|
+
this.otpError = "";
|
|
5725
|
+
this.otpResendBusy = false;
|
|
5726
|
+
this.otpResendUntilMs = 0;
|
|
5727
|
+
this.otpResendStatus = "";
|
|
5728
|
+
this.otpSubmitAnimating = false;
|
|
5729
|
+
this._otpResendTimer = null;
|
|
5730
|
+
this._otpSubmitTimer = null;
|
|
5731
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5732
|
+
this._ensureDrawerDefinition = Drawer_default;
|
|
5733
|
+
this._drawerEl = null;
|
|
5734
|
+
this._open = false;
|
|
5735
|
+
this._ownsThemeAttr = false;
|
|
5736
|
+
this._onWindowMessage = (ev) => {
|
|
5737
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
5738
|
+
if (!data || typeof data.type !== "string")
|
|
5739
|
+
return;
|
|
5740
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
5741
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
5742
|
+
this.loading = false;
|
|
5743
|
+
this.errorMessage = msg;
|
|
5744
|
+
this._drawerEl?.handleClose?.();
|
|
5745
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5746
|
+
bubbles: true,
|
|
5747
|
+
composed: true,
|
|
5748
|
+
detail: { confirmed: false }
|
|
5749
|
+
}));
|
|
5750
|
+
}
|
|
5751
|
+
};
|
|
5752
|
+
this._onKeyDown = (e) => {
|
|
5753
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
5754
|
+
if (this.loading)
|
|
5755
|
+
return;
|
|
5756
|
+
e.preventDefault();
|
|
5757
|
+
this._drawerEl?.handleClose();
|
|
5758
|
+
if (!this._drawerEl) {
|
|
5759
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5760
|
+
bubbles: true,
|
|
5761
|
+
composed: true,
|
|
5762
|
+
detail: { confirmed: false }
|
|
5763
|
+
}));
|
|
5764
|
+
}
|
|
5765
|
+
}
|
|
5766
|
+
};
|
|
5767
|
+
this.onPasskeyRegistrationConfirm = () => {
|
|
5768
|
+
this.finishContentConfirm();
|
|
5769
|
+
};
|
|
5770
|
+
this._onOtpInput = (event) => {
|
|
5771
|
+
const input = event.currentTarget;
|
|
5772
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5773
|
+
this.otpCode = code;
|
|
5774
|
+
this.otpError = "";
|
|
5775
|
+
if (code.length < 6) {
|
|
5776
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5777
|
+
this._resetOtpSubmitAnimation();
|
|
5778
|
+
return;
|
|
5779
|
+
}
|
|
5780
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5781
|
+
return;
|
|
5782
|
+
this._lastAutoOtpSubmitCode = code;
|
|
5783
|
+
this._submitEmailOtpAfterFade(code);
|
|
5784
|
+
};
|
|
5785
|
+
this._onOtpResend = () => {
|
|
5786
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
5787
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5788
|
+
return;
|
|
5789
|
+
if (this.otpResendUntilMs > Date.now())
|
|
5790
|
+
return;
|
|
5791
|
+
this.otpError = "";
|
|
5792
|
+
this.otpResendStatus = "";
|
|
5793
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5794
|
+
this._resetOtpSubmitAnimation();
|
|
5795
|
+
this.otpResendBusy = true;
|
|
5796
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5797
|
+
this.requestUpdate();
|
|
5798
|
+
(async () => {
|
|
5799
|
+
try {
|
|
5800
|
+
const result = await resend();
|
|
5801
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
5802
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
5803
|
+
if (challengeId) {
|
|
5804
|
+
this.emailOtpPrompt = {
|
|
5805
|
+
...this.emailOtpPrompt,
|
|
5806
|
+
challengeId,
|
|
5807
|
+
...emailHint ? { emailHint } : {}
|
|
5808
|
+
};
|
|
5809
|
+
}
|
|
5810
|
+
this.otpResendStatus = "Code sent";
|
|
5811
|
+
} catch (error) {
|
|
5812
|
+
this.otpError = formatEmailOtpResendError(error);
|
|
5813
|
+
} finally {
|
|
5814
|
+
this.otpResendBusy = false;
|
|
5815
|
+
this.requestUpdate();
|
|
5816
|
+
}
|
|
5817
|
+
})();
|
|
5818
|
+
};
|
|
5819
|
+
this._onFundingNoticeCopy = (event) => {
|
|
5820
|
+
const target = event.currentTarget;
|
|
5821
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5822
|
+
copyTextToClipboard(accountId);
|
|
5823
|
+
};
|
|
5824
|
+
this.onDrawerCancel = () => {
|
|
5825
|
+
if (this.loading)
|
|
5826
|
+
return;
|
|
5827
|
+
this._open = false;
|
|
5828
|
+
this.requestUpdate();
|
|
5829
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5830
|
+
bubbles: true,
|
|
5831
|
+
composed: true,
|
|
5832
|
+
detail: { confirmed: false }
|
|
5833
|
+
}));
|
|
5834
|
+
};
|
|
5835
|
+
this.onContentConfirm = () => {
|
|
5836
|
+
if (this.loading || this.otpSubmitAnimating)
|
|
5837
|
+
return;
|
|
5838
|
+
if (this._isEmailOtpMode()) {
|
|
5839
|
+
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
5840
|
+
if (!/^\d{6}$/.test(code)) {
|
|
5841
|
+
this.otpCode = code;
|
|
5842
|
+
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
5843
|
+
this.requestUpdate();
|
|
5844
|
+
return;
|
|
5845
|
+
}
|
|
5846
|
+
this.otpCode = code;
|
|
5847
|
+
this.otpError = "";
|
|
5848
|
+
this._lastAutoOtpSubmitCode = code;
|
|
5849
|
+
this._submitEmailOtpAfterFade(code);
|
|
5850
|
+
return;
|
|
5851
|
+
}
|
|
5852
|
+
this.finishContentConfirm();
|
|
5853
|
+
};
|
|
5854
|
+
this.onContentCancel = () => {
|
|
5855
|
+
this._drawerEl?.handleClose();
|
|
5856
|
+
this._open = false;
|
|
5857
|
+
this.requestUpdate();
|
|
5858
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5859
|
+
bubbles: true,
|
|
5860
|
+
composed: true,
|
|
5861
|
+
detail: { confirmed: false }
|
|
5862
|
+
}));
|
|
5863
|
+
};
|
|
5864
|
+
this.nearAccountId = "";
|
|
5865
|
+
this.txSigningRequests = undefined;
|
|
5866
|
+
this.model = undefined;
|
|
5867
|
+
this.theme = "dark";
|
|
5868
|
+
this.appearance = undefined;
|
|
5869
|
+
this.loading = false;
|
|
5827
5870
|
this.body = "";
|
|
5828
5871
|
this.title = "";
|
|
5829
5872
|
this.confirmText = "Next";
|
|
@@ -5878,7 +5921,7 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5878
5921
|
ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
|
|
5879
5922
|
ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
|
|
5880
5923
|
]);
|
|
5881
|
-
await new Promise((
|
|
5924
|
+
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
|
|
5882
5925
|
this._open = true;
|
|
5883
5926
|
this.requestUpdate();
|
|
5884
5927
|
}
|
|
@@ -5907,36 +5950,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5907
5950
|
}
|
|
5908
5951
|
}
|
|
5909
5952
|
}
|
|
5910
|
-
onDrawerCancel = () => {
|
|
5911
|
-
if (this.loading)
|
|
5912
|
-
return;
|
|
5913
|
-
this._open = false;
|
|
5914
|
-
this.requestUpdate();
|
|
5915
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5916
|
-
bubbles: true,
|
|
5917
|
-
composed: true,
|
|
5918
|
-
detail: { confirmed: false }
|
|
5919
|
-
}));
|
|
5920
|
-
};
|
|
5921
|
-
onContentConfirm = () => {
|
|
5922
|
-
if (this.loading || this.otpSubmitAnimating)
|
|
5923
|
-
return;
|
|
5924
|
-
if (this._isEmailOtpMode()) {
|
|
5925
|
-
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
5926
|
-
if (!/^\d{6}$/.test(code)) {
|
|
5927
|
-
this.otpCode = code;
|
|
5928
|
-
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
5929
|
-
this.requestUpdate();
|
|
5930
|
-
return;
|
|
5931
|
-
}
|
|
5932
|
-
this.otpCode = code;
|
|
5933
|
-
this.otpError = "";
|
|
5934
|
-
this._lastAutoOtpSubmitCode = code;
|
|
5935
|
-
this._submitEmailOtpAfterFade(code);
|
|
5936
|
-
return;
|
|
5937
|
-
}
|
|
5938
|
-
this.finishContentConfirm();
|
|
5939
|
-
};
|
|
5940
5953
|
finishContentConfirm(opts) {
|
|
5941
5954
|
if (this.loading)
|
|
5942
5955
|
return;
|
|
@@ -5956,16 +5969,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5956
5969
|
}
|
|
5957
5970
|
}));
|
|
5958
5971
|
}
|
|
5959
|
-
onContentCancel = () => {
|
|
5960
|
-
this._drawerEl?.handleClose();
|
|
5961
|
-
this._open = false;
|
|
5962
|
-
this.requestUpdate();
|
|
5963
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5964
|
-
bubbles: true,
|
|
5965
|
-
composed: true,
|
|
5966
|
-
detail: { confirmed: false }
|
|
5967
|
-
}));
|
|
5968
|
-
};
|
|
5969
5972
|
close(_confirmed) {
|
|
5970
5973
|
if (!this._open)
|
|
5971
5974
|
return;
|
|
@@ -6166,12 +6169,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6166
6169
|
init_nearFundingNotice();
|
|
6167
6170
|
init_registry();
|
|
6168
6171
|
ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
|
|
6169
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
6170
|
-
reason: "confirm-body",
|
|
6171
|
-
element: () => this.querySelector(".modal-container-root"),
|
|
6172
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
6173
|
-
settled: () => this.updateComplete
|
|
6174
|
-
});
|
|
6175
6172
|
static requiredChildTags = ["w3a-tx-confirm-content"];
|
|
6176
6173
|
static strictChildDefinitions = true;
|
|
6177
6174
|
static keepDefinitions = [tx_confirm_content_default];
|
|
@@ -6204,57 +6201,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6204
6201
|
otpResendStatus: { type: String, attribute: false },
|
|
6205
6202
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
6206
6203
|
};
|
|
6207
|
-
totalAmount = "";
|
|
6208
|
-
method = "";
|
|
6209
|
-
fingerprint = "";
|
|
6210
|
-
body = "";
|
|
6211
|
-
title = "";
|
|
6212
|
-
cancelText = "Cancel";
|
|
6213
|
-
confirmText = "Next";
|
|
6214
|
-
model;
|
|
6215
|
-
securityContext;
|
|
6216
|
-
loading = false;
|
|
6217
|
-
errorMessage = undefined;
|
|
6218
|
-
theme = "dark";
|
|
6219
|
-
appearance;
|
|
6220
|
-
nearExplorerUrl;
|
|
6221
|
-
tempoExplorerUrl;
|
|
6222
|
-
evmExplorerUrl;
|
|
6223
|
-
signingAuthMode;
|
|
6224
|
-
emailOtpPrompt;
|
|
6225
|
-
otpCode = "";
|
|
6226
|
-
otpError = "";
|
|
6227
|
-
otpResendBusy = false;
|
|
6228
|
-
otpResendUntilMs = 0;
|
|
6229
|
-
otpResendStatus = "";
|
|
6230
|
-
otpSubmitAnimating = false;
|
|
6231
|
-
_otpResendTimer = null;
|
|
6232
|
-
_otpSubmitTimer = null;
|
|
6233
|
-
_lastAutoOtpSubmitCode = "";
|
|
6234
|
-
intentDigest;
|
|
6235
|
-
deferClose = false;
|
|
6236
|
-
_stylesReady = false;
|
|
6237
|
-
_stylePromises = [];
|
|
6238
|
-
_stylesAwaiting = null;
|
|
6239
|
-
_ensureTreeDefinition = TxTree_default;
|
|
6240
|
-
_ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
6241
|
-
_onKeyDown = (e6) => {
|
|
6242
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
6243
|
-
e6.preventDefault();
|
|
6244
|
-
this._handleCancel();
|
|
6245
|
-
}
|
|
6246
|
-
};
|
|
6247
|
-
_onWindowMessage = (ev) => {
|
|
6248
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
6249
|
-
if (!data || typeof data.type !== "string")
|
|
6250
|
-
return;
|
|
6251
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
6252
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
6253
|
-
this.loading = false;
|
|
6254
|
-
this.errorMessage = msg;
|
|
6255
|
-
this._handleCancel();
|
|
6256
|
-
}
|
|
6257
|
-
};
|
|
6258
6204
|
_chainLabelForModel() {
|
|
6259
6205
|
switch (this.model?.chain) {
|
|
6260
6206
|
case "tempo":
|
|
@@ -6292,12 +6238,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6292
6238
|
_isStandaloneSurface() {
|
|
6293
6239
|
return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
|
|
6294
6240
|
}
|
|
6295
|
-
_handleBackdropClick = (event) => {
|
|
6296
|
-
if (!this._isStandaloneSurface())
|
|
6297
|
-
return;
|
|
6298
|
-
event.stopPropagation();
|
|
6299
|
-
this._handleCancel();
|
|
6300
|
-
};
|
|
6301
6241
|
_authHeadingFallback() {
|
|
6302
6242
|
if (this._passkeyRegistrationDisplay())
|
|
6303
6243
|
return "Create your passkey";
|
|
@@ -6363,9 +6303,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6363
6303
|
</div>
|
|
6364
6304
|
`;
|
|
6365
6305
|
}
|
|
6366
|
-
_onPasskeyRegistrationConfirm = () => {
|
|
6367
|
-
this._finishConfirm();
|
|
6368
|
-
};
|
|
6369
6306
|
_renderPasskeyRegistrationModal(display) {
|
|
6370
6307
|
return x`
|
|
6371
6308
|
${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
|
|
@@ -6400,21 +6337,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6400
6337
|
</div>
|
|
6401
6338
|
`;
|
|
6402
6339
|
}
|
|
6403
|
-
_onOtpInput = (event) => {
|
|
6404
|
-
const input = event.currentTarget;
|
|
6405
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
6406
|
-
this.otpCode = code;
|
|
6407
|
-
this.otpError = "";
|
|
6408
|
-
if (code.length < 6) {
|
|
6409
|
-
this._lastAutoOtpSubmitCode = "";
|
|
6410
|
-
this._resetOtpSubmitAnimation();
|
|
6411
|
-
return;
|
|
6412
|
-
}
|
|
6413
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
6414
|
-
return;
|
|
6415
|
-
this._lastAutoOtpSubmitCode = code;
|
|
6416
|
-
this._submitEmailOtpAfterFade(code);
|
|
6417
|
-
};
|
|
6418
6340
|
_clearOtpSubmitTimer() {
|
|
6419
6341
|
if (this._otpSubmitTimer != null)
|
|
6420
6342
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -6458,40 +6380,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6458
6380
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
6459
6381
|
return this.otpResendStatus || "Resend code";
|
|
6460
6382
|
}
|
|
6461
|
-
_onOtpResend = () => {
|
|
6462
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
6463
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
6464
|
-
return;
|
|
6465
|
-
if (this.otpResendUntilMs > Date.now())
|
|
6466
|
-
return;
|
|
6467
|
-
this.otpError = "";
|
|
6468
|
-
this.otpResendStatus = "";
|
|
6469
|
-
this._lastAutoOtpSubmitCode = "";
|
|
6470
|
-
this._resetOtpSubmitAnimation();
|
|
6471
|
-
this.otpResendBusy = true;
|
|
6472
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
6473
|
-
this.requestUpdate();
|
|
6474
|
-
(async () => {
|
|
6475
|
-
try {
|
|
6476
|
-
const result = await resend();
|
|
6477
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
6478
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
6479
|
-
if (challengeId) {
|
|
6480
|
-
this.emailOtpPrompt = {
|
|
6481
|
-
...this.emailOtpPrompt,
|
|
6482
|
-
challengeId,
|
|
6483
|
-
...emailHint ? { emailHint } : {}
|
|
6484
|
-
};
|
|
6485
|
-
}
|
|
6486
|
-
this.otpResendStatus = "Code sent";
|
|
6487
|
-
} catch (error) {
|
|
6488
|
-
this.otpError = formatEmailOtpResendError2(error);
|
|
6489
|
-
} finally {
|
|
6490
|
-
this.otpResendBusy = false;
|
|
6491
|
-
this.requestUpdate();
|
|
6492
|
-
}
|
|
6493
|
-
})();
|
|
6494
|
-
};
|
|
6495
6383
|
_renderEmailOtpPrompt() {
|
|
6496
6384
|
if (!this._isEmailOtpMode())
|
|
6497
6385
|
return "";
|
|
@@ -6536,11 +6424,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
6536
6424
|
</div>
|
|
6537
6425
|
`;
|
|
6538
6426
|
}
|
|
6539
|
-
_onFundingNoticeCopy = (event) => {
|
|
6540
|
-
const target = event.currentTarget;
|
|
6541
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
6542
|
-
copyTextToClipboard(accountId);
|
|
6543
|
-
};
|
|
6544
6427
|
_renderConfirmationBody() {
|
|
6545
6428
|
const body = String(this.body || "").trim();
|
|
6546
6429
|
if (!body)
|
|
@@ -6571,12 +6454,123 @@ var init_viewer_modal = __esm(() => {
|
|
|
6571
6454
|
}
|
|
6572
6455
|
constructor() {
|
|
6573
6456
|
super();
|
|
6457
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
6458
|
+
reason: "confirm-body",
|
|
6459
|
+
element: () => this.querySelector(".modal-container-root"),
|
|
6460
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
6461
|
+
settled: () => this.updateComplete
|
|
6462
|
+
});
|
|
6463
|
+
this.totalAmount = "";
|
|
6464
|
+
this.method = "";
|
|
6465
|
+
this.fingerprint = "";
|
|
6466
|
+
this.body = "";
|
|
6467
|
+
this.title = "";
|
|
6468
|
+
this.cancelText = "Cancel";
|
|
6469
|
+
this.confirmText = "Next";
|
|
6470
|
+
this.loading = false;
|
|
6471
|
+
this.errorMessage = undefined;
|
|
6472
|
+
this.theme = "dark";
|
|
6473
|
+
this.otpCode = "";
|
|
6474
|
+
this.otpError = "";
|
|
6475
|
+
this.otpResendBusy = false;
|
|
6476
|
+
this.otpResendUntilMs = 0;
|
|
6477
|
+
this.otpResendStatus = "";
|
|
6478
|
+
this.otpSubmitAnimating = false;
|
|
6479
|
+
this._otpResendTimer = null;
|
|
6480
|
+
this._otpSubmitTimer = null;
|
|
6481
|
+
this._lastAutoOtpSubmitCode = "";
|
|
6482
|
+
this.deferClose = false;
|
|
6483
|
+
this._stylesReady = false;
|
|
6484
|
+
this._stylePromises = [];
|
|
6485
|
+
this._stylesAwaiting = null;
|
|
6486
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
6487
|
+
this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
6488
|
+
this._onKeyDown = (e) => {
|
|
6489
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
6490
|
+
e.preventDefault();
|
|
6491
|
+
this._handleCancel();
|
|
6492
|
+
}
|
|
6493
|
+
};
|
|
6494
|
+
this._onWindowMessage = (ev) => {
|
|
6495
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
6496
|
+
if (!data || typeof data.type !== "string")
|
|
6497
|
+
return;
|
|
6498
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
6499
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
6500
|
+
this.loading = false;
|
|
6501
|
+
this.errorMessage = msg;
|
|
6502
|
+
this._handleCancel();
|
|
6503
|
+
}
|
|
6504
|
+
};
|
|
6505
|
+
this._handleBackdropClick = (event) => {
|
|
6506
|
+
if (!this._isStandaloneSurface())
|
|
6507
|
+
return;
|
|
6508
|
+
event.stopPropagation();
|
|
6509
|
+
this._handleCancel();
|
|
6510
|
+
};
|
|
6511
|
+
this._onPasskeyRegistrationConfirm = () => {
|
|
6512
|
+
this._finishConfirm();
|
|
6513
|
+
};
|
|
6514
|
+
this._onOtpInput = (event) => {
|
|
6515
|
+
const input = event.currentTarget;
|
|
6516
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
6517
|
+
this.otpCode = code;
|
|
6518
|
+
this.otpError = "";
|
|
6519
|
+
if (code.length < 6) {
|
|
6520
|
+
this._lastAutoOtpSubmitCode = "";
|
|
6521
|
+
this._resetOtpSubmitAnimation();
|
|
6522
|
+
return;
|
|
6523
|
+
}
|
|
6524
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
6525
|
+
return;
|
|
6526
|
+
this._lastAutoOtpSubmitCode = code;
|
|
6527
|
+
this._submitEmailOtpAfterFade(code);
|
|
6528
|
+
};
|
|
6529
|
+
this._onOtpResend = () => {
|
|
6530
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
6531
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
6532
|
+
return;
|
|
6533
|
+
if (this.otpResendUntilMs > Date.now())
|
|
6534
|
+
return;
|
|
6535
|
+
this.otpError = "";
|
|
6536
|
+
this.otpResendStatus = "";
|
|
6537
|
+
this._lastAutoOtpSubmitCode = "";
|
|
6538
|
+
this._resetOtpSubmitAnimation();
|
|
6539
|
+
this.otpResendBusy = true;
|
|
6540
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
6541
|
+
this.requestUpdate();
|
|
6542
|
+
(async () => {
|
|
6543
|
+
try {
|
|
6544
|
+
const result = await resend();
|
|
6545
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
6546
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
6547
|
+
if (challengeId) {
|
|
6548
|
+
this.emailOtpPrompt = {
|
|
6549
|
+
...this.emailOtpPrompt,
|
|
6550
|
+
challengeId,
|
|
6551
|
+
...emailHint ? { emailHint } : {}
|
|
6552
|
+
};
|
|
6553
|
+
}
|
|
6554
|
+
this.otpResendStatus = "Code sent";
|
|
6555
|
+
} catch (error) {
|
|
6556
|
+
this.otpError = formatEmailOtpResendError2(error);
|
|
6557
|
+
} finally {
|
|
6558
|
+
this.otpResendBusy = false;
|
|
6559
|
+
this.requestUpdate();
|
|
6560
|
+
}
|
|
6561
|
+
})();
|
|
6562
|
+
};
|
|
6563
|
+
this._onFundingNoticeCopy = (event) => {
|
|
6564
|
+
const target = event.currentTarget;
|
|
6565
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
6566
|
+
copyTextToClipboard(accountId);
|
|
6567
|
+
};
|
|
6568
|
+
this._ownsThemeAttr = false;
|
|
6574
6569
|
const root = document?.documentElement || null;
|
|
6575
6570
|
if (root) {
|
|
6576
6571
|
this._stylePromises.push(ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"), ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "halo-border.css", "data-w3a-halo-border-css"), ensureExternalStyles(root, "passkey-halo-loading.css", "data-w3a-passkey-halo-loading-css"));
|
|
6577
6572
|
}
|
|
6578
6573
|
}
|
|
6579
|
-
_ownsThemeAttr = false;
|
|
6580
6574
|
willUpdate(changedProperties) {
|
|
6581
6575
|
super.willUpdate(changedProperties);
|
|
6582
6576
|
if (this.hasUpdated)
|
|
@@ -6648,8 +6642,8 @@ var init_viewer_modal = __esm(() => {
|
|
|
6648
6642
|
if (this._stylesReady)
|
|
6649
6643
|
return true;
|
|
6650
6644
|
if (!this._stylesAwaiting) {
|
|
6651
|
-
const
|
|
6652
|
-
this._stylesAwaiting =
|
|
6645
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
6646
|
+
this._stylesAwaiting = p.then(() => {
|
|
6653
6647
|
this._stylesReady = true;
|
|
6654
6648
|
this.requestUpdate();
|
|
6655
6649
|
});
|
|
@@ -6888,18 +6882,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
|
|
|
6888
6882
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
|
|
6889
6883
|
};
|
|
6890
6884
|
static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
|
|
6891
|
-
childRef = e5();
|
|
6892
|
-
redispatchingEvent = false;
|
|
6893
|
-
interactiveAnnounced = false;
|
|
6894
|
-
currentChild = null;
|
|
6895
|
-
boundConfirmListener = (event) => {
|
|
6896
|
-
this.handleChildConfirm(event);
|
|
6897
|
-
};
|
|
6898
|
-
boundCancelListener = (_event) => {
|
|
6899
|
-
this.handleChildCancel();
|
|
6900
|
-
};
|
|
6901
6885
|
constructor() {
|
|
6902
6886
|
super();
|
|
6887
|
+
this.childRef = e5();
|
|
6888
|
+
this.redispatchingEvent = false;
|
|
6889
|
+
this.interactiveAnnounced = false;
|
|
6890
|
+
this.currentChild = null;
|
|
6891
|
+
this.boundConfirmListener = (event) => {
|
|
6892
|
+
this.handleChildConfirm(event);
|
|
6893
|
+
};
|
|
6894
|
+
this.boundCancelListener = (_event) => {
|
|
6895
|
+
this.handleChildCancel();
|
|
6896
|
+
};
|
|
6903
6897
|
this.variant = DEFAULT_VARIANT;
|
|
6904
6898
|
this.nearAccountId = "";
|
|
6905
6899
|
this.txSigningRequests = undefined;
|
|
@@ -7174,7 +7168,7 @@ function renderCopyStatusIcon() {
|
|
|
7174
7168
|
function settlingState(state, maskedTarget, startedAtMs) {
|
|
7175
7169
|
const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
|
|
7176
7170
|
const targetSlots = Array.from(maskedTarget.slice(prefix.length));
|
|
7177
|
-
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((
|
|
7171
|
+
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
|
|
7178
7172
|
glyph: randomReelGlyph(state.alphabet),
|
|
7179
7173
|
nextChangeAtMs: startedAtMs + index * 37 % 90
|
|
7180
7174
|
}));
|
|
@@ -7300,15 +7294,38 @@ var init_viewer = __esm(() => {
|
|
|
7300
7294
|
errorMessage: { type: String },
|
|
7301
7295
|
showCloseButton: { type: Boolean, attribute: "show-close-button" }
|
|
7302
7296
|
};
|
|
7303
|
-
copiedFields = new Set;
|
|
7304
|
-
copyTimers = new Map;
|
|
7305
|
-
revealStates = new Map;
|
|
7306
|
-
revealAnimationFrame = null;
|
|
7307
|
-
_stylesReady = false;
|
|
7308
|
-
_stylePromises = [];
|
|
7309
|
-
_stylesAwaiting = null;
|
|
7310
7297
|
constructor() {
|
|
7311
7298
|
super();
|
|
7299
|
+
this.copiedFields = new Set;
|
|
7300
|
+
this.copyTimers = new Map;
|
|
7301
|
+
this.revealStates = new Map;
|
|
7302
|
+
this.revealAnimationFrame = null;
|
|
7303
|
+
this._stylesReady = false;
|
|
7304
|
+
this._stylePromises = [];
|
|
7305
|
+
this._stylesAwaiting = null;
|
|
7306
|
+
this.onRevealAnimationFrame = (now) => {
|
|
7307
|
+
this.revealAnimationFrame = null;
|
|
7308
|
+
if (this.ownerDocument?.hidden) {
|
|
7309
|
+
this.scheduleRevealAnimation();
|
|
7310
|
+
return;
|
|
7311
|
+
}
|
|
7312
|
+
let changed = false;
|
|
7313
|
+
for (const [entryKey, state] of this.revealStates) {
|
|
7314
|
+
if (state.kind === "settled")
|
|
7315
|
+
continue;
|
|
7316
|
+
const nextState = advanceRevealState(state, now);
|
|
7317
|
+
if (nextState !== state) {
|
|
7318
|
+
this.revealStates.set(entryKey, nextState);
|
|
7319
|
+
changed = true;
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
if (changed)
|
|
7323
|
+
this.requestUpdate();
|
|
7324
|
+
this.scheduleRevealAnimation();
|
|
7325
|
+
};
|
|
7326
|
+
this._stopDragStart = (e) => {
|
|
7327
|
+
e.stopPropagation();
|
|
7328
|
+
};
|
|
7312
7329
|
this.theme = "dark";
|
|
7313
7330
|
this.variant = "drawer";
|
|
7314
7331
|
this.keys = undefined;
|
|
@@ -7320,27 +7337,27 @@ var init_viewer = __esm(() => {
|
|
|
7320
7337
|
return "export";
|
|
7321
7338
|
}
|
|
7322
7339
|
createRenderRoot() {
|
|
7323
|
-
const
|
|
7324
|
-
const root =
|
|
7340
|
+
const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
|
|
7341
|
+
const root = supportsConstructable ? super.createRenderRoot() : this;
|
|
7325
7342
|
const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
|
|
7326
7343
|
this._stylePromises.push(p1);
|
|
7327
7344
|
p1.catch(() => {});
|
|
7328
7345
|
const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
|
|
7329
7346
|
this._stylePromises.push(pCopyIcon);
|
|
7330
7347
|
pCopyIcon.catch(() => {});
|
|
7331
|
-
const
|
|
7332
|
-
this._stylePromises.push(
|
|
7333
|
-
|
|
7334
|
-
const
|
|
7335
|
-
this._stylePromises.push(
|
|
7336
|
-
|
|
7348
|
+
const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
|
|
7349
|
+
this._stylePromises.push(p2);
|
|
7350
|
+
p2.catch(() => {});
|
|
7351
|
+
const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
|
|
7352
|
+
this._stylePromises.push(p3);
|
|
7353
|
+
p3.catch(() => {});
|
|
7337
7354
|
return root;
|
|
7338
7355
|
}
|
|
7339
7356
|
shouldUpdate(_changed) {
|
|
7340
7357
|
if (this._stylesReady)
|
|
7341
7358
|
return true;
|
|
7342
7359
|
if (!this._stylesAwaiting) {
|
|
7343
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
7360
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
7344
7361
|
this._stylesAwaiting = settle.then(() => {
|
|
7345
7362
|
this._stylesReady = true;
|
|
7346
7363
|
this.requestUpdate();
|
|
@@ -7375,26 +7392,6 @@ var init_viewer = __esm(() => {
|
|
|
7375
7392
|
this.resetRevealStates();
|
|
7376
7393
|
super.disconnectedCallback();
|
|
7377
7394
|
}
|
|
7378
|
-
onRevealAnimationFrame = (now) => {
|
|
7379
|
-
this.revealAnimationFrame = null;
|
|
7380
|
-
if (this.ownerDocument?.hidden) {
|
|
7381
|
-
this.scheduleRevealAnimation();
|
|
7382
|
-
return;
|
|
7383
|
-
}
|
|
7384
|
-
let changed = false;
|
|
7385
|
-
for (const [entryKey, state] of this.revealStates) {
|
|
7386
|
-
if (state.kind === "settled")
|
|
7387
|
-
continue;
|
|
7388
|
-
const nextState = advanceRevealState(state, now);
|
|
7389
|
-
if (nextState !== state) {
|
|
7390
|
-
this.revealStates.set(entryKey, nextState);
|
|
7391
|
-
changed = true;
|
|
7392
|
-
}
|
|
7393
|
-
}
|
|
7394
|
-
if (changed)
|
|
7395
|
-
this.requestUpdate();
|
|
7396
|
-
this.scheduleRevealAnimation();
|
|
7397
|
-
};
|
|
7398
7395
|
scheduleRevealAnimation() {
|
|
7399
7396
|
if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
|
|
7400
7397
|
return;
|
|
@@ -7451,9 +7448,6 @@ var init_viewer = __esm(() => {
|
|
|
7451
7448
|
}
|
|
7452
7449
|
this.scheduleRevealAnimation();
|
|
7453
7450
|
}
|
|
7454
|
-
_stopDragStart = (e6) => {
|
|
7455
|
-
e6.stopPropagation();
|
|
7456
|
-
};
|
|
7457
7451
|
updateTheme() {
|
|
7458
7452
|
try {
|
|
7459
7453
|
const docEl = this.ownerDocument?.documentElement;
|
|
@@ -7501,8 +7495,8 @@ var init_viewer = __esm(() => {
|
|
|
7501
7495
|
}
|
|
7502
7496
|
this.markCopied(index, type);
|
|
7503
7497
|
this.requestUpdate();
|
|
7504
|
-
} catch (
|
|
7505
|
-
console.warn("Copy failed",
|
|
7498
|
+
} catch (e) {
|
|
7499
|
+
console.warn("Copy failed", e);
|
|
7506
7500
|
}
|
|
7507
7501
|
}
|
|
7508
7502
|
copyViaTextareaFallback(text) {
|
|
@@ -7555,9 +7549,9 @@ var init_viewer = __esm(() => {
|
|
|
7555
7549
|
const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
|
|
7556
7550
|
if (!item || typeof item !== "object")
|
|
7557
7551
|
return false;
|
|
7558
|
-
const
|
|
7559
|
-
const
|
|
7560
|
-
return !!
|
|
7552
|
+
const publicKey = String(item.publicKey || "").trim();
|
|
7553
|
+
const privateKey = String(item.privateKey || "").trim();
|
|
7554
|
+
return !!publicKey || !!privateKey;
|
|
7561
7555
|
}) : [];
|
|
7562
7556
|
if (provided.length > 0)
|
|
7563
7557
|
return provided;
|
|
@@ -7700,8 +7694,8 @@ function declarationsToCssText(selector, declarations) {
|
|
|
7700
7694
|
function getDefaultCspNonce() {
|
|
7701
7695
|
if (typeof window === "undefined")
|
|
7702
7696
|
return;
|
|
7703
|
-
const
|
|
7704
|
-
return
|
|
7697
|
+
const w = window;
|
|
7698
|
+
return w.w3aNonce || w.litNonce || undefined;
|
|
7705
7699
|
}
|
|
7706
7700
|
function createCspStylesheetManager(opts) {
|
|
7707
7701
|
const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
|
|
@@ -7720,7 +7714,7 @@ function createCspStylesheetManager(opts) {
|
|
|
7720
7714
|
return;
|
|
7721
7715
|
return typeof nonce === "function" ? nonce() : nonce;
|
|
7722
7716
|
};
|
|
7723
|
-
const
|
|
7717
|
+
const supportsConstructable = () => {
|
|
7724
7718
|
if (state.supportConstructable != null)
|
|
7725
7719
|
return state.supportConstructable;
|
|
7726
7720
|
state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
|
|
@@ -7760,7 +7754,7 @@ function createCspStylesheetManager(opts) {
|
|
|
7760
7754
|
const ensureBase = () => {
|
|
7761
7755
|
if (state.baseSheet || state.baseStyleEl)
|
|
7762
7756
|
return;
|
|
7763
|
-
if (
|
|
7757
|
+
if (supportsConstructable()) {
|
|
7764
7758
|
try {
|
|
7765
7759
|
state.baseSheet = new CSSStyleSheet;
|
|
7766
7760
|
state.baseSheet.replaceSync(baseCss);
|
|
@@ -7778,7 +7772,7 @@ function createCspStylesheetManager(opts) {
|
|
|
7778
7772
|
const buildDynamicCss = () => Array.from(state.rules.values()).join(`
|
|
7779
7773
|
`);
|
|
7780
7774
|
const ensureDynamic = () => {
|
|
7781
|
-
if (
|
|
7775
|
+
if (supportsConstructable()) {
|
|
7782
7776
|
if (!state.dynamicSheet) {
|
|
7783
7777
|
state.dynamicSheet = new CSSStyleSheet;
|
|
7784
7778
|
adoptSheets([state.dynamicSheet]);
|
|
@@ -7793,7 +7787,7 @@ function createCspStylesheetManager(opts) {
|
|
|
7793
7787
|
};
|
|
7794
7788
|
const syncDynamic = () => {
|
|
7795
7789
|
const css = buildDynamicCss();
|
|
7796
|
-
if (
|
|
7790
|
+
if (supportsConstructable()) {
|
|
7797
7791
|
try {
|
|
7798
7792
|
ensureDynamic();
|
|
7799
7793
|
state.dynamicSheet?.replaceSync(css);
|
|
@@ -7812,7 +7806,7 @@ function createCspStylesheetManager(opts) {
|
|
|
7812
7806
|
const existing = state.declarationRules.get(id);
|
|
7813
7807
|
if (existing && existing.selector === selector)
|
|
7814
7808
|
return existing.rule;
|
|
7815
|
-
if (!
|
|
7809
|
+
if (!supportsConstructable())
|
|
7816
7810
|
return null;
|
|
7817
7811
|
try {
|
|
7818
7812
|
if (!state.declarationSheet) {
|
|
@@ -7821,9 +7815,9 @@ function createCspStylesheetManager(opts) {
|
|
|
7821
7815
|
}
|
|
7822
7816
|
const sheet = state.declarationSheet;
|
|
7823
7817
|
if (existing) {
|
|
7824
|
-
const
|
|
7825
|
-
if (
|
|
7826
|
-
sheet.deleteRule(
|
|
7818
|
+
const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
|
|
7819
|
+
if (index >= 0)
|
|
7820
|
+
sheet.deleteRule(index);
|
|
7827
7821
|
state.declarationRules.delete(id);
|
|
7828
7822
|
}
|
|
7829
7823
|
const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
|
|
@@ -7913,8 +7907,8 @@ function createCspStylesheetManager(opts) {
|
|
|
7913
7907
|
// src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
|
|
7914
7908
|
var exports_iframe_host = {};
|
|
7915
7909
|
__export(exports_iframe_host, {
|
|
7916
|
-
|
|
7917
|
-
|
|
7910
|
+
IframeExportHost: () => IframeExportHost,
|
|
7911
|
+
default: () => iframe_host_default
|
|
7918
7912
|
});
|
|
7919
7913
|
function getExportTokenStyleManager() {
|
|
7920
7914
|
if (!exportTokenStyleManager) {
|
|
@@ -7931,9 +7925,9 @@ function toStringRecord(value) {
|
|
|
7931
7925
|
if (!value || typeof value !== "object")
|
|
7932
7926
|
return {};
|
|
7933
7927
|
const out = {};
|
|
7934
|
-
for (const [
|
|
7935
|
-
if (typeof
|
|
7936
|
-
out[
|
|
7928
|
+
for (const [k, v] of Object.entries(value)) {
|
|
7929
|
+
if (typeof v === "string")
|
|
7930
|
+
out[k] = v;
|
|
7937
7931
|
}
|
|
7938
7932
|
return out;
|
|
7939
7933
|
}
|
|
@@ -8015,13 +8009,13 @@ var init_iframe_host = __esm(() => {
|
|
|
8015
8009
|
errorMessage: { type: String },
|
|
8016
8010
|
surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
|
|
8017
8011
|
};
|
|
8018
|
-
drawerEl = null;
|
|
8019
|
-
viewerEl = null;
|
|
8020
|
-
openFrame = null;
|
|
8021
|
-
stylesReady = false;
|
|
8022
|
-
stylePromise = null;
|
|
8023
8012
|
constructor() {
|
|
8024
8013
|
super();
|
|
8014
|
+
this.drawerEl = null;
|
|
8015
|
+
this.viewerEl = null;
|
|
8016
|
+
this.openFrame = null;
|
|
8017
|
+
this.stylesReady = false;
|
|
8018
|
+
this.stylePromise = null;
|
|
8025
8019
|
this.theme = "dark";
|
|
8026
8020
|
this.variant = "drawer";
|
|
8027
8021
|
this.accountId = "";
|
|
@@ -8242,13 +8236,98 @@ var init_viewer2 = __esm(() => {
|
|
|
8242
8236
|
statusMessage: { state: true },
|
|
8243
8237
|
copied: { state: true }
|
|
8244
8238
|
};
|
|
8245
|
-
experience = { kind: "unconfigured" };
|
|
8246
|
-
loadGeneration = 0;
|
|
8247
|
-
copiedResetTimer = null;
|
|
8248
|
-
stylesReady = false;
|
|
8249
|
-
stylePromise = null;
|
|
8250
8239
|
constructor() {
|
|
8251
8240
|
super();
|
|
8241
|
+
this.experience = { kind: "unconfigured" };
|
|
8242
|
+
this.loadGeneration = 0;
|
|
8243
|
+
this.copiedResetTimer = null;
|
|
8244
|
+
this.stylesReady = false;
|
|
8245
|
+
this.stylePromise = null;
|
|
8246
|
+
this.retryStatus = () => {
|
|
8247
|
+
if (this.experience.kind !== "account_menu")
|
|
8248
|
+
return;
|
|
8249
|
+
const generation = this.loadGeneration + 1;
|
|
8250
|
+
this.loadGeneration = generation;
|
|
8251
|
+
const current = this.viewState;
|
|
8252
|
+
if (current.kind !== "summary")
|
|
8253
|
+
return;
|
|
8254
|
+
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
8255
|
+
this.loadSummaryStatus(this.experience, generation);
|
|
8256
|
+
};
|
|
8257
|
+
this.openRecoveryCodes = async () => {
|
|
8258
|
+
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
8259
|
+
return;
|
|
8260
|
+
const generation = this.loadGeneration;
|
|
8261
|
+
const summary = this.viewState;
|
|
8262
|
+
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
8263
|
+
try {
|
|
8264
|
+
const request = await this.experience.loadPendingBackup();
|
|
8265
|
+
if (generation !== this.loadGeneration)
|
|
8266
|
+
return;
|
|
8267
|
+
if (!request) {
|
|
8268
|
+
this.viewState = {
|
|
8269
|
+
...summary,
|
|
8270
|
+
actionError: "Recovery codes are no longer available on this device."
|
|
8271
|
+
};
|
|
8272
|
+
return;
|
|
8273
|
+
}
|
|
8274
|
+
this.viewState = { kind: "recovery_codes", request };
|
|
8275
|
+
await this.updateComplete;
|
|
8276
|
+
await new Promise(requestAnimationFrame);
|
|
8277
|
+
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
8278
|
+
} catch (error) {
|
|
8279
|
+
if (generation !== this.loadGeneration)
|
|
8280
|
+
return;
|
|
8281
|
+
this.viewState = {
|
|
8282
|
+
...summary,
|
|
8283
|
+
actionError: errorMessage(error, "Could not open recovery codes")
|
|
8284
|
+
};
|
|
8285
|
+
}
|
|
8286
|
+
};
|
|
8287
|
+
this.closeSummary = () => {
|
|
8288
|
+
this.dispatchClose({ kind: "dismissed" });
|
|
8289
|
+
};
|
|
8290
|
+
this.download = () => {
|
|
8291
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
8292
|
+
return;
|
|
8293
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
8294
|
+
try {
|
|
8295
|
+
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
8296
|
+
type: "text/plain;charset=utf-8"
|
|
8297
|
+
}));
|
|
8298
|
+
const anchor = document.createElement("a");
|
|
8299
|
+
anchor.href = url;
|
|
8300
|
+
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
8301
|
+
try {
|
|
8302
|
+
anchor.click();
|
|
8303
|
+
} finally {
|
|
8304
|
+
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
8305
|
+
}
|
|
8306
|
+
this.statusMessage = "Recovery codes downloaded.";
|
|
8307
|
+
} catch {
|
|
8308
|
+
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
8309
|
+
}
|
|
8310
|
+
};
|
|
8311
|
+
this.copy = async () => {
|
|
8312
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
8313
|
+
return;
|
|
8314
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
8315
|
+
try {
|
|
8316
|
+
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
8317
|
+
this.statusMessage = "Recovery codes copied.";
|
|
8318
|
+
this.flashCopied();
|
|
8319
|
+
} catch {
|
|
8320
|
+
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
8321
|
+
}
|
|
8322
|
+
};
|
|
8323
|
+
this.onAcknowledgementChange = (event) => {
|
|
8324
|
+
const input = event.target;
|
|
8325
|
+
if (input instanceof HTMLInputElement)
|
|
8326
|
+
this.acknowledged = input.checked;
|
|
8327
|
+
};
|
|
8328
|
+
this.closeRecoveryCodes = () => {
|
|
8329
|
+
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
8330
|
+
};
|
|
8252
8331
|
this.viewState = { kind: "unconfigured" };
|
|
8253
8332
|
this.acknowledged = false;
|
|
8254
8333
|
this.statusMessage = "";
|
|
@@ -8374,50 +8453,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8374
8453
|
assertNever2(this.viewState);
|
|
8375
8454
|
}
|
|
8376
8455
|
}
|
|
8377
|
-
retryStatus = () => {
|
|
8378
|
-
if (this.experience.kind !== "account_menu")
|
|
8379
|
-
return;
|
|
8380
|
-
const generation = this.loadGeneration + 1;
|
|
8381
|
-
this.loadGeneration = generation;
|
|
8382
|
-
const current = this.viewState;
|
|
8383
|
-
if (current.kind !== "summary")
|
|
8384
|
-
return;
|
|
8385
|
-
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
8386
|
-
this.loadSummaryStatus(this.experience, generation);
|
|
8387
|
-
};
|
|
8388
|
-
openRecoveryCodes = async () => {
|
|
8389
|
-
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
8390
|
-
return;
|
|
8391
|
-
const generation = this.loadGeneration;
|
|
8392
|
-
const summary = this.viewState;
|
|
8393
|
-
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
8394
|
-
try {
|
|
8395
|
-
const request = await this.experience.loadPendingBackup();
|
|
8396
|
-
if (generation !== this.loadGeneration)
|
|
8397
|
-
return;
|
|
8398
|
-
if (!request) {
|
|
8399
|
-
this.viewState = {
|
|
8400
|
-
...summary,
|
|
8401
|
-
actionError: "Recovery codes are no longer available on this device."
|
|
8402
|
-
};
|
|
8403
|
-
return;
|
|
8404
|
-
}
|
|
8405
|
-
this.viewState = { kind: "recovery_codes", request };
|
|
8406
|
-
await this.updateComplete;
|
|
8407
|
-
await new Promise(requestAnimationFrame);
|
|
8408
|
-
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
8409
|
-
} catch (error) {
|
|
8410
|
-
if (generation !== this.loadGeneration)
|
|
8411
|
-
return;
|
|
8412
|
-
this.viewState = {
|
|
8413
|
-
...summary,
|
|
8414
|
-
actionError: errorMessage(error, "Could not open recovery codes")
|
|
8415
|
-
};
|
|
8416
|
-
}
|
|
8417
|
-
};
|
|
8418
|
-
closeSummary = () => {
|
|
8419
|
-
this.dispatchClose({ kind: "dismissed" });
|
|
8420
|
-
};
|
|
8421
8456
|
dispatchClose(detail) {
|
|
8422
8457
|
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
|
|
8423
8458
|
detail,
|
|
@@ -8425,39 +8460,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8425
8460
|
composed: true
|
|
8426
8461
|
}));
|
|
8427
8462
|
}
|
|
8428
|
-
download = () => {
|
|
8429
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
8430
|
-
return;
|
|
8431
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
8432
|
-
try {
|
|
8433
|
-
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
8434
|
-
type: "text/plain;charset=utf-8"
|
|
8435
|
-
}));
|
|
8436
|
-
const anchor = document.createElement("a");
|
|
8437
|
-
anchor.href = url;
|
|
8438
|
-
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
8439
|
-
try {
|
|
8440
|
-
anchor.click();
|
|
8441
|
-
} finally {
|
|
8442
|
-
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
8443
|
-
}
|
|
8444
|
-
this.statusMessage = "Recovery codes downloaded.";
|
|
8445
|
-
} catch {
|
|
8446
|
-
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
8447
|
-
}
|
|
8448
|
-
};
|
|
8449
|
-
copy = async () => {
|
|
8450
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
8451
|
-
return;
|
|
8452
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
8453
|
-
try {
|
|
8454
|
-
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
8455
|
-
this.statusMessage = "Recovery codes copied.";
|
|
8456
|
-
this.flashCopied();
|
|
8457
|
-
} catch {
|
|
8458
|
-
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
8459
|
-
}
|
|
8460
|
-
};
|
|
8461
8463
|
flashCopied() {
|
|
8462
8464
|
if (this.copiedResetTimer !== null)
|
|
8463
8465
|
window.clearTimeout(this.copiedResetTimer);
|
|
@@ -8467,14 +8469,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8467
8469
|
this.copied = false;
|
|
8468
8470
|
}, COPIED_FLASH_MS);
|
|
8469
8471
|
}
|
|
8470
|
-
onAcknowledgementChange = (event) => {
|
|
8471
|
-
const input = event.target;
|
|
8472
|
-
if (input instanceof HTMLInputElement)
|
|
8473
|
-
this.acknowledged = input.checked;
|
|
8474
|
-
};
|
|
8475
|
-
closeRecoveryCodes = () => {
|
|
8476
|
-
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
8477
|
-
};
|
|
8478
8472
|
closeLabel(request) {
|
|
8479
8473
|
if (this.acknowledged)
|
|
8480
8474
|
return "Finish backup";
|
|
@@ -8622,8 +8616,8 @@ var init_viewer2 = __esm(() => {
|
|
|
8622
8616
|
// src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
|
|
8623
8617
|
var exports_host = {};
|
|
8624
8618
|
__export(exports_host, {
|
|
8625
|
-
|
|
8626
|
-
|
|
8619
|
+
RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
|
|
8620
|
+
default: () => host_default
|
|
8627
8621
|
});
|
|
8628
8622
|
var RecoveryCodeBackupHost, host_default;
|
|
8629
8623
|
var init_host = __esm(() => {
|
|
@@ -8639,24 +8633,22 @@ var init_host = __esm(() => {
|
|
|
8639
8633
|
experience: { attribute: false },
|
|
8640
8634
|
surface: { type: String }
|
|
8641
8635
|
};
|
|
8642
|
-
dialogEl = null;
|
|
8643
|
-
viewerEl = null;
|
|
8644
|
-
shown = false;
|
|
8645
|
-
dialogShown;
|
|
8646
|
-
resolveDialogShown;
|
|
8647
|
-
handleCancel = (event) => {
|
|
8648
|
-
event.preventDefault();
|
|
8649
|
-
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
8650
|
-
};
|
|
8651
|
-
handleStageChange = (event) => {
|
|
8652
|
-
const dialog = event.currentTarget;
|
|
8653
|
-
if (!(dialog instanceof HTMLDialogElement))
|
|
8654
|
-
return;
|
|
8655
|
-
const detail = event.detail;
|
|
8656
|
-
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
8657
|
-
};
|
|
8658
8636
|
constructor() {
|
|
8659
8637
|
super();
|
|
8638
|
+
this.dialogEl = null;
|
|
8639
|
+
this.viewerEl = null;
|
|
8640
|
+
this.shown = false;
|
|
8641
|
+
this.handleCancel = (event) => {
|
|
8642
|
+
event.preventDefault();
|
|
8643
|
+
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
8644
|
+
};
|
|
8645
|
+
this.handleStageChange = (event) => {
|
|
8646
|
+
const dialog = event.currentTarget;
|
|
8647
|
+
if (!(dialog instanceof HTMLDialogElement))
|
|
8648
|
+
return;
|
|
8649
|
+
const detail = event.detail;
|
|
8650
|
+
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
8651
|
+
};
|
|
8660
8652
|
this.experience = { kind: "unconfigured" };
|
|
8661
8653
|
this.surface = "standalone";
|
|
8662
8654
|
this.dialogShown = new Promise((resolve) => {
|
|
@@ -8753,6 +8745,26 @@ var init_HaloBorder = __esm(() => {
|
|
|
8753
8745
|
init_css_loader();
|
|
8754
8746
|
init_registry();
|
|
8755
8747
|
HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
|
|
8748
|
+
constructor() {
|
|
8749
|
+
super(...arguments);
|
|
8750
|
+
this._stylesReady = false;
|
|
8751
|
+
this._stylePromises = [];
|
|
8752
|
+
this._stylesAwaiting = null;
|
|
8753
|
+
this._rafId = null;
|
|
8754
|
+
this._startTs = 0;
|
|
8755
|
+
this._running = false;
|
|
8756
|
+
this.tick = (ts) => {
|
|
8757
|
+
if (!this._running)
|
|
8758
|
+
return;
|
|
8759
|
+
if (!this._startTs)
|
|
8760
|
+
this._startTs = ts;
|
|
8761
|
+
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
8762
|
+
const delta = (ts - this._startTs) % dur;
|
|
8763
|
+
const angle = delta / dur * 360;
|
|
8764
|
+
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
8765
|
+
this._rafId = requestAnimationFrame(this.tick);
|
|
8766
|
+
};
|
|
8767
|
+
}
|
|
8756
8768
|
static properties = {
|
|
8757
8769
|
animated: { type: Boolean },
|
|
8758
8770
|
theme: { type: String },
|
|
@@ -8767,15 +8779,12 @@ var init_HaloBorder = __esm(() => {
|
|
|
8767
8779
|
innerPadding: { type: String, attribute: "inner-padding" },
|
|
8768
8780
|
innerBackground: { type: String, attribute: "inner-background" }
|
|
8769
8781
|
};
|
|
8770
|
-
_stylesReady = false;
|
|
8771
|
-
_stylePromises = [];
|
|
8772
|
-
_stylesAwaiting = null;
|
|
8773
8782
|
static _STYLE_MARKER = "data-w3a-halo-border-css";
|
|
8774
8783
|
createRenderRoot() {
|
|
8775
8784
|
const root = super.createRenderRoot();
|
|
8776
|
-
const
|
|
8777
|
-
this._stylePromises.push(
|
|
8778
|
-
|
|
8785
|
+
const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
|
|
8786
|
+
this._stylePromises.push(p);
|
|
8787
|
+
p.catch(() => {});
|
|
8779
8788
|
return root;
|
|
8780
8789
|
}
|
|
8781
8790
|
shouldUpdate(_changed) {
|
|
@@ -8786,7 +8795,7 @@ var init_HaloBorder = __esm(() => {
|
|
|
8786
8795
|
return true;
|
|
8787
8796
|
}
|
|
8788
8797
|
if (!this._stylesAwaiting) {
|
|
8789
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
8798
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
8790
8799
|
this._stylesAwaiting = settle.then(() => {
|
|
8791
8800
|
this._stylesReady = true;
|
|
8792
8801
|
this.requestUpdate();
|
|
@@ -8804,9 +8813,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
8804
8813
|
const statefulLink = link;
|
|
8805
8814
|
return !!(statefulLink._w3aLoaded || link.sheet);
|
|
8806
8815
|
}
|
|
8807
|
-
_rafId = null;
|
|
8808
|
-
_startTs = 0;
|
|
8809
|
-
_running = false;
|
|
8810
8816
|
connectedCallback() {
|
|
8811
8817
|
super.connectedCallback();
|
|
8812
8818
|
this.applyCssVars();
|
|
@@ -8846,17 +8852,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
8846
8852
|
this.stop();
|
|
8847
8853
|
super.disconnectedCallback();
|
|
8848
8854
|
}
|
|
8849
|
-
tick = (ts) => {
|
|
8850
|
-
if (!this._running)
|
|
8851
|
-
return;
|
|
8852
|
-
if (!this._startTs)
|
|
8853
|
-
this._startTs = ts;
|
|
8854
|
-
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
8855
|
-
const delta = (ts - this._startTs) % dur;
|
|
8856
|
-
const angle = delta / dur * 360;
|
|
8857
|
-
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
8858
|
-
this._rafId = requestAnimationFrame(this.tick);
|
|
8859
|
-
};
|
|
8860
8855
|
start() {
|
|
8861
8856
|
if (this._running)
|
|
8862
8857
|
return;
|
|
@@ -8893,6 +8888,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
8893
8888
|
init_HaloBorder();
|
|
8894
8889
|
|
|
8895
8890
|
export {
|
|
8896
|
-
|
|
8897
|
-
|
|
8891
|
+
HaloBorderElement,
|
|
8892
|
+
HaloBorder_default as default
|
|
8898
8893
|
};
|